@mappedin/react-sdk 6.0.1-beta.45 → 6.0.1-beta.47

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 (35) hide show
  1. package/THIRD_PARTY_LICENSES.txt +2169 -27784
  2. package/lib/esm/{GLTFExporter-64BG5G32.js → GLTFExporter-7OZO7OAN.js} +1 -1
  3. package/lib/esm/GLTFLoader-BTM3ARCC.js +1 -0
  4. package/lib/esm/{browser-4WZEG5RQ.js → browser-RWOI5BLY.js} +1 -1
  5. package/lib/esm/chunk-3DLWMSMA.js +1 -0
  6. package/lib/esm/{chunk-OFX4UKYI.js → chunk-7WCA75NG.js} +1 -1
  7. package/lib/esm/chunk-MH6J7HN7.js +1 -0
  8. package/lib/esm/chunk-NS37OT4J.js +1 -0
  9. package/lib/esm/chunk-OEBM7FFM.js +1 -0
  10. package/lib/esm/chunk-PEDEW3M6.js +1 -0
  11. package/lib/esm/chunk-SB6JFH4C.js +1 -0
  12. package/lib/esm/index.css +1 -1
  13. package/lib/esm/index.d.ts +319 -128
  14. package/lib/esm/index.js +1 -1
  15. package/lib/esm/inspector-WRNBK432.js +1 -0
  16. package/lib/esm/inspector-WWR77OPX.css +1 -0
  17. package/lib/esm/internal-KFN6TGNE.js +1 -0
  18. package/lib/esm/internal-M7DPGYMI.css +1 -0
  19. package/lib/esm/outdoor-context-v4-T22T5B5J.js +1 -0
  20. package/lib/esm/{roboto-regular-E5TUWU5Q.js → roboto-regular-3HSVPIGX.js} +1 -1
  21. package/lib/esm/text3d-LSJE37UM.js +1 -0
  22. package/package.json +6 -6
  23. package/lib/esm/GLTFLoader-ELXGWZD3.js +0 -1
  24. package/lib/esm/chunk-BYMKRV3A.js +0 -1
  25. package/lib/esm/chunk-FAMEMKII.js +0 -1
  26. package/lib/esm/chunk-FSBH4P52.js +0 -1
  27. package/lib/esm/chunk-GVHB2OJC.js +0 -1
  28. package/lib/esm/chunk-LQS3FVBN.js +0 -1
  29. package/lib/esm/chunk-VVO7QO3Y.js +0 -1
  30. package/lib/esm/inspector-GOK26VAV.css +0 -1
  31. package/lib/esm/inspector-I2YHDXM6.js +0 -1
  32. package/lib/esm/internal-7A3UJNAV.css +0 -1
  33. package/lib/esm/internal-7LLUWCE5.js +0 -1
  34. package/lib/esm/outdoor-context-v4-XU2K4KTH.js +0 -1
  35. package/lib/esm/text3d-OPI6K2SH.js +0 -1
@@ -0,0 +1 @@
1
+ import{$ as yd,A as I9,B as S9,C as Th,D as oo,E as C9,F as GI,G as gs,H as T9,I as hd,J as P9,K as bs,L as jb,M as yr,N as UI,O as Sn,P as w9,Q as ip,R as Pi,S as Ot,T as at,U as Ph,V as VI,W as Gb,X as zI,Y as _9,Z as wh,_ as k9,a as U6,aa as gd,b as V6,ba as A9,c as z6,ca as Po,d as z,da as D9,e as LI,ea as F9,f as Rb,fa as HI,g as h9,ga as Ub,h as md,ha as Vb,i as Nb,ia as L9,j as y9,ja as R9,k as Bb,ka as N9,l as rp,la as zb,m as hs,ma as B9,n as g9,na as $9,o as b9,oa as j9,p as $I,pa as G9,q as At,qa as jo,r as Be,ra as WI,s as np,sa as U9,t as jI,ta as V9,u as ys,ua as sp,v as $b,va as Mh,w as Ia,wa as bd,x as op,xa as Hb,y as x9,ya as xd,z as v9,za as vd}from"./chunk-NS37OT4J.js";import{a as ZW,ca as E9,k as M9,v as O9}from"./chunk-OEBM7FFM.js";import{a as Go}from"./chunk-7WCA75NG.js";import{$ as We,A as X6,Aa as Db,B as _b,Ba as BI,C as kb,Ca as ds,D as Y6,Da as fs,E as K6,Ea as Ci,Fa as Fb,G as J6,Ga as l9,H as et,Ha as c9,I as De,Ja as Ti,M as Q6,N as e9,O as t9,P as Ch,Q as Me,R as Jr,S as r9,T as Ii,Ta as fd,U as ba,V as xa,W as Rt,Xa as Lb,Y as $r,Ya as p9,Z as va,_ as n9,aa as Si,ab as u9,b as Mb,c as Ob,ca as Bl,cb as ms,d as H6,da as o9,db as d9,e as ya,ea as RI,eb as f9,f as W6,g as us,ga as $l,gb as m9,la as i9,oa as jl,p as q6,pa as s9,q as Z6,qa as Ab,r as Eb,ra as NI,ta as dd,ya as a9,z as ga,za as Gl}from"./chunk-MH6J7HN7.js";import{a as f,b as v}from"./chunk-3DLWMSMA.js";import{a as P,b as R,c as s,d as wb,e as $n,g as ue,h as cs,i as ps,j as m,k as p,l as E,m as A,n as te,o as k,p as G6,q as ie}from"./chunk-PEDEW3M6.js";var Jh=ue(Et=>{"use strict";f();Object.defineProperty(Et,"__esModule",{value:!0});Et.regexpCode=Et.getEsmExportName=Et.getProperty=Et.safeStringify=Et.stringify=Et.strConcat=Et.addCodeArg=Et.str=Et._=Et.nil=Et._Code=Et.Name=Et.IDENTIFIER=Et._CodeOrName=void 0;var TS=class TS{};s(TS,"_CodeOrName");var Yh=TS;Et._CodeOrName=Yh;Et.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var PS=class PS extends Yh{constructor(t){if(super(),!Et.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};s(PS,"Name");var Cp=PS;Et.Name=Cp;var wS=class wS extends Yh{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Cp&&(r[n.str]=(r[n.str]||0)+1),r),{})}};s(wS,"_Code");var qo=wS;Et._Code=qo;Et.nil=new qo("");function pO(e,...t){let r=[e[0]],n=0;for(;n<t.length;)CS(r,t[n]),r.push(e[++n]);return new qo(r)}s(pO,"_");Et._=pO;var SS=new qo("+");function uO(e,...t){let r=[Kh(e[0])],n=0;for(;n<t.length;)r.push(SS),CS(r,t[n]),r.push(SS,Kh(e[++n]));return vq(r),new qo(r)}s(uO,"str");Et.str=uO;function CS(e,t){t instanceof qo?e.push(...t._items):t instanceof Cp?e.push(t):e.push(Cq(t))}s(CS,"addCodeArg");Et.addCodeArg=CS;function vq(e){let t=1;for(;t<e.length-1;){if(e[t]===SS){let r=Iq(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}s(vq,"optimize");function Iq(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Cp||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Cp))return'"'.concat(e).concat(t.slice(1))}s(Iq,"mergeExprItems");var lO;function Sq(e,t){return t.emptyStr()?e:e.emptyStr()?t:uO(lO||(lO=k(["","",""])),e,t)}s(Sq,"strConcat");Et.strConcat=Sq;function Cq(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Kh(Array.isArray(e)?e.join(","):e)}s(Cq,"interpolate");function Tq(e){return new qo(Kh(e))}s(Tq,"stringify");Et.stringify=Tq;function Kh(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}s(Kh,"safeStringify");Et.safeStringify=Kh;var cO;function Pq(e){return typeof e=="string"&&Et.IDENTIFIER.test(e)?new qo(".".concat(e)):pO(cO||(cO=k(["[","]"])),e)}s(Pq,"getProperty");Et.getProperty=Pq;function wq(e){if(typeof e=="string"&&Et.IDENTIFIER.test(e))return new qo("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}s(wq,"getEsmExportName");Et.getEsmExportName=wq;function Mq(e){return new qo(e.toString())}s(Mq,"regexpCode");Et.regexpCode=Mq});var DS=ue(lo=>{"use strict";f();Object.defineProperty(lo,"__esModule",{value:!0});lo.ValueScope=lo.ValueScopeName=lo.Scope=lo.varKinds=lo.UsedValueState=void 0;var ao=Jh(),ES=class ES extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};s(ES,"ValueError");var MS=ES,Xb;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Xb||(lo.UsedValueState=Xb={}));lo.varKinds={const:new ao.Name("const"),let:new ao.Name("let"),var:new ao.Name("var")};var _S=class _S{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof ao.Name?t:this.name(t)}name(t){return new ao.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};s(_S,"Scope");var Yb=_S;lo.Scope=Yb;var dO,kS=class kS extends ao.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,ao._)(dO||(dO=k([".","[","]"])),new ao.Name(r),n)}};s(kS,"ValueScopeName");var Kb=kS;lo.ValueScopeName=Kb;var fO,Oq=(0,ao._)(fO||(fO=k(["\n"],["\\n"]))),mO,hO,yO,AS=class AS extends Yb{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=R(P({},t),{_n:t.lines?Oq:ao.nil})}get(){return this._scope}name(t){return new Kb(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[i];if(l){let d=l.get(a);if(d)return d}else l=this._values[i]=new Map;l.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,ao._)(mO||(mO=k(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error('CodeGen: name "'.concat(o,'" has no value'));return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=ao.nil;for(let a in t){let l=t[a];if(!l)continue;let c=n[a]=n[a]||new Map;l.forEach(u=>{if(c.has(u))return;c.set(u,Xb.Started);let d=r(u);if(d){let h=this.opts.es5?lo.varKinds.var:lo.varKinds.const;i=(0,ao._)(hO||(hO=k(["",""," "," = ",";",""])),i,h,u,d,this.opts._n)}else if(d=o==null?void 0:o(u))i=(0,ao._)(yO||(yO=k(["","","",""])),i,d,this.opts._n);else throw new MS(u);c.set(u,Xb.Completed)})}return i}};s(AS,"ValueScope");var OS=AS;lo.ValueScope=OS});var Je=ue(tt=>{"use strict";f();Object.defineProperty(tt,"__esModule",{value:!0});tt.or=tt.and=tt.not=tt.CodeGen=tt.operators=tt.varKinds=tt.ValueScopeName=tt.ValueScope=tt.Scope=tt.Name=tt.regexpCode=tt.stringify=tt.getProperty=tt.nil=tt.strConcat=tt.str=tt._=void 0;var ft=Jh(),Ai=DS(),ec=Jh();Object.defineProperty(tt,"_",{enumerable:!0,get:s(function(){return ec._},"get")});Object.defineProperty(tt,"str",{enumerable:!0,get:s(function(){return ec.str},"get")});Object.defineProperty(tt,"strConcat",{enumerable:!0,get:s(function(){return ec.strConcat},"get")});Object.defineProperty(tt,"nil",{enumerable:!0,get:s(function(){return ec.nil},"get")});Object.defineProperty(tt,"getProperty",{enumerable:!0,get:s(function(){return ec.getProperty},"get")});Object.defineProperty(tt,"stringify",{enumerable:!0,get:s(function(){return ec.stringify},"get")});Object.defineProperty(tt,"regexpCode",{enumerable:!0,get:s(function(){return ec.regexpCode},"get")});Object.defineProperty(tt,"Name",{enumerable:!0,get:s(function(){return ec.Name},"get")});var t0=DS();Object.defineProperty(tt,"Scope",{enumerable:!0,get:s(function(){return t0.Scope},"get")});Object.defineProperty(tt,"ValueScope",{enumerable:!0,get:s(function(){return t0.ValueScope},"get")});Object.defineProperty(tt,"ValueScopeName",{enumerable:!0,get:s(function(){return t0.ValueScopeName},"get")});Object.defineProperty(tt,"varKinds",{enumerable:!0,get:s(function(){return t0.varKinds},"get")});tt.operators={GT:new ft._Code(">"),GTE:new ft._Code(">="),LT:new ft._Code("<"),LTE:new ft._Code("<="),EQ:new ft._Code("==="),NEQ:new ft._Code("!=="),NOT:new ft._Code("!"),OR:new ft._Code("||"),AND:new ft._Code("&&"),ADD:new ft._Code("+")};var WS=class WS{optimizeNodes(){return this}optimizeNames(t,r){return this}};s(WS,"Node");var Da=WS,qS=class qS extends Da{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ai.varKinds.var:this.varKind,o=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(o,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Zd(this.rhs,t,r)),this}get names(){return this.rhs instanceof ft._CodeOrName?this.rhs.names:{}}};s(qS,"Def");var FS=qS,ZS=class ZS extends Da{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof ft.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Zd(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ft.Name?{}:P({},this.lhs.names);return e0(t,this.rhs)}};s(ZS,"Assign");var Jb=ZS,XS=class XS extends Jb{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}};s(XS,"AssignOp");var LS=XS,YS=class YS extends Da{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};s(YS,"Label");var RS=YS,KS=class KS extends Da{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};s(KS,"Break");var NS=KS,JS=class JS extends Da{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};s(JS,"Throw");var BS=JS,QS=class QS extends Da{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=Zd(this.code,t,r),this}get names(){return this.code instanceof ft._CodeOrName?this.code.names:{}}};s(QS,"AnyCode");var $S=QS,e3=class e3 extends Da{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(Eq(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>wp(t,r.names),{})}};s(e3,"ParentNode");var Qh=e3,t3=class t3 extends Qh{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};s(t3,"BlockNode");var Fa=t3,r3=class r3 extends Qh{};s(r3,"Root");var jS=r3,n3=class n3 extends Fa{};s(n3,"Else");var qd=n3;qd.kind="else";var Wd=class Wd extends Fa{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new qd(n):n}if(r)return t===!1?r instanceof Wd?r:r.nodes:this.nodes.length?this:new Wd(CO(t),r instanceof Wd?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Zd(this.condition,t,r),this}get names(){let t=super.names;return e0(t,this.condition),this.else&&wp(t,this.else.names),t}};s(Wd,"If");var Tp=Wd;Tp.kind="if";var o3=class o3 extends Fa{};s(o3,"For");var Pp=o3;Pp.kind="for";var i3=class i3 extends Pp{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Zd(this.iteration,t,r),this}get names(){return wp(super.names,this.iteration.names)}};s(i3,"ForLoop");var GS=i3,s3=class s3 extends Pp{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ai.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return"for(".concat(r," ").concat(n,"=").concat(o,"; ").concat(n,"<").concat(i,"; ").concat(n,"++)")+super.render(t)}get names(){let t=e0(super.names,this.from);return e0(t,this.to)}};s(s3,"ForRange");var US=s3,a3=class a3 extends Pp{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Zd(this.iterable,t,r),this}get names(){return wp(super.names,this.iterable.names)}};s(a3,"ForIter");var Qb=a3,l3=class l3 extends Fa{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};s(l3,"Func");var ey=l3;ey.kind="func";var c3=class c3 extends Qh{render(t){return"return "+super.render(t)}};s(c3,"Return");var ty=c3;ty.kind="return";var p3=class p3 extends Fa{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&wp(t,this.catch.names),this.finally&&wp(t,this.finally.names),t}};s(p3,"Try");var VS=p3,u3=class u3 extends Fa{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};s(u3,"Catch");var ry=u3;ry.kind="catch";var d3=class d3 extends Fa{render(t){return"finally"+super.render(t)}};s(d3,"Finally");var ny=d3;ny.kind="finally";var gO,bO,xO,f3=class f3{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=R(P({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new Ai.Scope({parent:t}),this._nodes=[new jS]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new FS(t,i,n)),i}const(t,r,n){return this._def(Ai.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ai.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ai.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Jb(t,r,n))}add(t,r){return this._leafNode(new LS(t,tt.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ft.nil&&this._leafNode(new $S(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ft.addCodeArg)(r,o));return r.push("}"),new ft._Code(r)}if(t,r,n){if(this._blockNode(new Tp(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Tp(t))}else(){return this._elseNode(new qd)}endIf(){return this._endBlockNode(Tp,qd)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new GS(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ai.varKinds.var:Ai.varKinds.let){let a=this._scope.toName(t);return this._for(new US(i,a,r,n),()=>o(a))}forOf(t,r,n,o=Ai.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let a=r instanceof ft.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ft._)(gO||(gO=k(["",".length"])),a),l=>{this.var(i,(0,ft._)(bO||(bO=k(["","[","]"])),a,l)),n(i)})}return this._for(new Qb("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ai.varKinds.var:Ai.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ft._)(xO||(xO=k(["Object.keys(",")"])),r),n);let i=this._scope.toName(t);return this._for(new Qb("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Pp)}label(t){return this._leafNode(new RS(t))}break(t){return this._leafNode(new NS(t))}return(t){let r=new ty;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ty)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new VS;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new ry(i),r(i)}return n&&(this._currNode=o.finally=new ny,this.code(n)),this._endBlockNode(ry,ny)}throw(t){return this._leafNode(new BS(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=ft.nil,n,o){return this._blockNode(new ey(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ey)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof Tp))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};s(f3,"CodeGen");var zS=f3;tt.CodeGen=zS;function wp(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}s(wp,"addNames");function e0(e,t){return t instanceof ft._CodeOrName?wp(e,t.names):e}s(e0,"addExprNames");function Zd(e,t,r){if(e instanceof ft.Name)return n(e);if(!o(e))return e;return new ft._Code(e._items.reduce((i,a)=>(a instanceof ft.Name&&(a=n(a)),a instanceof ft._Code?i.push(...a._items):i.push(a),i),[]));function n(i){let a=r[i.str];return a===void 0||t[i.str]!==1?i:(delete t[i.str],a)}function o(i){return i instanceof ft._Code&&i._items.some(a=>a instanceof ft.Name&&t[a.str]===1&&r[a.str]!==void 0)}}s(Zd,"optimizeExpr");function Eq(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}s(Eq,"subtractNames");var vO;function CO(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ft._)(vO||(vO=k(["!",""])),HS(e))}s(CO,"not");tt.not=CO;var _q=TO(tt.operators.AND);function kq(...e){return e.reduce(_q)}s(kq,"and");tt.and=kq;var Aq=TO(tt.operators.OR);function Dq(...e){return e.reduce(Aq)}s(Dq,"or");tt.or=Dq;var IO;function TO(e){return(t,r)=>t===ft.nil?r:r===ft.nil?t:(0,ft._)(IO||(IO=k([""," "," ",""])),HS(t),e,HS(r))}s(TO,"mappend");var SO;function HS(e){return e instanceof ft.Name?e:(0,ft._)(SO||(SO=k(["(",")"])),e)}s(HS,"par")});var _t=ue(ot=>{"use strict";f();Object.defineProperty(ot,"__esModule",{value:!0});ot.checkStrictMode=ot.getErrorPath=ot.Type=ot.useFunc=ot.setEvaluated=ot.evaluatedPropsToName=ot.mergeEvaluated=ot.eachItem=ot.unescapeJsonPointer=ot.escapeJsonPointer=ot.escapeFragment=ot.unescapeFragment=ot.schemaRefOrVal=ot.schemaHasRulesButRef=ot.schemaHasRules=ot.checkUnknownRules=ot.alwaysValidSchema=ot.toHash=void 0;var qt=Je(),Fq=Jh();function Lq(e){let t={};for(let r of e)t[r]=!0;return t}s(Lq,"toHash");ot.toHash=Lq;function Rq(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(HO(e,t),!WO(t,e.self.RULES.all))}s(Rq,"alwaysValidSchema");ot.alwaysValidSchema=Rq;function HO(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||XO(e,'unknown keyword: "'.concat(i,'"'))}s(HO,"checkUnknownRules");ot.checkUnknownRules=HO;function WO(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}s(WO,"schemaHasRules");ot.schemaHasRules=WO;function Nq(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}s(Nq,"schemaHasRulesButRef");ot.schemaHasRulesButRef=Nq;var MO,OO;function Bq({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,qt._)(MO||(MO=k(["",""])),r)}return(0,qt._)(OO||(OO=k(["","","",""])),e,t,(0,qt.getProperty)(n))}s(Bq,"schemaRefOrVal");ot.schemaRefOrVal=Bq;function $q(e){return qO(decodeURIComponent(e))}s($q,"unescapeFragment");ot.unescapeFragment=$q;function jq(e){return encodeURIComponent(h3(e))}s(jq,"escapeFragment");ot.escapeFragment=jq;function h3(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}s(h3,"escapeJsonPointer");ot.escapeJsonPointer=h3;function qO(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}s(qO,"unescapeJsonPointer");ot.unescapeJsonPointer=qO;function Gq(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}s(Gq,"eachItem");ot.eachItem=Gq;function PO({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,a,l)=>{let c=a===void 0?i:a instanceof qt.Name?(i instanceof qt.Name?e(o,i,a):t(o,i,a),a):i instanceof qt.Name?(t(o,a,i),i):r(i,a);return l===qt.Name&&!(c instanceof qt.Name)?n(o,c):c}}s(PO,"makeMergeEvaluated");var EO,_O,kO,AO,DO,FO,LO,RO,NO,BO;ot.mergeEvaluated={props:PO({mergeNames:s((e,t,r)=>e.if((0,qt._)(EO||(EO=k([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,qt._)(_O||(_O=k([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,qt._)(kO||(kO=k([""," || {}"])),r)).code((0,qt._)(AO||(AO=k(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:s((e,t,r)=>e.if((0,qt._)(DO||(DO=k([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,qt._)(FO||(FO=k([""," || {}"])),r)),y3(e,r,t))}),"mergeToName"),mergeValues:s((e,t)=>e===!0?!0:P(P({},e),t),"mergeValues"),resultToName:ZO}),items:PO({mergeNames:s((e,t,r)=>e.if((0,qt._)(LO||(LO=k([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,qt._)(RO||(RO=k([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:s((e,t,r)=>e.if((0,qt._)(NO||(NO=k([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,qt._)(BO||(BO=k([""," > "," ? "," : ",""])),r,t,r,t))),"mergeToName"),mergeValues:s((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:s((e,t)=>e.var("items",t),"resultToName")})};var $O;function ZO(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,qt._)($O||($O=k(["{}"]))));return t!==void 0&&y3(e,r,t),r}s(ZO,"evaluatedPropsToName");ot.evaluatedPropsToName=ZO;var jO;function y3(e,t,r){Object.keys(r).forEach(n=>e.assign((0,qt._)(jO||(jO=k(["","",""])),t,(0,qt.getProperty)(n)),!0))}s(y3,"setEvaluated");ot.setEvaluated=y3;var wO={};function Uq(e,t){return e.scopeValue("func",{ref:t,code:wO[t.code]||(wO[t.code]=new Fq._Code(t.code))})}s(Uq,"useFunc");ot.useFunc=Uq;var m3;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(m3||(ot.Type=m3={}));var GO,UO,VO,zO;function Vq(e,t,r){if(e instanceof qt.Name){let n=t===m3.Num;return r?n?(0,qt._)(GO||(GO=k(['"[" + ',' + "]"'])),e):(0,qt._)(UO||(UO=k(['"[\'" + ',' + "\']"'])),e):n?(0,qt._)(VO||(VO=k(['"/" + ',""])),e):(0,qt._)(zO||(zO=k(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,qt.getProperty)(e).toString():"/"+h3(e)}s(Vq,"getErrorPath");ot.getErrorPath=Vq;function XO(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}s(XO,"checkStrictMode");ot.checkStrictMode=XO});var La=ue(g3=>{"use strict";f();Object.defineProperty(g3,"__esModule",{value:!0});var Cn=Je(),zq={data:new Cn.Name("data"),valCxt:new Cn.Name("valCxt"),instancePath:new Cn.Name("instancePath"),parentData:new Cn.Name("parentData"),parentDataProperty:new Cn.Name("parentDataProperty"),rootData:new Cn.Name("rootData"),dynamicAnchors:new Cn.Name("dynamicAnchors"),vErrors:new Cn.Name("vErrors"),errors:new Cn.Name("errors"),this:new Cn.Name("this"),self:new Cn.Name("self"),scope:new Cn.Name("scope"),json:new Cn.Name("json"),jsonPos:new Cn.Name("jsonPos"),jsonLen:new Cn.Name("jsonLen"),jsonPart:new Cn.Name("jsonPart")};g3.default=zq});var oy=ue(Tn=>{"use strict";f();Object.defineProperty(Tn,"__esModule",{value:!0});Tn.extendErrors=Tn.resetErrorsCount=Tn.reportExtraError=Tn.reportError=Tn.keyword$DataError=Tn.keywordError=void 0;var vt=Je(),r0=_t(),Vn=La(),YO;Tn.keywordError={message:s(({keyword:e})=>(0,vt.str)(YO||(YO=k(['must pass "','" keyword validation'])),e),"message")};var KO,JO;Tn.keyword$DataError={message:s(({keyword:e,schemaType:t})=>t?(0,vt.str)(KO||(KO=k(['"','" keyword must be '," ($data)"])),e,t):(0,vt.str)(JO||(JO=k(['"','" keyword is invalid ($data)'])),e),"message")};var QO;function Hq(e,t=Tn.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:a,allErrors:l}=o,c=CE(e,t,r);(n!=null?n:a||l)?IE(i,c):SE(o,(0,vt._)(QO||(QO=k(["[","]"])),c))}s(Hq,"reportError");Tn.reportError=Hq;function Wq(e,t=Tn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:a}=n,l=CE(e,t,r);IE(o,l),i||a||SE(n,Vn.default.vErrors)}s(Wq,"reportExtraError");Tn.reportExtraError=Wq;var eE,tE;function qq(e,t){e.assign(Vn.default.errors,t),e.if((0,vt._)(eE||(eE=k([""," !== null"])),Vn.default.vErrors),()=>e.if(t,()=>e.assign((0,vt._)(tE||(tE=k(["",".length"])),Vn.default.vErrors),t),()=>e.assign(Vn.default.vErrors,null)))}s(qq,"resetErrorsCount");Tn.resetErrorsCount=qq;var rE,nE,oE,iE,sE,aE,lE;function Zq({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",o,Vn.default.errors,l=>{e.const(a,(0,vt._)(rE||(rE=k(["","[","]"])),Vn.default.vErrors,l)),e.if((0,vt._)(nE||(nE=k(["",".instancePath === undefined"])),a),()=>e.assign((0,vt._)(oE||(oE=k(["",".instancePath"])),a),(0,vt.strConcat)(Vn.default.instancePath,i.errorPath))),e.assign((0,vt._)(iE||(iE=k(["",".schemaPath"])),a),(0,vt.str)(sE||(sE=k(["","/",""])),i.errSchemaPath,t)),i.opts.verbose&&(e.assign((0,vt._)(aE||(aE=k(["",".schema"])),a),r),e.assign((0,vt._)(lE||(lE=k(["",".data"])),a),n))})}s(Zq,"extendErrors");Tn.extendErrors=Zq;var cE,pE,uE,dE;function IE(e,t){let r=e.const("err",t);e.if((0,vt._)(cE||(cE=k([""," === null"])),Vn.default.vErrors),()=>e.assign(Vn.default.vErrors,(0,vt._)(pE||(pE=k(["[","]"])),r)),(0,vt._)(uE||(uE=k(["",".push(",")"])),Vn.default.vErrors,r)),e.code((0,vt._)(dE||(dE=k(["","++"])),Vn.default.errors))}s(IE,"addError");var fE,mE;function SE(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,vt._)(fE||(fE=k(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,vt._)(mE||(mE=k(["",".errors"])),n),t),r.return(!1))}s(SE,"returnErrors");var Mp={keyword:new vt.Name("keyword"),schemaPath:new vt.Name("schemaPath"),params:new vt.Name("params"),propertyName:new vt.Name("propertyName"),message:new vt.Name("message"),schema:new vt.Name("schema"),parentSchema:new vt.Name("parentSchema")},hE;function CE(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,vt._)(hE||(hE=k(["{}"]))):Xq(e,t,r)}s(CE,"errorObjectCode");function Xq(e,t,r={}){let{gen:n,it:o}=e,i=[Yq(o,r),Kq(e,r)];return Jq(e,t,i),n.object(...i)}s(Xq,"errorObject");var yE;function Yq({errorPath:e},{instancePath:t}){let r=t?(0,vt.str)(yE||(yE=k(["","",""])),e,(0,r0.getErrorPath)(t,r0.Type.Str)):e;return[Vn.default.instancePath,(0,vt.strConcat)(Vn.default.instancePath,r)]}s(Yq,"errorInstancePath");var gE,bE;function Kq({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,vt.str)(gE||(gE=k(["","/",""])),t,e);return r&&(o=(0,vt.str)(bE||(bE=k(["","",""])),o,(0,r0.getErrorPath)(r,r0.Type.Str))),[Mp.schemaPath,o]}s(Kq,"errorSchemaPath");var xE,vE;function Jq(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:a,it:l}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:h}=l;n.push([Mp.keyword,o],[Mp.params,typeof t=="function"?t(e):t||(0,vt._)(xE||(xE=k(["{}"])))]),c.messages&&n.push([Mp.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Mp.schema,a],[Mp.parentSchema,(0,vt._)(vE||(vE=k(["","",""])),d,h)],[Vn.default.data,i]),u&&n.push([Mp.propertyName,u])}s(Jq,"extraErrorProps")});var wE=ue(Xd=>{"use strict";f();Object.defineProperty(Xd,"__esModule",{value:!0});Xd.boolOrEmptySchema=Xd.topBoolOrEmptySchema=void 0;var Qq=oy(),eZ=Je(),tZ=La(),rZ={message:"boolean schema is false"},TE;function nZ(e){let{gen:t,schema:r,validateName:n}=e;r===!1?PE(e,!1):typeof r=="object"&&r.$async===!0?t.return(tZ.default.data):(t.assign((0,eZ._)(TE||(TE=k(["",".errors"])),n),null),t.return(!0))}s(nZ,"topBoolOrEmptySchema");Xd.topBoolOrEmptySchema=nZ;function oZ(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),PE(e)):r.var(t,!0)}s(oZ,"boolOrEmptySchema");Xd.boolOrEmptySchema=oZ;function PE(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Qq.reportError)(o,rZ,void 0,t)}s(PE,"falseSchemaError")});var b3=ue(Yd=>{"use strict";f();Object.defineProperty(Yd,"__esModule",{value:!0});Yd.getRules=Yd.isJSONType=void 0;var iZ=["string","number","integer","boolean","null","object","array"],sZ=new Set(iZ);function aZ(e){return typeof e=="string"&&sZ.has(e)}s(aZ,"isJSONType");Yd.isJSONType=aZ;function lZ(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:R(P({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}s(lZ,"getRules");Yd.getRules=lZ});var x3=ue(tc=>{"use strict";f();Object.defineProperty(tc,"__esModule",{value:!0});tc.shouldUseRule=tc.shouldUseGroup=tc.schemaHasRulesForType=void 0;function cZ({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&ME(e,n)}s(cZ,"schemaHasRulesForType");tc.schemaHasRulesForType=cZ;function ME(e,t){return t.rules.some(r=>OE(e,r))}s(ME,"shouldUseGroup");tc.shouldUseGroup=ME;function OE(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}s(OE,"shouldUseRule");tc.shouldUseRule=OE});var iy=ue(Pn=>{"use strict";f();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.reportTypeError=Pn.checkDataTypes=Pn.checkDataType=Pn.coerceAndCheckDataType=Pn.getJSONTypes=Pn.getSchemaTypes=Pn.DataType=void 0;var pZ=b3(),uZ=x3(),dZ=oy(),Ke=Je(),l8=_t(),Kd;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Kd||(Pn.DataType=Kd={}));function fZ(e){let t=c8(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}s(fZ,"getSchemaTypes");Pn.getSchemaTypes=fZ;function c8(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(pZ.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}s(c8,"getJSONTypes");Pn.getJSONTypes=c8;function mZ(e,t){let{gen:r,data:n,opts:o}=e,i=hZ(t,o.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,uZ.schemaHasRulesForType)(e,t[0]));if(a){let l=I3(t,n,o.strictNumbers,Kd.Wrong);r.if(l,()=>{i.length?yZ(e,t,i):S3(e)})}return a}s(mZ,"coerceAndCheckDataType");Pn.coerceAndCheckDataType=mZ;var p8=new Set(["string","number","integer","boolean","null"]);function hZ(e,t){return t?e.filter(r=>p8.has(r)||t==="array"&&r==="array"):[]}s(hZ,"coerceToTypes");var EE,_E,kE,AE,DE,FE,LE,RE,NE,BE,$E,jE,GE,UE,VE,zE,HE,WE,qE,ZE;function yZ(e,t,r){let{gen:n,data:o,opts:i}=e,a=n.let("dataType",(0,Ke._)(EE||(EE=k(["typeof ",""])),o)),l=n.let("coerced",(0,Ke._)(_E||(_E=k(["undefined"]))));i.coerceTypes==="array"&&n.if((0,Ke._)(kE||(kE=k([""," == 'object' && Array.isArray(",") && ",".length == 1"])),a,o,o),()=>n.assign(o,(0,Ke._)(AE||(AE=k(["","[0]"])),o)).assign(a,(0,Ke._)(DE||(DE=k(["typeof ",""])),o)).if(I3(t,o,i.strictNumbers),()=>n.assign(l,o))),n.if((0,Ke._)(FE||(FE=k([""," !== undefined"])),l));for(let u of r)(p8.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),S3(e),n.endIf(),n.if((0,Ke._)(LE||(LE=k([""," !== undefined"])),l),()=>{n.assign(o,l),gZ(e,l)});function c(u){switch(u){case"string":n.elseIf((0,Ke._)(RE||(RE=k(["",' == "number" || ',' == "boolean"'])),a,a)).assign(l,(0,Ke._)(NE||(NE=k(['"" + ',""])),o)).elseIf((0,Ke._)(BE||(BE=k([""," === null"])),o)).assign(l,(0,Ke._)($E||($E=k(['""']))));return;case"number":n.elseIf((0,Ke._)(jE||(jE=k(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),a,o,a,o,o,o)).assign(l,(0,Ke._)(GE||(GE=k(["+",""])),o));return;case"integer":n.elseIf((0,Ke._)(UE||(UE=k(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),a,o,a,o,o,o,o)).assign(l,(0,Ke._)(VE||(VE=k(["+",""])),o));return;case"boolean":n.elseIf((0,Ke._)(zE||(zE=k(["",' === "false" || '," === 0 || "," === null"])),o,o,o)).assign(l,!1).elseIf((0,Ke._)(HE||(HE=k(["",' === "true" || '," === 1"])),o,o)).assign(l,!0);return;case"null":n.elseIf((0,Ke._)(WE||(WE=k(["",' === "" || '," === 0 || "," === false"])),o,o,o)),n.assign(l,null);return;case"array":n.elseIf((0,Ke._)(qE||(qE=k(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),a,a,a,o)).assign(l,(0,Ke._)(ZE||(ZE=k(["[","]"])),o))}}s(c,"coerceSpecificType")}s(yZ,"coerceData");var XE,YE;function gZ({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ke._)(XE||(XE=k([""," !== undefined"])),t),()=>e.assign((0,Ke._)(YE||(YE=k(["","[","]"])),t,r),n))}s(gZ,"assignParentData");var KE,JE,QE,e8,t8,r8,n8;function v3(e,t,r,n=Kd.Correct){let o=n===Kd.Correct?Ke.operators.EQ:Ke.operators.NEQ,i;switch(e){case"null":return(0,Ke._)(KE||(KE=k([""," "," null"])),t,o);case"array":i=(0,Ke._)(JE||(JE=k(["Array.isArray(",")"])),t);break;case"object":i=(0,Ke._)(QE||(QE=k([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":i=a((0,Ke._)(e8||(e8=k(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":i=a();break;default:return(0,Ke._)(t8||(t8=k(["typeof "," "," ",""])),t,o,e)}return n===Kd.Correct?i:(0,Ke.not)(i);function a(l=Ke.nil){return(0,Ke.and)((0,Ke._)(r8||(r8=k(["typeof ",' == "number"'])),t),l,r?(0,Ke._)(n8||(n8=k(["isFinite(",")"])),t):Ke.nil)}}s(v3,"checkDataType");Pn.checkDataType=v3;var o8,i8;function I3(e,t,r,n){if(e.length===1)return v3(e[0],t,r,n);let o,i=(0,l8.toHash)(e);if(i.array&&i.object){let a=(0,Ke._)(o8||(o8=k(["typeof ",' != "object"'])),t);o=i.null?a:(0,Ke._)(i8||(i8=k(["!"," || ",""])),t,a),delete i.null,delete i.array,delete i.object}else o=Ke.nil;i.number&&delete i.integer;for(let a in i)o=(0,Ke.and)(o,v3(a,t,r,n));return o}s(I3,"checkDataTypes");Pn.checkDataTypes=I3;var s8,a8,bZ={message:s(({schema:e})=>"must be ".concat(e),"message"),params:s(({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ke._)(s8||(s8=k(["{type: ","}"])),e):(0,Ke._)(a8||(a8=k(["{type: ","}"])),t),"params")};function S3(e){let t=xZ(e);(0,dZ.reportError)(t,bZ)}s(S3,"reportTypeError");Pn.reportTypeError=S3;function xZ(e){let{gen:t,data:r,schema:n}=e,o=(0,l8.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}s(xZ,"getTypeErrorContext")});var y8=ue(n0=>{"use strict";f();Object.defineProperty(n0,"__esModule",{value:!0});n0.assignDefaults=void 0;var Jd=Je(),vZ=_t();function IZ(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)u8(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>u8(e,i,o.default))}s(IZ,"assignDefaults");n0.assignDefaults=IZ;var d8,f8,m8,h8;function u8(e,t,r){let{gen:n,compositeRule:o,data:i,opts:a}=e;if(r===void 0)return;let l=(0,Jd._)(d8||(d8=k(["","",""])),i,(0,Jd.getProperty)(t));if(o){(0,vZ.checkStrictMode)(e,"default is ignored for: ".concat(l));return}let c=(0,Jd._)(f8||(f8=k([""," === undefined"])),l);a.useDefaults==="empty"&&(c=(0,Jd._)(m8||(m8=k([""," || "," === null || ",' === ""'])),c,l,l)),n.if(c,(0,Jd._)(h8||(h8=k([""," = ",""])),l,(0,Jd.stringify)(r)))}s(u8,"assignDefault")});var Zo=ue(Ut=>{"use strict";f();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.validateUnion=Ut.validateArray=Ut.usePattern=Ut.callValidateCode=Ut.schemaProperties=Ut.allSchemaProperties=Ut.noPropertyInData=Ut.propertyInData=Ut.isOwnProperty=Ut.hasPropFunc=Ut.reportMissingProp=Ut.checkMissingProp=Ut.checkReportMissingProp=void 0;var tr=Je(),C3=_t(),rc=La(),SZ=_t(),g8;function CZ(e,t){let{gen:r,data:n,it:o}=e;r.if(P3(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,tr._)(g8||(g8=k(["",""])),t)},!0),e.error()})}s(CZ,"checkReportMissingProp");Ut.checkReportMissingProp=CZ;var b8;function TZ({gen:e,data:t,it:{opts:r}},n,o){return(0,tr.or)(...n.map(i=>(0,tr.and)(P3(e,t,i,r.ownProperties),(0,tr._)(b8||(b8=k([""," = ",""])),o,i))))}s(TZ,"checkMissingProp");Ut.checkMissingProp=TZ;function PZ(e,t){e.setParams({missingProperty:t},!0),e.error()}s(PZ,"reportMissingProp");Ut.reportMissingProp=PZ;var x8;function A8(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,tr._)(x8||(x8=k(["Object.prototype.hasOwnProperty"])))})}s(A8,"hasPropFunc");Ut.hasPropFunc=A8;var v8;function T3(e,t,r){return(0,tr._)(v8||(v8=k(["",".call(",", ",")"])),A8(e),t,r)}s(T3,"isOwnProperty");Ut.isOwnProperty=T3;var I8,S8;function wZ(e,t,r,n){let o=(0,tr._)(I8||(I8=k(["",""," !== undefined"])),t,(0,tr.getProperty)(r));return n?(0,tr._)(S8||(S8=k([""," && ",""])),o,T3(e,t,r)):o}s(wZ,"propertyInData");Ut.propertyInData=wZ;var C8;function P3(e,t,r,n){let o=(0,tr._)(C8||(C8=k(["",""," === undefined"])),t,(0,tr.getProperty)(r));return n?(0,tr.or)(o,(0,tr.not)(T3(e,t,r))):o}s(P3,"noPropertyInData");Ut.noPropertyInData=P3;function D8(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}s(D8,"allSchemaProperties");Ut.allSchemaProperties=D8;function MZ(e,t){return D8(t).filter(r=>!(0,C3.alwaysValidSchema)(e,t[r]))}s(MZ,"schemaProperties");Ut.schemaProperties=MZ;var T8,P8,w8,M8;function OZ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},l,c,u){let d=u?(0,tr._)(T8||(T8=k(["",", ",", ","",""])),e,t,n,o):t,h=[[rc.default.instancePath,(0,tr.strConcat)(rc.default.instancePath,i)],[rc.default.parentData,a.parentData],[rc.default.parentDataProperty,a.parentDataProperty],[rc.default.rootData,rc.default.rootData]];a.opts.dynamicRef&&h.push([rc.default.dynamicAnchors,rc.default.dynamicAnchors]);let y=(0,tr._)(P8||(P8=k(["",", ",""])),d,r.object(...h));return c!==tr.nil?(0,tr._)(w8||(w8=k(["",".call(",", ",")"])),l,c,y):(0,tr._)(M8||(M8=k(["","(",")"])),l,y)}s(OZ,"callValidateCode");Ut.callValidateCode=OZ;var O8,EZ=(0,tr._)(O8||(O8=k(["new RegExp"]))),E8;function _Z({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,tr._)(E8||(E8=k(["","(",", ",")"])),o.code==="new RegExp"?EZ:(0,SZ.useFunc)(e,o),r,n)})}s(_Z,"usePattern");Ut.usePattern=_Z;var _8;function kZ(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let l=t.let("valid",!0);return a(()=>t.assign(l,!1)),l}return t.var(i,!0),a(()=>t.break()),i;function a(l){let c=t.const("len",(0,tr._)(_8||(_8=k(["",".length"])),r));t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:C3.Type.Num},i),t.if((0,tr.not)(i),l)})}s(a,"validateItems")}s(kZ,"validateArray");Ut.validateArray=kZ;var k8;function AZ(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,C3.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);t.assign(a,(0,tr._)(k8||(k8=k([""," || ",""])),a,l)),e.mergeValidEvaluated(d,l)||t.if((0,tr.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}s(AZ,"validateUnion");Ut.validateUnion=AZ});var W8=ue(ws=>{"use strict";f();Object.defineProperty(ws,"__esModule",{value:!0});ws.validateKeywordUsage=ws.validSchemaType=ws.funcKeywordCode=ws.macroKeywordCode=void 0;var zn=Je(),Op=La(),DZ=Zo(),FZ=oy();function LZ(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=e,l=t.macro.call(a.self,o,i,a),c=H8(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let u=r.name("valid");e.subschema({schema:l,schemaPath:zn.nil,errSchemaPath:"".concat(a.errSchemaPath,"/").concat(n),topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}s(LZ,"macroKeywordCode");ws.macroKeywordCode=LZ;var L8,R8,N8,B8,$8,j8;function RZ(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:l,it:c}=e;BZ(c,t);let u=!l&&t.compile?t.compile.call(c.self,i,a,c):t.validate,d=H8(n,o,u),h=n.let("valid");e.block$data(h,y),e.ok((r=t.valid)!==null&&r!==void 0?r:h);function y(){if(t.errors===!1)S(),t.modifying&&F8(e),x(()=>e.error());else{let T=t.async?b():I();t.modifying&&F8(e),x(()=>NZ(e,T))}}s(y,"validateKeyword");function b(){let T=n.let("ruleErrs",null);return n.try(()=>S((0,zn._)(L8||(L8=k(["await "])))),w=>n.assign(h,!1).if((0,zn._)(R8||(R8=k([""," instanceof ",""])),w,c.ValidationError),()=>n.assign(T,(0,zn._)(N8||(N8=k(["",".errors"])),w)),()=>n.throw(w))),T}s(b,"validateAsync");function I(){let T=(0,zn._)(B8||(B8=k(["",".errors"])),d);return n.assign(T,null),S(zn.nil),T}s(I,"validateSync");function S(T=t.async?(0,zn._)($8||($8=k(["await "]))):zn.nil){let w=c.opts.passContext?Op.default.this:Op.default.self,M=!("compile"in t&&!l||t.schema===!1);n.assign(h,(0,zn._)(j8||(j8=k(["","",""])),T,(0,DZ.callValidateCode)(e,d,w,M)),t.modifying)}s(S,"assignValid");function x(T){var w;n.if((0,zn.not)((w=t.valid)!==null&&w!==void 0?w:h),T)}s(x,"reportErrs")}s(RZ,"funcKeywordCode");ws.funcKeywordCode=RZ;var G8;function F8(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,zn._)(G8||(G8=k(["","[","]"])),n.parentData,n.parentDataProperty)))}s(F8,"modifyData");var U8,V8,z8;function NZ(e,t){let{gen:r}=e;r.if((0,zn._)(U8||(U8=k(["Array.isArray(",")"])),t),()=>{r.assign(Op.default.vErrors,(0,zn._)(V8||(V8=k([""," === null ? "," : ",".concat(",")"])),Op.default.vErrors,t,Op.default.vErrors,t)).assign(Op.default.errors,(0,zn._)(z8||(z8=k(["",".length"])),Op.default.vErrors)),(0,FZ.extendErrors)(e)},()=>e.error())}s(NZ,"addErrs");function BZ({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}s(BZ,"checkAsyncKeyword");function H8(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,zn.stringify)(r)})}s(H8,"useKeyword");function $Z(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}s($Z,"validSchemaType");ws.validSchemaType=$Z;function jZ({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let a=o.dependencies;if(a!=null&&a.some(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error("parent schema must have dependencies of ".concat(i,": ").concat(a.join(",")));if(o.validateSchema&&!o.validateSchema(e[i])){let c='keyword "'.concat(i,'" value is invalid at path "').concat(n,'": ')+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}s(jZ,"validateKeywordUsage");ws.validateKeywordUsage=jZ});var Q8=ue(nc=>{"use strict";f();Object.defineProperty(nc,"__esModule",{value:!0});nc.extendSubschemaMode=nc.extendSubschemaData=nc.getSubschema=void 0;var Ms=Je(),J8=_t(),q8,Z8;function GZ(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Ms._)(q8||(q8=k(["","",""])),e.schemaPath,(0,Ms.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:l[r],schemaPath:(0,Ms._)(Z8||(Z8=k(["","","",""])),e.schemaPath,(0,Ms.getProperty)(t),(0,Ms.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,J8.escapeFragment)(r))}}if(n!==void 0){if(o===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}s(GZ,"getSubschema");nc.getSubschema=GZ;var X8,Y8,K8;function UZ(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:h}=t,y=l.let("data",(0,Ms._)(X8||(X8=k(["","",""])),t.data,(0,Ms.getProperty)(r)),!0);c(y),e.errorPath=(0,Ms.str)(Y8||(Y8=k(["","",""])),u,(0,J8.getErrorPath)(r,n,h.jsPropertySyntax)),e.parentDataProperty=(0,Ms._)(K8||(K8=k(["",""])),r),e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Ms.Name?o:l.let("data",o,!0);c(u),a!==void 0&&(e.propertyName=a)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}s(c,"dataContextProps")}s(UZ,"extendSubschemaData");nc.extendSubschemaData=UZ;function VZ(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}s(VZ,"extendSubschemaMode");nc.extendSubschemaMode=VZ});var w3=ue((BSe,e_)=>{"use strict";f();e_.exports=s(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var r_=ue((GSe,t_)=>{"use strict";f();var oc=t_.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};o0(t,n,o,e,"",e)};oc.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};oc.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};oc.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};oc.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o0(e,t,r,n,o,i,a,l,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,a,l,c,u);for(var d in n){var h=n[d];if(Array.isArray(h)){if(d in oc.arrayKeywords)for(var y=0;y<h.length;y++)o0(e,t,r,h[y],o+"/"+d+"/"+y,i,o,d,n,y)}else if(d in oc.propsKeywords){if(h&&typeof h=="object")for(var b in h)o0(e,t,r,h[b],o+"/"+d+"/"+zZ(b),i,o,d,n,b)}else(d in oc.keywords||e.allKeys&&!(d in oc.skipKeywords))&&o0(e,t,r,h,o+"/"+d,i,o,d,n)}r(n,o,i,a,l,c,u)}}s(o0,"_traverse");function zZ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(zZ,"escapeJsonPtr")});var sy=ue(co=>{"use strict";f();Object.defineProperty(co,"__esModule",{value:!0});co.getSchemaRefs=co.resolveUrl=co.normalizeId=co._getFullPath=co.getFullPath=co.inlineRef=void 0;var HZ=_t(),WZ=w3(),qZ=r_(),ZZ=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function XZ(e,t=!0){return typeof e=="boolean"?!0:t===!0?!M3(e):t?n_(e)<=t:!1}s(XZ,"inlineRef");co.inlineRef=XZ;var YZ=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function M3(e){for(let t in e){if(YZ.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(M3)||typeof r=="object"&&M3(r))return!0}return!1}s(M3,"hasRef");function n_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!ZZ.has(r)&&(typeof e[r]=="object"&&(0,HZ.eachItem)(e[r],n=>t+=n_(n)),t===1/0))return 1/0}return t}s(n_,"countKeys");function o_(e,t="",r){r!==!1&&(t=Qd(t));let n=e.parse(t);return i_(e,n)}s(o_,"getFullPath");co.getFullPath=o_;function i_(e,t){return e.serialize(t).split("#")[0]+"#"}s(i_,"_getFullPath");co._getFullPath=i_;var KZ=/#\/?$/;function Qd(e){return e?e.replace(KZ,""):""}s(Qd,"normalizeId");co.normalizeId=Qd;function JZ(e,t,r){return r=Qd(r),e.resolve(t,r)}s(JZ,"resolveUrl");co.resolveUrl=JZ;var QZ=/^[a-z_][-a-z0-9._]*$/i;function eX(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Qd(e[r]||t),i={"":o},a=o_(n,o,!1),l={},c=new Set;return qZ(e,{allKeys:!0},(h,y,b,I)=>{if(I===void 0)return;let S=a+y,x=i[I];typeof h[r]=="string"&&(x=T.call(this,h[r])),w.call(this,h.$anchor),w.call(this,h.$dynamicAnchor),i[y]=x;function T(M){let O=this.opts.uriResolver.resolve;if(M=Qd(x?O(x,M):M),c.has(M))throw d(M);c.add(M);let _=this.refs[M];return typeof _=="string"&&(_=this.refs[_]),typeof _=="object"?u(h,_.schema,M):M!==Qd(S)&&(M[0]==="#"?(u(h,l[M],M),l[M]=h):this.refs[M]=S),M}s(T,"addRef");function w(M){if(typeof M=="string"){if(!QZ.test(M))throw new Error('invalid anchor "'.concat(M,'"'));T.call(this,"#".concat(M))}}s(w,"addAnchor")}),l;function u(h,y,b){if(y!==void 0&&!WZ(h,y))throw d(b)}s(u,"checkAmbiguosRef");function d(h){return new Error('reference "'.concat(h,'" resolves to more than one schema'))}s(d,"ambiguos")}s(eX,"getSchemaRefs");co.getSchemaRefs=eX});var cy=ue(ic=>{"use strict";f();Object.defineProperty(ic,"__esModule",{value:!0});ic.getData=ic.KeywordCxt=ic.validateFunctionCode=void 0;var X_=wE(),s_=iy(),E3=x3(),i0=iy(),tX=y8(),ly=W8(),O3=Q8(),_e=Je(),ze=La(),rX=sy(),Ra=_t(),ay=oy();function nX(e){if(J_(e)&&(Q_(e),K_(e))){sX(e);return}Y_(e,()=>(0,X_.topBoolOrEmptySchema)(e))}s(nX,"validateFunctionCode");ic.validateFunctionCode=nX;var p_,u_,d_;function Y_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,_e._)(p_||(p_=k(["",", ",""])),ze.default.data,ze.default.valCxt),n.$async,()=>{e.code((0,_e._)(u_||(u_=k(['"use strict"; ',""])),a_(r,o))),iX(e,o),e.code(i)}):e.func(t,(0,_e._)(d_||(d_=k(["",", ",""])),ze.default.data,oX(o)),n.$async,()=>e.code(a_(r,o)).code(i))}s(Y_,"validateFunction");var f_,m_;function oX(e){return(0,_e._)(m_||(m_=k(["{",'="", ',", ",", ","=","","}={}"])),ze.default.instancePath,ze.default.parentData,ze.default.parentDataProperty,ze.default.rootData,ze.default.data,e.dynamicRef?(0,_e._)(f_||(f_=k([", ","={}"])),ze.default.dynamicAnchors):_e.nil)}s(oX,"destructureValCxt");var h_,y_,g_,b_,x_,v_,I_,S_,C_;function iX(e,t){e.if(ze.default.valCxt,()=>{e.var(ze.default.instancePath,(0,_e._)(h_||(h_=k(["",".",""])),ze.default.valCxt,ze.default.instancePath)),e.var(ze.default.parentData,(0,_e._)(y_||(y_=k(["",".",""])),ze.default.valCxt,ze.default.parentData)),e.var(ze.default.parentDataProperty,(0,_e._)(g_||(g_=k(["",".",""])),ze.default.valCxt,ze.default.parentDataProperty)),e.var(ze.default.rootData,(0,_e._)(b_||(b_=k(["",".",""])),ze.default.valCxt,ze.default.rootData)),t.dynamicRef&&e.var(ze.default.dynamicAnchors,(0,_e._)(x_||(x_=k(["",".",""])),ze.default.valCxt,ze.default.dynamicAnchors))},()=>{e.var(ze.default.instancePath,(0,_e._)(v_||(v_=k(['""'])))),e.var(ze.default.parentData,(0,_e._)(I_||(I_=k(["undefined"])))),e.var(ze.default.parentDataProperty,(0,_e._)(S_||(S_=k(["undefined"])))),e.var(ze.default.rootData,ze.default.data),t.dynamicRef&&e.var(ze.default.dynamicAnchors,(0,_e._)(C_||(C_=k(["{}"]))))})}s(iX,"destructureValCxtES5");function sX(e){let{schema:t,opts:r,gen:n}=e;Y_(e,()=>{r.$comment&&t.$comment&&tk(e),uX(e),n.let(ze.default.vErrors,null),n.let(ze.default.errors,0),r.unevaluated&&aX(e),ek(e),mX(e)})}s(sX,"topSchemaObjCode");var T_,P_,w_,M_,O_,E_,__;function aX(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,_e._)(T_||(T_=k(["",".evaluated"])),r)),t.if((0,_e._)(P_||(P_=k(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,_e._)(w_||(w_=k(["",".props"])),e.evaluated),(0,_e._)(M_||(M_=k(["undefined"]))))),t.if((0,_e._)(O_||(O_=k(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,_e._)(E_||(E_=k(["",".items"])),e.evaluated),(0,_e._)(__||(__=k(["undefined"])))))}s(aX,"resetEvaluated");var k_;function a_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,_e._)(k_||(k_=k(["/*# sourceURL="," */"])),r):_e.nil}s(a_,"funcSourceUrl");function lX(e,t){if(J_(e)&&(Q_(e),K_(e))){cX(e,t);return}(0,X_.boolOrEmptySchema)(e,t)}s(lX,"subschemaCode");function K_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}s(K_,"schemaCxtHasRules");function J_(e){return typeof e.schema!="boolean"}s(J_,"isSchemaObj");var A_;function cX(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&tk(e),dX(e),fX(e);let i=n.const("_errs",ze.default.errors);ek(e,i),n.var(t,(0,_e._)(A_||(A_=k([""," === ",""])),i,ze.default.errors))}s(cX,"subSchemaObjCode");function Q_(e){(0,Ra.checkUnknownRules)(e),pX(e)}s(Q_,"checkKeywords");function ek(e,t){if(e.opts.jtd)return l_(e,[],!1,t);let r=(0,s_.getSchemaTypes)(e.schema),n=(0,s_.coerceAndCheckDataType)(e,r);l_(e,r,!n,t)}s(ek,"typeAndKeywords");function pX(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ra.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}s(pX,"checkRefsAndKeywords");function uX(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ra.checkStrictMode)(e,"default is ignored in the schema root")}s(uX,"checkNoDefault");function dX(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,rX.resolveUrl)(e.opts.uriResolver,e.baseId,t))}s(dX,"updateContext");function fX(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}s(fX,"checkAsyncSchema");var D_,F_,L_;function tk({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,_e._)(D_||(D_=k(["",".logger.log(",")"])),ze.default.self,i));else if(typeof o.$comment=="function"){let a=(0,_e.str)(F_||(F_=k(["","/$comment"])),n),l=e.scopeValue("root",{ref:t.root});e.code((0,_e._)(L_||(L_=k(["",".opts.$comment(",", ",", ",".schema)"])),ze.default.self,i,a,l))}}s(tk,"commentKeyword");var R_,N_,B_,$_;function mX(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,_e._)(R_||(R_=k([""," === 0"])),ze.default.errors),()=>t.return(ze.default.data),()=>t.throw((0,_e._)(N_||(N_=k(["new ","(",")"])),o,ze.default.vErrors))):(t.assign((0,_e._)(B_||(B_=k(["",".errors"])),n),ze.default.vErrors),i.unevaluated&&hX(e),t.return((0,_e._)($_||($_=k([""," === 0"])),ze.default.errors)))}s(mX,"returnResults");var j_,G_;function hX({gen:e,evaluated:t,props:r,items:n}){r instanceof _e.Name&&e.assign((0,_e._)(j_||(j_=k(["",".props"])),t),r),n instanceof _e.Name&&e.assign((0,_e._)(G_||(G_=k(["",".items"])),t),n)}s(hX,"assignEvaluated");var U_;function l_(e,t,r,n){let{gen:o,schema:i,data:a,allErrors:l,opts:c,self:u}=e,{RULES:d}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Ra.schemaHasRulesButRef)(i,d))){o.block(()=>nk(e,"$ref",d.all.$ref.definition));return}c.jtd||yX(e,t),o.block(()=>{for(let y of d.rules)h(y);h(d.post)});function h(y){(0,E3.shouldUseGroup)(i,y)&&(y.type?(o.if((0,i0.checkDataType)(y.type,a,c.strictNumbers)),c_(e,y),t.length===1&&t[0]===y.type&&r&&(o.else(),(0,i0.reportTypeError)(e)),o.endIf()):c_(e,y),l||o.if((0,_e._)(U_||(U_=k([""," === ",""])),ze.default.errors,n||0)))}s(h,"groupKeywords")}s(l_,"schemaKeywords");function c_(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,tX.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,E3.shouldUseRule)(n,i)&&nk(e,i.keyword,i.definition,t.type)})}s(c_,"iterateKeywords");function yX(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(gX(e,t),e.opts.allowUnionTypes||bX(e,t),xX(e,e.dataTypes))}s(yX,"checkStrictTypes");function gX(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{rk(e.dataTypes,r)||_3(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),IX(e,t)}}s(gX,"checkContextTypes");function bX(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&_3(e,"use allowUnionTypes to allow union type keyword")}s(bX,"checkMultipleTypes");function xX(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,E3.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>vX(t,a))&&_3(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(n,'"'))}}}s(xX,"checkKeywordTypes");function vX(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}s(vX,"hasApplicableType");function rk(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}s(rk,"includesType");function IX(e,t){let r=[];for(let n of e.dataTypes)rk(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}s(IX,"narrowSchemaTypes");function _3(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,Ra.checkStrictMode)(e,t,e.opts.strictTypes)}s(_3,"strictTypesError");var V_,z_,H_,W_,k3=class k3{constructor(t,r,n){if((0,ly.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ra.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",ok(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ly.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",ze.default.errors))}result(t,r,n){this.failResult((0,_e.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,_e.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,_e._)(V_||(V_=k([""," !== undefined && (",")"])),r,(0,_e.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ay.reportExtraError:ay.reportError)(this,this.def.error,r)}$dataError(){(0,ay.reportError)(this,this.def.$dataError||ay.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ay.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=_e.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=_e.nil,r=_e.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,_e.or)((0,_e._)(z_||(z_=k([""," === undefined"])),o),r)),t!==_e.nil&&n.assign(t,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==_e.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,_e.or)(a(),l());function a(){if(n.length){if(!(r instanceof _e.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,_e._)(H_||(H_=k(["",""])),(0,i0.checkDataTypes)(c,r,i.opts.strictNumbers,i0.DataType.Wrong))}return _e.nil}function l(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,_e._)(W_||(W_=k(["!","(",")"])),c,r)}return _e.nil}}subschema(t,r){let n=(0,O3.getSubschema)(this.it,t);(0,O3.extendSubschemaData)(n,this.it,t),(0,O3.extendSubschemaMode)(n,t);let o=R(P(P({},this.it),n),{items:void 0,props:void 0});return lX(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ra.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ra.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,_e.Name)),!0}};s(k3,"KeywordCxt");var s0=k3;ic.KeywordCxt=s0;function nk(e,t,r,n){let o=new s0(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ly.funcKeywordCode)(o,r):"macro"in r?(0,ly.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ly.funcKeywordCode)(o,r)}s(nk,"keywordCode");var SX=/^\/(?:[^~]|~0|~1)*$/,CX=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,q_,Z_;function ok(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return ze.default.rootData;if(e[0]==="/"){if(!SX.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));o=e,i=ze.default.rootData}else{let u=CX.exec(e);if(!u)throw new Error("Invalid JSON-pointer: ".concat(e));let d=+u[1];if(o=u[2],o==="#"){if(d>=t)throw new Error(c("property/index",d));return n[t-d]}if(d>t)throw new Error(c("data",d));if(i=r[t-d],!o)return i}let a=i,l=o.split("/");for(let u of l)u&&(i=(0,_e._)(q_||(q_=k(["","",""])),i,(0,_e.getProperty)((0,Ra.unescapeJsonPointer)(u))),a=(0,_e._)(Z_||(Z_=k([""," && ",""])),a,i));return a;function c(u,d){return"Cannot access ".concat(u," ").concat(d," levels up, current level is ").concat(t)}}s(ok,"getData");ic.getData=ok});var a0=ue(D3=>{"use strict";f();Object.defineProperty(D3,"__esModule",{value:!0});var F3=class F3 extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};s(F3,"ValidationError");var A3=F3;D3.default=A3});var py=ue(N3=>{"use strict";f();Object.defineProperty(N3,"__esModule",{value:!0});var L3=sy(),B3=class B3 extends Error{constructor(t,r,n,o){super(o||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,L3.resolveUrl)(t,r,n),this.missingSchema=(0,L3.normalizeId)((0,L3.getFullPath)(t,this.missingRef))}};s(B3,"MissingRefError");var R3=B3;N3.default=R3});var c0=ue(Xo=>{"use strict";f();Object.defineProperty(Xo,"__esModule",{value:!0});Xo.resolveSchema=Xo.getCompilingSchema=Xo.resolveRef=Xo.compileSchema=Xo.SchemaEnv=void 0;var Di=Je(),TX=a0(),Ep=La(),Fi=sy(),ik=_t(),PX=cy(),G3=class G3{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Fi.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};s(G3,"SchemaEnv");var ef=G3;Xo.SchemaEnv=ef;var sk,ak;function j3(e){let t=lk.call(this,e);if(t)return t;let r=(0,Fi.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new Di.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),l;e.$async&&(l=a.scopeValue("Error",{ref:TX.default,code:(0,Di._)(sk||(sk=k(['require("ajv/dist/runtime/validation_error").default'])))}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Ep.default.data,parentData:Ep.default.parentData,parentDataProperty:Ep.default.parentDataProperty,dataNames:[Ep.default.data],dataPathArr:[Di.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Di.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Di.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Di._)(ak||(ak=k(['""']))),opts:this.opts,self:this},d;try{this._compilations.add(e),(0,PX.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let h=a.toString();d="".concat(a.scopeRefs(Ep.default.scope),"return ").concat(h),this.opts.code.process&&(d=this.opts.code.process(d,e));let b=new Function("".concat(Ep.default.self),"".concat(Ep.default.scope),d)(this,this.scope.get());if(this.scope.value(c,{ref:b}),b.errors=null,b.schema=e.schema,b.schemaEnv=e,e.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:c,validateCode:h,scopeValues:a._values}),this.opts.unevaluated){let{props:I,items:S}=u;b.evaluated={props:I instanceof Di.Name?void 0:I,items:S instanceof Di.Name?void 0:S,dynamicProps:I instanceof Di.Name,dynamicItems:S instanceof Di.Name},b.source&&(b.source.evaluated=(0,Di.stringify)(b.evaluated))}return e.validate=b,e}catch(h){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),h}finally{this._compilations.delete(e)}}s(j3,"compileSchema");Xo.compileSchema=j3;function wX(e,t,r){var n;r=(0,Fi.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=EX.call(this,e,r);if(i===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(i=new ef({schema:a,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=MX.call(this,i)}s(wX,"resolveRef");Xo.resolveRef=wX;function MX(e){return(0,Fi.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:j3.call(this,e)}s(MX,"inlineOrCompile");function lk(e){for(let t of this._compilations)if(OX(t,e))return t}s(lk,"getCompilingSchema");Xo.getCompilingSchema=lk;function OX(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}s(OX,"sameSchemaEnv");function EX(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||l0.call(this,e,t)}s(EX,"resolve");function l0(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Fi._getFullPath)(this.opts.uriResolver,r),o=(0,Fi.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return $3.call(this,r,e);let i=(0,Fi.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let l=l0.call(this,e,a);return typeof(l==null?void 0:l.schema)!="object"?void 0:$3.call(this,r,l)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||j3.call(this,a),i===(0,Fi.normalizeId)(t)){let{schema:l}=a,{schemaId:c}=this.opts,u=l[c];return u&&(o=(0,Fi.resolveUrl)(this.opts.uriResolver,o,u)),new ef({schema:l,schemaId:c,root:e,baseId:o})}return $3.call(this,r,a)}}s(l0,"resolveSchema");Xo.resolveSchema=l0;var _X=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $3(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,ik.unescapeFragment)(l)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!_X.has(l)&&u&&(t=(0,Fi.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,ik.schemaHasRulesButRef)(r,this.RULES)){let l=(0,Fi.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=l0.call(this,n,l)}let{schemaId:a}=this.opts;if(i=i||new ef({schema:r,schemaId:a,root:n,baseId:t}),i.schema!==i.root.schema)return i}s($3,"getJsonPointer")});var ck=ue((i3e,kX)=>{kX.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var uk=ue((s3e,pk)=>{"use strict";f();var AX={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};pk.exports={HEX:AX}});var xk=ue((l3e,bk)=>{"use strict";f();var{HEX:DX}=uk(),FX=new RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u");function hk(e){if(gk(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(FX)||[],[r]=t;return r?{host:RX(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}s(hk,"normalizeIPv4");function U3(e,t=!1){let r="",n=!0;for(let o of e){if(DX[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}s(U3,"stringArrayToHexStripped");function LX(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,a=!1,l=!1;function c(){if(o.length){if(i===!1){let u=U3(o);if(u!==void 0)n.push(u);else return r.error=!0,!1}o.length=0}return!0}s(c,"consume");for(let u=0;u<e.length;u++){let d=e[u];if(!(d==="["||d==="]"))if(d===":"){if(a===!0&&(l=!0),!c())break;if(t++,n.push(":"),t>7){r.error=!0;break}u-1>=0&&e[u-1]===":"&&(a=!0);continue}else if(d==="%"){if(!c())break;i=!0}else{o.push(d);continue}}return o.length&&(i?r.zone=o.join(""):l?n.push(o.join("")):n.push(U3(o))),r.address=n.join(""),r}s(LX,"getIPV6");function yk(e){if(gk(e,":")<2)return{host:e,isIPV6:!1};let t=LX(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}s(yk,"normalizeIPv6");function RX(e,t){let r="",n=!0,o=e.length;for(let i=0;i<o;i++){let a=e[i];a==="0"&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}s(RX,"stripLeadingZeros");function gk(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}s(gk,"findToken");var dk=new RegExp("^\\.\\.?\\/","u"),fk=new RegExp("^\\/\\.(?:\\/|$)","u"),mk=new RegExp("^\\/\\.\\.(?:\\/|$)","u"),NX=new RegExp("^\\/?(?:.|\\n)*?(?=\\/|$)","u");function BX(e){let t=[];for(;e.length;)if(e.match(dk))e=e.replace(dk,"");else if(e.match(fk))e=e.replace(fk,"/");else if(e.match(mk))e=e.replace(mk,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(NX);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}s(BX,"removeDotSegments");function $X(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}s($X,"normalizeComponentEncoding");function jX(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=hk(r);if(n.isIPV4)r=n.host;else{let o=yk(n.host);o.isIPV6===!0?r="[".concat(o.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}s(jX,"recomposeAuthority");bk.exports={recomposeAuthority:jX,normalizeComponentEncoding:$X,removeDotSegments:BX,normalizeIPv4:hk,normalizeIPv6:yk,stringArrayToHexStripped:U3}});var Pk=ue((u3e,Tk)=>{"use strict";f();var GX=new RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu"),UX=new RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu");function vk(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}s(vk,"isSecure");function Ik(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}s(Ik,"httpParse");function Sk(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}s(Sk,"httpSerialize");function VX(e){return e.secure=vk(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}s(VX,"wsParse");function zX(e){if((e.port===(vk(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}s(zX,"wsSerialize");function HX(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(UX);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o="".concat(n,":").concat(t.nid||e.nid),i=V3[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}s(HX,"urnParse");function WX(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o="".concat(r,":").concat(t.nid||n),i=V3[o];i&&(e=i.serialize(e,t));let a=e,l=e.nss;return a.path="".concat(n||t.nid,":").concat(l),t.skipEscape=!0,a}s(WX,"urnSerialize");function qX(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!GX.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}s(qX,"urnuuidParse");function ZX(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}s(ZX,"urnuuidSerialize");var Ck={scheme:"http",domainHost:!0,parse:Ik,serialize:Sk},XX={scheme:"https",domainHost:Ck.domainHost,parse:Ik,serialize:Sk},p0={scheme:"ws",domainHost:!0,parse:VX,serialize:zX},YX={scheme:"wss",domainHost:p0.domainHost,parse:p0.parse,serialize:p0.serialize},KX={scheme:"urn",parse:HX,serialize:WX,skipNormalize:!0},JX={scheme:"urn:uuid",parse:qX,serialize:ZX,skipNormalize:!0},V3={http:Ck,https:XX,ws:p0,wss:YX,urn:KX,"urn:uuid":JX};Tk.exports=V3});var Mk=ue((m3e,d0)=>{"use strict";f();var{normalizeIPv6:QX,normalizeIPv4:eY,removeDotSegments:uy,recomposeAuthority:tY,normalizeComponentEncoding:u0}=xk(),z3=Pk();function rY(e,t){return typeof e=="string"?e=Os(Na(e,t),t):typeof e=="object"&&(e=Na(Os(e,t),t)),e}s(rY,"normalize");function nY(e,t,r){let n=Object.assign({scheme:"null"},r),o=wk(Na(e,n),Na(t,n),n,!0);return Os(o,R(P({},n),{skipEscape:!0}))}s(nY,"resolve");function wk(e,t,r,n){let o={};return n||(e=Na(Os(e,r),r),t=Na(Os(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=uy(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=uy(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=uy(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=uy(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}s(wk,"resolveComponents");function oY(e,t,r){return typeof e=="string"?(e=unescape(e),e=Os(u0(Na(e,r),!0),R(P({},r),{skipEscape:!0}))):typeof e=="object"&&(e=Os(u0(e,!0),R(P({},r),{skipEscape:!0}))),typeof t=="string"?(t=unescape(t),t=Os(u0(Na(t,r),!0),R(P({},r),{skipEscape:!0}))):typeof t=="object"&&(t=Os(u0(t,!0),R(P({},r),{skipEscape:!0}))),e.toLowerCase()===t.toLowerCase()}s(oY,"equal");function Os(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=z3[(n.scheme||r.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let a=tY(r);if(a!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(a),r.path&&r.path.charAt(0)!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(l=uy(l)),a===void 0&&(l=l.replace(new RegExp("^\\/\\/","u"),"/%2F")),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}s(Os,"serialize");var iY=Array.from({length:127},(e,t)=>new RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u").test(String.fromCharCode(t)));function sY(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||iY[t])return!0;return!1}s(sY,"nonSimpleDomain");var aY=new RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u");function Na(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=e.indexOf("%")!==-1,i=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match(aY);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let c=eY(n.host);if(c.isIPV4===!1){let u=QX(c.host);n.host=u.host.toLowerCase(),i=u.isIPV6}else n.host=c.host,i=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let l=z3[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&i===!1&&sY(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!l||l&&!l.skipNormalize)&&(o&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),o&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),l&&l.parse&&l.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}s(Na,"parse");var H3={SCHEMES:z3,normalize:rY,resolve:nY,resolveComponents:wk,equal:oY,serialize:Os,parse:Na};d0.exports=H3;d0.exports.default=H3;d0.exports.fastUri=H3});var Ek=ue(W3=>{"use strict";f();Object.defineProperty(W3,"__esModule",{value:!0});var Ok=Mk();Ok.code='require("ajv/dist/runtime/uri").default';W3.default=Ok});var Nk=ue(on=>{"use strict";f();Object.defineProperty(on,"__esModule",{value:!0});on.CodeGen=on.Name=on.nil=on.stringify=on.str=on._=on.KeywordCxt=void 0;var lY=cy();Object.defineProperty(on,"KeywordCxt",{enumerable:!0,get:s(function(){return lY.KeywordCxt},"get")});var tf=Je();Object.defineProperty(on,"_",{enumerable:!0,get:s(function(){return tf._},"get")});Object.defineProperty(on,"str",{enumerable:!0,get:s(function(){return tf.str},"get")});Object.defineProperty(on,"stringify",{enumerable:!0,get:s(function(){return tf.stringify},"get")});Object.defineProperty(on,"nil",{enumerable:!0,get:s(function(){return tf.nil},"get")});Object.defineProperty(on,"Name",{enumerable:!0,get:s(function(){return tf.Name},"get")});Object.defineProperty(on,"CodeGen",{enumerable:!0,get:s(function(){return tf.CodeGen},"get")});var cY=a0(),Fk=py(),pY=b3(),dy=c0(),uY=Je(),fy=sy(),f0=iy(),Z3=_t(),_k=ck(),dY=Ek(),Lk=s((e,t)=>new RegExp(e,t),"defaultRegExp");Lk.code="new RegExp";var fY=["removeAdditional","useDefaults","coerceTypes"],mY=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),hY={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},yY={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},kk=200;function gY(e){var t,r,n,o,i,a,l,c,u,d,h,y,b,I,S,x,T,w,M,O,_,$,j,F,L;let q=e.strict,U=(t=e.code)===null||t===void 0?void 0:t.optimize,V=U===!0||U===void 0?1:U||0,Q=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Lk,Y=(o=e.uriResolver)!==null&&o!==void 0?o:dY.default;return{strictSchema:(a=(i=e.strictSchema)!==null&&i!==void 0?i:q)!==null&&a!==void 0?a:!0,strictNumbers:(c=(l=e.strictNumbers)!==null&&l!==void 0?l:q)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:q)!==null&&d!==void 0?d:"log",strictTuples:(y=(h=e.strictTuples)!==null&&h!==void 0?h:q)!==null&&y!==void 0?y:"log",strictRequired:(I=(b=e.strictRequired)!==null&&b!==void 0?b:q)!==null&&I!==void 0?I:!1,code:e.code?R(P({},e.code),{optimize:V,regExp:Q}):{optimize:V,regExp:Q},loopRequired:(S=e.loopRequired)!==null&&S!==void 0?S:kk,loopEnum:(x=e.loopEnum)!==null&&x!==void 0?x:kk,meta:(T=e.meta)!==null&&T!==void 0?T:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(M=e.inlineRefs)!==null&&M!==void 0?M:!0,schemaId:(O=e.schemaId)!==null&&O!==void 0?O:"$id",addUsedSchema:(_=e.addUsedSchema)!==null&&_!==void 0?_:!0,validateSchema:($=e.validateSchema)!==null&&$!==void 0?$:!0,validateFormats:(j=e.validateFormats)!==null&&j!==void 0?j:!0,unicodeRegExp:(F=e.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(L=e.int32range)!==null&&L!==void 0?L:!0,uriResolver:Y}}s(gY,"requiredOptions");var X3=class X3{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=P(P({},t),gY(t));let{es5:r,lines:n}=this.opts.code;this.scope=new uY.ValueScope({scope:{},prefixes:mY,es5:r,lines:n}),this.logger=CY(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,pY.getRules)(),Ak.call(this,hY,t,"NOT SUPPORTED"),Ak.call(this,yY,t,"DEPRECATED","warn"),this._metaOpts=IY.call(this),t.formats&&xY.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&vY.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),bY.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=_k;n==="id"&&(o=P({},_k),o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(d,h){await i.call(this,d.$schema);let y=this._addSchema(d,h);return y.validate||a.call(this,y)}async function i(d){d&&!this.getSchema(d)&&await o.call(this,{$ref:d},!0)}async function a(d){try{return this._compileSchemaEnv(d)}catch(h){if(!(h instanceof Fk.default))throw h;return l.call(this,h),await c.call(this,h.missingSchema),a.call(this,d)}}function l({missingSchema:d,missingRef:h}){if(this.refs[d])throw new Error("AnySchema ".concat(d," is loaded but ").concat(h," cannot be resolved"))}async function c(d){let h=await u.call(this,d);this.refs[d]||await i.call(this,h.$schema),this.refs[d]||this.addSchema(h,d,r)}async function u(d){let h=this._loading[d];if(h)return h;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:a}=this.opts;if(i=t[a],i!==void 0&&typeof i!="string")throw new Error("schema ".concat(a," must be string"))}return r=(0,fy.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=Dk.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new dy.SchemaEnv({schema:{},schemaId:n});if(r=dy.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Dk.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,fy.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(PY.call(this,n,r),!r)return(0,Z3.eachItem)(n,i=>q3.call(this,i)),this;MY.call(this,r);let o=R(P({},r),{type:(0,f0.getJSONTypes)(r.type),schemaType:(0,f0.getJSONTypes)(r.schemaType)});return(0,Z3.eachItem)(n,o.type.length===0?i=>q3.call(this,i,o):i=>o.type.forEach(a=>q3.call(this,i,o,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>"".concat(n).concat(o.instancePath," ").concat(o.message)).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),a=t;for(let l of i)a=a[l];for(let l in n){let c=n[l];if(typeof c!="object")continue;let{$data:u}=c.definition,d=a[l];u&&d&&(a[l]=Rk(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:l}=this.opts;if(typeof t=="object")a=t[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,fy.normalizeId)(a||n);let u=fy.getSchemaRefs.call(this,t,n);return c=new dy.SchemaEnv({schema:t,schemaId:l,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):dy.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{dy.compileSchema.call(this,t)}finally{this.opts=r}}};s(X3,"Ajv");var my=X3;my.ValidationError=cY.default;my.MissingRefError=Fk.default;on.default=my;function Ak(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n]("".concat(r,": option ").concat(o,". ").concat(e[i]))}}s(Ak,"checkOptions");function Dk(e){return e=(0,fy.normalizeId)(e),this.schemas[e]||this.refs[e]}s(Dk,"getSchEnv");function bY(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}s(bY,"addInitialSchemas");function xY(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}s(xY,"addInitialFormats");function vY(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}s(vY,"addInitialKeywords");function IY(){let e=P({},this.opts);for(let t of fY)delete e[t];return e}s(IY,"getMetaSchemaOptions");var SY={log(){},warn(){},error(){}};function CY(e){if(e===!1)return SY;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}s(CY,"getLogger");var TY=/^[a-z_$][a-z0-9_$:-]*$/i;function PY(e,t){let{RULES:r}=this;if((0,Z3.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!TY.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}s(PY,"checkKeyword");function q3(e,t,r){var n;let o=t==null?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=o?i.post:i.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[e]=!0,!t)return;let l={keyword:e,definition:R(P({},t),{type:(0,f0.getJSONTypes)(t.type),schemaType:(0,f0.getJSONTypes)(t.schemaType)})};t.before?wY.call(this,a,l,t.before):a.rules.push(l),i.all[e]=l,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}s(q3,"addRule");function wY(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}s(wY,"addBeforeRule");function MY(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Rk(t)),e.validateSchema=this.compile(t,!0))}s(MY,"keywordMetaschema");var OY={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Rk(e){return{anyOf:[e,OY]}}s(Rk,"schemaOrData")});var Bk=ue(Y3=>{"use strict";f();Object.defineProperty(Y3,"__esModule",{value:!0});var EY={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Y3.default=EY});var Kk=ue(_p=>{"use strict";f();Object.defineProperty(_p,"__esModule",{value:!0});_p.callRef=_p.getValidate=void 0;var _Y=py(),$k=Zo(),po=Je(),rf=La(),jk=c0(),m0=_t(),Gk,kY={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:a,opts:l,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return h();let d=jk.resolveRef.call(c,u,o,r);if(d===void 0)throw new _Y.default(n.opts.uriResolver,o,r);if(d instanceof jk.SchemaEnv)return y(d);return b(d);function h(){if(i===u)return h0(e,a,i,i.$async);let I=t.scopeValue("root",{ref:u});return h0(e,(0,po._)(Gk||(Gk=k(["",".validate"])),I),u,u.$async)}function y(I){let S=Yk(e,I);h0(e,S,I,I.$async)}function b(I){let S=t.scopeValue("schema",l.code.source===!0?{ref:I,code:(0,po.stringify)(I)}:{ref:I}),x=t.name("valid"),T=e.subschema({schema:I,dataTypes:[],schemaPath:po.nil,topSchemaRef:S,errSchemaPath:r},x);e.mergeEvaluated(T),e.ok(x)}}},Uk;function Yk(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,po._)(Uk||(Uk=k(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}s(Yk,"getValidate");_p.getValidate=Yk;var Vk,zk,Hk,Wk,qk,Zk,Xk;function h0(e,t,r,n){let{gen:o,it:i}=e,{allErrors:a,schemaEnv:l,opts:c}=i,u=c.passContext?rf.default.this:po.nil;n?d():h();function d(){if(!l.$async)throw new Error("async schema referenced by sync schema");let I=o.let("valid");o.try(()=>{o.code((0,po._)(Vk||(Vk=k(["await ",""])),(0,$k.callValidateCode)(e,t,u))),b(t),a||o.assign(I,!0)},S=>{o.if((0,po._)(zk||(zk=k(["!("," instanceof ",")"])),S,i.ValidationError),()=>o.throw(S)),y(S),a||o.assign(I,!1)}),e.ok(I)}s(d,"callAsyncRef");function h(){e.result((0,$k.callValidateCode)(e,t,u),()=>b(t),()=>y(t))}s(h,"callSyncRef");function y(I){let S=(0,po._)(Hk||(Hk=k(["",".errors"])),I);o.assign(rf.default.vErrors,(0,po._)(Wk||(Wk=k([""," === null ? "," : ",".concat(",")"])),rf.default.vErrors,S,rf.default.vErrors,S)),o.assign(rf.default.errors,(0,po._)(qk||(qk=k(["",".length"])),rf.default.vErrors))}s(y,"addErrorsFrom");function b(I){var S;if(!i.opts.unevaluated)return;let x=(S=r==null?void 0:r.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if(x&&!x.dynamicProps)x.props!==void 0&&(i.props=m0.mergeEvaluated.props(o,x.props,i.props));else{let T=o.var("props",(0,po._)(Zk||(Zk=k(["",".evaluated.props"])),I));i.props=m0.mergeEvaluated.props(o,T,i.props,po.Name)}if(i.items!==!0)if(x&&!x.dynamicItems)x.items!==void 0&&(i.items=m0.mergeEvaluated.items(o,x.items,i.items));else{let T=o.var("items",(0,po._)(Xk||(Xk=k(["",".evaluated.items"])),I));i.items=m0.mergeEvaluated.items(o,T,i.items,po.Name)}}s(b,"addEvaluatedFrom")}s(h0,"callRef");_p.callRef=h0;_p.default=kY});var Jk=ue(K3=>{"use strict";f();Object.defineProperty(K3,"__esModule",{value:!0});var AY=Bk(),DY=Kk(),FY=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",AY.default,DY.default];K3.default=FY});var rA=ue(J3=>{"use strict";f();Object.defineProperty(J3,"__esModule",{value:!0});var y0=Je(),sc=y0.operators,g0={maximum:{okStr:"<=",ok:sc.LTE,fail:sc.GT},minimum:{okStr:">=",ok:sc.GTE,fail:sc.LT},exclusiveMaximum:{okStr:"<",ok:sc.LT,fail:sc.GTE},exclusiveMinimum:{okStr:">",ok:sc.GT,fail:sc.LTE}},Qk,eA,LY={message:s(({keyword:e,schemaCode:t})=>(0,y0.str)(Qk||(Qk=k(["must be "," ",""])),g0[e].okStr,t),"message"),params:s(({keyword:e,schemaCode:t})=>(0,y0._)(eA||(eA=k(["{comparison: ",", limit: ","}"])),g0[e].okStr,t),"params")},tA,RY={keyword:Object.keys(g0),type:"number",schemaType:"number",$data:!0,error:LY,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,y0._)(tA||(tA=k([""," "," "," || isNaN(",")"])),r,g0[t].fail,n,r))}};J3.default=RY});var lA=ue(Q3=>{"use strict";f();Object.defineProperty(Q3,"__esModule",{value:!0});var hy=Je(),nA,oA,NY={message:s(({schemaCode:e})=>(0,hy.str)(nA||(nA=k(["must be multiple of ",""])),e),"message"),params:s(({schemaCode:e})=>(0,hy._)(oA||(oA=k(["{multipleOf: ","}"])),e),"params")},iA,sA,aA,BY={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:NY,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),l=i?(0,hy._)(iA||(iA=k(["Math.abs(Math.round(",") - ",") > 1e-",""])),a,a,i):(0,hy._)(sA||(sA=k([""," !== parseInt(",")"])),a,a);e.fail$data((0,hy._)(aA||(aA=k(["("," === 0 || ("," = ","/",", ","))"])),n,a,r,n,l))}};Q3.default=BY});var pA=ue(eC=>{"use strict";f();Object.defineProperty(eC,"__esModule",{value:!0});function cA(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}s(cA,"ucs2length");eC.default=cA;cA.code='require("ajv/dist/runtime/ucs2length").default'});var yA=ue(tC=>{"use strict";f();Object.defineProperty(tC,"__esModule",{value:!0});var kp=Je(),$Y=_t(),jY=pA(),uA,dA,GY={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,kp.str)(uA||(uA=k(["must NOT have "," than "," characters"])),r,t)},params:s(({schemaCode:e})=>(0,kp._)(dA||(dA=k(["{limit: ","}"])),e),"params")},fA,mA,hA,UY={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:GY,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?kp.operators.GT:kp.operators.LT,a=o.opts.unicode===!1?(0,kp._)(fA||(fA=k(["",".length"])),r):(0,kp._)(mA||(mA=k(["","(",")"])),(0,$Y.useFunc)(e.gen,jY.default),r);e.fail$data((0,kp._)(hA||(hA=k([""," "," ",""])),a,i,n))}};tC.default=UY});var IA=ue(rC=>{"use strict";f();Object.defineProperty(rC,"__esModule",{value:!0});var VY=Zo(),b0=Je(),gA,bA,zY={message:s(({schemaCode:e})=>(0,b0.str)(gA||(gA=k(['must match pattern "','"'])),e),"message"),params:s(({schemaCode:e})=>(0,b0._)(bA||(bA=k(["{pattern: ","}"])),e),"params")},xA,vA,HY={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:zY,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,a=i.opts.unicodeRegExp?"u":"",l=r?(0,b0._)(xA||(xA=k(["(new RegExp(",", ","))"])),o,a):(0,VY.usePattern)(e,n);e.fail$data((0,b0._)(vA||(vA=k(["!",".test(",")"])),l,t))}};rC.default=HY});var PA=ue(nC=>{"use strict";f();Object.defineProperty(nC,"__esModule",{value:!0});var yy=Je(),SA,CA,WY={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,yy.str)(SA||(SA=k(["must NOT have "," than "," properties"])),r,t)},params:s(({schemaCode:e})=>(0,yy._)(CA||(CA=k(["{limit: ","}"])),e),"params")},TA,qY={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:WY,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?yy.operators.GT:yy.operators.LT;e.fail$data((0,yy._)(TA||(TA=k(["Object.keys(",").length "," ",""])),r,o,n))}};nC.default=qY});var OA=ue(oC=>{"use strict";f();Object.defineProperty(oC,"__esModule",{value:!0});var gy=Zo(),by=Je(),ZY=_t(),wA,MA,XY={message:s(({params:{missingProperty:e}})=>(0,by.str)(wA||(wA=k(["must have required property '","'"])),e),"message"),params:s(({params:{missingProperty:e}})=>(0,by._)(MA||(MA=k(["{missingProperty: ","}"])),e),"params")},YY={keyword:"required",type:"object",schemaType:"array",$data:!0,error:XY,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:a}=e,{opts:l}=a;if(!i&&r.length===0)return;let c=r.length>=l.loopRequired;if(a.allErrors?u():d(),l.strictRequired){let b=e.parentSchema.properties,{definedProperties:I}=e.it;for(let S of r)if((b==null?void 0:b[S])===void 0&&!I.has(S)){let x=a.schemaEnv.baseId+a.errSchemaPath,T='required property "'.concat(S,'" is not defined at "').concat(x,'" (strictRequired)');(0,ZY.checkStrictMode)(a,T,a.opts.strictRequired)}}function u(){if(c||i)e.block$data(by.nil,h);else for(let b of r)(0,gy.checkReportMissingProp)(e,b)}s(u,"allErrorsMode");function d(){let b=t.let("missing");if(c||i){let I=t.let("valid",!0);e.block$data(I,()=>y(b,I)),e.ok(I)}else t.if((0,gy.checkMissingProp)(e,r,b)),(0,gy.reportMissingProp)(e,b),t.else()}s(d,"exitOnErrorMode");function h(){t.forOf("prop",n,b=>{e.setParams({missingProperty:b}),t.if((0,gy.noPropertyInData)(t,o,b,l.ownProperties),()=>e.error())})}s(h,"loopAllRequired");function y(b,I){e.setParams({missingProperty:b}),t.forOf(b,n,()=>{t.assign(I,(0,gy.propertyInData)(t,o,b,l.ownProperties)),t.if((0,by.not)(I),()=>{e.error(),t.break()})},by.nil)}s(y,"loopUntilMissing")}};oC.default=YY});var AA=ue(iC=>{"use strict";f();Object.defineProperty(iC,"__esModule",{value:!0});var xy=Je(),EA,_A,KY={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,xy.str)(EA||(EA=k(["must NOT have "," than "," items"])),r,t)},params:s(({schemaCode:e})=>(0,xy._)(_A||(_A=k(["{limit: ","}"])),e),"params")},kA,JY={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:KY,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?xy.operators.GT:xy.operators.LT;e.fail$data((0,xy._)(kA||(kA=k(["",".length "," ",""])),r,o,n))}};iC.default=JY});var x0=ue(sC=>{"use strict";f();Object.defineProperty(sC,"__esModule",{value:!0});var DA=w3();DA.code='require("ajv/dist/runtime/equal").default';sC.default=DA});var KA=ue(lC=>{"use strict";f();Object.defineProperty(lC,"__esModule",{value:!0});var aC=iy(),sn=Je(),QY=_t(),eK=x0(),FA,LA,tK={message:s(({params:{i:e,j:t}})=>(0,sn.str)(FA||(FA=k(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:s(({params:{i:e,j:t}})=>(0,sn._)(LA||(LA=k(["{i: ",", j: ","}"])),e,t),"params")},RA,NA,BA,$A,jA,GA,UA,VA,zA,HA,WA,qA,ZA,XA,YA,rK={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:tK,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:a,it:l}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,aC.getSchemaTypes)(i.items):[];e.block$data(c,d,(0,sn._)(RA||(RA=k([""," === false"])),a)),e.ok(c);function d(){let I=t.let("i",(0,sn._)(NA||(NA=k(["",".length"])),r)),S=t.let("j");e.setParams({i:I,j:S}),t.assign(c,!0),t.if((0,sn._)(BA||(BA=k([""," > 1"])),I),()=>(h()?y:b)(I,S))}s(d,"validateUniqueItems");function h(){return u.length>0&&!u.some(I=>I==="object"||I==="array")}s(h,"canOptimize");function y(I,S){let x=t.name("item"),T=(0,aC.checkDataTypes)(u,x,l.opts.strictNumbers,aC.DataType.Wrong),w=t.const("indices",(0,sn._)($A||($A=k(["{}"]))));t.for((0,sn._)(jA||(jA=k([";","--;"])),I),()=>{t.let(x,(0,sn._)(GA||(GA=k(["","[","]"])),r,I)),t.if(T,(0,sn._)(UA||(UA=k(["continue"])))),u.length>1&&t.if((0,sn._)(VA||(VA=k(["typeof ",' == "string"'])),x),(0,sn._)(zA||(zA=k(["",' += "_"'])),x)),t.if((0,sn._)(HA||(HA=k(["typeof ","[",'] == "number"'])),w,x),()=>{t.assign(S,(0,sn._)(WA||(WA=k(["","[","]"])),w,x)),e.error(),t.assign(c,!1).break()}).code((0,sn._)(qA||(qA=k(["","[","] = ",""])),w,x,I))})}s(y,"loopN");function b(I,S){let x=(0,QY.useFunc)(t,eK.default),T=t.name("outer");t.label(T).for((0,sn._)(ZA||(ZA=k([";","--;"])),I),()=>t.for((0,sn._)(XA||(XA=k([""," = ","; ","--;"])),S,I,S),()=>t.if((0,sn._)(YA||(YA=k(["","(","[","], ","[","])"])),x,r,I,r,S),()=>{e.error(),t.assign(c,!1).break(T)})))}s(b,"loopN2")}};lC.default=rK});var tD=ue(pC=>{"use strict";f();Object.defineProperty(pC,"__esModule",{value:!0});var cC=Je(),nK=_t(),oK=x0(),JA,iK={message:"must be equal to constant",params:s(({schemaCode:e})=>(0,cC._)(JA||(JA=k(["{allowedValue: ","}"])),e),"params")},QA,eD,sK={keyword:"const",$data:!0,error:iK,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,cC._)(QA||(QA=k(["!","(",", ",")"])),(0,nK.useFunc)(t,oK.default),r,o)):e.fail((0,cC._)(eD||(eD=k([""," !== ",""])),i,r))}};pC.default=sK});var sD=ue(uC=>{"use strict";f();Object.defineProperty(uC,"__esModule",{value:!0});var vy=Je(),aK=_t(),lK=x0(),rD,cK={message:"must be equal to one of the allowed values",params:s(({schemaCode:e})=>(0,vy._)(rD||(rD=k(["{allowedValues: ","}"])),e),"params")},nD,oD,iD,pK={keyword:"enum",schemaType:"array",$data:!0,error:cK,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=a.opts.loopEnum,c,u=s(()=>c!=null?c:c=(0,aK.useFunc)(t,lK.default),"getEql"),d;if(l||n)d=t.let("valid"),e.block$data(d,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let b=t.const("vSchema",i);d=(0,vy.or)(...o.map((I,S)=>y(b,S)))}e.pass(d);function h(){t.assign(d,!1),t.forOf("v",i,b=>t.if((0,vy._)(nD||(nD=k(["","(",", ",")"])),u(),r,b),()=>t.assign(d,!0).break()))}s(h,"loopEnum");function y(b,I){let S=o[I];return typeof S=="object"&&S!==null?(0,vy._)(oD||(oD=k(["","(",", ","[","])"])),u(),r,b,I):(0,vy._)(iD||(iD=k([""," === ",""])),r,S)}s(y,"equalCode")}};uC.default=pK});var aD=ue(dC=>{"use strict";f();Object.defineProperty(dC,"__esModule",{value:!0});var uK=rA(),dK=lA(),fK=yA(),mK=IA(),hK=PA(),yK=OA(),gK=AA(),bK=KA(),xK=tD(),vK=sD(),IK=[uK.default,dK.default,fK.default,mK.default,hK.default,yK.default,gK.default,bK.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},xK.default,vK.default];dC.default=IK});var mC=ue(Iy=>{"use strict";f();Object.defineProperty(Iy,"__esModule",{value:!0});Iy.validateAdditionalItems=void 0;var Ap=Je(),fC=_t(),lD,cD,SK={message:s(({params:{len:e}})=>(0,Ap.str)(lD||(lD=k(["must NOT have more than "," items"])),e),"message"),params:s(({params:{len:e}})=>(0,Ap._)(cD||(cD=k(["{limit: ","}"])),e),"params")},CK={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:SK,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,fC.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}fD(e,n)}},pD,uD,dD;function fD(e,t){let{gen:r,schema:n,data:o,keyword:i,it:a}=e;a.items=!0;let l=r.const("len",(0,Ap._)(pD||(pD=k(["",".length"])),o));if(n===!1)e.setParams({len:t.length}),e.pass((0,Ap._)(uD||(uD=k([""," <= ",""])),l,t.length));else if(typeof n=="object"&&!(0,fC.alwaysValidSchema)(a,n)){let u=r.var("valid",(0,Ap._)(dD||(dD=k([""," <= ",""])),l,t.length));r.if((0,Ap.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,l,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:fC.Type.Num},u),a.allErrors||r.if((0,Ap.not)(u),()=>r.break())})}s(c,"validateItems")}s(fD,"validateAdditionalItems");Iy.validateAdditionalItems=fD;Iy.default=CK});var hC=ue(Sy=>{"use strict";f();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.validateTuple=void 0;var mD=Je(),v0=_t(),TK=Zo(),PK={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return gD(e,"additionalItems",t);r.items=!0,!(0,v0.alwaysValidSchema)(r,t)&&e.ok((0,TK.validateArray)(e))}},hD,yD;function gD(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:l}=e;d(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=v0.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),u=n.const("len",(0,mD._)(hD||(hD=k(["",".length"])),i));r.forEach((h,y)=>{(0,v0.alwaysValidSchema)(l,h)||(n.if((0,mD._)(yD||(yD=k([""," > ",""])),u,y),()=>e.subschema({keyword:a,schemaProp:y,dataProp:y},c)),e.ok(c))});function d(h){let{opts:y,errSchemaPath:b}=l,I=r.length,S=I===h.minItems&&(I===h.maxItems||h[t]===!1);if(y.strictTuples&&!S){let x='"'.concat(a,'" is ').concat(I,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(b,'"');(0,v0.checkStrictMode)(l,x,y.strictTuples)}}s(d,"checkStrictTuple")}s(gD,"validateTuple");Sy.validateTuple=gD;Sy.default=PK});var bD=ue(yC=>{"use strict";f();Object.defineProperty(yC,"__esModule",{value:!0});var wK=hC(),MK={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:s(e=>(0,wK.validateTuple)(e,"items"),"code")};yC.default=MK});var SD=ue(gC=>{"use strict";f();Object.defineProperty(gC,"__esModule",{value:!0});var xD=Je(),OK=_t(),EK=Zo(),_K=mC(),vD,ID,kK={message:s(({params:{len:e}})=>(0,xD.str)(vD||(vD=k(["must NOT have more than "," items"])),e),"message"),params:s(({params:{len:e}})=>(0,xD._)(ID||(ID=k(["{limit: ","}"])),e),"params")},AK={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:kK,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,OK.alwaysValidSchema)(n,t)&&(o?(0,_K.validateAdditionalItems)(e,o):e.ok((0,EK.validateArray)(e)))}};gC.default=AK});var LD=ue(bC=>{"use strict";f();Object.defineProperty(bC,"__esModule",{value:!0});var Yo=Je(),I0=_t(),CD,TD,PD,wD,DK={message:s(({params:{min:e,max:t}})=>t===void 0?(0,Yo.str)(CD||(CD=k(["must contain at least "," valid item(s)"])),e):(0,Yo.str)(TD||(TD=k(["must contain at least "," and no more than "," valid item(s)"])),e,t),"message"),params:s(({params:{min:e,max:t}})=>t===void 0?(0,Yo._)(PD||(PD=k(["{minContains: ","}"])),e):(0,Yo._)(wD||(wD=k(["{minContains: ",", maxContains: ","}"])),e,t),"params")},MD,OD,ED,_D,kD,AD,DD,FD,FK={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:DK,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,a,l,{minContains:c,maxContains:u}=n;i.opts.next?(a=c===void 0?1:c,l=u):a=1;let d=t.const("len",(0,Yo._)(MD||(MD=k(["",".length"])),o));if(e.setParams({min:a,max:l}),l===void 0&&a===0){(0,I0.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,I0.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,I0.alwaysValidSchema)(i,r)){let S=(0,Yo._)(OD||(OD=k([""," >= ",""])),d,a);l!==void 0&&(S=(0,Yo._)(ED||(ED=k([""," && "," <= ",""])),S,d,l)),e.pass(S);return}i.items=!0;let h=t.name("valid");l===void 0&&a===1?b(h,()=>t.if(h,()=>t.break())):a===0?(t.let(h,!0),l!==void 0&&t.if((0,Yo._)(_D||(_D=k(["",".length > 0"])),o),y)):(t.let(h,!1),y()),e.result(h,()=>e.reset());function y(){let S=t.name("_valid"),x=t.let("count",0);b(S,()=>t.if(S,()=>I(x)))}s(y,"validateItemsWithCount");function b(S,x){t.forRange("i",0,d,T=>{e.subschema({keyword:"contains",dataProp:T,dataPropType:I0.Type.Num,compositeRule:!0},S),x()})}s(b,"validateItems");function I(S){t.code((0,Yo._)(kD||(kD=k(["","++"])),S)),l===void 0?t.if((0,Yo._)(AD||(AD=k([""," >= ",""])),S,a),()=>t.assign(h,!0).break()):(t.if((0,Yo._)(DD||(DD=k([""," > ",""])),S,l),()=>t.assign(h,!1).break()),a===1?t.assign(h,!0):t.if((0,Yo._)(FD||(FD=k([""," >= ",""])),S,a),()=>t.assign(h,!0)))}s(I,"checkLimits")}};bC.default=FK});var GD=ue(Es=>{"use strict";f();Object.defineProperty(Es,"__esModule",{value:!0});Es.validateSchemaDeps=Es.validatePropertyDeps=Es.error=void 0;var xC=Je(),LK=_t(),Cy=Zo(),RD,ND;Es.error={message:s(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,xC.str)(RD||(RD=k(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:s(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,xC._)(ND||(ND=k(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var RK={keyword:"dependencies",type:"object",schemaType:"object",error:Es.error,code(e){let[t,r]=NK(e);$D(e,t),jD(e,r)}};function NK({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}s(NK,"splitDependencies");var BD;function $D(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let a in t){let l=t[a];if(l.length===0)continue;let c=(0,Cy.propertyInData)(r,n,a,o.opts.ownProperties);e.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of l)(0,Cy.checkReportMissingProp)(e,u)}):(r.if((0,xC._)(BD||(BD=k([""," && (",")"])),c,(0,Cy.checkMissingProp)(e,l,i))),(0,Cy.reportMissingProp)(e,i),r.else())}}s($D,"validatePropertyDeps");Es.validatePropertyDeps=$D;function jD(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,a=r.name("valid");for(let l in t)(0,LK.alwaysValidSchema)(i,t[l])||(r.if((0,Cy.propertyInData)(r,n,l,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:l},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}s(jD,"validateSchemaDeps");Es.validateSchemaDeps=jD;Es.default=RK});var zD=ue(vC=>{"use strict";f();Object.defineProperty(vC,"__esModule",{value:!0});var VD=Je(),BK=_t(),UD,$K={message:"property name must be valid",params:s(({params:e})=>(0,VD._)(UD||(UD=k(["{propertyName: ","}"])),e.propertyName),"params")},jK={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:$K,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,BK.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),t.if((0,VD.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};vC.default=jK});var SC=ue(IC=>{"use strict";f();Object.defineProperty(IC,"__esModule",{value:!0});var S0=Zo(),Li=Je(),GK=La(),C0=_t(),HD,UK={message:"must NOT have additional properties",params:s(({params:e})=>(0,Li._)(HD||(HD=k(["{additionalProperty: ","}"])),e.additionalProperty),"params")},WD,qD,ZD,XD,VK={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:UK,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:a}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:l,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,C0.alwaysValidSchema)(a,r))return;let u=(0,S0.allSchemaProperties)(n.properties),d=(0,S0.allSchemaProperties)(n.patternProperties);h(),e.ok((0,Li._)(WD||(WD=k([""," === ",""])),i,GK.default.errors));function h(){t.forIn("key",o,x=>{!u.length&&!d.length?I(x):t.if(y(x),()=>I(x))})}s(h,"checkAdditionalProperties");function y(x){let T;if(u.length>8){let w=(0,C0.schemaRefOrVal)(a,n.properties,"properties");T=(0,S0.isOwnProperty)(t,w,x)}else u.length?T=(0,Li.or)(...u.map(w=>(0,Li._)(qD||(qD=k([""," === ",""])),x,w))):T=Li.nil;return d.length&&(T=(0,Li.or)(T,...d.map(w=>(0,Li._)(ZD||(ZD=k(["",".test(",")"])),(0,S0.usePattern)(e,w),x)))),(0,Li.not)(T)}s(y,"isAdditional");function b(x){t.code((0,Li._)(XD||(XD=k(["delete ","[","]"])),o,x))}s(b,"deleteAdditional");function I(x){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){b(x);return}if(r===!1){e.setParams({additionalProperty:x}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,C0.alwaysValidSchema)(a,r)){let T=t.name("valid");c.removeAdditional==="failing"?(S(x,T,!1),t.if((0,Li.not)(T),()=>{e.reset(),b(x)})):(S(x,T),l||t.if((0,Li.not)(T),()=>t.break()))}}s(I,"additionalPropertyCode");function S(x,T,w){let M={keyword:"additionalProperties",dataProp:x,dataPropType:C0.Type.Str};w===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(M,T)}s(S,"applyAdditionalSchema")}};IC.default=VK});var JD=ue(TC=>{"use strict";f();Object.defineProperty(TC,"__esModule",{value:!0});var zK=cy(),YD=Zo(),CC=_t(),KD=SC(),HK={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&KD.default.code(new zK.KeywordCxt(i,KD.default,"additionalProperties"));let a=(0,YD.allSchemaProperties)(r);for(let h of a)i.definedProperties.add(h);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=CC.mergeEvaluated.props(t,(0,CC.toHash)(a),i.props));let l=a.filter(h=>!(0,CC.alwaysValidSchema)(i,r[h]));if(l.length===0)return;let c=t.name("valid");for(let h of l)u(h)?d(h):(t.if((0,YD.propertyInData)(t,o,h,i.opts.ownProperties)),d(h),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(h),e.ok(c);function u(h){return i.opts.useDefaults&&!i.compositeRule&&r[h].default!==void 0}s(u,"hasDefault");function d(h){e.subschema({keyword:"properties",schemaProp:h,dataProp:h},c)}s(d,"applyPropertySchema")}};TC.default=HK});var oF=ue(PC=>{"use strict";f();Object.defineProperty(PC,"__esModule",{value:!0});var QD=Zo(),T0=Je(),eF=_t(),tF=_t(),rF,nF,WK={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:a}=i,l=(0,QD.allSchemaProperties)(r),c=l.filter(S=>(0,eF.alwaysValidSchema)(i,r[S]));if(l.length===0||c.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof T0.Name)&&(i.props=(0,tF.evaluatedPropsToName)(t,i.props));let{props:h}=i;y();function y(){for(let S of l)u&&b(S),i.allErrors?I(S):(t.var(d,!0),I(S),t.if(d))}s(y,"validatePatternProperties");function b(S){for(let x in u)new RegExp(S).test(x)&&(0,eF.checkStrictMode)(i,"property ".concat(x," matches pattern ").concat(S," (use allowMatchingProperties)"))}s(b,"checkMatchingProperties");function I(S){t.forIn("key",n,x=>{t.if((0,T0._)(rF||(rF=k(["",".test(",")"])),(0,QD.usePattern)(e,S),x),()=>{let T=c.includes(S);T||e.subschema({keyword:"patternProperties",schemaProp:S,dataProp:x,dataPropType:tF.Type.Str},d),i.opts.unevaluated&&h!==!0?t.assign((0,T0._)(nF||(nF=k(["","[","]"])),h,x),!0):!T&&!i.allErrors&&t.if((0,T0.not)(d),()=>t.break())})})}s(I,"validateProperties")}};PC.default=WK});var iF=ue(wC=>{"use strict";f();Object.defineProperty(wC,"__esModule",{value:!0});var qK=_t(),ZK={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,qK.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};wC.default=ZK});var sF=ue(MC=>{"use strict";f();Object.defineProperty(MC,"__esModule",{value:!0});var XK=Zo(),YK={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:XK.validateUnion,error:{message:"must match a schema in anyOf"}};MC.default=YK});var pF=ue(OC=>{"use strict";f();Object.defineProperty(OC,"__esModule",{value:!0});var P0=Je(),KK=_t(),aF,JK={message:"must match exactly one schema in oneOf",params:s(({params:e})=>(0,P0._)(aF||(aF=k(["{passingSchemas: ","}"])),e.passing),"params")},lF,cF,QK={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:JK,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,a=t.let("valid",!1),l=t.let("passing",null),c=t.name("_valid");e.setParams({passing:l}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,h)=>{let y;(0,KK.alwaysValidSchema)(o,d)?t.var(c,!0):y=e.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},c),h>0&&t.if((0,P0._)(lF||(lF=k([""," && ",""])),c,a)).assign(a,!1).assign(l,(0,P0._)(cF||(cF=k(["[",", ","]"])),l,h)).else(),t.if(c,()=>{t.assign(a,!0),t.assign(l,h),y&&e.mergeEvaluated(y,P0.Name)})})}s(u,"validateOneOf")}};OC.default=QK});var uF=ue(EC=>{"use strict";f();Object.defineProperty(EC,"__esModule",{value:!0});var eJ=_t(),tJ={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,a)=>{if((0,eJ.alwaysValidSchema)(n,i))return;let l=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o),e.mergeEvaluated(l)})}};EC.default=tJ});var gF=ue(_C=>{"use strict";f();Object.defineProperty(_C,"__esModule",{value:!0});var w0=Je(),yF=_t(),fF,mF,rJ={message:s(({params:e})=>(0,w0.str)(fF||(fF=k(['must match "','" schema'])),e.ifClause),"message"),params:s(({params:e})=>(0,w0._)(mF||(mF=k(["{failingKeyword: ","}"])),e.ifClause),"params")},hF,nJ={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rJ,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,yF.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=dF(n,"then"),i=dF(n,"else");if(!o&&!i)return;let a=t.let("valid",!0),l=t.name("_valid");if(c(),e.reset(),o&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(l,u("then",d),u("else",d))}else o?t.if(l,u("then")):t.if((0,w0.not)(l),u("else"));e.pass(a,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(d)}s(c,"validateIf");function u(d,h){return()=>{let y=e.subschema({keyword:d},l);t.assign(a,l),e.mergeValidEvaluated(y,a),h?t.assign(h,(0,w0._)(hF||(hF=k(["",""])),d)):e.setParams({ifClause:d})}}s(u,"validateClause")}};function dF(e,t){let r=e.schema[t];return r!==void 0&&!(0,yF.alwaysValidSchema)(e,r)}s(dF,"hasSchema");_C.default=nJ});var bF=ue(kC=>{"use strict";f();Object.defineProperty(kC,"__esModule",{value:!0});var oJ=_t(),iJ={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,oJ.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};kC.default=iJ});var xF=ue(AC=>{"use strict";f();Object.defineProperty(AC,"__esModule",{value:!0});var sJ=mC(),aJ=bD(),lJ=hC(),cJ=SD(),pJ=LD(),uJ=GD(),dJ=zD(),fJ=SC(),mJ=JD(),hJ=oF(),yJ=iF(),gJ=sF(),bJ=pF(),xJ=uF(),vJ=gF(),IJ=bF();function SJ(e=!1){let t=[yJ.default,gJ.default,bJ.default,xJ.default,vJ.default,IJ.default,dJ.default,fJ.default,uJ.default,mJ.default,hJ.default];return e?t.push(aJ.default,cJ.default):t.push(sJ.default,lJ.default),t.push(pJ.default),t}s(SJ,"getApplicator");AC.default=SJ});var NF=ue(DC=>{"use strict";f();Object.defineProperty(DC,"__esModule",{value:!0});var Er=Je(),vF,IF,CJ={message:s(({schemaCode:e})=>(0,Er.str)(vF||(vF=k(['must match format "','"'])),e),"message"),params:s(({schemaCode:e})=>(0,Er._)(IF||(IF=k(["{format: ","}"])),e),"params")},SF,CF,TF,PF,wF,MF,OF,EF,_F,kF,AF,DF,FF,LF,RF,TJ={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:CJ,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:h}=l;if(!c.validateFormats)return;o?y():b();function y(){let I=r.scopeValue("formats",{ref:h.formats,code:c.code.formats}),S=r.const("fDef",(0,Er._)(SF||(SF=k(["","[","]"])),I,a)),x=r.let("fType"),T=r.let("format");r.if((0,Er._)(CF||(CF=k(["typeof ",' == "object" && !('," instanceof RegExp)"])),S,S),()=>r.assign(x,(0,Er._)(TF||(TF=k(["",'.type || "string"'])),S)).assign(T,(0,Er._)(PF||(PF=k(["",".validate"])),S)),()=>r.assign(x,(0,Er._)(wF||(wF=k(['"string"'])))).assign(T,S)),e.fail$data((0,Er.or)(w(),M()));function w(){return c.strictSchema===!1?Er.nil:(0,Er._)(MF||(MF=k([""," && !",""])),a,T)}s(w,"unknownFmt");function M(){let O=d.$async?(0,Er._)(OF||(OF=k(["(",".async ? await ","(",") : ","(","))"])),S,T,n,T,n):(0,Er._)(EF||(EF=k(["","(",")"])),T,n),_=(0,Er._)(_F||(_F=k(["(typeof ",' == "function" ? '," : ",".test(","))"])),T,O,T,n);return(0,Er._)(kF||(kF=k([""," && "," !== true && "," === "," && !",""])),T,T,x,t,_)}s(M,"invalidFmt")}s(y,"validate$DataFormat");function b(){let I=h.formats[i];if(!I){w();return}if(I===!0)return;let[S,x,T]=M(I);S===t&&e.pass(O());function w(){if(c.strictSchema===!1){h.logger.warn(_());return}throw new Error(_());function _(){return'unknown format "'.concat(i,'" ignored in schema at path "').concat(u,'"')}}s(w,"unknownFormat");function M(_){let $=_ instanceof RegExp?(0,Er.regexpCode)(_):c.code.formats?(0,Er._)(AF||(AF=k(["","",""])),c.code.formats,(0,Er.getProperty)(i)):void 0,j=r.scopeValue("formats",{key:i,ref:_,code:$});return typeof _=="object"&&!(_ instanceof RegExp)?[_.type||"string",_.validate,(0,Er._)(DF||(DF=k(["",".validate"])),j)]:["string",_,j]}s(M,"getFormat");function O(){if(typeof I=="object"&&!(I instanceof RegExp)&&I.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Er._)(FF||(FF=k(["await ","(",")"])),T,n)}return typeof x=="function"?(0,Er._)(LF||(LF=k(["","(",")"])),T,n):(0,Er._)(RF||(RF=k(["",".test(",")"])),T,n)}s(O,"validCondition")}s(b,"validateFormat")}};DC.default=TJ});var BF=ue(FC=>{"use strict";f();Object.defineProperty(FC,"__esModule",{value:!0});var PJ=NF(),wJ=[PJ.default];FC.default=wJ});var $F=ue(nf=>{"use strict";f();Object.defineProperty(nf,"__esModule",{value:!0});nf.contentVocabulary=nf.metadataVocabulary=void 0;nf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];nf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var GF=ue(LC=>{"use strict";f();Object.defineProperty(LC,"__esModule",{value:!0});var MJ=Jk(),OJ=aD(),EJ=xF(),_J=BF(),jF=$F(),kJ=[MJ.default,OJ.default,(0,EJ.default)(),_J.default,jF.metadataVocabulary,jF.contentVocabulary];LC.default=kJ});var VF=ue(M0=>{"use strict";f();Object.defineProperty(M0,"__esModule",{value:!0});M0.DiscrError=void 0;var UF;(function(e){e.Tag="tag",e.Mapping="mapping"})(UF||(M0.DiscrError=UF={}))});var XF=ue(NC=>{"use strict";f();Object.defineProperty(NC,"__esModule",{value:!0});var of=Je(),RC=VF(),zF=c0(),AJ=py(),DJ=_t(),HF,FJ={message:s(({params:{discrError:e,tagName:t}})=>e===RC.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),"message"),params:s(({params:{discrError:e,tag:t,tagName:r}})=>(0,of._)(HF||(HF=k(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},WF,qF,ZF,LJ={keyword:"discriminator",type:"object",schemaType:"object",error:FJ,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:a}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,of._)(WF||(WF=k(["","",""])),r,(0,of.getProperty)(l)));t.if((0,of._)(qF||(qF=k(["typeof ",' == "string"'])),u),()=>d(),()=>e.error(!1,{discrError:RC.DiscrError.Tag,tag:u,tagName:l})),e.ok(c);function d(){let b=y();t.if(!1);for(let I in b)t.elseIf((0,of._)(ZF||(ZF=k([""," === ",""])),u,I)),t.assign(c,h(b[I]));t.else(),e.error(!1,{discrError:RC.DiscrError.Mapping,tag:u,tagName:l}),t.endIf()}s(d,"validateMapping");function h(b){let I=t.name("valid"),S=e.subschema({keyword:"oneOf",schemaProp:b},I);return e.mergeEvaluated(S,of.Name),I}s(h,"applyTagSchema");function y(){var b;let I={},S=T(o),x=!0;for(let O=0;O<a.length;O++){let _=a[O];if(_!=null&&_.$ref&&!(0,DJ.schemaHasRulesButRef)(_,i.self.RULES)){let j=_.$ref;if(_=zF.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,j),_ instanceof zF.SchemaEnv&&(_=_.schema),_===void 0)throw new AJ.default(i.opts.uriResolver,i.baseId,j)}let $=(b=_==null?void 0:_.properties)===null||b===void 0?void 0:b[l];if(typeof $!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(l,'"'));x=x&&(S||T(_)),w($,O)}if(!x)throw new Error('discriminator: "'.concat(l,'" must be required'));return I;function T({required:O}){return Array.isArray(O)&&O.includes(l)}function w(O,_){if(O.const)M(O.const,_);else if(O.enum)for(let $ of O.enum)M($,_);else throw new Error('discriminator: "properties/'.concat(l,'" must have "const" or "enum"'))}function M(O,_){if(typeof O!="string"||O in I)throw new Error('discriminator: "'.concat(l,'" values must be unique strings'));I[O]=_}}s(y,"getMapping")}};NC.default=LJ});var YF=ue((xTe,RJ)=>{RJ.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var jC=ue((rr,BC)=>{"use strict";f();Object.defineProperty(rr,"__esModule",{value:!0});rr.MissingRefError=rr.ValidationError=rr.CodeGen=rr.Name=rr.nil=rr.stringify=rr.str=rr._=rr.KeywordCxt=rr.Ajv=void 0;var NJ=Nk(),BJ=GF(),$J=XF(),KF=YF(),jJ=["/properties"],O0="http://json-schema.org/draft-07/schema",$C=class $C extends NJ.default{_addVocabularies(){super._addVocabularies(),BJ.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword($J.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(KF,jJ):KF;this.addMetaSchema(t,O0,!1),this.refs["http://json-schema.org/schema"]=O0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(O0)?O0:void 0)}};s($C,"Ajv");var sf=$C;rr.Ajv=sf;BC.exports=rr=sf;BC.exports.Ajv=sf;Object.defineProperty(rr,"__esModule",{value:!0});rr.default=sf;var GJ=cy();Object.defineProperty(rr,"KeywordCxt",{enumerable:!0,get:s(function(){return GJ.KeywordCxt},"get")});var af=Je();Object.defineProperty(rr,"_",{enumerable:!0,get:s(function(){return af._},"get")});Object.defineProperty(rr,"str",{enumerable:!0,get:s(function(){return af.str},"get")});Object.defineProperty(rr,"stringify",{enumerable:!0,get:s(function(){return af.stringify},"get")});Object.defineProperty(rr,"nil",{enumerable:!0,get:s(function(){return af.nil},"get")});Object.defineProperty(rr,"Name",{enumerable:!0,get:s(function(){return af.Name},"get")});Object.defineProperty(rr,"CodeGen",{enumerable:!0,get:s(function(){return af.CodeGen},"get")});var UJ=a0();Object.defineProperty(rr,"ValidationError",{enumerable:!0,get:s(function(){return UJ.default},"get")});var VJ=py();Object.defineProperty(rr,"MissingRefError",{enumerable:!0,get:s(function(){return VJ.default},"get")})});var nL=ue(_s=>{"use strict";f();Object.defineProperty(_s,"__esModule",{value:!0});_s.formatNames=_s.fastFormats=_s.fullFormats=void 0;function lf(e,t){return{validate:e,compare:t}}s(lf,"fmtDef");_s.fullFormats={date:lf(eL,VC),time:lf(tL,zC),"date-time":lf(qJ,rL),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:YJ,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:new RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:nQ,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:KJ,int32:{type:"number",validate:eQ},int64:{type:"number",validate:tQ},float:{type:"number",validate:QF},double:{type:"number",validate:QF},password:!0,binary:!0};_s.fastFormats=R(P({},_s.fullFormats),{date:lf(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,VC),time:lf(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,zC),"date-time":lf(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,rL),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});_s.formatNames=Object.keys(_s.fullFormats);function zJ(e){return e%4===0&&(e%100!==0||e%400===0)}s(zJ,"isLeapYear");var HJ=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,WJ=[0,31,28,31,30,31,30,31,31,30,31,30,31];function eL(e){let t=HJ.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&zJ(r)?29:WJ[n])}s(eL,"date");function VC(e,t){if(e&&t)return e>t?1:e<t?-1:0}s(VC,"compareDate");var GC=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function tL(e,t){let r=GC.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3],a=r[5];return(n<=23&&o<=59&&i<=59||n===23&&o===59&&i===60)&&(!t||a!=="")}s(tL,"time");function zC(e,t){if(!(e&&t))return;let r=GC.exec(e),n=GC.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}s(zC,"compareTime");var UC=/t|\s/i;function qJ(e){let t=e.split(UC);return t.length===2&&eL(t[0])&&tL(t[1],!0)}s(qJ,"date_time");function rL(e,t){if(!(e&&t))return;let[r,n]=e.split(UC),[o,i]=t.split(UC),a=VC(r,o);if(a!==void 0)return a||zC(n,i)}s(rL,"compareDateTime");var ZJ=/\/|:/,XJ=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function YJ(e){return ZJ.test(e)&&XJ.test(e)}s(YJ,"uri");var JF=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function KJ(e){return JF.lastIndex=0,JF.test(e)}s(KJ,"byte");var JJ=-(2**31),QJ=2**31-1;function eQ(e){return Number.isInteger(e)&&e<=QJ&&e>=JJ}s(eQ,"validateInt32");function tQ(e){return Number.isInteger(e)}s(tQ,"validateInt64");function QF(){return!0}s(QF,"validateNumber");var rQ=/[^\\]\\Z/;function nQ(e){if(rQ.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}s(nQ,"regex")});var dL=ue(cf=>{"use strict";f();Object.defineProperty(cf,"__esModule",{value:!0});cf.formatLimitDefinition=void 0;var oQ=jC(),Ri=Je(),ac=Ri.operators,E0={formatMaximum:{okStr:"<=",ok:ac.LTE,fail:ac.GT},formatMinimum:{okStr:">=",ok:ac.GTE,fail:ac.LT},formatExclusiveMaximum:{okStr:"<",ok:ac.LT,fail:ac.GTE},formatExclusiveMinimum:{okStr:">",ok:ac.GT,fail:ac.LTE}},oL,iL,iQ={message:s(({keyword:e,schemaCode:t})=>Ri.str(oL||(oL=k(["should be "," ",""])),E0[e].okStr,t),"message"),params:s(({keyword:e,schemaCode:t})=>Ri._(iL||(iL=k(["{comparison: ",", limit: ","}"])),E0[e].okStr,t),"params")},sL,aL,lL,cL,pL,uL;cf.formatLimitDefinition={keyword:Object.keys(E0),type:"string",schemaType:"string",$data:!0,error:iQ,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:a,self:l}=i;if(!a.validateFormats)return;let c=new oQ.KeywordCxt(i,l.RULES.all.format.definition,"format");c.$data?u():d();function u(){let y=t.scopeValue("formats",{ref:l.formats,code:a.code.formats}),b=t.const("fmt",Ri._(sL||(sL=k(["","[","]"])),y,c.schemaCode));e.fail$data(Ri.or(Ri._(aL||(aL=k(["typeof ",' != "object"'])),b),Ri._(lL||(lL=k([""," instanceof RegExp"])),b),Ri._(cL||(cL=k(["typeof ",'.compare != "function"'])),b),h(b)))}s(u,"validate$DataFormat");function d(){let y=c.schema,b=l.formats[y];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error('"'.concat(o,'": format "').concat(y,'" does not define "compare" function'));let I=t.scopeValue("formats",{key:y,ref:b,code:a.code.formats?Ri._(pL||(pL=k(["","",""])),a.code.formats,Ri.getProperty(y)):void 0});e.fail$data(h(I))}s(d,"validateFormat");function h(y){return Ri._(uL||(uL=k(["",".compare(",", ",") "," 0"])),y,r,n,E0[o].fail)}s(h,"compareCode")},dependencies:["format"]};var sQ=s(e=>(e.addKeyword(cf.formatLimitDefinition),e),"formatLimitPlugin");cf.default=sQ});var gL=ue((Ty,yL)=>{"use strict";f();Object.defineProperty(Ty,"__esModule",{value:!0});var pf=nL(),aQ=dL(),HC=Je(),fL=new HC.Name("fullFormats"),lQ=new HC.Name("fastFormats"),WC=s((e,t={keywords:!0})=>{if(Array.isArray(t))return mL(e,t,pf.fullFormats,fL),e;let[r,n]=t.mode==="fast"?[pf.fastFormats,lQ]:[pf.fullFormats,fL],o=t.formats||pf.formatNames;return mL(e,o,r,n),t.keywords&&aQ.default(e),e},"formatsPlugin");WC.get=(e,t="full")=>{let n=(t==="fast"?pf.fastFormats:pf.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var hL;function mL(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=HC._(hL||(hL=k(['require("ajv-formats/dist/formats").',""])),n));for(let a of t)e.addFormat(a,r[a])}s(mL,"addFormats");yL.exports=Ty=WC;Object.defineProperty(Ty,"__esModule",{value:!0});Ty.default=WC});var rG=ue((UZe,zw)=>{"use strict";f();var dv=ZW();dv.default&&(dv=dv.default);zw.exports=tG;zw.exports.default=tG;function tG(e,t,r){t=t||1;for(var n,o,i,a,l=0;l<e[0].length;l++){var c=e[0][l];(!l||c[0]<n)&&(n=c[0]),(!l||c[1]<o)&&(o=c[1]),(!l||c[0]>i)&&(i=c[0]),(!l||c[1]>a)&&(a=c[1])}var u=i-n,d=a-o,h=Math.min(u,d),y=h/2;if(h===0){var b=[n,o];return b.distance=0,b}for(var I=new dv(void 0,ope),S=n;S<i;S+=h)for(var x=o;x<a;x+=h)I.push(new bc(S+y,x+y,y,e));var T=spe(e),w=new bc(n+u/2,o+d/2,0,e);w.d>T.d&&(T=w);for(var M=I.length;I.length;){var O=I.pop();O.d>T.d&&(T=O,r&&console.log("found best %d after %d probes",Math.round(1e4*O.d)/1e4,M)),!(O.max-T.d<=t)&&(y=O.h/2,I.push(new bc(O.x-y,O.y-y,y,e)),I.push(new bc(O.x+y,O.y-y,y,e)),I.push(new bc(O.x-y,O.y+y,y,e)),I.push(new bc(O.x+y,O.y+y,y,e)),M+=4)}r&&(console.log("num probes: "+M),console.log("best distance: "+T.d));var _=[T.x,T.y];return _.distance=T.d,_}s(tG,"polylabel");function ope(e,t){return t.max-e.max}s(ope,"compareMax");function bc(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=ipe(e,t,n),this.max=this.d+this.h*Math.SQRT2}s(bc,"Cell");function ipe(e,t,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var a=r[i],l=0,c=a.length,u=c-1;l<c;u=l++){var d=a[l],h=a[u];d[1]>t!=h[1]>t&&e<(h[0]-d[0])*(t-d[1])/(h[1]-d[1])+d[0]&&(n=!n),o=Math.min(o,ape(e,t,d,h))}return o===0?0:(n?1:-1)*Math.sqrt(o)}s(ipe,"pointToPolygonDist");function spe(e){for(var t=0,r=0,n=0,o=e[0],i=0,a=o.length,l=a-1;i<a;l=i++){var c=o[i],u=o[l],d=c[0]*u[1]-u[0]*c[1];r+=(c[0]+u[0])*d,n+=(c[1]+u[1])*d,t+=d*3}return t===0?new bc(o[0][0],o[0][1],0,e):new bc(r/t,n/t,0,e)}s(spe,"getCentroidCell");function ape(e,t,r,n){var o=r[0],i=r[1],a=n[0]-o,l=n[1]-i;if(a!==0||l!==0){var c=((e-o)*a+(t-i)*l)/(a*a+l*l);c>1?(o=n[0],i=n[1]):c>0&&(o+=a*c,i+=l*c)}return a=e-o,l=t-i,a*a+l*l}s(ape,"getSegDistSq")});var NG=ue((u4,d4)=>{f();(function(e,t){typeof u4=="object"&&typeof d4<"u"?d4.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(u4,function(){"use strict";function e(x,T,w,M,O){s(function _($,j,F,L,q){for(;L>F;){if(L-F>600){var U=L-F+1,V=j-F+1,Q=Math.log(U),Y=.5*Math.exp(2*Q/3),se=.5*Math.sqrt(Q*Y*(U-Y)/U)*(V-U/2<0?-1:1),re=Math.max(F,Math.floor(j-V*Y/U+se)),ve=Math.min(L,Math.floor(j+(U-V)*Y/U+se));_($,j,re,ve,q)}var we=$[j],ye=F,Ne=L;for(t($,F,j),q($[L],we)>0&&t($,F,L);ye<Ne;){for(t($,ye,Ne),ye++,Ne--;q($[ye],we)<0;)ye++;for(;q($[Ne],we)>0;)Ne--}q($[F],we)===0?t($,F,Ne):t($,++Ne,L),Ne<=j&&(F=Ne+1),j<=Ne&&(L=Ne-1)}},"t")(x,T,w||0,M||x.length-1,O||r)}s(e,"t");function t(x,T,w){var M=x[T];x[T]=x[w],x[w]=M}s(t,"i");function r(x,T){return x<T?-1:x>T?1:0}s(r,"n");var n=s(function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function o(x,T,w){if(!w)return T.indexOf(x);for(var M=0;M<T.length;M++)if(w(x,T[M]))return M;return-1}s(o,"e");function i(x,T){a(x,0,x.children.length,T,x)}s(i,"a");function a(x,T,w,M,O){O||(O=I(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var _=T;_<w;_++){var $=x.children[_];l(O,x.leaf?M($):$)}return O}s(a,"h");function l(x,T){return x.minX=Math.min(x.minX,T.minX),x.minY=Math.min(x.minY,T.minY),x.maxX=Math.max(x.maxX,T.maxX),x.maxY=Math.max(x.maxY,T.maxY),x}s(l,"o");function c(x,T){return x.minX-T.minX}s(c,"s");function u(x,T){return x.minY-T.minY}s(u,"l");function d(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}s(d,"f");function h(x){return x.maxX-x.minX+(x.maxY-x.minY)}s(h,"u");function y(x,T){return x.minX<=T.minX&&x.minY<=T.minY&&T.maxX<=x.maxX&&T.maxY<=x.maxY}s(y,"m");function b(x,T){return T.minX<=x.maxX&&T.minY<=x.maxY&&T.maxX>=x.minX&&T.maxY>=x.minY}s(b,"c");function I(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}s(I,"p");function S(x,T,w,M,O){for(var _=[T,w];_.length;)if(!((w=_.pop())-(T=_.pop())<=M)){var $=T+Math.ceil((w-T)/M/2)*M;e(x,$,T,w,O),_.push(T,$,$,w)}}return s(S,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(x){var T=this.data,w=[];if(!b(x,T))return w;for(var M=this.toBBox,O=[];T;){for(var _=0;_<T.children.length;_++){var $=T.children[_],j=T.leaf?M($):$;b(x,j)&&(T.leaf?w.push($):y(x,j)?this._all($,w):O.push($))}T=O.pop()}return w},n.prototype.collides=function(x){var T=this.data;if(!b(x,T))return!1;for(var w=[];T;){for(var M=0;M<T.children.length;M++){var O=T.children[M],_=T.leaf?this.toBBox(O):O;if(b(x,_)){if(T.leaf||y(x,_))return!0;w.push(O)}}T=w.pop()}return!1},n.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var T=0;T<x.length;T++)this.insert(x[T]);return this}var w=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===w.height)this._splitRoot(this.data,w);else{if(this.data.height<w.height){var M=this.data;this.data=w,w=M}this._insert(w,this.data.height-w.height-1,!0)}else this.data=w;return this},n.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},n.prototype.clear=function(){return this.data=I([]),this},n.prototype.remove=function(x,T){if(!x)return this;for(var w,M,O,_=this.data,$=this.toBBox(x),j=[],F=[];_||j.length;){if(_||(_=j.pop(),M=j[j.length-1],w=F.pop(),O=!0),_.leaf){var L=o(x,_.children,T);if(L!==-1)return _.children.splice(L,1),j.push(_),this._condense(j),this}O||_.leaf||!y(_,$)?M?(w++,_=M.children[w],O=!1):_=null:(j.push(_),F.push(w),w=0,M=_,_=_.children[0])}return this},n.prototype.toBBox=function(x){return x},n.prototype.compareMinX=function(x,T){return x.minX-T.minX},n.prototype.compareMinY=function(x,T){return x.minY-T.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(x){return this.data=x,this},n.prototype._all=function(x,T){for(var w=[];x;)x.leaf?T.push.apply(T,x.children):w.push.apply(w,x.children),x=w.pop();return T},n.prototype._build=function(x,T,w,M){var O,_=w-T+1,$=this._maxEntries;if(_<=$)return i(O=I(x.slice(T,w+1)),this.toBBox),O;M||(M=Math.ceil(Math.log(_)/Math.log($)),$=Math.ceil(_/Math.pow($,M-1))),(O=I([])).leaf=!1,O.height=M;var j=Math.ceil(_/$),F=j*Math.ceil(Math.sqrt($));S(x,T,w,F,this.compareMinX);for(var L=T;L<=w;L+=F){var q=Math.min(L+F-1,w);S(x,L,q,j,this.compareMinY);for(var U=L;U<=q;U+=j){var V=Math.min(U+j-1,q);O.children.push(this._build(x,U,V,M-1))}}return i(O,this.toBBox),O},n.prototype._chooseSubtree=function(x,T,w,M){for(;M.push(T),!T.leaf&&M.length-1!==w;){for(var O=1/0,_=1/0,$=void 0,j=0;j<T.children.length;j++){var F=T.children[j],L=d(F),q=(U=x,V=F,(Math.max(V.maxX,U.maxX)-Math.min(V.minX,U.minX))*(Math.max(V.maxY,U.maxY)-Math.min(V.minY,U.minY))-L);q<_?(_=q,O=L<O?L:O,$=F):q===_&&L<O&&(O=L,$=F)}T=$||T.children[0]}var U,V;return T},n.prototype._insert=function(x,T,w){var M=w?x:this.toBBox(x),O=[],_=this._chooseSubtree(M,this.data,T,O);for(_.children.push(x),l(_,M);T>=0&&O[T].children.length>this._maxEntries;)this._split(O,T),T--;this._adjustParentBBoxes(M,O,T)},n.prototype._split=function(x,T){var w=x[T],M=w.children.length,O=this._minEntries;this._chooseSplitAxis(w,O,M);var _=this._chooseSplitIndex(w,O,M),$=I(w.children.splice(_,w.children.length-_));$.height=w.height,$.leaf=w.leaf,i(w,this.toBBox),i($,this.toBBox),T?x[T-1].children.push($):this._splitRoot(w,$)},n.prototype._splitRoot=function(x,T){this.data=I([x,T]),this.data.height=x.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(x,T,w){for(var M,O,_,$,j,F,L,q=1/0,U=1/0,V=T;V<=w-T;V++){var Q=a(x,0,V,this.toBBox),Y=a(x,V,w,this.toBBox),se=(O=Q,_=Y,$=void 0,j=void 0,F=void 0,L=void 0,$=Math.max(O.minX,_.minX),j=Math.max(O.minY,_.minY),F=Math.min(O.maxX,_.maxX),L=Math.min(O.maxY,_.maxY),Math.max(0,F-$)*Math.max(0,L-j)),re=d(Q)+d(Y);se<q?(q=se,M=V,U=re<U?re:U):se===q&&re<U&&(U=re,M=V)}return M||w-T},n.prototype._chooseSplitAxis=function(x,T,w){var M=x.leaf?this.compareMinX:c,O=x.leaf?this.compareMinY:u;this._allDistMargin(x,T,w,M)<this._allDistMargin(x,T,w,O)&&x.children.sort(M)},n.prototype._allDistMargin=function(x,T,w,M){x.children.sort(M);for(var O=this.toBBox,_=a(x,0,T,O),$=a(x,w-T,w,O),j=h(_)+h($),F=T;F<w-T;F++){var L=x.children[F];l(_,x.leaf?O(L):L),j+=h(_)}for(var q=w-T-1;q>=T;q--){var U=x.children[q];l($,x.leaf?O(U):U),j+=h($)}return j},n.prototype._adjustParentBBoxes=function(x,T,w){for(var M=w;M>=0;M--)l(T[M],x)},n.prototype._condense=function(x){for(var T=x.length-1,w=void 0;T>=0;T--)x[T].children.length===0?T>0?(w=x[T-1].children).splice(w.indexOf(x[T]),1):this.clear():i(x[T],this.toBBox)},n})});var g4=ue(Le=>{"use strict";f();Object.defineProperty(Le,"__esModule",{value:!0});Le.earthRadius=63710088e-1;Le.factors={centimeters:Le.earthRadius*100,centimetres:Le.earthRadius*100,degrees:Le.earthRadius/111325,feet:Le.earthRadius*3.28084,inches:Le.earthRadius*39.37,kilometers:Le.earthRadius/1e3,kilometres:Le.earthRadius/1e3,meters:Le.earthRadius,metres:Le.earthRadius,miles:Le.earthRadius/1609.344,millimeters:Le.earthRadius*1e3,millimetres:Le.earthRadius*1e3,nauticalmiles:Le.earthRadius/1852,radians:1,yards:Le.earthRadius*1.0936};Le.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Le.earthRadius,yards:1.0936133};Le.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function vc(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}s(vc,"feature");Le.feature=vc;function Ype(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return f4(t).geometry;case"LineString":return h4(t).geometry;case"Polygon":return m4(t).geometry;case"MultiPoint":return $G(t).geometry;case"MultiLineString":return BG(t).geometry;case"MultiPolygon":return jG(t).geometry;default:throw new Error(e+" is invalid")}}s(Ype,"geometry");Le.geometry=Ype;function f4(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Tv(e[0])||!Tv(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return vc(n,t,r)}s(f4,"point");Le.point=f4;function Kpe(e,t,r){return r===void 0&&(r={}),Pv(e.map(function(n){return f4(n,t)}),r)}s(Kpe,"points");Le.points=Kpe;function m4(e,t,r){r===void 0&&(r={});for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return vc(l,t,r)}s(m4,"polygon");Le.polygon=m4;function Jpe(e,t,r){return r===void 0&&(r={}),Pv(e.map(function(n){return m4(n,t)}),r)}s(Jpe,"polygons");Le.polygons=Jpe;function h4(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return vc(n,t,r)}s(h4,"lineString");Le.lineString=h4;function Qpe(e,t,r){return r===void 0&&(r={}),Pv(e.map(function(n){return h4(n,t)}),r)}s(Qpe,"lineStrings");Le.lineStrings=Qpe;function Pv(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}s(Pv,"featureCollection");Le.featureCollection=Pv;function BG(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return vc(n,t,r)}s(BG,"multiLineString");Le.multiLineString=BG;function $G(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return vc(n,t,r)}s($G,"multiPoint");Le.multiPoint=$G;function jG(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return vc(n,t,r)}s(jG,"multiPolygon");Le.multiPolygon=jG;function eue(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return vc(n,t,r)}s(eue,"geometryCollection");Le.geometryCollection=eue;function tue(e,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r}s(tue,"round");Le.round=tue;function GG(e,t){t===void 0&&(t="kilometers");var r=Le.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}s(GG,"radiansToLength");Le.radiansToLength=GG;function y4(e,t){t===void 0&&(t="kilometers");var r=Le.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}s(y4,"lengthToRadians");Le.lengthToRadians=y4;function rue(e,t){return UG(y4(e,t))}s(rue,"lengthToDegrees");Le.lengthToDegrees=rue;function nue(e){var t=e%360;return t<0&&(t+=360),t}s(nue,"bearingToAzimuth");Le.bearingToAzimuth=nue;function UG(e){var t=e%(2*Math.PI);return t*180/Math.PI}s(UG,"radiansToDegrees");Le.radiansToDegrees=UG;function oue(e){var t=e%360;return t*Math.PI/180}s(oue,"degreesToRadians");Le.degreesToRadians=oue;function iue(e,t,r){if(t===void 0&&(t="kilometers"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return GG(y4(e,t),r)}s(iue,"convertLength");Le.convertLength=iue;function sue(e,t,r){if(t===void 0&&(t="meters"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=Le.areaFactors[t];if(!n)throw new Error("invalid original units");var o=Le.areaFactors[r];if(!o)throw new Error("invalid final units");return e/n*o}s(sue,"convertArea");Le.convertArea=sue;function Tv(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}s(Tv,"isNumber");Le.isNumber=Tv;function aue(e){return!!e&&e.constructor===Object}s(aue,"isObject");Le.isObject=aue;function lue(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!Tv(t))throw new Error("bbox must only contain numbers")})}s(lue,"validateBBox");Le.validateBBox=lue;function cue(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}s(cue,"validateId");Le.validateId=cue});var x4=ue(Hr=>{"use strict";f();Object.defineProperty(Hr,"__esModule",{value:!0});var Dn=g4();function pg(e,t,r){if(e!==null)for(var n,o,i,a,l,c,u,d=0,h=0,y,b=e.type,I=b==="FeatureCollection",S=b==="Feature",x=I?e.features.length:1,T=0;T<x;T++){u=I?e.features[T].geometry:S?e.geometry:e,y=u?u.type==="GeometryCollection":!1,l=y?u.geometries.length:1;for(var w=0;w<l;w++){var M=0,O=0;if(a=y?u.geometries[w]:u,a!==null){c=a.coordinates;var _=a.type;switch(d=r&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(t(c,h,T,M,O)===!1)return!1;h++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],h,T,M,O)===!1)return!1;h++,_==="MultiPoint"&&M++}_==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(t(c[n][o],h,T,M,O)===!1)return!1;h++}_==="MultiLineString"&&M++,_==="Polygon"&&O++}_==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(O=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-d;i++){if(t(c[n][o][i],h,T,M,O)===!1)return!1;h++}O++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(pg(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(pg,"coordEach");function pue(e,t,r,n){var o=r;return pg(e,function(i,a,l,c,u){a===0&&r===void 0?o=i:o=t(o,i,a,l,c,u)},n),o}s(pue,"coordReduce");function VG(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}s(VG,"propEach");function uue(e,t,r){var n=r;return VG(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(uue,"propReduce");function zG(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}s(zG,"featureEach");function due(e,t,r){var n=r;return zG(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(due,"featureReduce");function fue(e){var t=[];return pg(e,function(r){t.push(r)}),t}s(fue,"coordAll");function b4(e,t){var r,n,o,i,a,l,c,u,d,h,y=0,b=e.type==="FeatureCollection",I=e.type==="Feature",S=b?e.features.length:1;for(r=0;r<S;r++){for(l=b?e.features[r].geometry:I?e.geometry:e,u=b?e.features[r].properties:I?e.properties:{},d=b?e.features[r].bbox:I?e.bbox:void 0,h=b?e.features[r].id:I?e.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,o=0;o<a;o++){if(i=c?l.geometries[o]:l,i===null){if(t(null,y,u,d,h)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,y,u,d,h)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],y,u,d,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}s(b4,"geomEach");function mue(e,t,r){var n=r;return b4(e,function(o,i,a,l,c){i===0&&r===void 0?n=o:n=t(n,o,i,a,l,c)}),n}s(mue,"geomReduce");function wv(e,t){b4(e,function(r,n,o,i,a){var l=r===null?null:r.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return t(Dn.feature(r,o,{bbox:i,id:a}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var d=r.coordinates[u],h={type:c,coordinates:d};if(t(Dn.feature(h,o),n,u)===!1)return!1}})}s(wv,"flattenEach");function hue(e,t,r){var n=r;return wv(e,function(o,i,a){i===0&&a===0&&r===void 0?n=o:n=t(n,o,i,a)}),n}s(hue,"flattenReduce");function HG(e,t){wv(e,function(r,n,o){var i=0;if(r.geometry){var a=r.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,u=0,d=0;if(pg(r,function(h,y,b,I,S){if(l===void 0||n>c||I>u||S>d){l=h,c=n,u=I,d=S,i=0;return}var x=Dn.lineString([l,h],r.properties);if(t(x,n,o,S,i)===!1)return!1;i++,l=h})===!1)return!1}}})}s(HG,"segmentEach");function yue(e,t,r){var n=r,o=!1;return HG(e,function(i,a,l,c,u){o===!1&&r===void 0?n=i:n=t(n,i,a,l,c,u),o=!0}),n}s(yue,"segmentReduce");function WG(e,t){if(!e)throw new Error("geojson is required");wv(e,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,a=r.geometry.coordinates;switch(i){case"LineString":if(t(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(t(Dn.lineString(a[l],r.properties),n,o,l)===!1)return!1;break}}})}s(WG,"lineEach");function gue(e,t,r){var n=r;return WG(e,function(o,i,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,a,l)}),n}s(gue,"lineReduce");function bue(e,t){if(t=t||{},!Dn.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.segmentIndex||0,a=t.properties,l;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,l=e.features[r].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),Dn.lineString([c[i],c[i+1]],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),Dn.lineString([c[o][i],c[o][i+1]],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),Dn.lineString([c[n][i],c[n][i+1]],a,t);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i-1),Dn.lineString([c[n][o][i],c[n][o][i+1]],a,t)}throw new Error("geojson is invalid")}s(bue,"findSegment");function xue(e,t){if(t=t||{},!Dn.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.coordIndex||0,a=t.properties,l;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,l=e.features[r].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return Dn.point(c,a,t);case"MultiPoint":return n<0&&(n=c.length+n),Dn.point(c[n],a,t);case"LineString":return i<0&&(i=c.length+i),Dn.point(c[i],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),Dn.point(c[o][i],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),Dn.point(c[n][i],a,t);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),i<0&&(i=c[n][o].length-i),Dn.point(c[n][o][i],a,t)}throw new Error("geojson is invalid")}s(xue,"findPoint");Hr.coordAll=fue;Hr.coordEach=pg;Hr.coordReduce=pue;Hr.featureEach=zG;Hr.featureReduce=due;Hr.findPoint=xue;Hr.findSegment=bue;Hr.flattenEach=wv;Hr.flattenReduce=hue;Hr.geomEach=b4;Hr.geomReduce=mue;Hr.lineEach=WG;Hr.lineReduce=gue;Hr.propEach=VG;Hr.propReduce=uue;Hr.segmentEach=HG;Hr.segmentReduce=yue});var qG=ue(I4=>{"use strict";f();Object.defineProperty(I4,"__esModule",{value:!0});var vue=x4();function v4(e){var t=[1/0,1/0,-1/0,-1/0];return vue.coordEach(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}s(v4,"bbox");v4.default=v4;I4.default=v4});var JG=ue((hQe,S4)=>{f();var Zs=NG(),XG=g4(),YG=x4(),rm=qG().default,Iue=YG.featureEach,fQe=YG.coordEach,mQe=XG.polygon,ZG=XG.featureCollection;function KG(e){var t=new Zs(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:rm(r),Zs.prototype.insert.call(this,r)},t.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:rm(o),n.push(o)}):Iue(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:rm(o),n.push(o)}),Zs.prototype.load.call(this,n)},t.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:rm(r),Zs.prototype.remove.call(this,r,n)},t.clear=function(){return Zs.prototype.clear.call(this)},t.search=function(r){var n=Zs.prototype.search.call(this,this.toBBox(r));return ZG(n)},t.collides=function(r){return Zs.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=Zs.prototype.all.call(this);return ZG(r)},t.toJSON=function(){return Zs.prototype.toJSON.call(this)},t.fromJSON=function(r){return Zs.prototype.fromJSON.call(this,r)},t.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=rm(r);else if(r.type==="FeatureCollection")n=rm(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}s(KG,"geojsonRbush");S4.exports=KG;S4.exports.default=KG});var v5=ue((Cg,ym)=>{f();var Hde=200,RU="__lodash_hash_undefined__",Wde=800,qde=16,NU=9007199254740991,BU="[object Arguments]",Zde="[object Array]",Xde="[object AsyncFunction]",Yde="[object Boolean]",Kde="[object Date]",Jde="[object Error]",$U="[object Function]",Qde="[object GeneratorFunction]",efe="[object Map]",tfe="[object Number]",rfe="[object Null]",jU="[object Object]",nfe="[object Proxy]",ofe="[object RegExp]",ife="[object Set]",sfe="[object String]",afe="[object Undefined]",lfe="[object WeakMap]",cfe="[object ArrayBuffer]",pfe="[object DataView]",ufe="[object Float32Array]",dfe="[object Float64Array]",ffe="[object Int8Array]",mfe="[object Int16Array]",hfe="[object Int32Array]",yfe="[object Uint8Array]",gfe="[object Uint8ClampedArray]",bfe="[object Uint16Array]",xfe="[object Uint32Array]",vfe=/[\\^$.*+?()[\]{}|]/g,Ife=/^\[object .+?Constructor\]$/,Sfe=/^(?:0|[1-9]\d*)$/,ar={};ar[ufe]=ar[dfe]=ar[ffe]=ar[mfe]=ar[hfe]=ar[yfe]=ar[gfe]=ar[bfe]=ar[xfe]=!0;ar[BU]=ar[Zde]=ar[cfe]=ar[Yde]=ar[pfe]=ar[Kde]=ar[Jde]=ar[$U]=ar[efe]=ar[tfe]=ar[jU]=ar[ofe]=ar[ife]=ar[sfe]=ar[lfe]=!1;var GU=typeof global=="object"&&global&&global.Object===Object&&global,Cfe=typeof self=="object"&&self&&self.Object===Object&&self,wg=GU||Cfe||Function("return this")(),UU=typeof Cg=="object"&&Cg&&!Cg.nodeType&&Cg,Tg=UU&&typeof ym=="object"&&ym&&!ym.nodeType&&ym,VU=Tg&&Tg.exports===UU,p5=VU&&GU.process,MU=function(){try{var e=Tg&&Tg.require&&Tg.require("util").types;return e||p5&&p5.binding&&p5.binding("util")}catch(t){}}(),OU=MU&&MU.isTypedArray;function Tfe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}s(Tfe,"apply");function Pfe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(Pfe,"baseTimes");function wfe(e){return function(t){return e(t)}}s(wfe,"baseUnary");function Mfe(e,t){return e==null?void 0:e[t]}s(Mfe,"getValue");function Ofe(e,t){return function(r){return e(t(r))}}s(Ofe,"overArg");var Efe=Array.prototype,_fe=Function.prototype,zv=Object.prototype,u5=wg["__core-js_shared__"],Hv=_fe.toString,ul=zv.hasOwnProperty,EU=function(){var e=/[^.]+$/.exec(u5&&u5.keys&&u5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),zU=zv.toString,kfe=Hv.call(Object),Afe=RegExp("^"+Hv.call(ul).replace(vfe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Uv=VU?wg.Buffer:void 0,_U=wg.Symbol,kU=wg.Uint8Array,AU=Uv?Uv.allocUnsafe:void 0,HU=Ofe(Object.getPrototypeOf,Object),DU=Object.create,Dfe=zv.propertyIsEnumerable,Ffe=Efe.splice,Tu=_U?_U.toStringTag:void 0,Vv=function(){try{var e=g5(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Lfe=Uv?Uv.isBuffer:void 0,FU=Math.max,Rfe=Date.now,WU=g5(wg,"Map"),Pg=g5(Object,"create"),Nfe=function(){function e(){}return s(e,"object"),function(t){if(!wu(t))return{};if(DU)return DU(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Pu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Pu,"Hash");function Bfe(){this.__data__=Pg?Pg(null):{},this.size=0}s(Bfe,"hashClear");function $fe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}s($fe,"hashDelete");function jfe(e){var t=this.__data__;if(Pg){var r=t[e];return r===RU?void 0:r}return ul.call(t,e)?t[e]:void 0}s(jfe,"hashGet");function Gfe(e){var t=this.__data__;return Pg?t[e]!==void 0:ul.call(t,e)}s(Gfe,"hashHas");function Ufe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Pg&&t===void 0?RU:t,this}s(Ufe,"hashSet");Pu.prototype.clear=Bfe;Pu.prototype.delete=$fe;Pu.prototype.get=jfe;Pu.prototype.has=Gfe;Pu.prototype.set=Ufe;function dl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(dl,"ListCache");function Vfe(){this.__data__=[],this.size=0}s(Vfe,"listCacheClear");function zfe(e){var t=this.__data__,r=Wv(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Ffe.call(t,r,1),--this.size,!0}s(zfe,"listCacheDelete");function Hfe(e){var t=this.__data__,r=Wv(t,e);return r<0?void 0:t[r][1]}s(Hfe,"listCacheGet");function Wfe(e){return Wv(this.__data__,e)>-1}s(Wfe,"listCacheHas");function qfe(e,t){var r=this.__data__,n=Wv(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}s(qfe,"listCacheSet");dl.prototype.clear=Vfe;dl.prototype.delete=zfe;dl.prototype.get=Hfe;dl.prototype.has=Wfe;dl.prototype.set=qfe;function gm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(gm,"MapCache");function Zfe(){this.size=0,this.__data__={hash:new Pu,map:new(WU||dl),string:new Pu}}s(Zfe,"mapCacheClear");function Xfe(e){var t=Zv(this,e).delete(e);return this.size-=t?1:0,t}s(Xfe,"mapCacheDelete");function Yfe(e){return Zv(this,e).get(e)}s(Yfe,"mapCacheGet");function Kfe(e){return Zv(this,e).has(e)}s(Kfe,"mapCacheHas");function Jfe(e,t){var r=Zv(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}s(Jfe,"mapCacheSet");gm.prototype.clear=Zfe;gm.prototype.delete=Xfe;gm.prototype.get=Yfe;gm.prototype.has=Kfe;gm.prototype.set=Jfe;function bm(e){var t=this.__data__=new dl(e);this.size=t.size}s(bm,"Stack");function Qfe(){this.__data__=new dl,this.size=0}s(Qfe,"stackClear");function eme(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}s(eme,"stackDelete");function tme(e){return this.__data__.get(e)}s(tme,"stackGet");function rme(e){return this.__data__.has(e)}s(rme,"stackHas");function nme(e,t){var r=this.__data__;if(r instanceof dl){var n=r.__data__;if(!WU||n.length<Hde-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new gm(n)}return r.set(e,t),this.size=r.size,this}s(nme,"stackSet");bm.prototype.clear=Qfe;bm.prototype.delete=eme;bm.prototype.get=tme;bm.prototype.has=rme;bm.prototype.set=nme;function ome(e,t){var r=h5(e),n=!r&&m5(e),o=!r&&!n&&YU(e),i=!r&&!n&&!o&&JU(e),a=r||n||o||i,l=a?Pfe(e.length,String):[],c=l.length;for(var u in e)(t||ul.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ZU(u,c)))&&l.push(u);return l}s(ome,"arrayLikeKeys");function d5(e,t,r){(r!==void 0&&!Xv(e[t],r)||r===void 0&&!(t in e))&&y5(e,t,r)}s(d5,"assignMergeValue");function ime(e,t,r){var n=e[t];(!(ul.call(e,t)&&Xv(n,r))||r===void 0&&!(t in e))&&y5(e,t,r)}s(ime,"assignValue");function Wv(e,t){for(var r=e.length;r--;)if(Xv(e[r][0],t))return r;return-1}s(Wv,"assocIndexOf");function y5(e,t,r){t=="__proto__"&&Vv?Vv(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}s(y5,"baseAssignValue");var sme=xme();function qv(e){return e==null?e===void 0?afe:rfe:Tu&&Tu in Object(e)?vme(e):wme(e)}s(qv,"baseGetTag");function LU(e){return Mg(e)&&qv(e)==BU}s(LU,"baseIsArguments");function ame(e){if(!wu(e)||Tme(e))return!1;var t=x5(e)?Afe:Ife;return t.test(_me(e))}s(ame,"baseIsNative");function lme(e){return Mg(e)&&KU(e.length)&&!!ar[qv(e)]}s(lme,"baseIsTypedArray");function cme(e){if(!wu(e))return Pme(e);var t=XU(e),r=[];for(var n in e)n=="constructor"&&(t||!ul.call(e,n))||r.push(n);return r}s(cme,"baseKeysIn");function qU(e,t,r,n,o){e!==t&&sme(t,function(i,a){if(o||(o=new bm),wu(i))pme(e,t,a,r,qU,n,o);else{var l=n?n(f5(e,a),i,a+"",e,t,o):void 0;l===void 0&&(l=i),d5(e,a,l)}},QU)}s(qU,"baseMerge");function pme(e,t,r,n,o,i,a){var l=f5(e,r),c=f5(t,r),u=a.get(c);if(u){d5(e,r,u);return}var d=i?i(l,c,r+"",e,t,a):void 0,h=d===void 0;if(h){var y=h5(c),b=!y&&YU(c),I=!y&&!b&&JU(c);d=c,y||b||I?h5(l)?d=l:kme(l)?d=yme(l):b?(h=!1,d=fme(c,!0)):I?(h=!1,d=hme(c,!0)):d=[]:Ame(c)||m5(c)?(d=l,m5(l)?d=Dme(l):(!wu(l)||x5(l))&&(d=Ime(c))):h=!1}h&&(a.set(c,d),o(d,c,n,i,a),a.delete(c)),d5(e,r,d)}s(pme,"baseMergeDeep");function ume(e,t){return Ome(Mme(e,t,eV),e+"")}s(ume,"baseRest");var dme=Vv?function(e,t){return Vv(e,"toString",{configurable:!0,enumerable:!1,value:Lme(t),writable:!0})}:eV;function fme(e,t){if(t)return e.slice();var r=e.length,n=AU?AU(r):new e.constructor(r);return e.copy(n),n}s(fme,"cloneBuffer");function mme(e){var t=new e.constructor(e.byteLength);return new kU(t).set(new kU(e)),t}s(mme,"cloneArrayBuffer");function hme(e,t){var r=t?mme(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}s(hme,"cloneTypedArray");function yme(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}s(yme,"copyArray");function gme(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var l=t[i],c=n?n(r[l],e[l],l,r,e):void 0;c===void 0&&(c=e[l]),o?y5(r,l,c):ime(r,l,c)}return r}s(gme,"copyObject");function bme(e){return ume(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&Sme(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var l=r[n];l&&e(t,l,n,i)}return t})}s(bme,"createAssigner");function xme(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),l=a.length;l--;){var c=a[e?l:++o];if(r(i[c],c,i)===!1)break}return t}}s(xme,"createBaseFor");function Zv(e,t){var r=e.__data__;return Cme(t)?r[typeof t=="string"?"string":"hash"]:r.map}s(Zv,"getMapData");function g5(e,t){var r=Mfe(e,t);return ame(r)?r:void 0}s(g5,"getNative");function vme(e){var t=ul.call(e,Tu),r=e[Tu];try{e[Tu]=void 0;var n=!0}catch(i){}var o=zU.call(e);return n&&(t?e[Tu]=r:delete e[Tu]),o}s(vme,"getRawTag");function Ime(e){return typeof e.constructor=="function"&&!XU(e)?Nfe(HU(e)):{}}s(Ime,"initCloneObject");function ZU(e,t){var r=typeof e;return t=t==null?NU:t,!!t&&(r=="number"||r!="symbol"&&Sfe.test(e))&&e>-1&&e%1==0&&e<t}s(ZU,"isIndex");function Sme(e,t,r){if(!wu(r))return!1;var n=typeof t;return(n=="number"?b5(r)&&ZU(t,r.length):n=="string"&&t in r)?Xv(r[t],e):!1}s(Sme,"isIterateeCall");function Cme(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}s(Cme,"isKeyable");function Tme(e){return!!EU&&EU in e}s(Tme,"isMasked");function XU(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||zv;return e===r}s(XU,"isPrototype");function Pme(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(Pme,"nativeKeysIn");function wme(e){return zU.call(e)}s(wme,"objectToString");function Mme(e,t,r){return t=FU(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=FU(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=n[o];return l[t]=r(a),Tfe(e,this,l)}}s(Mme,"overRest");function f5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}s(f5,"safeGet");var Ome=Eme(dme);function Eme(e){var t=0,r=0;return function(){var n=Rfe(),o=qde-(n-r);if(r=n,o>0){if(++t>=Wde)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}s(Eme,"shortOut");function _me(e){if(e!=null){try{return Hv.call(e)}catch(t){}try{return e+""}catch(t){}}return""}s(_me,"toSource");function Xv(e,t){return e===t||e!==e&&t!==t}s(Xv,"eq");var m5=LU(function(){return arguments}())?LU:function(e){return Mg(e)&&ul.call(e,"callee")&&!Dfe.call(e,"callee")},h5=Array.isArray;function b5(e){return e!=null&&KU(e.length)&&!x5(e)}s(b5,"isArrayLike");function kme(e){return Mg(e)&&b5(e)}s(kme,"isArrayLikeObject");var YU=Lfe||Rme;function x5(e){if(!wu(e))return!1;var t=qv(e);return t==$U||t==Qde||t==Xde||t==nfe}s(x5,"isFunction");function KU(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=NU}s(KU,"isLength");function wu(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}s(wu,"isObject");function Mg(e){return e!=null&&typeof e=="object"}s(Mg,"isObjectLike");function Ame(e){if(!Mg(e)||qv(e)!=jU)return!1;var t=HU(e);if(t===null)return!0;var r=ul.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Hv.call(r)==kfe}s(Ame,"isPlainObject");var JU=OU?wfe(OU):lme;function Dme(e){return gme(e,QU(e))}s(Dme,"toPlainObject");function QU(e){return b5(e)?ome(e,!0):cme(e)}s(QU,"keysIn");var Fme=bme(function(e,t,r){qU(e,t,r)});function Lme(e){return function(){return e}}s(Lme,"constant");function eV(e){return e}s(eV,"identity");function Rme(){return!1}s(Rme,"stubFalse");ym.exports=Fme});var L5=ue((_g,vm)=>{f();var phe=200,IV="__lodash_hash_undefined__",uhe=800,dhe=16,SV=9007199254740991,CV="[object Arguments]",fhe="[object Array]",mhe="[object AsyncFunction]",hhe="[object Boolean]",yhe="[object Date]",ghe="[object Error]",TV="[object Function]",bhe="[object GeneratorFunction]",xhe="[object Map]",vhe="[object Number]",Ihe="[object Null]",PV="[object Object]",She="[object Proxy]",Che="[object RegExp]",The="[object Set]",Phe="[object String]",whe="[object Undefined]",Mhe="[object WeakMap]",Ohe="[object ArrayBuffer]",Ehe="[object DataView]",_he="[object Float32Array]",khe="[object Float64Array]",Ahe="[object Int8Array]",Dhe="[object Int16Array]",Fhe="[object Int32Array]",Lhe="[object Uint8Array]",Rhe="[object Uint8ClampedArray]",Nhe="[object Uint16Array]",Bhe="[object Uint32Array]",$he=/[\\^$.*+?()[\]{}|]/g,jhe=/^\[object .+?Constructor\]$/,Ghe=/^(?:0|[1-9]\d*)$/,lr={};lr[_he]=lr[khe]=lr[Ahe]=lr[Dhe]=lr[Fhe]=lr[Lhe]=lr[Rhe]=lr[Nhe]=lr[Bhe]=!0;lr[CV]=lr[fhe]=lr[Ohe]=lr[hhe]=lr[Ehe]=lr[yhe]=lr[ghe]=lr[TV]=lr[xhe]=lr[vhe]=lr[PV]=lr[Che]=lr[The]=lr[Phe]=lr[Mhe]=!1;var wV=typeof global=="object"&&global&&global.Object===Object&&global,Uhe=typeof self=="object"&&self&&self.Object===Object&&self,Dg=wV||Uhe||Function("return this")(),MV=typeof _g=="object"&&_g&&!_g.nodeType&&_g,kg=MV&&typeof vm=="object"&&vm&&!vm.nodeType&&vm,OV=kg&&kg.exports===MV,T5=OV&&wV.process,dV=function(){try{var e=kg&&kg.require&&kg.require("util").types;return e||T5&&T5.binding&&T5.binding("util")}catch(t){}}(),fV=dV&&dV.isTypedArray;function EV(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}s(EV,"apply");function Vhe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(Vhe,"baseTimes");function zhe(e){return function(t){return e(t)}}s(zhe,"baseUnary");function Hhe(e,t){return e==null?void 0:e[t]}s(Hhe,"getValue");function Whe(e,t){return function(r){return e(t(r))}}s(Whe,"overArg");var qhe=Array.prototype,Zhe=Function.prototype,e2=Object.prototype,P5=Dg["__core-js_shared__"],t2=Zhe.toString,hl=e2.hasOwnProperty,mV=function(){var e=/[^.]+$/.exec(P5&&P5.keys&&P5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_V=e2.toString,Xhe=t2.call(Object),Yhe=RegExp("^"+t2.call(hl).replace($he,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jv=OV?Dg.Buffer:void 0,hV=Dg.Symbol,yV=Dg.Uint8Array,gV=Jv?Jv.allocUnsafe:void 0,kV=Whe(Object.getPrototypeOf,Object),bV=Object.create,Khe=e2.propertyIsEnumerable,Jhe=qhe.splice,Ou=hV?hV.toStringTag:void 0,Qv=function(){try{var e=A5(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Qhe=Jv?Jv.isBuffer:void 0,xV=Math.max,eye=Date.now,AV=A5(Dg,"Map"),Ag=A5(Object,"create"),tye=function(){function e(){}return s(e,"object"),function(t){if(!ml(t))return{};if(bV)return bV(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Eu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Eu,"Hash");function rye(){this.__data__=Ag?Ag(null):{},this.size=0}s(rye,"hashClear");function nye(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}s(nye,"hashDelete");function oye(e){var t=this.__data__;if(Ag){var r=t[e];return r===IV?void 0:r}return hl.call(t,e)?t[e]:void 0}s(oye,"hashGet");function iye(e){var t=this.__data__;return Ag?t[e]!==void 0:hl.call(t,e)}s(iye,"hashHas");function sye(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ag&&t===void 0?IV:t,this}s(sye,"hashSet");Eu.prototype.clear=rye;Eu.prototype.delete=nye;Eu.prototype.get=oye;Eu.prototype.has=iye;Eu.prototype.set=sye;function yl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(yl,"ListCache");function aye(){this.__data__=[],this.size=0}s(aye,"listCacheClear");function lye(e){var t=this.__data__,r=r2(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Jhe.call(t,r,1),--this.size,!0}s(lye,"listCacheDelete");function cye(e){var t=this.__data__,r=r2(t,e);return r<0?void 0:t[r][1]}s(cye,"listCacheGet");function pye(e){return r2(this.__data__,e)>-1}s(pye,"listCacheHas");function uye(e,t){var r=this.__data__,n=r2(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}s(uye,"listCacheSet");yl.prototype.clear=aye;yl.prototype.delete=lye;yl.prototype.get=cye;yl.prototype.has=pye;yl.prototype.set=uye;function Im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s(Im,"MapCache");function dye(){this.size=0,this.__data__={hash:new Eu,map:new(AV||yl),string:new Eu}}s(dye,"mapCacheClear");function fye(e){var t=o2(this,e).delete(e);return this.size-=t?1:0,t}s(fye,"mapCacheDelete");function mye(e){return o2(this,e).get(e)}s(mye,"mapCacheGet");function hye(e){return o2(this,e).has(e)}s(hye,"mapCacheHas");function yye(e,t){var r=o2(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}s(yye,"mapCacheSet");Im.prototype.clear=dye;Im.prototype.delete=fye;Im.prototype.get=mye;Im.prototype.has=hye;Im.prototype.set=yye;function Sm(e){var t=this.__data__=new yl(e);this.size=t.size}s(Sm,"Stack");function gye(){this.__data__=new yl,this.size=0}s(gye,"stackClear");function bye(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}s(bye,"stackDelete");function xye(e){return this.__data__.get(e)}s(xye,"stackGet");function vye(e){return this.__data__.has(e)}s(vye,"stackHas");function Iye(e,t){var r=this.__data__;if(r instanceof yl){var n=r.__data__;if(!AV||n.length<phe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Im(n)}return r.set(e,t),this.size=r.size,this}s(Iye,"stackSet");Sm.prototype.clear=gye;Sm.prototype.delete=bye;Sm.prototype.get=xye;Sm.prototype.has=vye;Sm.prototype.set=Iye;function Sye(e,t){var r=E5(e),n=!r&&O5(e),o=!r&&!n&&NV(e),i=!r&&!n&&!o&&$V(e),a=r||n||o||i,l=a?Vhe(e.length,String):[],c=l.length;for(var u in e)(t||hl.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LV(u,c)))&&l.push(u);return l}s(Sye,"arrayLikeKeys");function w5(e,t,r){(r!==void 0&&!i2(e[t],r)||r===void 0&&!(t in e))&&_5(e,t,r)}s(w5,"assignMergeValue");function Cye(e,t,r){var n=e[t];(!(hl.call(e,t)&&i2(n,r))||r===void 0&&!(t in e))&&_5(e,t,r)}s(Cye,"assignValue");function r2(e,t){for(var r=e.length;r--;)if(i2(e[r][0],t))return r;return-1}s(r2,"assocIndexOf");function _5(e,t,r){t=="__proto__"&&Qv?Qv(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}s(_5,"baseAssignValue");var Tye=Rye();function n2(e){return e==null?e===void 0?whe:Ihe:Ou&&Ou in Object(e)?Nye(e):Vye(e)}s(n2,"baseGetTag");function vV(e){return Fg(e)&&n2(e)==CV}s(vV,"baseIsArguments");function Pye(e){if(!ml(e)||Gye(e))return!1;var t=F5(e)?Yhe:jhe;return t.test(qye(e))}s(Pye,"baseIsNative");function wye(e){return Fg(e)&&BV(e.length)&&!!lr[n2(e)]}s(wye,"baseIsTypedArray");function Mye(e){if(!ml(e))return Uye(e);var t=RV(e),r=[];for(var n in e)n=="constructor"&&(t||!hl.call(e,n))||r.push(n);return r}s(Mye,"baseKeysIn");function k5(e,t,r,n,o){e!==t&&Tye(t,function(i,a){if(o||(o=new Sm),ml(i))Oye(e,t,a,r,k5,n,o);else{var l=n?n(M5(e,a),i,a+"",e,t,o):void 0;l===void 0&&(l=i),w5(e,a,l)}},jV)}s(k5,"baseMerge");function Oye(e,t,r,n,o,i,a){var l=M5(e,r),c=M5(t,r),u=a.get(c);if(u){w5(e,r,u);return}var d=i?i(l,c,r+"",e,t,a):void 0,h=d===void 0;if(h){var y=E5(c),b=!y&&NV(c),I=!y&&!b&&$V(c);d=c,y||b||I?E5(l)?d=l:Zye(l)?d=Dye(l):b?(h=!1,d=_ye(c,!0)):I?(h=!1,d=Aye(c,!0)):d=[]:Xye(c)||O5(c)?(d=l,O5(l)?d=Yye(l):(!ml(l)||F5(l))&&(d=Bye(c))):h=!1}h&&(a.set(c,d),o(d,c,n,i,a),a.delete(c)),w5(e,r,d)}s(Oye,"baseMergeDeep");function DV(e,t){return Hye(zye(e,t,GV),e+"")}s(DV,"baseRest");var Eye=Qv?function(e,t){return Qv(e,"toString",{configurable:!0,enumerable:!1,value:Qye(t),writable:!0})}:GV;function _ye(e,t){if(t)return e.slice();var r=e.length,n=gV?gV(r):new e.constructor(r);return e.copy(n),n}s(_ye,"cloneBuffer");function kye(e){var t=new e.constructor(e.byteLength);return new yV(t).set(new yV(e)),t}s(kye,"cloneArrayBuffer");function Aye(e,t){var r=t?kye(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}s(Aye,"cloneTypedArray");function Dye(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}s(Dye,"copyArray");function Fye(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var l=t[i],c=n?n(r[l],e[l],l,r,e):void 0;c===void 0&&(c=e[l]),o?_5(r,l,c):Cye(r,l,c)}return r}s(Fye,"copyObject");function Lye(e){return DV(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&$ye(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var l=r[n];l&&e(t,l,n,i)}return t})}s(Lye,"createAssigner");function Rye(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),l=a.length;l--;){var c=a[e?l:++o];if(r(i[c],c,i)===!1)break}return t}}s(Rye,"createBaseFor");function FV(e,t,r,n,o,i){return ml(e)&&ml(t)&&(i.set(t,e),k5(e,t,void 0,FV,i),i.delete(t)),e}s(FV,"customDefaultsMerge");function o2(e,t){var r=e.__data__;return jye(t)?r[typeof t=="string"?"string":"hash"]:r.map}s(o2,"getMapData");function A5(e,t){var r=Hhe(e,t);return Pye(r)?r:void 0}s(A5,"getNative");function Nye(e){var t=hl.call(e,Ou),r=e[Ou];try{e[Ou]=void 0;var n=!0}catch(i){}var o=_V.call(e);return n&&(t?e[Ou]=r:delete e[Ou]),o}s(Nye,"getRawTag");function Bye(e){return typeof e.constructor=="function"&&!RV(e)?tye(kV(e)):{}}s(Bye,"initCloneObject");function LV(e,t){var r=typeof e;return t=t==null?SV:t,!!t&&(r=="number"||r!="symbol"&&Ghe.test(e))&&e>-1&&e%1==0&&e<t}s(LV,"isIndex");function $ye(e,t,r){if(!ml(r))return!1;var n=typeof t;return(n=="number"?D5(r)&&LV(t,r.length):n=="string"&&t in r)?i2(r[t],e):!1}s($ye,"isIterateeCall");function jye(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}s(jye,"isKeyable");function Gye(e){return!!mV&&mV in e}s(Gye,"isMasked");function RV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||e2;return e===r}s(RV,"isPrototype");function Uye(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(Uye,"nativeKeysIn");function Vye(e){return _V.call(e)}s(Vye,"objectToString");function zye(e,t,r){return t=xV(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=xV(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=n[o];return l[t]=r(a),EV(e,this,l)}}s(zye,"overRest");function M5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}s(M5,"safeGet");var Hye=Wye(Eye);function Wye(e){var t=0,r=0;return function(){var n=eye(),o=dhe-(n-r);if(r=n,o>0){if(++t>=uhe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}s(Wye,"shortOut");function qye(e){if(e!=null){try{return t2.call(e)}catch(t){}try{return e+""}catch(t){}}return""}s(qye,"toSource");function i2(e,t){return e===t||e!==e&&t!==t}s(i2,"eq");var O5=vV(function(){return arguments}())?vV:function(e){return Fg(e)&&hl.call(e,"callee")&&!Khe.call(e,"callee")},E5=Array.isArray;function D5(e){return e!=null&&BV(e.length)&&!F5(e)}s(D5,"isArrayLike");function Zye(e){return Fg(e)&&D5(e)}s(Zye,"isArrayLikeObject");var NV=Qhe||ege;function F5(e){if(!ml(e))return!1;var t=n2(e);return t==TV||t==bhe||t==mhe||t==She}s(F5,"isFunction");function BV(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=SV}s(BV,"isLength");function ml(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}s(ml,"isObject");function Fg(e){return e!=null&&typeof e=="object"}s(Fg,"isObjectLike");function Xye(e){if(!Fg(e)||n2(e)!=PV)return!1;var t=kV(e);if(t===null)return!0;var r=hl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&t2.call(r)==Xhe}s(Xye,"isPlainObject");var $V=fV?zhe(fV):wye;function Yye(e){return Fye(e,jV(e))}s(Yye,"toPlainObject");var Kye=DV(function(e){return e.push(void 0,FV),EV(Jye,void 0,e)});function jV(e){return D5(e)?Sye(e,!0):Mye(e)}s(jV,"keysIn");var Jye=Lye(function(e,t,r,n){k5(e,t,r,n)});function Qye(e){return function(){return e}}s(Qye,"constant");function GV(e){return e}s(GV,"identity");function ege(){return!1}s(ege,"stubFalse");vm.exports=Kye});var Az=ue((Got,Vg)=>{"use strict";f();var yge=!1,Du=!1,Pz=!0,wz=!1,g={},Mz=!1;typeof Vg<"u"&&Vg.exports?(Vg.exports=g,Mz=!0):typeof document<"u"?window.ClipperLib=g:self.ClipperLib=g;var g2;Mz?(qr="chrome",g2="Netscape"):(qr=navigator.userAgent.toString().toLowerCase(),g2=navigator.appName);var qr,ut={};qr.indexOf("chrome")!=-1&&qr.indexOf("chromium")==-1?ut.chrome=1:ut.chrome=0;qr.indexOf("chromium")!=-1?ut.chromium=1:ut.chromium=0;qr.indexOf("safari")!=-1&&qr.indexOf("chrome")==-1&&qr.indexOf("chromium")==-1?ut.safari=1:ut.safari=0;qr.indexOf("firefox")!=-1?ut.firefox=1:ut.firefox=0;qr.indexOf("firefox/17")!=-1?ut.firefox17=1:ut.firefox17=0;qr.indexOf("firefox/15")!=-1?ut.firefox15=1:ut.firefox15=0;qr.indexOf("firefox/3")!=-1?ut.firefox3=1:ut.firefox3=0;qr.indexOf("opera")!=-1?ut.opera=1:ut.opera=0;qr.indexOf("msie 10")!=-1?ut.msie10=1:ut.msie10=0;qr.indexOf("msie 9")!=-1?ut.msie9=1:ut.msie9=0;qr.indexOf("msie 8")!=-1?ut.msie8=1:ut.msie8=0;qr.indexOf("msie 7")!=-1?ut.msie7=1:ut.msie7=0;qr.indexOf("msie ")!=-1?ut.msie=1:ut.msie=0;g.biginteger_used=null;var Oc,gge=0xdeadbeefcafe,Cz=(gge&16777215)==15715070;function ne(e,t,r){g.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}s(ne,"BigInteger");function xt(){return new ne(null)}s(xt,"nbi");function bge(e,t,r,n,o,i){for(;--i>=0;){var a=t*this[e++]+r[n]+o;o=Math.floor(a/67108864),r[n++]=a&67108863}return o}s(bge,"am1");function xge(e,t,r,n,o,i){for(var a=t&32767,l=t>>15;--i>=0;){var c=this[e]&32767,u=this[e++]>>15,d=l*c+u*a;c=a*c+((d&32767)<<15)+r[n]+(o&1073741823),o=(c>>>30)+(d>>>15)+l*u+(o>>>30),r[n++]=c&1073741823}return o}s(xge,"am2");function vge(e,t,r,n,o,i){for(var a=t&16383,l=t>>14;--i>=0;){var c=this[e]&16383,u=this[e++]>>14,d=l*c+u*a;c=a*c+((d&16383)<<14)+r[n]+o,o=(c>>28)+(d>>14)+l*u,r[n++]=c&268435455}return o}s(vge,"am3");Cz&&g2=="Microsoft Internet Explorer"?(ne.prototype.am=xge,Oc=30):Cz&&g2!="Netscape"?(ne.prototype.am=bge,Oc=26):(ne.prototype.am=vge,Oc=28);ne.prototype.DB=Oc;ne.prototype.DM=(1<<Oc)-1;ne.prototype.DV=1<<Oc;var sM=52;ne.prototype.FV=Math.pow(2,sM);ne.prototype.F1=sM-Oc;ne.prototype.F2=2*Oc-sM;var Ige="0123456789abcdefghijklmnopqrstuvwxyz",x2=new Array,Mm,yi;Mm=48;for(yi=0;yi<=9;++yi)x2[Mm++]=yi;Mm=97;for(yi=10;yi<36;++yi)x2[Mm++]=yi;Mm=65;for(yi=10;yi<36;++yi)x2[Mm++]=yi;function Tz(e){return Ige.charAt(e)}s(Tz,"int2char");function Oz(e,t){var r=x2[e.charCodeAt(t)];return r==null?-1:r}s(Oz,"intAt");function Sge(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}s(Sge,"bnpCopyTo");function Cge(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}s(Cge,"bnpFromInt");function Mc(e){var t=xt();return t.fromInt(e),t}s(Mc,"nbv");function Tge(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,o=!1,i=0;--n>=0;){var a=r==8?e[n]&255:Oz(e,n);if(a<0){e.charAt(n)=="-"&&(o=!0);continue}o=!1,i==0?this[this.t++]=a:i+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this[this.t++]=a>>this.DB-i):this[this.t-1]|=a<<i,i+=r,i>=this.DB&&(i-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),o&&ne.ZERO.subTo(this,this)}s(Tge,"bnpFromString");function Pge(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}s(Pge,"bnpClamp");function wge(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,o=!1,i="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(o=!0,i=Tz(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(o=!0),o&&(i+=Tz(n));return o?i:"0"}s(wge,"bnToString");function Mge(){var e=xt();return ne.ZERO.subTo(this,e),e}s(Mge,"bnNegate");function Oge(){return this.s<0?this.negate():this}s(Oge,"bnAbs");function Ege(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}s(Ege,"bnCompareTo");function v2(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}s(v2,"nbits");function _ge(){return this.t<=0?0:this.DB*(this.t-1)+v2(this[this.t-1]^this.s&this.DM)}s(_ge,"bnBitLength");function kge(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}s(kge,"bnpDLShiftTo");function Age(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}s(Age,"bnpDRShiftTo");function Dge(e,t){var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),a=this.s<<r&this.DM,l;for(l=this.t-1;l>=0;--l)t[l+i+1]=this[l]>>n|a,a=(this[l]&o)<<r;for(l=i-1;l>=0;--l)t[l]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()}s(Dge,"bnpLShiftTo");function Fge(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&i)<<o,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}s(Fge,"bnpRShiftTo");function Lge(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}s(Lge,"bnpSubTo");function Rge(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t[o]=0;for(o=0;o<n.t;++o)t[o+r.t]=r.am(0,n[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&ne.ZERO.subTo(t,t)}s(Rge,"bnpMultiplyTo");function Nge(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}s(Nge,"bnpSquareTo");function Bge(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=xt());var i=xt(),a=this.s,l=e.s,c=this.DB-v2(n[n.t-1]);c>0?(n.lShiftTo(c,i),o.lShiftTo(c,r)):(n.copyTo(i),o.copyTo(r));var u=i.t,d=i[u-1];if(d!=0){var h=d*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),y=this.FV/h,b=(1<<this.F1)/h,I=1<<this.F2,S=r.t,x=S-u,T=t==null?xt():t;for(i.dlShiftTo(x,T),r.compareTo(T)>=0&&(r[r.t++]=1,r.subTo(T,r)),ne.ONE.dlShiftTo(u,T),T.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--x>=0;){var w=r[--S]==d?this.DM:Math.floor(r[S]*y+(r[S-1]+I)*b);if((r[S]+=i.am(0,w,r,x,0,u))<w)for(i.dlShiftTo(x,T),r.subTo(T,r);r[S]<--w;)r.subTo(T,r)}t!=null&&(r.drShiftTo(u,t),a!=l&&ne.ZERO.subTo(t,t)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&ne.ZERO.subTo(r,r)}}}s(Bge,"bnpDivRemTo");function $ge(e){var t=xt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ne.ZERO)>0&&e.subTo(t,t),t}s($ge,"bnMod");function Fu(e){this.m=e}s(Fu,"Classic");function jge(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}s(jge,"cConvert");function Gge(e){return e}s(Gge,"cRevert");function Uge(e){e.divRemTo(this.m,null,e)}s(Uge,"cReduce");function Vge(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(Vge,"cMulTo");function zge(e,t){e.squareTo(t),this.reduce(t)}s(zge,"cSqrTo");Fu.prototype.convert=jge;Fu.prototype.revert=Gge;Fu.prototype.reduce=Uge;Fu.prototype.mulTo=Vge;Fu.prototype.sqrTo=zge;function Hge(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}s(Hge,"bnpInvDigit");function Lu(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}s(Lu,"Montgomery");function Wge(e){var t=xt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ne.ZERO)>0&&this.m.subTo(t,t),t}s(Wge,"montConvert");function qge(e){var t=xt();return e.copyTo(t),this.reduce(t),t}s(qge,"montRevert");function Zge(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}s(Zge,"montReduce");function Xge(e,t){e.squareTo(t),this.reduce(t)}s(Xge,"montSqrTo");function Yge(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(Yge,"montMulTo");Lu.prototype.convert=Wge;Lu.prototype.revert=qge;Lu.prototype.reduce=Zge;Lu.prototype.mulTo=Yge;Lu.prototype.sqrTo=Xge;function Kge(){return(this.t>0?this[0]&1:this.s)==0}s(Kge,"bnpIsEven");function Jge(e,t){if(e>4294967295||e<1)return ne.ONE;var r=xt(),n=xt(),o=t.convert(this),i=v2(e)-1;for(o.copyTo(r);--i>=0;)if(t.sqrTo(r,n),(e&1<<i)>0)t.mulTo(n,o,r);else{var a=r;r=n,n=a}return t.revert(r)}s(Jge,"bnpExp");function Qge(e,t){var r;return e<256||t.isEven()?r=new Fu(t):r=new Lu(t),this.exp(e,r)}s(Qge,"bnModPowInt");ne.prototype.copyTo=Sge;ne.prototype.fromInt=Cge;ne.prototype.fromString=Tge;ne.prototype.clamp=Pge;ne.prototype.dlShiftTo=kge;ne.prototype.drShiftTo=Age;ne.prototype.lShiftTo=Dge;ne.prototype.rShiftTo=Fge;ne.prototype.subTo=Lge;ne.prototype.multiplyTo=Rge;ne.prototype.squareTo=Nge;ne.prototype.divRemTo=Bge;ne.prototype.invDigit=Hge;ne.prototype.isEven=Kge;ne.prototype.exp=Jge;ne.prototype.toString=wge;ne.prototype.negate=Mge;ne.prototype.abs=Oge;ne.prototype.compareTo=Ege;ne.prototype.bitLength=_ge;ne.prototype.mod=$ge;ne.prototype.modPowInt=Qge;ne.ZERO=Mc(0);ne.ONE=Mc(1);function e1e(){var e=xt();return this.copyTo(e),e}s(e1e,"bnClone");function t1e(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}s(t1e,"bnIntValue");function r1e(){return this.t==0?this.s:this[0]<<24>>24}s(r1e,"bnByteValue");function n1e(){return this.t==0?this.s:this[0]<<16>>16}s(n1e,"bnShortValue");function o1e(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}s(o1e,"bnpChunkSize");function i1e(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}s(i1e,"bnSigNum");function s1e(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=Mc(r),o=xt(),i=xt(),a="";for(this.divRemTo(n,o,i);o.signum()>0;)a=(r+i.intValue()).toString(e).substr(1)+a,o.divRemTo(n,o,i);return i.intValue().toString(e)+a}s(s1e,"bnpToRadix");function a1e(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,i=0,a=0,l=0;l<e.length;++l){var c=Oz(e,l);if(c<0){e.charAt(l)=="-"&&this.signum()==0&&(o=!0);continue}a=t*a+c,++i>=r&&(this.dMultiply(n),this.dAddOffset(a,0),i=0,a=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(a,0)),o&&ne.ZERO.subTo(this,this)}s(a1e,"bnpFromRadix");function l1e(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(ne.ONE.shiftLeft(e-1),aM,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ne.ONE.shiftLeft(e-1),this);else{var n=new Array,o=e&7;n.length=(e>>3)+1,t.nextBytes(n),o>0?n[0]&=(1<<o)-1:n[0]=0,this.fromString(n,256)}}s(l1e,"bnpFromNumber");function c1e(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,o=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(t[o++]=n);return t}s(c1e,"bnToByteArray");function p1e(e){return this.compareTo(e)==0}s(p1e,"bnEquals");function u1e(e){return this.compareTo(e)<0?this:e}s(u1e,"bnMin");function d1e(e){return this.compareTo(e)>0?this:e}s(d1e,"bnMax");function f1e(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}s(f1e,"bnpBitwiseTo");function m1e(e,t){return e&t}s(m1e,"op_and");function h1e(e){var t=xt();return this.bitwiseTo(e,m1e,t),t}s(h1e,"bnAnd");function aM(e,t){return e|t}s(aM,"op_or");function y1e(e){var t=xt();return this.bitwiseTo(e,aM,t),t}s(y1e,"bnOr");function Ez(e,t){return e^t}s(Ez,"op_xor");function g1e(e){var t=xt();return this.bitwiseTo(e,Ez,t),t}s(g1e,"bnXor");function _z(e,t){return e&~t}s(_z,"op_andnot");function b1e(e){var t=xt();return this.bitwiseTo(e,_z,t),t}s(b1e,"bnAndNot");function x1e(){for(var e=xt(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}s(x1e,"bnNot");function v1e(e){var t=xt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}s(v1e,"bnShiftLeft");function I1e(e){var t=xt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}s(I1e,"bnShiftRight");function S1e(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}s(S1e,"lbit");function C1e(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+S1e(this[e]);return this.s<0?this.t*this.DB:-1}s(C1e,"bnGetLowestSetBit");function T1e(e){for(var t=0;e!=0;)e&=e-1,++t;return t}s(T1e,"cbit");function P1e(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=T1e(this[r]^t);return e}s(P1e,"bnBitCount");function w1e(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}s(w1e,"bnTestBit");function M1e(e,t){var r=ne.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}s(M1e,"bnpChangeBit");function O1e(e){return this.changeBit(e,aM)}s(O1e,"bnSetBit");function E1e(e){return this.changeBit(e,_z)}s(E1e,"bnClearBit");function _1e(e){return this.changeBit(e,Ez)}s(_1e,"bnFlipBit");function k1e(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}s(k1e,"bnpAddTo");function A1e(e){var t=xt();return this.addTo(e,t),t}s(A1e,"bnAdd");function D1e(e){var t=xt();return this.subTo(e,t),t}s(D1e,"bnSubtract");function F1e(e){var t=xt();return this.multiplyTo(e,t),t}s(F1e,"bnMultiply");function L1e(){var e=xt();return this.squareTo(e),e}s(L1e,"bnSquare");function R1e(e){var t=xt();return this.divRemTo(e,t,null),t}s(R1e,"bnDivide");function N1e(e){var t=xt();return this.divRemTo(e,null,t),t}s(N1e,"bnRemainder");function B1e(e){var t=xt(),r=xt();return this.divRemTo(e,t,r),new Array(t,r)}s(B1e,"bnDivideAndRemainder");function $1e(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}s($1e,"bnpDMultiply");function j1e(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}s(j1e,"bnpDAddOffset");function zg(){}s(zg,"NullExp");function kz(e){return e}s(kz,"nNop");function G1e(e,t,r){e.multiplyTo(t,r)}s(G1e,"nMulTo");function U1e(e,t){e.squareTo(t)}s(U1e,"nSqrTo");zg.prototype.convert=kz;zg.prototype.revert=kz;zg.prototype.mulTo=G1e;zg.prototype.sqrTo=U1e;function V1e(e){return this.exp(e,new zg)}s(V1e,"bnPow");function z1e(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var o;for(o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}s(z1e,"bnpMultiplyLowerTo");function H1e(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}s(H1e,"bnpMultiplyUpperTo");function Om(e){this.r2=xt(),this.q3=xt(),ne.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}s(Om,"Barrett");function W1e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=xt();return e.copyTo(t),this.reduce(t),t}s(W1e,"barrettConvert");function q1e(e){return e}s(q1e,"barrettRevert");function Z1e(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}s(Z1e,"barrettReduce");function X1e(e,t){e.squareTo(t),this.reduce(t)}s(X1e,"barrettSqrTo");function Y1e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(Y1e,"barrettMulTo");Om.prototype.convert=W1e;Om.prototype.revert=q1e;Om.prototype.reduce=Z1e;Om.prototype.mulTo=Y1e;Om.prototype.sqrTo=X1e;function K1e(e,t){var r=e.bitLength(),n,o=Mc(1),i;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?i=new Fu(t):t.isEven()?i=new Om(t):i=new Lu(t);var a=new Array,l=3,c=n-1,u=(1<<n)-1;if(a[1]=i.convert(this),n>1){var d=xt();for(i.sqrTo(a[1],d);l<=u;)a[l]=xt(),i.mulTo(d,a[l-2],a[l]),l+=2}var h=e.t-1,y,b=!0,I=xt(),S;for(r=v2(e[h])-1;h>=0;){for(r>=c?y=e[h]>>r-c&u:(y=(e[h]&(1<<r+1)-1)<<c-r,h>0&&(y|=e[h-1]>>this.DB+r-c)),l=n;(y&1)==0;)y>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),b)a[y].copyTo(o),b=!1;else{for(;l>1;)i.sqrTo(o,I),i.sqrTo(I,o),l-=2;l>0?i.sqrTo(o,I):(S=o,o=I,I=S),i.mulTo(I,a[y],o)}for(;h>=0&&(e[h]&1<<r)==0;)i.sqrTo(o,I),S=o,o=I,I=S,--r<0&&(r=this.DB-1,--h)}return i.revert(o)}s(K1e,"bnModPow");function J1e(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r}s(J1e,"bnGCD");function Q1e(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}s(Q1e,"bnpModInt");function ebe(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return ne.ZERO;for(var r=e.clone(),n=this.clone(),o=Mc(1),i=Mc(0),a=Mc(0),l=Mc(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!i.isEven())&&(o.addTo(this,o),i.subTo(e,i)),o.rShiftTo(1,o)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;n.isEven();)n.rShiftTo(1,n),t?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(e,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(a,o),i.subTo(l,i)):(n.subTo(r,n),t&&a.subTo(o,a),l.subTo(i,l))}if(n.compareTo(ne.ONE)!=0)return ne.ZERO;if(l.compareTo(e)>=0)return l.subtract(e);if(l.signum()<0)l.addTo(e,l);else return l;return l.signum()<0?l.add(e):l}s(ebe,"bnModInverse");var Yn=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],tbe=(1<<26)/Yn[Yn.length-1];function rbe(e){var t,r=this.abs();if(r.t==1&&r[0]<=Yn[Yn.length-1]){for(t=0;t<Yn.length;++t)if(r[0]==Yn[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Yn.length;){for(var n=Yn[t],o=t+1;o<Yn.length&&n<tbe;)n*=Yn[o++];for(n=r.modInt(n);t<o;)if(n%Yn[t++]==0)return!1}return r.millerRabin(e)}s(rbe,"bnIsProbablePrime");function nbe(e){var t=this.subtract(ne.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Yn.length&&(e=Yn.length);for(var o=xt(),i=0;i<e;++i){o.fromInt(Yn[Math.floor(Math.random()*Yn.length)]);var a=o.modPow(n,this);if(a.compareTo(ne.ONE)!=0&&a.compareTo(t)!=0){for(var l=1;l++<r&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(ne.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}s(nbe,"bnpMillerRabin");ne.prototype.chunkSize=o1e;ne.prototype.toRadix=s1e;ne.prototype.fromRadix=a1e;ne.prototype.fromNumber=l1e;ne.prototype.bitwiseTo=f1e;ne.prototype.changeBit=M1e;ne.prototype.addTo=k1e;ne.prototype.dMultiply=$1e;ne.prototype.dAddOffset=j1e;ne.prototype.multiplyLowerTo=z1e;ne.prototype.multiplyUpperTo=H1e;ne.prototype.modInt=Q1e;ne.prototype.millerRabin=nbe;ne.prototype.clone=e1e;ne.prototype.intValue=t1e;ne.prototype.byteValue=r1e;ne.prototype.shortValue=n1e;ne.prototype.signum=i1e;ne.prototype.toByteArray=c1e;ne.prototype.equals=p1e;ne.prototype.min=u1e;ne.prototype.max=d1e;ne.prototype.and=h1e;ne.prototype.or=y1e;ne.prototype.xor=g1e;ne.prototype.andNot=b1e;ne.prototype.not=x1e;ne.prototype.shiftLeft=v1e;ne.prototype.shiftRight=I1e;ne.prototype.getLowestSetBit=C1e;ne.prototype.bitCount=P1e;ne.prototype.testBit=w1e;ne.prototype.setBit=O1e;ne.prototype.clearBit=E1e;ne.prototype.flipBit=_1e;ne.prototype.add=A1e;ne.prototype.subtract=D1e;ne.prototype.multiply=F1e;ne.prototype.divide=R1e;ne.prototype.remainder=N1e;ne.prototype.divideAndRemainder=B1e;ne.prototype.modPow=K1e;ne.prototype.modInverse=ebe;ne.prototype.pow=V1e;ne.prototype.gcd=J1e;ne.prototype.isProbablePrime=rbe;ne.prototype.square=L1e;var it=ne;it.prototype.IsNegative=function(){return this.compareTo(it.ZERO)==-1};it.op_Equality=function(e,t){return e.compareTo(t)==0};it.op_Inequality=function(e,t){return e.compareTo(t)!=0};it.op_GreaterThan=function(e,t){return e.compareTo(t)>0};it.op_LessThan=function(e,t){return e.compareTo(t)<0};it.op_Addition=function(e,t){return new it(e).add(new it(t))};it.op_Subtraction=function(e,t){return new it(e).subtract(new it(t))};it.Int128Mul=function(e,t){return new it(e).multiply(new it(t))};it.op_Division=function(e,t){return e.divide(t)};it.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof b2>"u"&&(b2=s(function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),o=0;o<n.length;o++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[o])>"u"&&Object.defineProperty(e.prototype,n[o],Object.getOwnPropertyDescriptor(t.prototype,n[o]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}},"Inherit"));var b2;g.Path=function(){return[]};g.Paths=function(){return[]};g.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};g.DoublePoint0=function(){this.X=0,this.Y=0};g.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};g.DoublePoint2=function(e,t){this.X=e,this.Y=t};g.PolyNode=function(){this.m_Parent=null,this.m_polygon=new g.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};g.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};g.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};g.PolyNode.prototype.Contour=function(){return this.m_polygon};g.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};g.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};g.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};g.PolyNode.prototype.Childs=function(){return this.m_Childs};g.PolyNode.prototype.Parent=function(){return this.m_Parent};g.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};g.PolyTree=function(){this.m_AllPolys=[],g.PolyNode.call(this)};g.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};g.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};g.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};b2(g.PolyTree,g.PolyNode);g.Math_Abs_Int64=g.Math_Abs_Int32=g.Math_Abs_Double=function(e){return Math.abs(e)};g.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};ut.msie||ut.opera||ut.safari?g.Cast_Int32=function(e){return e|0}:g.Cast_Int32=function(e){return~~e};ut.chrome?g.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:ut.firefox&&typeof Number.toInteger=="function"?g.Cast_Int64=function(e){return Number.toInteger(e)}:ut.msie7||ut.msie8?g.Cast_Int64=function(e){return parseInt(e,10)}:ut.msie?g.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:g.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};g.Clear=function(e){e.length=0};g.PI=3.141592653589793;g.PI2=2*3.141592653589793;g.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,Du)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof g.DoublePoint){var r=e[0];this.X=g.Clipper.Round(r.X),this.Y=g.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof g.DoublePoint){var r=e[0];this.X=g.Clipper.Round(r.X),this.Y=g.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};g.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};g.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};Du?(g.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},g.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},g.IntPoint1dp=function(e){this.X=g.Clipper.Round(e.X),this.Y=g.Clipper.Round(e.Y),this.Z=0},g.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},g.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(g.IntPoint0=function(){this.X=0,this.Y=0},g.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},g.IntPoint1dp=function(e){this.X=g.Clipper.Round(e.X),this.Y=g.Clipper.Round(e.Y)},g.IntPoint2=function(e,t){this.X=e,this.Y=t});g.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};g.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};g.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};g.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};g.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};g.PolyType={ptSubject:0,ptClip:1};g.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};g.JoinType={jtSquare:0,jtRound:1,jtMiter:2};g.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};wz&&(g.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});g.EdgeSide={esLeft:0,esRight:1};g.Direction={dRightToLeft:0,dLeftToRight:1};g.TEdge=function(){this.Bot=new g.IntPoint,this.Curr=new g.IntPoint,this.Top=new g.IntPoint,this.Delta=new g.IntPoint,this.Dx=0,this.PolyTyp=g.PolyType.ptSubject,this.Side=g.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};g.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new g.IntPoint};g.MyIntersectNodeSort=function(){};g.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};g.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};g.Scanbeam=function(){this.Y=0,this.Next=null};g.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};g.OutPt=function(){this.Idx=0,this.Pt=new g.IntPoint,this.Next=null,this.Prev=null};g.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new g.IntPoint};g.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};g.ClipperBase.horizontal=-9007199254740992;g.ClipperBase.Skip=-2;g.ClipperBase.Unassigned=-1;g.ClipperBase.tolerance=1e-20;yge?(g.ClipperBase.loRange=46340,g.ClipperBase.hiRange=46340):(g.ClipperBase.loRange=47453132,g.ClipperBase.hiRange=0xfffffffffffff);g.ClipperBase.near_zero=function(e){return e>-g.ClipperBase.tolerance&&e<g.ClipperBase.tolerance};g.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};g.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(g.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};g.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&it.op_Equality(it.Int128Mul(e.X-t.X,r.Y-t.Y),it.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};g.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};g.ClipperBase.prototype.SlopesEqual=g.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,o,i,a,l,c;return t==3?(r=e[0],n=e[1],c=e[2],c?it.op_Equality(it.Int128Mul(r.Delta.Y,n.Delta.X),it.Int128Mul(r.Delta.X,n.Delta.Y)):g.Cast_Int64(r.Delta.Y*n.Delta.X)==g.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(o=e[0],i=e[1],a=e[2],c=e[3],c?it.op_Equality(it.Int128Mul(o.Y-i.Y,i.X-a.X),it.Int128Mul(o.X-i.X,i.Y-a.Y)):g.Cast_Int64((o.Y-i.Y)*(i.X-a.X))-g.Cast_Int64((o.X-i.X)*(i.Y-a.Y))===0):(o=e[0],i=e[1],a=e[2],l=e[3],c=e[4],c?it.op_Equality(it.Int128Mul(o.Y-i.Y,a.X-l.X),it.Int128Mul(o.X-i.X,a.Y-l.Y)):g.Cast_Int64((o.Y-i.Y)*(a.X-l.X))-g.Cast_Int64((o.X-i.X)*(a.Y-l.Y))===0)};g.ClipperBase.SlopesEqual3=function(e,t,r){return r?it.op_Equality(it.Int128Mul(e.Delta.Y,t.Delta.X),it.Int128Mul(e.Delta.X,t.Delta.Y)):g.Cast_Int64(e.Delta.Y*t.Delta.X)==g.Cast_Int64(e.Delta.X*t.Delta.Y)};g.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?it.op_Equality(it.Int128Mul(e.Y-t.Y,t.X-r.X),it.Int128Mul(e.X-t.X,t.Y-r.Y)):g.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-g.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};g.ClipperBase.SlopesEqual5=function(e,t,r,n,o){return o?it.op_Equality(it.Int128Mul(e.Y-t.Y,r.X-n.X),it.Int128Mul(e.X-t.X,r.Y-n.Y)):g.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-g.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};g.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;g.Clear(this.m_edges[e])}g.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};g.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};g.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>g.ClipperBase.hiRange||e.Y>g.ClipperBase.hiRange||-e.X>g.ClipperBase.hiRange||-e.Y>g.ClipperBase.hiRange)&&g.Error("Coordinate outside allowed range in RangeTest()."):(e.X>g.ClipperBase.loRange||e.Y>g.ClipperBase.loRange||-e.X>g.ClipperBase.loRange||-e.Y>g.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};g.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};g.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};g.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;g.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||g.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=g.ClipperBase.horizontal&&e.Prev.Dx!=g.ClipperBase.horizontal)break;for(;e.Prev.Dx==g.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==g.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};g.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,o,i;if(e.Dx==g.ClipperBase.horizontal&&(t?i=e.Prev.Bot.X:i=e.Next.Bot.X,e.Bot.X!=i&&this.ReverseHorizontal(e)),n.OutIdx!=g.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=g.ClipperBase.Skip;)n=n.Next;if(n.Dx==g.ClipperBase.horizontal&&n.Next.OutIdx!=g.ClipperBase.Skip){for(o=n;o.Prev.Dx==g.ClipperBase.horizontal;)o=o.Prev;o.Prev.Top.X==n.Next.Top.X?t||(n=o.Prev):o.Prev.Top.X>n.Next.Top.X&&(n=o.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=g.ClipperBase.Skip;)n=n.Prev;if(n.Dx==g.ClipperBase.horizontal&&n.Prev.OutIdx!=g.ClipperBase.Skip){for(o=n;o.Next.Dx==g.ClipperBase.horizontal;)o=o.Next;o.Next.Top.X==n.Prev.Top.X?t||(n=o.Next):o.Next.Top.X>n.Prev.Top.X&&(n=o.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==g.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==g.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==g.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==g.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var a=new g.LocalMinima;a.Next=null,a.Y=e.Bot.Y,a.LeftBound=null,a.RightBound=e,a.RightBound.WindDelta=0,n=this.ProcessBound(a.RightBound,t),this.InsertLocalMinima(a)}}return n};g.ClipperBase.prototype.AddPath=function(e,t,r){Pz?!r&&t==g.PolyType.ptClip&&g.Error("AddPath: Open paths must be subject."):r||g.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&g.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&g.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var o=new Array,i=0;i<=n;i++)o.push(new g.TEdge);var a=!0;o[1].Curr.X=e[1].X,o[1].Curr.Y=e[1].Y;var l={Value:this.m_UseFullRange};this.RangeTest(e[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(e[n],l),this.m_UseFullRange=l.Value,this.InitEdge(o[0],o[1],o[n],e[0]),this.InitEdge(o[n],o[0],o[n-1],e[n]);for(var i=n-1;i>=1;--i)l.Value=this.m_UseFullRange,this.RangeTest(e[i],l),this.m_UseFullRange=l.Value,this.InitEdge(o[i],o[i+1],o[i-1],e[i]);for(var c=o[0],u=c,d=c;;){if(g.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==c&&(c=u.Next),u=this.RemoveEdge(u),d=u;continue}if(u.Prev==u.Next)break;if(r&&g.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==c&&(c=u.Next),u=this.RemoveEdge(u),u=u.Prev,d=u;continue}if(u=u.Next,u==d)break}if(!r&&u==u.Next||r&&u.Prev==u.Next)return!1;r||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=g.ClipperBase.Skip);var h=c;u=c;do this.InitEdge2(u,t),u=u.Next,a&&u.Curr.Y!=c.Curr.Y&&(a=!1);while(u!=c);if(a){if(r)return!1;u.Prev.OutIdx=g.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var y=new g.LocalMinima;for(y.Next=null,y.Y=u.Bot.Y,y.LeftBound=null,y.RightBound=u,y.RightBound.Side=g.EdgeSide.esRight,y.RightBound.WindDelta=0;u.Next.OutIdx!=g.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(y),this.m_edges.push(o),!0}this.m_edges.push(o);for(var b,I=null;u=this.FindNextLocMin(u),u!=I;){I==null&&(I=u);var y=new g.LocalMinima;y.Next=null,y.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(y.LeftBound=u.Prev,y.RightBound=u,b=!1):(y.LeftBound=u,y.RightBound=u.Prev,b=!0),y.LeftBound.Side=g.EdgeSide.esLeft,y.RightBound.Side=g.EdgeSide.esRight,r?y.LeftBound.Next==y.RightBound?y.LeftBound.WindDelta=-1:y.LeftBound.WindDelta=1:y.LeftBound.WindDelta=0,y.RightBound.WindDelta=-y.LeftBound.WindDelta,u=this.ProcessBound(y.LeftBound,b);var S=this.ProcessBound(y.RightBound,!b);y.LeftBound.OutIdx==g.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==g.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),b||(u=S)}return!0};g.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,o=0,i=e.length;o<i;++o)this.AddPath(e[o],t,r)&&(n=!0);return n};g.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return g.IntPoint.op_Equality(e,r)||g.IntPoint.op_Equality(e,t)||g.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};g.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};g.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=g.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};g.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};g.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};g.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,Du&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};g.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=g.EdgeSide.esLeft,t.OutIdx=g.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=g.EdgeSide.esRight,t.OutIdx=g.ClipperBase.Unassigned),e=e.Next}};g.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=g.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=g.PolyFillType.pftEvenOdd,this.m_SubjFillType=g.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,g.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=g.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,Du&&(this.ZFillFunction=null)};g.Clipper.ioReverseSolution=1;g.Clipper.ioStrictlySimple=2;g.Clipper.ioPreserveCollinear=4;g.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),g.ClipperBase.prototype.Clear.call(this))};g.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};g.Clipper.prototype.Reset=function(){g.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};g.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new g.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new g.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new g.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};g.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof g.PolyTree;if(t==4&&!r){var n=e[0],o=e[1],i=e[2],a=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&g.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,g.Clear(o),this.m_SubjFillType=i,this.m_ClipFillType=a,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var l=this.ExecuteInternal();l&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==4&&r){var n=e[0],c=e[1],i=e[2],a=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=i,this.m_ClipFillType=a,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var l=this.ExecuteInternal();l&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(t==2&&!r){var n=e[0],o=e[1];return this.Execute(n,o,g.PolyFillType.pftEvenOdd,g.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],c=e[1];return this.Execute(n,c,g.PolyFillType.pftEvenOdd,g.PolyFillType.pftEvenOdd)}};g.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};g.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),g.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts===null||o.IsOpen||(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts!==null&&!o.IsOpen&&this.FixupOutPolygon(o)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{g.Clear(this.m_Joins),g.Clear(this.m_GhostJoins)}};g.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};g.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);g.Clear(this.m_PolyOuts)};g.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};g.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};g.Clipper.prototype.AddJoin=function(e,t,r){var n=new g.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};g.Clipper.prototype.AddGhostJoin=function(e,t){var r=new g.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};Du&&(g.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});g.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(g.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&g.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var o=0,i=this.m_GhostJoins.length;o<i;o++){var a=this.m_GhostJoins[o];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,r.Bot,r.Top)&&this.AddJoin(a.OutPt1,n,a.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&g.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,l,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&g.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,l,r.Top)}var c=t.NextInAEL;if(c!==null)for(;c!=r;)this.IntersectEdges(r,c,t.Curr,!1),c=c.NextInAEL}}}};g.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};g.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<g.Clipper.TopX(e,t.Top.Y):e.Top.X>g.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};g.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==g.PolyType.ptSubject?this.m_SubjFillType==g.PolyFillType.pftEvenOdd:this.m_ClipFillType==g.PolyFillType.pftEvenOdd};g.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==g.PolyType.ptSubject?this.m_ClipFillType==g.PolyFillType.pftEvenOdd:this.m_SubjFillType==g.PolyFillType.pftEvenOdd};g.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==g.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case g.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case g.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case g.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case g.ClipType.ctIntersection:switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2!==0;case g.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case g.ClipType.ctUnion:switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2===0;case g.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case g.ClipType.ctDifference:if(e.PolyTyp==g.PolyType.ptSubject)switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2===0;case g.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2!==0;case g.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case g.ClipType.ctXor:if(e.WindDelta===0)switch(r){case g.PolyFillType.pftEvenOdd:case g.PolyFillType.pftNonZero:return e.WindCnt2===0;case g.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};g.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=g.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};g.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};g.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};g.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};g.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};g.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};g.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,o,i;if(g.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=g.EdgeSide.esLeft,t.Side=g.EdgeSide.esRight,o=e,o.PrevInAEL==t?i=t.PrevInAEL:i=o.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=g.EdgeSide.esRight,t.Side=g.EdgeSide.esLeft,o=t,o.PrevInAEL==e?i=e.PrevInAEL:i=o.PrevInAEL),i!==null&&i.OutIdx>=0&&g.Clipper.TopX(i,r.Y)==g.Clipper.TopX(o,r.Y)&&g.ClipperBase.SlopesEqual(o,i,this.m_UseFullRange)&&o.WindDelta!==0&&i.WindDelta!==0){var a=this.AddOutPt(i,r);this.AddJoin(n,a,o.Top)}return n};g.Clipper.prototype.CreateOutRec=function(){var e=new g.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};g.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==g.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var o=new g.OutPt;return n.Pts=o,o.Idx=n.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=o,o.Prev=o,n.IsOpen||this.SetHoleState(e,n),Du&&(g.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):g.IntPoint.op_Equality(t,e.Top)?(o.Pt.X=e.Top.X,o.Pt.Y=e.Top.Y,o.Pt.Z=e.Top.Z):this.SetZ(o.Pt,e)),e.OutIdx=n.Idx,o}else{var n=this.m_PolyOuts[e.OutIdx],i=n.Pts;if(r&&g.IntPoint.op_Equality(t,i.Pt))return i;if(!r&&g.IntPoint.op_Equality(t,i.Prev.Pt))return i.Prev;var o=new g.OutPt;return o.Idx=n.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=i,o.Prev=i.Prev,o.Prev.Next=o,i.Prev=o,r&&(n.Pts=o),Du&&(g.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):g.IntPoint.op_Equality(t,e.Top)?(o.Pt.X=e.Top.X,o.Pt.Y=e.Top.Y,o.Pt.Z=e.Top.Z):this.SetZ(o.Pt,e)),o}};g.Clipper.prototype.SwapPoints=function(e,t){var r=new g.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};g.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};g.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new g.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};g.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};g.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?g.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};g.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;g.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;g.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var o=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;g.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var i=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;g.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var a=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=i&&n>=a||o>=i&&o>=a};g.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;g.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};g.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};g.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};g.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};g.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],o;this.Param1RightOfParam2(r,n)?o=n:this.Param1RightOfParam2(n,r)?o=r:o=this.GetLowermostRec(r,n);var i=r.Pts,a=i.Prev,l=n.Pts,c=l.Prev,u;e.Side==g.EdgeSide.esLeft?(t.Side==g.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=i,i.Prev=l,a.Next=c,c.Prev=a,r.Pts=c):(c.Next=i,i.Prev=c,l.Prev=a,a.Next=l,r.Pts=l),u=g.EdgeSide.esLeft):(t.Side==g.EdgeSide.esRight?(this.ReversePolyPtLinks(l),a.Next=c,c.Prev=a,l.Next=i,i.Prev=l):(a.Next=l,l.Prev=a,i.Prev=c,c.Next=i),u=g.EdgeSide.esRight),r.BottomPt=null,o==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var d=e.OutIdx,h=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==h){y.OutIdx=d,y.Side=u;break}y=y.NextInAEL}n.Idx=r.Idx};g.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};g.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};g.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};g.Clipper.prototype.IntersectEdges=function(e,t,r,n){var o=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,i=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,a=e.OutIdx>=0,l=t.OutIdx>=0;if(Pz&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(o||i)&&a&&l&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==g.ClipType.ctUnion?e.WindDelta===0?l&&(this.AddOutPt(e,r),a&&(e.OutIdx=-1)):a&&(this.AddOutPt(t,r),l&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=g.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),a&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=g.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),l&&(t.OutIdx=-1))),o&&(e.OutIdx<0?this.DeleteFromAEL(e):g.Error("Error intersecting polylines")),i&&(t.OutIdx<0?this.DeleteFromAEL(t):g.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var c=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=c}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var u,d,h,y;e.PolyTyp==g.PolyType.ptSubject?(u=this.m_SubjFillType,h=this.m_ClipFillType):(u=this.m_ClipFillType,h=this.m_SubjFillType),t.PolyTyp==g.PolyType.ptSubject?(d=this.m_SubjFillType,y=this.m_ClipFillType):(d=this.m_ClipFillType,y=this.m_SubjFillType);var b,I;switch(u){case g.PolyFillType.pftPositive:b=e.WindCnt;break;case g.PolyFillType.pftNegative:b=-e.WindCnt;break;default:b=Math.abs(e.WindCnt);break}switch(d){case g.PolyFillType.pftPositive:I=t.WindCnt;break;case g.PolyFillType.pftNegative:I=-t.WindCnt;break;default:I=Math.abs(t.WindCnt);break}if(a&&l)o||i||b!==0&&b!=1||I!==0&&I!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=g.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if(a)(I===0||I==1)&&(this.AddOutPt(e,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if(l)(b===0||b==1)&&(this.AddOutPt(t,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if((b===0||b==1)&&(I===0||I==1)&&!o&&!i){var S,x;switch(h){case g.PolyFillType.pftPositive:S=e.WindCnt2;break;case g.PolyFillType.pftNegative:S=-e.WindCnt2;break;default:S=Math.abs(e.WindCnt2);break}switch(y){case g.PolyFillType.pftPositive:x=t.WindCnt2;break;case g.PolyFillType.pftNegative:x=-t.WindCnt2;break;default:x=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(b==1&&I==1)switch(this.m_ClipType){case g.ClipType.ctIntersection:S>0&&x>0&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctUnion:S<=0&&x<=0&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctDifference:(e.PolyTyp==g.PolyType.ptClip&&S>0&&x>0||e.PolyTyp==g.PolyType.ptSubject&&S<=0&&x<=0)&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else g.Clipper.SwapSides(e,t)}o!=i&&(o&&e.OutIdx>=0||i&&t.OutIdx>=0)&&(g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t)),o&&this.DeleteFromAEL(e),i&&this.DeleteFromAEL(t)};g.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};g.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};g.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&g.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,g.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};g.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};g.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=g.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=g.Direction.dRightToLeft)};g.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=g.EdgeSide.esLeft&&(r=r.Prev),t&&(g.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};g.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,o=r.Left,i=r.Right,a=e,l=null;a.NextInLML!==null&&g.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(l=this.GetMaximaPair(a));;){for(var c=e==a,u=this.GetNextInAEL(e,n);u!==null&&!(u.Curr.X==e.Top.X&&e.NextInLML!==null&&u.Dx<e.NextInLML.Dx);){var d=this.GetNextInAEL(u,n);if(n==g.Direction.dLeftToRight&&u.Curr.X<=i||n==g.Direction.dRightToLeft&&u.Curr.X>=o){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),u==l&&c){n==g.Direction.dLeftToRight?this.IntersectEdges(e,u,u.Top,!1):this.IntersectEdges(u,e,u.Top,!1),l.OutIdx>=0&&g.Error("ProcessHorizontal error");return}else if(n==g.Direction.dLeftToRight){var h=new g.IntPoint(u.Curr.X,e.Curr.Y);this.IntersectEdges(e,u,h,!0)}else{var h=new g.IntPoint(u.Curr.X,e.Curr.Y);this.IntersectEdges(u,e,h,!0)}this.SwapPositionsInAEL(e,u)}else if(n==g.Direction.dLeftToRight&&u.Curr.X>=i||n==g.Direction.dRightToLeft&&u.Curr.X<=o)break;u=d}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&g.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:o,Right:i};this.GetHorzDirection(e,r),n=r.Dir,o=r.Left,i=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var y=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var b=e.PrevInAEL,d=e.NextInAEL;if(b!==null&&b.Curr.X==e.Bot.X&&b.Curr.Y==e.Bot.Y&&b.WindDelta!==0&&b.OutIdx>=0&&b.Curr.Y>b.Top.Y&&g.ClipperBase.SlopesEqual(e,b,this.m_UseFullRange)){var I=this.AddOutPt(b,e.Bot);this.AddJoin(y,I,e.Top)}else if(d!==null&&d.Curr.X==e.Bot.X&&d.Curr.Y==e.Bot.Y&&d.WindDelta!==0&&d.OutIdx>=0&&d.Curr.Y>d.Top.Y&&g.ClipperBase.SlopesEqual(e,d,this.m_UseFullRange)){var I=this.AddOutPt(d,e.Bot);this.AddJoin(y,I,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else l!==null?l.OutIdx>=0?(n==g.Direction.dLeftToRight?this.IntersectEdges(e,l,e.Top,!1):this.IntersectEdges(l,e,e.Top,!1),l.OutIdx>=0&&g.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(l)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};g.Clipper.prototype.GetNextInAEL=function(e,t){return t==g.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};g.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};g.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};g.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};g.Clipper.prototype.GetMaximaPair=function(e){var t=null;return g.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:g.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!g.ClipperBase.IsHorizontal(t))?null:t};g.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,g.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};g.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=g.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var o=r.NextInSEL,i=new g.IntPoint;if(r.Curr.X>o.Curr.X){!this.IntersectPoint(r,o,i)&&r.Curr.X>o.Curr.X+1&&g.Error("Intersection error"),i.Y>e&&(i.Y=e,Math.abs(r.Dx)>Math.abs(o.Dx)?i.X=g.Clipper.TopX(o,e):i.X=g.Clipper.TopX(r,e));var a=new g.IntersectNode;a.Edge1=r,a.Edge2=o,a.Pt.X=i.X,a.Pt.Y=i.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(r,o),n=!0}else r=o}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};g.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};g.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};g.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};g.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var obe=s(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),ibe=s(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),sbe=s(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),abe=s(function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)},"R4");ut.msie?g.Clipper.Round=obe:ut.chromium?g.Clipper.Round=sbe:ut.safari?g.Clipper.Round=abe:g.Clipper.Round=ibe;g.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+g.Clipper.Round(e.Dx*(t-e.Bot.Y))};g.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,o;if(g.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,g.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,r.Y=g.Clipper.Round(r.X/t.Dx+o));else if(t.Delta.X===0)r.X=t.Bot.X,g.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=g.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,o=t.Bot.X-t.Bot.Y*t.Dx;var i=(o-n)/(e.Dx-t.Dx);r.Y=g.Clipper.Round(i),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=g.Clipper.Round(e.Dx*i+n):r.X=g.Clipper.Round(t.Dx*i+o)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=g.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=g.Clipper.TopX(e,r.Y):r.X=g.Clipper.TopX(t,r.Y)}return!0};g.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!g.ClipperBase.IsHorizontal(n)}if(r){var o=t.PrevInAEL;this.DoMaxima(t),o===null?t=this.m_ActiveEdges:t=o.NextInAEL}else{if(this.IsIntermediate(t,e)&&g.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=g.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var o=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&o!==null&&o.OutIdx>=0&&o.Curr.X==t.Curr.X&&o.WindDelta!==0){var i=this.AddOutPt(o,t.Curr),a=this.AddOutPt(t,t.Curr);this.AddJoin(i,a,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var i=null;t.OutIdx>=0&&(i=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var o=t.PrevInAEL,l=t.NextInAEL;if(o!==null&&o.Curr.X==t.Bot.X&&o.Curr.Y==t.Bot.Y&&i!==null&&o.OutIdx>=0&&o.Curr.Y>o.Top.Y&&g.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,t.Bot);this.AddJoin(i,a,t.Top)}else if(l!==null&&l.Curr.X==t.Bot.X&&l.Curr.Y==t.Bot.Y&&i!==null&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&g.ClipperBase.SlopesEqual(t,l,this.m_UseFullRange)&&t.WindDelta!==0&&l.WindDelta!==0){var a=this.AddOutPt(l,t.Bot);this.AddJoin(i,a,t.Top)}}t=t.NextInAEL}};g.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):g.Error("DoMaxima error")};g.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};g.Clipper.Orientation=function(e){return g.Clipper.Area(e)>=0};g.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};g.Clipper.prototype.BuildResult=function(e){g.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var o=n.Pts.Prev,i=this.PointCount(o);if(!(i<2)){for(var a=new Array(i),l=0;l<i;l++)a[l]=o.Pt,o=o.Prev;e.push(a)}}}};g.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],o=this.PointCount(n.Pts);if(!(n.IsOpen&&o<2||!n.IsOpen&&o<3)){this.FixHoleLinkage(n);var i=new g.PolyNode;e.m_AllPolys.push(i),n.PolyNode=i,i.m_polygon.length=o;for(var a=n.Pts.Prev,l=0;l<o;l++)i.m_polygon[l]=a.Pt,a=a.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};g.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(g.IntPoint.op_Equality(r.Pt,r.Next.Pt)||g.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||g.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};g.Clipper.prototype.DupOutPt=function(e,t){var r=new g.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};g.Clipper.prototype.GetOverlap=function(e,t,r,n,o){return e<t?r<n?(o.Left=Math.max(e,r),o.Right=Math.min(t,n)):(o.Left=Math.max(e,n),o.Right=Math.min(t,r)):r<n?(o.Left=Math.max(t,r),o.Right=Math.min(e,n)):(o.Left=Math.max(t,n),o.Right=Math.min(e,r)),o.Left<o.Right};g.Clipper.prototype.JoinHorz=function(e,t,r,n,o,i){var a=e.Pt.X>t.Pt.X?g.Direction.dRightToLeft:g.Direction.dLeftToRight,l=r.Pt.X>n.Pt.X?g.Direction.dRightToLeft:g.Direction.dLeftToRight;if(a==l)return!1;if(a==g.Direction.dLeftToRight){for(;e.Next.Pt.X<=o.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;i&&e.Pt.X!=o.X&&(e=e.Next),t=this.DupOutPt(e,!i),g.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,!i))}else{for(;e.Next.Pt.X>=o.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;!i&&e.Pt.X!=o.X&&(e=e.Next),t=this.DupOutPt(e,i),g.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,i))}if(l==g.Direction.dLeftToRight){for(;r.Next.Pt.X<=o.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;i&&r.Pt.X!=o.X&&(r=r.Next),n=this.DupOutPt(r,!i),g.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,!i))}else{for(;r.Next.Pt.X>=o.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;!i&&r.Pt.X!=o.X&&(r=r.Next),n=this.DupOutPt(r,i),g.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,i))}return a==g.Direction.dLeftToRight==i?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};g.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,o=new g.OutPt,i=e.OutPt2,a=new g.OutPt,l=e.OutPt1.Pt.Y==e.OffPt.Y;if(l&&g.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&g.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(o=e.OutPt1.Next;o!=n&&g.IntPoint.op_Equality(o.Pt,e.OffPt);)o=o.Next;var c=o.Pt.Y>e.OffPt.Y;for(a=e.OutPt2.Next;a!=i&&g.IntPoint.op_Equality(a.Pt,e.OffPt);)a=a.Next;var u=a.Pt.Y>e.OffPt.Y;return c==u?!1:c?(o=this.DupOutPt(n,!1),a=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=a,a.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),a=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=a,a.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}else if(l){for(o=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=o&&n.Prev!=i;)n=n.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=n&&o.Next!=i;)o=o.Next;if(o.Next==n||o.Next==i)return!1;for(a=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=a&&i.Prev!=o;)i=i.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=i&&a.Next!=n;)a=a.Next;if(a.Next==i||a.Next==n)return!1;var d={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,o.Pt.X,i.Pt.X,a.Pt.X,d))return!1;var h=d.Left,y=d.Right,b=new g.IntPoint,I;return n.Pt.X>=h&&n.Pt.X<=y?(b.X=n.Pt.X,b.Y=n.Pt.Y,I=n.Pt.X>o.Pt.X):i.Pt.X>=h&&i.Pt.X<=y?(b.X=i.Pt.X,b.Y=i.Pt.Y,I=i.Pt.X>a.Pt.X):o.Pt.X>=h&&o.Pt.X<=y?(b.X=o.Pt.X,b.Y=o.Pt.Y,I=o.Pt.X>n.Pt.X):(b.X=a.Pt.X,b.Y=a.Pt.Y,I=a.Pt.X>i.Pt.X),e.OutPt1=n,e.OutPt2=i,this.JoinHorz(n,o,i,a,b,I)}else{for(o=n.Next;g.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Next;var S=o.Pt.Y>n.Pt.Y||!g.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange);if(S){for(o=n.Prev;g.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Prev;if(o.Pt.Y>n.Pt.Y||!g.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange))return!1}for(a=i.Next;g.IntPoint.op_Equality(a.Pt,i.Pt)&&a!=i;)a=a.Next;var x=a.Pt.Y>i.Pt.Y||!g.ClipperBase.SlopesEqual(i.Pt,a.Pt,e.OffPt,this.m_UseFullRange);if(x){for(a=i.Prev;g.IntPoint.op_Equality(a.Pt,i.Pt)&&a!=i;)a=a.Prev;if(a.Pt.Y>i.Pt.Y||!g.ClipperBase.SlopesEqual(i.Pt,a.Pt,e.OffPt,this.m_UseFullRange))return!1}return o==n||a==i||o==a||t==r&&S==x?!1:S?(o=this.DupOutPt(n,!1),a=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=a,a.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),a=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=a,a.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}};g.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new g.IntRect(0,0,0,0);var n=new g.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var o=0,i=e[t].length;o<i;o++)e[t][o].X<n.left?n.left=e[t][o].X:e[t][o].X>n.right&&(n.right=e[t][o].X),e[t][o].Y<n.top?n.top=e[t][o].Y:e[t][o].Y>n.bottom&&(n.bottom=e[t][o].Y);return n};g.Clipper.prototype.GetBounds2=function(e){var t=e,r=new g.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};g.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var o=t[0],i=1;i<=n;++i){var a=i==n?t[0]:t[i];if(a.Y==e.Y&&(a.X==e.X||o.Y==e.Y&&a.X>e.X==o.X<e.X))return-1;if(o.Y<e.Y!=a.Y<e.Y){if(o.X>=e.X)if(a.X>e.X)r=1-r;else{var l=(o.X-e.X)*(a.Y-e.Y)-(a.X-e.X)*(o.Y-e.Y);if(l==0)return-1;l>0==a.Y>o.Y&&(r=1-r)}else if(a.X>e.X){var l=(o.X-e.X)*(a.Y-e.Y)-(a.X-e.X)*(o.Y-e.Y);if(l==0)return-1;l>0==a.Y>o.Y&&(r=1-r)}}o=a}return r};g.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var o=t.Pt.X,i=t.Pt.Y,a=t.Next.Pt.X,l=t.Next.Pt.Y;if(l==e.Y&&(a==e.X||i==e.Y&&a>e.X==o<e.X))return-1;if(i<e.Y!=l<e.Y){if(o>=e.X)if(a>e.X)r=1-r;else{var c=(o-e.X)*(l-e.Y)-(a-e.X)*(i-e.Y);if(c==0)return-1;c>0==l>i&&(r=1-r)}else if(a>e.X){var c=(o-e.X)*(l-e.Y)-(a-e.X)*(i-e.Y);if(c==0)return-1;c>0==l>i&&(r=1-r)}}if(t=t.Next,n==t)break}return r};g.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};g.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts!==null&&o.FirstLeft==e&&this.Poly2ContainsPoly1(o.Pts,t.Pts)&&(o.FirstLeft=t)}};g.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,o=n.length,i=n[r];r<o;r++,i=n[r])i.FirstLeft==e&&(i.FirstLeft=t)};g.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};g.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),o=this.GetOutRec(r.OutPt2.Idx);if(!(n.Pts==null||o.Pts==null)){var i;if(n==o?i=n:this.Param1RightOfParam2(n,o)?i=o:this.Param1RightOfParam2(o,n)?i=n:i=this.GetLowermostRec(n,o),!!this.JoinPoints(r,n,o))if(n==o){if(n.Pts=r.OutPt1,n.BottomPt=null,o=this.CreateOutRec(),o.Pts=r.OutPt2,this.UpdateOutPtIdxs(o),this.m_UsingPolyTree)for(var a=0,l=this.m_PolyOuts.length;a<l-1;a++){var c=this.m_PolyOuts[a];c.Pts==null||g.Clipper.ParseFirstLeft(c.FirstLeft)!=n||c.IsHole==n.IsHole||this.Poly2ContainsPoly1(c.Pts,r.OutPt2)&&(c.FirstLeft=o)}this.Poly2ContainsPoly1(o.Pts,n.Pts)?(o.IsHole=!n.IsHole,o.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,n),(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)):this.Poly2ContainsPoly1(n.Pts,o.Pts)?(o.IsHole=n.IsHole,n.IsHole=!o.IsHole,o.FirstLeft=n.FirstLeft,n.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,o),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(o.IsHole=n.IsHole,o.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,o))}else o.Pts=null,o.BottomPt=null,o.Idx=n.Idx,n.IsHole=i.IsHole,i==o&&(n.FirstLeft=o.FirstLeft),o.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,n)}}};g.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};g.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(g.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var o=r.Prev,i=n.Prev;r.Prev=i,i.Next=r,n.Prev=o,o.Next=n,t.Pts=r;var a=this.CreateOutRec();a.Pts=n,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,t.Pts)?(a.IsHole=!t.IsHole,a.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,a.Pts)?(a.IsHole=t.IsHole,t.IsHole=!a.IsHole,a.FirstLeft=t.FirstLeft,t.FirstLeft=a):(a.IsHole=t.IsHole,a.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};g.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,o=t-1;n<t;++n)r+=(e[o].X+e[n].X)*(e[o].Y-e[n].Y),o=n;return-r*.5};g.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};wz&&(g.Clipper.OffsetPaths=function(e,t,r,n,o){var i=new g.Paths,a=new g.ClipperOffset(o,o);return a.AddPaths(e,r,n),a.Execute(i,t),i});g.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new g.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,g.PolyType.ptSubject,!0),n.Execute(g.ClipType.ctUnion,r,t,t),r};g.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=g.PolyFillType.pftEvenOdd);var r=new Array,n=new g.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,g.PolyType.ptSubject,!0),n.Execute(g.ClipType.ctUnion,r,t,t),r};g.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};g.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,o=r.X-t.X,i=n*t.X+o*t.Y;return i=n*e.X+o*e.Y-i,i*i/(n*n+o*o)};g.Clipper.SlopesNearCollinear=function(e,t,r,n){return g.Clipper.DistanceFromLineSqrd(t,e,r)<n};g.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,o=e.Y-t.Y;return n*n+o*o<=r};g.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};g.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),o=0;o<r;++o)n[o]=new g.OutPt;for(var o=0;o<r;++o)n[o].Pt=e[o],n[o].Next=n[(o+1)%r],n[o].Next.Prev=n[o],n[o].Idx=0;for(var i=t*t,a=n[0];a.Idx==0&&a.Next!=a.Prev;)g.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,i)?(a=g.Clipper.ExcludeOp(a),r--):g.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,i)?(g.Clipper.ExcludeOp(a.Next),a=g.Clipper.ExcludeOp(a),r-=2):g.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,i)?(a=g.Clipper.ExcludeOp(a),r--):(a.Idx=1,a=a.Next);r<3&&(r=0);for(var l=new Array(r),o=0;o<r;++o)l[o]=new g.IntPoint(a.Pt),a=a.Next;return n=null,l};g.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,o=e.length;n<o;n++)r[n]=g.Clipper.CleanPolygon(e[n],t);return r};g.Clipper.Minkowski=function(e,t,r,n){var o=n?1:0,i=e.length,a=t.length,l=new Array;if(r)for(var c=0;c<a;c++){for(var u=new Array(i),d=0,h=e.length,y=e[d];d<h;d++,y=e[d])u[d]=new g.IntPoint(t[c].X+y.X,t[c].Y+y.Y);l.push(u)}else for(var c=0;c<a;c++){for(var u=new Array(i),d=0,h=e.length,y=e[d];d<h;d++,y=e[d])u[d]=new g.IntPoint(t[c].X-y.X,t[c].Y-y.Y);l.push(u)}for(var b=new Array,c=0;c<a-1+o;c++)for(var d=0;d<i;d++){var I=new Array;I.push(l[c%a][d%i]),I.push(l[(c+1)%a][d%i]),I.push(l[(c+1)%a][(d+1)%i]),I.push(l[c%a][(d+1)%i]),g.Clipper.Orientation(I)||I.reverse(),b.push(I)}var S=new g.Clipper(0);return S.AddPaths(b,g.PolyType.ptSubject,!0),S.Execute(g.ClipType.ctUnion,l,g.PolyFillType.pftNonZero,g.PolyFillType.pftNonZero),l};g.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],o=e[2];return g.Clipper.Minkowski(r,n,!0,o)}else if(t==4){for(var r=e[0],i=e[1],a=e[2],o=e[3],l=new g.Clipper,c,u=0,d=i.length;u<d;++u){var c=g.Clipper.Minkowski(r,i[u],!0,o);l.AddPaths(c,g.PolyType.ptSubject,!0)}o&&l.AddPaths(i,g.PolyType.ptClip,!0);var h=new g.Paths;return l.Execute(g.ClipType.ctUnion,h,a,a),h}};g.Clipper.MinkowskiDiff=function(e,t,r){return g.Clipper.Minkowski(e,t,!1,r)};g.Clipper.PolyTreeToPaths=function(e){var t=new Array;return g.Clipper.AddPolyNodeToPaths(e,g.Clipper.NodeType.ntAny,t),t};g.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case g.Clipper.NodeType.ntOpen:return;case g.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var o=0,i=e.Childs(),a=i.length,l=i[o];o<a;o++,l=i[o])g.Clipper.AddPolyNodeToPaths(l,t,r)};g.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new g.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};g.Clipper.ClosedPathsFromPolyTree=function(e){var t=new g.Paths;return g.Clipper.AddPolyNodeToPaths(e,g.Clipper.NodeType.ntClosed,t),t};b2(g.Clipper,g.ClipperBase);g.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};g.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=g.ClipperOffset.def_arc_tolerance),this.m_destPolys=new g.Paths,this.m_srcPoly=new g.Path,this.m_destPoly=new g.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new g.IntPoint,this.m_polyNodes=new g.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};g.ClipperOffset.two_pi=6.28318530717959;g.ClipperOffset.def_arc_tolerance=.25;g.ClipperOffset.prototype.Clear=function(){g.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};g.ClipperOffset.Round=g.Clipper.Round;g.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var o=new g.PolyNode;if(o.m_jointype=t,o.m_endtype=r,r==g.EndType.etClosedLine||r==g.EndType.etClosedPolygon)for(;n>0&&g.IntPoint.op_Equality(e[0],e[n]);)n--;o.m_polygon.push(e[0]);for(var i=0,a=0,l=1;l<=n;l++)g.IntPoint.op_Inequality(o.m_polygon[i],e[l])&&(i++,o.m_polygon.push(e[l]),(e[l].Y>o.m_polygon[a].Y||e[l].Y==o.m_polygon[a].Y&&e[l].X<o.m_polygon[a].X)&&(a=i));if(!(r==g.EndType.etClosedPolygon&&i<2||r!=g.EndType.etClosedPolygon&&i<0)&&(this.m_polyNodes.AddChild(o),r==g.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new g.IntPoint(0,a);else{var c=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(o.m_polygon[a].Y>c.Y||o.m_polygon[a].Y==c.Y&&o.m_polygon[a].X<c.X)&&(this.m_lowest=new g.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};g.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,o=e.length;n<o;n++)this.AddPath(e[n],t,r)};g.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!g.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==g.EndType.etClosedPolygon||t.m_endtype==g.EndType.etClosedLine&&g.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==g.EndType.etClosedLine&&!g.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};g.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new g.DoublePoint(0,0);var o=1/Math.sqrt(r*r+n*n);return r*=o,n*=o,new g.DoublePoint(n,-r)};g.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,g.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==g.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=g.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*g.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*g.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(g.ClipperOffset.two_pi/o),this.m_cos=Math.cos(g.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/g.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var i=this.m_srcPoly.length;if(!(i==0||e<=0&&(i<3||r.m_endtype!=g.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,i==1){if(r.m_jointype==g.JoinType.jtRound)for(var a=1,l=0,c=1;c<=o;c++){this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X+a*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y+l*e)));var u=a;a=a*this.m_cos-this.m_sin*l,l=u*this.m_sin+l*this.m_cos}else for(var a=-1,l=-1,c=0;c<4;++c)this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X+a*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y+l*e))),a<0?a=1:l<0?l=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var c=0;c<i-1;c++)this.m_normals.push(g.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(r.m_endtype==g.EndType.etClosedLine||r.m_endtype==g.EndType.etClosedPolygon?this.m_normals.push(g.ClipperOffset.GetUnitNormal(this.m_srcPoly[i-1],this.m_srcPoly[0])):this.m_normals.push(new g.DoublePoint(this.m_normals[i-2])),r.m_endtype==g.EndType.etClosedPolygon){for(var d=i-1,c=0;c<i;c++)d=this.OffsetPoint(c,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==g.EndType.etClosedLine){for(var d=i-1,c=0;c<i;c++)d=this.OffsetPoint(c,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var h=this.m_normals[i-1],c=i-1;c>0;c--)this.m_normals[c]=new g.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new g.DoublePoint(-h.X,-h.Y),d=0;for(var c=i-1;c>=0;c--)d=this.OffsetPoint(c,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var d=0,c=1;c<i-1;++c)d=this.OffsetPoint(c,d,r.m_jointype);var y;if(r.m_endtype==g.EndType.etOpenButt){var c=i-1;y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*e),g.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*e)),this.m_destPoly.push(y),y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*e),g.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*e)),this.m_destPoly.push(y)}else{var c=i-1;d=i-2,this.m_sinA=0,this.m_normals[c]=new g.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),r.m_endtype==g.EndType.etOpenSquare?this.DoSquare(c,d):this.DoRound(c,d)}for(var c=i-1;c>0;c--)this.m_normals[c]=new g.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new g.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),d=i-1;for(var c=d-1;c>0;--c)d=this.OffsetPoint(c,d,r.m_jointype);r.m_endtype==g.EndType.etOpenButt?(y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(y),y=new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),g.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(y)):(d=1,this.m_sinA=0,r.m_endtype==g.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};g.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof g.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var o=new g.Clipper(0);if(o.AddPaths(this.m_destPolys,g.PolyType.ptSubject,!0),n>0)o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftPositive,g.PolyFillType.pftPositive);else{var i=g.Clipper.GetBounds(this.m_destPolys),a=new g.Path;if(a.push(new g.IntPoint(i.left-10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.top-10)),a.push(new g.IntPoint(i.left-10,i.top-10)),o.AddPath(a,g.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftNegative,g.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var l=r.Childs()[0];r.Childs()[0]=l.Childs()[0];for(var c=1;c<l.ChildCount();c++)r.AddChild(l.Childs()[c])}else r.Clear()}}else{var r=e[0],n=e[1];g.Clear(r),this.FixOrientations(),this.DoOffset(n);var o=new g.Clipper(0);if(o.AddPaths(this.m_destPolys,g.PolyType.ptSubject,!0),n>0)o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftPositive,g.PolyFillType.pftPositive);else{var i=g.Clipper.GetBounds(this.m_destPolys),a=new g.Path;a.push(new g.IntPoint(i.left-10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.bottom+10)),a.push(new g.IntPoint(i.right+10,i.top-10)),a.push(new g.IntPoint(i.left-10,i.top-10)),o.AddPath(a,g.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(g.ClipType.ctUnion,r,g.PolyFillType.pftNegative,g.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};g.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new g.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case g.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case g.JoinType.jtSquare:this.DoSquare(e,t);break;case g.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};g.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};g.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),g.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};g.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=g.Cast_Int32(g.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),o=this.m_normals[t].X,i=this.m_normals[t].Y,a,l=0;l<n;++l)this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+o*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+i*this.m_delta))),a=o,o=o*this.m_cos-this.m_sin*i,i=a*this.m_sin+i*this.m_cos;this.m_destPoly.push(new g.IntPoint(g.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),g.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};g.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};g.JS={};g.JS.AreaOfPolygon=function(e,t){return t||(t=1),g.Clipper.Area(e)/(t*t)};g.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=g.Clipper.Area(e[n]);return r/(t*t)};g.JS.BoundsOfPath=function(e,t){return g.JS.BoundsOfPaths([e],t)};g.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=g.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};g.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=g.JS.Clone(n);if(typeof t!="number"||t===null)return g.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var o=n.length,i,a,l,c,u,d,h,y=[],b=0;b<o;b++)if(a=n[b],i=a.length,i!==0){if(i<3){l=a,y.push(l);continue}for(l=a,c=t*t,u=a[0],d=1,h=1;h<i;h++)(a[h].X-u.X)*(a[h].X-u.X)+(a[h].Y-u.Y)*(a[h].Y-u.Y)<=c||(l[d]=a[h],u=a[h],d++);u=a[d-1],(a[0].X-u.X)*(a[0].X-u.X)+(a[0].Y-u.Y)*(a[0].Y-u.Y)<=c&&d--,d<i&&l.splice(d,i-d),l.length&&y.push(l)}return!r&&y.length?y=y[0]:!r&&y.length===0?y=[]:r&&y.length===0&&(y=[[]]),y};g.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,o,i,a,l=new Array(r);for(o=0;o<r;o++){for(n=e[o].length,a=new Array(n),i=0;i<n;i++)a[i]={X:e[o][i].X,Y:e[o][i].Y};l[o]=a}return t||(l=l[0]),l};g.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return g.Error("Tolerance is not a number in Lighten()."),g.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return g.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,o,i,a,l,c,u,d,h,y,b,I,S,x,T,w,M=e.length,O=t*t,_=[];for(r=0;r<M;r++)if(o=e[r],l=o.length,l!=0){for(i=0;i<1e6;i++){for(a=[],l=o.length,o[l-1].X!=o[0].X||o[l-1].Y!=o[0].Y?(b=1,o.push({X:o[0].X,Y:o[0].Y}),l=o.length):b=0,y=[],n=0;n<l-2;n++)c=o[n],d=o[n+1],u=o[n+2],T=c.X,w=c.Y,I=u.X-T,S=u.Y-w,(I!==0||S!==0)&&(x=((d.X-T)*I+(d.Y-w)*S)/(I*I+S*S),x>1?(T=u.X,w=u.Y):x>0&&(T+=I*x,w+=S*x)),I=d.X-T,S=d.Y-w,h=I*I+S*S,h<=O&&(y[n+1]=1,n++);for(a.push({X:o[0].X,Y:o[0].Y}),n=1;n<l-1;n++)y[n]||a.push({X:o[n].X,Y:o[n].Y});if(a.push({X:o[l-1].X,Y:o[l-1].Y}),b&&o.pop(),y.length)o=a;else break}l=a.length,a[l-1].X==a[0].X&&a[l-1].Y==a[0].Y&&a.pop(),a.length>2&&_.push(a)}return!e[0]instanceof Array&&(_=_[0]),typeof _>"u"&&(_=[[]]),_};g.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,o=0,i,a,l=0,c=0,u=0,d=0,h=e.length;if(h<2)return 0;for(t&&(e[h]=e[0],h++);--h;)i=e[h],l=i.X,c=i.Y,a=e[h-1],u=a.X,d=a.Y,o+=n((l-u)*(l-u)+(c-d)*(c-d));return t&&e.pop(),o/r};g.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,o=0;o<e.length;o++)n+=g.JS.PerimeterOfPath(e[o],t,r);return n};g.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};g.JS.ScaleDownPaths=function(e,t){var r,n,o,i=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)o=e[r][n],o.X=o.X/t,o.Y=o.Y/t};g.JS.ScaleUpPath=function(e,t){var r,n,o=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=o(n.X*t),n.Y=o(n.Y*t)};g.JS.ScaleUpPaths=function(e,t){var r,n,o,i=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)o=e[r][n],o.X=i(o.X*t),o.Y=i(o.Y*t)};g.ExPolygons=function(){return[]};g.ExPolygon=function(){this.outer=null,this.holes=null};g.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new g.ExPolygon;r.outer=e.Contour();var n=e.Childs(),o=n.length;r.holes=new Array(o);var i,a,l,c,u,d;for(l=0;l<o;l++)for(i=n[l],r.holes[l]=i.Contour(),c=0,u=i.Childs(),d=u.length;c<d;c++)a=u[c],g.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(r)};g.JS.ExPolygonsToPaths=function(e){var t,r,n,o,i=new g.Paths;for(t=0,n=e.length;t<n;t++)for(i.push(e[t].outer),r=0,o=e[t].holes.length;r<o;r++)i.push(e[t].holes[r]);return i};g.JS.PolyTreeToExPolygons=function(e){var t=new g.ExPolygons,r,n,o,i;for(n=0,o=e.Childs(),i=o.length;n<i;n++)r=o[n],g.JS.AddOuterPolyNodeToExPolygons(r,t);return t};Vg.exports=g});var tW=ue((eyt,gI)=>{f();(function(){"use strict";function e(a,l){var c=a.x-l.x,u=a.y-l.y;return c*c+u*u}s(e,"getSqDist");function t(a,l,c){var u=l.x,d=l.y,h=c.x-u,y=c.y-d;if(h!==0||y!==0){var b=((a.x-u)*h+(a.y-d)*y)/(h*h+y*y);b>1?(u=c.x,d=c.y):b>0&&(u+=h*b,d+=y*b)}return h=a.x-u,y=a.y-d,h*h+y*y}s(t,"getSqSegDist");function r(a,l){for(var c=a[0],u=[c],d,h=1,y=a.length;h<y;h++)d=a[h],e(d,c)>l&&(u.push(d),c=d);return c!==d&&u.push(d),u}s(r,"simplifyRadialDist");function n(a,l,c,u,d){for(var h=u,y,b=l+1;b<c;b++){var I=t(a[b],a[l],a[c]);I>h&&(y=b,h=I)}h>u&&(y-l>1&&n(a,l,y,u,d),d.push(a[y]),c-y>1&&n(a,y,c,u,d))}s(n,"simplifyDPStep");function o(a,l){var c=a.length-1,u=[a[0]];return n(a,0,c,l,u),u.push(a[c]),u}s(o,"simplifyDouglasPeucker");function i(a,l,c){if(a.length<=2)return a;var u=l!==void 0?l*l:1;return a=c?a:r(a,u),a=o(a,u),a}s(i,"simplify"),typeof define=="function"&&define.amd?define(function(){return i}):typeof gI<"u"?(gI.exports=i,gI.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});f();f();var Id=class Id{constructor(t,r,n){m(this,"__type",Id.__type);m(this,"id",At());m(this,"latitude");m(this,"longitude");m(this,"floorId");m(this,"verticalOffset");var o;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(o=t.verticalOffset)!=null?o:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===Id.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};s(Id,"Coordinate"),m(Id,"__type","coordinate");var qI=Id,$e=qI;f();var ZI=class ZI{constructor(t){m(this,"id");this.id=t}};s(ZI,"BaseMetaData");var jr=ZI;var xs,jn,ap,Ul,Sd=class Sd extends jr{constructor(r,n){super(n.mvfData.properties.id);m(this,"__type",Sd.__type);E(this,xs);E(this,jn,{});E(this,ap);E(this,Ul);A(this,xs,r),A(this,ap,n.floorId),A(this,Ul,n.mvfData)}static is(r){return r.__type===Sd.__type}get locations(){return p(this,jn).locations?p(this,jn).locations:(p(this,jn).locations=(p(this,xs).locationIdsByNodeId[this.id]||[]).map(r=>p(this,xs).getById("enterprise-location",r)).filter(Boolean),p(this,jn).locations)}get space(){var r;return p(this,xs).getById("space",(r=p(this,xs).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=p(this,xs).getById("floor",p(this,ap));if(r==null)throw new Error("Floor ".concat(p(this,ap)," not found!"));return r}get coordinate(){if(p(this,jn).coordinate==null){let[r,n]=p(this,Ul).geometry.coordinates;p(this,jn).coordinate=new $e(n,r,p(this,ap))}return p(this,jn).coordinate}get externalId(){var r;return(r=p(this,Ul).properties.externalId)!=null?r:""}get neighbors(){if(p(this,jn).neighbours==null){let r=p(this,Ul).properties.neighbors.map(n=>{let o=p(this,xs).getById("node",n.id);if(o==null)throw new Error("Node ".concat(n.id," not found!"));return o});p(this,jn).neighbours=r}return p(this,jn).neighbours}get geoJSON(){return R(P({},p(this,Ul)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(r=>r.id)}}destroy(){for(let r of Object.keys(p(this,jn)))delete p(this,jn)[r]}};xs=new WeakMap,jn=new WeakMap,ap=new WeakMap,Ul=new WeakMap,s(Sd,"Node"),m(Sd,"__type","node");var XI=Sd,Sa=XI;f();f();var lp,YI=class YI{constructor(t,r){m(this,"id");E(this,lp);this.id=t}get geoJSONBoundingBox(){return p(this,lp)?p(this,lp):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(A(this,lp,hd(this.geoJSON)),p(this,lp))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};lp=new WeakMap,s(YI,"BaseMapData");var wi=YI;var Vl,Uo,Mi,Td,Oh,JI,Cd=class Cd extends wi{constructor(r,n){super(n.mvfData.id,r);E(this,Oh);m(this,"__type",Cd.__type);E(this,Vl);E(this,Uo,{});E(this,Mi);E(this,Td);A(this,Vl,r),A(this,Mi,n.mvfData),A(this,Td,n.facadeId)}static is(r){return r.__type===Cd.__type}get type(){return p(this,Mi).type}get name(){var r;return(r=te(this,Oh,JI).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=te(this,Oh,JI).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=p(this,Mi).externalId)!=null?r:""}get floors(){var r,n;if(p(this,Uo).floors==null){let o=((n=(r=p(this,Mi).floors)!=null?r:p(this,Mi).maps)!=null?n:[]).reduce((i,a)=>{let l=p(this,Vl).floorsById[a];return l&&i.push(l),i},[]);o.length===0&&z.error("Floor stack ".concat(this.id," has no floors")),p(this,Uo).floors=o}return p(this,Uo).floors}get defaultFloor(){if(p(this,Uo).defaultFloor!=null)return p(this,Uo).defaultFloor;let r=p(this,Mi).defaultFloor?p(this,Vl).getById("floor",p(this,Mi).defaultFloor):void 0;return p(this,Uo).defaultFloor=r||this.floors.reduce((n,o)=>Math.abs(o.elevation)<Math.abs(n.elevation)?o:n),p(this,Uo).defaultFloor}get facade(){return p(this,Td)?p(this,Vl).facadesById[p(this,Td)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(p(this,Uo)))delete p(this,Uo)[r]}};Vl=new WeakMap,Uo=new WeakMap,Mi=new WeakMap,Td=new WeakMap,Oh=new WeakSet,JI=s(function(r){return p(this,Vl).getPropTranslation(this.__type,r,this.id,p(this,Mi)[r])},"#translate"),s(Cd,"FloorStack"),m(Cd,"__type","floor-stack");var KI=Cd,Eh=KI;f();f();f();f();f();f();var kh,Ca,_h=class _h extends jr{constructor(r){super(String(At()));E(this,kh,{});E(this,Ca);A(this,Ca,r.mvfData)}static is(r){return r.__type===_h.__type}get url(){return p(this,Ca).url}get name(){if("displayName"in p(this,Ca))return p(this,Ca).displayName;if("label"in p(this,Ca))return p(this,Ca).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(p(this,kh)))delete p(this,kh)[r]}};kh=new WeakMap,Ca=new WeakMap,s(_h,"Hyperlink"),m(_h,"__type","hyperlink");var QI=_h,zl=QI;f();f();function Ah(e){return typeof e=="string"?e:e.id}s(Ah,"getId");function tS(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}s(tS,"isPosition");var eS=8,vs=s(e=>typeof e=="number"?e.toFixed(eS):tS(e)?e[1].toFixed(eS)+"-"+e[0].toFixed(eS):e.map(t=>vs(t)).join("-"),"serializeCoords"),XW=s(e=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,r=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(e)||r.test(e)},"isPrivateCdnAsset"),Wb=s(e=>{if(!XW(e))return null;let t="";e.startsWith("https://")?(t="https://",e=e.slice(8)):e.startsWith("http://")&&(t="http://",e=e.slice(7));let[r,n,o]=e.split("/");return{origin:t+r,mapId:n,fileName:o}},"parseCdnAssetUrl");var Fh,Hl,cp,Dh=class Dh extends jr{constructor(r){super(String(At()));E(this,Fh,{});E(this,Hl);E(this,cp);A(this,Hl,r.mvfData),A(this,cp,r.mapData)}static is(r){return r.__type===Dh.__type}get url(){let r=p(this,Hl).url;if(p(this,cp).tokenManager==null)return r;let n=Wb(p(this,Hl).url);if(n==null)return r;let o=n.mapId;try{if(p(this,cp).tokenManager.isEnterpriseMode())return r;let i=p(this,cp).tokenManager.getSasToken(o).token;if(i==null||i==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(i)}catch(i){return z.error("Error getting SAS token for image",{error:i,url:r}),r}}get name(){return p(this,Hl).altText}get altText(){return p(this,Hl).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(p(this,Fh)))delete p(this,Fh)[r]}};Fh=new WeakMap,Hl=new WeakMap,cp=new WeakMap,s(Dh,"ImageMetaData"),m(Dh,"__type","image");var rS=Dh,Wl=rS;var Pd,Oi,Ta,nS=class nS extends wi{constructor(r,n){super(n.properties.id,r);E(this,Pd);E(this,Oi);E(this,Ta,{});A(this,Pd,r),A(this,Oi,n)}get externalId(){var r;return(r=p(this,Oi).properties.externalId)!=null?r:""}get name(){var n,o,i,a,l;let r="";return"details"in p(this,Oi).properties||(r=(n=p(this,Oi).properties.externalId)!=null?n:""),r===""&&(r=(i=(o=p(this,Oi).properties.details)==null?void 0:o.name)!=null?i:""),r===""&&(r=(l=(a=this.locationProfiles.find(c=>c.name&&c.name.length>0))==null?void 0:a.name)!=null?l:""),r}get description(){var n,o,i,a;let r=(o=(n=p(this,Oi).properties.details)==null?void 0:n.description)!=null?o:"";return r===""&&(r=(a=(i=this.locationProfiles.find(l=>l.description&&l.description.length>0))==null?void 0:i.description)!=null?a:""),r}get images(){var n,o,i,a,l;if(p(this,Ta).images!=null)return p(this,Ta).images;let r=(i=(o=(n=p(this,Oi).properties.details)==null?void 0:n.images)==null?void 0:o.map(c=>new Wl({mvfData:c,mapData:p(this,Pd)})))!=null?i:[];return(r==null||r.length===0)&&(r=(l=(a=this.locationProfiles.find(c=>c.images.length>0))==null?void 0:a.images)!=null?l:[]),p(this,Ta).images=r,r}get links(){var n,o,i,a,l;if(p(this,Ta).links!=null)return p(this,Ta).links;let r=(i=(o=(n=p(this,Oi).properties.details)==null?void 0:n.links)==null?void 0:o.map(c=>new zl({mvfData:c})))!=null?i:[];return(r==null||r.length===0)&&(r=(l=(a=this.locationProfiles.find(c=>c.links.length>0))==null?void 0:a.links)!=null?l:[]),p(this,Ta).links=r,r}get locationProfiles(){var r;return(r=p(this,Pd).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};Pd=new WeakMap,Oi=new WeakMap,Ta=new WeakMap,s(nS,"DetailedMapData");var nn=nS;var Lh,pp,Md,Od,wd=class wd extends nn{constructor(r,n){super(r,n.mvfData);m(this,"__type",wd.__type);E(this,Lh);E(this,pp);E(this,Md,{});E(this,Od);A(this,Lh,r),A(this,pp,n.floorId),A(this,Od,n.mvfData)}static is(r){return r.__type===wd.__type}get center(){var r;if(p(this,Md).center==null){let[n,o]=(r=p(this,Od).properties.center)!=null?r:[0,0];p(this,Md).center=new $e(o,n,p(this,pp))}return p(this,Md).center}get floor(){let r=p(this,Lh).getById("floor",p(this,pp));if(r==null)throw new Error("Floor ".concat(p(this,pp)," not found!"));return r}get geoJSON(){return R(P({},p(this,Od)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Lh=new WeakMap,pp=new WeakMap,Md=new WeakMap,Od=new WeakMap,s(wd,"Area"),m(wd,"__type","area");var oS=wd,Pa=oS;f();var up,wa,dp,_d,Ed=class Ed extends nn{constructor(r,n){super(r,n.mvfData);m(this,"__type",Ed.__type);E(this,up);E(this,wa);E(this,dp);E(this,_d);A(this,wa,{}),A(this,_d,n.mvfData),A(this,up,r),A(this,dp,n.floorId)}static is(r){return r.__type===Ed.__type}get floor(){let r=p(this,up).getById("floor",p(this,dp));if(r==null)throw new Error("Floor ".concat(p(this,dp)," not found!"));return r}get center(){if(p(this,wa).center==null){let[[r,n],[o,i]]=p(this,_d).geometry.coordinates,a=(r+o)/2,l=(n+i)/2;p(this,wa).center=new $e(l,a,p(this,dp))}return p(this,wa).center}get isExterior(){var o;let r=p(this,up).obstructionIdByEntranceId[this.id],n=p(this,up).getMVFFeatureById("obstruction",r);return(o=n==null?void 0:n.properties.footprintComponent)!=null?o:!1}get geoJSON(){return R(P({},p(this,_d)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(p(this,wa)))delete p(this,wa)[r]}};up=new WeakMap,wa=new WeakMap,dp=new WeakMap,_d=new WeakMap,s(Ed,"Door"),m(Ed,"__type","door");var iS=Ed,Ei=iS;f();var ql,fp,wo,Is,kd=class kd extends nn{constructor(r,n){super(r,n.mvfData);m(this,"__type",kd.__type);E(this,ql);E(this,fp);E(this,wo,{});E(this,Is);A(this,ql,r),A(this,fp,n.floorId),A(this,Is,n.mvfData)}getMvfData(){return p(this,Is)}static is(r){return r.__type===kd.__type}get type(){return KW(p(this,Is).properties.kind)}get locations(){if(p(this,wo).locations)return p(this,wo).locations;p(this,wo).locations=[];let r=p(this,ql).mvfLocationsBySpaceId[p(this,Is).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let o=p(this,ql).getById("enterprise-location",n.id);o&&p(this,wo).locations.push(o)}return p(this,wo).locations}get floor(){let r=p(this,ql).getById("floor",p(this,fp));if(r==null)throw new Error("Floor ".concat(p(this,fp)," not found!"));return r}get doors(){return p(this,Is).properties.destinationNodes.reduce((r,n)=>{let o=p(this,ql).doorsByNodeId[n];return o&&r.push(o),r},[])}get center(){var r;if(p(this,wo).center==null){let[n,o]=(r=p(this,Is).properties.center)!=null?r:[0,0];p(this,wo).center=new $e(o,n,p(this,fp))}return p(this,wo).center}get geoJSON(){return R(P({},p(this,Is)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(p(this,wo)))delete p(this,wo)[r]}};ql=new WeakMap,fp=new WeakMap,wo=new WeakMap,Is=new WeakMap,s(kd,"Space"),m(kd,"__type","space");var sS=kd,YW=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function KW(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return YW.includes(t)?t:"room"}s(KW,"validateSpaceType");var Gr=sS;f();var Vo,Yt,zo,Rh,lS,Ad=class Ad extends wi{constructor(r,n){super(n.mvfData.properties.id,r);E(this,Rh);m(this,"__type",Ad.__type);E(this,Vo);E(this,Yt,{});E(this,zo);A(this,Vo,r),A(this,zo,n.mvfData)}static is(r){return r.__type===Ad.__type}get focusTarget(){return this}get name(){var r,n;return"name"in p(this,zo).properties?(n=te(this,Rh,lS).call(this,"name"))!=null?n:"":(r=p(this,zo).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in p(this,zo).properties?(n=te(this,Rh,lS).call(this,"shortName"))!=null?n:"":(r=p(this,zo).properties.externalId)!=null?r:""}get externalId(){var r;return(r=p(this,zo).properties.externalId)!=null?r:""}get elevation(){return p(this,zo).properties.elevation}get spaces(){if(p(this,Yt).spaces==null){let r=p(this,Vo).spaces.filter(n=>n.floor.id===this.id);p(this,Yt).spaces=r}return p(this,Yt).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=p(this,zo).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(p(this,Yt).objects==null){let r=p(this,Vo).objects.filter(n=>n.floor.id===this.id);p(this,Yt).objects=r}return p(this,Yt).objects}get connections(){if(p(this,Yt).connections==null){let r=p(this,Vo).connections.filter(n=>n.floors.includes(this));p(this,Yt).connections=r}return p(this,Yt).connections}get doors(){if(p(this,Yt).doors==null){let r=p(this,Vo).doors.filter(n=>n.floor.id===this.id);p(this,Yt).doors=r}return p(this,Yt).doors}get annotations(){if(p(this,Yt).annotations==null){let r=p(this,Vo).annotations.filter(n=>n.floor.id===this.id);p(this,Yt).annotations=r}return p(this,Yt).annotations}get pois(){if(p(this,Yt).pois==null){let r=p(this,Vo).pointsOfInterest.filter(n=>n.floor.id===this.id);p(this,Yt).pois=r}return p(this,Yt).pois}get floorStack(){if(p(this,Yt).floorStack==null){let r=p(this,Vo).floorStacks.find(n=>n.floors.includes(this));p(this,Yt).floorStack=r}return p(this,Yt).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(r=>r.id),objects:this.objects.map(r=>r.id),connections:this.connections.map(r=>r.id),doors:this.doors.map(r=>r.id),annotations:this.annotations.map(r=>r.id),pois:this.pois.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(p(this,Yt)))delete p(this,Yt)[r]}};Vo=new WeakMap,Yt=new WeakMap,zo=new WeakMap,Rh=new WeakSet,lS=s(function(r){let n=p(this,zo).properties[r];return p(this,Vo).getPropTranslation(this.__type,r,this.id,n)},"#translate"),s(Ad,"Floor"),m(Ad,"__type","floor");var aS=Ad,Gn=aS;f();f();f();var Nh=s(e=>e!=null,"notNull");f();function Bh(e){let t;if(Gr.is(e)||Ei.is(e)||io.is(e)||Pa.is(e)||Ho.is(e))t=e.center;else if(Ma.is(e)||Oa.is(e))t=e.coordinate;else if($e.is(e))t=e;else if(Sa.is(e))t=e.coordinate;else if(Ss.is(e))t=e.coordinates[0];else return;return t}s(Bh,"getCoordinateFromStuffs");f();f();var mp={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},Cs="ExteriorWalls",Zl="Walls",z9=0,Dd="InteriorDoors",Fd="ExteriorDoors",Or="GeometryLayer",Ea="LabelsLayer",Ts="MarkersLayer",$h="FootprintLayer",Ld="OcclusionLayer",H9="ImagesLayer",hp="FacadesLayer";var W9=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],q9={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function cS(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&z.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}s(cS,"validateOptions");function pS(e,t){var o,i,a,l,c,u;let r=((o=e==null?void 0:e.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,n=R(P(P({},mp),e),{outdoorView:P({enabled:((i=e==null?void 0:e.outdoorView)==null?void 0:i.enabled)===void 0?!!r:(a=e==null?void 0:e.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(l=mp.outdoorView)==null?void 0:l.layersHiddenByGeometry},e==null?void 0:e.outdoorView),bearing:(u=(c=e==null?void 0:e.bearing)!=null?c:t.naturalBearing)!=null?u:0,imagePlacementOptions:P(P({},mp.imagePlacementOptions),e==null?void 0:e.imagePlacementOptions),multiFloorView:P(P({},mp.multiFloorView),e==null?void 0:e.multiFloorView)});return r&&n.outdoorView&&(n.outdoorView.token=r),n}s(pS,"handleShow3DMapOptionDefault");function Z9(e){let t={remove_watermark:!1};if(e)try{let r=Rb(e);Object.assign(t,r.capabilities)}catch(r){z.error("Error decoding capabilities from token",r)}return t}s(Z9,"handleTokenCapabilities");var Xl,Wo,_a,Rd=class Rd extends nn{constructor(r,n){let o=Object.values(n.mvfDataByFloorId)[0];super(r,o);m(this,"__type",Rd.__type);E(this,Xl);E(this,Wo);E(this,_a);A(this,Wo,{}),A(this,Xl,r),A(this,_a,n.mvfDataByFloorId)}static is(r){return r.__type===Rd.__type}get accessible(){var r;return(r=Object.values(p(this,_a))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(p(this,_a))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(p(this,_a))[0].properties.extra}get coordinates(){return p(this,Wo).coordinates==null&&(p(this,Wo).coordinates=Object.entries(p(this,_a)).map(([r,n])=>new $e(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),p(this,Wo).coordinates}get nodes(){return Object.values(p(this,_a))[0].properties.nodes.map(r=>p(this,Xl).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?p(this,Xl).getById("floor",r.floorId):void 0).filter(Nh)}get locationProfiles(){var n,o,i,a,l;if(p(this,Wo).locationProfiles!=null)return p(this,Wo).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let c=[(o=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?o:0,(a=(i=this.coordinates[0])==null?void 0:i.latitude)!=null?a:0],u=vs(c),d=(l=p(this,Xl).mvfConnectionIdsByLatLon[u])!=null?l:[];for(let h of d){let y=p(this,Xl).locationProfilesByAttachedFeatureId[h];if(y!=null){r=y;break}}}return p(this,Wo).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(r=>r.toJSON()),floors:this.floors.map(r=>r.id),extra:this.extra}}destroy(){for(let r of Object.keys(p(this,Wo)))delete p(this,Wo)[r]}};Xl=new WeakMap,Wo=new WeakMap,_a=new WeakMap,s(Rd,"Connection"),m(Rd,"__type","connection");var uS=Rd,Yl=uS;f();var jh,yp,Kl,gp,Nd=class Nd extends nn{constructor(r,n){super(r,n.mvfData);m(this,"__type",Nd.__type);E(this,jh);E(this,yp);E(this,Kl,{});E(this,gp);A(this,jh,r),A(this,yp,n.floorId),A(this,gp,n.mvfData)}static is(r){return r.__type===Nd.__type}get type(){let r=p(this,gp).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=p(this,jh).getById("floor",p(this,yp));if(r==null)throw new Error("Floor ".concat(p(this,yp)," not found!"));return r}get center(){var r;if(p(this,Kl).center==null){let[n,o]=(r=p(this,gp).properties.center)!=null?r:[0,0];p(this,Kl).center=new $e(o,n,p(this,yp))}return p(this,Kl).center}get geoJSON(){return R(P({},p(this,gp)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of globalThis.Object.keys(p(this,Kl)))p(this,Kl)[r]=null}};jh=new WeakMap,yp=new WeakMap,Kl=new WeakMap,gp=new WeakMap,s(Nd,"MapObject"),m(Nd,"__type","object");var dS=Nd,io=dS;f();var Gh,bp,Jl,$d,Bd=class Bd extends nn{constructor(r,n){super(r,n.mvfData);m(this,"__type",Bd.__type);E(this,Gh);E(this,bp);E(this,Jl,{});E(this,$d);A(this,Gh,r),A(this,$d,n.mvfData),A(this,bp,n.floorId)}static is(r){return r.__type===Bd.__type}get floor(){let r=p(this,Gh).getById("floor",p(this,bp));if(r==null)throw new Error("Floor ".concat(p(this,bp)," not found!"));return r}get coordinate(){var r;if(p(this,Jl).coordinate==null){let[n,o]=(r=p(this,$d).geometry.coordinates)!=null?r:[0,0];p(this,Jl).coordinate=new $e(o,n,p(this,bp))}return p(this,Jl).coordinate}get geoJSON(){return R(P({},p(this,$d)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in p(this,Jl))p(this,Jl)[r]=null}};Gh=new WeakMap,bp=new WeakMap,Jl=new WeakMap,$d=new WeakMap,s(Bd,"PointOfInterest"),m(Bd,"__type","point-of-interest");var fS=Bd,Ma=fS;f();var Uh,xp,Ql,vp,Vh,hS,jd=class jd extends nn{constructor(r,n){super(r,n.mvfData);E(this,Vh);m(this,"__type",jd.__type);E(this,Uh);E(this,xp);E(this,Ql,{});E(this,vp);A(this,Uh,r),A(this,xp,n.floorId),A(this,vp,n.mvfData)}static is(r){return r.__type===jd.__type}get group(){return te(this,Vh,hS).call(this).group}get type(){return te(this,Vh,hS).call(this).type}get coordinate(){if(p(this,Ql).coordinate==null){let[r,n]=p(this,vp).geometry.coordinates;p(this,Ql).coordinate=new $e(n,r,p(this,xp))}return p(this,Ql).coordinate}get floor(){let r=p(this,Uh).getById("floor",p(this,xp));if(r==null)throw new Error("Floor ".concat(p(this,xp)," not found!"));return r}get geoJSON(){return R(P({},p(this,vp)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(p(this,Ql)))delete p(this,Ql)[r]}};Uh=new WeakMap,xp=new WeakMap,Ql=new WeakMap,vp=new WeakMap,Vh=new WeakSet,hS=s(function(){let[r,n]=p(this,vp).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),s(jd,"Annotation"),m(jd,"__type","annotation");var mS=jd,Oa=mS;f();var JW=s((e,t)=>{var c,u,d,h,y,b,I,S,x,T,w;let r={},n={},o={},i={},a={},l={};for(let M of e["location.json"]||[]){let O=new Ip(t,{mvfData:M});if(r[M.id]=O,M.externalId&&(i[M.externalId]==null&&(i[M.externalId]=[]),i[M.externalId].push(O)),M.categories)for(let $ of M.categories)a[$]==null&&(a[$]=[]),a[$].push(O);let _=[...(u=(c=M.obstructions)==null?void 0:c.map($=>$.id))!=null?u:[],...(h=(d=M.spaces)==null?void 0:d.map($=>$.id))!=null?h:[],...(b=(y=M.annotations)==null?void 0:y.map($=>$.id))!=null?b:[],...(I=M.connections)!=null?I:[],...(x=(S=M.entrances)==null?void 0:S.map($=>$.id))!=null?x:[],...(w=(T=M.areas)==null?void 0:T.map($=>$.id))!=null?w:[]];for(let $ of _)$&&(l[$]==null&&(l[$]=[]),l[$].push(O))}for(let M of e["category.json"]||[]){let O=new Hh(t,{mvfData:M});n[M.id]=O,M.parent&&(o[M.parent]==null&&(o[M.parent]=[]),o[M.parent].push(O))}return{locationCategoriesByParentId:o,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:i,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:l}},"processMVFLocationProfilesAndCategories"),QW=s((e,t,r)=>{var x,T;let n={},o={},i={},a={},l={},c={},u={},d={},h={},y={},b={},I={},S=globalThis.Object.keys(e.space);for(let w of S){let M=e.space[w];if(M!=null)for(let O of M.features){I[O.properties.id]=w,u[O.properties.id]=O;for(let _ of O.properties.destinationNodes)l[_]==null&&(l[_]=[]),l[_].push(O.properties.id);if(O.properties.kind==="desk-entrance"&&(c[O.properties.externalId]==null&&(c[O.properties.externalId]=[]),c[O.properties.externalId].push(...O.properties.destinationNodes)),!["void","desk-entrance"].includes((x=O.properties.kind)!=null?x:"")){if((T=O.properties.kind)!=null&&T.includes("connection")){let _=vs(O.geometry.coordinates);y[_]==null&&(y[_]=[]),y[_].push(O.properties.id);continue}if(O.properties.kind==="poi"){let _=new Ma(r,{floorId:w,mvfData:O});i[O.properties.id]=_,h[w]||(h[w]=[]),h[w].push(O),O.properties.externalId&&(a[O.properties.externalId]==null&&(a[O.properties.externalId]=[]),a[O.properties.externalId].push(_))}else{let _=new Gr(r,{floorId:w,mvfData:O});n[O.properties.id]=_,O.properties.externalId&&(o[O.properties.externalId]==null&&(o[O.properties.externalId]=[]),o[O.properties.externalId].push(_)),d[w]||(d[w]=[]),d[w].push(O)}}}}for(let w in y){let M=y[w],O={};for(let $ of M){let j=I[$],F=u[$],L=t==null?void 0:t["n_"+F.properties.id.split("s_")[1]];O[j]=R(P({},F),{properties:R(P({},F.properties),{accessible:(L==null?void 0:L.accessible)===!0})})}let _=new Yl(r,{mvfDataByFloorId:O});b[_.id]=_}return{spacesById:n,spacesByExternalId:o,poisById:i,poisByExternalId:a,connectionsById:b,spaceIdsByDestinationNodeId:l,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:u,connectionIdsByLatLon:y,mvfSpacesByFloorId:d,mvfPoisByFloorId:h}},"processMVFSpaces"),eq=s((e,t)=>{var a,l;let r={},n={},o={},i={};for(let c of e["node.geojson"].features){o[c.properties.id]=c;let u=new Sa(t,{mvfData:c,floorId:(a=c.properties.floor)!=null?a:c.properties.map});r[c.properties.id]=u,c.properties.externalId&&(n[c.properties.externalId]==null&&(n[c.properties.externalId]=[]),n[c.properties.externalId].push(u));let d=(l=c.properties.floor)!=null?l:c.properties.map;i[d]||(i[d]=[]),i[d].push(c)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}},"processMVFNodes"),tq=s((e,t)=>{let r={},n={},o={},i={},a=globalThis.Object.keys(e.obstruction);for(let l of a){let c=e.obstruction[l];if(c!=null)for(let u of c.features){o[u.properties.id]=u;for(let h of u.properties.entrances)i[h]=u.properties.id;if(u.properties.kind==="Wall")continue;let d=new io(t,{floorId:l,mvfData:u});r[u.properties.id]=d,u.properties.externalId&&(n[u.properties.externalId]==null&&(n[u.properties.externalId]=[]),n[u.properties.externalId].push(d))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:o,obstructionIdByEntranceId:i}},"processMVFObstructions"),rq=s((e,t)=>{let r={},n={},o={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let i of e["floor.geojson"].features){o[i.properties.id]=i.properties;let a=new Gn(t,{mvfData:i});r[i.properties.id]=a,i.properties.externalId&&(n[i.properties.externalId]==null&&(n[i.properties.externalId]=[]),n[i.properties.externalId].push(a))}else for(let i of e["map.geojson"]){o[i.id]=i;let a=new Gn(t,{mvfData:{properties:i}});r[i.id]=a}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:o}},"processMVFFloors"),nq=s((e,t)=>{var c;let r={},n={},o={},i={},a={},l=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(l!=null)for(let u of l){let d=(c=e.facade)==null?void 0:c[u.id],h=new Eh(t,{mvfData:u,facadeId:d==null?void 0:d.id});if(r[u.id]=h,u.externalId&&(n[u.externalId]==null&&(n[u.externalId]=[]),n[u.externalId].push(h)),o[u.id]=u,d){let y=new Ho(t,{mvfData:d,floorStackId:u.id});i[d.id]=y;for(let b of d.spaces)a[b.spaceId]=y}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:o,facadesById:i,facadesBySpaceId:a}},"processMVFFloorStacks"),oq=s((e,t)=>{let r={},n={},o=e["connection.json"].reduce((i,a)=>{a.nodes.forEach(c=>i[c]=a),r[a.id]=a;let l=t==null?void 0:t[a.nodes[0]];if(l!=null){let c=vs(l.geometry.coordinates);n[c]==null&&(n[c]=[]),n[c].push(a.id)}return i},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),iq=s((e,t)=>{let r={},n={},o={},i={},a={},l=globalThis.Object.keys(e.entrance);for(let c of l){let u=e.entrance[c];if(u!=null)for(let d of u.features){i[d.properties.id]=d;let h=new Ei(t,{floorId:c,mvfData:d});d.properties.node&&(o[d.properties.node]=h),r[d.properties.id]=h,d.properties.externalId&&(n[d.properties.externalId]==null&&(n[d.properties.externalId]=[]),n[d.properties.externalId].push(h)),a[c]||(a[c]=[]),a[c].push(d)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:o,mvfEntrancesById:i,mvfEntrancesByFloorId:a}},"processMVFEntrances"),sq=s((e,t,r)=>{var n;if(e.textAreas!=null)for(let o in e.textAreas){let i=(n=e.textAreas[o])==null?void 0:n.features;if(i!=null){for(let a of i)if("anchorId"in a.properties){let l=a==null?void 0:a.properties,c=t[l.anchorId]||r[l.anchorId];if(c!=null&&l!=null){let u=c.properties;u.textArea=l,u.textArea&&(u.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),aq=s((e,t,r)=>{var n;if(e.floorImages!=null)for(let o in e.floorImages){let i=(n=e.floorImages[o])==null?void 0:n.features;if(i!=null){for(let a of i)if("anchorId"in a.properties){let l=a==null?void 0:a.properties,c=t[l.anchorId]||r[l.anchorId];if(c!=null&&l!=null){let u=c.properties;u.image=l,u.image&&(u.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),lq=s((e,t)=>{var n,o;if(((n=e.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let r=(o=e.enterprise)==null?void 0:o.enterpriseStyles;for(let i in r){let a=r[i];a.geometryAnchors.forEach(l=>{let c=t[l.geometryId];if(c!=null){let u=c.properties;u.style={styleId:i,edgeOffset:a.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),cq=s((e,t,r)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let n of e.enterprise.textures)for(let o of n.geometryAnchors){let i=t[o.geometryId]||r[o.geometryId];if(i!=null){let a=i.properties;a.textures==null&&(a.textures=[]),a.textures.push(n)}}},"processMVFEnterpriseTextures"),pq=s((e,t)=>{let r={},n={},o={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o};let i=globalThis.Object.keys(e.annotation);for(let a of i){let l=e.annotation[a];if(l!=null)for(let c of l.features){n[c.properties.id]=c;let u=new Oa(t,{floorId:a,mvfData:c});r[c.properties.id]=u,o[a]||(o[a]=[]),o[a].push(c)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o}},"processMVFAnnotations"),uq=s((e,t)=>{let r={},n={},o={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:o};let i=globalThis.Object.keys(e.area);for(let a of i){let l=e.area[a];if(l!=null)for(let c of l.features){o[c.properties.id]=c;let u=new Pa(t,{floorId:a,mvfData:c});r[c.properties.id]=u,c.properties.externalId&&(n[c.properties.externalId]==null&&(n[c.properties.externalId]=[]),n[c.properties.externalId].push(u))}}return{areasById:r,areasByExternalId:n,mvfAreasById:o}},"processMVFAreas"),X9=s((e,t)=>{var T,w,M,O,_,$,j,F,L,q,U,V,Q;let r={},n={},o={},i={},a=((w=(T=e.enterprise)==null?void 0:T.locations)!=null?w:[]).reduce((Y,se)=>(Y[se.id]=se,Y),{}),l={},c={},u={},d={},h={},y={},b=((M=e.enterprise)==null?void 0:M.venue)||{},I={},S={};for(let Y of(_=(O=e.enterprise)==null?void 0:O.categories)!=null?_:[]){let se=new zh(t,{mvfData:Y});l[Y.id]=se,Y.externalId&&(c[Y.externalId]==null&&(c[Y.externalId]=[]),c[Y.externalId].push(se)),u[Y.id]=Y,Y.locations.forEach(re=>{h[re]==null&&(h[re]=[]),h[re].push(Y.id)})}let x={};for(let Y of(j=($=e.enterprise)==null?void 0:$.locationInstances)!=null?j:[]){let se=a[Y.parent],re=Object.keys(se),ve={};for(let ye of re)ve[ye]=void 0;let we=P(R(P({},ve),{polygons:[],nodes:[]}),Y);x[we.parent]==null&&(x[we.parent]=[]),x[we.parent].push(new Ss(t,{mvfData:we,categoryIds:((L=(F=e.enterprise)==null?void 0:F.categoryPriorities)==null?void 0:L[we.id])||h[we.id],parentId:Y.parent})),I[we.id]=Y}for(let Y in e.space){let se=e.space[Y];if(se!=null)for(let re of se.features)for(let ve of re.properties.destinationNodes)S[ve]==null&&(S[ve]=[]),S[ve].push(re.properties.id)}for(let Y of(U=(q=e.enterprise)==null?void 0:q.locations)!=null?U:[]){let se=new Ss(t,{mvfData:Y,categoryIds:((Q=(V=e.enterprise)==null?void 0:V.categoryPriorities)==null?void 0:Q[Y.id])||h[Y.id],locationInstances:x[Y.id]});o[Y.id]=se,Y.externalId&&(i[Y.externalId]==null&&(i[Y.externalId]=[]),i[Y.externalId].push(se)),Y.nodes.forEach(re=>{y[re.id]==null&&(y[re.id]=[]),y[re.id].push(Y.id)});for(let re of Y.polygons)d[re.id]==null&&(d[re.id]=[]),d[re.id].push(Y)}if(t.enterpriseMode===!0){for(let Y in t.mvfConnectionsById){let se={},re=t.mvfConnectionsById[Y];for(let ve of t.mvfConnectionsById[Y].nodes){let we=t.nodesById[ve];we!=null&&(se[we.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[we.coordinate.longitude,we.coordinate.latitude]},properties:{id:Y,externalId:re.externalId,kind:"enterprise."+re.type,destinationNodes:[],flags:"",type:re.type,nodes:re.nodes,accessible:re.accessible,extra:re.extra,details:re.details}})}Object.keys(se).length>0&&(r[Y]=new Yl(t,{mvfDataByFloorId:se}),re.externalId&&(n[re.externalId]==null&&(n[re.externalId]=[]),n[re.externalId].push(r[Y])))}t.connectionsById=r}return{spaceIdsByNodeId:S,connectionsByExternalId:n,locationIdsByNodeId:y,mvfLocationsBySpaceId:d,mvfLocationsById:a,mvfCategoriesById:u,locationsById:o,locationsByExternalId:i,locationInstancesById:I,categoriesById:l,categoriesByExternalId:c,venue:b}},"createEnterpriseDataFromMVF"),Y9=s((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}=eq(e,t),{mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfConnectionIdsByLatLon:c}=oq(e,o),{spacesById:u,spacesByExternalId:d,spaceIdsByDestinationNodeId:h,poisById:y,poisByExternalId:b,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:S,connectionsById:x,connectionIdsByLatLon:T,mvfSpacesByFloorId:w,mvfPoisByFloorId:M}=QW(e,l,t),{objectsById:O,objectsByExternalId:_,mvfObstructionById:$,obstructionIdByEntranceId:j}=tq(e,t),{floorsById:F,floorsByExternalId:L,mvfFloorsById:q}=rq(e,t),{floorStacksById:U,floorStacksByExternalId:V,mvfFloorStacksById:Q,facadesById:Y,facadesBySpaceId:se}=nq(e,t),{doorsById:re,doorsByExternalId:ve,doorsByNodeId:we,mvfEntrancesById:ye,mvfEntrancesByFloorId:Ne}=iq(e,t),{annotationsById:nt,mvfAnnotationsById:st,mvfAnnotationsByFloorId:qe}=pq(e,t),{areasById:Ye,areasByExternalId:de,mvfAreasById:ge}=uq(e,t);aq(e,I,$),sq(e,I,$),lq(e,I),cq(e,I,$);let{locationCategoriesByParentId:me,locationProfilesById:oe,locationCategoriesById:D,locationProfilesByExternalId:K,locationProfilesByCategoryId:N,locationProfilesByAttachedFeatureId:pe}=JW(e,t);return{spacesById:u,spacesByExternalId:d,nodesById:r,nodesByExternalId:n,objectsById:O,objectsByExternalId:_,floorsById:F,floorsByExternalId:L,floorStacksById:U,floorStacksByExternalId:V,facadesById:Y,facadesBySpaceId:se,connectionsById:x,doorsById:re,doorsByExternalId:ve,doorsByNodeId:we,poisById:y,poisByExternalId:b,annotationsById:nt,areasById:Ye,areasByExternalId:de,spaceIdsByDestinationNodeId:h,objectEntranceNodeIdsByObstructionId:S,obstructionIdByEntranceId:j,connectionIdsByLatLon:T,locationProfilesById:oe,locationCategoriesById:D,locationProfilesByExternalId:K,locationProfilesByCategoryId:N,locationCategoriesByParentId:me,mvfSpacesById:I,mvfNodesById:o,mvfObstructionById:$,mvfFloorsById:q,mvfFloorStacksById:Q,mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfEntrancesById:ye,mvfAnnotationsById:st,mvfNodesByFloorId:i,mvfSpacesByFloorId:w,mvfPoisByFloorId:M,mvfAreasById:ge,mvfEntrancesByFloorId:Ne,mvfAnnotationsByFloorId:qe,locationProfilesByAttachedFeatureId:pe,mvfConnectionIdsByLatLon:c}},"createDataFromMVF");f();f();f();var dq=s(function(){let t=globalThis.fetch;return{fetch(...r){if(!Nh(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...r)},setFetch(r){t=r}}},"createFetchControl")(),K9=dq.fetch;var tO=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],J9=tO[0],rO="https://api-gateway.mappedin.com/track-analytics/a/",nO="deny-watchposition",oO="load-mapview",iO="load-mapdata",sO="change-language",aO="query-directions";var ka,_i,Gd,qb,gS=class gS{constructor(){E(this,Gd);E(this,ka,Object.freeze({}));E(this,_i);m(this,"oneTimeEventsSent",new Set);m(this,"sendGetDirectionsEvent",b9((t,r)=>this.sendAnalyticEvent(aO,{start:t,end:r,type:"location_to_location"}),2500));A(this,_i,te(this,Gd,qb).call(this,p(this,ka)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){A(this,ka,{}),A(this,_i,te(this,Gd,qb).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return A(this,ka,Object.freeze(Object.assign({},p(this,ka),t))),A(this,_i,te(this,Gd,qb).call(this,t)),p(this,_i)}updateState(t){let r=P({},t);r.mapId&&(r.analyticsBaseUrl=yS(R(P({},p(this,_i)),{mapId:r.mapId}))),r.context&&(r.context=eO(r.context)),r.baseUri&&(r.analyticsBaseUrl=yS({baseUri:r.baseUri,mapId:p(this,_i).mapId})),Object.assign(p(this,_i),r),this.handleStateUpdate(t)}handleStateUpdate(t){var r;(r=t.userPosition)!=null&&r.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:r,accessToken:n}=this.getState();return!!(t&&r)||!!n}getState(){return p(this,_i)}getContext(){return this.getState().context||p(this,ka).context||J9}getSessionId(){return this.getState().sessionId||p(this,ka).sessionId||Q9()}sendAnalyticEvent(t,r={}){let n=this.getState(),o=mq(n.analyticsBaseUrl,t),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":n.deviceId};if(n.logEvents&&z.log("Analytics.track",o,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return z.warn("Auth needs to be ready to send analytics.");let a=R(P({},r),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(a,n.userPosition),i["Content-Type"]="application/json",n.accessToken?i.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(i["x-mappedin-key"]=btoa(n.key),i["x-mappedin-secret"]=btoa(n.secret)),K9(o,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(t,r){if(yq.includes(t))return z.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=hq.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(iO,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(sO,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(nO)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(oO,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};ka=new WeakMap,_i=new WeakMap,Gd=new WeakSet,qb=s(function(t){var n,o,i,a;let r=(n=t.baseUri)!=null?n:rO;return{baseUri:r,analyticsBaseUrl:yS(R(P({},t),{baseUri:r})),version:((o=v==null?void 0:v.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||fq(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||Q9(),platformString:t.platformString||"",context:eO(t.context)||J9,geolocationMode:!1,sendEvents:(i=t.sendEvents)!=null?i:!0,logEvents:(a=t.logEvents)!=null?a:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),s(gS,"AnalyticsInternal");var Ud=gS;function yS({mapId:e,baseUri:t=rO}){return"".concat(t).concat(e,"/")}s(yS,"getBaseUrl");function fq(){return np.getInstance().loadLocalData("deviceId")}s(fq,"getDeviceIDFromStorage");function Q9(){return np.getInstance().loadSessionData("id")}s(Q9,"getSessionIDFromStorage");function mq(e,t){return e+t}s(mq,"buildUrl");function eO(e){return tO.find(t=>t===e)}s(eO,"getValidContext");var hq=["$select-location","$select-category","$query-suggest","$query-search"],yq=[oO,iO,aO,nO,sO],B2e=new Ud,Aa,bS=class bS{constructor(t){E(this,Aa);m(this,"capture");m(this,"updateState");A(this,Aa,t),this.capture=p(this,Aa).capture.bind(p(this,Aa)),this.updateState=p(this,Aa).updateState.bind(p(this,Aa))}getState(){return Object.assign({},p(this,Aa).getState())}};Aa=new WeakMap,s(bS,"Analytics");var Wh=bS;f();var gq=new Set(["polygons"]),ki,ur,so,qh,Vd=class Vd extends jr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",Vd.__type);m(this,"description");m(this,"name","");m(this,"amenity");m(this,"externalId","");m(this,"extra");m(this,"gallery");m(this,"instances");m(this,"logo");m(this,"operationHours");m(this,"phone");m(this,"picture");m(this,"shortName");m(this,"showFloatingLabelWhenImagePresent");m(this,"showLogo");m(this,"siblingGroups");m(this,"social");m(this,"sortOrder",-1);m(this,"states");m(this,"tags");m(this,"type","");m(this,"hidden",!1);E(this,ki);E(this,ur,{});E(this,so);E(this,qh);A(this,ki,r),A(this,so,n.mvfData),A(this,qh,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let o in n.mvfData)!gq.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(n.parentId){let i=p(this,ki).locationsById[n.parentId];return p(this,so)[o]!=null?p(this,ki).getPropTranslation(this.__type,o,p(this,so).id,p(this,so)[o]):p(this,ki).getPropTranslation(this.__type,o,p(this,so).id,i[o])}return p(this,ki).getPropTranslation(this.__type,o,p(this,so).id,p(this,so)[o])}})}static is(r){return r.__type===Vd.__type}get focusTarget(){return this.spaces}get categories(){return p(this,ur).categories?p(this,ur).categories:(p(this,ur).categories=(p(this,qh).map(r=>p(this,ki).getById("enterprise-category",r))||[]).filter(Boolean),p(this,ur).categories)}get coordinates(){if(p(this,ur).coordinates)return p(this,ur).coordinates;p(this,ur).coordinates=[];for(let r=0;r<this.nodes.length;r++)p(this,ur).coordinates.push(this.nodes[r].coordinate);return p(this,ur).coordinates}get nodes(){if(p(this,ur).nodes)return p(this,ur).nodes;p(this,ur).nodes=[];for(let r=0;r<p(this,so).nodes.length;r++){let n=p(this,ki).getById("node",p(this,so).nodes[r].id);n&&p(this,ur).nodes.push(n)}return p(this,ur).nodes}get spaces(){if(p(this,ur).spaces)return p(this,ur).spaces;p(this,ur).spaces=[];for(let r=0;r<p(this,so).polygons.length;r++){let n=p(this,ki).getById("space",p(this,so).polygons[r].id);n&&p(this,ur).spaces.push(n)}return p(this,ur).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(p(this,ur)))delete p(this,ur)[r]}};ki=new WeakMap,ur=new WeakMap,so=new WeakMap,qh=new WeakMap,s(Vd,"EnterpriseLocation"),m(Vd,"__type","enterprise-location");var xS=Vd,Ss=xS;f();var bq=new Set,Sp,Un,Ps,zd=class zd extends jr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",zd.__type);m(this,"name","");m(this,"color");m(this,"externalId","");m(this,"extra");m(this,"icon");m(this,"iconFromDefaultList");m(this,"sortOrder",-1);m(this,"picture");E(this,Sp);E(this,Un,{});E(this,Ps);A(this,Sp,r),A(this,Ps,n.mvfData);for(let o in n.mvfData)!bq.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return p(this,Sp).getPropTranslation(this.__type,o,p(this,Ps).id,p(this,Ps)[o])}})}static is(r){return r.__type===zd.__type}get children(){if(p(this,Un).children)return p(this,Un).children;p(this,Un).children=[];for(let r=0;r<p(this,Ps).children.length;r++){let n=p(this,Sp).getById("enterprise-category",p(this,Ps).children[r]);n&&p(this,Un).children.push(n)}return p(this,Un).children}get locations(){if(p(this,Un).locations)return p(this,Un).locations;p(this,Un).locations=[];for(let r=0;r<p(this,Ps).locations.length;r++){let n=p(this,Sp).getById("enterprise-location",p(this,Ps).locations[r]);n&&p(this,Un).locations.push(n)}return p(this,Un).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(p(this,Un)))delete p(this,Un)[r]}};Sp=new WeakMap,Un=new WeakMap,Ps=new WeakMap,s(zd,"EnterpriseCategory"),m(zd,"__type","enterprise-category");var vS=zd,zh=vS;f();var xq=new Set,Zh,Xh,Hd=class Hd extends jr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",Hd.__type);m(this,"countrycode");m(this,"externalId","");m(this,"defaultLanguage",{code:"en",name:"English"});m(this,"defaultMap");m(this,"extra");m(this,"icon");m(this,"languages",[]);m(this,"links",[]);m(this,"logo");m(this,"mappedinWebUrl");m(this,"slug","");m(this,"topLocations");m(this,"tzid");E(this,Zh,{});E(this,Xh);A(this,Xh,n.mvfData);for(let o in n.mvfData)!xq.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=n.mvfData[o])}static is(r){return r.__type===Hd.__type}get name(){var r;return(r=p(this,Xh).name)!=null?r:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(p(this,Zh)))delete p(this,Zh)[r]}};Zh=new WeakMap,Xh=new WeakMap,s(Hd,"EnterpriseVenue"),m(Hd,"__type","enterprise-venue");var IS=Hd,Zb=IS;f();f();f();f();f();f();var xL=ps(jC(),1),vL=ps(gL(),1);f();var cQ=s(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function _0(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(_0);let t=P({},e);for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let o=_0(n);if(cQ(o)){let i=o.allOf.findIndex(l=>l.type==="array"),a=o.allOf.findIndex(l=>l.type==="object");if(i!==-1&&a!==-1){t[r]=R(P({},o),{allOf:[o.allOf[i]]});continue}}t[r]=o}return t}s(_0,"cleanupInvalidArrayAllOf");var bL={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var RTe=vL.default.default(new xL.default.default).compile(_0(bL));f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();f();var mt={};cs(mt,{HasPropertyKey:()=>uQ,IsArray:()=>wn,IsAsyncIterator:()=>qC,IsBigInt:()=>Py,IsBoolean:()=>lc,IsDate:()=>Dp,IsFunction:()=>ZC,IsIterator:()=>XC,IsNull:()=>YC,IsNumber:()=>Ni,IsObject:()=>Vt,IsRegExp:()=>wy,IsString:()=>Kt,IsSymbol:()=>KC,IsUint8Array:()=>Ba,IsUndefined:()=>gr});f();function uQ(e,t){return t in e}s(uQ,"HasPropertyKey");function qC(e){return Vt(e)&&!wn(e)&&!Ba(e)&&Symbol.asyncIterator in e}s(qC,"IsAsyncIterator");function wn(e){return Array.isArray(e)}s(wn,"IsArray");function Py(e){return typeof e=="bigint"}s(Py,"IsBigInt");function lc(e){return typeof e=="boolean"}s(lc,"IsBoolean");function Dp(e){return e instanceof globalThis.Date}s(Dp,"IsDate");function ZC(e){return typeof e=="function"}s(ZC,"IsFunction");function XC(e){return Vt(e)&&!wn(e)&&!Ba(e)&&Symbol.iterator in e}s(XC,"IsIterator");function YC(e){return e===null}s(YC,"IsNull");function Ni(e){return typeof e=="number"}s(Ni,"IsNumber");function Vt(e){return typeof e=="object"&&e!==null}s(Vt,"IsObject");function wy(e){return e instanceof globalThis.RegExp}s(wy,"IsRegExp");function Kt(e){return typeof e=="string"}s(Kt,"IsString");function KC(e){return typeof e=="symbol"}s(KC,"IsSymbol");function Ba(e){return e instanceof globalThis.Uint8Array}s(Ba,"IsUint8Array");function gr(e){return e===void 0}s(gr,"IsUndefined");function dQ(e){return e.map(t=>k0(t))}s(dQ,"ArrayType");function fQ(e){return new Date(e.getTime())}s(fQ,"DateType");function mQ(e){return new Uint8Array(e)}s(mQ,"Uint8ArrayType");function hQ(e){return new RegExp(e.source,e.flags)}s(hQ,"RegExpType");function yQ(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=k0(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=k0(e[r]);return t}s(yQ,"ObjectType");function k0(e){return wn(e)?dQ(e):Dp(e)?fQ(e):Ba(e)?mQ(e):wy(e)?hQ(e):Vt(e)?yQ(e):e}s(k0,"Visit");function nr(e){return k0(e)}s(nr,"Clone");function IL(e){return e.map(t=>My(t))}s(IL,"CloneRest");function My(e,t){return t===void 0?nr(e):nr(P(P({},t),e))}s(My,"CloneType");f();f();f();function A0(e){return Ze(e)&&Symbol.asyncIterator in e}s(A0,"IsAsyncIterator");function D0(e){return Ze(e)&&Symbol.iterator in e}s(D0,"IsIterator");function JC(e){return Ze(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}s(JC,"IsStandardObject");function F0(e){return e instanceof Promise}s(F0,"IsPromise");function Hn(e){return e instanceof Date&&Number.isFinite(e.getTime())}s(Hn,"IsDate");function SL(e){return e instanceof globalThis.Map}s(SL,"IsMap");function CL(e){return e instanceof globalThis.Set}s(CL,"IsSet");function Ko(e){return ArrayBuffer.isView(e)}s(Ko,"IsTypedArray");function uf(e){return e instanceof globalThis.Uint8Array}s(uf,"IsUint8Array");function je(e,t){return t in e}s(je,"HasPropertyKey");function Ze(e){return e!==null&&typeof e=="object"}s(Ze,"IsObject");function He(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}s(He,"IsArray");function br(e){return e===void 0}s(br,"IsUndefined");function $a(e){return e===null}s($a,"IsNull");function ks(e){return typeof e=="boolean"}s(ks,"IsBoolean");function ke(e){return typeof e=="number"}s(ke,"IsNumber");function L0(e){return Number.isInteger(e)}s(L0,"IsInteger");function an(e){return typeof e=="bigint"}s(an,"IsBigInt");function ht(e){return typeof e=="string"}s(ht,"IsString");function cc(e){return typeof e=="function"}s(cc,"IsFunction");function ja(e){return typeof e=="symbol"}s(ja,"IsSymbol");function ln(e){return an(e)||ks(e)||$a(e)||ke(e)||ht(e)||ja(e)||br(e)}s(ln,"IsValueType");var Lt;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(a,l){return e.ExactOptionalPropertyTypes?l in a:a[l]!==void 0}s(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){let l=Ze(a);return e.AllowArrayObject?l:l&&!He(a)}s(r,"IsObjectLike"),e.IsObjectLike=r;function n(a){return r(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}s(n,"IsRecordLike"),e.IsRecordLike=n;function o(a){return e.AllowNaN?ke(a):Number.isFinite(a)}s(o,"IsNumberLike"),e.IsNumberLike=o;function i(a){let l=br(a);return e.AllowNullVoid?l||a===null:l}s(i,"IsVoidLike"),e.IsVoidLike=i})(Lt||(Lt={}));f();function gQ(e){return globalThis.Object.freeze(e).map(t=>Oy(t))}s(gQ,"ImmutableArray");function bQ(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Oy(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Oy(e[r]);return globalThis.Object.freeze(t)}s(bQ,"ImmutableObject");function Oy(e){return wn(e)?gQ(e):Dp(e)?e:Ba(e)?e:wy(e)?e:Vt(e)?bQ(e):e}s(Oy,"Immutable");function ee(e,t){let r=t!==void 0?P(P({},t),e):e;switch(Lt.InstanceMode){case"freeze":return Oy(r);case"clone":return nr(r);default:return r}}s(ee,"CreateType");f();var QC=class QC extends Error{constructor(t){super(t)}};s(QC,"TypeBoxError");var Fe=QC;f();f();f();var or=Symbol.for("TypeBox.Transform"),Ga=Symbol.for("TypeBox.Readonly"),Wn=Symbol.for("TypeBox.Optional"),Jo=Symbol.for("TypeBox.Hint"),Z=Symbol.for("TypeBox.Kind");function TL(e){return Vt(e)&&e[Ga]==="Readonly"}s(TL,"IsReadonly");function As(e){return Vt(e)&&e[Wn]==="Optional"}s(As,"IsOptional");function eT(e){return It(e,"Any")}s(eT,"IsAny");function Ua(e){return It(e,"Array")}s(Ua,"IsArray");function Ey(e){return It(e,"AsyncIterator")}s(Ey,"IsAsyncIterator");function tT(e){return It(e,"BigInt")}s(tT,"IsBigInt");function rT(e){return It(e,"Boolean")}s(rT,"IsBoolean");function _y(e){return It(e,"Constructor")}s(_y,"IsConstructor");function xQ(e){return It(e,"Date")}s(xQ,"IsDate");function ky(e){return It(e,"Function")}s(ky,"IsFunction");function Fp(e){return It(e,"Integer")}s(Fp,"IsInteger");function _r(e){return It(e,"Intersect")}s(_r,"IsIntersect");function Ay(e){return It(e,"Iterator")}s(Ay,"IsIterator");function It(e,t){return Vt(e)&&Z in e&&e[Z]===t}s(It,"IsKindOf");function Va(e){return It(e,"Literal")}s(Va,"IsLiteral");function Mo(e){return It(e,"MappedKey")}s(Mo,"IsMappedKey");function sr(e){return It(e,"MappedResult")}s(sr,"IsMappedResult");function pc(e){return It(e,"Never")}s(pc,"IsNever");function vQ(e){return It(e,"Not")}s(vQ,"IsNot");function IQ(e){return It(e,"Null")}s(IQ,"IsNull");function Lp(e){return It(e,"Number")}s(Lp,"IsNumber");function Ur(e){return It(e,"Object")}s(Ur,"IsObject");function Rp(e){return It(e,"Promise")}s(Rp,"IsPromise");function nT(e){return It(e,"Record")}s(nT,"IsRecord");function oT(e){return It(e,"Ref")}s(oT,"IsRef");function iT(e){return It(e,"RegExp")}s(iT,"IsRegExp");function Dy(e){return It(e,"String")}s(Dy,"IsString");function SQ(e){return It(e,"Symbol")}s(SQ,"IsSymbol");function Oo(e){return It(e,"TemplateLiteral")}s(Oo,"IsTemplateLiteral");function CQ(e){return It(e,"This")}s(CQ,"IsThis");function df(e){return Vt(e)&&or in e}s(df,"IsTransform");function Bi(e){return It(e,"Tuple")}s(Bi,"IsTuple");function TQ(e){return It(e,"Undefined")}s(TQ,"IsUndefined");function kt(e){return It(e,"Union")}s(kt,"IsUnion");function PQ(e){return It(e,"Uint8Array")}s(PQ,"IsUint8Array");function wQ(e){return It(e,"Unknown")}s(wQ,"IsUnknown");function MQ(e){return It(e,"Unsafe")}s(MQ,"IsUnsafe");function OQ(e){return It(e,"Void")}s(OQ,"IsVoid");function uc(e){return Vt(e)&&Z in e&&Kt(e[Z])}s(uc,"IsKind");function $i(e){return eT(e)||Ua(e)||rT(e)||tT(e)||Ey(e)||_y(e)||xQ(e)||ky(e)||Fp(e)||_r(e)||Ay(e)||Va(e)||Mo(e)||sr(e)||pc(e)||vQ(e)||IQ(e)||Lp(e)||Ur(e)||Rp(e)||nT(e)||oT(e)||iT(e)||Dy(e)||SQ(e)||Oo(e)||CQ(e)||Bi(e)||TQ(e)||kt(e)||PQ(e)||wQ(e)||MQ(e)||OQ(e)||uc(e)}s($i,"IsSchema");var B={};cs(B,{IsAny:()=>OL,IsArray:()=>EL,IsAsyncIterator:()=>_L,IsBigInt:()=>kL,IsBoolean:()=>AL,IsConstructor:()=>DL,IsDate:()=>FL,IsFunction:()=>LL,IsInteger:()=>RL,IsIntersect:()=>NL,IsIterator:()=>BL,IsKind:()=>lR,IsKindOf:()=>gt,IsLiteral:()=>Ly,IsLiteralBoolean:()=>FQ,IsLiteralNumber:()=>jL,IsLiteralString:()=>$L,IsLiteralValue:()=>GL,IsMappedKey:()=>UL,IsMappedResult:()=>VL,IsNever:()=>zL,IsNot:()=>HL,IsNull:()=>WL,IsNumber:()=>qL,IsObject:()=>ZL,IsOptional:()=>DQ,IsPromise:()=>XL,IsProperties:()=>cT,IsReadonly:()=>AQ,IsRecord:()=>YL,IsRecursive:()=>LQ,IsRef:()=>KL,IsRegExp:()=>JL,IsSchema:()=>yt,IsString:()=>QL,IsSymbol:()=>eR,IsTemplateLiteral:()=>tR,IsThis:()=>rR,IsTransform:()=>Jt,IsTuple:()=>nR,IsUint8Array:()=>oR,IsUndefined:()=>ff,IsUnion:()=>pT,IsUnionLiteral:()=>RQ,IsUnknown:()=>iR,IsUnsafe:()=>sR,IsVoid:()=>aR,TypeGuardUnknownTypeError:()=>sT});f();var uT=class uT extends Fe{};s(uT,"TypeGuardUnknownTypeError");var sT=uT,EQ=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function PL(e){try{return new RegExp(e),!0}catch(t){return!1}}s(PL,"IsPattern");function aT(e){if(!Kt(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}s(aT,"IsControlCharacterFree");function wL(e){return lT(e)||yt(e)}s(wL,"IsAdditionalProperties");function Fy(e){return gr(e)||Py(e)}s(Fy,"IsOptionalBigInt");function Zt(e){return gr(e)||Ni(e)}s(Zt,"IsOptionalNumber");function lT(e){return gr(e)||lc(e)}s(lT,"IsOptionalBoolean");function Nt(e){return gr(e)||Kt(e)}s(Nt,"IsOptionalString");function _Q(e){return gr(e)||Kt(e)&&aT(e)&&PL(e)}s(_Q,"IsOptionalPattern");function kQ(e){return gr(e)||Kt(e)&&aT(e)}s(kQ,"IsOptionalFormat");function ML(e){return gr(e)||yt(e)}s(ML,"IsOptionalSchema");function AQ(e){return Vt(e)&&e[Ga]==="Readonly"}s(AQ,"IsReadonly");function DQ(e){return Vt(e)&&e[Wn]==="Optional"}s(DQ,"IsOptional");function OL(e){return gt(e,"Any")&&Nt(e.$id)}s(OL,"IsAny");function EL(e){return gt(e,"Array")&&e.type==="array"&&Nt(e.$id)&&yt(e.items)&&Zt(e.minItems)&&Zt(e.maxItems)&&lT(e.uniqueItems)&&ML(e.contains)&&Zt(e.minContains)&&Zt(e.maxContains)}s(EL,"IsArray");function _L(e){return gt(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Nt(e.$id)&&yt(e.items)}s(_L,"IsAsyncIterator");function kL(e){return gt(e,"BigInt")&&e.type==="bigint"&&Nt(e.$id)&&Fy(e.exclusiveMaximum)&&Fy(e.exclusiveMinimum)&&Fy(e.maximum)&&Fy(e.minimum)&&Fy(e.multipleOf)}s(kL,"IsBigInt");function AL(e){return gt(e,"Boolean")&&e.type==="boolean"&&Nt(e.$id)}s(AL,"IsBoolean");function DL(e){return gt(e,"Constructor")&&e.type==="Constructor"&&Nt(e.$id)&&wn(e.parameters)&&e.parameters.every(t=>yt(t))&&yt(e.returns)}s(DL,"IsConstructor");function FL(e){return gt(e,"Date")&&e.type==="Date"&&Nt(e.$id)&&Zt(e.exclusiveMaximumTimestamp)&&Zt(e.exclusiveMinimumTimestamp)&&Zt(e.maximumTimestamp)&&Zt(e.minimumTimestamp)&&Zt(e.multipleOfTimestamp)}s(FL,"IsDate");function LL(e){return gt(e,"Function")&&e.type==="Function"&&Nt(e.$id)&&wn(e.parameters)&&e.parameters.every(t=>yt(t))&&yt(e.returns)}s(LL,"IsFunction");function RL(e){return gt(e,"Integer")&&e.type==="integer"&&Nt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}s(RL,"IsInteger");function cT(e){return Vt(e)&&Object.entries(e).every(([t,r])=>aT(t)&&yt(r))}s(cT,"IsProperties");function NL(e){return gt(e,"Intersect")&&!(Kt(e.type)&&e.type!=="object")&&wn(e.allOf)&&e.allOf.every(t=>yt(t)&&!Jt(t))&&Nt(e.type)&&(lT(e.unevaluatedProperties)||ML(e.unevaluatedProperties))&&Nt(e.$id)}s(NL,"IsIntersect");function BL(e){return gt(e,"Iterator")&&e.type==="Iterator"&&Nt(e.$id)&&yt(e.items)}s(BL,"IsIterator");function gt(e,t){return Vt(e)&&Z in e&&e[Z]===t}s(gt,"IsKindOf");function $L(e){return Ly(e)&&Kt(e.const)}s($L,"IsLiteralString");function jL(e){return Ly(e)&&Ni(e.const)}s(jL,"IsLiteralNumber");function FQ(e){return Ly(e)&&lc(e.const)}s(FQ,"IsLiteralBoolean");function Ly(e){return gt(e,"Literal")&&Nt(e.$id)&&GL(e.const)}s(Ly,"IsLiteral");function GL(e){return lc(e)||Ni(e)||Kt(e)}s(GL,"IsLiteralValue");function UL(e){return gt(e,"MappedKey")&&wn(e.keys)&&e.keys.every(t=>Ni(t)||Kt(t))}s(UL,"IsMappedKey");function VL(e){return gt(e,"MappedResult")&&cT(e.properties)}s(VL,"IsMappedResult");function zL(e){return gt(e,"Never")&&Vt(e.not)&&Object.getOwnPropertyNames(e.not).length===0}s(zL,"IsNever");function HL(e){return gt(e,"Not")&&yt(e.not)}s(HL,"IsNot");function WL(e){return gt(e,"Null")&&e.type==="null"&&Nt(e.$id)}s(WL,"IsNull");function qL(e){return gt(e,"Number")&&e.type==="number"&&Nt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}s(qL,"IsNumber");function ZL(e){return gt(e,"Object")&&e.type==="object"&&Nt(e.$id)&&cT(e.properties)&&wL(e.additionalProperties)&&Zt(e.minProperties)&&Zt(e.maxProperties)}s(ZL,"IsObject");function XL(e){return gt(e,"Promise")&&e.type==="Promise"&&Nt(e.$id)&&yt(e.item)}s(XL,"IsPromise");function YL(e){return gt(e,"Record")&&e.type==="object"&&Nt(e.$id)&&wL(e.additionalProperties)&&Vt(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&PL(r[0])&&Vt(t.patternProperties)&&yt(t.patternProperties[r[0]])})(e)}s(YL,"IsRecord");function LQ(e){return Vt(e)&&Jo in e&&e[Jo]==="Recursive"}s(LQ,"IsRecursive");function KL(e){return gt(e,"Ref")&&Nt(e.$id)&&Kt(e.$ref)}s(KL,"IsRef");function JL(e){return gt(e,"RegExp")&&Nt(e.$id)&&Kt(e.source)&&Kt(e.flags)&&Zt(e.maxLength)&&Zt(e.minLength)}s(JL,"IsRegExp");function QL(e){return gt(e,"String")&&e.type==="string"&&Nt(e.$id)&&Zt(e.minLength)&&Zt(e.maxLength)&&_Q(e.pattern)&&kQ(e.format)}s(QL,"IsString");function eR(e){return gt(e,"Symbol")&&e.type==="symbol"&&Nt(e.$id)}s(eR,"IsSymbol");function tR(e){return gt(e,"TemplateLiteral")&&e.type==="string"&&Kt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}s(tR,"IsTemplateLiteral");function rR(e){return gt(e,"This")&&Nt(e.$id)&&Kt(e.$ref)}s(rR,"IsThis");function Jt(e){return Vt(e)&&or in e}s(Jt,"IsTransform");function nR(e){return gt(e,"Tuple")&&e.type==="array"&&Nt(e.$id)&&Ni(e.minItems)&&Ni(e.maxItems)&&e.minItems===e.maxItems&&(gr(e.items)&&gr(e.additionalItems)&&e.minItems===0||wn(e.items)&&e.items.every(t=>yt(t)))}s(nR,"IsTuple");function ff(e){return gt(e,"Undefined")&&e.type==="undefined"&&Nt(e.$id)}s(ff,"IsUndefined");function RQ(e){return pT(e)&&e.anyOf.every(t=>$L(t)||jL(t))}s(RQ,"IsUnionLiteral");function pT(e){return gt(e,"Union")&&Nt(e.$id)&&Vt(e)&&wn(e.anyOf)&&e.anyOf.every(t=>yt(t))}s(pT,"IsUnion");function oR(e){return gt(e,"Uint8Array")&&e.type==="Uint8Array"&&Nt(e.$id)&&Zt(e.minByteLength)&&Zt(e.maxByteLength)}s(oR,"IsUint8Array");function iR(e){return gt(e,"Unknown")&&Nt(e.$id)}s(iR,"IsUnknown");function sR(e){return gt(e,"Unsafe")}s(sR,"IsUnsafe");function aR(e){return gt(e,"Void")&&e.type==="void"&&Nt(e.$id)}s(aR,"IsVoid");function lR(e){return Vt(e)&&Z in e&&Kt(e[Z])&&!EQ.includes(e[Z])}s(lR,"IsKind");function yt(e){return Vt(e)&&(OL(e)||EL(e)||AL(e)||kL(e)||_L(e)||DL(e)||FL(e)||LL(e)||RL(e)||NL(e)||BL(e)||Ly(e)||UL(e)||VL(e)||zL(e)||HL(e)||WL(e)||qL(e)||ZL(e)||XL(e)||YL(e)||KL(e)||JL(e)||QL(e)||eR(e)||tR(e)||rR(e)||nR(e)||ff(e)||pT(e)||oR(e)||iR(e)||sR(e)||aR(e)||lR(e))}s(yt,"IsSchema");f();var dT="(true|false)",Ry="(0|[1-9][0-9]*)",fT="(.*)",NQ="(?!.*)",iwe="^".concat(dT,"$"),za="^".concat(Ry,"$"),Ha="^".concat(fT,"$"),cR="^".concat(NQ,"$");f();var qn={};cs(qn,{Clear:()=>$Q,Delete:()=>jQ,Entries:()=>BQ,Get:()=>VQ,Has:()=>GQ,Set:()=>UQ});f();var mf=new Map;function BQ(){return new Map(mf)}s(BQ,"Entries");function $Q(){return mf.clear()}s($Q,"Clear");function jQ(e){return mf.delete(e)}s(jQ,"Delete");function GQ(e){return mf.has(e)}s(GQ,"Has");function UQ(e,t){mf.set(e,t)}s(UQ,"Set");function VQ(e){return mf.get(e)}s(VQ,"Get");var Vr={};cs(Vr,{Clear:()=>HQ,Delete:()=>WQ,Entries:()=>zQ,Get:()=>XQ,Has:()=>qQ,Set:()=>ZQ});f();var hf=new Map;function zQ(){return new Map(hf)}s(zQ,"Entries");function HQ(){return hf.clear()}s(HQ,"Clear");function WQ(e){return hf.delete(e)}s(WQ,"Delete");function qQ(e){return hf.has(e)}s(qQ,"Has");function ZQ(e,t){hf.set(e,t)}s(ZQ,"Set");function XQ(e){return hf.get(e)}s(XQ,"Get");f();function pR(e,t){return e.includes(t)}s(pR,"SetIncludes");function uR(e){return[...new Set(e)]}s(uR,"SetDistinct");function YQ(e,t){return e.filter(r=>t.includes(r))}s(YQ,"SetIntersect");function KQ(e,t){return e.reduce((r,n)=>YQ(r,n),t)}s(KQ,"SetIntersectManyResolve");function dR(e){return e.length===1?e[0]:e.length>1?KQ(e.slice(1),e[0]):[]}s(dR,"SetIntersectMany");function fR(e){let t=[];for(let r of e)t.push(...r);return t}s(fR,"SetUnionMany");f();function dc(e){return ee({[Z]:"Any"},e)}s(dc,"Any");f();function R0(e,t){return ee({[Z]:"Array",type:"array",items:e},t)}s(R0,"Array");f();function N0(e,t){return ee({[Z]:"AsyncIterator",type:"AsyncIterator",items:e},t)}s(N0,"AsyncIterator");f();f();f();function JQ(e,t){let o=e,{[t]:r}=o;return $n(o,[wb(t)])}s(JQ,"DiscardKey");function Cr(e,t){return t.reduce((r,n)=>JQ(r,n),e)}s(Cr,"Discard");f();function Bt(e){return ee({[Z]:"Never",not:{}},e)}s(Bt,"Never");f();f();function St(e){return ee({[Z]:"MappedResult",properties:e})}s(St,"MappedResult");f();f();function B0(e,t,r){return ee({[Z]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}s(B0,"Constructor");f();function fc(e,t,r){return ee({[Z]:"Function",type:"Function",parameters:e,returns:t},r)}s(fc,"Function");f();f();f();f();function Ny(e,t){return ee({[Z]:"Union",anyOf:e},t)}s(Ny,"UnionCreate");function QQ(e){return e.some(t=>As(t))}s(QQ,"IsUnionOptional");function mR(e){return e.map(t=>As(t)?eee(t):t)}s(mR,"RemoveOptionalFromRest");function eee(e){return Cr(e,[Wn])}s(eee,"RemoveOptionalFromType");function tee(e,t){return QQ(e)?uo(Ny(mR(e),t)):Ny(mR(e),t)}s(tee,"ResolveUnion");function Ds(e,t){return e.length===0?Bt(t):e.length===1?ee(e[0],t):tee(e,t)}s(Ds,"UnionEvaluated");f();function $t(e,t){return e.length===0?Bt(t):e.length===1?ee(e[0],t):Ny(e,t)}s($t,"Union");f();f();f();var hT=class hT extends Fe{};s(hT,"TemplateLiteralParserError");var $0=hT;function ree(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}s(ree,"Unescape");function mT(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}s(mT,"IsNonEscaped");function Wa(e,t){return mT(e,t,"(")}s(Wa,"IsOpenParen");function By(e,t){return mT(e,t,")")}s(By,"IsCloseParen");function hR(e,t){return mT(e,t,"|")}s(hR,"IsSeparator");function nee(e){if(!(Wa(e,0)&&By(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Wa(e,r)&&(t+=1),By(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}s(nee,"IsGroup");function oee(e){return e.slice(1,e.length-1)}s(oee,"InGroup");function iee(e){let t=0;for(let r=0;r<e.length;r++)if(Wa(e,r)&&(t+=1),By(e,r)&&(t-=1),hR(e,r)&&t===0)return!0;return!1}s(iee,"IsPrecedenceOr");function see(e){for(let t=0;t<e.length;t++)if(Wa(e,t))return!0;return!1}s(see,"IsPrecedenceAnd");function aee(e){let[t,r]=[0,0],n=[];for(let i=0;i<e.length;i++)if(Wa(e,i)&&(t+=1),By(e,i)&&(t-=1),hR(e,i)&&t===0){let a=e.slice(r,i);a.length>0&&n.push(yf(a)),r=i+1}let o=e.slice(r);return o.length>0&&n.push(yf(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}s(aee,"Or");function lee(e){function t(o,i){if(!Wa(o,i))throw new $0("TemplateLiteralParser: Index must point to open parens");let a=0;for(let l=i;l<o.length;l++)if(Wa(o,l)&&(a+=1),By(o,l)&&(a-=1),a===0)return[i,l];throw new $0("TemplateLiteralParser: Unclosed group parens in expression")}s(t,"Group");function r(o,i){for(let a=i;a<o.length;a++)if(Wa(o,a))return[i,a];return[i,o.length]}s(r,"Range");let n=[];for(let o=0;o<e.length;o++)if(Wa(e,o)){let[i,a]=t(e,o),l=e.slice(i,a+1);n.push(yf(l)),o=a}else{let[i,a]=r(e,o),l=e.slice(i,a);l.length>0&&n.push(yf(l)),o=a-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}s(lee,"And");function yf(e){return nee(e)?yf(oee(e)):iee(e)?aee(e):see(e)?lee(e):{type:"const",const:ree(e)}}s(yf,"TemplateLiteralParse");function gf(e){return yf(e.slice(1,e.length-1))}s(gf,"TemplateLiteralParseExact");var gT=class gT extends Fe{};s(gT,"TemplateLiteralFiniteError");var yT=gT;function cee(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}s(cee,"IsNumberExpression");function pee(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}s(pee,"IsBooleanExpression");function uee(e){return e.type==="const"&&e.const===".*"}s(uee,"IsStringExpression");function Np(e){return cee(e)||uee(e)?!1:pee(e)?!0:e.type==="and"?e.expr.every(t=>Np(t)):e.type==="or"?e.expr.every(t=>Np(t)):e.type==="const"?!0:(()=>{throw new yT("Unknown expression type")})()}s(Np,"IsTemplateLiteralExpressionFinite");function j0(e){let t=gf(e.pattern);return Np(t)}s(j0,"IsTemplateLiteralFinite");f();var xT=class xT extends Fe{};s(xT,"TemplateLiteralGenerateError");var bT=xT;function*yR(e){if(e.length===1)return yield*ie(e[0]);for(let t of e[0])for(let r of yR(e.slice(1)))yield"".concat(t).concat(r)}s(yR,"GenerateReduce");function*dee(e){return yield*ie(yR(e.expr.map(t=>[...$y(t)])))}s(dee,"GenerateAnd");function*fee(e){for(let t of e.expr)yield*ie($y(t))}s(fee,"GenerateOr");function*mee(e){return yield e.const}s(mee,"GenerateConst");function*$y(e){return e.type==="and"?yield*ie(dee(e)):e.type==="or"?yield*ie(fee(e)):e.type==="const"?yield*ie(mee(e)):(()=>{throw new bT("Unknown expression")})()}s($y,"TemplateLiteralExpressionGenerate");function bf(e){let t=gf(e.pattern);return Np(t)?[...$y(t)]:[]}s(bf,"TemplateLiteralGenerate");f();f();function Dt(e,t){return ee({[Z]:"Literal",const:e,type:typeof e},t)}s(Dt,"Literal");f();function G0(e){return ee({[Z]:"Boolean",type:"boolean"},e)}s(G0,"Boolean");f();function xf(e){return ee({[Z]:"BigInt",type:"bigint"},e)}s(xf,"BigInt");f();function Fs(e){return ee({[Z]:"Number",type:"number"},e)}s(Fs,"Number");f();function Qo(e){return ee({[Z]:"String",type:"string"},e)}s(Qo,"String");function*hee(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield G0():t==="number"?yield Fs():t==="bigint"?yield xf():t==="string"?yield Qo():yield(()=>{let r=t.split("|").map(n=>Dt(n.trim()));return r.length===0?Bt():r.length===1?r[0]:Ds(r)})()}s(hee,"FromUnion");function*yee(e){if(e[1]!=="{"){let t=Dt("$"),r=vT(e.slice(1));return yield*ie([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=hee(e.slice(2,t)),n=vT(e.slice(t+1));return yield*ie([...r,...n])}yield Dt(e)}s(yee,"FromTerminal");function*vT(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=Dt(e.slice(0,t)),n=yee(e.slice(t));return yield*ie([r,...n])}yield Dt(e)}s(vT,"FromSyntax");function gR(e){return[...vT(e)]}s(gR,"TemplateLiteralSyntax");f();var CT=class CT extends Fe{};s(CT,"TemplateLiteralPatternError");var IT=CT;function gee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(gee,"Escape");function bR(e,t){return Oo(e)?e.pattern.slice(1,e.pattern.length-1):kt(e)?"(".concat(e.anyOf.map(r=>bR(r,t)).join("|"),")"):Lp(e)?"".concat(t).concat(Ry):Fp(e)?"".concat(t).concat(Ry):tT(e)?"".concat(t).concat(Ry):Dy(e)?"".concat(t).concat(fT):Va(e)?"".concat(t).concat(gee(e.const.toString())):rT(e)?"".concat(t).concat(dT):(()=>{throw new IT("Unexpected Kind '".concat(e[Z],"'"))})()}s(bR,"Visit");function ST(e){return"^".concat(e.map(t=>bR(t,"")).join(""),"$")}s(ST,"TemplateLiteralPattern");f();function Bp(e){let r=bf(e).map(n=>Dt(n));return Ds(r)}s(Bp,"TemplateLiteralToUnion");f();function U0(e,t){let r=Kt(e)?ST(gR(e)):ST(e);return ee({[Z]:"TemplateLiteral",type:"string",pattern:r},t)}s(U0,"TemplateLiteral");function bee(e){return bf(e).map(r=>r.toString())}s(bee,"FromTemplateLiteral");function xee(e){let t=[];for(let r of e)t.push(...fo(r));return t}s(xee,"FromUnion");function vee(e){return[e.toString()]}s(vee,"FromLiteral");function fo(e){return[...new Set(Oo(e)?bee(e):kt(e)?xee(e.anyOf):Va(e)?vee(e.const):Lp(e)?["[number]"]:Fp(e)?["[number]"]:[])]}s(fo,"IndexPropertyKeys");f();function Iee(e,t,r){let n={};for(let o of Object.getOwnPropertyNames(t))n[o]=vf(e,fo(t[o]),r);return n}s(Iee,"FromProperties");function See(e,t,r){return Iee(e,t.properties,r)}s(See,"FromMappedResult");function xR(e,t,r){let n=See(e,t,r);return St(n)}s(xR,"IndexFromMappedResult");function IR(e,t){return e.map(r=>SR(r,t))}s(IR,"FromRest");function Cee(e){return e.filter(t=>!pc(t))}s(Cee,"FromIntersectRest");function Tee(e,t){return V0(Cee(IR(e,t)))}s(Tee,"FromIntersect");function Pee(e){return e.some(t=>pc(t))?[]:e}s(Pee,"FromUnionRest");function wee(e,t){return Ds(Pee(IR(e,t)))}s(wee,"FromUnion");function Mee(e,t){return t in e?e[t]:t==="[number]"?Ds(e):Bt()}s(Mee,"FromTuple");function Oee(e,t){return t==="[number]"?e:Bt()}s(Oee,"FromArray");function Eee(e,t){return t in e?e[t]:Bt()}s(Eee,"FromProperty");function SR(e,t){var r;return _r(e)?Tee(e.allOf,t):kt(e)?wee(e.anyOf,t):Bi(e)?Mee((r=e.items)!=null?r:[],t):Ua(e)?Oee(e.items,t):Ur(e)?Eee(e.properties,t):Bt()}s(SR,"IndexFromPropertyKey");function jy(e,t){return t.map(r=>SR(e,r))}s(jy,"IndexFromPropertyKeys");function vR(e,t){return Ds(jy(e,t))}s(vR,"FromSchema");function vf(e,t,r){return sr(t)?xR(e,t,r):Mo(t)?CR(e,t,r):ee($i(t)?vR(e,fo(t)):vR(e,t),r)}s(vf,"Index");function _ee(e,t,r){return{[t]:vf(e,[t],nr(r))}}s(_ee,"MappedIndexPropertyKey");function kee(e,t,r){return t.reduce((n,o)=>P(P({},n),_ee(e,o,r)),{})}s(kee,"MappedIndexPropertyKeys");function Aee(e,t,r){return kee(e,t.keys,r)}s(Aee,"MappedIndexProperties");function CR(e,t,r){let n=Aee(e,t,r);return St(n)}s(CR,"IndexFromMappedKey");f();function z0(e,t){return ee({[Z]:"Iterator",type:"Iterator",items:e},t)}s(z0,"Iterator");f();function Dee(e){let t=[];for(let r in e)As(e[r])||t.push(r);return t}s(Dee,"RequiredKeys");function Fee(e,t){let r=Dee(e),n=r.length>0?{[Z]:"Object",type:"object",properties:e,required:r}:{[Z]:"Object",type:"object",properties:e};return ee(n,t)}s(Fee,"_Object");var zt=Fee;f();function H0(e,t){return ee({[Z]:"Promise",type:"Promise",item:e},t)}s(H0,"Promise");f();f();function Lee(e){return ee(Cr(e,[Ga]))}s(Lee,"RemoveReadonly");function Ree(e){return ee(R(P({},e),{[Ga]:"Readonly"}))}s(Ree,"AddReadonly");function Nee(e,t){return t===!1?Lee(e):Ree(e)}s(Nee,"ReadonlyWithFlag");function ei(e,t){let r=t!=null?t:!0;return sr(e)?TR(e,r):Nee(e,r)}s(ei,"Readonly");function Bee(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ei(e[n],t);return r}s(Bee,"FromProperties");function $ee(e,t){return Bee(e.properties,t)}s($ee,"FromMappedResult");function TR(e,t){let r=$ee(e,t);return St(r)}s(TR,"ReadonlyFromMappedResult");f();function Ls(e,t){return ee(e.length>0?{[Z]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Z]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}s(Ls,"Tuple");function PR(e,t){return e in t?ti(e,t[e]):St(t)}s(PR,"FromMappedResult");function jee(e){return{[e]:Dt(e)}}s(jee,"MappedKeyToKnownMappedResultProperties");function Gee(e){let t={};for(let r of e)t[r]=Dt(r);return t}s(Gee,"MappedKeyToUnknownMappedResultProperties");function Uee(e,t){return pR(t,e)?jee(e):Gee(t)}s(Uee,"MappedKeyToMappedResultProperties");function Vee(e,t){let r=Uee(e,t);return PR(e,r)}s(Vee,"FromMappedKey");function Gy(e,t){return t.map(r=>ti(e,r))}s(Gy,"FromRest");function zee(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=ti(e,t[n]);return r}s(zee,"FromProperties");function ti(e,t){var n;let r=P({},t);return As(t)?uo(ti(e,Cr(t,[Wn]))):TL(t)?ei(ti(e,Cr(t,[Ga]))):sr(t)?PR(e,t.properties):Mo(t)?Vee(e,t.keys):_y(t)?B0(Gy(e,t.parameters),ti(e,t.returns),r):ky(t)?fc(Gy(e,t.parameters),ti(e,t.returns),r):Ey(t)?N0(ti(e,t.items),r):Ay(t)?z0(ti(e,t.items),r):_r(t)?mo(Gy(e,t.allOf),r):kt(t)?$t(Gy(e,t.anyOf),r):Bi(t)?Ls(Gy(e,(n=t.items)!=null?n:[]),r):Ur(t)?zt(zee(e,t.properties),r):Ua(t)?R0(ti(e,t.items),r):Rp(t)?H0(ti(e,t.item),r):t}s(ti,"FromSchemaType");function Hee(e,t){let r={};for(let n of e)r[n]=ti(n,t);return r}s(Hee,"MappedFunctionReturnType");function wR(e,t,r){let n=$i(e)?fo(e):e,o=t({[Z]:"MappedKey",keys:n}),i=Hee(n,o);return zt(i,r)}s(wR,"Mapped");f();function Wee(e){return ee(Cr(e,[Wn]))}s(Wee,"RemoveOptional");function qee(e){return ee(R(P({},e),{[Wn]:"Optional"}))}s(qee,"AddOptional");function Zee(e,t){return t===!1?Wee(e):qee(e)}s(Zee,"OptionalWithFlag");function uo(e,t){let r=t!=null?t:!0;return sr(e)?MR(e,r):Zee(e,r)}s(uo,"Optional");function Xee(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=uo(e[n],t);return r}s(Xee,"FromProperties");function Yee(e,t){return Xee(e.properties,t)}s(Yee,"FromMappedResult");function MR(e,t){let r=Yee(e,t);return St(r)}s(MR,"OptionalFromMappedResult");f();function Uy(e,t={}){let r=e.every(o=>Ur(o)),n=$i(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return ee(t.unevaluatedProperties===!1||$i(t.unevaluatedProperties)||r?R(P({},n),{[Z]:"Intersect",type:"object",allOf:e}):R(P({},n),{[Z]:"Intersect",allOf:e}),t)}s(Uy,"IntersectCreate");function Kee(e){return e.every(t=>As(t))}s(Kee,"IsIntersectOptional");function Jee(e){return Cr(e,[Wn])}s(Jee,"RemoveOptionalFromType");function OR(e){return e.map(t=>As(t)?Jee(t):t)}s(OR,"RemoveOptionalFromRest");function Qee(e,t){return Kee(e)?uo(Uy(OR(e),t)):Uy(OR(e),t)}s(Qee,"ResolveIntersect");function V0(e,t={}){if(e.length===0)return Bt(t);if(e.length===1)return ee(e[0],t);if(e.some(r=>df(r)))throw new Error("Cannot intersect transform types");return Qee(e,t)}s(V0,"IntersectEvaluated");f();function mo(e,t){if(e.length===0)return Bt(t);if(e.length===1)return ee(e[0],t);if(e.some(r=>df(r)))throw new Error("Cannot intersect transform types");return Uy(e,t)}s(mo,"Intersect");function ER(e){return e.map(t=>TT(t))}s(ER,"FromRest");function ete(e){return mo(ER(e))}s(ete,"FromIntersect");function tte(e){return $t(ER(e))}s(tte,"FromUnion");function rte(e){return TT(e)}s(rte,"FromPromise");function TT(e){return _r(e)?ete(e.allOf):kt(e)?tte(e.anyOf):Rp(e)?rte(e.item):e}s(TT,"AwaitedResolve");function _R(e,t){return ee(TT(e),t)}s(_R,"Awaited");f();f();f();f();function kR(e){let t=[];for(let r of e)t.push(Qr(r));return t}s(kR,"FromRest");function nte(e){let t=kR(e);return fR(t)}s(nte,"FromIntersect");function ote(e){let t=kR(e);return dR(t)}s(ote,"FromUnion");function ite(e){return e.map((t,r)=>r.toString())}s(ite,"FromTuple");function ste(e){return["[number]"]}s(ste,"FromArray");function ate(e){return globalThis.Object.getOwnPropertyNames(e)}s(ate,"FromProperties");function lte(e){return PT?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}s(lte,"FromPatternProperties");function Qr(e){var t;return _r(e)?nte(e.allOf):kt(e)?ote(e.anyOf):Bi(e)?ite((t=e.items)!=null?t:[]):Ua(e)?ste(e.items):Ur(e)?ate(e.properties):nT(e)?lte(e.patternProperties):[]}s(Qr,"KeyOfPropertyKeys");var PT=!1;function qa(e){PT=!0;let t=Qr(e);PT=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}s(qa,"KeyOfPattern");function cte(e){return e.map(t=>t==="[number]"?Fs():Dt(t))}s(cte,"KeyOfPropertyKeysToRest");function W0(e,t){if(sr(e))return AR(e,t);{let r=Qr(e),n=cte(r),o=Ds(n);return ee(o,t)}}s(W0,"KeyOf");function pte(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=W0(e[n],nr(t));return r}s(pte,"FromProperties");function ute(e,t){return pte(e.properties,t)}s(ute,"FromMappedResult");function AR(e,t){let r=ute(e,t);return St(r)}s(AR,"KeyOfFromMappedResult");f();function mc(e){let t=Qr(e),r=jy(e,t);return t.map((n,o)=>[t[o],r[o]])}s(mc,"KeyOfPropertyEntries");function dte(e){let t=[];for(let r of e)t.push(...Qr(r));return uR(t)}s(dte,"CompositeKeys");function fte(e){return e.filter(t=>!pc(t))}s(fte,"FilterNever");function mte(e,t){let r=[];for(let n of e)r.push(...jy(n,[t]));return fte(r)}s(mte,"CompositeProperty");function hte(e,t){let r={};for(let n of t)r[n]=V0(mte(e,n));return r}s(hte,"CompositeProperties");function DR(e,t){let r=dte(e),n=hte(e,r);return zt(n,t)}s(DR,"Composite");f();f();function q0(e){return ee({[Z]:"Date",type:"Date"},e)}s(q0,"Date");f();function Z0(e){return ee({[Z]:"Null",type:"null"},e)}s(Z0,"Null");f();function X0(e){return ee({[Z]:"Symbol",type:"symbol"},e)}s(X0,"Symbol");f();function Y0(e){return ee({[Z]:"Undefined",type:"undefined"},e)}s(Y0,"Undefined");f();function K0(e){return ee({[Z]:"Uint8Array",type:"Uint8Array"},e)}s(K0,"Uint8Array");f();function Za(e){return ee({[Z]:"Unknown"},e)}s(Za,"Unknown");function yte(e){return e.map(t=>wT(t,!1))}s(yte,"FromArray");function gte(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ei(wT(e[r],!1));return t}s(gte,"FromProperties");function J0(e,t){return t===!0?e:ei(e)}s(J0,"ConditionalReadonly");function wT(e,t){return qC(e)?J0(dc(),t):XC(e)?J0(dc(),t):wn(e)?ei(Ls(yte(e))):Ba(e)?K0():Dp(e)?q0():Vt(e)?J0(zt(gte(e)),t):ZC(e)?J0(fc([],Za()),t):gr(e)?Y0():YC(e)?Z0():KC(e)?X0():Py(e)?xf():Ni(e)?Dt(e):lc(e)?Dt(e):Kt(e)?Dt(e):zt({})}s(wT,"FromValue");function FR(e,t){return ee(wT(e,!0),t)}s(FR,"Const");f();function LR(e,t){return Ls(e.parameters,t)}s(LR,"ConstructorParameters");f();function Vy(e,t){return e.map(r=>ji(r,t))}s(Vy,"FromRest");function bte(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ji(e[n],t);return r}s(bte,"FromProperties");function xte(e,t){return e.parameters=Vy(e.parameters,t),e.returns=ji(e.returns,t),e}s(xte,"FromConstructor");function vte(e,t){return e.parameters=Vy(e.parameters,t),e.returns=ji(e.returns,t),e}s(vte,"FromFunction");function Ite(e,t){return e.allOf=Vy(e.allOf,t),e}s(Ite,"FromIntersect");function Ste(e,t){return e.anyOf=Vy(e.anyOf,t),e}s(Ste,"FromUnion");function Cte(e,t){return gr(e.items)||(e.items=Vy(e.items,t)),e}s(Cte,"FromTuple");function Tte(e,t){return e.items=ji(e.items,t),e}s(Tte,"FromArray");function Pte(e,t){return e.properties=bte(e.properties,t),e}s(Pte,"FromObject");function wte(e,t){return e.item=ji(e.item,t),e}s(wte,"FromPromise");function Mte(e,t){return e.items=ji(e.items,t),e}s(Mte,"FromAsyncIterator");function Ote(e,t){return e.items=ji(e.items,t),e}s(Ote,"FromIterator");function Ete(e,t){let r=t.find(o=>o.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=Cr(r,["$id"]);return ji(n,t)}s(Ete,"FromRef");function _te(e,t){return _y(e)?xte(e,t):ky(e)?vte(e,t):_r(e)?Ite(e,t):kt(e)?Ste(e,t):Bi(e)?Cte(e,t):Ua(e)?Tte(e,t):Ur(e)?Pte(e,t):Rp(e)?wte(e,t):Ey(e)?Mte(e,t):Ay(e)?Ote(e,t):oT(e)?Ete(e,t):e}s(_te,"DerefResolve");function ji(e,t){return _te(My(e),IL(t))}s(ji,"Deref");f();function RR(e,t){if(gr(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),o=[...new Set(r)].map(i=>Dt(i));return $t(o,R(P({},t),{[Jo]:"Enum"}))}s(RR,"Enum");f();f();f();var DT=class DT extends Fe{};s(DT,"ExtendsResolverError");var OT=DT,J;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(J||(J={}));function ri(e){return e===J.False?e:J.True}s(ri,"IntoBooleanResult");function If(e){throw new OT(e)}s(If,"Throw");function Fr(e){return B.IsNever(e)||B.IsIntersect(e)||B.IsUnion(e)||B.IsUnknown(e)||B.IsAny(e)}s(Fr,"IsStructuralRight");function Lr(e,t){return B.IsNever(t)?VR(e,t):B.IsIntersect(t)?Q0(e,t):B.IsUnion(t)?AT(e,t):B.IsUnknown(t)?qR(e,t):B.IsAny(t)?kT(e,t):If("StructuralRight")}s(Lr,"StructuralRight");function kT(e,t){return J.True}s(kT,"FromAnyRight");function kte(e,t){return B.IsIntersect(t)?Q0(e,t):B.IsUnion(t)&&t.anyOf.some(r=>B.IsAny(r)||B.IsUnknown(r))?J.True:B.IsUnion(t)?J.Union:B.IsUnknown(t)||B.IsAny(t)?J.True:J.Union}s(kte,"FromAny");function Ate(e,t){return B.IsUnknown(e)?J.False:B.IsAny(e)?J.Union:B.IsNever(e)?J.True:J.False}s(Ate,"FromArrayRight");function Dte(e,t){return B.IsObject(t)&&ex(t)?J.True:Fr(t)?Lr(e,t):B.IsArray(t)?ri(jt(e.items,t.items)):J.False}s(Dte,"FromArray");function Fte(e,t){return Fr(t)?Lr(e,t):B.IsAsyncIterator(t)?ri(jt(e.items,t.items)):J.False}s(Fte,"FromAsyncIterator");function Lte(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsBigInt(t)?J.True:J.False}s(Lte,"FromBigInt");function GR(e,t){return B.IsLiteralBoolean(e)||B.IsBoolean(e)?J.True:J.False}s(GR,"FromBooleanRight");function Rte(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsBoolean(t)?J.True:J.False}s(Rte,"FromBoolean");function Nte(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsConstructor(t)?e.parameters.length>t.parameters.length?J.False:e.parameters.every((r,n)=>ri(jt(t.parameters[n],r))===J.True)?ri(jt(e.returns,t.returns)):J.False:J.False}s(Nte,"FromConstructor");function Bte(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsDate(t)?J.True:J.False}s(Bte,"FromDate");function $te(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsFunction(t)?e.parameters.length>t.parameters.length?J.False:e.parameters.every((r,n)=>ri(jt(t.parameters[n],r))===J.True)?ri(jt(e.returns,t.returns)):J.False:J.False}s($te,"FromFunction");function UR(e,t){return B.IsLiteral(e)&&mt.IsNumber(e.const)||B.IsNumber(e)||B.IsInteger(e)?J.True:J.False}s(UR,"FromIntegerRight");function jte(e,t){return B.IsInteger(t)||B.IsNumber(t)?J.True:Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):J.False}s(jte,"FromInteger");function Q0(e,t){return t.allOf.every(r=>jt(e,r)===J.True)?J.True:J.False}s(Q0,"FromIntersectRight");function Gte(e,t){return e.allOf.some(r=>jt(r,t)===J.True)?J.True:J.False}s(Gte,"FromIntersect");function Ute(e,t){return Fr(t)?Lr(e,t):B.IsIterator(t)?ri(jt(e.items,t.items)):J.False}s(Ute,"FromIterator");function Vte(e,t){return B.IsLiteral(t)&&t.const===e.const?J.True:Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsString(t)?WR(e,t):B.IsNumber(t)?zR(e,t):B.IsInteger(t)?UR(e,t):B.IsBoolean(t)?GR(e,t):J.False}s(Vte,"FromLiteral");function VR(e,t){return J.False}s(VR,"FromNeverRight");function zte(e,t){return J.True}s(zte,"FromNever");function NR(e){let[t,r]=[e,0];for(;B.IsNot(t);)t=t.not,r+=1;return r%2===0?t:Za()}s(NR,"UnwrapTNot");function Hte(e,t){return B.IsNot(e)?jt(NR(e),t):B.IsNot(t)?jt(e,NR(t)):If("Invalid fallthrough for Not")}s(Hte,"FromNot");function Wte(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsNull(t)?J.True:J.False}s(Wte,"FromNull");function zR(e,t){return B.IsLiteralNumber(e)||B.IsNumber(e)||B.IsInteger(e)?J.True:J.False}s(zR,"FromNumberRight");function qte(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsInteger(t)||B.IsNumber(t)?J.True:J.False}s(qte,"FromNumber");function ho(e,t){return Object.getOwnPropertyNames(e.properties).length===t}s(ho,"IsObjectPropertyCount");function BR(e){return ex(e)}s(BR,"IsObjectStringLike");function $R(e){return ho(e,0)||ho(e,1)&&"description"in e.properties&&B.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(B.IsString(e.properties.description.anyOf[0])&&B.IsUndefined(e.properties.description.anyOf[1])||B.IsString(e.properties.description.anyOf[1])&&B.IsUndefined(e.properties.description.anyOf[0]))}s($R,"IsObjectSymbolLike");function MT(e){return ho(e,0)}s(MT,"IsObjectNumberLike");function jR(e){return ho(e,0)}s(jR,"IsObjectBooleanLike");function Zte(e){return ho(e,0)}s(Zte,"IsObjectBigIntLike");function Xte(e){return ho(e,0)}s(Xte,"IsObjectDateLike");function Yte(e){return ex(e)}s(Yte,"IsObjectUint8ArrayLike");function Kte(e){let t=Fs();return ho(e,0)||ho(e,1)&&"length"in e.properties&&ri(jt(e.properties.length,t))===J.True}s(Kte,"IsObjectFunctionLike");function Jte(e){return ho(e,0)}s(Jte,"IsObjectConstructorLike");function ex(e){let t=Fs();return ho(e,0)||ho(e,1)&&"length"in e.properties&&ri(jt(e.properties.length,t))===J.True}s(ex,"IsObjectArrayLike");function Qte(e){let t=fc([dc()],dc());return ho(e,0)||ho(e,1)&&"then"in e.properties&&ri(jt(e.properties.then,t))===J.True}s(Qte,"IsObjectPromiseLike");function HR(e,t){return jt(e,t)===J.False||B.IsOptional(e)&&!B.IsOptional(t)?J.False:J.True}s(HR,"Property");function Mn(e,t){return B.IsUnknown(e)?J.False:B.IsAny(e)?J.Union:B.IsNever(e)||B.IsLiteralString(e)&&BR(t)||B.IsLiteralNumber(e)&&MT(t)||B.IsLiteralBoolean(e)&&jR(t)||B.IsSymbol(e)&&$R(t)||B.IsBigInt(e)&&Zte(t)||B.IsString(e)&&BR(t)||B.IsSymbol(e)&&$R(t)||B.IsNumber(e)&&MT(t)||B.IsInteger(e)&&MT(t)||B.IsBoolean(e)&&jR(t)||B.IsUint8Array(e)&&Yte(t)||B.IsDate(e)&&Xte(t)||B.IsConstructor(e)&&Jte(t)||B.IsFunction(e)&&Kte(t)?J.True:B.IsRecord(e)&&B.IsString(ET(e))?t[Jo]==="Record"?J.True:J.False:B.IsRecord(e)&&B.IsNumber(ET(e))?ho(t,0)?J.True:J.False:J.False}s(Mn,"FromObjectRight");function ere(e,t){return Fr(t)?Lr(e,t):B.IsRecord(t)?ni(e,t):B.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!B.IsOptional(t.properties[r]))return J.False;if(B.IsOptional(t.properties[r]))return J.True;if(HR(e.properties[r],t.properties[r])===J.False)return J.False}return J.True})():J.False}s(ere,"FromObject");function tre(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)&&Qte(t)?J.True:B.IsPromise(t)?ri(jt(e.item,t.item)):J.False}s(tre,"FromPromise");function ET(e){return za in e.patternProperties?Fs():Ha in e.patternProperties?Qo():If("Unknown record key pattern")}s(ET,"RecordKey");function _T(e){return za in e.patternProperties?e.patternProperties[za]:Ha in e.patternProperties?e.patternProperties[Ha]:If("Unable to get record value schema")}s(_T,"RecordValue");function ni(e,t){let[r,n]=[ET(t),_T(t)];return B.IsLiteralString(e)&&B.IsNumber(r)&&ri(jt(e,n))===J.True?J.True:B.IsUint8Array(e)&&B.IsNumber(r)||B.IsString(e)&&B.IsNumber(r)||B.IsArray(e)&&B.IsNumber(r)?jt(e,n):B.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(HR(n,e.properties[o])===J.False)return J.False;return J.True})():J.False}s(ni,"FromRecordRight");function rre(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?jt(_T(e),_T(t)):J.False}s(rre,"FromRecord");function nre(e,t){let r=B.IsRegExp(e)?Qo():e,n=B.IsRegExp(t)?Qo():t;return jt(r,n)}s(nre,"FromRegExp");function WR(e,t){return B.IsLiteral(e)&&mt.IsString(e.const)||B.IsString(e)?J.True:J.False}s(WR,"FromStringRight");function ore(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsString(t)?J.True:J.False}s(ore,"FromString");function ire(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsSymbol(t)?J.True:J.False}s(ire,"FromSymbol");function sre(e,t){return B.IsTemplateLiteral(e)?jt(Bp(e),t):B.IsTemplateLiteral(t)?jt(e,Bp(t)):If("Invalid fallthrough for TemplateLiteral")}s(sre,"FromTemplateLiteral");function are(e,t){return B.IsArray(t)&&e.items!==void 0&&e.items.every(r=>jt(r,t.items)===J.True)}s(are,"IsArrayOfTuple");function lre(e,t){return B.IsNever(e)?J.True:B.IsUnknown(e)?J.False:B.IsAny(e)?J.Union:J.False}s(lre,"FromTupleRight");function cre(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)&&ex(t)||B.IsArray(t)&&are(e,t)?J.True:B.IsTuple(t)?mt.IsUndefined(e.items)&&!mt.IsUndefined(t.items)||!mt.IsUndefined(e.items)&&mt.IsUndefined(t.items)?J.False:mt.IsUndefined(e.items)&&!mt.IsUndefined(t.items)||e.items.every((r,n)=>jt(r,t.items[n])===J.True)?J.True:J.False:J.False}s(cre,"FromTuple");function pre(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsUint8Array(t)?J.True:J.False}s(pre,"FromUint8Array");function ure(e,t){return Fr(t)?Lr(e,t):B.IsObject(t)?Mn(e,t):B.IsRecord(t)?ni(e,t):B.IsVoid(t)?mre(e,t):B.IsUndefined(t)?J.True:J.False}s(ure,"FromUndefined");function AT(e,t){return t.anyOf.some(r=>jt(e,r)===J.True)?J.True:J.False}s(AT,"FromUnionRight");function dre(e,t){return e.anyOf.every(r=>jt(r,t)===J.True)?J.True:J.False}s(dre,"FromUnion");function qR(e,t){return J.True}s(qR,"FromUnknownRight");function fre(e,t){return B.IsNever(t)?VR(e,t):B.IsIntersect(t)?Q0(e,t):B.IsUnion(t)?AT(e,t):B.IsAny(t)?kT(e,t):B.IsString(t)?WR(e,t):B.IsNumber(t)?zR(e,t):B.IsInteger(t)?UR(e,t):B.IsBoolean(t)?GR(e,t):B.IsArray(t)?Ate(e,t):B.IsTuple(t)?lre(e,t):B.IsObject(t)?Mn(e,t):B.IsUnknown(t)?J.True:J.False}s(fre,"FromUnknown");function mre(e,t){return B.IsUndefined(e)||B.IsUndefined(e)?J.True:J.False}s(mre,"FromVoidRight");function hre(e,t){return B.IsIntersect(t)?Q0(e,t):B.IsUnion(t)?AT(e,t):B.IsUnknown(t)?qR(e,t):B.IsAny(t)?kT(e,t):B.IsObject(t)?Mn(e,t):B.IsVoid(t)?J.True:J.False}s(hre,"FromVoid");function jt(e,t){return B.IsTemplateLiteral(e)||B.IsTemplateLiteral(t)?sre(e,t):B.IsRegExp(e)||B.IsRegExp(t)?nre(e,t):B.IsNot(e)||B.IsNot(t)?Hte(e,t):B.IsAny(e)?kte(e,t):B.IsArray(e)?Dte(e,t):B.IsBigInt(e)?Lte(e,t):B.IsBoolean(e)?Rte(e,t):B.IsAsyncIterator(e)?Fte(e,t):B.IsConstructor(e)?Nte(e,t):B.IsDate(e)?Bte(e,t):B.IsFunction(e)?$te(e,t):B.IsInteger(e)?jte(e,t):B.IsIntersect(e)?Gte(e,t):B.IsIterator(e)?Ute(e,t):B.IsLiteral(e)?Vte(e,t):B.IsNever(e)?zte(e,t):B.IsNull(e)?Wte(e,t):B.IsNumber(e)?qte(e,t):B.IsObject(e)?ere(e,t):B.IsRecord(e)?rre(e,t):B.IsString(e)?ore(e,t):B.IsSymbol(e)?ire(e,t):B.IsTuple(e)?cre(e,t):B.IsPromise(e)?tre(e,t):B.IsUint8Array(e)?pre(e,t):B.IsUndefined(e)?ure(e,t):B.IsUnion(e)?dre(e,t):B.IsUnknown(e)?fre(e,t):B.IsVoid(e)?hre(e,t):If("Unknown left type operand '".concat(e[Z],"'"))}s(jt,"Visit");function hc(e,t){return jt(e,t)}s(hc,"ExtendsCheck");f();f();f();function yre(e,t,r,n,o){let i={};for(let a of globalThis.Object.getOwnPropertyNames(e))i[a]=Sf(e[a],t,r,n,nr(o));return i}s(yre,"FromProperties");function gre(e,t,r,n,o){return yre(e.properties,t,r,n,o)}s(gre,"FromMappedResult");function ZR(e,t,r,n,o){let i=gre(e,t,r,n,o);return St(i)}s(ZR,"ExtendsFromMappedResult");function bre(e,t,r,n){let o=hc(e,t);return o===J.Union?$t([r,n]):o===J.True?r:n}s(bre,"ExtendsResolve");function Sf(e,t,r,n,o){return sr(e)?ZR(e,t,r,n,o):Mo(e)?ee(XR(e,t,r,n,o)):ee(bre(e,t,r,n),o)}s(Sf,"Extends");function xre(e,t,r,n,o){return{[e]:Sf(Dt(e),t,r,n,nr(o))}}s(xre,"FromPropertyKey");function vre(e,t,r,n,o){return e.reduce((i,a)=>P(P({},i),xre(a,t,r,n,o)),{})}s(vre,"FromPropertyKeys");function Ire(e,t,r,n,o){return vre(e.keys,t,r,n,o)}s(Ire,"FromMappedKey");function XR(e,t,r,n,o){let i=Ire(e,t,r,n,o);return St(i)}s(XR,"ExtendsFromMappedKey");f();function Sre(e){return e.allOf.every(t=>Xa(t))}s(Sre,"Intersect");function Cre(e){return e.anyOf.some(t=>Xa(t))}s(Cre,"Union");function Tre(e){return!Xa(e.not)}s(Tre,"Not");function Xa(e){return e[Z]==="Intersect"?Sre(e):e[Z]==="Union"?Cre(e):e[Z]==="Not"?Tre(e):e[Z]==="Undefined"}s(Xa,"ExtendsUndefinedCheck");f();function YR(e,t){return Cf(Bp(e),t)}s(YR,"ExcludeFromTemplateLiteral");function Pre(e,t){let r=e.filter(n=>hc(n,t)===J.False);return r.length===1?r[0]:$t(r)}s(Pre,"ExcludeRest");function Cf(e,t,r={}){return Oo(e)?ee(YR(e,t),r):sr(e)?ee(KR(e,t),r):ee(kt(e)?Pre(e.anyOf,t):hc(e,t)!==J.False?Bt():e,r)}s(Cf,"Exclude");function wre(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Cf(e[n],t);return r}s(wre,"FromProperties");function Mre(e,t){return wre(e.properties,t)}s(Mre,"FromMappedResult");function KR(e,t){let r=Mre(e,t);return St(r)}s(KR,"ExcludeFromMappedResult");f();f();f();function JR(e,t){return Tf(Bp(e),t)}s(JR,"ExtractFromTemplateLiteral");function Ore(e,t){let r=e.filter(n=>hc(n,t)!==J.False);return r.length===1?r[0]:$t(r)}s(Ore,"ExtractRest");function Tf(e,t,r){return Oo(e)?ee(JR(e,t),r):sr(e)?ee(QR(e,t),r):ee(kt(e)?Ore(e.anyOf,t):hc(e,t)!==J.False?e:Bt(),r)}s(Tf,"Extract");function Ere(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Tf(e[n],t);return r}s(Ere,"FromProperties");function _re(e,t){return Ere(e.properties,t)}s(_re,"FromMappedResult");function QR(e,t){let r=_re(e,t);return St(r)}s(QR,"ExtractFromMappedResult");f();function eN(e,t){return ee(e.returns,t)}s(eN,"InstanceType");f();function tN(e){return ee({[Z]:"Integer",type:"integer"},e)}s(tN,"Integer");f();f();f();function kre(e,t,r){return{[e]:Gi(Dt(e),t,nr(r))}}s(kre,"MappedIntrinsicPropertyKey");function Are(e,t,r){return e.reduce((o,i)=>P(P({},o),kre(i,t,r)),{})}s(Are,"MappedIntrinsicPropertyKeys");function Dre(e,t,r){return Are(e.keys,t,r)}s(Dre,"MappedIntrinsicProperties");function rN(e,t,r){let n=Dre(e,t,r);return St(n)}s(rN,"IntrinsicFromMappedKey");function Fre(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}s(Fre,"ApplyUncapitalize");function Lre(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}s(Lre,"ApplyCapitalize");function Rre(e){return e.toUpperCase()}s(Rre,"ApplyUppercase");function Nre(e){return e.toLowerCase()}s(Nre,"ApplyLowercase");function Bre(e,t,r){let n=gf(e.pattern);if(!Np(n))return R(P({},e),{pattern:nN(e.pattern,t)});let a=[...$y(n)].map(u=>Dt(u)),l=oN(a,t),c=$t(l);return U0([c],r)}s(Bre,"FromTemplateLiteral");function nN(e,t){return typeof e=="string"?t==="Uncapitalize"?Fre(e):t==="Capitalize"?Lre(e):t==="Uppercase"?Rre(e):t==="Lowercase"?Nre(e):e:e.toString()}s(nN,"FromLiteralValue");function oN(e,t){return e.map(r=>Gi(r,t))}s(oN,"FromRest");function Gi(e,t,r={}){return Mo(e)?rN(e,t,r):Oo(e)?Bre(e,t,r):kt(e)?$t(oN(e.anyOf,t),r):Va(e)?Dt(nN(e.const,t),r):ee(e,r)}s(Gi,"Intrinsic");function iN(e,t={}){return Gi(e,"Capitalize",t)}s(iN,"Capitalize");f();function sN(e,t={}){return Gi(e,"Lowercase",t)}s(sN,"Lowercase");f();function aN(e,t={}){return Gi(e,"Uncapitalize",t)}s(aN,"Uncapitalize");f();function lN(e,t={}){return Gi(e,"Uppercase",t)}s(lN,"Uppercase");f();function cN(e,t){return ee({[Z]:"Not",not:e},t)}s(cN,"Not");f();f();f();function $re(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Pf(e[o],t,nr(r));return n}s($re,"FromProperties");function jre(e,t,r){return $re(e.properties,t,r)}s(jre,"FromMappedResult");function pN(e,t,r){let n=jre(e,t,r);return St(n)}s(pN,"OmitFromMappedResult");function Gre(e,t){return e.map(r=>FT(r,t))}s(Gre,"FromIntersect");function Ure(e,t){return e.map(r=>FT(r,t))}s(Ure,"FromUnion");function Vre(e,t){let o=e,{[t]:r}=o;return $n(o,[wb(t)])}s(Vre,"FromProperty");function zre(e,t){return t.reduce((r,n)=>Vre(r,n),e)}s(zre,"FromProperties");function Hre(e,t){let r=Cr(e,[or,"$id","required","properties"]),n=zre(e.properties,t);return zt(n,r)}s(Hre,"FromObject");function FT(e,t){return _r(e)?mo(Gre(e.allOf,t)):kt(e)?$t(Ure(e.anyOf,t)):Ur(e)?Hre(e,t):zt({})}s(FT,"OmitResolve");function Pf(e,t,r){if(Mo(t))return uN(e,t,r);if(sr(e))return pN(e,t,r);let n=$i(t)?fo(t):t;return ee(P(P({},FT(e,n)),r))}s(Pf,"Omit");function Wre(e,t,r){return{[t]:Pf(e,[t],nr(r))}}s(Wre,"FromPropertyKey");function qre(e,t,r){return t.reduce((n,o)=>P(P({},n),Wre(e,o,r)),{})}s(qre,"FromPropertyKeys");function Zre(e,t,r){return qre(e,t.keys,r)}s(Zre,"FromMappedKey");function uN(e,t,r){let n=Zre(e,t,r);return St(n)}s(uN,"OmitFromMappedKey");f();function dN(e,t){return Ls(e.parameters,t)}s(dN,"Parameters");f();f();function fN(e){return e.map(t=>mN(t))}s(fN,"FromRest");function Xre(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=uo(e[r]);return t}s(Xre,"FromProperties");function Yre(e){let t=Cr(e,[or,"$id","required","properties"]),r=Xre(e.properties);return zt(r,t)}s(Yre,"FromObject");function mN(e){return _r(e)?mo(fN(e.allOf)):kt(e)?$t(fN(e.anyOf)):Ur(e)?Yre(e):zt({})}s(mN,"PartialResolve");function tx(e,t){return sr(e)?hN(e,t):ee(P(P({},mN(e)),t))}s(tx,"Partial");function Kre(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=tx(e[n],nr(t));return r}s(Kre,"FromProperties");function Jre(e,t){return Kre(e.properties,t)}s(Jre,"FromMappedResult");function hN(e,t){let r=Jre(e,t);return St(r)}s(hN,"PartialFromMappedResult");f();f();f();function Qre(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=wf(e[o],t,nr(r));return n}s(Qre,"FromProperties");function ene(e,t,r){return Qre(e.properties,t,r)}s(ene,"FromMappedResult");function yN(e,t,r){let n=ene(e,t,r);return St(n)}s(yN,"PickFromMappedResult");function tne(e,t){return e.map(r=>LT(r,t))}s(tne,"FromIntersect");function rne(e,t){return e.map(r=>LT(r,t))}s(rne,"FromUnion");function nne(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}s(nne,"FromProperties");function one(e,t){let r=Cr(e,[or,"$id","required","properties"]),n=nne(e.properties,t);return zt(n,r)}s(one,"FromObject");function LT(e,t){return _r(e)?mo(tne(e.allOf,t)):kt(e)?$t(rne(e.anyOf,t)):Ur(e)?one(e,t):zt({})}s(LT,"PickResolve");function wf(e,t,r){if(Mo(t))return gN(e,t,r);if(sr(e))return yN(e,t,r);let n=$i(t)?fo(t):t;return ee(P(P({},LT(e,n)),r))}s(wf,"Pick");function ine(e,t,r){return{[t]:wf(e,[t],nr(r))}}s(ine,"FromPropertyKey");function sne(e,t,r){return t.reduce((n,o)=>P(P({},n),ine(e,o,r)),{})}s(sne,"FromPropertyKeys");function ane(e,t,r){return sne(e,t.keys,r)}s(ane,"FromMappedKey");function gN(e,t,r){let n=ane(e,t,r);return St(n)}s(gN,"PickFromMappedKey");f();function bN(e){return ei(uo(e))}s(bN,"ReadonlyOptional");f();function $p(e,t,r){return ee({[Z]:"Record",type:"object",patternProperties:{[e]:t}},r)}s($p,"RecordCreateFromPattern");function RT(e,t,r){let n={};for(let o of e)n[o]=t;return zt(n,R(P({},r),{[Jo]:"Record"}))}s(RT,"RecordCreateFromKeys");function lne(e,t,r){return j0(e)?RT(fo(e),t,r):$p(e.pattern,t,r)}s(lne,"FromTemplateLiteralKey");function cne(e,t,r){return RT(fo($t(e)),t,r)}s(cne,"FromUnionKey");function pne(e,t,r){return RT([e.toString()],t,r)}s(pne,"FromLiteralKey");function une(e,t,r){return $p(e.source,t,r)}s(une,"FromRegExpKey");function dne(e,t,r){let n=gr(e.pattern)?Ha:e.pattern;return $p(n,t,r)}s(dne,"FromStringKey");function fne(e,t,r){return $p(Ha,t,r)}s(fne,"FromAnyKey");function mne(e,t,r){return $p(cR,t,r)}s(mne,"FromNeverKey");function hne(e,t,r){return $p(za,t,r)}s(hne,"FromIntegerKey");function yne(e,t,r){return $p(za,t,r)}s(yne,"FromNumberKey");function xN(e,t,r={}){return kt(e)?cne(e.anyOf,t,r):Oo(e)?lne(e,t,r):Va(e)?pne(e.const,t,r):Fp(e)?hne(e,t,r):Lp(e)?yne(e,t,r):iT(e)?une(e,t,r):Dy(e)?dne(e,t,r):eT(e)?fne(e,t,r):pc(e)?mne(e,t,r):Bt(r)}s(xN,"Record");f();var gne=0;function vN(e,t={}){gr(t.$id)&&(t.$id="T".concat(gne++));let r=My(e({[Z]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,ee(P({[Jo]:"Recursive"},r),t)}s(vN,"Recursive");f();function IN(e,t){if(Kt(e))return ee({[Z]:"Ref",$ref:e},t);if(gr(e.$id))throw new Error("Reference target type must specify an $id");return ee({[Z]:"Ref",$ref:e.$id},t)}s(IN,"Ref");f();function SN(e,t){let r=Kt(e)?new globalThis.RegExp(e):e;return ee({[Z]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}s(SN,"RegExp");f();f();function CN(e){return e.map(t=>TN(t))}s(CN,"FromRest");function bne(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Cr(e[r],[Wn]);return t}s(bne,"FromProperties");function xne(e){let t=Cr(e,[or,"$id","required","properties"]),r=bne(e.properties);return zt(r,t)}s(xne,"FromObject");function TN(e){return _r(e)?mo(CN(e.allOf)):kt(e)?$t(CN(e.anyOf)):Ur(e)?xne(e):zt({})}s(TN,"RequiredResolve");function rx(e,t){return sr(e)?PN(e,t):ee(P(P({},TN(e)),t))}s(rx,"Required");function vne(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=rx(e[n],t);return r}s(vne,"FromProperties");function Ine(e,t){return vne(e.properties,t)}s(Ine,"FromMappedResult");function PN(e,t){let r=Ine(e,t);return St(r)}s(PN,"RequiredFromMappedResult");f();function Sne(e){var t;return _r(e)?e.allOf:kt(e)?e.anyOf:Bi(e)?(t=e.items)!=null?t:[]:[]}s(Sne,"RestResolve");function wN(e){return Sne(e)}s(wN,"Rest");f();function MN(e,t){return ee(e.returns,t)}s(MN,"ReturnType");f();function ON(e){return JSON.parse(JSON.stringify(e))}s(ON,"Strict");f();var $T=class $T{constructor(t){this.schema=t}Decode(t){return new BT(this.schema,t)}};s($T,"TransformDecodeBuilder");var NT=$T,jT=class jT{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let i={Encode:s(a=>r[or].Encode(t(a)),"Encode"),Decode:s(a=>this.decode(r[or].Decode(a)),"Decode")};return R(P({},r),{[or]:i})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return R(P({},r),{[or]:n})}Encode(t){return df(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};s(jT,"TransformEncodeBuilder");var BT=jT;function EN(e){return new NT(e)}s(EN,"Transform");f();function nx(e={}){var t;return ee({[Z]:(t=e[Z])!=null?t:"Unsafe"},e)}s(nx,"Unsafe");f();function _N(e){return ee({[Z]:"Void",type:"void"},e)}s(_N,"Void");f();var GT={};cs(GT,{Any:()=>dc,Array:()=>R0,AsyncIterator:()=>N0,Awaited:()=>_R,BigInt:()=>xf,Boolean:()=>G0,Capitalize:()=>iN,Composite:()=>DR,Const:()=>FR,Constructor:()=>B0,ConstructorParameters:()=>LR,Date:()=>q0,Deref:()=>ji,Enum:()=>RR,Exclude:()=>Cf,Extends:()=>Sf,Extract:()=>Tf,Function:()=>fc,Index:()=>vf,InstanceType:()=>eN,Integer:()=>tN,Intersect:()=>mo,Iterator:()=>z0,KeyOf:()=>W0,Literal:()=>Dt,Lowercase:()=>sN,Mapped:()=>wR,Never:()=>Bt,Not:()=>cN,Null:()=>Z0,Number:()=>Fs,Object:()=>zt,Omit:()=>Pf,Optional:()=>uo,Parameters:()=>dN,Partial:()=>tx,Pick:()=>wf,Promise:()=>H0,Readonly:()=>ei,ReadonlyOptional:()=>bN,Record:()=>xN,Recursive:()=>vN,Ref:()=>IN,RegExp:()=>SN,Required:()=>rx,Rest:()=>wN,ReturnType:()=>MN,Strict:()=>ON,String:()=>Qo,Symbol:()=>X0,TemplateLiteral:()=>U0,Transform:()=>EN,Tuple:()=>Ls,Uint8Array:()=>K0,Uncapitalize:()=>aN,Undefined:()=>Y0,Union:()=>$t,Unknown:()=>Za,Unsafe:()=>nx,Uppercase:()=>lN,Void:()=>_N});f();var C=GT;var dr=s((e,t)=>C.Unsafe(C.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),On=dr("g","GeometryId"),Ct=dr("f","FloorId"),UT=[On,Ct];f();f();var zy=C.Object({externalId:C.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:C.String({description:"The name of the entity."}),shortName:C.String({description:"A short name for the entity."}),description:C.String({description:"A description of the entity."}),icon:C.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),VT=C.Partial(zy,{$id:"Details",description:"Additional information about a given entity."}),Ui=C.Object({details:C.Optional(C.Ref(VT))},{$id:"WithDetails"}),jp=s(e=>{let t=[...e].sort(),r=C.Pick(zy,e),n=C.Omit(zy,e);return C.Object({details:C.Intersect([r,C.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),zT=[zy,VT];f();f();var HT=C.Record(C.String(),C.Unknown(),{$id:"Extra"}),Vi=C.Object({extra:C.Optional(C.Ref(HT))}),WT=[HT];f();f();var Mf=C.Object({geometryId:C.Ref(On),floorId:C.Ref(Ct)},{$id:"GeometryAnchor"}),Cne=C.Object({geometryAnchor:C.Ref(Mf)}),Gp=s((e,t)=>C.Object({geometryAnchors:C.Array(C.Ref(Mf),e)},t),"WithGeometryAnchors"),qT=[Mf];f();f();f();f();f();var Of=C.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),Ef=C.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Up=C.Tuple([C.Ref(Of),C.Ref(Ef)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),En=C.Object({type:C.Literal("Point"),coordinates:C.Ref(Up)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),ox=C.Object({type:C.Literal("MultiPoint"),coordinates:C.Array(C.Ref(Up))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),ix=C.Object({type:C.Literal("LineString"),coordinates:C.Array(C.Ref(Up),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),sx=C.Object({type:C.Literal("MultiLineString"),coordinates:C.Array(C.Array(C.Ref(Up),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),kN=C.Array(C.Ref(Up),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),ZT=C.Array(C.Ref(kN),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),_f=C.Object({type:C.Literal("Polygon"),coordinates:C.Ref(ZT)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),kf=C.Object({type:C.Literal("MultiPolygon"),coordinates:C.Array(C.Ref(ZT))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),cn=s((e,t,r)=>C.Object({type:C.Literal("Feature"),geometry:e,properties:t},r),"Feature"),Zn=s((e,t,r)=>C.Object({type:C.Literal("FeatureCollection"),features:C.Array(e,r)},t),"FeatureCollection"),XT=[Of,Ef,Up,En,ox,ix,sx,kN,ZT,_f,kf];var AN=C.Intersect([C.Object({id:C.Ref(Ct),elevation:C.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:C.Optional(C.String({description:"The subtitle of the floor."}))}),Ui],{$id:"FloorProperties"}),DN=cn(C.Union([C.Ref(_f),C.Ref(kf),C.Null()]),C.Ref(AN),{$id:"FloorFeature"}),FN=Zn(C.Ref(DN),{$id:"FloorCollection"}),Tne=C.Object({floors:C.Ref(FN)}),LN={name:"core:floors",intoBundle:s(function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},"fromBundle"),schema:Tne,references:[AN,DN,FN]};f();f();f();var YT=class YT{constructor(t){m(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};s(YT,"OptionIterator");var ax=YT,KT=class KT{constructor(t){m(this,"_tag","Some");m(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return RN(t(this.value))}mapAsync(t){return t(this.value).then(r=>RN(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:yc()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?yc():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return be(this.value)}okOrElse(t){return be(this.value)}iter(){return new ax(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?Af([this.value,t.value]):yc()}zipWith(t,r){return t.isSome()?Af(r(this.value,t.value)):yc()}get[Symbol.toStringTag](){return"Some"}};s(KT,"Some");var lx=KT,JT=class JT{constructor(){m(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return Ie(t)}okOrElse(t){return Ie(t())}iter(){return new ax(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};s(JT,"None");var cx=JT,Af=s(e=>new lx(e),"some"),yc=s(()=>new cx,"none"),RN=s(e=>e instanceof lx||e instanceof cx?e:e==null?yc():Af(e),"option");var tP=class tP{constructor(t){m(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};s(tP,"ResultIterator");var px=tP,rP=class rP{constructor(t){m(this,"_tag","Ok");m(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return Af(this.value)}err(){return yc()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return be(t(this.value))}async mapAsync(t){return t(this.value).then(be)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new px(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};s(rP,"Ok");var QT=rP,ux=class ux{constructor(t){m(this,"_tag","Err");m(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return yc()}err(){return Af(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new px(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new ux(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};s(ux,"Err");var eP=ux,be=s(e=>new QT(e),"ok"),Ie=s(e=>new eP(e),"err");f();var Rs;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Rs||(Rs={}));var Pne=s(e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},"createFloorMap"),Ya=s(e=>{let t=Pne(e);return s(n=>{let o=t.get(n);return o==null?Ie({kind:Rs.UnknownFloorError,properties:{floorId:n}}):be(o)},"floorLookup")},"createFloorLookup");f();f();f();f();var Tr=s(e=>C.Unsafe(e),"PartialRecord");f();var bt=s(e=>Object.keys(e),"typedKeys");f();var NN=s(e=>{if(e.floors==null)return Ie({kind:Rs.FloorMissingError,properties:null});if(e.geometry==null)return Ie({kind:Rs.GeometryMissingError,properties:null});let t=Ya(e);for(let r of bt(e.geometry)){let n=t(r);if(n.isErr())return n}return be(!0)},"validateGeometry");var BN=C.Intersect([C.Object({id:C.Ref(On)}),Ui],{$id:"GeometryProperties"}),$N=cn(C.Union([C.Ref(En),C.Ref(ox),C.Ref(ix),C.Ref(sx),C.Ref(_f),C.Ref(kf)]),C.Ref(BN),{$id:"GeometryFeature"}),jN=Zn(C.Ref($N),{$id:"GeometryCollection"}),wne=C.Object({geometry:Tr(C.Record(Ct,C.Ref(jN),{additionalProperties:!1}))},{$id:"GeometrySchema"}),Mne=/^geometry\/(.*)\.geojson$/,GN={name:"core:geometry",schema:wne,intoBundle:s(function*(e){if(e.geometry!=null)for(let t of bt(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Mne))==null?void 0:o[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[BN,$N,jN],integrityCheck:NN};f();f();var Tt=s(e=>Object.entries(e),"typedEntries");var One=s(e=>{var r;let t=new Map;for(let[n,o]of Tt((r=e.geometry)!=null?r:{}))t.set(n,new Map(o==null?void 0:o.features.map(i=>[i.properties.id,i])));return t},"createLookupMap"),zr=s(e=>{let t=One(e);return s((n,o)=>{let i=t.get(n);if(i==null)return Ie({kind:Rs.UnknownFloorError,properties:{floorId:n}});let a=i.get(o);return a==null?Ie({kind:Rs.UnknownGeometryError,properties:{floorId:n,geometryId:o}}):be(a)},"geometryLookup")},"createGeometryLookup");f();var nP=C.Object({type:C.Literal("file"),name:C.String({description:"The name of the file."})},{$id:"ManifestFile"}),UN=C.Recursive(e=>C.Object({type:C.Literal("folder"),name:C.String({description:"The name of the folder."}),children:C.Array(C.Union([e,C.Ref(nP)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),VN=C.Object({name:C.String({description:"The name of the map."}),version:C.Literal("3.0.0",{description:"The version of the manifest."}),orgId:C.Optional(C.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:C.Optional(C.String({description:"The identifier of the map that this MVF is for."})),contents:C.Array(C.Union([C.Ref(UN),C.Ref(nP)]),{minItems:1,description:"The contents of the MVF bundle."}),time:C.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:C.Optional(C.Unsafe(C.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:C.Optional(C.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:C.Optional(C.Ref(Ct,{description:"The default floor ID of the map."})),language:C.Optional(C.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),zN=Zn(cn(En,C.Ref(VN)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),Ene=C.Object({manifest:C.Ref(zN)}),HN={name:"core:manifest",intoBundle:s(function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},"fromBundle"),schema:Ene,references:[nP,UN,VN,zN]};var oi=C.Object({geometryId:C.Ref(On)},{$id:"WithGeometryId"}),dx=C.Object({geometryIds:C.Array(C.Ref(On))},{$id:"WithGeometryIds"}),oP=[oi,dx];f();f();var WN=s((e,t)=>C.Unsafe(C.Transform(C.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),yo=s((e,t)=>{let r=WN(e,t),n=[...e,"unknown"],o=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:r,values:n,record:o}},"SafeStringEnum");f();f();f();var Hy;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(Hy||(Hy={}));var qN=s(e=>{var n;if(e.annotations==null)return be(!0);let t=zr(e),r=new Set(bt((n=e.annotationSymbols)!=null?n:{}));for(let o of bt(e.annotations)){let i=e.annotations[o];if(i!=null)for(let a of i){if(!r.has(a.symbolKey))return Ie({kind:Hy.AnnotationUnknownSymbolError,properties:{annotationId:a.id,symbolKey:a.symbolKey}});let l=t(o,a.geometryId);if(l.isErr())return l;if(l.value.geometry.type!=="Point")return Ie({kind:Hy.AnnotationNonPointGeometryError,properties:{annotationId:a.id,floorId:o,geometryId:a.geometryId}})}}return be(!0)},"validateAnnotations");var ZN=dr("a","AnnotationId"),iP=C.Intersect([oi,C.Object({id:C.Ref(ZN,{description:"The unique identifier for the annotation."}),externalId:C.Optional(C.String({description:"The external identifier for the annotation."})),symbolKey:C.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),XN=C.Object({url:C.String({format:"uri",description:"The URL for the symbol."}),name:C.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),_ne=C.Object({annotations:Tr(C.Record(Ct,C.Array(C.Ref(iP)),{additionalProperties:!1})),annotationSymbols:Tr(C.Record(C.Index(iP,["symbolKey"]),C.Ref(XN)))},{$id:"AnnotationsSchema"}),kne=/^annotations\/(.*)\.json$/,YN={name:"ext:mvf-annotations",schema:_ne,intoBundle:s(function*(e){if(e.annotations!=null)for(let t of bt(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},"intoBundle"),fromBundle:s((e,t,r)=>{var o;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(o=e.match(kne))==null?void 0:o[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[ZN,iP,XN],integrityCheck:qN};f();f();f();f();f();f();f();f();var aP=class aP extends Fe{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};s(aP,"TypeSystemDuplicateTypeKind");var sP=aP,lP=class lP extends Fe{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};s(lP,"TypeSystemDuplicateFormat");var Wy=lP,fx;(function(e){function t(n,o){if(Vr.Has(n))throw new sP(n);return Vr.Set(n,o),(i={})=>nx(R(P({},i),{[Z]:n}))}s(t,"Type"),e.Type=t;function r(n,o){if(qn.Has(n))throw new Wy(n);return qn.Set(n,o),n}s(r,"Format"),e.Format=r})(fx||(fx={}));f();f();f();function Ane(e){switch(e.errorType){case X.ArrayContains:return"Expected array to contain at least one matching value";case X.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case X.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case X.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case X.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case X.ArrayUniqueItems:return"Expected array elements to be unique";case X.Array:return"Expected array";case X.AsyncIterator:return"Expected AsyncIterator";case X.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case X.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case X.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case X.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case X.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case X.BigInt:return"Expected bigint";case X.Boolean:return"Expected boolean";case X.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case X.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case X.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case X.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case X.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case X.Date:return"Expected Date";case X.Function:return"Expected function";case X.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case X.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case X.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case X.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case X.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case X.Integer:return"Expected integer";case X.IntersectUnevaluatedProperties:return"Unexpected property";case X.Intersect:return"Expected all values to match";case X.Iterator:return"Expected Iterator";case X.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case X.Never:return"Never";case X.Not:return"Value should not match";case X.Null:return"Expected null";case X.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case X.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case X.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case X.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case X.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case X.Number:return"Expected number";case X.Object:return"Expected object";case X.ObjectAdditionalProperties:return"Unexpected property";case X.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case X.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case X.ObjectRequiredProperty:return"Expected required property";case X.Promise:return"Expected Promise";case X.RegExp:return"Expected string to match regular expression";case X.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case X.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case X.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case X.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case X.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case X.String:return"Expected string";case X.Symbol:return"Expected symbol";case X.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case X.Tuple:return"Expected tuple";case X.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case X.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case X.Uint8Array:return"Expected Uint8Array";case X.Undefined:return"Expected undefined";case X.Union:return"Expected union value";case X.Void:return"Expected void";case X.Kind:return"Expected kind '".concat(e.schema[Z],"'");default:return"Unknown error type"}}s(Ane,"DefaultErrorFunction");var Dne=Ane;function KN(){return Dne}s(KN,"GetErrorFunction");f();var pP=class pP extends Fe{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};s(pP,"TypeDereferenceError");var cP=pP;function Fne(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new cP(e);return Pt(r,t)}s(Fne,"Resolve");function ii(e,t){return!ht(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}s(ii,"Pushref");function Pt(e,t){return e[Z]==="This"||e[Z]==="Ref"?Fne(e,t):e}s(Pt,"Deref");f();var dP=class dP extends Fe{constructor(t){super("Unable to hash value"),this.value=t}};s(dP,"ValueHashError");var uP=dP,Eo;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Eo||(Eo={}));var Df=BigInt("14695981039346656037"),[Lne,Rne]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Nne=Array.from({length:256}).map((e,t)=>BigInt(t)),JN=new Float64Array(1),QN=new DataView(JN.buffer),eB=new Uint8Array(JN.buffer);function*Bne(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}s(Bne,"NumberToBytes");function $ne(e){_n(Eo.Array);for(let t of e)Ff(t)}s($ne,"ArrayType");function jne(e){_n(Eo.Boolean),_n(e?1:0)}s(jne,"BooleanType");function Gne(e){_n(Eo.BigInt),QN.setBigInt64(0,e);for(let t of eB)_n(t)}s(Gne,"BigIntType");function Une(e){_n(Eo.Date),Ff(e.getTime())}s(Une,"DateType");function Vne(e){_n(Eo.Null)}s(Vne,"NullType");function zne(e){_n(Eo.Number),QN.setFloat64(0,e);for(let t of eB)_n(t)}s(zne,"NumberType");function Hne(e){_n(Eo.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Ff(t),Ff(e[t])}s(Hne,"ObjectType");function Wne(e){_n(Eo.String);for(let t=0;t<e.length;t++)for(let r of Bne(e.charCodeAt(t)))_n(r)}s(Wne,"StringType");function qne(e){_n(Eo.Symbol),Ff(e.description)}s(qne,"SymbolType");function Zne(e){_n(Eo.Uint8Array);for(let t=0;t<e.length;t++)_n(e[t])}s(Zne,"Uint8ArrayType");function Xne(e){return _n(Eo.Undefined)}s(Xne,"UndefinedType");function Ff(e){if(He(e))return $ne(e);if(ks(e))return jne(e);if(an(e))return Gne(e);if(Hn(e))return Une(e);if($a(e))return Vne(e);if(ke(e))return zne(e);if(Ze(e))return Hne(e);if(ht(e))return Wne(e);if(ja(e))return qne(e);if(uf(e))return Zne(e);if(br(e))return Xne(e);throw new uP(e)}s(Ff,"Visit");function _n(e){Df=Df^Nne[e],Df=Df*Lne%Rne}s(_n,"FNV1A64");function gc(e){return Df=BigInt("14695981039346656037"),Ff(e),Df}s(gc,"Hash");f();var mP=class mP extends Fe{constructor(t){super("Unknown type"),this.schema=t}};s(mP,"ValueCheckUnknownTypeError");var fP=mP;function Yne(e){return e[Z]==="Any"||e[Z]==="Unknown"}s(Yne,"IsAnyOrUnknown");function lt(e){return e!==void 0}s(lt,"IsDefined");function Kne(e,t,r){return!0}s(Kne,"FromAny");function Jne(e,t,r){if(!He(r)||lt(e.minItems)&&!(r.length>=e.minItems)||lt(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>pn(e.items,t,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let a of r){let l=gc(a);if(i.has(l))return!1;i.add(l)}return!0}())return!1;if(!(lt(e.contains)||ke(e.minContains)||ke(e.maxContains)))return!0;let n=lt(e.contains)?e.contains:Bt(),o=r.reduce((i,a)=>pn(n,t,a)?i+1:i,0);return!(o===0||ke(e.minContains)&&o<e.minContains||ke(e.maxContains)&&o>e.maxContains)}s(Jne,"FromArray");function Qne(e,t,r){return A0(r)}s(Qne,"FromAsyncIterator");function eoe(e,t,r){return!(!an(r)||lt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||lt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||lt(e.maximum)&&!(r<=e.maximum)||lt(e.minimum)&&!(r>=e.minimum)||lt(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}s(eoe,"FromBigInt");function toe(e,t,r){return ks(r)}s(toe,"FromBoolean");function roe(e,t,r){return pn(e.returns,t,r.prototype)}s(roe,"FromConstructor");function noe(e,t,r){return!(!Hn(r)||lt(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||lt(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||lt(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||lt(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||lt(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}s(noe,"FromDate");function ooe(e,t,r){return cc(r)}s(ooe,"FromFunction");function ioe(e,t,r){return!(!L0(r)||lt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||lt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||lt(e.maximum)&&!(r<=e.maximum)||lt(e.minimum)&&!(r>=e.minimum)||lt(e.multipleOf)&&r%e.multipleOf!==0)}s(ioe,"FromInteger");function soe(e,t,r){let n=e.allOf.every(o=>pn(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(qa(e)),i=Object.getOwnPropertyNames(r).every(a=>o.test(a));return n&&i}else if(yt(e.unevaluatedProperties)){let o=new RegExp(qa(e)),i=Object.getOwnPropertyNames(r).every(a=>o.test(a)||pn(e.unevaluatedProperties,t,r[a]));return n&&i}else return n}s(soe,"FromIntersect");function aoe(e,t,r){return D0(r)}s(aoe,"FromIterator");function loe(e,t,r){return r===e.const}s(loe,"FromLiteral");function coe(e,t,r){return!1}s(coe,"FromNever");function poe(e,t,r){return!pn(e.not,t,r)}s(poe,"FromNot");function uoe(e,t,r){return $a(r)}s(uoe,"FromNull");function doe(e,t,r){return!(!Lt.IsNumberLike(r)||lt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||lt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||lt(e.minimum)&&!(r>=e.minimum)||lt(e.maximum)&&!(r<=e.maximum)||lt(e.multipleOf)&&r%e.multipleOf!==0)}s(doe,"FromNumber");function foe(e,t,r){if(!Lt.IsObjectLike(r)||lt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||lt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let o of n){let i=e.properties[o];if(e.required&&e.required.includes(o)){if(!pn(i,t,r[o])||(Xa(i)||Yne(i))&&!(o in r))return!1}else if(Lt.IsExactOptionalProperty(r,o)&&!pn(i,t,r[o]))return!1}if(e.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&o.length===n.length?!0:o.every(i=>n.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(i=>n.includes(i)||pn(e.additionalProperties,t,r[i])):!0}s(foe,"FromObject");function moe(e,t,r){return F0(r)}s(moe,"FromPromise");function hoe(e,t,r){if(!Lt.IsRecordLike(r)||lt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||lt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),a=Object.entries(r).every(([u,d])=>i.test(u)?pn(o,t,d):!0),l=typeof e.additionalProperties=="object"?Object.entries(r).every(([u,d])=>i.test(u)?!0:pn(e.additionalProperties,t,d)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(u=>i.test(u)):!0;return a&&l&&c}s(hoe,"FromRecord");function yoe(e,t,r){return pn(Pt(e,t),t,r)}s(yoe,"FromRef");function goe(e,t,r){let n=new RegExp(e.source,e.flags);return lt(e.minLength)&&!(r.length>=e.minLength)||lt(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}s(goe,"FromRegExp");function boe(e,t,r){return!ht(r)||lt(e.minLength)&&!(r.length>=e.minLength)||lt(e.maxLength)&&!(r.length<=e.maxLength)||lt(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:lt(e.format)?qn.Has(e.format)?qn.Get(e.format)(r):!1:!0}s(boe,"FromString");function xoe(e,t,r){return ja(r)}s(xoe,"FromSymbol");function voe(e,t,r){return ht(r)&&new RegExp(e.pattern).test(r)}s(voe,"FromTemplateLiteral");function Ioe(e,t,r){return pn(Pt(e,t),t,r)}s(Ioe,"FromThis");function Soe(e,t,r){if(!He(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!pn(e.items[n],t,r[n]))return!1;return!0}s(Soe,"FromTuple");function Coe(e,t,r){return br(r)}s(Coe,"FromUndefined");function Toe(e,t,r){return e.anyOf.some(n=>pn(n,t,r))}s(Toe,"FromUnion");function Poe(e,t,r){return!(!uf(r)||lt(e.maxByteLength)&&!(r.length<=e.maxByteLength)||lt(e.minByteLength)&&!(r.length>=e.minByteLength))}s(Poe,"FromUint8Array");function woe(e,t,r){return!0}s(woe,"FromUnknown");function Moe(e,t,r){return Lt.IsVoidLike(r)}s(Moe,"FromVoid");function Ooe(e,t,r){return Vr.Has(e[Z])?Vr.Get(e[Z])(e,r):!1}s(Ooe,"FromKind");function pn(e,t,r){let n=lt(e.$id)?[...t,e]:t,o=e;switch(o[Z]){case"Any":return Kne(o,n,r);case"Array":return Jne(o,n,r);case"AsyncIterator":return Qne(o,n,r);case"BigInt":return eoe(o,n,r);case"Boolean":return toe(o,n,r);case"Constructor":return roe(o,n,r);case"Date":return noe(o,n,r);case"Function":return ooe(o,n,r);case"Integer":return ioe(o,n,r);case"Intersect":return soe(o,n,r);case"Iterator":return aoe(o,n,r);case"Literal":return loe(o,n,r);case"Never":return coe(o,n,r);case"Not":return poe(o,n,r);case"Null":return uoe(o,n,r);case"Number":return doe(o,n,r);case"Object":return foe(o,n,r);case"Promise":return moe(o,n,r);case"Record":return hoe(o,n,r);case"Ref":return yoe(o,n,r);case"RegExp":return goe(o,n,r);case"String":return boe(o,n,r);case"Symbol":return xoe(o,n,r);case"TemplateLiteral":return voe(o,n,r);case"This":return Ioe(o,n,r);case"Tuple":return Soe(o,n,r);case"Undefined":return Coe(o,n,r);case"Union":return Toe(o,n,r);case"Uint8Array":return Poe(o,n,r);case"Unknown":return woe(o,n,r);case"Void":return Moe(o,n,r);default:if(!Vr.Has(o[Z]))throw new fP(o);return Ooe(o,n,r)}}s(pn,"Visit");function rt(...e){return e.length===3?pn(e[0],e[1],e[2]):pn(e[0],[],e[1])}s(rt,"Check");var X;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(X||(X={}));var yP=class yP extends Fe{constructor(t){super("Unknown type"),this.schema=t}};s(yP,"ValueErrorsUnknownTypeError");var hP=yP;function Ka(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(Ka,"EscapeKey");function ct(e){return e!==void 0}s(ct,"IsDefined");var gP=class gP{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};s(gP,"ValueErrorIterator");var si=gP;function he(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:KN()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}s(he,"Create");function*Eoe(e,t,r,n){}s(Eoe,"FromAny");function*_oe(e,t,r,n){if(!He(n))return yield he(X.Array,e,r,n);ct(e.minItems)&&!(n.length>=e.minItems)&&(yield he(X.ArrayMinItems,e,r,n)),ct(e.maxItems)&&!(n.length<=e.maxItems)&&(yield he(X.ArrayMaxItems,e,r,n));for(let a=0;a<n.length;a++)yield*ie(un(e.items,t,"".concat(r,"/").concat(a),n[a]));if(e.uniqueItems===!0&&!function(){let a=new Set;for(let l of n){let c=gc(l);if(a.has(c))return!1;a.add(c)}return!0}()&&(yield he(X.ArrayUniqueItems,e,r,n)),!(ct(e.contains)||ct(e.minContains)||ct(e.maxContains)))return;let o=ct(e.contains)?e.contains:Bt(),i=n.reduce((a,l,c)=>un(o,t,"".concat(r).concat(c),l).next().done===!0?a+1:a,0);i===0&&(yield he(X.ArrayContains,e,r,n)),ke(e.minContains)&&i<e.minContains&&(yield he(X.ArrayMinContains,e,r,n)),ke(e.maxContains)&&i>e.maxContains&&(yield he(X.ArrayMaxContains,e,r,n))}s(_oe,"FromArray");function*koe(e,t,r,n){A0(n)||(yield he(X.AsyncIterator,e,r,n))}s(koe,"FromAsyncIterator");function*Aoe(e,t,r,n){if(!an(n))return yield he(X.BigInt,e,r,n);ct(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield he(X.BigIntExclusiveMaximum,e,r,n)),ct(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield he(X.BigIntExclusiveMinimum,e,r,n)),ct(e.maximum)&&!(n<=e.maximum)&&(yield he(X.BigIntMaximum,e,r,n)),ct(e.minimum)&&!(n>=e.minimum)&&(yield he(X.BigIntMinimum,e,r,n)),ct(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield he(X.BigIntMultipleOf,e,r,n))}s(Aoe,"FromBigInt");function*Doe(e,t,r,n){ks(n)||(yield he(X.Boolean,e,r,n))}s(Doe,"FromBoolean");function*Foe(e,t,r,n){yield*ie(un(e.returns,t,r,n.prototype))}s(Foe,"FromConstructor");function*Loe(e,t,r,n){if(!Hn(n))return yield he(X.Date,e,r,n);ct(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield he(X.DateExclusiveMaximumTimestamp,e,r,n)),ct(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield he(X.DateExclusiveMinimumTimestamp,e,r,n)),ct(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield he(X.DateMaximumTimestamp,e,r,n)),ct(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield he(X.DateMinimumTimestamp,e,r,n)),ct(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield he(X.DateMultipleOfTimestamp,e,r,n))}s(Loe,"FromDate");function*Roe(e,t,r,n){cc(n)||(yield he(X.Function,e,r,n))}s(Roe,"FromFunction");function*Noe(e,t,r,n){if(!L0(n))return yield he(X.Integer,e,r,n);ct(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield he(X.IntegerExclusiveMaximum,e,r,n)),ct(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield he(X.IntegerExclusiveMinimum,e,r,n)),ct(e.maximum)&&!(n<=e.maximum)&&(yield he(X.IntegerMaximum,e,r,n)),ct(e.minimum)&&!(n>=e.minimum)&&(yield he(X.IntegerMinimum,e,r,n)),ct(e.multipleOf)&&n%e.multipleOf!==0&&(yield he(X.IntegerMultipleOf,e,r,n))}s(Noe,"FromInteger");function*Boe(e,t,r,n){let o=!1;for(let i of e.allOf)for(let a of un(i,t,r,n))o=!0,yield a;if(o)return yield he(X.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let i=new RegExp(qa(e));for(let a of Object.getOwnPropertyNames(n))i.test(a)||(yield he(X.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(a),n))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(qa(e));for(let a of Object.getOwnPropertyNames(n))if(!i.test(a)){let l=un(e.unevaluatedProperties,t,"".concat(r,"/").concat(a),n[a]).next();l.done||(yield l.value)}}}s(Boe,"FromIntersect");function*$oe(e,t,r,n){D0(n)||(yield he(X.Iterator,e,r,n))}s($oe,"FromIterator");function*joe(e,t,r,n){n!==e.const&&(yield he(X.Literal,e,r,n))}s(joe,"FromLiteral");function*Goe(e,t,r,n){yield he(X.Never,e,r,n)}s(Goe,"FromNever");function*Uoe(e,t,r,n){un(e.not,t,r,n).next().done===!0&&(yield he(X.Not,e,r,n))}s(Uoe,"FromNot");function*Voe(e,t,r,n){$a(n)||(yield he(X.Null,e,r,n))}s(Voe,"FromNull");function*zoe(e,t,r,n){if(!Lt.IsNumberLike(n))return yield he(X.Number,e,r,n);ct(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield he(X.NumberExclusiveMaximum,e,r,n)),ct(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield he(X.NumberExclusiveMinimum,e,r,n)),ct(e.maximum)&&!(n<=e.maximum)&&(yield he(X.NumberMaximum,e,r,n)),ct(e.minimum)&&!(n>=e.minimum)&&(yield he(X.NumberMinimum,e,r,n)),ct(e.multipleOf)&&n%e.multipleOf!==0&&(yield he(X.NumberMultipleOf,e,r,n))}s(zoe,"FromNumber");function*Hoe(e,t,r,n){if(!Lt.IsObjectLike(n))return yield he(X.Object,e,r,n);ct(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield he(X.ObjectMinProperties,e,r,n)),ct(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield he(X.ObjectMaxProperties,e,r,n));let o=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),a=Object.getOwnPropertyNames(n);for(let l of o)a.includes(l)||(yield he(X.ObjectRequiredProperty,e.properties[l],"".concat(r,"/").concat(Ka(l)),void 0));if(e.additionalProperties===!1)for(let l of a)i.includes(l)||(yield he(X.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Ka(l)),n[l]));if(typeof e.additionalProperties=="object")for(let l of a)i.includes(l)||(yield*ie(un(e.additionalProperties,t,"".concat(r,"/").concat(Ka(l)),n[l])));for(let l of i){let c=e.properties[l];e.required&&e.required.includes(l)?(yield*ie(un(c,t,"".concat(r,"/").concat(Ka(l)),n[l])),Xa(e)&&!(l in n)&&(yield he(X.ObjectRequiredProperty,c,"".concat(r,"/").concat(Ka(l)),void 0))):Lt.IsExactOptionalProperty(n,l)&&(yield*ie(un(c,t,"".concat(r,"/").concat(Ka(l)),n[l])))}}s(Hoe,"FromObject");function*Woe(e,t,r,n){F0(n)||(yield he(X.Promise,e,r,n))}s(Woe,"FromPromise");function*qoe(e,t,r,n){if(!Lt.IsRecordLike(n))return yield he(X.Object,e,r,n);ct(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield he(X.ObjectMinProperties,e,r,n)),ct(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield he(X.ObjectMaxProperties,e,r,n));let[o,i]=Object.entries(e.patternProperties)[0],a=new RegExp(o);for(let[l,c]of Object.entries(n))a.test(l)&&(yield*ie(un(i,t,"".concat(r,"/").concat(Ka(l)),c)));if(typeof e.additionalProperties=="object")for(let[l,c]of Object.entries(n))a.test(l)||(yield*ie(un(e.additionalProperties,t,"".concat(r,"/").concat(Ka(l)),c)));if(e.additionalProperties===!1){for(let[l,c]of Object.entries(n))if(!a.test(l))return yield he(X.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Ka(l)),c)}}s(qoe,"FromRecord");function*Zoe(e,t,r,n){yield*ie(un(Pt(e,t),t,r,n))}s(Zoe,"FromRef");function*Xoe(e,t,r,n){if(!ht(n))return yield he(X.String,e,r,n);if(ct(e.minLength)&&!(n.length>=e.minLength)&&(yield he(X.StringMinLength,e,r,n)),ct(e.maxLength)&&!(n.length<=e.maxLength)&&(yield he(X.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield he(X.RegExp,e,r,n)}s(Xoe,"FromRegExp");function*Yoe(e,t,r,n){if(!ht(n))return yield he(X.String,e,r,n);ct(e.minLength)&&!(n.length>=e.minLength)&&(yield he(X.StringMinLength,e,r,n)),ct(e.maxLength)&&!(n.length<=e.maxLength)&&(yield he(X.StringMaxLength,e,r,n)),ht(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield he(X.StringPattern,e,r,n))),ht(e.format)&&(qn.Has(e.format)?qn.Get(e.format)(n)||(yield he(X.StringFormat,e,r,n)):yield he(X.StringFormatUnknown,e,r,n))}s(Yoe,"FromString");function*Koe(e,t,r,n){ja(n)||(yield he(X.Symbol,e,r,n))}s(Koe,"FromSymbol");function*Joe(e,t,r,n){if(!ht(n))return yield he(X.String,e,r,n);new RegExp(e.pattern).test(n)||(yield he(X.StringPattern,e,r,n))}s(Joe,"FromTemplateLiteral");function*Qoe(e,t,r,n){yield*ie(un(Pt(e,t),t,r,n))}s(Qoe,"FromThis");function*eie(e,t,r,n){if(!He(n))return yield he(X.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield he(X.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield he(X.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*ie(un(e.items[o],t,"".concat(r,"/").concat(o),n[o]))}s(eie,"FromTuple");function*tie(e,t,r,n){br(n)||(yield he(X.Undefined,e,r,n))}s(tie,"FromUndefined");function*rie(e,t,r,n){if(rt(e,t,n))return;let o=e.anyOf.map(i=>new si(un(i,t,r,n)));yield he(X.Union,e,r,n,o)}s(rie,"FromUnion");function*nie(e,t,r,n){if(!uf(n))return yield he(X.Uint8Array,e,r,n);ct(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield he(X.Uint8ArrayMaxByteLength,e,r,n)),ct(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield he(X.Uint8ArrayMinByteLength,e,r,n))}s(nie,"FromUint8Array");function*oie(e,t,r,n){}s(oie,"FromUnknown");function*iie(e,t,r,n){Lt.IsVoidLike(n)||(yield he(X.Void,e,r,n))}s(iie,"FromVoid");function*sie(e,t,r,n){Vr.Get(e[Z])(e,n)||(yield he(X.Kind,e,r,n))}s(sie,"FromKind");function*un(e,t,r,n){let o=ct(e.$id)?[...t,e]:t,i=e;switch(i[Z]){case"Any":return yield*ie(Eoe(i,o,r,n));case"Array":return yield*ie(_oe(i,o,r,n));case"AsyncIterator":return yield*ie(koe(i,o,r,n));case"BigInt":return yield*ie(Aoe(i,o,r,n));case"Boolean":return yield*ie(Doe(i,o,r,n));case"Constructor":return yield*ie(Foe(i,o,r,n));case"Date":return yield*ie(Loe(i,o,r,n));case"Function":return yield*ie(Roe(i,o,r,n));case"Integer":return yield*ie(Noe(i,o,r,n));case"Intersect":return yield*ie(Boe(i,o,r,n));case"Iterator":return yield*ie($oe(i,o,r,n));case"Literal":return yield*ie(joe(i,o,r,n));case"Never":return yield*ie(Goe(i,o,r,n));case"Not":return yield*ie(Uoe(i,o,r,n));case"Null":return yield*ie(Voe(i,o,r,n));case"Number":return yield*ie(zoe(i,o,r,n));case"Object":return yield*ie(Hoe(i,o,r,n));case"Promise":return yield*ie(Woe(i,o,r,n));case"Record":return yield*ie(qoe(i,o,r,n));case"Ref":return yield*ie(Zoe(i,o,r,n));case"RegExp":return yield*ie(Xoe(i,o,r,n));case"String":return yield*ie(Yoe(i,o,r,n));case"Symbol":return yield*ie(Koe(i,o,r,n));case"TemplateLiteral":return yield*ie(Joe(i,o,r,n));case"This":return yield*ie(Qoe(i,o,r,n));case"Tuple":return yield*ie(eie(i,o,r,n));case"Undefined":return yield*ie(tie(i,o,r,n));case"Union":return yield*ie(rie(i,o,r,n));case"Uint8Array":return yield*ie(nie(i,o,r,n));case"Unknown":return yield*ie(oie(i,o,r,n));case"Void":return yield*ie(iie(i,o,r,n));default:if(!Vr.Has(i[Z]))throw new hP(e);return yield*ie(sie(i,o,r,n))}}s(un,"Visit");function Ns(...e){let t=e.length===3?un(e[0],e[1],"",e[2]):un(e[0],[],"",e[1]);return new si(t)}s(Ns,"Errors");f();var aie=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},rB=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},bP,mx,nB,vP=class vP extends Fe{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),bP.add(this),mx.set(this,void 0),aie(this,mx,t,"f"),this.error=r}Errors(){return new si(rB(this,bP,"m",nB).call(this))}};s(vP,"AssertError");var xP=vP;mx=new WeakMap,bP=new WeakSet,nB=s(function*(){this.error&&(yield this.error),yield*ie(rB(this,mx,"f"))},"_AssertError_Iterator");function tB(e,t,r){if(!rt(e,t,r))throw new xP(Ns(e,t,r))}s(tB,"AssertValue");function hx(...e){return e.length===3?tB(e[0],e[1],e[2]):tB(e[0],[],e[1])}s(hx,"Assert");f();f();f();function lie(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=wt(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=wt(e[r]);return t}s(lie,"FromObject");function cie(e){return e.map(t=>wt(t))}s(cie,"FromArray");function pie(e){return e.slice()}s(pie,"FromTypedArray");function uie(e){return new Map(wt([...e.entries()]))}s(uie,"FromMap");function die(e){return new Set(wt([...e.entries()]))}s(die,"FromSet");function fie(e){return new Date(e.toISOString())}s(fie,"FromDate");function wt(e){if(He(e))return cie(e);if(Hn(e))return fie(e);if(Ko(e))return pie(e);if(SL(e))return uie(e);if(CL(e))return die(e);if(Ze(e))return lie(e);if(ln(e))return e;throw new Error("ValueClone: Unable to clone value")}s(wt,"Clone");var IP=class IP extends Fe{constructor(t,r){super(r),this.schema=t}};s(IP,"ValueCreateError");var _o=IP;function Mt(e){return cc(e)?e():wt(e)}s(Mt,"FromDefault");function mie(e,t){return je(e,"default")?Mt(e.default):{}}s(mie,"FromAny");function hie(e,t){if(e.uniqueItems===!0&&!je(e,"default"))throw new _o(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!je(e,"default"))throw new _o(e,"Array with the contains constraint requires a default value");return"default"in e?Mt(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>ko(e.items,t)):[]}s(hie,"FromArray");function yie(e,t){return je(e,"default")?Mt(e.default):function(){return G6(this,null,function*(){})}()}s(yie,"FromAsyncIterator");function gie(e,t){return je(e,"default")?Mt(e.default):BigInt(0)}s(gie,"FromBigInt");function bie(e,t){return je(e,"default")?Mt(e.default):!1}s(bie,"FromBoolean");function xie(e,t){if(je(e,"default"))return Mt(e.default);{let r=ko(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let i=this;i[n]=o}}}:class{}}}s(xie,"FromConstructor");function vie(e,t){return je(e,"default")?Mt(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}s(vie,"FromDate");function Iie(e,t){return je(e,"default")?Mt(e.default):()=>ko(e.returns,t)}s(Iie,"FromFunction");function Sie(e,t){return je(e,"default")?Mt(e.default):e.minimum!==void 0?e.minimum:0}s(Sie,"FromInteger");function Cie(e,t){if(je(e,"default"))return Mt(e.default);{let r=e.allOf.reduce((n,o)=>{let i=ko(o,t);return typeof i=="object"?P(P({},n),i):i},{});if(!rt(e,t,r))throw new _o(e,"Intersect produced invalid value. Consider using a default value.");return r}}s(Cie,"FromIntersect");function Tie(e,t){return je(e,"default")?Mt(e.default):function*(){}()}s(Tie,"FromIterator");function Pie(e,t){return je(e,"default")?Mt(e.default):e.const}s(Pie,"FromLiteral");function wie(e,t){if(je(e,"default"))return Mt(e.default);throw new _o(e,"Never types cannot be created. Consider using a default value.")}s(wie,"FromNever");function Mie(e,t){if(je(e,"default"))return Mt(e.default);throw new _o(e,"Not types must have a default value")}s(Mie,"FromNot");function Oie(e,t){return je(e,"default")?Mt(e.default):null}s(Oie,"FromNull");function Eie(e,t){return je(e,"default")?Mt(e.default):e.minimum!==void 0?e.minimum:0}s(Eie,"FromNumber");function _ie(e,t){if(je(e,"default"))return Mt(e.default);{let r=new Set(e.required),n={};for(let[o,i]of Object.entries(e.properties))r.has(o)&&(n[o]=ko(i,t));return n}}s(_ie,"FromObject");function kie(e,t){return je(e,"default")?Mt(e.default):Promise.resolve(ko(e.item,t))}s(kie,"FromPromise");function Aie(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(je(e,"default"))return Mt(e.default);if(r===Ha||r===za)return{};{let o=r.slice(1,r.length-1).split("|"),i={};for(let a of o)i[a]=ko(n,t);return i}}s(Aie,"FromRecord");function Die(e,t){return je(e,"default")?Mt(e.default):ko(Pt(e,t),t)}s(Die,"FromRef");function Fie(e,t){if(je(e,"default"))return Mt(e.default);throw new _o(e,"RegExp types cannot be created. Consider using a default value.")}s(Fie,"FromRegExp");function Lie(e,t){if(e.pattern!==void 0){if(je(e,"default"))return Mt(e.default);throw new _o(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(je(e,"default"))return Mt(e.default);throw new _o(e,"String types with formats must specify a default value")}else return je(e,"default")?Mt(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}s(Lie,"FromString");function Rie(e,t){return je(e,"default")?Mt(e.default):"value"in e?Symbol.for(e.value):Symbol()}s(Rie,"FromSymbol");function Nie(e,t){if(je(e,"default"))return Mt(e.default);if(!j0(e))throw new _o(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return bf(e)[0]}s(Nie,"FromTemplateLiteral");function Bie(e,t){if(oB++>Wie)throw new _o(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return je(e,"default")?Mt(e.default):ko(Pt(e,t),t)}s(Bie,"FromThis");function $ie(e,t){return je(e,"default")?Mt(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>ko(e.items[n],t))}s($ie,"FromTuple");function jie(e,t){if(je(e,"default"))return Mt(e.default)}s(jie,"FromUndefined");function Gie(e,t){if(je(e,"default"))return Mt(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return ko(e.anyOf[0],t)}s(Gie,"FromUnion");function Uie(e,t){return je(e,"default")?Mt(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}s(Uie,"FromUint8Array");function Vie(e,t){return je(e,"default")?Mt(e.default):{}}s(Vie,"FromUnknown");function zie(e,t){if(je(e,"default"))return Mt(e.default)}s(zie,"FromVoid");function Hie(e,t){if(je(e,"default"))return Mt(e.default);throw new Error("User defined types must specify a default value")}s(Hie,"FromKind");function ko(e,t){let r=ii(e,t),n=e;switch(n[Z]){case"Any":return mie(n,r);case"Array":return hie(n,r);case"AsyncIterator":return yie(n,r);case"BigInt":return gie(n,r);case"Boolean":return bie(n,r);case"Constructor":return xie(n,r);case"Date":return vie(n,r);case"Function":return Iie(n,r);case"Integer":return Sie(n,r);case"Intersect":return Cie(n,r);case"Iterator":return Tie(n,r);case"Literal":return Pie(n,r);case"Never":return wie(n,r);case"Not":return Mie(n,r);case"Null":return Oie(n,r);case"Number":return Eie(n,r);case"Object":return _ie(n,r);case"Promise":return kie(n,r);case"Record":return Aie(n,r);case"Ref":return Die(n,r);case"RegExp":return Fie(n,r);case"String":return Lie(n,r);case"Symbol":return Rie(n,r);case"TemplateLiteral":return Nie(n,r);case"This":return Bie(n,r);case"Tuple":return $ie(n,r);case"Undefined":return jie(n,r);case"Union":return Gie(n,r);case"Uint8Array":return Uie(n,r);case"Unknown":return Vie(n,r);case"Void":return zie(n,r);default:if(!Vr.Has(n[Z]))throw new _o(n,"Unknown type");return Hie(n,r)}}s(ko,"Visit");var Wie=512,oB=0;function ai(...e){return oB=0,e.length===2?ko(e[0],e[1]):ko(e[0],[])}s(ai,"Create");var CP=class CP extends Fe{constructor(t,r){super(r),this.schema=t}};s(CP,"ValueCastError");var yx=CP;function qie(e,t,r){if(e[Z]==="Object"&&typeof r=="object"&&!$a(r)){let n=e,o=Object.getOwnPropertyNames(r),i=Object.entries(n.properties),[a,l]=[1/i.length,i.length];return i.reduce((c,[u,d])=>{let h=d[Z]==="Literal"&&d.const===r[u]?l:0,y=rt(d,t,r[u])?a:0,b=o.includes(u)?a:0;return c+(h+y+b)},0)}else return rt(e,t,r)?1:0}s(qie,"ScoreUnion");function Zie(e,t,r){let n=e.anyOf.map(a=>Pt(a,t)),[o,i]=[n[0],0];for(let a of n){let l=qie(a,t,r);l>i&&(o=a,i=l)}return o}s(Zie,"SelectUnion");function Xie(e,t,r){if("default"in e)return typeof r=="function"?e.default:wt(e.default);{let n=Zie(e,t,r);return SP(n,t,r)}}s(Xie,"CastUnion");function Yie(e,t,r){return rt(e,t,r)?wt(r):ai(e,t)}s(Yie,"DefaultClone");function Kie(e,t,r){return rt(e,t,r)?r:ai(e,t)}s(Kie,"Default");function Jie(e,t,r){if(rt(e,t,r))return wt(r);let n=He(r)?wt(r):ai(e,t),o=ke(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,a=(ke(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(c=>Bs(e.items,t,c));if(e.uniqueItems!==!0)return a;let l=[...new Set(a)];if(!rt(e,t,l))throw new yx(e,"Array cast produced invalid data due to uniqueItems constraint");return l}s(Jie,"FromArray");function Qie(e,t,r){if(rt(e,t,r))return ai(e,t);let n=new Set(e.returns.required||[]),o=s(function(){},"result");for(let[i,a]of Object.entries(e.returns.properties))!n.has(i)&&r.prototype[i]===void 0||(o.prototype[i]=Bs(a,t,r.prototype[i]));return o}s(Qie,"FromConstructor");function ese(e,t,r){let n=ai(e,t),o=Ze(n)&&Ze(r)?P(P({},n),r):r;return rt(e,t,o)?o:ai(e,t)}s(ese,"FromIntersect");function tse(e,t,r){throw new yx(e,"Never types cannot be cast")}s(tse,"FromNever");function rse(e,t,r){if(rt(e,t,r))return r;if(r===null||typeof r!="object")return ai(e,t);let n=new Set(e.required||[]),o={};for(let[i,a]of Object.entries(e.properties))!n.has(i)&&r[i]===void 0||(o[i]=Bs(a,t,r[i]));if(typeof e.additionalProperties=="object"){let i=Object.getOwnPropertyNames(e.properties);for(let a of Object.getOwnPropertyNames(r))i.includes(a)||(o[a]=Bs(e.additionalProperties,t,r[a]))}return o}s(rse,"FromObject");function nse(e,t,r){if(rt(e,t,r))return wt(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return ai(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n],i={};for(let[a,l]of Object.entries(r))i[a]=Bs(o,t,l);return i}s(nse,"FromRecord");function ose(e,t,r){return Bs(Pt(e,t),t,r)}s(ose,"FromRef");function ise(e,t,r){return Bs(Pt(e,t),t,r)}s(ise,"FromThis");function sse(e,t,r){return rt(e,t,r)?wt(r):He(r)?e.items===void 0?[]:e.items.map((n,o)=>Bs(n,t,r[o])):ai(e,t)}s(sse,"FromTuple");function ase(e,t,r){return rt(e,t,r)?wt(r):Xie(e,t,r)}s(ase,"FromUnion");function Bs(e,t,r){let n=ht(e.$id)?[...t,e]:t,o=e;switch(e[Z]){case"Array":return Jie(o,n,r);case"Constructor":return Qie(o,n,r);case"Intersect":return ese(o,n,r);case"Never":return tse(o,n,r);case"Object":return rse(o,n,r);case"Record":return nse(o,n,r);case"Ref":return ose(o,n,r);case"This":return ise(o,n,r);case"Tuple":return sse(o,n,r);case"Union":return ase(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Yie(e,t,r);default:return Kie(o,n,r)}}s(Bs,"Visit");function SP(...e){return e.length===3?Bs(e[0],e[1],e[2]):Bs(e[0],[],e[1])}s(SP,"Cast");f();function lse(e){return uc(e)&&e[Z]!=="Unsafe"}s(lse,"IsCheckable");function cse(e,t,r){return He(r)?r.map(n=>Ao(e.items,t,n)):r}s(cse,"FromArray");function pse(e,t,r){let n=e.unevaluatedProperties,i=e.allOf.map(l=>Ao(l,t,wt(r))).reduce((l,c)=>Ze(c)?P(P({},l),c):c,{});if(!Ze(r)||!Ze(i)||!uc(n))return i;let a=Qr(e);for(let l of Object.getOwnPropertyNames(r))a.includes(l)||rt(n,t,r[l])&&(i[l]=Ao(n,t,r[l]));return i}s(pse,"FromIntersect");function use(e,t,r){if(!Ze(r)||He(r))return r;let n=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(je(e.properties,o)){r[o]=Ao(e.properties[o],t,r[o]);continue}if(uc(n)&&rt(n,t,r[o])){r[o]=Ao(n,t,r[o]);continue}delete r[o]}return r}s(use,"FromObject");function dse(e,t,r){if(!Ze(r))return r;let n=e.additionalProperties,o=Object.getOwnPropertyNames(r),[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of o){if(l.test(c)){r[c]=Ao(a,t,r[c]);continue}if(uc(n)&&rt(n,t,r[c])){r[c]=Ao(n,t,r[c]);continue}delete r[c]}return r}s(dse,"FromRecord");function fse(e,t,r){return Ao(Pt(e,t),t,r)}s(fse,"FromRef");function mse(e,t,r){return Ao(Pt(e,t),t,r)}s(mse,"FromThis");function hse(e,t,r){if(!He(r))return r;if(br(e.items))return[];let n=Math.min(r.length,e.items.length);for(let o=0;o<n;o++)r[o]=Ao(e.items[o],t,r[o]);return r.length>n?r.slice(0,n):r}s(hse,"FromTuple");function yse(e,t,r){for(let n of e.anyOf)if(lse(n)&&rt(n,t,r))return Ao(n,t,r);return r}s(yse,"FromUnion");function Ao(e,t,r){let n=ht(e.$id)?[...t,e]:t,o=e;switch(o[Z]){case"Array":return cse(o,n,r);case"Intersect":return pse(o,n,r);case"Object":return use(o,n,r);case"Record":return dse(o,n,r);case"Ref":return fse(o,n,r);case"This":return mse(o,n,r);case"Tuple":return hse(o,n,r);case"Union":return yse(o,n,r);default:return r}}s(Ao,"Visit");function gx(...e){return e.length===3?Ao(e[0],e[1],e[2]):Ao(e[0],[],e[1])}s(gx,"Clean");f();function bx(e){return ht(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}s(bx,"IsStringNumeric");function gse(e){return an(e)||ks(e)||ke(e)}s(gse,"IsValueToString");function qy(e){return e===!0||ke(e)&&e===1||an(e)&&e===BigInt("1")||ht(e)&&(e.toLowerCase()==="true"||e==="1")}s(qy,"IsValueTrue");function Zy(e){return e===!1||ke(e)&&(e===0||Object.is(e,-0))||an(e)&&e===BigInt("0")||ht(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}s(Zy,"IsValueFalse");function bse(e){return ht(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}s(bse,"IsTimeStringWithTimeZone");function xse(e){return ht(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}s(xse,"IsTimeStringWithoutTimeZone");function vse(e){return ht(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}s(vse,"IsDateTimeStringWithTimeZone");function Ise(e){return ht(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}s(Ise,"IsDateTimeStringWithoutTimeZone");function Sse(e){return ht(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}s(Sse,"IsDateString");function Cse(e,t){let r=sB(e);return r===t?r:e}s(Cse,"TryConvertLiteralString");function Tse(e,t){let r=aB(e);return r===t?r:e}s(Tse,"TryConvertLiteralNumber");function Pse(e,t){let r=iB(e);return r===t?r:e}s(Pse,"TryConvertLiteralBoolean");function wse(e,t){return ht(e.const)?Cse(t,e.const):ke(e.const)?Tse(t,e.const):ks(e.const)?Pse(t,e.const):t}s(wse,"TryConvertLiteral");function iB(e){return qy(e)?!0:Zy(e)?!1:e}s(iB,"TryConvertBoolean");function Mse(e){let t=s(r=>r.split(".")[0],"truncateInteger");return bx(e)?BigInt(t(e)):ke(e)?BigInt(Math.trunc(e)):Zy(e)?BigInt(0):qy(e)?BigInt(1):e}s(Mse,"TryConvertBigInt");function sB(e){return gse(e)?e.toString():ja(e)&&e.description!==void 0?e.description.toString():e}s(sB,"TryConvertString");function aB(e){return bx(e)?parseFloat(e):qy(e)?1:Zy(e)?0:e}s(aB,"TryConvertNumber");function Ose(e){return bx(e)?parseInt(e):ke(e)?e|0:qy(e)?1:Zy(e)?0:e}s(Ose,"TryConvertInteger");function Ese(e){return ht(e)&&e.toLowerCase()==="null"?null:e}s(Ese,"TryConvertNull");function _se(e){return ht(e)&&e==="undefined"?void 0:e}s(_se,"TryConvertUndefined");function kse(e){return Hn(e)?e:ke(e)?new Date(e):qy(e)?new Date(1):Zy(e)?new Date(0):bx(e)?new Date(parseInt(e)):xse(e)?new Date("1970-01-01T".concat(e,".000Z")):bse(e)?new Date("1970-01-01T".concat(e)):Ise(e)?new Date("".concat(e,".000Z")):vse(e)?new Date(e):Sse(e)?new Date("".concat(e,"T00:00:00.000Z")):e}s(kse,"TryConvertDate");function Ase(e,t,r){return(He(r)?r:[r]).map(o=>$s(e.items,t,o))}s(Ase,"FromArray");function Dse(e,t,r){return Mse(r)}s(Dse,"FromBigInt");function Fse(e,t,r){return iB(r)}s(Fse,"FromBoolean");function Lse(e,t,r){return kse(r)}s(Lse,"FromDate");function Rse(e,t,r){return Ose(r)}s(Rse,"FromInteger");function Nse(e,t,r){return e.allOf.reduce((n,o)=>$s(o,t,n),r)}s(Nse,"FromIntersect");function Bse(e,t,r){return wse(e,r)}s(Bse,"FromLiteral");function $se(e,t,r){return Ese(r)}s($se,"FromNull");function jse(e,t,r){return aB(r)}s(jse,"FromNumber");function Gse(e,t,r){if(!Ze(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))je(r,n)&&(r[n]=$s(e.properties[n],t,r[n]));return r}s(Gse,"FromObject");function Use(e,t,r){if(!Ze(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o];for(let[a,l]of Object.entries(r))r[a]=$s(i,t,l);return r}s(Use,"FromRecord");function Vse(e,t,r){return $s(Pt(e,t),t,r)}s(Vse,"FromRef");function zse(e,t,r){return sB(r)}s(zse,"FromString");function Hse(e,t,r){return ht(r)||ke(r)?Symbol(r):r}s(Hse,"FromSymbol");function Wse(e,t,r){return $s(Pt(e,t),t,r)}s(Wse,"FromThis");function qse(e,t,r){return He(r)&&!br(e.items)?r.map((o,i)=>i<e.items.length?$s(e.items[i],t,o):o):r}s(qse,"FromTuple");function Zse(e,t,r){return _se(r)}s(Zse,"FromUndefined");function Xse(e,t,r){for(let n of e.anyOf){let o=$s(n,t,wt(r));if(rt(n,t,o))return o}return r}s(Xse,"FromUnion");function $s(e,t,r){let n=ii(e,t),o=e;switch(e[Z]){case"Array":return Ase(o,n,r);case"BigInt":return Dse(o,n,r);case"Boolean":return Fse(o,n,r);case"Date":return Lse(o,n,r);case"Integer":return Rse(o,n,r);case"Intersect":return Nse(o,n,r);case"Literal":return Bse(o,n,r);case"Null":return $se(o,n,r);case"Number":return jse(o,n,r);case"Object":return Gse(o,n,r);case"Record":return Use(o,n,r);case"Ref":return Vse(o,n,r);case"String":return zse(o,n,r);case"Symbol":return Hse(o,n,r);case"This":return Wse(o,n,r);case"Tuple":return qse(o,n,r);case"Undefined":return Zse(o,n,r);case"Union":return Xse(o,n,r);default:return r}}s($s,"Visit");function xx(...e){return e.length===3?$s(e[0],e[1],e[2]):$s(e[0],[],e[1])}s(xx,"Convert");f();f();var TP=class TP extends Fe{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};s(TP,"TransformDecodeCheckError");var Lf=TP,PP=class PP extends Fe{constructor(t,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=o}};s(PP,"TransformDecodeError");var Vp=PP;function xr(e,t,r){try{return Jt(e)?e[or].Decode(r):r}catch(n){throw new Vp(e,t,r,n)}}s(xr,"Default");function Yse(e,t,r,n){return He(n)?xr(e,r,n.map((o,i)=>js(e.items,t,"".concat(r,"/").concat(i),o))):xr(e,r,n)}s(Yse,"FromArray");function Kse(e,t,r,n){if(!Ze(n)||ln(n))return xr(e,r,n);let o=mc(e),i=o.map(d=>d[0]),a=P({},n);for(let[d,h]of o)d in a&&(a[d]=js(h,t,"".concat(r,"/").concat(d),a[d]));if(!Jt(e.unevaluatedProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.unevaluatedProperties,u=P({},a);for(let d of l)i.includes(d)||(u[d]=xr(c,"".concat(r,"/").concat(d),u[d]));return xr(e,r,u)}s(Kse,"FromIntersect");function Jse(e,t,r,n){return xr(e,r,js(e.not,t,r,n))}s(Jse,"FromNot");function Qse(e,t,r,n){if(!Ze(n))return xr(e,r,n);let o=Qr(e),i=P({},n);for(let u of o)je(i,u)&&(br(i[u])&&(!ff(e.properties[u])||Lt.IsExactOptionalProperty(i,u))||(i[u]=js(e.properties[u],t,"".concat(r,"/").concat(u),i[u])));if(!yt(e.additionalProperties))return xr(e,r,i);let a=Object.getOwnPropertyNames(i),l=e.additionalProperties,c=P({},i);for(let u of a)o.includes(u)||(c[u]=xr(l,"".concat(r,"/").concat(u),c[u]));return xr(e,r,c)}s(Qse,"FromObject");function eae(e,t,r,n){if(!Ze(n))return xr(e,r,n);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),a=P({},n);for(let d of Object.getOwnPropertyNames(n))i.test(d)&&(a[d]=js(e.patternProperties[o],t,"".concat(r,"/").concat(d),a[d]));if(!yt(e.additionalProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,u=P({},a);for(let d of l)i.test(d)||(u[d]=xr(c,"".concat(r,"/").concat(d),u[d]));return xr(e,r,u)}s(eae,"FromRecord");function tae(e,t,r,n){let o=Pt(e,t);return xr(e,r,js(o,t,r,n))}s(tae,"FromRef");function rae(e,t,r,n){let o=Pt(e,t);return xr(e,r,js(o,t,r,n))}s(rae,"FromThis");function nae(e,t,r,n){return He(n)&&He(e.items)?xr(e,r,e.items.map((o,i)=>js(o,t,"".concat(r,"/").concat(i),n[i]))):xr(e,r,n)}s(nae,"FromTuple");function oae(e,t,r,n){for(let o of e.anyOf){if(!rt(o,t,n))continue;let i=js(o,t,r,n);return xr(e,r,i)}return xr(e,r,n)}s(oae,"FromUnion");function js(e,t,r,n){let o=ii(e,t),i=e;switch(e[Z]){case"Array":return Yse(i,o,r,n);case"Intersect":return Kse(i,o,r,n);case"Not":return Jse(i,o,r,n);case"Object":return Qse(i,o,r,n);case"Record":return eae(i,o,r,n);case"Ref":return tae(i,o,r,n);case"Symbol":return xr(i,r,n);case"This":return rae(i,o,r,n);case"Tuple":return nae(i,o,r,n);case"Union":return oae(i,o,r,n);default:return xr(i,r,n)}}s(js,"Visit");function Rf(e,t,r){return js(e,t,"",r)}s(Rf,"TransformDecode");f();var wP=class wP extends Fe{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};s(wP,"TransformEncodeCheckError");var Nf=wP,MP=class MP extends Fe{constructor(t,r,n,o){super("".concat(o instanceof Error?o.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=o}};s(MP,"TransformEncodeError");var zp=MP;function kn(e,t,r){try{return Jt(e)?e[or].Encode(r):r}catch(n){throw new zp(e,t,r,n)}}s(kn,"Default");function iae(e,t,r,n){let o=kn(e,r,n);return He(o)?o.map((i,a)=>Gs(e.items,t,"".concat(r,"/").concat(a),i)):o}s(iae,"FromArray");function sae(e,t,r,n){let o=kn(e,r,n);if(!Ze(n)||ln(n))return o;let i=mc(e),a=i.map(h=>h[0]),l=P({},o);for(let[h,y]of i)h in l&&(l[h]=Gs(y,t,"".concat(r,"/").concat(h),l[h]));if(!Jt(e.unevaluatedProperties))return l;let c=Object.getOwnPropertyNames(l),u=e.unevaluatedProperties,d=P({},l);for(let h of c)a.includes(h)||(d[h]=kn(u,"".concat(r,"/").concat(h),d[h]));return d}s(sae,"FromIntersect");function aae(e,t,r,n){return kn(e.not,r,kn(e,r,n))}s(aae,"FromNot");function lae(e,t,r,n){let o=kn(e,r,n);if(!Ze(o))return o;let i=Qr(e),a=P({},o);for(let d of i)je(a,d)&&(br(a[d])&&(!ff(e.properties[d])||Lt.IsExactOptionalProperty(a,d))||(a[d]=Gs(e.properties[d],t,"".concat(r,"/").concat(d),a[d])));if(!yt(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,u=P({},a);for(let d of l)i.includes(d)||(u[d]=kn(c,"".concat(r,"/").concat(d),u[d]));return u}s(lae,"FromObject");function cae(e,t,r,n){let o=kn(e,r,n);if(!Ze(n))return o;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l=P({},o);for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(l[h]=Gs(e.patternProperties[i],t,"".concat(r,"/").concat(h),l[h]));if(!yt(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),u=e.additionalProperties,d=P({},l);for(let h of c)a.test(h)||(d[h]=kn(u,"".concat(r,"/").concat(h),d[h]));return d}s(cae,"FromRecord");function pae(e,t,r,n){let o=Pt(e,t),i=Gs(o,t,r,n);return kn(e,r,i)}s(pae,"FromRef");function uae(e,t,r,n){let o=Pt(e,t),i=Gs(o,t,r,n);return kn(e,r,i)}s(uae,"FromThis");function dae(e,t,r,n){let o=kn(e,r,n);return He(e.items)?e.items.map((i,a)=>Gs(i,t,"".concat(r,"/").concat(a),o[a])):[]}s(dae,"FromTuple");function fae(e,t,r,n){for(let o of e.anyOf){if(!rt(o,t,n))continue;let i=Gs(o,t,r,n);return kn(e,r,i)}for(let o of e.anyOf){let i=Gs(o,t,r,n);if(rt(e,t,i))return kn(e,r,i)}return kn(e,r,n)}s(fae,"FromUnion");function Gs(e,t,r,n){let o=ii(e,t),i=e;switch(e[Z]){case"Array":return iae(i,o,r,n);case"Intersect":return sae(i,o,r,n);case"Not":return aae(i,o,r,n);case"Object":return lae(i,o,r,n);case"Record":return cae(i,o,r,n);case"Ref":return pae(i,o,r,n);case"This":return uae(i,o,r,n);case"Tuple":return dae(i,o,r,n);case"Union":return fae(i,o,r,n);default:return kn(i,r,n)}}s(Gs,"Visit");function vx(e,t,r){return Gs(e,t,"",r)}s(vx,"TransformEncode");f();function mae(e,t){return Jt(e)||en(e.items,t)}s(mae,"FromArray");function hae(e,t){return Jt(e)||en(e.items,t)}s(hae,"FromAsyncIterator");function yae(e,t){return Jt(e)||en(e.returns,t)||e.parameters.some(r=>en(r,t))}s(yae,"FromConstructor");function gae(e,t){return Jt(e)||en(e.returns,t)||e.parameters.some(r=>en(r,t))}s(gae,"FromFunction");function bae(e,t){return Jt(e)||Jt(e.unevaluatedProperties)||e.allOf.some(r=>en(r,t))}s(bae,"FromIntersect");function xae(e,t){return Jt(e)||en(e.items,t)}s(xae,"FromIterator");function vae(e,t){return Jt(e)||en(e.not,t)}s(vae,"FromNot");function Iae(e,t){return Jt(e)||Object.values(e.properties).some(r=>en(r,t))||yt(e.additionalProperties)&&en(e.additionalProperties,t)}s(Iae,"FromObject");function Sae(e,t){return Jt(e)||en(e.item,t)}s(Sae,"FromPromise");function Cae(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Jt(e)||en(n,t)||yt(e.additionalProperties)&&Jt(e.additionalProperties)}s(Cae,"FromRecord");function Tae(e,t){return Jt(e)?!0:en(Pt(e,t),t)}s(Tae,"FromRef");function Pae(e,t){return Jt(e)?!0:en(Pt(e,t),t)}s(Pae,"FromThis");function wae(e,t){return Jt(e)||!br(e.items)&&e.items.some(r=>en(r,t))}s(wae,"FromTuple");function Mae(e,t){return Jt(e)||e.anyOf.some(r=>en(r,t))}s(Mae,"FromUnion");function en(e,t){let r=ii(e,t),n=e;if(e.$id&&OP.has(e.$id))return!1;switch(e.$id&&OP.add(e.$id),e[Z]){case"Array":return mae(n,r);case"AsyncIterator":return hae(n,r);case"Constructor":return yae(n,r);case"Function":return gae(n,r);case"Intersect":return bae(n,r);case"Iterator":return xae(n,r);case"Not":return vae(n,r);case"Object":return Iae(n,r);case"Promise":return Sae(n,r);case"Record":return Cae(n,r);case"Ref":return Tae(n,r);case"This":return Pae(n,r);case"Tuple":return wae(n,r);case"Union":return Mae(n,r);default:return Jt(e)}}s(en,"Visit");var OP=new Set;function Us(e,t){return OP.clear(),en(e,t)}s(Us,"HasTransform");function lB(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!rt(t,r,n))throw new Lf(t,n,Ns(t,r,n).First());return Us(t,r)?Rf(t,r,n):n}s(lB,"Decode");f();function Ja(e,t){let r=je(e,"default")?e.default:void 0,n=cc(r)?r():wt(r);return br(t)?n:Ze(t)&&Ze(n)?Object.assign(n,t):t}s(Ja,"ValueOrDefault");function EP(e){return uc(e)&&"default"in e}s(EP,"HasDefaultProperty");function Oae(e,t,r){let n=Ja(e,r);if(!He(n))return n;for(let o=0;o<n.length;o++)n[o]=Do(e.items,t,n[o]);return n}s(Oae,"FromArray");function Eae(e,t,r){return Hn(r)?r:Ja(e,r)}s(Eae,"FromDate");function _ae(e,t,r){let n=Ja(e,r);return e.allOf.reduce((o,i)=>{let a=Do(i,t,n);return Ze(a)?P(P({},o),a):a},{})}s(_ae,"FromIntersect");function kae(e,t,r){let n=Ja(e,r);if(!Ze(n))return n;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let a=Do(e.properties[i],t,n[i]);br(a)||(n[i]=Do(e.properties[i],t,n[i]))}if(!EP(e.additionalProperties))return n;for(let i of Object.getOwnPropertyNames(n))o.includes(i)||(n[i]=Do(e.additionalProperties,t,n[i]));return n}s(kae,"FromObject");function Aae(e,t,r){let n=Ja(e,r);if(!Ze(n))return n;let o=e.additionalProperties,[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of Object.getOwnPropertyNames(n))l.test(c)&&EP(a)&&(n[c]=Do(a,t,n[c]));if(!EP(o))return n;for(let c of Object.getOwnPropertyNames(n))l.test(c)||(n[c]=Do(o,t,n[c]));return n}s(Aae,"FromRecord");function Dae(e,t,r){return Do(Pt(e,t),t,Ja(e,r))}s(Dae,"FromRef");function Fae(e,t,r){return Do(Pt(e,t),t,r)}s(Fae,"FromThis");function Lae(e,t,r){let n=Ja(e,r);if(!He(n)||br(e.items))return n;let[o,i]=[e.items,Math.max(e.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=Do(o[a],t,n[a]));return n}s(Lae,"FromTuple");function Rae(e,t,r){let n=Ja(e,r);for(let o of e.anyOf){let i=Do(o,t,wt(n));if(rt(o,t,i))return i}return n}s(Rae,"FromUnion");function Do(e,t,r){let n=ii(e,t),o=e;switch(o[Z]){case"Array":return Oae(o,n,r);case"Date":return Eae(o,n,r);case"Intersect":return _ae(o,n,r);case"Object":return kae(o,n,r);case"Record":return Aae(o,n,r);case"Ref":return Dae(o,n,r);case"This":return Fae(o,n,r);case"Tuple":return Lae(o,n,r);case"Union":return Rae(o,n,r);default:return Ja(o,r)}}s(Do,"Visit");function Ix(...e){return e.length===3?Do(e[0],e[1],e[2]):Do(e[0],[],e[1])}s(Ix,"Default");f();f();var li={};cs(li,{Delete:()=>Bae,Format:()=>Xy,Get:()=>jae,Has:()=>$ae,Set:()=>Nae,ValuePointerRootDeleteError:()=>Cx,ValuePointerRootSetError:()=>Sx});f();var _P=class _P extends Fe{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};s(_P,"ValuePointerRootSetError");var Sx=_P,kP=class kP extends Fe{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};s(kP,"ValuePointerRootDeleteError");var Cx=kP;function cB(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}s(cB,"Escape");function*Xy(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield cB(e.slice(t,r))),t=n+1):r=n;yield cB(e.slice(t))}s(Xy,"Format");function Nae(e,t,r){if(t==="")throw new Sx(e,t,r);let[n,o,i]=[null,e,""];for(let a of Xy(t))o[a]===void 0&&(o[a]={}),n=o,o=o[a],i=a;n[i]=r}s(Nae,"Set");function Bae(e,t){if(t==="")throw new Cx(e,t);let[r,n,o]=[null,e,""];for(let i of Xy(t)){if(n[i]===void 0||n[i]===null)return;r=n,n=n[i],o=i}if(Array.isArray(r)){let i=parseInt(o);r.splice(i,1)}else delete r[o]}s(Bae,"Delete");function $ae(e,t){if(t==="")return!0;let[r,n,o]=[null,e,""];for(let i of Xy(t)){if(n[i]===void 0)return!1;r=n,n=n[i],o=i}return Object.getOwnPropertyNames(r).includes(o)}s($ae,"Has");function jae(e,t){if(t==="")return e;let r=e;for(let n of Xy(t)){if(r[n]===void 0)return;r=r[n]}return r}s(jae,"Get");f();function Gae(e,t){if(!Ze(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(o=>Hp(e[o],t[o]))}s(Gae,"ObjectType");function Uae(e,t){return Hn(t)&&e.getTime()===t.getTime()}s(Uae,"DateType");function Vae(e,t){return!He(t)||e.length!==t.length?!1:e.every((r,n)=>Hp(r,t[n]))}s(Vae,"ArrayType");function zae(e,t){return!Ko(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>Hp(r,t[n]))}s(zae,"TypedArrayType");function Hae(e,t){return e===t}s(Hae,"ValueType");function Hp(e,t){if(Hn(e))return Uae(e,t);if(Ko(e))return zae(e,t);if(He(e))return Vae(e,t);if(Ze(e))return Gae(e,t);if(ln(e))return Hae(e,t);throw new Error("ValueEquals: Unable to compare value")}s(Hp,"Equal");var Wae=zt({type:Dt("insert"),path:Qo(),value:Za()}),qae=zt({type:Dt("update"),path:Qo(),value:Za()}),Zae=zt({type:Dt("delete"),path:Qo()}),uB=$t([Wae,qae,Zae]),AP=class AP extends Fe{constructor(t,r){super(r),this.value=t}};s(AP,"ValueDiffError");var Tx=AP;function Px(e,t){return{type:"update",path:e,value:t}}s(Px,"CreateUpdate");function dB(e,t){return{type:"insert",path:e,value:t}}s(dB,"CreateInsert");function fB(e){return{type:"delete",path:e}}s(fB,"CreateDelete");function pB(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new Tx(e,"Cannot diff objects with symbols")}s(pB,"AssertDiffable");function*Xae(e,t,r){if(pB(t),pB(r),!JC(r))return yield Px(e,r);let n=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let i of o)je(t,i)||(yield dB("".concat(e,"/").concat(i),r[i]));for(let i of n)je(r,i)&&(Hp(t,r)||(yield*ie(wx("".concat(e,"/").concat(i),t[i],r[i]))));for(let i of n)je(r,i)||(yield fB("".concat(e,"/").concat(i)))}s(Xae,"ObjectType");function*Yae(e,t,r){if(!He(r))return yield Px(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*ie(wx("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield dB("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield fB("".concat(e,"/").concat(n)))}s(Yae,"ArrayType");function*Kae(e,t,r){if(!Ko(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield Px(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*ie(wx("".concat(e,"/").concat(n),t[n],r[n]))}s(Kae,"TypedArrayType");function*Jae(e,t,r){t!==r&&(yield Px(e,r))}s(Jae,"ValueType");function*wx(e,t,r){if(JC(t))return yield*ie(Xae(e,t,r));if(He(t))return yield*ie(Yae(e,t,r));if(Ko(t))return yield*ie(Kae(e,t,r));if(ln(t))return yield*ie(Jae(e,t,r));throw new Tx(t,"Unable to diff value")}s(wx,"Visit");function mB(e,t){return[...wx("",e,t)]}s(mB,"Diff");function Qae(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}s(Qae,"IsRootUpdate");function ele(e){return e.length===0}s(ele,"IsIdentity");function hB(e,t){if(Qae(t))return wt(t[0].value);if(ele(t))return wt(e);let r=wt(e);for(let n of t)switch(n.type){case"insert":{li.Set(r,n.path,n.value);break}case"update":{li.Set(r,n.path,n.value);break}case"delete":{li.Delete(r,n.path);break}}return r}s(hB,"Patch");f();function yB(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=Us(t,r)?vx(t,r,n):n;if(!rt(t,r,o))throw new Nf(t,o,Ns(t,r,o).First());return o}s(yB,"Encode");f();var FP=class FP extends Fe{constructor(t){super(t)}};s(FP,"ValueMutateError");var Mx=FP;function tle(e,t,r,n){if(!Ze(r))li.Set(e,t,wt(n));else{let o=Object.getOwnPropertyNames(r),i=Object.getOwnPropertyNames(n);for(let a of o)i.includes(a)||delete r[a];for(let a of i)o.includes(a)||(r[a]=null);for(let a of i)DP(e,"".concat(t,"/").concat(a),r[a],n[a])}}s(tle,"ObjectType");function rle(e,t,r,n){if(!He(r))li.Set(e,t,wt(n));else{for(let o=0;o<n.length;o++)DP(e,"".concat(t,"/").concat(o),r[o],n[o]);r.splice(n.length)}}s(rle,"ArrayType");function nle(e,t,r,n){if(Ko(r)&&r.length===n.length)for(let o=0;o<r.length;o++)r[o]=n[o];else li.Set(e,t,wt(n))}s(nle,"TypedArrayType");function ole(e,t,r,n){r!==n&&li.Set(e,t,n)}s(ole,"ValueType");function DP(e,t,r,n){if(He(n))return rle(e,t,r,n);if(Ko(n))return nle(e,t,r,n);if(Ze(n))return tle(e,t,r,n);if(ln(n))return ole(e,t,r,n)}s(DP,"Visit");function gB(e){return Ko(e)||ln(e)}s(gB,"IsNonMutableValue");function ile(e,t){return Ze(e)&&He(t)||He(e)&&Ze(t)}s(ile,"IsMismatchedValue");function bB(e,t){if(gB(e)||gB(t))throw new Mx("Only object and array types can be mutated at the root level");if(ile(e,t))throw new Mx("Cannot assign due type mismatch of assignable values");DP(e,"",e,t)}s(bB,"Mutate");f();var sle=[(e,t,r)=>wt(r),(e,t,r)=>Ix(e,t,r),(e,t,r)=>gx(e,t,r),(e,t,r)=>xx(e,t,r),(e,t,r)=>(hx(e,t,r),r),(e,t,r)=>Us(e,t)?Rf(e,t,r):r];function xB(e,t,r){return sle.reduce((n,o)=>o(e,t,n),r)}s(xB,"ParseValue");function vB(...e){return e.length===3?xB(e[0],e[1],e[2]):xB(e[0],[],e[1])}s(vB,"Parse");f();var Qa={};cs(Qa,{Assert:()=>hx,Cast:()=>SP,Check:()=>rt,Clean:()=>gx,Clone:()=>wt,Convert:()=>xx,Create:()=>ai,Decode:()=>lB,Default:()=>Ix,Diff:()=>mB,Edit:()=>uB,Encode:()=>yB,Equal:()=>Hp,Errors:()=>Ns,Hash:()=>gc,Mutate:()=>bB,Parse:()=>vB,Patch:()=>hB,ValueErrorIterator:()=>si});f();f();var RP=class RP extends Fe{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));m(this,"schema");this.schema=r}};s(RP,"TypeDereferenceError");var LP=RP;function ale(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new LP(e);return Wp(r,t)}s(ale,"Resolve");function Ox(e,t){return!mt.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}s(Ox,"Pushref");function Wp(e,t){return e[Z]==="This"||e[Z]==="Ref"?ale(e,t):e}s(Wp,"Deref");f();function lle(e,t,r){let n=e.get(t);if(n!==void 0)return n;let o=Us(t,r);return e.set(t,o),o}s(lle,"HasTransformCached");function Ex(){let e=new WeakMap;return{HasTransform:s((t,r)=>lle(e,t,r),"HasTransform")}}s(Ex,"CreateTransformCache");function vr(e,t,r){try{return B.IsTransform(e)?e[or].Decode(r):r}catch(n){throw new Vp(e,t,r,n)}}s(vr,"Default");function cle(e,t,r,n,o){return mt.IsArray(n)?vr(e,r,n.map((i,a)=>Vs(e.items,t,"".concat(r,"/").concat(a),i,o))):vr(e,r,n)}s(cle,"FromArray");function ple(e,t,r,n,o){if(!mt.IsObject(n)||ln(n))return vr(e,r,n);let i=mc(e),a=i.map(h=>h[0]),l=P({},n);for(let[h,y]of i)h in l&&(l[h]=Vs(y,t,"".concat(r,"/").concat(h),l[h],o));if(!B.IsTransform(e.unevaluatedProperties))return vr(e,r,l);let c=Object.getOwnPropertyNames(l),u=e.unevaluatedProperties,d=P({},l);for(let h of c)a.includes(h)||(d[h]=vr(u,"".concat(r,"/").concat(h),d[h]));return vr(e,r,d)}s(ple,"FromIntersect");function ule(e,t,r,n,o){return vr(e,r,Vs(e.not,t,r,n,o))}s(ule,"FromNot");function dle(e,t,r,n,o){if(!mt.IsObject(n))return vr(e,r,n);let i=Qr(e),a=P({},n);for(let d of i)mt.HasPropertyKey(a,d)&&(mt.IsUndefined(a[d])&&(!B.IsUndefined(e.properties[d])||Lt.IsExactOptionalProperty(a,d))||(a[d]=Vs(e.properties[d],t,"".concat(r,"/").concat(d),a[d],o)));if(!B.IsSchema(e.additionalProperties))return vr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,u=P({},a);for(let d of l)i.includes(d)||(u[d]=vr(c,"".concat(r,"/").concat(d),u[d]));return vr(e,r,u)}s(dle,"FromObject");function fle(e,t,r,n,o){if(!mt.IsObject(n))return vr(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l=P({},n);for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(l[h]=Vs(e.patternProperties[i],t,"".concat(r,"/").concat(h),l[h],o));if(!B.IsSchema(e.additionalProperties))return vr(e,r,l);let c=Object.getOwnPropertyNames(l),u=e.additionalProperties,d=P({},l);for(let h of c)a.test(h)||(d[h]=vr(u,"".concat(r,"/").concat(h),d[h]));return vr(e,r,d)}s(fle,"FromRecord");function mle(e,t,r,n,o){let i=Wp(e,t);return vr(e,r,Vs(i,t,r,n,o))}s(mle,"FromRef");function hle(e,t,r,n,o){let i=Wp(e,t);return vr(e,r,Vs(i,t,r,n,o))}s(hle,"FromThis");function yle(e,t,r,n,o){return mt.IsArray(n)&&mt.IsArray(e.items)?vr(e,r,e.items.map((i,a)=>Vs(i,t,"".concat(r,"/").concat(a),n[a],o))):vr(e,r,n)}s(yle,"FromTuple");function gle(e,t,r,n,o){for(let i of e.anyOf){if(!Qa.Check(i,t,n))continue;let a=Vs(i,t,r,n,o);return vr(e,r,a)}return vr(e,r,n)}s(gle,"FromUnion");function Vs(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=Ox(e,t),a=e;switch(e[Z]){case"Array":return cle(a,i,r,n,o);case"Intersect":return ple(a,i,r,n,o);case"Not":return ule(a,i,r,n,o);case"Object":return dle(a,i,r,n,o);case"Record":return fle(a,i,r,n,o);case"Ref":return mle(a,i,r,n,o);case"Symbol":return vr(a,r,n);case"This":return hle(a,i,r,n,o);case"Tuple":return yle(a,i,r,n,o);case"Union":return gle(a,i,r,n,o);default:return vr(a,r,n)}}s(Vs,"Visit");function IB(e,t,r){let n=Ex();return Vs(e,t,"",r,n)}s(IB,"FastTransformDecode");f();function An(e,t,r){try{return B.IsTransform(e)?e[or].Encode(r):r}catch(n){throw new zp(e,t,r,n)}}s(An,"Default");function ble(e,t,r,n,o){let i=An(e,r,n);return mt.IsArray(i)?i.map((a,l)=>zs(e.items,t,"".concat(r,"/").concat(l),a,o)):i}s(ble,"FromArray");function xle(e,t,r,n,o){let i=An(e,r,n);if(!mt.IsObject(n)||ln(n))return i;let a=mc(e),l=a.map(y=>y[0]),c=P({},i);for(let[y,b]of a)y in c&&(c[y]=zs(b,t,"".concat(r,"/").concat(y),c[y],o));if(!B.IsTransform(e.unevaluatedProperties))return c;let u=Object.getOwnPropertyNames(c),d=e.unevaluatedProperties,h=P({},c);for(let y of u)l.includes(y)||(h[y]=An(d,"".concat(r,"/").concat(y),h[y]));return h}s(xle,"FromIntersect");function vle(e,t,r,n){return An(e.not,r,An(e,r,n))}s(vle,"FromNot");function Ile(e,t,r,n,o){let i=An(e,r,n);if(!mt.IsObject(i))return i;let a=Qr(e),l=P({},i);for(let h of a)mt.HasPropertyKey(l,h)&&(mt.IsUndefined(l[h])&&(!B.IsUndefined(e.properties[h])||Lt.IsExactOptionalProperty(l,h))||(l[h]=zs(e.properties[h],t,"".concat(r,"/").concat(h),l[h],o)));if(!B.IsSchema(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),u=e.additionalProperties,d=P({},l);for(let h of c)a.includes(h)||(d[h]=An(u,"".concat(r,"/").concat(h),d[h]));return d}s(Ile,"FromObject");function Sle(e,t,r,n,o){let i=An(e,r,n);if(!mt.IsObject(n))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(a),c=P({},i);for(let y of Object.getOwnPropertyNames(n))l.test(y)&&(c[y]=zs(e.patternProperties[a],t,"".concat(r,"/").concat(y),c[y],o));if(!B.IsSchema(e.additionalProperties))return c;let u=Object.getOwnPropertyNames(c),d=e.additionalProperties,h=P({},c);for(let y of u)l.test(y)||(h[y]=An(d,"".concat(r,"/").concat(y),h[y]));return h}s(Sle,"FromRecord");function Cle(e,t,r,n,o){let i=Wp(e,t),a=zs(i,t,r,n,o);return An(e,r,a)}s(Cle,"FromRef");function Tle(e,t,r,n,o){let i=Wp(e,t),a=zs(i,t,r,n,o);return An(e,r,a)}s(Tle,"FromThis");function Ple(e,t,r,n,o){let i=An(e,r,n);return mt.IsArray(e.items)?e.items.map((a,l)=>zs(a,t,"".concat(r,"/").concat(l),i[l],o)):[]}s(Ple,"FromTuple");function wle(e,t,r,n,o){for(let i of e.anyOf){if(!Qa.Check(i,t,n))continue;let a=zs(i,t,r,n,o);return An(e,r,a)}for(let i of e.anyOf){let a=zs(i,t,r,n,o);if(Qa.Check(e,t,a))return An(e,r,a)}return An(e,r,n)}s(wle,"FromUnion");function zs(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=Ox(e,t),a=e;switch(e[Z]){case"Array":return ble(a,i,r,n,o);case"Intersect":return xle(a,i,r,n,o);case"Not":return vle(a,i,r,n);case"Object":return Ile(a,i,r,n,o);case"Record":return Sle(a,i,r,n,o);case"Ref":return Cle(a,i,r,n,o);case"This":return Tle(a,i,r,n,o);case"Tuple":return Ple(a,i,r,n,o);case"Union":return wle(a,i,r,n,o);default:return An(a,r,n)}}s(zs,"Visit");function SB(e,t,r){let n=Ex();return zs(e,t,"",r,n)}s(SB,"FastTransformEncode");f();var GP=class GP{constructor(t,r,n,o){this.schema=t,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=Us(t,r)}Code(){return this.code}Errors(t){return Ns(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new Lf(this.schema,t,this.Errors(t).First());return this.hasTransform?Rf(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?vx(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new Nf(this.schema,t,this.Errors(t).First());return r}};s(GP,"TypeCheck");var NP=GP,el;(function(e){function t(i){return i===36}s(t,"DollarSign"),e.DollarSign=t;function r(i){return i===95}s(r,"IsUnderscore"),e.IsUnderscore=r;function n(i){return i>=65&&i<=90||i>=97&&i<=122}s(n,"IsAlpha"),e.IsAlpha=n;function o(i){return i>=48&&i<=57}s(o,"IsNumeric"),e.IsNumeric=o})(el||(el={}));var _x;(function(e){function t(i){return i.length===0?!1:el.IsNumeric(i.charCodeAt(0))}s(t,"IsFirstCharacterNumeric");function r(i){if(t(i))return!1;for(let a=0;a<i.length;a++){let l=i.charCodeAt(a);if(!(el.IsAlpha(l)||el.IsNumeric(l)||el.DollarSign(l)||el.IsUnderscore(l)))return!1}return!0}s(r,"IsAccessor");function n(i){return i.replace(/'/g,"\\'")}s(n,"EscapeHyphen");function o(i,a){return r(a)?"".concat(i,".").concat(a):"".concat(i,"['").concat(n(a),"']")}s(o,"Encode"),e.Encode=o})(_x||(_x={}));var BP;(function(e){function t(r){let n=[];for(let o=0;o<r.length;o++){let i=r.charCodeAt(o);el.IsNumeric(i)||el.IsAlpha(i)?n.push(r.charAt(o)):n.push("_".concat(i,"_"))}return n.join("").replace(/__/g,"_")}s(t,"Encode"),e.Encode=t})(BP||(BP={}));var $P;(function(e){function t(r){return r.replace(/'/g,"\\'")}s(t,"Escape"),e.Escape=t})($P||($P={}));var UP=class UP extends Fe{constructor(t){super("Unknown type"),this.schema=t}};s(UP,"TypeCompilerUnknownTypeError");var jP=UP,VP=class VP extends Fe{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};s(VP,"TypeCompilerTypeGuardError");var kx=VP,qp;(function(e){function t(a,l,c){return Lt.ExactOptionalPropertyTypes?"('".concat(l,"' in ").concat(a," ? ").concat(c," : true)"):"(".concat(_x.Encode(a,l)," !== undefined ? ").concat(c," : true)")}s(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){return Lt.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null)"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,"))")}s(r,"IsObjectLike"),e.IsObjectLike=r;function n(a){return Lt.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,") && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))")}s(n,"IsRecordLike"),e.IsRecordLike=n;function o(a){return Lt.AllowNaN?"typeof ".concat(a," === 'number'"):"Number.isFinite(".concat(a,")")}s(o,"IsNumberLike"),e.IsNumberLike=o;function i(a){return Lt.AllowNullVoid?"(".concat(a," === undefined || ").concat(a," === null)"):"".concat(a," === undefined")}s(i,"IsVoidLike"),e.IsVoidLike=i})(qp||(qp={}));var Ax;(function(e){function t(D){return D[Z]==="Any"||D[Z]==="Unknown"}s(t,"IsAnyOrUnknown");function*r(D,K,N){yield"true"}s(r,"FromAny");function*n(D,K,N){yield"Array.isArray(".concat(N,")");let[pe,le]=[Ye("value","any"),Ye("acc","number")];ke(D.maxItems)&&(yield"".concat(N,".length <= ").concat(D.maxItems)),ke(D.minItems)&&(yield"".concat(N,".length >= ").concat(D.minItems));let ce=Ne(D.items,K,"value");if(yield"".concat(N,".every((").concat(pe,") => ").concat(ce,")"),yt(D.contains)||ke(D.minContains)||ke(D.maxContains)){let Ce=yt(D.contains)?D.contains:Bt(),pr=Ne(Ce,K,"value"),Bn=ke(D.minContains)?["(count >= ".concat(D.minContains,")")]:[],rn=ke(D.maxContains)?["(count <= ".concat(D.maxContains,")")]:[],In="const count = value.reduce((".concat(le,", ").concat(pe,") => ").concat(pr," ? acc + 1 : acc, 0)"),tp=["(count > 0)",...Bn,...rn].join(" && ");yield"((".concat(pe,") => { ").concat(In,"; return ").concat(tp,"})(").concat(N,")")}if(D.uniqueItems===!0){let pr="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(pe,") => { ").concat(pr," )(").concat(N,")")}}s(n,"FromArray");function*o(D,K,N){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(N,")")}s(o,"FromAsyncIterator");function*i(D,K,N){yield"(typeof ".concat(N," === 'bigint')"),an(D.exclusiveMaximum)&&(yield"".concat(N," < BigInt(").concat(D.exclusiveMaximum,")")),an(D.exclusiveMinimum)&&(yield"".concat(N," > BigInt(").concat(D.exclusiveMinimum,")")),an(D.maximum)&&(yield"".concat(N," <= BigInt(").concat(D.maximum,")")),an(D.minimum)&&(yield"".concat(N," >= BigInt(").concat(D.minimum,")")),an(D.multipleOf)&&(yield"(".concat(N," % BigInt(").concat(D.multipleOf,")) === 0"))}s(i,"FromBigInt");function*a(D,K,N){yield"(typeof ".concat(N," === 'boolean')")}s(a,"FromBoolean");function*l(D,K,N){yield*ie(we(D.returns,K,"".concat(N,".prototype")))}s(l,"FromConstructor");function*c(D,K,N){yield"(".concat(N," instanceof Date) && Number.isFinite(").concat(N,".getTime())"),ke(D.exclusiveMaximumTimestamp)&&(yield"".concat(N,".getTime() < ").concat(D.exclusiveMaximumTimestamp)),ke(D.exclusiveMinimumTimestamp)&&(yield"".concat(N,".getTime() > ").concat(D.exclusiveMinimumTimestamp)),ke(D.maximumTimestamp)&&(yield"".concat(N,".getTime() <= ").concat(D.maximumTimestamp)),ke(D.minimumTimestamp)&&(yield"".concat(N,".getTime() >= ").concat(D.minimumTimestamp)),ke(D.multipleOfTimestamp)&&(yield"(".concat(N,".getTime() % ").concat(D.multipleOfTimestamp,") === 0"))}s(c,"FromDate");function*u(D,K,N){yield"(typeof ".concat(N," === 'function')")}s(u,"FromFunction");function*d(D,K,N){yield"Number.isInteger(".concat(N,")"),ke(D.exclusiveMaximum)&&(yield"".concat(N," < ").concat(D.exclusiveMaximum)),ke(D.exclusiveMinimum)&&(yield"".concat(N," > ").concat(D.exclusiveMinimum)),ke(D.maximum)&&(yield"".concat(N," <= ").concat(D.maximum)),ke(D.minimum)&&(yield"".concat(N," >= ").concat(D.minimum)),ke(D.multipleOf)&&(yield"(".concat(N," % ").concat(D.multipleOf,") === 0"))}s(d,"FromInteger");function*h(D,K,N){let pe=D.allOf.map(le=>Ne(le,K,N)).join(" && ");if(D.unevaluatedProperties===!1){let le=st("".concat(new RegExp(qa(D)),";")),ce="Object.getOwnPropertyNames(".concat(N,").every(key => ").concat(le,".test(key))");yield"(".concat(pe," && ").concat(ce,")")}else if(yt(D.unevaluatedProperties)){let le=st("".concat(new RegExp(qa(D)),";")),ce="Object.getOwnPropertyNames(".concat(N,").every(key => ").concat(le,".test(key) || ").concat(Ne(D.unevaluatedProperties,K,"".concat(N,"[key]")),")");yield"(".concat(pe," && ").concat(ce,")")}else yield"(".concat(pe,")")}s(h,"FromIntersect");function*y(D,K,N){yield"(typeof value === 'object' && Symbol.iterator in ".concat(N,")")}s(y,"FromIterator");function*b(D,K,N){typeof D.const=="number"||typeof D.const=="boolean"?yield"(".concat(N," === ").concat(D.const,")"):yield"(".concat(N," === '").concat($P.Escape(D.const),"')")}s(b,"FromLiteral");function*I(D,K,N){yield"false"}s(I,"FromNever");function*S(D,K,N){let pe=Ne(D.not,K,N);yield"(!".concat(pe,")")}s(S,"FromNot");function*x(D,K,N){yield"(".concat(N," === null)")}s(x,"FromNull");function*T(D,K,N){yield qp.IsNumberLike(N),ke(D.exclusiveMaximum)&&(yield"".concat(N," < ").concat(D.exclusiveMaximum)),ke(D.exclusiveMinimum)&&(yield"".concat(N," > ").concat(D.exclusiveMinimum)),ke(D.maximum)&&(yield"".concat(N," <= ").concat(D.maximum)),ke(D.minimum)&&(yield"".concat(N," >= ").concat(D.minimum)),ke(D.multipleOf)&&(yield"(".concat(N," % ").concat(D.multipleOf,") === 0"))}s(T,"FromNumber");function*w(D,K,N){yield qp.IsObjectLike(N),ke(D.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(N,").length >= ").concat(D.minProperties)),ke(D.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(N,").length <= ").concat(D.maxProperties));let pe=Object.getOwnPropertyNames(D.properties);for(let le of pe){let ce=_x.Encode(N,le),Ce=D.properties[le];if(D.required&&D.required.includes(le))yield*ie(we(Ce,K,ce)),(Xa(Ce)||t(Ce))&&(yield"('".concat(le,"' in ").concat(N,")"));else{let pr=Ne(Ce,K,ce);yield qp.IsExactOptionalProperty(N,le,pr)}}if(D.additionalProperties===!1)if(D.required&&D.required.length===pe.length)yield"Object.getOwnPropertyNames(".concat(N,").length === ").concat(pe.length);else{let le="[".concat(pe.map(ce=>"'".concat(ce,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(N,").every(key => ").concat(le,".includes(key))")}if(typeof D.additionalProperties=="object"){let le=Ne(D.additionalProperties,K,"".concat(N,"[key]")),ce="[".concat(pe.map(Ce=>"'".concat(Ce,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(N,").every(key => ").concat(ce,".includes(key) || ").concat(le,"))")}}s(w,"FromObject");function*M(D,K,N){yield"(typeof value === 'object' && typeof ".concat(N,".then === 'function')")}s(M,"FromPromise");function*O(D,K,N){yield qp.IsRecordLike(N),ke(D.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(N,").length >= ").concat(D.minProperties)),ke(D.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(N,").length <= ").concat(D.maxProperties));let[pe,le]=Object.entries(D.patternProperties)[0],ce=st("".concat(new RegExp(pe))),Ce=Ne(le,K,"value"),pr=yt(D.additionalProperties)?Ne(D.additionalProperties,K,N):D.additionalProperties===!1?"false":"true",Bn="(".concat(ce,".test(key) ? ").concat(Ce," : ").concat(pr,")");yield"(Object.entries(".concat(N,").every(([key, value]) => ").concat(Bn,"))")}s(O,"FromRecord");function*_(D,K,N){let pe=Pt(D,K);if(ye.functions.has(D.$ref))return yield"".concat(nt(D.$ref),"(").concat(N,")");yield*ie(we(pe,K,N))}s(_,"FromRef");function*$(D,K,N){let pe=st("".concat(new RegExp(D.source,D.flags),";"));yield"(typeof ".concat(N," === 'string')"),ke(D.maxLength)&&(yield"".concat(N,".length <= ").concat(D.maxLength)),ke(D.minLength)&&(yield"".concat(N,".length >= ").concat(D.minLength)),yield"".concat(pe,".test(").concat(N,")")}s($,"FromRegExp");function*j(D,K,N){if(yield"(typeof ".concat(N," === 'string')"),ke(D.maxLength)&&(yield"".concat(N,".length <= ").concat(D.maxLength)),ke(D.minLength)&&(yield"".concat(N,".length >= ").concat(D.minLength)),D.pattern!==void 0){let pe=st("".concat(new RegExp(D.pattern),";"));yield"".concat(pe,".test(").concat(N,")")}D.format!==void 0&&(yield"format('".concat(D.format,"', ").concat(N,")"))}s(j,"FromString");function*F(D,K,N){yield"(typeof ".concat(N," === 'symbol')")}s(F,"FromSymbol");function*L(D,K,N){yield"(typeof ".concat(N," === 'string')");let pe=st("".concat(new RegExp(D.pattern),";"));yield"".concat(pe,".test(").concat(N,")")}s(L,"FromTemplateLiteral");function*q(D,K,N){yield"".concat(nt(D.$ref),"(").concat(N,")")}s(q,"FromThis");function*U(D,K,N){if(yield"Array.isArray(".concat(N,")"),D.items===void 0)return yield"".concat(N,".length === 0");yield"(".concat(N,".length === ").concat(D.maxItems,")");for(let pe=0;pe<D.items.length;pe++){let le=Ne(D.items[pe],K,"".concat(N,"[").concat(pe,"]"));yield"".concat(le)}}s(U,"FromTuple");function*V(D,K,N){yield"".concat(N," === undefined")}s(V,"FromUndefined");function*Q(D,K,N){let pe=D.anyOf.map(le=>Ne(le,K,N));yield"(".concat(pe.join(" || "),")")}s(Q,"FromUnion");function*Y(D,K,N){yield"".concat(N," instanceof Uint8Array"),ke(D.maxByteLength)&&(yield"(".concat(N,".length <= ").concat(D.maxByteLength,")")),ke(D.minByteLength)&&(yield"(".concat(N,".length >= ").concat(D.minByteLength,")"))}s(Y,"FromUint8Array");function*se(D,K,N){yield"true"}s(se,"FromUnknown");function*re(D,K,N){yield qp.IsVoidLike(N)}s(re,"FromVoid");function*ve(D,K,N){let pe=ye.instances.size;ye.instances.set(pe,D),yield"kind('".concat(D[Z],"', ").concat(pe,", ").concat(N,")")}s(ve,"FromKind");function*we(D,K,N,pe=!0){let le=ht(D.$id)?[...K,D]:K,ce=D;if(pe&&ht(D.$id)){let Ce=nt(D.$id);if(ye.functions.has(Ce))return yield"".concat(Ce,"(").concat(N,")");{let pr=qe(Ce,D,K,"value",!1);return ye.functions.set(Ce,pr),yield"".concat(Ce,"(").concat(N,")")}}switch(ce[Z]){case"Any":return yield*ie(r(ce,le,N));case"Array":return yield*ie(n(ce,le,N));case"AsyncIterator":return yield*ie(o(ce,le,N));case"BigInt":return yield*ie(i(ce,le,N));case"Boolean":return yield*ie(a(ce,le,N));case"Constructor":return yield*ie(l(ce,le,N));case"Date":return yield*ie(c(ce,le,N));case"Function":return yield*ie(u(ce,le,N));case"Integer":return yield*ie(d(ce,le,N));case"Intersect":return yield*ie(h(ce,le,N));case"Iterator":return yield*ie(y(ce,le,N));case"Literal":return yield*ie(b(ce,le,N));case"Never":return yield*ie(I(ce,le,N));case"Not":return yield*ie(S(ce,le,N));case"Null":return yield*ie(x(ce,le,N));case"Number":return yield*ie(T(ce,le,N));case"Object":return yield*ie(w(ce,le,N));case"Promise":return yield*ie(M(ce,le,N));case"Record":return yield*ie(O(ce,le,N));case"Ref":return yield*ie(_(ce,le,N));case"RegExp":return yield*ie($(ce,le,N));case"String":return yield*ie(j(ce,le,N));case"Symbol":return yield*ie(F(ce,le,N));case"TemplateLiteral":return yield*ie(L(ce,le,N));case"This":return yield*ie(q(ce,le,N));case"Tuple":return yield*ie(U(ce,le,N));case"Undefined":return yield*ie(V(ce,le,N));case"Union":return yield*ie(Q(ce,le,N));case"Uint8Array":return yield*ie(Y(ce,le,N));case"Unknown":return yield*ie(se(ce,le,N));case"Void":return yield*ie(re(ce,le,N));default:if(!Vr.Has(ce[Z]))throw new jP(D);return yield*ie(ve(ce,le,N))}}s(we,"Visit");let ye={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Ne(D,K,N,pe=!0){return"(".concat([...we(D,K,N,pe)].join(" && "),")")}s(Ne,"CreateExpression");function nt(D){return"check_".concat(BP.Encode(D))}s(nt,"CreateFunctionName");function st(D){let K="local_".concat(ye.variables.size);return ye.variables.set(K,"const ".concat(K," = ").concat(D)),K}s(st,"CreateVariable");function qe(D,K,N,pe,le=!0){let[ce,Ce]=["\n",In=>"".padStart(In," ")],pr=Ye("value","any"),Bn=de("boolean"),rn=[...we(K,N,pe,le)].map(In=>"".concat(Ce(4)).concat(In)).join(" &&".concat(ce));return"function ".concat(D,"(").concat(pr,")").concat(Bn," {").concat(ce).concat(Ce(2),"return (").concat(ce).concat(rn).concat(ce).concat(Ce(2),")\n}")}s(qe,"CreateFunction");function Ye(D,K){let N=ye.language==="typescript"?": ".concat(K):"";return"".concat(D).concat(N)}s(Ye,"CreateParameter");function de(D){return ye.language==="typescript"?": ".concat(D):""}s(de,"CreateReturns");function ge(D,K,N){let pe=qe("check",D,K,"value"),le=Ye("value","any"),ce=de("boolean"),Ce=[...ye.functions.values()],pr=[...ye.variables.values()],Bn=ht(D.$id)?"return function check(".concat(le,")").concat(ce," {\n return ").concat(nt(D.$id),"(value)\n}"):"return ".concat(pe);return[...pr,...Ce,Bn].join("\n")}s(ge,"Build");function me(...D){let K={language:"javascript"},[N,pe,le]=D.length===2&&He(D[1])?[D[0],D[1],K]:D.length===2&&!He(D[1])?[D[0],[],D[1]]:D.length===3?[D[0],D[1],D[2]]:D.length===1?[D[0],[],K]:[null,[],K];if(ye.language=le.language,ye.variables.clear(),ye.functions.clear(),ye.instances.clear(),!yt(N))throw new kx(N);for(let ce of pe)if(!yt(ce))throw new kx(ce);return ge(N,pe,le)}s(me,"Code"),e.Code=me;function oe(D,K=[]){let N=me(D,K,{language:"javascript"}),pe=globalThis.Function("kind","format","hash",N),le=new Map(ye.instances);function ce(rn,In,tp){if(!Vr.Has(rn)||!le.has(In))return!1;let DI=Vr.Get(rn),FI=le.get(In);return DI(FI,tp)}s(ce,"typeRegistryFunction");function Ce(rn,In){return qn.Has(rn)?qn.Get(rn)(In):!1}s(Ce,"formatRegistryFunction");function pr(rn){return gc(rn)}s(pr,"hashFunction");let Bn=pe(ce,Ce,pr);return new NP(D,K,Bn,N)}s(oe,"Compile"),e.Compile=oe})(Ax||(Ax={}));f();f();var CB={},Mle=s(function(e,t,r,n,o){var i=new Worker(CB[t]||(CB[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(a){var l=a.data,c=l.$e$;if(c){var u=new Error(c[0]);u.code=c[1],u.stack=c[2],o(u,null)}else o(null,l)},i.postMessage(r,n),i},"wk"),Qt=Uint8Array,Xn=Uint16Array,Jy=Int32Array,Gf=new Qt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Uf=new Qt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yy=new Qt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),MB=s(function(e,t){for(var r=new Xn(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Jy(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},"freb"),OB=MB(Gf,2),YP=OB.b,Nx=OB.r;YP[28]=258,Nx[258]=28;var EB=MB(Uf,0),_B=EB.b,HP=EB.r,Ky=new Xn(32768);for(Ft=0;Ft<32768;++Ft)tl=(Ft&43690)>>1|(Ft&21845)<<1,tl=(tl&52428)>>2|(tl&13107)<<2,tl=(tl&61680)>>4|(tl&3855)<<4,Ky[Ft]=((tl&65280)>>8|(tl&255)<<8)>>1;var tl,Ft,pi=s(function(e,t,r){for(var n=e.length,o=0,i=new Xn(t);o<n;++o)e[o]&&++i[e[o]-1];var a=new Xn(t);for(o=1;o<t;++o)a[o]=a[o-1]+i[o-1]<<1;var l;if(r){l=new Xn(1<<t);var c=15-t;for(o=0;o<n;++o)if(e[o])for(var u=o<<4|e[o],d=t-e[o],h=a[e[o]-1]++<<d,y=h|(1<<d)-1;h<=y;++h)l[Ky[h]>>c]=u}else for(l=new Xn(n),o=0;o<n;++o)e[o]&&(l[o]=Ky[a[e[o]-1]++]>>15-e[o]);return l},"hMap"),rl=new Qt(288);for(Ft=0;Ft<144;++Ft)rl[Ft]=8;var Ft;for(Ft=144;Ft<256;++Ft)rl[Ft]=9;var Ft;for(Ft=256;Ft<280;++Ft)rl[Ft]=7;var Ft;for(Ft=280;Ft<288;++Ft)rl[Ft]=8;var Ft,jf=new Qt(32);for(Ft=0;Ft<32;++Ft)jf[Ft]=5;var Ft,kB=pi(rl,9,0),AB=pi(rl,9,1),DB=pi(jf,5,0),FB=pi(jf,5,1),Fx=s(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),ci=s(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),Lx=s(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),Qy=s(function(e){return(e+7)/8|0},"shft"),Zp=s(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Qt(e.subarray(t,r))},"slc"),Gx={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},LB=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rr=s(function(e,t,r){var n=new Error(t||LB[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Rr),!r)throw n;return n},"err"),RB=s(function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new Qt(0);var a=!r,l=a||t.i!=2,c=t.i;a&&(r=new Qt(o*3));var u=s(function(N){var pe=r.length;if(N>pe){var le=new Qt(Math.max(pe*2,N));le.set(r),r=le}},"cbuf"),d=t.f||0,h=t.p||0,y=t.b||0,b=t.l,I=t.d,S=t.m,x=t.n,T=o*8;do{if(!b){d=ci(e,h,1);var w=ci(e,h+1,3);if(h+=3,w)if(w==1)b=AB,I=FB,S=9,x=5;else if(w==2){var $=ci(e,h,31)+257,j=ci(e,h+10,15)+4,F=$+ci(e,h+5,31)+1;h+=14;for(var L=new Qt(F),q=new Qt(19),U=0;U<j;++U)q[Yy[U]]=ci(e,h+U*3,7);h+=j*3;for(var V=Fx(q),Q=(1<<V)-1,Y=pi(q,V,1),U=0;U<F;){var se=Y[ci(e,h,Q)];h+=se&15;var M=se>>4;if(M<16)L[U++]=M;else{var re=0,ve=0;for(M==16?(ve=3+ci(e,h,3),h+=2,re=L[U-1]):M==17?(ve=3+ci(e,h,7),h+=3):M==18&&(ve=11+ci(e,h,127),h+=7);ve--;)L[U++]=re}}var we=L.subarray(0,$),ye=L.subarray($);S=Fx(we),x=Fx(ye),b=pi(we,S,1),I=pi(ye,x,1)}else Rr(1);else{var M=Qy(h)+4,O=e[M-4]|e[M-3]<<8,_=M+O;if(_>o){c&&Rr(0);break}l&&u(y+O),r.set(e.subarray(M,_),y),t.b=y+=O,t.p=h=_*8,t.f=d;continue}if(h>T){c&&Rr(0);break}}l&&u(y+131072);for(var Ne=(1<<S)-1,nt=(1<<x)-1,st=h;;st=h){var re=b[Lx(e,h)&Ne],qe=re>>4;if(h+=re&15,h>T){c&&Rr(0);break}if(re||Rr(2),qe<256)r[y++]=qe;else if(qe==256){st=h,b=null;break}else{var Ye=qe-254;if(qe>264){var U=qe-257,de=Gf[U];Ye=ci(e,h,(1<<de)-1)+YP[U],h+=de}var ge=I[Lx(e,h)&nt],me=ge>>4;ge||Rr(3),h+=ge&15;var ye=_B[me];if(me>3){var de=Uf[me];ye+=Lx(e,h)&(1<<de)-1,h+=de}if(h>T){c&&Rr(0);break}l&&u(y+131072);var oe=y+Ye;if(y<ye){var D=i-ye,K=Math.min(ye,oe);for(D+y<0&&Rr(3);y<K;++y)r[y]=n[D+y]}for(;y<oe;++y)r[y]=r[y-ye]}}t.l=b,t.p=st,t.b=y,t.f=d,b&&(d=1,t.m=S,t.d=I,t.n=x)}while(!d);return y!=r.length&&a?Zp(r,0,y):r.subarray(0,y)},"inflt"),Hs=s(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),Bf=s(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},"wbits16"),Rx=s(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:JP,l:0};if(o==1){var a=new Qt(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort(function(_,$){return _.f-$.f}),r.push({s:-1,f:25001});var l=r[0],c=r[1],u=0,d=1,h=2;for(r[0]={s:-1,f:l.f+c.f,l,r:c};d!=o-1;)l=r[r[u].f<r[h].f?u++:h++],c=r[u!=d&&r[u].f<r[h].f?u++:h++],r[d++]={s:-1,f:l.f+c.f,l,r:c};for(var y=i[0].s,n=1;n<o;++n)i[n].s>y&&(y=i[n].s);var b=new Xn(y+1),I=Bx(r[d-1],b,0);if(I>t){var n=0,S=0,x=I-t,T=1<<x;for(i.sort(function($,j){return b[j.s]-b[$.s]||$.f-j.f});n<o;++n){var w=i[n].s;if(b[w]>t)S+=T-(1<<I-b[w]),b[w]=t;else break}for(S>>=x;S>0;){var M=i[n].s;b[M]<t?S-=1<<t-b[M]++-1:++n}for(;n>=0&&S;--n){var O=i[n].s;b[O]==t&&(--b[O],++S)}I=t}return{t:new Qt(b),l:I}},"hTree"),Bx=s(function(e,t,r){return e.s==-1?Math.max(Bx(e.l,t,r+1),Bx(e.r,t,r+1)):t[e.s]=r},"ln"),WP=s(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Xn(++t),n=0,o=e[0],i=1,a=s(function(c){r[n++]=c},"w"),l=1;l<=t;++l)if(e[l]==o&&l!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[l]}return{c:r.subarray(0,n),n:t}},"lc"),$f=s(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),KP=s(function(e,t,r){var n=r.length,o=Qy(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},"wfblk"),qP=s(function(e,t,r,n,o,i,a,l,c,u,d){Hs(t,d++,r),++o[256];for(var h=Rx(o,15),y=h.t,b=h.l,I=Rx(i,15),S=I.t,x=I.l,T=WP(y),w=T.c,M=T.n,O=WP(S),_=O.c,$=O.n,j=new Xn(19),F=0;F<w.length;++F)++j[w[F]&31];for(var F=0;F<_.length;++F)++j[_[F]&31];for(var L=Rx(j,7),q=L.t,U=L.l,V=19;V>4&&!q[Yy[V-1]];--V);var Q=u+5<<3,Y=$f(o,rl)+$f(i,jf)+a,se=$f(o,y)+$f(i,S)+a+14+3*V+$f(j,q)+2*j[16]+3*j[17]+7*j[18];if(c>=0&&Q<=Y&&Q<=se)return KP(t,d,e.subarray(c,c+u));var re,ve,we,ye;if(Hs(t,d,1+(se<Y)),d+=2,se<Y){re=pi(y,b,0),ve=y,we=pi(S,x,0),ye=S;var Ne=pi(q,U,0);Hs(t,d,M-257),Hs(t,d+5,$-1),Hs(t,d+10,V-4),d+=14;for(var F=0;F<V;++F)Hs(t,d+3*F,q[Yy[F]]);d+=3*V;for(var nt=[w,_],st=0;st<2;++st)for(var qe=nt[st],F=0;F<qe.length;++F){var Ye=qe[F]&31;Hs(t,d,Ne[Ye]),d+=q[Ye],Ye>15&&(Hs(t,d,qe[F]>>5&127),d+=qe[F]>>12)}}else re=kB,ve=rl,we=DB,ye=jf;for(var F=0;F<l;++F){var de=n[F];if(de>255){var Ye=de>>18&31;Bf(t,d,re[Ye+257]),d+=ve[Ye+257],Ye>7&&(Hs(t,d,de>>23&31),d+=Gf[Ye]);var ge=de&31;Bf(t,d,we[ge]),d+=ye[ge],ge>3&&(Bf(t,d,de>>5&8191),d+=Uf[ge])}else Bf(t,d,re[de]),d+=ve[de]}return Bf(t,d,re[256]),d+ve[256]},"wblk"),NB=new Jy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),JP=new Qt(0),BB=s(function(e,t,r,n,o,i){var a=i.z||e.length,l=new Qt(n+a+5*(1+Math.ceil(a/7e3))+o),c=l.subarray(n,l.length-o),u=i.l,d=(i.r||0)&7;if(t){d&&(c[0]=i.r>>3);for(var h=NB[t-1],y=h>>13,b=h&8191,I=(1<<r)-1,S=i.p||new Xn(32768),x=i.h||new Xn(I+1),T=Math.ceil(r/3),w=2*T,M=s(function(ce){return(e[ce]^e[ce+1]<<T^e[ce+2]<<w)&I},"hsh"),O=new Jy(25e3),_=new Xn(288),$=new Xn(32),j=0,F=0,L=i.i||0,q=0,U=i.w||0,V=0;L+2<a;++L){var Q=M(L),Y=L&32767,se=x[Q];if(S[Y]=se,x[Q]=Y,U<=L){var re=a-L;if((j>7e3||q>24576)&&(re>423||!u)){d=qP(e,c,0,O,_,$,F,q,V,L-V,d),q=j=F=0,V=L;for(var ve=0;ve<286;++ve)_[ve]=0;for(var ve=0;ve<30;++ve)$[ve]=0}var we=2,ye=0,Ne=b,nt=Y-se&32767;if(re>2&&Q==M(L-nt))for(var st=Math.min(y,re)-1,qe=Math.min(32767,L),Ye=Math.min(258,re);nt<=qe&&--Ne&&Y!=se;){if(e[L+we]==e[L+we-nt]){for(var de=0;de<Ye&&e[L+de]==e[L+de-nt];++de);if(de>we){if(we=de,ye=nt,de>st)break;for(var ge=Math.min(nt,de-2),me=0,ve=0;ve<ge;++ve){var oe=L-nt+ve&32767,D=S[oe],K=oe-D&32767;K>me&&(me=K,se=oe)}}}Y=se,se=S[Y],nt+=Y-se&32767}if(ye){O[q++]=268435456|Nx[we]<<18|HP[ye];var N=Nx[we]&31,pe=HP[ye]&31;F+=Gf[N]+Uf[pe],++_[257+N],++$[pe],U=L+we,++j}else O[q++]=e[L],++_[e[L]]}}for(L=Math.max(L,U);L<a;++L)O[q++]=e[L],++_[e[L]];d=qP(e,c,u,O,_,$,F,q,V,L-V,d),u||(i.r=d&7|c[d/8|0]<<3,d-=7,i.h=x,i.p=S,i.i=L,i.w=U)}else{for(var L=i.w||0;L<a+u;L+=65535){var le=L+65535;le>=a&&(c[d/8|0]=u,le=a),d=KP(c,d+1,e.subarray(L,le))}i.i=a}return Zp(l,0,n+Qy(d)+o)},"dflt"),Ole=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),Ele=s(function(){var e=-1;return{p:s(function(t){for(var r=e,n=0;n<t.length;++n)r=Ole[r&255^t[n]]^r>>>8;e=r},"p"),d:s(function(){return~e},"d")}},"crc");var $B=s(function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new Qt(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return BB(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)},"dopt"),QP=s(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg"),TB=s(function(e,t,r){for(var n=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<n.length;++a){var l=n[a],c=i[a];if(typeof l=="function"){t+=";"+c+"=";var u=l.toString();if(l.prototype)if(u.indexOf("[native code]")!=-1){var d=u.indexOf(" ",8)+1;t+=u.slice(d,u.indexOf("(",d))}else{t+=u;for(var h in l.prototype)t+=";"+c+".prototype."+h+"="+l.prototype[h].toString()}else t+=u}else r[c]=l}return t},"wcln"),Dx=[],_le=s(function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},"cbfs"),kle=s(function(e,t,r,n){if(!Dx[r]){for(var o="",i={},a=e.length-1,l=0;l<a;++l)o=TB(e[l],o,i);Dx[r]={c:TB(e[a],o,i),e:i}}var c=QP({},Dx[r].e);return Mle(Dx[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,c,_le(c),n)},"wrkr"),Ale=s(function(){return[Qt,Xn,Jy,Gf,Uf,Yy,YP,_B,AB,FB,Ky,LB,pi,Fx,ci,Lx,Qy,Zp,Rr,RB,tw,Ux,jB]},"bInflt"),Dle=s(function(){return[Qt,Xn,Jy,Gf,Uf,Yy,Nx,HP,kB,rl,DB,jf,Ky,NB,JP,pi,Hs,Bf,Rx,Bx,WP,$f,KP,qP,Qy,Zp,BB,$B,ew,Ux]},"bDflt");var Ux=s(function(e){return postMessage(e,[e.buffer])},"pbf"),jB=s(function(e){return e&&{out:e.size&&new Qt(e.size),dictionary:e.dictionary}},"gopt"),GB=s(function(e,t,r,n,o,i){var a=kle(r,n,o,function(l,c){a.terminate(),i(l,c)});return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},"cbify");var Ws=s(function(e,t){return e[t]|e[t+1]<<8},"b2"),zi=s(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),zP=s(function(e,t){return zi(e,t)+zi(e,t+4)*4294967296},"b8"),dn=s(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function Fle(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Rr(7),GB(e,t,[Dle],function(n){return Ux(ew(n.data[0],n.data[1]))},0,r)}s(Fle,"deflate");function ew(e,t){return $B(e,t||{},0,0)}s(ew,"deflateSync");function Lle(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Rr(7),GB(e,t,[Ale],function(n){return Ux(tw(n.data[0],jB(n.data[1])))},1,r)}s(Lle,"inflate");function tw(e,t){return RB(e,{i:2},t&&t.out,t&&t.dictionary)}s(tw,"inflateSync");var UB=s(function(e,t,r,n){for(var o in e){var i=e[o],a=t+o,l=n;Array.isArray(i)&&(l=QP(n,i[1]),i=i[0]),i instanceof Qt?r[a]=[i,l]:(r[a+="/"]=[new Qt(0),l],UB(i,a,r,n))}},"fltn"),PB=typeof TextEncoder<"u"&&new TextEncoder,ZP=typeof TextDecoder<"u"&&new TextDecoder,Rle=0;try{ZP.decode(JP,{stream:!0}),Rle=1}catch(e){}var Nle=s(function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return{s:t,r:Zp(e,r-1)};o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}},"dutf8");function $x(e,t){if(t){for(var r=new Qt(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(PB)return PB.encode(e);for(var o=e.length,i=new Qt(e.length+(e.length>>1)),a=0,l=s(function(d){i[a++]=d},"w"),n=0;n<o;++n){if(a+5>i.length){var c=new Qt(a+8+(o-n<<1));c.set(i),i=c}var u=e.charCodeAt(n);u<128||t?l(u):u<2048?(l(192|u>>6),l(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++n)&1023,l(240|u>>18),l(128|u>>12&63),l(128|u>>6&63),l(128|u&63)):(l(224|u>>12),l(128|u>>6&63),l(128|u&63))}return Zp(i,0,a)}s($x,"strToU8");function rw(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(ZP)return ZP.decode(e);var o=Nle(e),i=o.s,r=o.r;return r.length&&Rr(8),i}}s(rw,"strFromU8");var Ble=s(function(e,t){return t+30+Ws(e,t+26)+Ws(e,t+28)},"slzh"),$le=s(function(e,t,r){var n=Ws(e,t+28),o=rw(e.subarray(t+46,t+46+n),!(Ws(e,t+8)&2048)),i=t+46+n,a=zi(e,t+20),l=r&&a==4294967295?jle(e,i):[a,zi(e,t+24),zi(e,t+42)],c=l[0],u=l[1],d=l[2];return[Ws(e,t+10),c,u,o,i+Ws(e,t+30)+Ws(e,t+32),d]},"zh"),jle=s(function(e,t){for(;Ws(e,t)!=1;t+=4+Ws(e,t+2));return[zP(e,t+12),zP(e,t+4),zP(e,t+20)]},"z64e"),XP=s(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&Rr(9),t+=n+4}return t},"exfl"),wB=s(function(e,t,r,n,o,i,a,l){var c=n.length,u=r.extra,d=l&&l.length,h=XP(u);dn(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=o&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var y=new Date(r.mtime==null?Date.now():r.mtime),b=y.getFullYear()-1980;if((b<0||b>119)&&Rr(10),dn(e,t,b<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>1),t+=4,i!=-1&&(dn(e,t,r.crc),dn(e,t+4,i<0?-i-2:i),dn(e,t+8,r.size)),dn(e,t+12,c),dn(e,t+14,h),t+=16,a!=null&&(dn(e,t,d),dn(e,t+6,r.attrs),dn(e,t+10,a),t+=14),e.set(n,t),t+=c,h)for(var I in u){var S=u[I],x=S.length;dn(e,t,+I),dn(e,t+2,x),e.set(S,t+4),t+=4+x}return d&&(e.set(l,t),t+=d),t},"wzh"),Gle=s(function(e,t,r,n,o){dn(e,t,101010256),dn(e,t+8,r),dn(e,t+10,r),dn(e,t+12,n),dn(e,t+16,o)},"wzf");function VB(e,t,r){r||(r=t,t={}),typeof r!="function"&&Rr(7);var n={};UB(e,"",n,t);var o=Object.keys(n),i=o.length,a=0,l=0,c=i,u=new Array(i),d=[],h=s(function(){for(var x=0;x<d.length;++x)d[x]()},"tAll"),y=s(function(x,T){jx(function(){r(x,T)})},"cbd");jx(function(){y=r});var b=s(function(){var x=new Qt(l+22),T=a,w=l-a;l=0;for(var M=0;M<c;++M){var O=u[M];try{var _=O.c.length;wB(x,l,O,O.f,O.u,_);var $=30+O.f.length+XP(O.extra),j=l+$;x.set(O.c,j),wB(x,a,O,O.f,O.u,_,l,O.m),a+=16+$+(O.m?O.m.length:0),l=j+_}catch(F){return y(F,null)}}Gle(x,a,u.length,w,T),y(null,x)},"cbf");i||b();for(var I=s(function(x){var T=o[x],w=n[T],M=w[0],O=w[1],_=Ele(),$=M.length;_.p(M);var j=$x(T),F=j.length,L=O.comment,q=L&&$x(L),U=q&&q.length,V=XP(O.extra),Q=O.level==0?0:8,Y=s(function(se,re){if(se)h(),y(se,null);else{var ve=re.length;u[x]=QP(O,{size:$,crc:_.d(),c:re,f:j,m:q,u:F!=T.length||q&&L.length!=U,compression:Q}),a+=30+F+V+ve,l+=76+2*(F+V)+(U||0)+ve,--i||b()}},"cbl");if(F>65535&&Y(Rr(11,0,1),null),!Q)Y(null,M);else if($<16e4)try{Y(null,ew(M,O))}catch(se){Y(se,null)}else d.push(Fle(M,O,Y))},"_loop_1"),S=0;S<c;++S)I(S);return h}s(VB,"zip");var jx=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function zB(e,t,r){r||(r=t,t={}),typeof r!="function"&&Rr(7);var n=[],o=s(function(){for(var x=0;x<n.length;++x)n[x]()},"tAll"),i={},a=s(function(x,T){jx(function(){r(x,T)})},"cbd");jx(function(){a=r});for(var l=e.length-22;zi(e,l)!=101010256;--l)if(!l||e.length-l>65558)return a(Rr(13,0,1),null),o;var c=Ws(e,l+8);if(c){var u=c,d=zi(e,l+16),h=d==4294967295||u==65535;if(h){var y=zi(e,l-12);h=zi(e,y)==101075792,h&&(u=c=zi(e,y+32),d=zi(e,y+48))}for(var b=t&&t.filter,I=s(function(x){var T=$le(e,d,h),w=T[0],M=T[1],O=T[2],_=T[3],$=T[4],j=T[5],F=Ble(e,j);d=$;var L=s(function(U,V){U?(o(),a(U,null)):(V&&(i[_]=V),--c||a(null,i))},"cbl");if(!b||b({name:_,size:M,originalSize:O,compression:w}))if(!w)L(null,Zp(e,F,F+M));else if(w==8){var q=e.subarray(F,F+M);if(O<524288||M>.8*O)try{L(null,tw(q,{out:new Qt(O)}))}catch(U){L(U,null)}else n.push(Lle(q,{size:O},L))}else L(Rr(14,"unknown compression type "+w,1),null);else L(null,null)},"_loop_3"),S=0;S<u;++S)I(S)}else a(null,{});return o}s(zB,"unzip");f();var Ule=s(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Vle=s(e=>e!=null,"notNull"),Vx=s((e,t,r=0)=>{var n;if(B.IsNull(e))return"null";if(B.IsUndefined(e))return"undefined";if(B.IsString(e))return"<string>";if(B.IsNumber(e))return"<number>";if(B.IsBoolean(e))return"<boolean>";if(B.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(B.IsRef(e)){let o=t.find(i=>i.$id===e.$ref);return o==null?e.$ref:Vx(o,t,r)}if(B.IsArray(e))return"".concat(Vx(e.items,t,r+1),"[]");if(B.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let i="".concat(e.anyOf.map(a=>Vx(a,t,r+1)).filter(Vle).join(" | "));return r>0?"(".concat(i,")"):i}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),zle=s((e,t,r)=>{var i;let n=t.message;B.IsUnion(t.schema)&&(n="Expected one of: ".concat(Vx(t.schema,r)));let o="#/definitions/".concat(e).concat((i=Ule(t.path))!=null?i:"");return"".concat(o,": ").concat(n)},"errorHandler"),zx=s((e,t,r)=>{let n=t.First();if(n!=null)return zle(e,n,r)},"shortError");var Vf;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(Vf||(Vf={}));var ow=class ow extends Error{constructor(r,n){super(n);m(this,"name");m(this,"kind");this.name="CompressError",this.kind=r}};s(ow,"CompressError");var zf=ow,Hle=s(e=>new zf(Vf.Archive,e.message),"flateErrorIntoCompressError"),Wle=s(e=>{let t=Object.values(Gx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),qle=s((e,t,r)=>{var n;return new zf(Vf.Validate,(n=zx(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),Zle=s(e=>new zf(Vf.Encode,e.message),"encodeErrorIntoCompressError"),Xle=s(e=>new zf(Vf.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),nw=s((e,t,r)=>t instanceof zp?Zle(t):t instanceof si?qle(e,t,r):Wle(t)?Hle(t):Xle(t),"intoCompressError");f();var Hf;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(Hf||(Hf={}));var sw=class sw extends Error{constructor(r,n){super(n);m(this,"name");m(this,"kind");this.name="DecompressError",this.kind=r}};s(sw,"DecompressError");var Wf=sw,Yle=s(e=>new Wf(Hf.Unarchive,e.message),"flateErrorIntoDecompressError"),Kle=s(e=>{let t=Object.values(Gx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Jle=s((e,t,r)=>{var n;return new Wf(Hf.Validate,(n=zx(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),Qle=s(e=>new Wf(Hf.Decode,e.message),"decodeErrorIntoDecompressError"),ece=s(e=>new Wf(Hf.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),iw=s((e,t,r)=>t instanceof Vp?Qle(t):t instanceof si?Jle(e,t,r):Kle(t)?Yle(t):ece(t),"intoDecompressError");f();f();f();var tce=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rce=[0,31,28,31,30,31,30,31,31,30,31,30,31],nce=s(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),Hx=s(e=>{let t=tce.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&nce(r)?29:rce[n])},"date");f();var oce=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,Wx=s(e=>{let t=oce.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3],i=t[4],a=t[5]==="-"?-1:1,l=+(t[6]||0),c=+(t[7]||0);if(l>23||c>59||!i)return!1;if(r<=23&&n<=59&&o<60)return!0;let u=n-c*a,d=r-l*a-(u<0?1:0);return(d===23||d===-1)&&(u===59||u===-1)&&o<61},"time");var ice=/t|\s/i,HB=s(e=>{let t=e.split(ice);return t.length===2&&Hx(t[0])&&Wx(t[1])},"dateTime");f();var sce=/\/|:/,ace=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,WB=s(e=>sce.test(e)&&ace.test(e),"uri");var lce=[["date",Hx],["time",Wx],["date-time",HB],["uri",WB]],qB=s(()=>{for(let[e,t]of lce)try{fx.Format(e,t)}catch(r){if(r instanceof Wy)continue;throw r}},"registerFormats");f();f();f();var ZB=s(e=>e instanceof Error?e:new Error(String(e)),"asError");var qx=s(e=>(...t)=>{try{return be(e(...t))}catch(r){return Ie(ZB(r))}},"safeFn");var cce=qx((e,t)=>{let r={};for(let n of t)for(let o of n.intoBundle(e))r[o.path]=$x(JSON.stringify(o.contents));return r}),aw=s(async(e,t,r)=>cce(e,t).andThenAsync(n=>new Promise(o=>{VB(n,R(P({},r),{consume:!0}),(i,a)=>{o(i?Ie(i):be(a))})})),"compress");f();f();function Zx(e,t,r=[]){let n=P({},e);for(let[o,i]of Object.entries(t))if(i!==void 0)if(o in n){let a=o;if(Array.isArray(i)&&i.length>0){let l=pce(i[0],r);if(l){let c=n[a];if(!Array.isArray(c))throw new Error("Expected array at ".concat(o,", got ").concat(typeof c));let u=new Map(i.map(y=>[XB(y,l),y])),h=c.map(y=>{let b=u.get(XB(y,l));return b?Zx(y,b,r):y});n[a]=h}else n[a]=i}else{let l=n[a];typeof l=="object"&&l!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?n[a]=i:n[a]=Zx(l,i,r):n[o]=i}}else n[o]=i;return n}s(Zx,"deepMergeOn");function pce(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let o of t)if(o in n&&typeof n[o]<"u")return[o];if(Array.isArray(n))return null;for(let[o,i]of Object.entries(n)){let a=r(i);if(a)return[o,...a]}return null}return s(r,"search"),r(e)}s(pce,"findIdentifierKey");function XB(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}s(XB,"getValueByKeyPath");var uce=s(e=>e,"identity"),dce=s(e=>JSON.parse(rw(e)),"jsonDecode"),fce=s((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,uce)!==void 0),"isFileExpected"),mce=qx((e,t)=>{let r={};for(let n of Object.keys(e)){let o=e[n];for(let i of t){let a=i.fromBundle(n,o,dce);if(a){r=Zx(r,a,[]);break}}}return r}),lw=s(async(e,t)=>new Promise(r=>zB(e,{filter:s(n=>fce(n,t),"filter")},(n,o)=>{r(n?Ie(n):be(o))})).then(r=>r.andThen(n=>mce(n,t))),"decompress");f();var hce=s(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),yce=s(e=>{if(e.length<2)return!1;let t=e.filter(hce);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),Xx=s(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&yce(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Xx(r)])):Array.isArray(e)?e.map(Xx):e,"fixDuplicateAllOf");f();var Yx=s(e=>typeof e=="object"&&e!=null&&"$ref"in e?R(P({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Yx(r)])):Array.isArray(e)?e.map(Yx):e,"prefixReferences");var qf;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(qf||(qf={}));var gce=s(e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),bce=s((...e)=>{let t=new Map;for(let r of gce(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return Ie({kind:qf.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return be(t)},"computeReferenceMap"),ui,Xp,nl,Hi,Jx=class Jx{constructor(t,r,n,o){E(this,ui);E(this,Xp);E(this,nl,[]);E(this,Hi);A(this,ui,t),A(this,Xp,r),A(this,nl,n),A(this,Hi,o),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(t,r="CoreMVF"){let n=C.Composite(t.extensions.map(i=>i.schema),{$id:r});if(!B.IsSchema(n))return Ie({kind:qf.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let o=bce(XT.values(),UT.values(),zT.values(),WT.values(),qT.values(),oP.values(),t.extensions.flatMap(i=>{var a;return(a=i.references)!=null?a:[]}).values());if(!o.isOk())return o;try{qB();let i=Ax.Compile(n,[...o.value.values()]);return be(new Jx(n,i,t.extensions,o.value))}catch(i){return i instanceof Fe?Ie({kind:qf.TypeboxError,message:i.message,original:i}):Ie({kind:qf.UnknownError,message:"An unknown error occurred while compiling the schema",original:i})}}is(t){return p(this,Xp).Check(t)}parse(t){return p(this,Xp).Check(t)?be(t):Ie(p(this,Xp).Errors(t))}decode(t){try{return be(IB(p(this,ui),[...p(this,Hi).values()],t))}catch(r){return Ie(r)}}encode(t){try{return be(SB(p(this,ui),[...p(this,Hi).values()],t))}catch(r){return Ie(r)}}verify(t){for(let r of p(this,nl))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return Ie(n.error)}return be(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([p(this,ui),...p(this,Hi).values()])),r=Xx(Yx({$id:"#/definitions/".concat((n=p(this,ui).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>aw(r,p(this,nl))).then(r=>r.mapErr(n=>{var o;return nw((o=p(this,ui).$id)!=null?o:"CoreMVF",n,[...p(this,Hi).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>aw(r,p(this,nl))).then(r=>r.mapErr(n=>{var o;return nw((o=p(this,ui).$id)!=null?o:"CoreMVF",n,[...p(this,Hi).values()])}))}async decompress(t){return lw(t,p(this,nl)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var o;return iw((o=p(this,ui).$id)!=null?o:"CoreMVF",n,[...p(this,Hi).values()])}))}async decompressUnsafe(t){return lw(t,p(this,nl)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var o;return iw((o=p(this,ui).$id)!=null?o:"CoreMVF",n,[...p(this,Hi).values()])}))}};ui=new WeakMap,Xp=new WeakMap,nl=new WeakMap,Hi=new WeakMap,s(Jx,"MVFParser");var Kx=Jx;var Zf,cw=class cw{constructor(){E(this,Zf,[]);this.extend=this.extend.bind(this)}extend(t){return p(this,Zf).push(t),this}extendOptional(t){let r=R(P({},t),{schema:C.Partial(t.schema)});return p(this,Zf).push(r),this}build(){return Kx.create(this)}get extensions(){return p(this,Zf)}};Zf=new WeakMap,s(cw,"MVFParserBuilder");var Qx=cw;var YB=s(()=>new Qx().extend(LN).extend(GN).extend(HN),"createParser");var Yp=dr("lcat","LocationCategoryId"),pw=C.Intersect([C.Object({id:C.Ref(Yp),parent:C.Optional(C.Ref(Yp))}),jp(["name"]),Vi],{$id:"LocationCategory"}),KB=[Yp,pw];f();f();var Kp;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Kp||(Kp={}));var JB=s(e=>{var o,i,a,l,c,u,d,h,y;if(e.locationCategories==null&&e.locations==null)return be(!0);let t=new Set((i=(o=e.locationCategories)==null?void 0:o.map(b=>b.id))!=null?i:[]);for(let b of(a=e.locationCategories)!=null?a:[])if(b.parent!=null&&!t.has(b.parent))return Ie({kind:Kp.UnknownParentCategoryError,properties:{categoryId:b.id,parentCategoryId:b.parent}});let r=zr(e);for(let b of(l=e.locations)!=null?l:[]){for(let I of b.categories)if(!t.has(I))return Ie({kind:Kp.UnknownCategoryError,properties:{locationId:b.id,categoryId:I}});for(let I of b.geometryAnchors){let S=r(I.floorId,I.geometryId);if(S.isErr())return S}}let n=new Set((u=(c=e.locations)==null?void 0:c.map(b=>b.id))!=null?u:[]);for(let b of(d=e.locationInstances)!=null?d:[]){if(!n.has(b.parentId))return Ie({kind:Kp.UnknownParentLocationError,properties:{locationInstanceId:b.id,parentLocationId:b.parentId}});for(let I of(h=b.categories)!=null?h:[])if(!t.has(I))return Ie({kind:Kp.UnknownCategoryError,properties:{locationId:b.id,categoryId:I}});for(let I of(y=b.geometryAnchors)!=null?y:[]){let S=r(I.floorId,I.geometryId);if(S.isErr())return S}}return be(!0)},"validateLocations");f();var Jp=dr("loc","LocationId"),ev=dr("loci","LocationInstanceId"),QB=C.Object({name:C.String(),url:C.String({format:"uri"})},{$id:"LocationSocial"}),e$=C.Object({url:C.String({format:"uri"})},{$id:"LocationImage"}),uw=C.Object({label:C.String(),url:C.String({format:"uri"})},{$id:"LocationLink"}),dw=C.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),t$=C.Union([C.Literal("Sunday"),C.Literal("Monday"),C.Literal("Tuesday"),C.Literal("Wednesday"),C.Literal("Thursday"),C.Literal("Friday"),C.Literal("Saturday")],{$id:"OpeningHoursDay"}),xce="PublicHolidays",fw=C.Union([t$,C.Literal(xce)],{$id:"OpeningHoursDayOrPublicHoliday"}),tv=C.Object({"@type":C.Optional(C.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:C.Optional(C.Ref(dw,{description:"The time the opening hours start"})),closes:C.Optional(C.Ref(dw,{description:"The time the opening hours end"})),dayOfWeek:C.Optional(C.Union([C.Ref(fw),C.Array(C.Ref(fw))],{description:"The days of the week the opening hours apply to"})),validFrom:C.Optional(C.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:C.Optional(C.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),rv=C.Intersect([C.Object({id:C.Ref(Jp),categories:C.Array(C.Ref(Yp)),logo:C.Optional(C.String({format:"uri"})),phone:C.Optional(C.String()),social:C.Array(C.Ref(QB)),images:C.Array(C.Ref(e$)),links:C.Array(C.Ref(uw)),website:C.Optional(C.Ref(uw)),openingHours:C.Optional(C.Array(C.Ref(tv)))}),jp(["name"]),Gp(),Vi],{$id:"Location"}),mw=C.Intersect([C.Object({id:C.Ref(ev),parentId:C.Ref(Jp)}),C.Partial(C.Omit(rv,["id","parentId"]))],{$id:"LocationInstance"}),nv=[Jp,ev,QB,e$,uw,dw,t$,fw,tv,rv,mw];var vce=C.Object({locations:C.Array(C.Ref(rv)),locationCategories:C.Array(C.Ref(pw)),locationInstances:C.Optional(C.Array(C.Ref(mw)))},{$id:"LocationsExtensionSchema"}),r$="locations.json",n$="location-categories.json",o$="location-instances.json",i$={name:"ext:locations",schema:vce,intoBundle:s(function*(e){e.locations!=null&&(yield{path:r$,contents:e.locations}),e.locationCategories!=null&&(yield{path:n$,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:o$,contents:e.locationInstances})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===r$)return{locations:r(t)};if(e===n$)return{locationCategories:r(t)};if(e===o$)return{locationInstances:r(t)}},"fromBundle"),references:[...KB,...nv],integrityCheck:JB};f();f();var qs;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(qs||(qs={}));var s$=s(e=>{var c,u,d,h,y,b,I,S,x,T,w,M,O,_,$,j,F,L,q,U;if(e.enterprise==null)return be(!0);let t=e.enterprise,r=new Set((u=(c=e.locationCategories)==null?void 0:c.map(V=>V.id))!=null?u:[]);for(let V of(d=t.categories)!=null?d:[])if(!r.has(V.categoryId))return Ie({kind:qs.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:V.id,locationCategoryId:V.categoryId}});let n=new Set((y=(h=e.locations)==null?void 0:h.map(V=>V.id))!=null?y:[]);for(let V of(b=t.locations)!=null?b:[]){if(!n.has(V.locationId))return Ie({kind:qs.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:V.id,locationId:V.locationId}});for(let Q of(I=V.siblingGroups)!=null?I:[])for(let Y of(S=Q.siblings)!=null?S:[])if(!n.has(Y))return Ie({kind:qs.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:V.id,siblingLocationId:Y,label:Q.label}})}let o=new Set((T=(x=e.enterprise.locations)==null?void 0:x.map(V=>V.id))!=null?T:[]);if(((w=t.venue)==null?void 0:w.topLocations)!=null){for(let V of t.venue.topLocations)if(!o.has(V))return Ie({kind:qs.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:V}})}let i=new Set((O=(M=e.locationInstances)==null?void 0:M.map(V=>V.id))!=null?O:[]);for(let V of(_=t.locationInstances)!=null?_:[]){if(!o.has(V.parentId))return Ie({kind:qs.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:V.id,enterpriseLocationId:V.parentId}});if(!i.has(V.locationInstanceId))return Ie({kind:qs.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:V.id,locationInstanceId:V.locationInstanceId}});for(let Q of($=V.siblingGroups)!=null?$:[])for(let Y of(j=Q.siblings)!=null?j:[])if(!n.has(Y))return Ie({kind:qs.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:V.id,siblingLocationId:Y,label:Q.label}})}let a=Ya(e),l=zr(e);for(let[V,Q]of Tt((F=t.floorText)!=null?F:{})){let Y=a(V);if(Y.isErr())return Y;for(let se of Q.features){if(!("geometryId"in se.properties))continue;let re=l(V,se.properties.geometryId);if(re.isErr())return re}}for(let[V,Q]of Tt((L=t.textures)!=null?L:{})){let Y=a(V);if(Y.isErr())return Y;for(let se of Q){let re=l(V,se.geometryId);if(re.isErr())return re}}for(let[V,Q]of Tt((q=t.layers)!=null?q:{})){let Y=a(V);if(Y.isErr())return Y;for(let se of bt(Q!=null?Q:{})){let re=l(V,se);if(re.isErr())return re}}for(let[V,Q]of Tt((U=t.textAreas)!=null?U:{})){let Y=a(V);if(Y.isErr())return Y;for(let se of Q.features)if("geometryId"in se.properties){let re=l(V,se.properties.geometryId);if(re.isErr())return re}}return be(!0)},"validateCMS");f();f();var Qp=dr("el","EnterpriseLocationId"),hw=dr("ec","EnterpriseCategoryId"),yw=dr("eli","EnterpriseLocationInstanceId"),gw=dr("ev","EnterpriseVenueId"),bw=dr("eft","EnterpriseFloorTextId"),a$=[Qp,hw,yw,gw,bw];var l$=C.Object({id:C.Ref(hw),categoryId:C.Ref(Yp),color:C.Optional(C.String()),sortOrder:C.Number(),iconFromDefaultList:C.Optional(C.Union([C.String(),C.Null()])),picture:C.Optional(C.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),xw=C.Object({categories:C.Optional(C.Array(C.Ref(l$)))},{$id:"EnterpriseCategoriesSchema"}),c$=[l$,xw];f();var p$=yo(["left","center","right"]),Ice=p$.schema,VVe=p$.values,vw=C.Object({id:C.Ref(bw),text:C.String(),visible:C.Boolean({default:!0}),fontSize:C.Number({default:12,minimum:1}),fontFamily:C.String({default:"Droid Sans"}),color:C.String({default:"black"}),rotation:C.Number({minimum:0,maximum:360}),align:Ice},{$id:"FloorTextCommonProperties"}),Iw=C.Intersect([C.Ref(vw),oi],{$id:"AnchoredFloorTextProperties"}),Sw=C.Intersect([C.Ref(vw),C.Object({verticalOffset:C.Number()})],{$id:"FloatingFloorTextProperties"}),u$=C.Union([C.Ref(Iw),C.Ref(Sw)],{$id:"FloorTextProperties"}),d$=cn(En,C.Ref(u$),{$id:"FloorTextFeature"}),Sce=cn(En,C.Ref(Iw),{$id:"AnchoredFloorTextFeature"}),Cce=cn(En,C.Ref(Sw),{$id:"FloatingFloorTextFeature"}),f$=Zn(C.Ref(d$),{$id:"EnterpriseFloorTextFeatureCollection"}),m$=C.Record(Ct,C.Ref(f$),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),Cw=C.Object({floorText:C.Optional(C.Ref(m$))},{$id:"EnterpriseFloorTextSchema"}),h$=[vw,Iw,Sw,u$,d$,Sce,Cce,f$,m$,Cw];f();var y$=Tr(C.Record(On,C.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),g$=Tr(C.Record(Ct,C.Ref(y$),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),Tw=C.Object({layers:C.Optional(C.Ref(g$))},{$id:"EnterpriseLayersSchema"}),b$=[y$,g$,Tw];f();f();f();var Pw=yo(["closed-temporarily","new","pop-up","coming-soon","relocated"]),Tce=Pw.schema,eze=Pw.values,tze=Pw.record,ww=C.Object({type:Tce,start:C.Optional(C.String({format:"date",description:"The start date of the state"})),end:C.Optional(C.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),Mw=C.Object({label:C.String(),siblings:C.Array(C.Ref(Jp))},{$id:"SiblingGroup"}),ov=C.Object({name:C.String(),code:C.String()},{$id:"Language"}),x$=[ww,Mw,ov];var iv=C.Object({id:C.Ref(Qp),locationId:C.Ref(Jp),type:C.String(),sortOrder:C.Number(),tags:C.Optional(C.Array(C.String())),picture:C.Optional(C.String({format:"uri",description:"The picture of the location"})),states:C.Optional(C.Array(C.Ref(ww),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:C.Optional(C.Array(C.Ref(Mw))),gallery:C.Optional(C.Array(C.Object({caption:C.Optional(C.String()),image:C.String({format:"uri"}),embeddedUrl:C.Optional(C.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:C.Optional(C.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:C.Optional(C.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:C.Optional(C.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),Ow=C.Object({locations:C.Optional(C.Array(C.Ref(iv)))},{$id:"EnterpriseLocationsSchema"}),v$=[iv,Ow];var I$=C.Intersect([C.Object({id:C.Ref(yw),parentId:C.Ref(Qp),locationInstanceId:C.Ref(ev)}),C.Partial(C.Omit(iv,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),Ew=C.Object({locationInstances:C.Optional(C.Array(C.Ref(I$)))},{$id:"EnterpriseLocationInstancesSchema"}),S$=[I$,Ew];f();var _w=yo(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),C$=_w.schema,vze=_w.values,Ize=_w.record,kw=C.Object({maxWidth:C.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:C.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:C.Ref(C$),rotation:C.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),T$=C.Intersect([C.Ref(kw),oi],{$id:"EnterpriseAnchoredTextAreaProperties"}),P$=C.Intersect([C.Ref(kw),C.Object({verticalOffset:C.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),w$=C.Union([T$,P$],{$id:"EnterpriseTextAreaProperties"}),M$=cn(C.Ref(En),w$,{$id:"EnterpriseTextAreaFeature"}),O$=Zn(C.Ref(M$),{$id:"EnterpriseTextAreaCollection"}),E$=C.Record(Ct,C.Ref(O$),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),_$=C.Object({textAreas:C.Optional(C.Ref(E$))},{$id:"EnterpriseTextAreasSchema"}),k$=[C$,kw,T$,P$,w$,M$,O$,E$];f();var Aw=C.Object({u:C.Number(),v:C.Number()},{$id:"EnterpriseTextureUV"}),Dw=yo(["top","side"],{$id:"EnterpriseTextureFace"}),A$=Dw.schema,wze=Dw.values,Mze=Dw.record,Fw=yo(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),D$=Fw.schema,Oze=Fw.values,Eze=Fw.record,F$=C.Tuple([Of,Ef,Of,Ef],{$id:"EnterpriseTextureBounds"}),L$=C.Intersect([C.Object({repeat:C.Ref(Aw),offset:C.Ref(Aw),rotation:C.Number({minimum:0,maximum:360}),path:C.String({format:"uri"}),face:C.Ref(A$),surface:C.Ref(D$),bounds:C.Ref(F$)},{$id:"EnterpriseTextureProperties"}),oi],{$id:"EnterpriseTexture"}),R$=C.Array(C.Ref(L$),{$id:"EnterpriseTextures"}),N$=C.Record(Ct,C.Ref(R$),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),Lw=C.Object({textures:C.Optional(C.Ref(N$))},{$id:"EnterpriseTexturesSchema"}),B$=[L$,R$,Lw,Aw,A$,D$,F$,N$];f();var $$=C.Intersect([C.Object({id:C.Ref(gw),slug:C.String(),defaultLanguage:C.Ref(ov),languages:C.Array(C.Ref(ov)),countrycode:C.Optional(C.String()),logo:C.Optional(C.String({format:"uri"})),mappedinWebUrl:C.Optional(C.String({format:"uri"})),topLocations:C.Optional(C.Array(C.Ref(Qp))),operationHours:C.Optional(C.Array(C.Ref(tv))),coverImage:C.Optional(C.String({format:"uri"}))}),jp(["name"]),Vi],{$id:"EnterpriseVenue"}),Rw=C.Object({venue:C.Optional(C.Ref($$))},{$id:"EnterpriseVenueSchema"}),j$=[$$,Rw];var U$=C.Intersect([Rw,Ow,Ew,xw,Lw,Cw,Tw,_$],{$id:"EnterpriseProperties"}),G$=C.Object({enterprise:C.Optional(C.Ref(U$))},{$id:"CMSExtensionSchema"}),Pce=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,V$={name:"ext:cms",schema:G$,intoBundle:s(function*(e){var r,n,o,i,a,l;if(e.enterprise==null)return;let t=e.enterprise;for(let c of bt(t))switch(c){case"floorText":for(let u of bt((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(u,".geojson"),contents:((n=t.floorText)!=null?n:{})[u]};continue;case"textures":for(let u of bt((o=t.textures)!=null?o:{}))yield{path:"enterprise/textures/".concat(u,".json"),contents:((i=t.textures)!=null?i:{})[u]};continue;case"textAreas":for(let u of bt((a=t.textAreas)!=null?a:{}))yield{path:"enterprise/textAreas/".concat(u,".geojson"),contents:((l=t.textAreas)!=null?l:{})[u]};continue;default:yield{path:"enterprise/".concat(c,".json"),contents:t[c]};continue}},"intoBundle"),fromBundle:s((e,t,r)=>{let n=e.match(Pce);if(!n)return;let[,o,i]=n,a=r(t);switch(o){case"floorText":case"textures":case"textAreas":return{enterprise:{[o]:{[i]:a}}};default:return{enterprise:{[i]:a}}}},"fromBundle"),references:[U$,G$,...j$,...v$,...S$,...c$,...B$,...b$,...h$,...k$,...a$,...x$,...nv],integrityCheck:s$};f();f();f();f();var Wi;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Wi||(Wi={}));var z$=s(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return be(!0);let r=Object.entries(t).map(([i,a])=>P({key:i},a)).sort((i,a)=>i.index!==a.index?i.index-a.index:i.bit-a.bit),n=0,o=-1;for(let i of r){if(i.bit===o)return Ie({kind:Wi.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:"navigationFlags.".concat(i.key)}});if(i.index!=n){if(o!=31)return Ie({kind:Wi.NavigationFlagMissingDeclaration,properties:{index:n,bit:o+1,path:"navigationFlags"}});if(i.index!=n+1||i.bit!=0)return Ie({kind:Wi.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=i.index,o=0}else{if(i.bit!==o+1)return Ie({kind:Wi.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:o+1,path:"navigationFlags"}});o=i.bit}}return be(!0)},"validateNavigationFlags");f();function Xf(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}s(Xf,"hasFlag");f();var H$=2**32-1,eg=s(e=>{var o;let t=Object.keys((o=e.navigationFlags)!=null?o:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},"determineMaxNavigationFlags"),Yf=s((e,t,r)=>{if(t.index==-1&&e.length===0)return be(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return Ie({kind:Wi.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let o=0;o<e.length;o++){let i=e[o];if(o<t.index){if(i>H$)return Ie({kind:Wi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:H$,path:r}});continue}else if(i>t.flag)return Ie({kind:Wi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:t.flag,path:r}})}return be(!0)},"validateFlags");var wce=C.Object({index:C.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:C.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),W$=C.Intersect([wce,Ui],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),Nw={accessible:"accessible",outdoors:"outdoors"},q$=C.Record(C.String(),W$,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),Mce=C.Object({navigationFlags:C.Ref(q$)},{$id:"NavigationFlagsSchema"}),sv=C.Array(C.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),Bw=C.Object({flags:C.Ref(sv)},{$id:"WithFlags"}),eu=C.Intersect([Mf,Bw],{$id:"FlaggedGeometryAnchor"}),Oce=C.Object({geometryAnchor:eu},{$id:"WithFlaggedGeometryAnchor"}),Ece=C.Object({geometryAnchors:C.Array(eu)},{$id:"WithFlaggedGeometryAnchors"}),Z$={name:"ext:mvf-navigation-flags",schema:Mce,intoBundle:s(function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},"intoBundle"),fromBundle:s((e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},"fromBundle"),references:[W$,q$,sv,eu,Oce,Ece],integrityCheck:z$};f();var X$=s(e=>{if(e.connections==null)return be(!0);let t=zr(e),r=eg(e);for(let[n,o]of e.connections.entries()){for(let[i,a]of o.entrances.entries()){let l=t(a.floorId,a.geometryId);if(l.isErr())return l;let c=Yf(a.flags,r,"connections[".concat(n,"].entrances[").concat(i,"]"));if(c.isErr())return c}for(let[i,a]of o.exits.entries()){let l=t(a.floorId,a.geometryId);if(l.isErr())return l;let c=Yf(a.flags,r,"connections[".concat(n,"].exits[").concat(i,"]"));if(c.isErr())return c}}return be(!0)},"validateConnections");var K$=dr("c","ConnectionId"),{schema:_ce,values:RHe,record:kce}=yo(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),J$=_ce;var $w=kce,Q$=C.Intersect([C.Object({id:C.Ref(K$,{description:"The unique identifier for the connection."}),entrances:C.Array(C.Ref(eu)),exits:C.Array(C.Ref(eu)),entryCost:C.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:C.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:C.Ref(J$,{description:"The type of connection."})}),Ui,Vi],{$id:"ConnectionsProperties"}),ej=C.Array(C.Ref(Q$),{$id:"ConnectionsCollection"}),Ace=C.Object({connections:C.Ref(ej)},{$id:"ConnectionsExtensionSchema"}),Y$="connections.json",tj={name:"ext:connections",schema:Ace,intoBundle:s(function*(e){e.connections!=null&&(yield{path:Y$,contents:e.connections})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===Y$)return{connections:r(t)}},"fromBundle"),references:[Q$,ej,J$,K$,eu,sv],integrityCheck:X$};f();f();var rj=s(e=>{if(e.defaultStyle==null)return be(!0);let t=zr(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let o=t(n.floorId,n.geometryId);if(o.isErr())return o}return be(!0)},"validateDefaultStyle");var nj=C.Intersect([Gp(),Vi,C.Object({altitude:C.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:C.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:C.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:C.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:C.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:C.Optional(C.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),oj=C.Record(C.String(),C.Ref(nj),{$id:"DefaultStyleCollection",additionalProperties:!1}),Dce=C.Object({defaultStyle:C.Ref(oj)},{$id:"DefaultStyleSchema"}),ij={name:"ext:mvf-default-style",schema:Dce,intoBundle:s(function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},"fromBundle"),references:[nj,oj],integrityCheck:rj};f();f();f();f();var av;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(av||(av={}));var sj=s(e=>{if(e.floorStacks==null)return be(!0);let t=Ya(e);for(let r of e.floorStacks){for(let n of r.floors){let o=t(n);if(o.isErr())return o}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return Ie({kind:av.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return be(!0)},"validateFloorStacks");var lv=dr("fs","FloorStackId"),lj=C.Intersect([C.Object({id:C.Ref(lv,{description:"The unique identifier for the floor stack."}),floors:C.Array(C.Ref(Ct),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:C.Optional(C.Ref(Ct,{description:"The default floor for the floor stack."}))}),Ui],{$id:"FloorStacksProperties"}),cj=C.Array(C.Ref(lj),{$id:"FloorStackCollection"}),Fce=C.Object({floorStacks:C.Ref(cj)},{$id:"FloorStackExtensionSchema"}),aj="floor-stacks.json",pj={name:"ext:floor-stacks",schema:Fce,intoBundle:s(function*(e){e.floorStacks!=null&&(yield{path:aj,contents:e.floorStacks})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===aj)return{floorStacks:r(t)}},"fromBundle"),references:[lv,lj,cj],integrityCheck:sj};f();f();var tg;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(tg||(tg={}));var uj=s(e=>{if(e.facade==null)return be(!0);if(e.floorStacks==null)return Ie({kind:tg.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=zr(e);for(let[n,o]of Tt(e.facade))if(o!=null){if(!t.has(n))return Ie({kind:tg.UnknownFloorStackError,properties:{floorStackId:n}});for(let i of o.geometryAnchors){let a=r(i.floorId,i.geometryId);if(a.isErr())return a}}return be(!0)},"validateFacade");var dj=dr("fc","FacadeId"),fj=C.Intersect([C.Object({id:C.Ref(dj)}),Gp({minItems:1})],{$id:"FacadeProperties"}),Lce=C.Object({facade:Tr(C.Record(lv,C.Ref(fj),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),Rce=/^facade\/(.*)\.json$/,mj={name:"ext:facade",schema:Lce,intoBundle:s(function*(e){if(e.facade!=null)for(let t of bt(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Rce))==null?void 0:o[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[dj,fj],integrityCheck:uj};f();f();var hj=s(e=>{if(e.floorImages==null)return be(!0);let t=zr(e);for(let[r,n]of Tt(e.floorImages))if(n!=null)for(let o of n.features){if(!("geometryId"in o.properties))continue;let i=o.properties.geometryId,a=t(r,i);if(a.isErr())return a}return be(!0)},"validateFloorImages");var jw=C.Object({path:C.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:C.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:C.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:C.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),yj=C.Intersect([C.Ref(jw),oi],{$id:"AnchoredFloorImageProperties"}),gj=C.Intersect([C.Ref(jw),C.Object({verticalOffset:C.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),bj=C.Union([yj,gj],{$id:"FloorImageProperties"}),xj=cn(C.Ref(En),bj,{$id:"FloorImageFeature"}),vj=Zn(C.Ref(xj),{$id:"FloorImageCollection"}),Nce=C.Object({floorImages:Tr(C.Record(Ct,C.Ref(vj),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),Bce=/^floorImages\/(.*)\.geojson$/,Ij={name:"ext:floor-images",schema:Nce,intoBundle:s(function*(e){if(e.floorImages!=null)for(let t of bt(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Bce))==null?void 0:o[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[jw,yj,gj,bj,xj,vj],integrityCheck:hj};f();f();var Sj=s(e=>{if(e.kinds==null)return be(!0);let t=zr(e);for(let[r,n]of Tt(e.kinds))if(n!=null)for(let o of bt(n)){let i=t(r,o);if(i.isErr())return i}return be(!0)},"validateKinds");var{values:rqe,schema:$ce,record:nqe}=yo(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),Cj=$ce;var Tj=Tr(C.Record(On,C.Ref(Cj),{additionalProperties:!1,$id:"GeometryKinds"})),jce=C.Object({kinds:Tr(C.Record(Ct,C.Ref(Tj),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),Gce=/^kinds\/(.*)\.json$/,Pj={name:"ext:kinds",schema:jce,intoBundle:s(function*(e){if(e.kinds!=null)for(let t of bt(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Gce))==null?void 0:o[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[Cj,Tj],integrityCheck:Sj};f();f();f();var cv;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(cv||(cv={}));var wj=s(e=>{if(e.nodes==null)return be(!0);let t=zr(e),r=eg(e);for(let[n,o]of Tt(e.nodes)){if(o==null)continue;let i=new Set(o.features.map(a=>a.properties.id));for(let[a,l]of o.features.entries()){for(let c of l.properties.geometryIds){let u=t(n,c);if(u.isErr())return u}for(let[c,u]of l.properties.neighbors.entries()){if(!i.has(u.id))return Ie({kind:cv.UnknownNeighbor,properties:{floorId:n,nodeId:l.properties.id,neighborId:u.id}});let d=Yf(u.flags,r,'nodes["'.concat(n,'"].features[').concat(a,"].properties.neighbors[").concat(c,"]"));if(d.isErr())return d}}}return be(!0)},"validateNodes");var Gw=dr("n","NodeId"),Mj=C.Intersect([C.Object({id:C.Ref(Gw,{description:"The unique identifier for the node."}),extraCost:C.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),Bw],{$id:"NodeNeighbor"}),Oj=C.Intersect([C.Object({id:C.Ref(Gw,{description:"The unique identifier for the node."}),neighbors:C.Array(C.Ref(Mj),{description:"The neighbors of the node."})}),dx],{$id:"NodeProperties"}),Ej=cn(C.Ref(En),Oj,{$id:"NodeFeature"}),_j=Zn(C.Ref(Ej),{$id:"NodeCollection"}),Uce=C.Object({nodes:Tr(C.Record(Ct,C.Ref(_j),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Vce=/^nodes\/(.*)\.json$/,kj={name:"ext:nodes",schema:Uce,intoBundle:s(function*(e){if(e.nodes!=null)for(let t of bt(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var o;let n=(o=e.match(Vce))==null?void 0:o[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[Gw,Mj,Oj,Ej,_j],integrityCheck:wj};f();f();f();var pv;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(pv||(pv={}));var Aj=s(e=>{if(e.outdoors==null)return be(!0);let t=Ya(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let o of e.floorStacks)if(o.floors.includes(r))return Ie({kind:pv.FloorInFloorStackError,properties:{floorId:r,floorStackId:o.id}})}}return be(!0)},"validateOutdoors");var Fj=C.Object({floors:C.Array(C.Ref(Ct),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),zce=C.Object({outdoors:C.Ref(Fj)},{$id:"OutdoorsExtensionSchema"}),Dj="outdoors.json",Lj={name:"ext:outdoors",schema:zce,intoBundle:s(function*(e){e.outdoors!=null&&(yield{path:Dj,contents:e.outdoors})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===Dj)return{outdoors:r(t)}},"fromBundle"),references:[Fj],integrityCheck:Aj};f();f();f();var uv;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(uv||(uv={}));var Rj=s(e=>{if(e.tileset==null)return be(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return Ie({kind:uv.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return be(!0)},"validateTilesets");var Uw=C.Object({key:C.String({minLength:1,description:"Unique identifier for the tileset style."}),name:C.String({minLength:1,description:"Display name of the tileset style."}),url:C.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),Nj=C.Object({default:C.Ref(Uw,{description:"The default tileset style, which should be used."}),others:C.Optional(C.Array(C.Ref(Uw,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Hce=C.Object({tileset:C.Ref(Nj)},{$id:"TilesetExtensionSchema"}),Bj={name:"ext:mvf-tileset",schema:Hce,intoBundle:s(function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},"fromBundle"),references:[Uw,Nj],integrityCheck:Rj};f();var $j=C.Object({},{$id:"WalkableProperties"}),jj=C.Object({},{$id:"NonWalkableProperties"}),Gj=Tr(C.Record(On,C.Ref($j),{$id:"WalkableGeometries",additionalProperties:!1})),Uj=Tr(C.Record(On,C.Ref(jj),{$id:"NonWalkableGeometries",additionalProperties:!1})),Wce=C.Object({walkable:Tr(C.Record(Ct,C.Ref(Gj),{additionalProperties:!1})),nonwalkable:Tr(C.Record(Ct,C.Ref(Uj),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),qce=/^walkable\/(.*)\.json$/,Zce=/^nonwalkable\/(.*)\.json$/,Vj={name:"ext:mvf-traversability",schema:Wce,intoBundle:s(function*(e){if(e.walkable!=null)for(let t of bt(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of bt(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:s((e,t,r)=>{var i,a;let n=(i=e.match(qce))==null?void 0:i[1];if(n!=null)return{walkable:{[n]:r(t)}};let o=(a=e.match(Zce))==null?void 0:a[1];if(o!=null)return{nonwalkable:{[o]:r(t)}}},"fromBundle"),references:[$j,jj,Gj,Uj]};f();f();function zj(e){return e.replace(/^g_/,"s_")}s(zj,"toSpaceId");function Xce(e){return e.replace(/^g_/,"o_")}s(Xce,"toObstructionId");function Yce(e){return e.replace(/^g_/,"w_")}s(Yce,"toWindowId");function Kce(e){return e.replace(/^g_/,"ar_")}s(Kce,"convertAreaId");function Jce(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],o=0,i=e.geometry.type.replace("Multi","");for(let a of e.geometry.coordinates)n.push(R(P({},e),{geometry:{type:i,coordinates:a},properties:R(P({},e.properties),{id:"".concat(t,"-").concat(o++),kind:r})}));return n}default:return[R(P({},e),{properties:R(P({},e.properties),{id:t,kind:r})})]}}s(Jce,"splitMultiPartGeometryFeatureWithNewId");function rg(e,t,r,n){let o=new Map;for(let{feature:i,floorId:a}of e){let l=i.properties.id,c=n.get(l);if(t.has(l)){let u=Jce(i,r(l),c),d=u.map(y=>y.properties.id),h=d.map(y=>({geometryId:y,floorId:a}));o.set(l,{ids:d,features:u,anchors:h})}}return o}s(rg,"mapGeometryToOtherIds");function Hj(e){var c,u,d;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((c=e.kinds)!=null?c:{}).filter(h=>h!==void 0).flatMap(Tt)),n=Tt(e.geometry).flatMap(([h,y])=>{var b;return((b=y==null?void 0:y.features)!=null?b:[]).map(I=>({feature:I,floorId:h}))}).flat(),o=new Set(Object.values((u=e.walkable)!=null?u:{}).filter(h=>h!==void 0).flatMap(bt)),i=new Set(Object.values((d=e.nonwalkable)!=null?d:{}).filter(h=>h!==void 0).flatMap(bt)),a=new Set(Array.from(r.entries()).filter(([h,y])=>y==="area").map(([h])=>h)),l=new Set(Array.from(r.entries()).filter(([h,y])=>y==="window").map(([h])=>h));return o.size>0&&(t.space=rg(n,o,zj,r)),i.size>0&&(t.obstruction=rg(n,i,Xce,r)),a.size>0&&(t.area=rg(n,a,Kce,r)),l.size>0&&(t.window=rg(n,l,Yce,r)),o.size===0&&i.size===0&&a.size===0&&(t.space=rg(n,new Set(n.map(h=>h.feature.properties.id)),zj,r)),t}s(Hj,"createGeometryMaps");function Wj(e){let t=Qce(e),r=Hj(e),n=epe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}s(Wj,"buildBuilderOptions");function Qce(e){var r,n,o;let t=new Map;for(let i of Object.values((r=e.nodes)!=null?r:{}))for(let a of(n=i==null?void 0:i.features)!=null?n:[])if(a.properties.geometryIds.length>0)for(let l of a.properties.geometryIds){let c=(o=t.get(l))!=null?o:[];c.push(a.properties.id),t.set(l,c)}return t}s(Qce,"buildNodesByGeometryId");function epe(e){var r,n;let t=new Map;for(let o of Object.values((r=e.geometry)!=null?r:{}))for(let i of(n=o==null?void 0:o.features)!=null?n:[])t.set(i.properties.id,i);return t}s(epe,"buildGeometryFeatureById");f();function qj(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,o]of Tt(e.annotations)){if(!o||o.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let i=new Map(e.geometry[n].features.map(l=>[l.properties.id,l])),a={type:"FeatureCollection",features:[]};for(let l of o){let c=i.get(l.geometryId);if(!c||c.geometry.type!=="Point")continue;let u={id:l.id,externalId:l.externalId,symbolId:l.symbolKey};a.features.push({type:"Feature",geometry:c.geometry,properties:u})}r[n]=a}return{annotation:r}}s(qj,"buildAnnotations");f();function Zj(e,{nodesByGeometryId:t}){var a,l,c,u,d,h,y;let r={"connection.json":[],entrance:{}},n=(a=e.navigationFlags)==null?void 0:a[Nw.accessible],o=(l=e.navigationFlags)==null?void 0:l[Nw.outdoors],i=new Map(Object.values((c=e.geometry)!=null?c:{}).flatMap(b=>{var I;return(I=b==null?void 0:b.features)!=null?I:[]}).map(b=>[b.properties.id,b]));for(let b of(u=e.connections)!=null?u:[]){if(Vw(b,i)){let T=tpe(b,i,t,o);for(let[w,M]of T)r.entrance[w]||(r.entrance[w]={type:"FeatureCollection",features:[]}),r.entrance[w].features.push(M);continue}let I=n!=null&&b.entrances.every(T=>Xf(T,n))&&b.exits.every(T=>Xf(T,n)),S=Array.from(new Set([...b.entrances.map(T=>t.get(T.geometryId)),...b.exits.map(T=>t.get(T.geometryId))].flat().filter(T=>T!=null))),x={id:b.id,externalId:(h=(d=b.details)==null?void 0:d.externalId)!=null?h:"",type:b.type,accessible:I,nodes:S};(y=b.details)!=null&&y.name&&(x.details={name:b.details.name}),b.extra&&(x.extra=b.extra),r["connection.json"].push(x)}return r}s(Zj,"buildConnections");function Vw(e,t){return e.type==$w.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}s(Vw,"isLineDoor");function tpe(e,t,r,n){var i,a;if(e.type!==$w.door)return[];let o=[];for(let l of e.entrances){let c=t.get(l.geometryId);if((c==null?void 0:c.geometry.type)==="LineString"){let u={type:"Feature",geometry:c.geometry,properties:{id:e.id,externalId:(a=(i=e.details)==null?void 0:i.externalId)!=null?a:"",isExterior:rpe(e,n)}},d=e.details;d&&(u.properties.details={name:d.name,description:d.description},d.icon&&(u.properties.details.images=[{url:d.icon,altText:"".concat(d.name," icon")}]));let h=r.get(l.geometryId);h&&h.length>0&&(u.properties.node=h[0]),o.push([l.floorId,u])}}return o}s(tpe,"buildEntranceFeaturesFromConnection");function rpe(e,t){return e.entrances.some(r=>Xf(r,t))||e.exits.some(r=>Xf(r,t))}s(rpe,"isExterior");f();function Yj(e,{geometryMaps:t,nodesByGeometryId:r}){var w,M,O,_,$,j,F,L,q,U,V,Q,Y,se,re,ve,we,ye,Ne,nt,st,qe,Ye;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},o=(w=e.manifest)==null?void 0:w.features[0];if(o&&(n.venue.defaultFloor=o.properties.defaultFloor,n.venue.tzid=o.properties.tzid,n.venue.name=o.properties.name),e.enterprise.venue){let de=e.enterprise.venue;n.venue=R(P({},n.venue),{slug:de.slug,name:(M=de.details.name)!=null?M:n.venue.name,externalId:(O=de.details.externalId)!=null?O:"",defaultLanguage:de.defaultLanguage,languages:de.languages,countrycode:de.countrycode,coverImage:de.coverImage,logo:de.logo,icon:de.details.icon,extra:de.extra,mappedinWebUrl:de.mappedinWebUrl,operationHours:de.operationHours,topLocations:de.topLocations})}let i=new Map,a=new Map,l=e.locations,c=e.enterprise.locations;if(l&&c){let de=new Map(l.map(ge=>[ge.id,ge]));for(let ge of c){let me=de.get(ge.locationId);if(me){let oe=me.details,D={id:ge.id,name:oe.name,externalId:(_=oe.externalId)!=null?_:"",type:ge.type,sortOrder:ge.sortOrder,amenity:ge.amenity,description:oe.description,extra:me.extra,links:me.links,operationHours:me.openingHours,gallery:ge.gallery,logo:me.logo,shortName:oe.shortName,picture:ge.picture,showFloatingLabelWhenImagePresent:ge.showFloatingLabelWhenImagePresent,showLogo:ge.showLogo,siblingGroups:ge.siblingGroups,states:ge.states,tags:ge.tags,spaces:[],nodes:[],polygons:[]};me.phone&&(D.phone={number:me.phone});let K=Xj(me.social);me.website&&(K.website=me.website.url),D.social=K;for(let N of me.geometryAnchors){let pe=t.space.get(N.geometryId);if(pe){let ce=new Set(pe.features.filter(Ce=>Ce.geometry.type==="Polygon").map(Ce=>Ce.properties.id));for(let Ce of pe.anchors)D.spaces.push({floor:Ce.floorId,id:Ce.geometryId}),ce.has(Ce.geometryId)&&D.polygons.push({map:Ce.floorId,id:Ce.geometryId})}let le=r.get(N.geometryId);for(let ce of le!=null?le:[])D.nodes.push({map:N.floorId,id:ce})}n.locations.push(D);for(let N of me.categories)i.set(N,[...($=i.get(N))!=null?$:[],ge.id]);a.set(ge.id,me.categories)}}}let u=e.enterprise.locationInstances,d=e.locationInstances;if(u&&d){let de=new Map(d.map(me=>[me.id,me])),ge=[];for(let me of u){let oe=de.get(me.locationInstanceId);if(oe){let D={id:me.id,parent:me.parentId,name:(j=oe.details)==null?void 0:j.name,externalId:(F=oe.details)==null?void 0:F.externalId,type:me.type,sortOrder:me.sortOrder,amenity:me.amenity,description:(L=oe.details)==null?void 0:L.description,extra:oe.extra,links:oe.links,operationHours:oe.openingHours,gallery:me.gallery,picture:me.picture,showFloatingLabelWhenImagePresent:me.showFloatingLabelWhenImagePresent,showLogo:me.showLogo,siblingGroups:me.siblingGroups,states:me.states,tags:me.tags,logo:oe.logo,shortName:(q=oe.details)==null?void 0:q.shortName};oe.phone&&(D.phone={number:oe.phone});let K=Xj((U=oe.social)!=null?U:[]);if(oe.website&&(K.website=oe.website.url),Object.keys(K).length>0&&(D.social=K),(V=oe.geometryAnchors)!=null&&V.length){let N=oe.geometryAnchors.flatMap(pe=>{var le,ce;return(ce=(le=t.space.get(pe.geometryId))==null?void 0:le.anchors)!=null?ce:[]});N.length>0&&(D.spaces=N.map(pe=>({floor:pe.floorId,id:pe.geometryId})))}if(oe.geometryAnchors){D.spaces=[],D.polygons=[],D.nodes=[];for(let N of oe.geometryAnchors){let pe=t.space.get(N.geometryId);if(pe){let ce=new Set(pe.features.filter(Ce=>Ce.geometry.type==="Polygon").map(Ce=>Ce.properties.id));for(let Ce of pe.anchors)D.spaces.push({floor:Ce.floorId,id:Ce.geometryId}),ce.has(Ce.geometryId)&&D.polygons.push({map:Ce.floorId,id:Ce.geometryId})}let le=r.get(N.geometryId);for(let ce of le!=null?le:[])D.nodes.push({map:N.floorId,id:ce})}}ge.push(D)}}ge.length>0&&(n.locationInstances=ge)}let h=e.locationCategories,y=e.enterprise.categories;if(h&&y){let de=[],ge=new Map(h.map(K=>[K.id,K])),me=new Map(y.map(K=>[K.categoryId,K.id])),oe=new Map;for(let K of h){let N=me.get(K.parent);if(N){let pe=(Q=oe.get(N))!=null?Q:[];pe.push(K.id),oe.set(N,pe)}}for(let K of y){let N=ge.get(K.categoryId);if(N){let le=((Y=oe.get(K.id))!=null?Y:[]).map(Ce=>me.get(Ce)).filter(Ce=>Ce!==void 0),ce={id:K.id,name:N.details.name,externalId:(se=N.details.externalId)!=null?se:"",sortOrder:K.sortOrder,children:le,locations:(re=i.get(K.categoryId))!=null?re:[],icon:N.details.icon,picture:K.picture,color:K.color,extra:N.extra,iconFromDefaultList:K.iconFromDefaultList};de.push(ce)}}n.categories=de;let D={};for(let[K,N]of a.entries())D[K]=N.map(pe=>me.get(pe)).filter(pe=>pe!==void 0);n.categoryPriorities=D}let b={};for(let[de,ge]of Object.entries((ve=e.defaultStyle)!=null?ve:{}))if(ge.buffer>0){let me=ge.geometryAnchors.flatMap(oe=>{var D,K;return(K=(D=t.space.get(oe.geometryId))==null?void 0:D.anchors)!=null?K:[]});b[de]={edgeOffset:ge.buffer,geometryAnchors:me}}Object.keys(b).length>0&&(n.enterpriseStyles=b);let I=new Map;for(let de of Object.values((we=e.enterprise.layers)!=null?we:{}))if(de)for(let[ge,me]of Tt(de)){if(typeof me!="string")continue;let oe=(ye=I.get(me))!=null?ye:{name:me,id:"ely_".concat(me),spaces:[]};oe.spaces.push(...(nt=(Ne=t.space.get(ge))==null?void 0:Ne.anchors.map(D=>({floorId:D.floorId,spaceId:D.geometryId})))!=null?nt:[]),I.set(me,oe)}I.size>0&&(n.layers=Array.from(I.values()));let S=[];for(let de of Object.values((st=e.enterprise.textures)!=null?st:{}))for(let ge of de){let me=(qe=t.space.get(ge.geometryId))==null?void 0:qe.anchors;!me||me.length<1||ge.face==="unknown"||ge.surface==="unknown"||S.push({repeat:ge.repeat,offset:ge.offset,rotation:ge.rotation,path:ge.path,face:ge.face,surface:ge.surface,bounds:ge.bounds,geometryAnchors:me})}S.length>0&&(n.textures=S);let x={};for(let[de,ge]of Object.entries((Ye=e.enterprise.floorText)!=null?Ye:{})){let me={type:"FeatureCollection",features:[]};for(let oe of ge.features){if(oe.properties.align==="unknown")continue;let D={align:oe.properties.align,color:oe.properties.color,fontFamily:oe.properties.fontFamily,fontSize:oe.properties.fontSize,rotation:oe.properties.rotation,text:oe.properties.text,visible:oe.properties.visible};"geometryId"in oe.properties?D.geometryId=oe.properties.geometryId:D.verticalOffset=oe.properties.verticalOffset,me.features.push({type:"Feature",geometry:oe.geometry,properties:D})}me.features.length>0&&(x[de]=me)}Object.keys(x).length>0&&(n.floorText=x);let T={enterprise:n};if(e.enterprise.textAreas){let de={};for(let[ge,me]of Tt(e.enterprise.textAreas)){let oe={type:"FeatureCollection",features:[]};for(let D of me.features){if(D.properties.align==="unknown")continue;let K={align:D.properties.align,maxWidth:D.properties.maxWidth,maxHeight:D.properties.maxHeight,rotation:D.properties.rotation};"geometryId"in D.properties?K.anchorId=D.properties.geometryId:K.verticalOffset=D.properties.verticalOffset;let N={type:"Feature",geometry:D.geometry,properties:K};oe.features.push(N)}de[ge]=oe}T.textAreas=de}return T}s(Yj,"buildEnterprise");var npe=["facebook","instagram","twitter"];function Xj(e){let t={};for(let{name:r,url:n}of e){let o=r.toLowerCase();npe.includes(o)&&(t[o]=n)}return t}s(Xj,"convertSocials");f();function Kj(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[o,i]of Tt(e.facade))i&&(n[o]={id:i.id,spaces:i.geometryAnchors.flatMap(({floorId:a,geometryId:l})=>{var c;return(c=t.space.get(l))==null?void 0:c.ids.map(u=>({floorId:a,spaceId:u}))}).filter(a=>a!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}s(Kj,"buildFacade");f();function Jj(e,t={}){var o,i,a,l,c,u,d,h,y,b,I,S;let r={type:"FeatureCollection",features:[]},n=[];for(let x of e.floors.features)n.push({id:x.properties.id.replace(/^f_/,"m_"),externalId:(i=(o=x.properties.details)==null?void 0:o.externalId)!=null?i:"",elevation:x.properties.elevation,name:(l=(a=x.properties.details)==null?void 0:a.name)!=null?l:"",shortName:(u=(c=x.properties.details)==null?void 0:c.shortName)!=null?u:"",subtitle:x.properties.subtitle}),r.features.push({type:"Feature",geometry:x.geometry,properties:{id:x.properties.id,externalId:(h=(d=x.properties.details)==null?void 0:d.externalId)!=null?h:"",elevation:x.properties.elevation,name:(b=(y=x.properties.details)==null?void 0:y.name)!=null?b:"",shortName:(S=(I=x.properties.details)==null?void 0:I.shortName)!=null?S:"",subtitle:x.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}s(Jj,"buildFloors");f();function Qj(e,{geometryMaps:t}){var o,i,l,c,u;let r={},n={};for(let[d,h]of Tt((o=e.floorImages)!=null?o:{})){let y={features:[],type:"FeatureCollection"};for(let b of(i=h==null?void 0:h.features)!=null?i:[])if("verticalOffset"in b.properties)y.features.push(b);else{let a=b.properties,{geometryId:I}=a,S=$n(a,["geometryId"]),x=(u=(l=t.space.get(I))==null?void 0:l.ids[0])!=null?u:(c=t.obstruction.get(I))==null?void 0:c.ids[0];if(!x)continue;let T={geometry:b.geometry,properties:R(P({},S),{anchorId:x}),type:b.type};y.features.push(T)}n[d]=y}return Object.keys(n).length>0&&(r.floorImages=n),r}s(Qj,"buildFloorImages");f();function eG(e,t={}){var o,i,a,l,c,u,d;let r=[];for(let h of(o=e==null?void 0:e.floorStacks)!=null?o:[]){let y={id:h.id,floors:h.floors,maps:h.floors,externalId:(a=(i=h.details)==null?void 0:i.externalId)!=null?a:"",name:(c=(l=h.details)==null?void 0:l.name)!=null?c:"",shortName:(d=(u=h.details)==null?void 0:u.shortName)!=null?d:"",type:"Building"};h.defaultFloor&&(y.defaultFloor=h.defaultFloor),r.push(y)}if(e.outdoors){let h={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(h)}return{"floorstack.json":r,"mapstack.geojson":r}}s(eG,"buildFloorStacks");f();f();var nG=ps(rG(),1);var lpe=s(e=>{let t=e.geometry.coordinates[0],r=0;for(let n=0;n<t.length-1;n++)r+=t[n][0]*t[n+1][1]-t[n+1][0]*t[n][1];return Math.abs(r/2)},"calculateArea"),cpe=s((e,t)=>{let[r,n]=e,o=t.geometry.coordinates[0],i=!1;for(let a=0,l=o.length-1;a<o.length;l=a++){let[c,u]=o[a],[d,h]=o[l];u>n!=h>n&&r<(d-c)*(n-u)/(h-u)+c&&(i=!i)}return i},"pointInPolygon"),ppe=s(e=>{let t=e.geometry.coordinates[0],r=0,n=0;for(let o=0;o<t.length-1;o++)r+=t[o][0],n+=t[o][1];return{geometry:{coordinates:[r/(t.length-1),n/(t.length-1)]}}},"calculateCenterOfMass"),upe=s(e=>{let t=lpe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),fv=s(e=>{try{let r=ppe(e).geometry.coordinates;if(!cpe(r,e)){let o=(0,nG.default)(e.geometry.coordinates,upe(e));return be([o[0],o[1]])}return be(r)}catch(t){return Ie(new Error("Unable to calculate center of polygon"))}},"labelCenter");function Hw(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}s(Hw,"isPolygonFeature");function oG(e,{geometryMaps:t,nodesByGeometryId:r}){var u,d,h,y,b,I,S,x,T;let n=ype(e.defaultStyle),o={},i={},a={},l={};for(let w of bt(e.geometry)){let M=e.geometry[w];if(!M)continue;let O=[],_=[],$=[],j=[];for(let F of M.features){let L=F.properties.id,q=n.has(L),U=(u=r.get(L))!=null?u:[];for(let V of(h=(d=t.space.get(L))==null?void 0:d.features)!=null?h:[])O.push(dpe(V,U));for(let V of(b=(y=t.obstruction.get(L))==null?void 0:y.features)!=null?b:[])_.push(fpe(V,q));for(let V of(S=(I=t.area.get(L))==null?void 0:I.features)!=null?S:[])$.push(mpe(V,U));for(let V of(T=(x=t.window.get(L))==null?void 0:x.features)!=null?T:[])j.push(hpe(V))}O.length>0&&(o[w]={type:"FeatureCollection",features:O.filter(F=>F!==null)}),_.length>0&&(i[w]={type:"FeatureCollection",features:_.filter(F=>F!==null)}),$.length>0&&(a[w]={type:"FeatureCollection",features:$.filter(F=>F!==null)}),j.length>0&&(l[w]={type:"FeatureCollection",features:j.filter(F=>F!==null)})}let c={space:o,obstruction:i};return Object.keys(a).length>0&&(c.area=a),Object.keys(l).length>0&&(c.window=l),c}s(oG,"buildGeometry");function dpe(e,t){var n,o;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:e.geometry,properties:{destinationNodes:t,id:e.properties.id,externalId:(o=(n=e.properties.details)==null?void 0:n.externalId)!=null?o:"",kind:e.properties.kind}};return e.properties.details&&(r.properties.details={name:e.properties.details.name,description:e.properties.details.description,images:e.properties.details.icon?[{url:e.properties.details.icon,altText:e.properties.details.name?"".concat(e.properties.details.name," icon"):"icon"}]:void 0}),Hw(r)&&(r.properties.center=fv(r).unwrapOr(void 0)),r}s(dpe,"buildSpace");function fpe(e,t){var o,i;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(i=(o=r.details)==null?void 0:o.externalId)!=null?i:"",entrances:[],kind:r.kind,footprintComponent:t}};return Hw(n)&&(n.properties.center=fv(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}s(fpe,"buildObstruction");function mpe(e,t){var o,i;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(i=(o=r.details)==null?void 0:o.externalId)!=null?i:"",destinationNodes:t}};return Hw(n)&&(n.properties.center=fv(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}s(mpe,"buildArea");function hpe(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}s(hpe,"buildWindow");function ype(e){var n,o,i,a;let t=[...(o=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?o:[],...(a=(i=e==null?void 0:e.Walls)==null?void 0:i.geometryAnchors)!=null?a:[]];return new Set(t.map(l=>l.geometryId))}s(ype,"calculateFootprintGeometry");f();function iG(e,{geometryMaps:t,geometryFeatureById:r}){var o,i,a,l,c,u,d,h,y,b,I,S,x;if(!e.locationCategories&&!e.locations)return{};let n={};if((o=e.locationCategories)!=null&&o.length){let T=[];for(let w of e.locationCategories){let M={id:w.id,name:w.details.name,icon:(i=w.details.icon)!=null?i:""};w.parent&&(M.parent=w.parent),T.push(M)}n["category.json"]=T}if((a=e.locations)!=null&&a.length){let T=gpe(e,{geometryFeatureById:r}),w=[];for(let M of e.locations){let O={id:M.id,name:M.details.name,categories:M.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:M.links,openingHoursSpecification:(l=M.openingHours)!=null?l:[],pictures:M.images,social:M.social,description:M.details.description,externalId:M.details.externalId,icon:M.details.icon,logo:M.logo,phone:M.phone,website:M.website};w.push(O);for(let{geometryId:_,floorId:$}of M.geometryAnchors)O.spaces.push(...(u=(c=t.space.get(_))==null?void 0:c.ids.map(j=>({id:j,floor:$})))!=null?u:[]),O.obstructions.push(...(h=(d=t.obstruction.get(_))==null?void 0:d.ids.map(j=>({id:j,floor:$})))!=null?h:[]),O.areas.push(...(b=(y=t.area.get(_))==null?void 0:y.ids.map(j=>({id:j,floor:$})))!=null?b:[]),O.entrances.push(...(I=T.entrancesByGeometryId.get(_))!=null?I:[]),O.connections.push(...(S=T.connectionsByGeometryId.get(_))!=null?S:[]),O.annotations.push(...(x=T.annotationsByGeometryId.get(_))!=null?x:[])}n["location.json"]=w}return n}s(iG,"buildLocations");function gpe(e,{geometryFeatureById:t}){var n,o,i;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[a,l]of Tt(e.annotations))for(let c of l!=null?l:[]){let u=c.geometryId,d=c.id,h=(n=r.annotationsByGeometryId.get(u))!=null?n:[];h.push({floor:a,id:d}),r.annotationsByGeometryId.set(u,h)}if(e.connections)for(let a of e.connections){let l=Vw(a,t),c=Array.from(new Map([...a.entrances,...a.exits].map(u=>["".concat(u.geometryId,"_").concat(u.floorId),u])).values());for(let u of c){let d=u.geometryId;if(l){let h=(o=r.entrancesByGeometryId.get(d))!=null?o:[];h.push({floor:u.floorId,id:a.id}),r.entrancesByGeometryId.set(d,h)}else{let h=(i=r.connectionsByGeometryId.get(d))!=null?i:[];h.push(a.id),r.connectionsByGeometryId.set(d,h)}}}return r}s(gpe,"buildLocationAttachmentMaps");f();function sG(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},o=e.manifest;if(o.features.length>0){let i=o.features[0],a=i.properties,l={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:a.time,name:a.name,naturalBearing:a.naturalBearing,tzid:a.tzid,map:a.mapId,org_id:a.orgId,language:a.language}};r.features.push(l)}return n}s(sG,"buildManifest");f();function aG(e,{geometryMaps:t}){var l,c,u,d,h,y,b,I,S,x,T,w,M,O,_;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,o=new Map;for(let $ of(c=(l=e.floors)==null?void 0:l.features)!=null?c:[])o.set($.properties.id,$.properties.elevation);let i=new Map;for(let $ of Object.values((u=e.nodes)!=null?u:{}))for(let j of(d=$==null?void 0:$.features)!=null?d:[])for(let F of j.properties.geometryIds)i.set(F,[...(h=i.get(F))!=null?h:[],j.properties.id]);let a=new Map;for(let $ of(y=e.connections)!=null?y:[]){let j=$.exits.map(F=>{var L;return R(P({},F),{nodes:(L=i.get(F.geometryId))!=null?L:[]})});for(let F of $.entrances){let L=(b=i.get(F.geometryId))!=null?b:[];for(let q of L)for(let U of j){let V=Math.abs(((I=o.get(F.floorId))!=null?I:0)-((S=o.get(U.floorId))!=null?S:0))*$.floorCostMultiplier,Q=(x=a.get(q))!=null?x:[];Q.push(...U.nodes.map(Y=>({id:Y,weight:V+$.entryCost}))),a.set(q,Q)}}}for(let[$,j]of Tt((T=e.nodes)!=null?T:{}))for(let F of(w=j==null?void 0:j.features)!=null?w:[]){let L=(M=t.space.get(F.properties.geometryIds[0]))==null?void 0:M.features[0],q=(L==null?void 0:L.geometry.type)==="Point"&&((O=L==null?void 0:L.properties.details)!=null&&O.externalId)?L.properties.details.externalId:"",U={type:"Feature",geometry:F.geometry,properties:{id:F.properties.id,floor:$,space:F.properties.geometryIds.map(V=>{var Q;return(Q=t.space.get(V))==null?void 0:Q.ids}).flat().filter(V=>V!==void 0),neighbors:[...F.properties.neighbors.map(V=>({id:V.id,weight:V.extraCost})),...(_=a.get(F.properties.id))!=null?_:[]],map:$,externalId:q}};n.push(U)}return r}s(aG,"buildNodes");f();function bpe(e,t){var n;let r={};for(let o of e){let i=t.get(o);i&&((n=r[i])!=null||(r[i]=[]),r[i].push(o))}return r}s(bpe,"groupGeometryByType");function lG(e,{geometryMaps:t}){var a,l,c;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let o=[...Array.from(t.space.values()).map(u=>u.features),...Array.from(t.obstruction.values()).map(u=>u.features)],i=new Map(o.flatMap(u=>u.map(d=>[d.properties.id,d.geometry.type])));for(let[u,d]of Tt(e.defaultStyle)){let h=bpe(d.geometryAnchors.flatMap(y=>{var b,I,S,x;return[...(I=(b=t.space.get(y.geometryId))==null?void 0:b.ids)!=null?I:[],...(x=(S=t.obstruction.get(y.geometryId))==null?void 0:S.ids)!=null?x:[]]}),i);if(h.Point&&h.Point.length>0){let y={points:Array.from(h.Point.values()),showImage:((a=d.extra)==null?void 0:a.showImage)!==void 0?((l=d.extra)==null?void 0:l.showImage)===!0:d.opacity!==0};n["".concat(u,".Point")]=y}if(h.LineString&&h.LineString.length>0){let y={lineStrings:Array.from(h.LineString.values()),altitude:d.altitude,color:d.color,height:d.height,opacity:d.opacity,width:d.buffer};n["".concat(u,".LineString")]=y}if(h.Polygon&&h.Polygon.length>0){let y={polygons:Array.from(h.Polygon.values()),altitude:d.altitude,color:d.color,height:d.height,opacity:d.opacity};((c=d.extra)==null?void 0:c.showImage)!==void 0&&(y.showImage=d.extra.showImage===!0),n["".concat(u,".Polygon")]=y}}return r}s(lG,"buildStyles");var xpe=YB().extendOptional(Z$).extendOptional(kj).extendOptional(tj).extendOptional(Pj).extendOptional(Vj).extendOptional(ij).extendOptional(pj).extendOptional(Lj).extendOptional(Bj).extendOptional(Ij).extendOptional(mj).extendOptional(YN).extendOptional(i$).extendOptional(V$).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function vpe(e){let t=Wj(e),r=Jj(e,t),n=oG(e,t),o=aG(e,t),i=Zj(e,t),a=lG(e,t),l=eG(e,t),c=Qj(e,t),u=Kj(e,t),d=qj(e,t),h=iG(e,t),y=Yj(e,t),b=sG(e,t);return P(P(P(P(P(P(R(P(P(P(P(P(P({},r),n),o),i),a),l),{"tileset.json":e.tileset}),c),u),d),h),y),b)}s(vpe,"convertUnzippedStandardMVFv3ToParsedMVFv2");async function Ww(e){let t=await xpe.decompress(e);return t.isOk()?be(vpe(t.value)):Ie(t.error)}s(Ww,"extractAndConvertMVFv3");f();function Kf(e){return e.endsWith("/")?e:"".concat(e,"/")}s(Kf,"normalizeUrl");f();var Jf="https://app.mappedin.com/",cG="https://auth.mappedin.com/";f();f();var Ipe=s(e=>{let t=Date.now();return e-t},"fromNow"),mv=s((e,t)=>Ipe(e)<=t*60*1e3,"shouldRefreshToken");var uG=60,dG=uG*60*1e3,pG="accessTokens";async function ng(e,t=!1){let r="".concat(e.key),n=np.getInstance(),o=(n==null?void 0:n.loadSessionData(pG))||{},i=Math.floor(Date.now()/1e3);if(o[r]&&!mv(o[r].expiresTimestamp*1e3,uG))return o[r];let a=t?await Spe(e,i):await Cpe(e,i),l=R(P({},o),{[r]:a});return n==null||n.saveSessionData(pG,l),a}s(ng,"getAccessToken");async function Spe(e,t){var i;let r="".concat((i=e.baseAuthUri)!=null?i:cG,"oauth2/token"),n=await qi()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}s(Spe,"fetchAccessTokenEnterprise");async function Cpe(e,t){let r="".concat(e.baseAuthUri?Kf(e.baseAuthUri):Jf,"api/api-key/token"),n=await qi()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}s(Cpe,"fetchAccessToken");f();var mG=60,hG=mG*60*1e3,fG="miSasTokens";async function qw(e,t){let r="".concat(t,"__").concat(e.mapId),n=np.getInstance(),o=(n==null?void 0:n.loadSessionData(fG))||{};if(o[r]&&!mv(o[r].expires,mG))return o[r];let i=await Tpe(e,t),a=R(P({},o),{[r]:{token:i.token,expires:new Date(i.expires).getTime()}});return n==null||n.saveSessionData(fG,a),i}s(qw,"getSasToken");async function Tpe(e,t){let r="".concat(e.baseUri?Kf(e.baseUri):Jf,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await qi()(r,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{token:o.token,expires:new Date(o.expires).getTime()}}s(Tpe,"fetchSasToken");var yG=globalThis.fetch,xG,Ppe=(xG=v==null?void 0:v.env)==null?void 0:xG.npm_package_version;function qi(){if(yG==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return yG}s(qi,"isomorphicFetch");var Zw={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function vG(e){var r;let t=P(P({},Zw),e);return t.headers=R(P({},t.headers),{"mappedin-sdk-version":Ppe}),t.things=[],"platformString"in e&&(t.headers=R(P({},t.headers),{"mappedin-platform-version":e.platformString})),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}s(vG,"parseOptions");function wpe(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language;let{headers:o}=e;o["Content-Type"]=o["Content-Type"]||"text/json",e.accessToken?o.Authorization="Bearer ".concat(e.accessToken):e.noAuth||e.clientId&&e.clientSecret&&(o["x-mappedin-key"]=btoa(e.clientId),o["x-mappedin-secret"]=btoa(e.clientSecret));let i={method:"GET",headers:o};return e.secure&&(t+="&withcdntoken"),{req:i,url:t}}s(wpe,"constructParamsForRequest");async function Mpe(e,t,r=!1){let n=wpe(e,t,r),o=await qi()(n.url,n.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}s(Mpe,"generateAPIRequest");var Ope=s(e=>{let t=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(t==null||Object.keys(t).length===0)return z.warn("No perspectives available in response!"),null;let r={};for(let[n,o]of Object.entries(t)){let i="url"in o&&typeof o.url=="string"?o.url:null,a="locale_packs"in o&&typeof o.locale_packs=="object"?o.locale_packs:null;if(i==null||a==null){z.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:i,locale_packs:a}}return r},"getPerspectivesFromResponse");async function Epe(e,t="exports/mvf/1/bundle"){var u,d;let r=vG(P(P({baseUri:"https://api-gateway.mappedin.com/"},Zw),e)),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((u=r.version)!=null?u:"2.0.0");r.headers["Content-Type"]="application/zip";let o=await Mpe(r,n),i=o.url,a=o.locale_packs,l=(d=r.perspective)!=null?d:Zw.perspective,c=Ope(o);if(l!=null&&l!==""&&c!=null){let h=c[l];h==null?z.warn("Perspective ".concat(l," not found in response! Loading default perspective instead.")):(z.log('Loading perspective "'.concat(l,'"')),i=h.url,a=h.locale_packs)}return{url:i,localePacks:a,updated_at:o.updated_at}}s(Epe,"getVenueMVFURL");var og=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function Xw(e,{signal:t}){let r=await(await qi()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}s(Xw,"getLanguagePackUnitArray");async function Qf(e){let r=(await import("./browser-RWOI5BLY.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let o=r["enterprise/locations.json"];o&&(n.enterprise.locations=JSON.parse(og().decode(o)));let i=r["enterprise/categories.json"];i&&(n.enterprise.categories=JSON.parse(og().decode(i)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(og().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(og().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(og().decode(r["manifest.json"]))),n}s(Qf,"parseLanguagePack");async function IG(e,{signal:t}){try{let r=await(await qi()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await Qf(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}s(IG,"downloadLanguagePack");async function Yw(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:o,localePacks:i}=await Epe(e,n),a=await qi()(o).then(c=>c.arrayBuffer()),l=new Uint8Array(a);t({compressed:l,localePacks:i})}catch(n){r(n)}})}s(Yw,"downloadVenueBundleMVFAPIGateway");async function Kw(e,t){return new Promise(async(r,n)=>{try{let{url:o}=await _pe(e,t),i=await qi()(o).then(l=>l.arrayBuffer()),a=new Uint8Array(i);r(a)}catch(o){n(o)}})}s(Kw,"downloadMVF");async function _pe(e,t){let r=new URL("".concat(e.baseUri?Kf(e.baseUri):Jf,"api/venue/").concat(e.mapId,"/mvf"));e.viewId&&r.searchParams.set("configId",e.viewId),e.mvfVersion&&r.searchParams.set("version",e.mvfVersion);let n=await qi()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}s(_pe,"getMakerBundleURL");function hv(e){var n,o,i,a,l,c,u,d,h,y,b,I,S,x,T,w,M,O;let t=new TextDecoder,r=t.decode.bind(t);try{let _={"connection.json":JSON.parse(r(e["connection.json"])),"manifest.geojson":JSON.parse(r(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(r(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(r(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(r(e["tileset.json"])):void 0};if(e.enterprise!=null&&(_.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(_.enterprise.locations=JSON.parse(r((o=e.enterprise)==null?void 0:o["locations.json"]))),(i=e.enterprise)!=null&&i["categories.json"]&&(_.enterprise.categories=JSON.parse(r((a=e.enterprise)==null?void 0:a["categories.json"]))),(l=e.enterprise)!=null&&l["venue.json"]&&(_.enterprise.venue=JSON.parse(r((c=e.enterprise)==null?void 0:c["venue.json"]))),(u=e.enterprise)!=null&&u["layers.json"]&&(_.enterprise.layers=JSON.parse(r((d=e.enterprise)==null?void 0:d["layers.json"]))),(h=e.enterprise)!=null&&h["locationInstances.json"]&&(_.enterprise.locationInstances=JSON.parse(r((y=e.enterprise)==null?void 0:y["locationInstances.json"]))),(b=e.enterprise)!=null&&b["enterpriseStyles.json"]&&(_.enterprise.enterpriseStyles=JSON.parse(r((I=e.enterprise)==null?void 0:I["enterpriseStyles.json"]))),(S=e.enterprise)!=null&&S["textures.json"]&&(_.enterprise.textures=JSON.parse(r((x=e.enterprise)==null?void 0:x["textures.json"]))),(T=e.enterprise)!=null&&T["floorText.json"]&&(_.enterprise.floorText=JSON.parse(r((w=e.enterprise)==null?void 0:w["floorText.json"]))),(M=e.enterprise)!=null&&M["categoryPriorities.json"]&&(_.enterprise.categoryPriorities=JSON.parse(r((O=e.enterprise)==null?void 0:O["categoryPriorities.json"])))),e["floorstack.json"]!=null?_["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(_["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),_["floorstack.json"]==null&&_["mapstack.json"]==null&&_["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(_["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),_["floor.geojson"]==null&&_["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(_["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(_["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(_["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(_["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){_.annotation={};let j=Object.keys(e.annotation);for(let F of j){let L=F.replace(/\.json|\.geojson/g,"");_.annotation[L]=JSON.parse(r(e.annotation[F]))}}let $=Object.keys(e.space);for(let j of $){let F=j.replace(/\.json|\.geojson/g,"");_.space[F]=JSON.parse(r(e.space[j]))}if(e.obstruction!=null){let j=Object.keys(e.obstruction);for(let F of j){let L=F.replace(/\.json|\.geojson/g,"");_.obstruction[L]=JSON.parse(r(e.obstruction[F]))}}else _.obstruction={};if(e.entrance!=null){let j=Object.keys(e.entrance);for(let F of j){let L=F.replace(/\.json|\.geojson/g,"");_.entrance[L]=JSON.parse(r(e.entrance[F]))}}else _.entrance={};if("floorImages"in e&&e.floorImages!=null){_.floorImages={};for(let j of Object.keys(e.floorImages)){let F=j.replace(/\.json|\.geojson/g,"");_.floorImages[F]=JSON.parse(r(e.floorImages[j]))}}if("textAreas"in e&&e.textAreas!=null){_.textAreas={};for(let j of Object.keys(e.textAreas)){let F=j.replace(/\.json|\.geojson/g,"");_.textAreas[F]=JSON.parse(r(e.textAreas[j]))}}if("facade"in e&&e.facade!=null){_.facade={};for(let j of Object.keys(e.facade)){let F=j.replace(/\.json|\.geojson/g,"");_.facade[F]=JSON.parse(r(e.facade[j]))}}if("area"in e&&e.area!=null){_.area={};for(let j of Object.keys(e.area)){let F=j.replace(/\.json|\.geojson/g,"");_.area[F]=JSON.parse(r(e.area[j]))}}return _}catch(_){throw z.error(_),new Error("MVF parsing failed! Probably encountered a bad file.")}}s(hv,"parseMVF");function kpe(e){if(e==null||typeof e!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in e?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in e?"floorstack.json":"mapstack.json"in e?"mapstack.json":"mapstack.geojson"];"styles.json"in e&&t.push("styles.json"),"shapes.json"in e&&t.push("shapes.json");for(let r of t)if(e[r]==null||e[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}s(kpe,"validateStaticMVFFiles");async function yv(e){return new Promise(async(t,r)=>{try{if(e==null||typeof e!="object")throw new Error("Error parsing data! Unzipping failed.");if(e[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let o=(await import("./browser-RWOI5BLY.js")).unzipSync(e);if(!kpe(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let i={},a=Object.keys(o);for(let l of a){if(o[l].length===0)continue;let c=l.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){i[c[0]]=o[l];continue}if(c[0]==="image"){z.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else i[c[0]]==null&&(i[c[0]]={}),i[c[0]][c[1]]=o[l]}t(i)}catch(n){r(n)}})}s(yv,"unzipMVF");function tu(){let e="us",t={};function r(){return Lpe(Npe(e),t)}return s(r,"getState"),{updateByUserOption(n){var o,i;n.environment&&(e=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(o=n.analytics)!=null&&o.baseUri&&(t.analyticsBaseUri=(i=n.analytics)==null?void 0:i.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?gG.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?gG.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}s(tu,"createEnvControl");var SG=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),gG=Object.freeze(R(P({},SG),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),Ape=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),Dpe=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Fpe=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function Lpe(e,t){return P(P({},e),t)}s(Lpe,"getAuthStateByEnvironment");var Rpe={eu:Ape,us:SG,"us-staging-enterprise":Dpe,"us-staging-self-serve":Fpe};function Npe(e){return Rpe[e]}s(Npe,"getEnvironmentAuthState");var Jw=s(e=>{var r,n;let t=Object.values((n=(r=e["floorstack.json"])!=null?r:e["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(o=>o.type!=="Outdoor").map(o=>o.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),bG=s(async e=>{let t=performance.now(),r=await Ww(e);return z.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw z.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function Qw(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await yv(e);return hv(r)}catch(r){return bG(e)}case"3.0.0":return bG(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}s(Qw,"unzipAndParseMVFv2");f();function e4(e){var o,i,a,l,c,u;let t=((i=(o=e.enterprise)==null?void 0:o.locations)==null?void 0:i.reduce((d,h)=>(d[h.id]=h,d),{}))||{};for(let d of((a=e.enterprise)==null?void 0:a.locationInstances)||[])t[d.id]=d;let r={};for(let d of e["floorstack.json"]||[])r[d.id]=d;let n={};for(let d of((l=e["floor.geojson"])==null?void 0:l.features)||[])d.properties&&d.properties.id&&(n[d.properties.id]=d.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((u=(c=e.enterprise)==null?void 0:c.categories)==null?void 0:u.reduce((d,h)=>(d[h.id]=h,d),{}))||{},"floor-stack":r,floor:n}}}s(e4,"parseLocalePackToLanguagePack");function CG(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}s(CG,"isMappedinCdnUrl");function TG(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}s(TG,"hasSasToken");f();f();f();f();f();f();f();var t4=class t4{constructor({origin:t,destination:r,distance:n=0,angle:o=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:a=!0}){m(this,"origin");m(this,"destination");m(this,"distance");m(this,"angle");m(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=o,this.weight=i||0,a?t.properties.floor===r.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===r.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};s(t4,"Edge");var ru=t4;f();f();f();f();function di(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}s(di,"getCoord");function Fo(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}s(Fo,"getCoords");function em(e){return e.type==="Feature"?e.geometry:e}s(em,"getGeom");function PG(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}s(PG,"getType");function ol(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=di(e),o=em(t),i=o.type,a=t.bbox,l=o.coordinates;if(a&&Bpe(n,a)===!1)return!1;i==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(wG(n,l[u][0],r.ignoreBoundary)){for(var d=!1,h=1;h<l[u].length&&!d;)wG(n,l[u][h],!r.ignoreBoundary)&&(d=!0),h++;d||(c=!0)}return c}s(ol,"booleanPointInPolygon");function wG(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,i=t.length-1;o<t.length;i=o++){var a=t[o][0],l=t[o][1],c=t[i][0],u=t[i][1],d=e[1]*(a-c)+l*(c-e[0])+u*(e[0]-a)===0&&(a-e[0])*(c-e[0])<=0&&(l-e[1])*(u-e[1])<=0;if(d)return!r;var h=l>e[1]!=u>e[1]&&e[0]<(c-a)*(e[1]-l)/(u-l)+a;h&&(n=!n)}return n}s(wG,"inRing");function Bpe(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}s(Bpe,"inBBox");f();f();function il([e,t],[r,n]){let o=t-n,i=e-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}s(il,"getAngle");f();var $pe=63710088e-1;function Zi(e,t){let[r,n]=e.map(d=>d*Math.PI/180),[o,i]=t.map(d=>d*Math.PI/180),a=i-n,l=o-r,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(i)*Math.sin(l/2)*Math.sin(l/2),u=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return $pe*u}s(Zi,"getDistance");f();f();function gv(e,t,r,n){let[o,i]=e,[a,l]=t,[c,u]=r,[d,h]=n;if(i===l&&o===a||u===h&&c===d)return null;let y=(d-c)*(l-i)-(h-u)*(a-o);if(y===0)return null;let b=((h-u)*(o-c)-(d-c)*(i-u))/y,I=((l-i)*(o-c)-(a-o)*(i-u))/y;if(b<0||b>1||I<0||I>1)return null;let S=i+b*(l-i);return[o+b*(a-o),S]}s(gv,"getLineIntersection");f();f();function nu(e,t,r,n){n===void 0&&(n={});var o=di(e),i=oo(o[0]),a=oo(o[1]),l=oo(r),c=S9(t,n.units),u=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),d=i+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(u)),h=Th(d),y=Th(u);return ys([h,y],n.properties)}s(nu,"destination");function r4(e,t,r,n){let o=nu(e,r/1e3,n),i=nu(t,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}s(r4,"getOffsetLine");f();function n4(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}s(n4,"radToDegNormalized");var MG=111e3;function OG(e,t,r=[],n=0){let o=!0,i=e.geometry.coordinates,a=t.geometry.coordinates,l=n4(il(i,a)-Math.PI/2),c=n4(il(i,a)+Math.PI/2),u=n/MG,d=n/(MG*Math.cos(i[1]*Math.PI/180)),h=Math.min(i[1],a[1])-u,y=Math.max(i[1],a[1])+u,b=Math.min(i[0],a[0])-d,I=Math.max(i[0],a[0])+d;for(let S of r)if(!(Math.max(S[0][1],S[1][1])<h||Math.min(S[0][1],S[1][1])>y||Math.max(S[0][0],S[1][0])<b||Math.min(S[0][0],S[1][0])>I)){if(n>0){let x=r4(i,a,n,l),T=r4(i,a,n,c);if(gv(x[0],x[1],S[0],S[1])||gv(T[0],T[1],S[0],S[1])){o=!1;return}}else if(gv(i,a,S[0],S[1])){o=!1;return}}return o}s(OG,"hasLineOfSight");var ou,fn,o4,EG,_G,kG,AG,DG,FG,xv,i4=class i4{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){E(this,fn);m(this,"edges",{});m(this,"nodesById");m(this,"nodesByGroup",new Map);E(this,ou);E(this,xv,s((t,r)=>{let n=0;for(let o of r)(!o[p(this,ou)]||o[p(this,ou)]===t.properties[p(this,ou)])&&ol(t.geometry.coordinates,o.geometry.geometry)&&(n+=Math.max(0,o.cost));return n},"#getZonalCost"));A(this,ou,r);let{features:o}=t;this.nodesById=te(this,fn,EG).call(this,o),te(this,fn,_G).call(this),te(this,fn,kG).call(this,o,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,o)=>{let i=Zi(t.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:o,zones:i,overrideEdgeWeights:a}){var y;let l=te(this,fn,o4).call(this,t),c=te(this,fn,o4).call(this,r);if(l.length===0||c.length===0)return[];let{frontier:u,cameFrom:d,costSoFar:h}=te(this,fn,AG).call(this,l,c);for(;u.length>0;){let b=u.shift();if(!b)break;if(te(this,fn,DG).call(this,b.origin,c))return te(this,fn,FG).call(this,d,b.origin.properties.id);for(let I of this.edges[b.origin.properties.id]){let S=(y=a==null?void 0:a.get(I))!=null?y:I.weight;if(o!=null&&o.has(I.origin.properties.id)&&I.destination.properties.map!==I.origin.properties.map)continue;let x=h[b.origin.properties.id]+S+p(this,xv).call(this,I.destination,i);if(!(x===1/0||n!=null&&n.has(I.destination.properties.id))&&(h[I.destination.properties.id]==null||x<h[I.destination.properties.id])){let T=x+this.getShortestEuclideanDistance(I.destination,c);h[I.destination.properties.id]=x,d[I.destination.properties.id]=I,u.push({origin:I.destination,priority:T})}}u.sort((I,S)=>I.priority-S.priority)}return[]}};ou=new WeakMap,fn=new WeakSet,o4=s(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),EG=s(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),_G=s(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:r})=>!!this.nodesById[r]))},"#removeInvalidNeighbors"),kG=s(function(t,r,n){t.forEach(o=>{let i=r==="default"?r:o.properties[r];this.nodesByGroup.has(i)||this.nodesByGroup.set(i,[]),this.nodesByGroup.get(i).push(o),this.edges[o.properties.id]=o.properties.neighbors.map(({id:a,weight:l})=>{let c=this.nodesById[a],u=Zi(o.geometry.coordinates,c.geometry.coordinates),d=il(o.geometry.coordinates,c.geometry.coordinates);return new ru({origin:o,destination:c,pathWeight:l,distance:u,angle:d,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),AG=s(function(t,r){let n=[],o={},i={};return t.forEach(a=>{let l=this.getShortestEuclideanDistance(a,r);n.push({origin:a,priority:l}),o[a.properties.id]=null,i[a.properties.id]=0}),n.sort((a,l)=>a.priority-l.priority),{frontier:n,cameFrom:o,costSoFar:i}},"#initializeSearch"),DG=s(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),FG=s(function(t,r){let n=[],o=t[r];for(;o;)n.push(o),o=t[o.origin.properties.id];return n.reverse()},"#reconstructPath"),xv=new WeakMap,s(i4,"NavigationGraph");var bv=i4;var jpe=.4,s4=class s4{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o}){m(this,"groupBy");m(this,"graph");m(this,"geometryEdgesByMapId",new Map);m(this,"generatePath",s(t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let i=0;i<t.length;i++){let{origin:a,destination:l}=t[i],c={id:a.properties.id,angle:t[i].angle,distance:t[i].distance,destination:l.properties.id,edges:this.graph.edges[a.properties.id]};this.groupBy!=="default"&&(c.groupBy=a.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:c})}let o={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(o.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:o}),n},"generatePath"));m(this,"getDistance",s((t,r)=>Zi(t,r),"getDistance"));m(this,"getAngle",s((t,r)=>il(t,r),"getAngle"));this.groupBy=n,this.graph=new bv({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o}),((r==null?void 0:r.features)||[]).forEach(a=>{let l=null;if(a.geometry.type==="LineString"?l=a.geometry.coordinates:a.geometry.type==="Polygon"&&(l=a.geometry.coordinates.flat()),l){let c=this.groupBy==="default"?this.groupBy:a.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),l.forEach((u,d)=>{this.geometryEdgesByMapId.get(c).push([u,l[d+1]||l[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:o,disabledConnectionNodeIds:i,simplify:a,multiplicativeDistanceWeightScaling:l,overrideEdgeWeights:c}){var y,b;let u=(y=a==null?void 0:a.enabled)!=null?y:!0,d=t!=null?t:[],h=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:d,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(i),overrideEdgeWeights:c});return h.length===0?{type:"FeatureCollection",features:[]}:(u&&(h=this.simplifyAllSteps(h,(b=a==null?void 0:a.bufferRadius)!=null?b:jpe,l)),this.generatePath(h))}simplifyAllSteps(t,r,n){var u,d;let o=[],i=[t[0]];for(let h=1;h<t.length;h++)if(this.groupBy!=="default"&&t[h].origin.properties[this.groupBy]!==t[h-1].origin.properties[this.groupBy]){let y=t[h-1].origin.properties[this.groupBy],b=(u=this.geometryEdgesByMapId.get(y))!=null?u:[];o.push(...this.simplifySteps(i,b,r,n)),i=[t[h]]}else i.push(t[h]);let a=t[t.length-1],l=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],c=(d=this.geometryEdgesByMapId.get(l))!=null?d:[];return o.push(...this.simplifySteps(i,c,r,n)),o}simplifySteps(t,r,n,o){if(t.length<3)return t;let i=[t[0]],a=1;for(let l=a+2;l<t.length;l++)if(t[a].origin.properties.preventSmoothing||!OG(t[a].origin,t[l].origin,r,n)){let c=l-1;i.push(new ru(R(P({},t[a]),{destination:t[c].origin,distance:Zi(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates),angle:il(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates)}))),a=c}return i.push(new ru(R(P({},t[a]),{destination:t[t.length-1].origin,distance:Zi(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:il(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o})),t[t.length-1]),i}};s(s4,"Navigator");var tm=s4;f();var Txe={};cs(Txe,{Annotation:()=>Oa,Area:()=>Pa,Connection:()=>Yl,Coordinate:()=>$e,DOORS:()=>P1,Door:()=>Ei,E_SDK_LOG_LEVEL:()=>V6,EnterpriseCategory:()=>zh,EnterpriseLocation:()=>Ss,EnterpriseVenue:()=>Zb,Facade:()=>Ho,Floor:()=>Gn,FloorStack:()=>Eh,Hyperlink:()=>zl,ImageMetaData:()=>Wl,LocationCategory:()=>Hh,LocationProfile:()=>Ip,MAPPEDIN_COLORS:()=>q9,MapObject:()=>io,Node:()=>Sa,PointOfInterest:()=>Ma,Space:()=>Gr,WALLS:()=>T1,__setWatermarkOnClickFn:()=>gxe,createMapLibreOverlay:()=>Sxe,disableText3DWorker:()=>sW,enableTestMode:()=>w4,getMapData:()=>MW,getMapDataEnterprise:()=>Ixe,hydrateMapData:()=>vxe,hydrateMapDataFromMVF:()=>bxe,parseMVF:()=>hv,preloadFont:()=>U5,setLoggerLevel:()=>z6,setUseEnterpriseAPI:()=>xxe,setWorkersUrl:()=>dW,show3dMap:()=>OW,show3dMapGeojson:()=>Cxe,unzipMVF:()=>yv});f();f();f();f();var sg,ag,lg,a4=class a4{constructor(t,r,{enabled:n=!1}={}){E(this,sg);m(this,"searchInstance");E(this,ag);E(this,lg);m(this,"enabled",!1);A(this,sg,t),A(this,ag,r),A(this,lg,()=>{var o;(o=this.searchInstance)==null||o.then(i=>i.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return z.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return z.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return z.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return z.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-KFN6TGNE.js").then(({InternalSearch:t})=>new t(p(this,sg)))),p(this,ag).on("language-change",p(this,lg)),await this.searchInstance)}};sg=new WeakMap,ag=new WeakMap,lg=new WeakMap,s(a4,"Search");var ig=a4;var LG=new WeakMap,Pr,c4=class c4 extends Be{constructor(r,{search:n}={}){super();E(this,Pr);m(this,"Analytics");m(this,"Search");m(this,"Query");m(this,"getDirections",s((r,n,o)=>p(this,Pr).getDirections(r,n,o),"getDirections"));m(this,"getDirectionsMultiDestination",s((r,n,o)=>p(this,Pr).getDirectionsMultiDestination(r,n,o),"getDirectionsMultiDestination"));A(this,Pr,r),LG.set(this,r),this.Analytics=new Wh(r.Analytics),this.Query=r.Query,this.Search=new ig(this,r,{enabled:n==null?void 0:n.enabled}),p(this,Pr).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return p(this,Pr).getEnv()}getAccessToken(){var r;return(r=p(this,Pr).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return p(this,Pr).mapName}get mapCenter(){return p(this,Pr).mapCenter}get organizationId(){return p(this,Pr).organizationId}get outdoorViewToken(){return p(this,Pr).outdoorViewToken}getByType(r){return p(this,Pr).getByType(r)}getById(r,n){return p(this,Pr).getById(r,n)}getByExternalId(r,n){return p(this,Pr).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return p(this,Pr).changeLanguage(r)}get currentLanguage(){return p(this,Pr).currentLanguage}get naturalBearing(){var r;return(r=p(this,Pr).naturalBearing)!=null?r:0}getDistance(r,n){return p(this,Pr).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return p(this,Pr).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return p(this,Pr).toJSONBundle({downloadLanguagePacks:r})}};Pr=new WeakMap,s(c4,"MapData");var l4=c4,vv=l4;function cg(e){let t=LG.get(e);if(!t)throw new Error("MapDataInternal not found");return t}s(cg,"getMapDataInternal");f();f();f();f();f();function Gpe(e,t,r){r===void 0&&(r={});for(var n=di(e),o=Fo(t),i=0;i<o.length-1;i++){var a=!1;if(r.ignoreEndVertices&&(i===0&&(a="start"),i===o.length-2&&(a="end"),i===0&&i+1===o.length-1&&(a="both")),Upe(o[i],o[i+1],n,a,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}s(Gpe,"booleanPointOnLine");function Upe(e,t,r,n,o){var i=r[0],a=r[1],l=e[0],c=e[1],u=t[0],d=t[1],h=r[0]-l,y=r[1]-c,b=u-l,I=d-c,S=h*I-y*b;if(o!==null){if(Math.abs(S)>o)return!1}else if(S!==0)return!1;if(n){if(n==="start")return Math.abs(b)>=Math.abs(I)?b>0?l<i&&i<=u:u<=i&&i<l:I>0?c<a&&a<=d:d<=a&&a<c;if(n==="end")return Math.abs(b)>=Math.abs(I)?b>0?l<=i&&i<u:u<i&&i<=l:I>0?c<=a&&a<d:d<a&&a<=c;if(n==="both")return Math.abs(b)>=Math.abs(I)?b>0?l<i&&i<u:u<i&&i<l:I>0?c<a&&a<d:d<a&&a<c}else return Math.abs(b)>=Math.abs(I)?b>0?l<=i&&i<=u:u<=i&&i<=l:I>0?c<=a&&a<=d:d<=a&&a<=c;return!1}s(Upe,"isPointOnLineSegment");var RG=Gpe;f();function Vpe(e,t){t===void 0&&(t={});var r=hd(e),n=(r[0]+r[2])/2,o=(r[1]+r[3])/2;return ys([n,o],t.properties,t)}s(Vpe,"center");var Iv=Vpe;f();f();function zpe(e,t,r){r===void 0&&(r={});var n=di(e),o=di(t),i=oo(o[1]-n[1]),a=oo(o[0]-n[0]),l=oo(n[1]),c=oo(o[1]),u=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return I9(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),r.units)}s(zpe,"distance");var xc=zpe;function Sv(e,t){return t===void 0&&(t={}),T9(e,function(r,n){var o=n.geometry.coordinates;return r+xc(o[0],o[1],t)},0)}s(Sv,"length");f();f();f();function Cv(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Hpe(e,t);var n=di(e),o=di(t),i=oo(n[0]),a=oo(o[0]),l=oo(n[1]),c=oo(o[1]),u=Math.sin(a-i)*Math.cos(c),d=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-i);return Th(Math.atan2(u,d))}s(Cv,"bearing");function Hpe(e,t){var r=Cv(t,e);return r=(r+180)%360,r}s(Hpe,"calculateFinalBearing");f();f();function Wpe(e){if(!e)throw new Error("geojson is required");var t=[];return gs(e,function(r){qpe(r,t)}),op(t)}s(Wpe,"lineSegment");function qpe(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Fo(n);break;case"LineString":r=[Fo(n)]}r.forEach(function(o){var i=Zpe(o,e.properties);i.forEach(function(a){a.id=t.length,t.push(a)})})}}s(qpe,"lineSegmentFeature");function Zpe(e,t){var r=[];return e.reduce(function(n,o){var i=Ia([n,o],t);return i.bbox=Xpe(n,o),r.push(i),o}),r}s(Zpe,"createSegments");function Xpe(e,t){var r=e[0],n=e[1],o=t[0],i=t[1],a=r<o?r:o,l=n<i?n:i,c=r>o?r:o,u=n>i?n:i;return[a,l,c,u]}s(Xpe,"bbox");var p4=Wpe;var eU=ps(JG(),1);function Sue(e,t){var r={},n=[];if(e.type==="LineString"&&(e=jI(e)),t.type==="LineString"&&(t=jI(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=QG(e,t);return o&&n.push(o),op(n)}var i=(0,eU.default)();return i.load(p4(t)),GI(p4(e),function(a){GI(i.search(a),function(l){var c=QG(a,l);if(c){var u=Fo(c).join(",");r[u]||(r[u]=!0,n.push(c))}})}),op(n)}s(Sue,"lineIntersect");function QG(e,t){var r=Fo(e),n=Fo(t);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],i=r[0][1],a=r[1][0],l=r[1][1],c=n[0][0],u=n[0][1],d=n[1][0],h=n[1][1],y=(h-u)*(a-o)-(d-c)*(l-i),b=(d-c)*(i-u)-(h-u)*(o-c),I=(a-o)*(i-u)-(l-i)*(o-c);if(y===0)return null;var S=b/y,x=I/y;if(S>=0&&S<=1&&x>=0&&x<=1){var T=o+S*(a-o),w=i+S*(l-i);return ys([T,w])}return null}s(QG,"intersects");var nm=Sue;function Cue(e,t,r){r===void 0&&(r={});var n=ys([1/0,1/0],{dist:1/0}),o=0;return gs(e,function(i){for(var a=Fo(i),l=0;l<a.length-1;l++){var c=ys(a[l]);c.properties.dist=xc(t,c,r);var u=ys(a[l+1]);u.properties.dist=xc(t,u,r);var d=xc(c,u,r),h=Math.max(c.properties.dist,u.properties.dist),y=Cv(c,u),b=nu(t,h,y+90,r),I=nu(t,h,y-90,r),S=nm(Ia([b.geometry.coordinates,I.geometry.coordinates]),Ia([c.geometry.coordinates,u.geometry.coordinates])),x=null;S.features.length>0&&(x=S.features[0],x.properties.dist=xc(t,x,r),x.properties.location=o+xc(c,x,r)),c.properties.dist<n.properties.dist&&(n=c,n.properties.index=l,n.properties.location=o),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=l+1,n.properties.location=o+d),x&&x.properties.dist<n.properties.dist&&(n=x,n.properties.index=l),o+=d}}),n}s(Cue,"nearestPointOnLine");var ug=Cue;function Tue(e,t,r){var n=Fo(r);if(PG(r)!=="LineString")throw new Error("line must be a LineString");var o=ug(r,e),i=ug(r,t),a;o.properties.index<=i.properties.index?a=[o,i]:a=[i,o];for(var l=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)l.push(n[c]);return l.push(a[1].geometry.coordinates),Ia(l,r.properties)}s(Tue,"lineSlice");var C4=Tue;var Pue=1e-7;function T4(e){return{type:"Point",coordinates:e}}s(T4,"point");function wue(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,o=r.map(i=>ug(e,T4(i)));return n.reduce((i,a)=>{let l=C4(T4(a),o[0],e),c=C4(T4(a),o[1],e),u=Sv(l)<Sv(c)?l:c;return u.properties=R(P({},e.properties),{entrances:[]}),i.concat([u])},[])}s(wue,"splitObstructionByEntrance");function P4(e,t){return t.reduce((r,n)=>{let o={epsilon:Pue},i=r.obstructions.findIndex(l=>RG(Iv(n),l,o)),a=r.obstructions[i];if(a){let[l,c]=wue(a,n);r.entrances.push(n),r.obstructions.splice(i,1,l,c)}return r},{obstructions:[e],entrances:[]})}s(P4,"findAndSplitObstructionByAllEntrances");f();f();f();f();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:s(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var tU="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";f();f();var rU=!1;function w4(){rU=!0}s(w4,"enableTestMode");function nU(){return rU}s(nU,"isTestMode");var M4=class M4{constructor(t){m(this,"backgroundAlpha",1);m(this,"backgroundColor",new Rt);m(this,"width",0);m(this,"height",0);m(this,"options",{});m(this,"renderer");m(this,"enabledLayers",new Set([0,1]));m(this,"handleWebGLContextCreationError",s(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));m(this,"handleWebGLContextLost",s(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));m(this,"handleWebGLContextRestored",s(t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)},"handleWebGLContextRestored"));var r,n,o,i,a;try{this.options=t,nU()?(this.renderer={setSize:s(()=>{},"setSize"),state:{reset:s(()=>{},"reset")},properties:{get:s(()=>{},"get")},getSize:s(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:s(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:s(()=>1,"getClearAlpha"),getClearColor:s(()=>new Rt,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:s(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:s(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:s(()=>{},"setRenderTarget"),setClearColor:s(()=>{},"setClearColor"),clear:s(()=>{},"clear"),render:s(()=>{},"render"),clearStencil:s(()=>{},"clearStencil"),clearDepth:s(()=>{},"clearDepth"),domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new m9({canvas:t.canvas,alpha:t.alpha||!1,stencil:!0,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Rt((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(l){z.error(l),t.onWebGLRendererError&&t.onWebGLRendererError(l)}(o=this.domElement())==null||o.addEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(a=this.domElement())==null||a.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,o,i;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(i=this.domElement())==null||i.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset(),r.layers.disableAll();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.clearDepth(),r.layers.disableAll(),r.layers.enable(Gb.ALWAYS_ON_TOP),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){v.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=r,this.renderer.setSize(t,r,!1))}setBackgroundColor(t,r){this.backgroundColor=t,this.backgroundAlpha=r}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};s(M4,"Renderer");var Mv=M4;f();f();var oU='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';f();f();f();f();f();function iU(e,t){return t.x+t.w<e.x+e.w&&t.x>e.x&&t.y>e.y&&t.y+t.h<e.y+e.h}s(iU,"contains");f();function sU(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}s(sU,"intersectPoint");f();function aU(e,t){let r=t.x,n=t.y,o=t.x+t.w,i=t.y+t.h,a=e.x,l=e.y,c=e.x+e.w,u=e.y+e.h;return r<c&&a<o&&n<u&&l<i}s(aU,"intersects");f();function sl(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}s(sl,"appendItems");f();var O4=class O4{constructor(t,r,n,o,i){m(this,"x");m(this,"y");m(this,"w");m(this,"h");m(this,"userData");this.userData=typeof i>"u"?null:i,this.x=t,this.y=r,this.w=n,this.h=o}contains(t){return t===this?!1:iU(this,t)}intersects(t){return aU(this,t)}intersectsPoint(t){return sU(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};s(O4,"Rectangle");var Wr=O4;var iu=class iu{constructor(t,r){m(this,"topLeft");m(this,"topRight");m(this,"bottomLeft");m(this,"bottomRight");m(this,"divided",!1);m(this,"boundary");m(this,"capacity",16);m(this,"objects",[]);m(this,"parent");this.parent=r,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:r,w:n,h:o}=this.boundary;this.topLeft=new iu(new Wr(t,r,n/2,o/2),this),this.topRight=new iu(new Wr(t+n/2,r,n/2,o/2),this),this.bottomLeft=new iu(new Wr(t,r+o/2,n/2,o/2),this),this.bottomRight=new iu(new Wr(t+n/2,r+o/2,n/2,o/2),this),this.divided=!0}queryRect(t){let r=[];if(this.boundary.intersects(t))r.push(...this.objects);else return[];return this.divided&&(sl(r,this.topLeft.queryRect(t)),sl(r,this.topRight.queryRect(t)),sl(r,this.bottomLeft.queryRect(t)),sl(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(sl(r,this.topLeft.queryPoint(t)),sl(r,this.topRight.queryPoint(t)),sl(r,this.bottomLeft.queryPoint(t)),sl(r,this.bottomRight.queryPoint(t))),r}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(r=>r.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};s(iu,"QuadTree");var Xs=iu;f();f();var lU=["","","low","medium","high","always-visible"];function cU(e){return Math.min(5,Math.max(2,e))}s(cU,"clampTierNumber");function om(e){if(typeof e=="number")return cU(e);let t=lU.indexOf(e);return t===-1?3:t}s(om,"convertCollisionRankingTierToNumber");function dg(e){let t=cU(e);return lU[t]}s(dg,"convertNumberToCollisionRankingTier");function uU(e,t,r){let n,o,i,a=null,l=0;r||(r={});let c=s(function(){l=r.leading===!1?0:Date.now(),a=null,i=e.apply(n,o),a||(n=o=null)},"later");return function(){let u=Date.now();!l&&r.leading===!1&&(l=u);let d=t-(u-l);return n=globalThis,o=arguments,d<=0||d>t?(a&&(clearTimeout(a),a=null),l=u,i=e.apply(n,o),a||(n=o=null)):!a&&r.trailing!==!1&&(a=setTimeout(c,d)),i}}s(uU,"throttle");var su=!1,E4="",Oue=150,k4=class k4 extends Be{constructor(r,n,o=E4?new Worker(E4):new Worker(URL.createObjectURL(new Blob([oU],{type:"text/javascript"})))){super();m(this,"worker");m(this,"debugContext");m(this,"debugCanvas");m(this,"collidersDirty",!0);m(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);m(this,"visibleCollidersQTree",new Xs(new Wr(0,0,0,0)));m(this,"interactiveCollidersQTree",new Xs(new Wr(0,0,0,0)));m(this,"coreState");m(this,"postMessage");m(this,"showCollisionBoxes",s(()=>{su=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));m(this,"hideCollisionBoxes",s(()=>{su=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));m(this,"currentMsgId","");m(this,"working",!1);m(this,"_postMessage",s(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));m(this,"componentArray",[]);m(this,"update",s((r,n,o="bottom-left",i=!1)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let l;for(let c of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(c);u&&(l=u.components[0],this.componentArray.push(l))}this.resize(r,n,o),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(l=>l.collisionDirty===!0);a&&this.componentArray.sort((l,c)=>c.rank-l.rank);for(let l=0;l<this.componentArray.length;l++)if(this.packedMessage){let c=this.componentArray[l].toPackedMessage(i&&!a);this.packedMessage[0][l]==null&&(this.packedMessage[0][l]=[]),this.packedMessage[0][l][0]==null&&(this.packedMessage[0][l][0]=[]),this.packedMessage[0][l][0]=c.bboxes,this.packedMessage[0][l][1]=c.enabled&&this.componentArray[l].visible&&!this.componentArray[l].isOccluded?1:0,this.packedMessage[0][l][2]=c.rank===5?1:0,this.packedMessage[0][l][3]=c.x,this.packedMessage[0][l][4]=c.y,this.packedMessage[0][l][5]=c.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][l][6]=c.lockedToStrategyIndex}this.working||this.postMessage()},"update"));m(this,"resolve",s(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,o=-1,i,a,l;su&&(this.visibleCollidersQTree=new Xs(new Wr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Xs(new Wr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let c=0;c<this.componentArray.length;c++){let u=this.componentArray[c];n[c]!=null&&(o=n[c][0],i=n[c][2],u.offscreen=n[c][1]===1,o!==-1&&i!=null?(l=new Wr(i.x,i.y,i.w,i.h,{entityId:u.id}),su&&this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(u.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new Wr(i.x,i.y,i.w,i.h,{entityId:u.id})),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),o!==-1&&o!==u.currentStrategyIndex&&(u.activeBoundingBox=l,u.onStrategySelected(o))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),o!==-1&&o!==u.currentStrategyIndex&&u.onStrategySelected(o)))}su&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));m(this,"drawDebug",s(()=>{su&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));m(this,"destroy",s(()=>{this.worker.terminate()},"destroy"));this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=o,this.worker.onmessage=i=>this.resolve(i),this.postMessage=uU(this._postMessage,Oue,!1),su?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,o){this.packedMessage[6]=o,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};s(k4,"CollisionSystem");var Ov=k4;function _4(e){E4=e}s(_4,"setWorkerUrl");f();f();f();f();var D4=class D4{constructor(t){m(this,"type");m(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};s(D4,"Tap");var Ev=D4,F4=class F4{constructor(){m(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};s(F4,"TapsController");var _v=F4;f();function dU(e){let t=new Set;for(let r of e){let n=r.object;for(;n.parent&&!t.has(n.parent);)n=n.parent,n instanceof at&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}s(dU,"getUniqueIntersectedGroupContainers");var im,L4=class L4 extends Be{constructor(r,n,o,i,a){super();m(this,"raycaster",new ms);m(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});m(this,"coreState");m(this,"camera");m(this,"worldPlane");m(this,"_quadtree",new Xs(new Wr(0,0,0,0)));m(this,"_container");m(this,"lastPointerEvent");m(this,"cursor","grab");m(this,"touchesCount",0);m(this,"isUserInteracting");m(this,"hasTouched",!1);E(this,im);m(this,"onPointerMoveRaf",s(r=>{this.lastPointerEvent=r,p(this,im)&&cancelAnimationFrame(p(this,im)),A(this,im,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));m(this,"onPointerMove",s(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));m(this,"tapsControl",new _v);m(this,"onPointerDown",s(r=>{r.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:r.timeStamp,clientX:r.clientX,clientY:r.clientY},this.lastPointerEvent=r,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),r.pointerType==="touch"&&(this.tapsControl.add(new Ev(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));m(this,"clickTimeout");m(this,"onPointerUp",s(r=>{this.tapsControl.discardOutsideOfWaitWindow(r.timeStamp),this.lastPointerEvent=r,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(r);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(r.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",r),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(r),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",r),this.flush()):this.handleClick(r)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));m(this,"dirty3D",!0);m(this,"cachedHitBoxes",{entities:[],groups:[]});m(this,"ndcPoint",new De);m(this,"debugPanel");this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=r,this.coreState=n,this.worldPlane=i,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(i=>{var a,l;return((a=i.object)==null?void 0:a.name)==="worldPlane"||((l=i.object)==null?void 0:l.visible)}),o=n.findIndex(i=>{var a;return((a=i.object)==null?void 0:a.name)==="worldPlane"});return o!==-1&&n.push(n.splice(o,1)[0]),n}getGroupContainerIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(i=>i.object.visible),o;return n!=null&&n.length>0&&(o=dU(n)),o}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(r){let n=r||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:o,entity2D:i,position:a,groupContainers:l}=this.intersect(n);(this.detect3DEntityHover(o)||this.detect2DEntityHover(i)||this.detect3DContainerHover(l))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=i,this.state.hovered3DContainers=l,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:l})),this.handleCursor()}handleCursor(){var a;let r=!!(this.state.hovered3DEntity&&((a=this.state.hovered3DEntity)!=null&&a.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,i=Aue(r,o,n);this.cursor!==i&&(this.cursor=i,i==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),(r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry"?r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh):(r==null?void 0:r.type)==="group-container"&&r.components[1]&&!this.cachedHitBoxes.groups.includes(r)&&this.cachedHitBoxes.groups.push(r);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var x,T,w,M,O;let n=[r.offsetX,r.offsetY],o=this._quadtree.queryPoint(n),[i]=o.filter(_=>_.intersectsPoint(n)),a=this.coreState.containerOffset[0],l=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-l)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-a)/this._container.clientHeight)*2+1;let c=this.getThreeDIntersectsFromXY(this.ndcPoint),u=(x=c[0])==null?void 0:x.point,d=[],h=[];for(let _ of c.filter($=>$.object.name!=="worldPlane"))_.object instanceof We&&_.object.material.depthTest===!1?d.push(_):h.push(_);let y=(w=(T=d[0])!=null?T:h[0])!=null?w:void 0,b,I;if(y!=null){if(b=Fue(y.object,this.coreState.geometry3DMap),!b){let _=(M=y==null?void 0:y.instanceId)!=null?M:y==null?void 0:y.batchId;b=_!=null&&(y!=null&&y.object.userData.entities)?this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entities[_]):this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entityId)}b!=null&&b.components[2]&&(I=b)}let S=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((O=i==null?void 0:i.userData)==null?void 0:O.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(i==null?void 0:i.userData.entityId),entity3D:I,position:u,groupContainers:S}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&mU(this.state.lastHover,!1,this.coreState),r&&mU(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!g9(this.state.hovered3DContainers,r)}updateInteractionStateIfPanning(r){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(r.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(r.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let r=document.createElement("div");r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.backgroundColor="white",r.style.padding="10px",document.body.append(r),r.id="interaction-debug-panel",this.debugPanel=r,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var o,i,a;this.queueDebugMessage("CLICK \n3D: ".concat((o=n.entity3D)==null?void 0:o.id," \n2D: ").concat((i=n.entity2D)==null?void 0:i.id," \nPos: ").concat((a=n.position)==null?void 0:a.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var o,i,a;this.queueDebugMessage("HOVER \n3D: ".concat((o=n.entity3D)==null?void 0:o.id," \n2D: ").concat((i=n.entity2D)==null?void 0:i.id," \nPos: ").concat((a=n.position)==null?void 0:a.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,n){var i;let o=document.createElement("pre");o.style.maxWidth="300px",o.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",o.style.backgroundColor=n,o.textContent=r,(i=this.debugPanel)==null||i.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};im=new WeakMap,s(L4,"InteractionSystem");var mg=L4;function mU(e,t,r){var a;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let o=(a=e.components[0].textMesh)==null?void 0:a.userData.entityId;if(!o)return;let i=r.geometry3DMap.get(o);(i==null?void 0:i.type)==="text3d"&&(i.components[1].hoverByPolygon=t,i.components[1].dirty=!0)}s(mU,"updateHover");function Aue(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}s(Aue,"processCursor");function Due(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof $l)return;if(t.userData.isSingleModel)return t;t=t.parent}}s(Due,"findModelParent");function Fue(e,t){let r=Due(e);return r?t.get(r.userData.entityId):void 0}s(Fue,"findModelParentEntity");f();f();f();var G={};cs(G,{BRAND:()=>sde,DIRTY:()=>au,EMPTY_PATH:()=>Bue,INVALID:()=>Re,NEVER:()=>zde,OK:()=>Fn,ParseStatus:()=>hn,Schema:()=>Qe,ZodAny:()=>Cc,ZodArray:()=>pl,ZodBigInt:()=>pu,ZodBoolean:()=>uu,ZodBranded:()=>Ig,ZodCatch:()=>Su,ZodDate:()=>du,ZodDefault:()=>Iu,ZodDiscriminatedUnion:()=>Lv,ZodEffects:()=>hi,ZodEnum:()=>xu,ZodError:()=>go,ZodFirstPartyTypeKind:()=>Ge,ZodFunction:()=>Nv,ZodIntersection:()=>yu,ZodIssueCode:()=>ae,ZodLazy:()=>gu,ZodLiteral:()=>bu,ZodMap:()=>fm,ZodNaN:()=>hm,ZodNativeEnum:()=>vu,ZodNever:()=>Xi,ZodNull:()=>mu,ZodNullable:()=>Qs,ZodNumber:()=>cu,ZodObject:()=>bo,ZodOptional:()=>fi,ZodParsedType:()=>xe,ZodPipeline:()=>Sg,ZodPromise:()=>Tc,ZodReadonly:()=>Cu,ZodRecord:()=>Rv,ZodSchema:()=>Qe,ZodSet:()=>mm,ZodString:()=>Sc,ZodSymbol:()=>um,ZodTransformer:()=>hi,ZodTuple:()=>Js,ZodType:()=>Qe,ZodUndefined:()=>fu,ZodUnion:()=>hu,ZodUnknown:()=>cl,ZodVoid:()=>dm,addIssueToContext:()=>fe,any:()=>hde,array:()=>xde,bigint:()=>pde,boolean:()=>PU,coerce:()=>Vde,custom:()=>SU,date:()=>ude,datetimeRegex:()=>vU,defaultErrorMap:()=>al,discriminatedUnion:()=>Cde,effect:()=>Lde,enum:()=>Ade,function:()=>Ede,getErrorMap:()=>sm,getParsedType:()=>Ks,instanceof:()=>lde,intersection:()=>Tde,isAborted:()=>Dv,isAsync:()=>am,isDirty:()=>Fv,isValid:()=>Ic,late:()=>ade,lazy:()=>_de,literal:()=>kde,makeIssue:()=>hg,map:()=>Mde,nan:()=>cde,nativeEnum:()=>Dde,never:()=>gde,null:()=>mde,nullable:()=>Nde,number:()=>TU,object:()=>vde,objectUtil:()=>R4,oboolean:()=>Ude,onumber:()=>Gde,optional:()=>Rde,ostring:()=>jde,pipeline:()=>$de,preprocess:()=>Bde,promise:()=>Fde,quotelessJson:()=>Lue,record:()=>wde,set:()=>Ode,setErrorMap:()=>Nue,strictObject:()=>Ide,string:()=>CU,symbol:()=>dde,transformer:()=>Lde,tuple:()=>Pde,undefined:()=>fde,union:()=>Sde,unknown:()=>yde,util:()=>pt,void:()=>bde});f();f();f();f();f();var pt;(function(e){e.assertEqual=o=>{};function t(o){}s(t,"assertIs"),e.assertIs=t;function r(o){throw new Error}s(r,"assertNever"),e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),a={};for(let l of i)a[l]=o[l];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(i)}s(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(pt||(pt={}));var R4;(function(e){e.mergeShapes=(t,r)=>P(P({},t),r)})(R4||(R4={}));var xe=pt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ks=s(e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return Number.isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},"getParsedType");var ae=pt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Lue=s(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),kv=class kv extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=s(i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let l=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(a))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}},"processError");return o(this),n}static assert(t){if(!(t instanceof kv))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,pt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};s(kv,"ZodError");var go=kv;go.create=e=>new go(e);var Rue=s((e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===xe.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case ae.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,pt.jsonStringifyReplacer));break;case ae.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(pt.joinValues(e.keys,", "));break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(pt.joinValues(e.options));break;case ae.invalid_enum_value:r="Invalid enum value. Expected ".concat(pt.joinValues(e.options),", received '").concat(e.received,"'");break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):pt.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case ae.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case ae.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,pt.assertNever(e)}return{message:r}},"errorMap"),al=Rue;var hU=al;function Nue(e){hU=e}s(Nue,"setErrorMap");function sm(){return hU}s(sm,"getErrorMap");f();var hg=s(e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],a=R(P({},o),{path:i});if(o.message!==void 0)return R(P({},o),{path:i,message:o.message});let l="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)l=u(a,{data:t,defaultError:l}).message;return R(P({},o),{path:i,message:l})},"makeIssue"),Bue=[];function fe(e,t){let r=sm(),n=hg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===al?void 0:al].filter(o=>!!o)});e.common.issues.push(n)}s(fe,"addIssueToContext");var Av=class Av{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Re;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,a=await o.value;n.push({key:i,value:a})}return Av.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return Re;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}};s(Av,"ParseStatus");var hn=Av,Re=Object.freeze({status:"aborted"}),au=s(e=>({status:"dirty",value:e}),"DIRTY"),Fn=s(e=>({status:"valid",value:e}),"OK"),Dv=s(e=>e.status==="aborted","isAborted"),Fv=s(e=>e.status==="dirty","isDirty"),Ic=s(e=>e.status==="valid","isValid"),am=s(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");f();f();f();var Oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Oe||(Oe={}));var $4=class $4{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};s($4,"ParseInputLazyPath");var mi=$4,yU=s((e,t)=>{if(Ic(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new go(e.common.issues);return this._error=r,this._error}}},"handleResult");function Xe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:s((a,l)=>{var u,d;let{message:c}=e;return a.code==="invalid_enum_value"?{message:c!=null?c:l.defaultError}:typeof l.data>"u"?{message:(u=c!=null?c:n)!=null?u:l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:(d=c!=null?c:r)!=null?d:l.defaultError}},"customMap"),description:o}}s(Xe,"processCreateParams");var j4=class j4{get description(){return this._def.description}_getType(t){return Ks(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ks(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new hn,ctx:{common:t.parent.common,data:t.data,parsedType:Ks(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(am(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!=null?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ks(t)},o=this._parseSync({data:t,path:n.path,parent:n});return yU(n,o)}"~validate"(t){var n,o;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ks(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:r});return Ic(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>Ic(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ks(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(am(o)?o:Promise.resolve(o));return yU(n,i)}refine(t,r){let n=s(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"getIssueProperties");return this._refinement((o,i)=>{let a=t(o),l=s(()=>i.addIssue(P({code:ae.custom},n(o))),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new hi({schema:this,typeName:Ge.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s(r=>this["~validate"](r),"validate")}}optional(){return fi.create(this,this._def)}nullable(){return Qs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pl.create(this)}promise(){return Tc.create(this,this._def)}or(t){return hu.create([this,t],this._def)}and(t){return yu.create(this,t,this._def)}transform(t){return new hi(R(P({},Xe(this._def)),{schema:this,typeName:Ge.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new Iu(R(P({},Xe(this._def)),{innerType:this,defaultValue:r,typeName:Ge.ZodDefault}))}brand(){return new Ig(P({typeName:Ge.ZodBranded,type:this},Xe(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new Su(R(P({},Xe(this._def)),{innerType:this,catchValue:r,typeName:Ge.ZodCatch}))}describe(t){let r=this.constructor;return new r(R(P({},this._def),{description:t}))}pipe(t){return Sg.create(this,t)}readonly(){return Cu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};s(j4,"ZodType");var Qe=j4,$ue=/^c[^\s-]{8,}$/i,jue=/^[0-9a-z]+$/,Gue=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Uue=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Vue=/^[a-z0-9_-]{21}$/i,zue=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hue=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wue=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,que="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",N4,Zue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xue=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Yue=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Kue=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Jue=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Que=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bU="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ede=new RegExp("^".concat(bU,"$"));function xU(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}s(xU,"timeRegexSource");function tde(e){return new RegExp("^".concat(xU(e),"$"))}s(tde,"timeRegex");function vU(e){let t="".concat(bU,"T").concat(xU(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}s(vU,"datetimeRegex");function rde(e,t){return!!((t==="v4"||!t)&&Zue.test(e)||(t==="v6"||!t)&&Yue.test(e))}s(rde,"isValidIP");function nde(e,t){if(!zue.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch(r){return!1}}s(nde,"isValidJWT");function ode(e,t){return!!((t==="v4"||!t)&&Xue.test(e)||(t==="v6"||!t)&&Kue.test(e))}s(ode,"isValidCidr");var lu=class lu extends Qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:xe.string,received:i.parsedType}),Re}let n=new hn,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,l=t.data.length<i.value;(a||l)&&(o=this._getOrReturnCtx(t,o),a?fe(o,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&fe(o,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Wue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"email",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")N4||(N4=new RegExp(que,"u")),N4.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"emoji",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Uue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"uuid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Vue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"nanoid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")$ue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"cuid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")jue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"cuid2",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Gue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"ulid",code:ae.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch(a){o=this._getOrReturnCtx(t,o),fe(o,{validation:"url",code:ae.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"regex",code:ae.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?vU(i).test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ede.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?tde(i).test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Hue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"duration",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?rde(t.data,i.version)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"ip",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?nde(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"jwt",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?ode(t.data,i.version)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"cidr",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Jue.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"base64",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?Que.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"base64url",code:ae.invalid_string,message:i.message}),n.dirty()):pt.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),P({validation:r,code:ae.invalid_string},Oe.errToObj(n)))}_addCheck(t){return new lu(R(P({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(P({kind:"email"},Oe.errToObj(t)))}url(t){return this._addCheck(P({kind:"url"},Oe.errToObj(t)))}emoji(t){return this._addCheck(P({kind:"emoji"},Oe.errToObj(t)))}uuid(t){return this._addCheck(P({kind:"uuid"},Oe.errToObj(t)))}nanoid(t){return this._addCheck(P({kind:"nanoid"},Oe.errToObj(t)))}cuid(t){return this._addCheck(P({kind:"cuid"},Oe.errToObj(t)))}cuid2(t){return this._addCheck(P({kind:"cuid2"},Oe.errToObj(t)))}ulid(t){return this._addCheck(P({kind:"ulid"},Oe.errToObj(t)))}base64(t){return this._addCheck(P({kind:"base64"},Oe.errToObj(t)))}base64url(t){return this._addCheck(P({kind:"base64url"},Oe.errToObj(t)))}jwt(t){return this._addCheck(P({kind:"jwt"},Oe.errToObj(t)))}ip(t){return this._addCheck(P({kind:"ip"},Oe.errToObj(t)))}cidr(t){return this._addCheck(P({kind:"cidr"},Oe.errToObj(t)))}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(P({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},Oe.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(P({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},Oe.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(P({kind:"duration"},Oe.errToObj(t)))}regex(t,r){return this._addCheck(P({kind:"regex",regex:t},Oe.errToObj(r)))}includes(t,r){return this._addCheck(P({kind:"includes",value:t,position:r==null?void 0:r.position},Oe.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(P({kind:"startsWith",value:t},Oe.errToObj(r)))}endsWith(t,r){return this._addCheck(P({kind:"endsWith",value:t},Oe.errToObj(r)))}min(t,r){return this._addCheck(P({kind:"min",value:t},Oe.errToObj(r)))}max(t,r){return this._addCheck(P({kind:"max",value:t},Oe.errToObj(r)))}length(t,r){return this._addCheck(P({kind:"length",value:t},Oe.errToObj(r)))}nonempty(t){return this.min(1,Oe.errToObj(t))}trim(){return new lu(R(P({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new lu(R(P({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new lu(R(P({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};s(lu,"ZodString");var Sc=lu;Sc.create=e=>{var t;return new Sc(P({checks:[],typeName:Ge.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Xe(e)))};function ide(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}s(ide,"floatSafeRemainder");var yg=class yg extends Qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:xe.number,received:i.parsedType}),Re}let n,o=new hn;for(let i of this._def.checks)i.kind==="int"?pt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?ide(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.not_finite,message:i.message}),o.dirty()):pt.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Oe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Oe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Oe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Oe.toString(r))}setLimit(t,r,n,o){return new yg(R(P({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Oe.toString(o)}]}))}_addCheck(t){return new yg(R(P({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:Oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Oe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Oe.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&pt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};s(yg,"ZodNumber");var cu=yg;cu.create=e=>new cu(P({checks:[],typeName:Ge.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},Xe(e)));var gg=class gg extends Qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(i){return this._getInvalidInput(t)}if(this._getType(t)!==xe.bigint)return this._getInvalidInput(t);let n,o=new hn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),fe(n,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):pt.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return fe(r,{code:ae.invalid_type,expected:xe.bigint,received:r.parsedType}),Re}gte(t,r){return this.setLimit("min",t,!0,Oe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Oe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Oe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Oe.toString(r))}setLimit(t,r,n,o){return new gg(R(P({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Oe.toString(o)}]}))}_addCheck(t){return new gg(R(P({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Oe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Oe.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};s(gg,"ZodBigInt");var pu=gg;pu.create=e=>{var t;return new pu(P({checks:[],typeName:Ge.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Xe(e)))};var G4=class G4 extends Qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:xe.boolean,received:n.parsedType}),Re}return Fn(t.data)}};s(G4,"ZodBoolean");var uu=G4;uu.create=e=>new uu(P({typeName:Ge.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},Xe(e)));var Bv=class Bv extends Qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:xe.date,received:i.parsedType}),Re}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_date}),Re}let n=new hn,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):pt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Bv(R(P({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Oe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Oe.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};s(Bv,"ZodDate");var du=Bv;du.create=e=>new du(P({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ge.ZodDate},Xe(e)));var U4=class U4 extends Qe{_parse(t){if(this._getType(t)!==xe.symbol){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:xe.symbol,received:n.parsedType}),Re}return Fn(t.data)}};s(U4,"ZodSymbol");var um=U4;um.create=e=>new um(P({typeName:Ge.ZodSymbol},Xe(e)));var V4=class V4 extends Qe{_parse(t){if(this._getType(t)!==xe.undefined){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:xe.undefined,received:n.parsedType}),Re}return Fn(t.data)}};s(V4,"ZodUndefined");var fu=V4;fu.create=e=>new fu(P({typeName:Ge.ZodUndefined},Xe(e)));var z4=class z4 extends Qe{_parse(t){if(this._getType(t)!==xe.null){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:xe.null,received:n.parsedType}),Re}return Fn(t.data)}};s(z4,"ZodNull");var mu=z4;mu.create=e=>new mu(P({typeName:Ge.ZodNull},Xe(e)));var H4=class H4 extends Qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Fn(t.data)}};s(H4,"ZodAny");var Cc=H4;Cc.create=e=>new Cc(P({typeName:Ge.ZodAny},Xe(e)));var W4=class W4 extends Qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fn(t.data)}};s(W4,"ZodUnknown");var cl=W4;cl.create=e=>new cl(P({typeName:Ge.ZodUnknown},Xe(e)));var q4=class q4 extends Qe{_parse(t){let r=this._getOrReturnCtx(t);return fe(r,{code:ae.invalid_type,expected:xe.never,received:r.parsedType}),Re}};s(q4,"ZodNever");var Xi=q4;Xi.create=e=>new Xi(P({typeName:Ge.ZodNever},Xe(e)));var Z4=class Z4 extends Qe{_parse(t){if(this._getType(t)!==xe.undefined){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:xe.void,received:n.parsedType}),Re}return Fn(t.data)}};s(Z4,"ZodVoid");var dm=Z4;dm.create=e=>new dm(P({typeName:Ge.ZodVoid},Xe(e)));var cm=class cm extends Qe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==xe.array)return fe(r,{code:ae.invalid_type,expected:xe.array,received:r.parsedType}),Re;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,l=r.data.length<o.exactLength.value;(a||l)&&(fe(r,{code:a?ae.too_big:ae.too_small,minimum:l?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(fe(r,{code:ae.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(fe(r,{code:ae.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,l)=>o.type._parseAsync(new mi(r,a,r.path,l)))).then(a=>hn.mergeArray(n,a));let i=[...r.data].map((a,l)=>o.type._parseSync(new mi(r,a,r.path,l)));return hn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new cm(R(P({},this._def),{minLength:{value:t,message:Oe.toString(r)}}))}max(t,r){return new cm(R(P({},this._def),{maxLength:{value:t,message:Oe.toString(r)}}))}length(t,r){return new cm(R(P({},this._def),{exactLength:{value:t,message:Oe.toString(r)}}))}nonempty(t){return this.min(1,t)}};s(cm,"ZodArray");var pl=cm;pl.create=(e,t)=>new pl(P({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ge.ZodArray},Xe(t)));function lm(e){if(e instanceof bo){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=fi.create(lm(n))}return new bo(R(P({},e._def),{shape:s(()=>t,"shape")}))}else return e instanceof pl?new pl(R(P({},e._def),{type:lm(e.element)})):e instanceof fi?fi.create(lm(e.unwrap())):e instanceof Qs?Qs.create(lm(e.unwrap())):e instanceof Js?Js.create(e.items.map(t=>lm(t))):e}s(lm,"deepPartialify");var Lo=class Lo extends Qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=pt.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==xe.object){let u=this._getOrReturnCtx(t);return fe(u,{code:ae.invalid_type,expected:xe.object,received:u.parsedType}),Re}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof Xi&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||l.push(u);let c=[];for(let u of a){let d=i[u],h=o.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new mi(o,h,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Xi){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")l.length>0&&(fe(o,{code:ae.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of l){let h=o.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new mi(o,h,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let h=await d.key,y=await d.value;u.push({key:h,value:y,alwaysSet:d.alwaysSet})}return u}).then(u=>hn.mergeObjectSync(n,u)):hn.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return Oe.errToObj,new Lo(P(R(P({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:s((r,n)=>{var i,a,l,c;let o=(l=(a=(i=this._def).errorMap)==null?void 0:a.call(i,r,n).message)!=null?l:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=Oe.errToObj(t).message)!=null?c:o}:{message:o}},"errorMap")}:{}))}strip(){return new Lo(R(P({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Lo(R(P({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new Lo(R(P({},this._def),{shape:s(()=>P(P({},this._def.shape()),t),"shape")}))}merge(t){return new Lo({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:s(()=>P(P({},this._def.shape()),t._def.shape()),"shape"),typeName:Ge.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lo(R(P({},this._def),{catchall:t}))}pick(t){let r={};for(let n of pt.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Lo(R(P({},this._def),{shape:s(()=>r,"shape")}))}omit(t){let r={};for(let n of pt.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Lo(R(P({},this._def),{shape:s(()=>r,"shape")}))}deepPartial(){return lm(this)}partial(t){let r={};for(let n of pt.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new Lo(R(P({},this._def),{shape:s(()=>r,"shape")}))}required(t){let r={};for(let n of pt.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof fi;)i=i._def.innerType;r[n]=i}return new Lo(R(P({},this._def),{shape:s(()=>r,"shape")}))}keyof(){return IU(pt.objectKeys(this.shape))}};s(Lo,"ZodObject");var bo=Lo;bo.create=(e,t)=>new bo(P({shape:s(()=>e,"shape"),unknownKeys:"strip",catchall:Xi.create(),typeName:Ge.ZodObject},Xe(t)));bo.strictCreate=(e,t)=>new bo(P({shape:s(()=>e,"shape"),unknownKeys:"strict",catchall:Xi.create(),typeName:Ge.ZodObject},Xe(t)));bo.lazycreate=(e,t)=>new bo(P({shape:e,unknownKeys:"strip",catchall:Xi.create(),typeName:Ge.ZodObject},Xe(t)));var X4=class X4 extends Qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let l of i)if(l.result.status==="valid")return l.result;for(let l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let a=i.map(l=>new go(l.ctx.common.issues));return fe(r,{code:ae.invalid_union,unionErrors:a}),Re}if(s(o,"handleResults"),r.common.async)return Promise.all(n.map(async i=>{let a=R(P({},r),{common:R(P({},r.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let c of n){let u=R(P({},r),{common:R(P({},r.common),{issues:[]}),parent:null}),d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let l=a.map(c=>new go(c));return fe(r,{code:ae.invalid_union,unionErrors:l}),Re}}get options(){return this._def.options}};s(X4,"ZodUnion");var hu=X4;hu.create=(e,t)=>new hu(P({options:e,typeName:Ge.ZodUnion},Xe(t)));var ll=s(e=>e instanceof gu?ll(e.schema):e instanceof hi?ll(e.innerType()):e instanceof bu?[e.value]:e instanceof xu?e.options:e instanceof vu?pt.objectValues(e.enum):e instanceof Iu?ll(e._def.innerType):e instanceof fu?[void 0]:e instanceof mu?[null]:e instanceof fi?[void 0,...ll(e.unwrap())]:e instanceof Qs?[null,...ll(e.unwrap())]:e instanceof Ig||e instanceof Cu?ll(e.unwrap()):e instanceof Su?ll(e._def.innerType):[],"getDiscriminator"),$v=class $v extends Qe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return fe(r,{code:ae.invalid_type,expected:xe.object,received:r.parsedType}),Re;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(fe(r,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=ll(i.shape[t]);if(!a.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let l of a){if(o.has(l))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(l)));o.set(l,i)}}return new $v(P({typeName:Ge.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o},Xe(n)))}};s($v,"ZodDiscriminatedUnion");var Lv=$v;function B4(e,t){let r=Ks(e),n=Ks(t);if(e===t)return{valid:!0,data:e};if(r===xe.object&&n===xe.object){let o=pt.objectKeys(t),i=pt.objectKeys(e).filter(l=>o.indexOf(l)!==-1),a=P(P({},e),t);for(let l of i){let c=B4(e[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(r===xe.array&&n===xe.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],l=t[i],c=B4(a,l);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===xe.date&&n===xe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}s(B4,"mergeValues");var Y4=class Y4 extends Qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=s((i,a)=>{if(Dv(i)||Dv(a))return Re;let l=B4(i.value,a.value);return l.valid?((Fv(i)||Fv(a))&&r.dirty(),{status:r.value,value:l.data}):(fe(n,{code:ae.invalid_intersection_types}),Re)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};s(Y4,"ZodIntersection");var yu=Y4;yu.create=(e,t,r)=>new yu(P({left:e,right:t,typeName:Ge.ZodIntersection},Xe(r)));var jv=class jv extends Qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.array)return fe(n,{code:ae.invalid_type,expected:xe.array,received:n.parsedType}),Re;if(n.data.length<this._def.items.length)return fe(n,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Re;!this._def.rest&&n.data.length>this._def.items.length&&(fe(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,l)=>{let c=this._def.items[l]||this._def.rest;return c?c._parse(new mi(n,a,n.path,l)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>hn.mergeArray(r,a)):hn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new jv(R(P({},this._def),{rest:t}))}};s(jv,"ZodTuple");var Js=jv;Js.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Js(P({items:e,typeName:Ge.ZodTuple,rest:null},Xe(t)))};var bg=class bg extends Qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return fe(n,{code:ae.invalid_type,expected:xe.object,received:n.parsedType}),Re;let o=[],i=this._def.keyType,a=this._def.valueType;for(let l in n.data)o.push({key:i._parse(new mi(n,l,n.path,l)),value:a._parse(new mi(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?hn.mergeObjectAsync(r,o):hn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Qe?new bg(P({keyType:t,valueType:r,typeName:Ge.ZodRecord},Xe(n))):new bg(P({keyType:Sc.create(),valueType:t,typeName:Ge.ZodRecord},Xe(r)))}};s(bg,"ZodRecord");var Rv=bg,K4=class K4 extends Qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.map)return fe(n,{code:ae.invalid_type,expected:xe.map,received:n.parsedType}),Re;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([l,c],u)=>({key:o._parse(new mi(n,l,n.path,[u,"key"])),value:i._parse(new mi(n,c,n.path,[u,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Re;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let c of a){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Re;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}};s(K4,"ZodMap");var fm=K4;fm.create=(e,t,r)=>new fm(P({valueType:t,keyType:e,typeName:Ge.ZodMap},Xe(r)));var xg=class xg extends Qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.set)return fe(n,{code:ae.invalid_type,expected:xe.set,received:n.parsedType}),Re;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(fe(n,{code:ae.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(fe(n,{code:ae.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let d of c){if(d.status==="aborted")return Re;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}s(a,"finalizeSet");let l=[...n.data.values()].map((c,u)=>i._parse(new mi(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,r){return new xg(R(P({},this._def),{minSize:{value:t,message:Oe.toString(r)}}))}max(t,r){return new xg(R(P({},this._def),{maxSize:{value:t,message:Oe.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};s(xg,"ZodSet");var mm=xg;mm.create=(e,t)=>new mm(P({valueType:e,minSize:null,maxSize:null,typeName:Ge.ZodSet},Xe(t)));var pm=class pm extends Qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.function)return fe(r,{code:ae.invalid_type,expected:xe.function,received:r.parsedType}),Re;function n(l,c){return hg({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sm(),al].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:c}})}s(n,"makeArgsIssue");function o(l,c){return hg({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sm(),al].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:c}})}s(o,"makeReturnsIssue");let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Tc){let l=this;return Fn(async function(...c){let u=new go([]),d=await l._def.args.parseAsync(c,i).catch(b=>{throw u.addIssue(n(c,b)),u}),h=await Reflect.apply(a,this,d);return await l._def.returns._def.type.parseAsync(h,i).catch(b=>{throw u.addIssue(o(h,b)),u})})}else{let l=this;return Fn(function(...c){let u=l._def.args.safeParse(c,i);if(!u.success)throw new go([n(c,u.error)]);let d=Reflect.apply(a,this,u.data),h=l._def.returns.safeParse(d,i);if(!h.success)throw new go([o(d,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new pm(R(P({},this._def),{args:Js.create(t).rest(cl.create())}))}returns(t){return new pm(R(P({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new pm(P({args:t||Js.create([]).rest(cl.create()),returns:r||cl.create(),typeName:Ge.ZodFunction},Xe(n)))}};s(pm,"ZodFunction");var Nv=pm,J4=class J4 extends Qe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};s(J4,"ZodLazy");var gu=J4;gu.create=(e,t)=>new gu(P({getter:e,typeName:Ge.ZodLazy},Xe(t)));var Q4=class Q4 extends Qe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return fe(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:t.data}}get value(){return this._def.value}};s(Q4,"ZodLiteral");var bu=Q4;bu.create=(e,t)=>new bu(P({value:e,typeName:Ge.ZodLiteral},Xe(t)));function IU(e,t){return new xu(P({values:e,typeName:Ge.ZodEnum},Xe(t)))}s(IU,"createZodEnum");var vg=class vg extends Qe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{expected:pt.joinValues(n),received:r.parsedType,code:ae.invalid_type}),Re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{received:r.data,code:ae.invalid_enum_value,options:n}),Re}return Fn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return vg.create(t,P(P({},this._def),r))}exclude(t,r=this._def){return vg.create(this.options.filter(n=>!t.includes(n)),P(P({},this._def),r))}};s(vg,"ZodEnum");var xu=vg;xu.create=IU;var e5=class e5 extends Qe{_parse(t){let r=pt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==xe.string&&n.parsedType!==xe.number){let o=pt.objectValues(r);return fe(n,{expected:pt.joinValues(o),received:n.parsedType,code:ae.invalid_type}),Re}if(this._cache||(this._cache=new Set(pt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=pt.objectValues(r);return fe(n,{received:n.data,code:ae.invalid_enum_value,options:o}),Re}return Fn(t.data)}get enum(){return this._def.values}};s(e5,"ZodNativeEnum");var vu=e5;vu.create=(e,t)=>new vu(P({values:e,typeName:Ge.ZodNativeEnum},Xe(t)));var t5=class t5 extends Qe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.promise&&r.common.async===!1)return fe(r,{code:ae.invalid_type,expected:xe.promise,received:r.parsedType}),Re;let n=r.parsedType===xe.promise?r.data:Promise.resolve(r.data);return Fn(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};s(t5,"ZodPromise");var Tc=t5;Tc.create=(e,t)=>new Tc(P({type:e,typeName:Ge.ZodPromise},Xe(t)));var r5=class r5 extends Qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s(a=>{fe(n,a),a.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async l=>{if(r.value==="aborted")return Re;let c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?Re:c.status==="dirty"?au(c.value):r.value==="dirty"?au(c.value):c});{if(r.value==="aborted")return Re;let l=this._def.schema._parseSync({data:a,path:n.path,parent:n});return l.status==="aborted"?Re:l.status==="dirty"?au(l.value):r.value==="dirty"?au(l.value):l}}if(o.type==="refinement"){let a=s(l=>{let c=o.refinement(l,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Re:(l.status==="dirty"&&r.dirty(),a(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Re:(l.status==="dirty"&&r.dirty(),a(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ic(a))return Re;let l=o.transform(a.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Ic(a)?Promise.resolve(o.transform(a.value,i)).then(l=>({status:r.value,value:l})):Re);pt.assertNever(o)}};s(r5,"ZodEffects");var hi=r5;hi.create=(e,t,r)=>new hi(P({schema:e,typeName:Ge.ZodEffects,effect:t},Xe(r)));hi.createWithPreprocess=(e,t,r)=>new hi(P({schema:t,effect:{type:"preprocess",transform:e},typeName:Ge.ZodEffects},Xe(r)));var n5=class n5 extends Qe{_parse(t){return this._getType(t)===xe.undefined?Fn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};s(n5,"ZodOptional");var fi=n5;fi.create=(e,t)=>new fi(P({innerType:e,typeName:Ge.ZodOptional},Xe(t)));var o5=class o5 extends Qe{_parse(t){return this._getType(t)===xe.null?Fn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};s(o5,"ZodNullable");var Qs=o5;Qs.create=(e,t)=>new Qs(P({innerType:e,typeName:Ge.ZodNullable},Xe(t)));var i5=class i5 extends Qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===xe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};s(i5,"ZodDefault");var Iu=i5;Iu.create=(e,t)=>new Iu(P({innerType:e,typeName:Ge.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},Xe(t)));var s5=class s5 extends Qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=R(P({},r),{common:R(P({},r.common),{issues:[]})}),o=this._def.innerType._parse({data:n.data,path:n.path,parent:P({},n)});return am(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new go(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new go(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};s(s5,"ZodCatch");var Su=s5;Su.create=(e,t)=>new Su(P({innerType:e,typeName:Ge.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},Xe(t)));var a5=class a5 extends Qe{_parse(t){if(this._getType(t)!==xe.nan){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:xe.nan,received:n.parsedType}),Re}return{status:"valid",value:t.data}}};s(a5,"ZodNaN");var hm=a5;hm.create=e=>new hm(P({typeName:Ge.ZodNaN},Xe(e)));var sde=Symbol("zod_brand"),l5=class l5 extends Qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};s(l5,"ZodBranded");var Ig=l5,Gv=class Gv extends Qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return s(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Re:i.status==="dirty"?(r.dirty(),au(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})},"handleAsync")();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Re:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new Gv({in:t,out:r,typeName:Ge.ZodPipeline})}};s(Gv,"ZodPipeline");var Sg=Gv,c5=class c5 extends Qe{_parse(t){let r=this._def.innerType._parse(t),n=s(o=>(Ic(o)&&(o.value=Object.freeze(o.value)),o),"freeze");return am(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};s(c5,"ZodReadonly");var Cu=c5;Cu.create=(e,t)=>new Cu(P({innerType:e,typeName:Ge.ZodReadonly},Xe(t)));function gU(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}s(gU,"cleanParams");function SU(e,t={},r){return e?Cc.create().superRefine((n,o)=>{var a,l;let i=e(n);if(i instanceof Promise)return i.then(c=>{var u,d;if(!c){let h=gU(t,n),y=(d=(u=h.fatal)!=null?u:r)!=null?d:!0;o.addIssue(R(P({code:"custom"},h),{fatal:y}))}});if(!i){let c=gU(t,n),u=(l=(a=c.fatal)!=null?a:r)!=null?l:!0;o.addIssue(R(P({code:"custom"},c),{fatal:u}))}}):Cc.create()}s(SU,"custom");var ade={object:bo.lazycreate},Ge;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ge||(Ge={}));var lde=s((e,t={message:"Input not instance of ".concat(e.name)})=>SU(r=>r instanceof e,t),"instanceOfType"),CU=Sc.create,TU=cu.create,cde=hm.create,pde=pu.create,PU=uu.create,ude=du.create,dde=um.create,fde=fu.create,mde=mu.create,hde=Cc.create,yde=cl.create,gde=Xi.create,bde=dm.create,xde=pl.create,vde=bo.create,Ide=bo.strictCreate,Sde=hu.create,Cde=Lv.create,Tde=yu.create,Pde=Js.create,wde=Rv.create,Mde=fm.create,Ode=mm.create,Ede=Nv.create,_de=gu.create,kde=bu.create,Ade=xu.create,Dde=vu.create,Fde=Tc.create,Lde=hi.create,Rde=fi.create,Nde=Qs.create,Bde=hi.createWithPreprocess,$de=Sg.create,jde=s(()=>CU().optional(),"ostring"),Gde=s(()=>TU().optional(),"onumber"),Ude=s(()=>PU().optional(),"oboolean"),Vde={string:s(e=>Sc.create(R(P({},e),{coerce:!0})),"string"),number:s(e=>cu.create(R(P({},e),{coerce:!0})),"number"),boolean:s(e=>uu.create(R(P({},e),{coerce:!0})),"boolean"),bigint:s(e=>pu.create(R(P({},e),{coerce:!0})),"bigint"),date:s(e=>du.create(R(P({},e),{coerce:!0})),"date")};var zde=Re;var wU=G;var yn=wU;var rV=ps(v5());var Og=4,Nme=8,Bme="0.6",tV="low-priority-pin",I5=G.object({rank:G.union([G.enum(["low","medium","high","always-visible"]),G.number()]).optional(),interactive:G.union([G.boolean(),G.literal("pointer-events-auto")]).optional(),id:G.string().optional(),anchor:G.union([G.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),G.array(G.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:G.boolean().optional(),zIndex:G.number().optional(),lowPriorityPin:G.object({enabled:G.boolean().optional(),size:G.number().positive().optional(),color:G.string().optional()}).optional()});function nV(e,t,r){G.array(G.number()).min(2).max(3).parse(e),G.string().parse(t),I5.parse(r)}s(nV,"validateMarker");var $me=Object.freeze({enabled:!0,size:Nme,color:"#666"}),Mu=class Mu{constructor(t,r={}){m(this,"id");m(this,"type","marker");m(this,"rank",0);m(this,"initialRank",0);m(this,"activeAnchor","center");m(this,"pointerEvents","none");m(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:P({},$me)});m(this,"projection",new De);m(this,"enabled",!0);m(this,"canShow",!1);m(this,"visible",!0);m(this,"isOccluded",!1);m(this,"offscreen",!1);m(this,"strategyIndex",-1);m(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});m(this,"dimensions",{width:0,height:0});m(this,"markerContainer");m(this,"containerEl");m(this,"contentEl",null);m(this,"contentHtml","");m(this,"style",{top:"0px",left:"0px"});m(this,"dirty",!1);m(this,"attachedDirty",!0);m(this,"collisionDirty",!0);m(this,"visibilityNeedsUpdate","show");m(this,"animation",null);m(this,"currentStrategyIndex",-1);m(this,"onStrategySelected",s((t,r=!1)=>{var o,i;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",tV);let a=this.options.lowPriorityPin,l=a.size,c=a.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(l,"px")),this.markerContainer.style.setProperty("--pin-color",c),this.markerContainer.style.opacity=Bme,this.style.top=-l/2+"px",this.style.left=-l/2+"px"}else{this.activeAnchor=(i=(o=this.strategies[t])==null?void 0:o.name)!=null?i:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:a,height:l}=this.dimensions,c=-l/2+"px",u=-a/2+"px";switch(this.style.top=c,this.style.left=u,this.activeAnchor){case"top":{this.style.top=-l+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-a+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-l+"px",this.style.left=-a+"px";break}case"top-right":{this.style.top=-l+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-a+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=c,this.style.left=u}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));m(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,o,i;if(this.id=(r==null?void 0:r.id)||At(),this.options=(0,rV.default)(this.options,r),typeof r.rank=="string")this.rank=om(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let a=Math.trunc(v.env.NODE_ENV==="test"?Mu.testId:Mu.testId*10)/10;Mu.testId+=.001,this.rank=a}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(i=(o=this.markerContainer.firstElementChild)==null?void 0:o.firstElementChild)!=null?i:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:o}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:o}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var i;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let o=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(a=>({name:a,getBoundingBox:s(()=>{let l=r/2,c=r/2,u=t/2,d=t/2;switch(a){case"top":{l=r,c=0;break}case"bottom":{l=0,c=r;break}case"left":{u=t,d=0;break}case"right":{u=0,d=t;break}case"top-left":{l=r,u=t,c=0,d=0;break}case"top-right":{l=r,d=t,c=0,u=0;break}case"bottom-left":{c=r,u=t,l=0,d=0;break}case"bottom-right":{c=r,d=t,l=0,u=0;break}}return[l+Og,c+Og,u+Og,d+Og]},"getBoundingBox")}));if((i=this.options.lowPriorityPin)!=null&&i.enabled){let a={name:tV,getBoundingBox:s(()=>{let l=Math.max(2,Og/2);return[this.options.lowPriorityPin.size/2+l,this.options.lowPriorityPin.size/2+l,this.options.lowPriorityPin.size/2+l,this.options.lowPriorityPin.size/2+l]},"getBoundingBox")};o.push(a)}return o}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let o=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(o!==-1){let i=this.packedMessage.bboxes.splice(o,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let o=0;o<this.strategies.length;o++){let i=this.strategies[o];o===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),o]):this.packedMessage.bboxes.push([...i.getBoundingBox(),o])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return(t=this.options.lowPriorityPin)!=null&&t.enabled?Array.isArray(this.options.anchor)?this.options.anchor.length:1:-1}destroy(){}};s(Mu,"MarkerComponent"),m(Mu,"testId",0);var ea=Mu;f();f();f();f();f();var S5=class S5{constructor(){m(this,"hover",!1);m(this,"dirty",!1)}};s(S5,"InteractionComponent");var xm=S5;f();f();function Yv(e){"@babel/helpers - typeof";return Yv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yv(e)}s(Yv,"_typeof");var jme=/^\s+/,Gme=/\s+$/;function Pe(e,t){if(e=e||"",t=t||{},e instanceof Pe)return e;if(!(this instanceof Pe))return new Pe(e,t);var r=Ume(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}s(Pe,"tinycolor");Pe.prototype={isDark:s(function(){return this.getBrightness()<128},"isDark"),isLight:s(function(){return!this.isDark()},"isLight"),isValid:s(function(){return this._ok},"isValid"),getOriginalInput:s(function(){return this._originalInput},"getOriginalInput"),getFormat:s(function(){return this._format},"getFormat"),getAlpha:s(function(){return this._a},"getAlpha"),getBrightness:s(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:s(function(){var t=this.toRgb(),r,n,o,i,a,l;return r=t.r/255,n=t.g/255,o=t.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),o<=.03928?l=o/12.92:l=Math.pow((o+.055)/1.055,2.4),.2126*i+.7152*a+.0722*l},"getLuminance"),setAlpha:s(function(t){return this._a=pV(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:s(function(){var t=iV(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:s(function(){var t=iV(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+o+"%)":"hsva("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},"toHsvString"),toHsl:s(function(){var t=oV(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:s(function(){var t=oV(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+o+"%)":"hsla("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},"toHslString"),toHex:s(function(t){return sV(this._r,this._g,this._b,t)},"toHex"),toHexString:s(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:s(function(t){return Wme(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:s(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:s(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:s(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:s(function(){return{r:Math.round(fr(this._r,255)*100)+"%",g:Math.round(fr(this._g,255)*100)+"%",b:Math.round(fr(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:s(function(){return this._a==1?"rgb("+Math.round(fr(this._r,255)*100)+"%, "+Math.round(fr(this._g,255)*100)+"%, "+Math.round(fr(this._b,255)*100)+"%)":"rgba("+Math.round(fr(this._r,255)*100)+"%, "+Math.round(fr(this._g,255)*100)+"%, "+Math.round(fr(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:s(function(){return this._a===0?"transparent":this._a<1?!1:ohe[sV(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:s(function(t){var r="#"+aV(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Pe(t);n="#"+aV(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+n+")"},"toFilter"),toString:s(function(t){var r=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0,i=!r&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:s(function(){return Pe(this.toString())},"clone"),_applyModification:s(function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:s(function(){return this._applyModification(Yme,arguments)},"lighten"),brighten:s(function(){return this._applyModification(Kme,arguments)},"brighten"),darken:s(function(){return this._applyModification(Jme,arguments)},"darken"),desaturate:s(function(){return this._applyModification(qme,arguments)},"desaturate"),saturate:s(function(){return this._applyModification(Zme,arguments)},"saturate"),greyscale:s(function(){return this._applyModification(Xme,arguments)},"greyscale"),spin:s(function(){return this._applyModification(Qme,arguments)},"spin"),_applyCombination:s(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:s(function(){return this._applyCombination(rhe,arguments)},"analogous"),complement:s(function(){return this._applyCombination(ehe,arguments)},"complement"),monochromatic:s(function(){return this._applyCombination(nhe,arguments)},"monochromatic"),splitcomplement:s(function(){return this._applyCombination(the,arguments)},"splitcomplement"),triad:s(function(){return this._applyCombination(lV,[3])},"triad"),tetrad:s(function(){return this._applyCombination(lV,[4])},"tetrad")};Pe.fromRatio=function(e,t){if(Yv(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=Eg(e[n]));e=r}return Pe(e,t)};function Ume(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,i=null,a=!1,l=!1;return typeof e=="string"&&(e=lhe(e)),Yv(e)=="object"&&(fl(e.r)&&fl(e.g)&&fl(e.b)?(t=Vme(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):fl(e.h)&&fl(e.s)&&fl(e.v)?(n=Eg(e.s),o=Eg(e.v),t=Hme(e.h,n,o),a=!0,l="hsv"):fl(e.h)&&fl(e.s)&&fl(e.l)&&(n=Eg(e.s),i=Eg(e.l),t=zme(e.h,n,i),a=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=pV(r),{ok:a,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}s(Ume,"inputToRGB");function Vme(e,t,r){return{r:fr(e,255)*255,g:fr(t,255)*255,b:fr(r,255)*255}}s(Vme,"rgbToRgb");function oV(e,t,r){e=fr(e,255),t=fr(t,255),r=fr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,a,l=(n+o)/2;if(n==o)i=a=0;else{var c=n-o;switch(a=l>.5?c/(2-n-o):c/(n+o),n){case e:i=(t-r)/c+(t<r?6:0);break;case t:i=(r-e)/c+2;break;case r:i=(e-t)/c+4;break}i/=6}return{h:i,s:a,l}}s(oV,"rgbToHsl");function zme(e,t,r){var n,o,i;e=fr(e,360),t=fr(t,100),r=fr(r,100);function a(u,d,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(d-u)*6*h:h<1/2?d:h<2/3?u+(d-u)*(2/3-h)*6:u}if(s(a,"hue2rgb"),t===0)n=o=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;n=a(c,l,e+1/3),o=a(c,l,e),i=a(c,l,e-1/3)}return{r:n*255,g:o*255,b:i*255}}s(zme,"hslToRgb");function iV(e,t,r){e=fr(e,255),t=fr(t,255),r=fr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,a,l=n,c=n-o;if(a=n===0?0:c/n,n==o)i=0;else{switch(n){case e:i=(t-r)/c+(t<r?6:0);break;case t:i=(r-e)/c+2;break;case r:i=(e-t)/c+4;break}i/=6}return{h:i,s:a,v:l}}s(iV,"rgbToHsv");function Hme(e,t,r){e=fr(e,360)*6,t=fr(t,100),r=fr(r,100);var n=Math.floor(e),o=e-n,i=r*(1-t),a=r*(1-o*t),l=r*(1-(1-o)*t),c=n%6,u=[r,a,i,i,l,r][c],d=[l,r,r,a,i,i][c],h=[i,i,l,r,r,a][c];return{r:u*255,g:d*255,b:h*255}}s(Hme,"hsvToRgb");function sV(e,t,r,n){var o=[Ki(Math.round(e).toString(16)),Ki(Math.round(t).toString(16)),Ki(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}s(sV,"rgbToHex");function Wme(e,t,r,n,o){var i=[Ki(Math.round(e).toString(16)),Ki(Math.round(t).toString(16)),Ki(Math.round(r).toString(16)),Ki(uV(n))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}s(Wme,"rgbaToHex");function aV(e,t,r,n){var o=[Ki(uV(n)),Ki(Math.round(e).toString(16)),Ki(Math.round(t).toString(16)),Ki(Math.round(r).toString(16))];return o.join("")}s(aV,"rgbaToArgbHex");Pe.equals=function(e,t){return!e||!t?!1:Pe(e).toRgbString()==Pe(t).toRgbString()};Pe.random=function(){return Pe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function qme(e,t){t=t===0?0:t||10;var r=Pe(e).toHsl();return r.s-=t/100,r.s=Kv(r.s),Pe(r)}s(qme,"_desaturate");function Zme(e,t){t=t===0?0:t||10;var r=Pe(e).toHsl();return r.s+=t/100,r.s=Kv(r.s),Pe(r)}s(Zme,"_saturate");function Xme(e){return Pe(e).desaturate(100)}s(Xme,"_greyscale");function Yme(e,t){t=t===0?0:t||10;var r=Pe(e).toHsl();return r.l+=t/100,r.l=Kv(r.l),Pe(r)}s(Yme,"_lighten");function Kme(e,t){t=t===0?0:t||10;var r=Pe(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),Pe(r)}s(Kme,"_brighten");function Jme(e,t){t=t===0?0:t||10;var r=Pe(e).toHsl();return r.l-=t/100,r.l=Kv(r.l),Pe(r)}s(Jme,"_darken");function Qme(e,t){var r=Pe(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Pe(r)}s(Qme,"_spin");function ehe(e){var t=Pe(e).toHsl();return t.h=(t.h+180)%360,Pe(t)}s(ehe,"_complement");function lV(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Pe(e).toHsl(),n=[Pe(e)],o=360/t,i=1;i<t;i++)n.push(Pe({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}s(lV,"polyad");function the(e){var t=Pe(e).toHsl(),r=t.h;return[Pe(e),Pe({h:(r+72)%360,s:t.s,l:t.l}),Pe({h:(r+216)%360,s:t.s,l:t.l})]}s(the,"_splitcomplement");function rhe(e,t,r){t=t||6,r=r||30;var n=Pe(e).toHsl(),o=360/r,i=[Pe(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(Pe(n));return i}s(rhe,"_analogous");function nhe(e,t){t=t||6;for(var r=Pe(e).toHsv(),n=r.h,o=r.s,i=r.v,a=[],l=1/t;t--;)a.push(Pe({h:n,s:o,v:i})),i=(i+l)%1;return a}s(nhe,"_monochromatic");Pe.mix=function(e,t,r){r=r===0?0:r||50;var n=Pe(e).toRgb(),o=Pe(t).toRgb(),i=r/100,a={r:(o.r-n.r)*i+n.r,g:(o.g-n.g)*i+n.g,b:(o.b-n.b)*i+n.b,a:(o.a-n.a)*i+n.a};return Pe(a)};Pe.readability=function(e,t){var r=Pe(e),n=Pe(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Pe.isReadable=function(e,t,r){var n=Pe.readability(e,t),o,i;switch(i=!1,o=che(r),o.level+o.size){case"AAsmall":case"AAAlarge":i=n>=4.5;break;case"AAlarge":i=n>=3;break;case"AAAsmall":i=n>=7;break}return i};Pe.mostReadable=function(e,t,r){var n=null,o=0,i,a,l,c;r=r||{},a=r.includeFallbackColors,l=r.level,c=r.size;for(var u=0;u<t.length;u++)i=Pe.readability(e,t[u]),i>o&&(o=i,n=Pe(t[u]));return Pe.isReadable(e,n,{level:l,size:c})||!a?n:(r.includeFallbackColors=!1,Pe.mostReadable(e,["#fff","#000"],r))};var C5=Pe.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ohe=Pe.hexNames=ihe(C5);function ihe(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}s(ihe,"flip");function pV(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}s(pV,"boundAlpha");function fr(e,t){she(e)&&(e="100%");var r=ahe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}s(fr,"bound01");function Kv(e){return Math.min(1,Math.max(0,e))}s(Kv,"clamp01");function Ro(e){return parseInt(e,16)}s(Ro,"parseIntFromHex");function she(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}s(she,"isOnePointZero");function ahe(e){return typeof e=="string"&&e.indexOf("%")!=-1}s(ahe,"isPercentage");function Ki(e){return e.length==1?"0"+e:""+e}s(Ki,"pad2");function Eg(e){return e<=1&&(e=e*100+"%"),e}s(Eg,"convertToPercentage");function uV(e){return Math.round(parseFloat(e)*255).toString(16)}s(uV,"convertDecimalToHex");function cV(e){return Ro(e)/255}s(cV,"convertHexToDecimal");var Yi=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function fl(e){return!!Yi.CSS_UNIT.exec(e)}s(fl,"isValidCSSUnit");function lhe(e){e=e.replace(jme,"").replace(Gme,"").toLowerCase();var t=!1;if(C5[e])e=C5[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Yi.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Yi.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Yi.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Yi.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Yi.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Yi.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Yi.hex8.exec(e))?{r:Ro(r[1]),g:Ro(r[2]),b:Ro(r[3]),a:cV(r[4]),format:t?"name":"hex8"}:(r=Yi.hex6.exec(e))?{r:Ro(r[1]),g:Ro(r[2]),b:Ro(r[3]),format:t?"name":"hex"}:(r=Yi.hex4.exec(e))?{r:Ro(r[1]+""+r[1]),g:Ro(r[2]+""+r[2]),b:Ro(r[3]+""+r[3]),a:cV(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=Yi.hex3.exec(e))?{r:Ro(r[1]+""+r[1]),g:Ro(r[2]+""+r[2]),b:Ro(r[3]+""+r[3]),format:t?"name":"hex"}:!1}s(lhe,"stringInputToObject");function che(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}s(che,"validateWCAG2Parms");var R5=ps(L5());var B5=G.object({rank:G.union([G.enum(["low","medium","high","always-visible"]),G.number()]).optional(),interactive:G.boolean().optional(),appearance:G.object({margin:G.number().min(6).optional(),text:G.object({numLines:G.number().optional(),lineHeight:G.number().optional(),size:G.number().optional(),maxWidth:G.number().optional(),foregroundColor:G.string().optional(),backgroundColor:G.string().optional()}).optional(),marker:G.object({size:G.number().optional(),foregroundColor:G.object({active:G.string().optional(),inactive:G.string().optional()}).optional(),backgroundColor:G.object({active:G.string().optional(),inactive:G.string().optional()}).optional(),iconSizeInterpolation:G.object({nearZoomLevel:G.number().optional(),farZoomLevel:G.number().optional(),nearScale:G.number().optional(),farScale:G.number().optional()}).optional()}).optional()}).optional()});function HV(e,t,r){G.array(G.number()).min(2).max(3).parse(e),G.string().parse(t),B5.parse(r||{})}s(HV,"validateLabel");var Cm={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},tge={lightOnDark:R(P({},Cm),{text:R(P({},Cm.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:R(P({},Cm.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:R(P({},Cm),{text:R(P({},Cm.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:R(P({},Cm.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},rge="LOW_PRIORITY",UV=4,nge=6,oge=20,ige=2.5,sge=2,age="cover",lge=-1/0,VV=6.5,zV={heightAbovePolygon:0,appearance:tge.darkOnLight},WV=s((e,t)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(r=>{var n,o,i;return((n=t.text)==null?void 0:n[r])!=null&&((o=e.text)==null?void 0:o[r])!==((i=t.text)==null?void 0:i[r])}),"isOneOfTextDirtyOptions"),qV=s((e,t)=>["foregroundColor","backgroundColor","icon"].some(r=>{var n,o,i;return((n=t.marker)==null?void 0:n[r])!=null&&((o=e.marker)==null?void 0:o[r])!==((i=t.marker)==null?void 0:i[r])}),"isOneOfMarkerDirtyOptions");var Lg,Rg,_u=class _u{constructor(t,r,n){m(this,"lines",0);m(this,"id");m(this,"rank");m(this,"type","label");m(this,"initialRank");m(this,"contextConfigured",!1);m(this,"fillText");m(this,"newStyle",{});m(this,"opacity",0);m(this,"visibilityNeedsUpdate",!1);m(this,"text");m(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});m(this,"projection",new De);m(this,"labelCacheId");m(this,"_cache",{});m(this,"appearance");m(this,"options");m(this,"visible",!0);m(this,"enabled",!0);m(this,"isOccluded",!1);m(this,"offscreen",!1);m(this,"canShow",!1);m(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});m(this,"dimensions",{width:0,height:0});m(this,"currentStrategyIndex",-1);E(this,Lg,0);m(this,"iconScale",1);E(this,Rg);m(this,"dirty",!0);m(this,"textDirty",!0);m(this,"markerDirty",!0);m(this,"attachedDirty",!0);m(this,"collisionDirty",!0);m(this,"lastTextAlign");m(this,"imageHash");m(this,"markerSize",0);m(this,"iconVisible",!1);m(this,"dp");m(this,"animate",!0);m(this,"onStrategySelected",s(t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[this.currentStrategyIndex];if(r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}},"onStrategySelected"));m(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var i,a;if(this.id=(i=r.id)!=null?i:At(),this.options=(0,R5.default)({},r,zV),this.text=t,this.dp=(l=1)=>l*n.pixelRatio,typeof r.rank=="string")this.rank=om(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let l=Math.trunc(v.env.NODE_ENV==="test"?_u.testId:_u.testId*10)/10;_u.testId+=.001,this.rank=l,this.initialRank=l}let o=(0,R5.default)({},this.options.appearance,zV.appearance);this.appearance={margin:o.margin,text:{lineHeight:o.text.lineHeight,numLines:o.text.numLines,size:o.text.size,maxWidth:o.text.maxWidth,foregroundColor:o.text.foregroundColor,backgroundColor:o.text.backgroundColor},marker:{foregroundColor:{active:o.marker.foregroundColor.active,inactive:o.marker.foregroundColor.inactive||Pe(o.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:o.marker.backgroundColor.active,inactive:o.marker.backgroundColor.inactive||Pe(o.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:o.marker.icon,iconSize:o.marker.iconSize||oge,iconPadding:(a=o.marker.iconPadding)!=null?a:sge,iconFit:o.marker.iconFit||age,iconOverflow:o.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:o.marker.iconVisibleAtZoomLevel==null?lge:o.marker.iconVisibleAtZoomLevel,iconSizeInterpolation:o.marker.iconSizeInterpolation}},this.scaledIconPadding=this.appearance.marker.iconPadding}get totalMarkerSize(){return p(this,Lg)*this.iconScale}set totalMarkerSize(t){A(this,Lg,t)}get scaledIconPadding(){return(p(this,Rg)||this.appearance.marker.iconPadding||0)*this.iconScale}set scaledIconPadding(t){A(this,Rg,t)}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(VV),this.totalMarkerSize=Math.ceil((this.markerSize+ige)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,o=Math.max(nge,n),i=this.iconVisible?o/2:0,a=this.iconVisible?this.totalMarkerSize:VV/2,l=[{name:"RIGHT",getBoundingBox:s(()=>{let c=Math.max(this.totalMarkerSize,r);return[c/2+o,c/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+t+o]},"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+UV,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:s(()=>{let c=Math.max(this.totalMarkerSize,r);return[c/2+o,c/2+o,this.totalMarkerSize/2+t+o,this.totalMarkerSize/2+o]},"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-UV,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:s(()=>{let c=this.dp();return[r+this.totalMarkerSize/2/c+o,this.totalMarkerSize/2+o,t/2+o,t/2+o]},"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:rge,getBoundingBox:s(()=>[a+i,a+i,a+i,a+i],"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:s(()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o],"getBoundingBox"),onStrategySelected:s(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:l}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let r=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,r){r.onStrategySelected(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};Lg=new WeakMap,Rg=new WeakMap,s(_u,"LabelComponent"),m(_u,"testId",0);var N5=_u,ta=N5;f();f();var z5=class z5 extends Be{constructor(r,n){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"textSet",new Set);m(this,"batchedTextMap",new Map);m(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var l,c,u;let n,o,i,a=[];for(let d of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(d),(n==null?void 0:n.type)==="text3d"){o=n.components[0],i=n.components[1];let h=(l=o.mesh)==null?void 0:l.parent;if(!h||!(h instanceof at)||!(o instanceof Pc))continue;if("textArea"in o.feature.properties&&o.mesh!=null&&o.polygonEntityId!=null&&o.textMesh==null&&o.mesh.parent!=null&&((u=(c=o.feature.properties)==null?void 0:c.textArea)==null?void 0:u.position)!=null){if(this.textSet.has(o.polygonEntityId))continue;this.textSet.add(o.polygonEntityId),this.batchedTextMap.has(h)||this.batchedTextMap.set(h,Tm().then(({BatchedText:I})=>{let S=new I;return S.type="batchedtext",h.add(S),S}));let b=this.batchedTextMap.get(h);if(!b)throw new Error("batched text required");a.push(ZV({entityId:d,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(o.mesh!=null&&o.textMesh==null&&o.mesh.parent!=null){if(this.textSet.has(d.toString()))continue;this.textSet.add(d.toString()),this.batchedTextMap.has(h)||this.batchedTextMap.set(h,Tm().then(({BatchedText:I})=>{let S=new I;return S.type="batchedtext",h.add(S),S}));let b=this.batchedTextMap.get(h);if(!b)throw new Error("batched text required");a.push(ZV({entityId:d,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let y=this.batchedTextMap.get(h);o.textMesh&&y&&o.polygonEntityId!=null&&Promise.all([y,Promise.resolve({meshComponent:o,styleComponent:i})]).then(([b,{meshComponent:I,styleComponent:S}])=>{let{textMesh:x}=I;if(b&&x){let T=V5(b,x);I.visible&&!T?b.add(x):!I.visible&&T&&b.remove(x)}S.flipToFaceCamera&&this.flipIfNeeded(I,r)})}return Promise.all(a)}flipIfNeeded(r,n){let o=r.textMesh;if(!o)return!1;let i=o.rotation.z,a=HI(i+n);a>Math.PI/2&&a<3*Math.PI/2&&(o.rotation.z=HI(i+Math.PI))}showTextAreaMesh(){let r,n;for(let o of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(o),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let i=n.feature.properties.textArea;if(!i)continue;let a=new Ci(i.maxWidth,i.maxHeight),l=new We(a,new $r({color:"pink"})),{textMesh:c}=n;if(!c)continue;let u=this.convertTo3DMapPosition(i.position,Ng);l.position.copy(u),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,$5.identity(),$5.makeRotationAxis(new Me(0,0,1),c.userData.rotationZ),Ng.set(i.maxWidth/2,0,0),Ng.applyMatrix4($5),l.position.x-=Ng.x,l.position.y-=Ng.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(o,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};s(z5,"Text3DSystem");var s2=z5;function G5(e){Tm().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}s(G5,"configureWorker");var $5=new Ii,Ng=new Me,j5;async function U5(e){let{preloadFont:t}=await Tm();return t(e)}s(U5,"preloadFont");function Tm(){return j5||(j5=import("./text3d-LSJE37UM.js").then(e=>e)),j5}s(Tm,"getText3DService");async function ZV({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:o,rendererState:i,type:a="text-area"}){return Promise.all([Tm(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:l,createTroikaTextArea:c},u])=>a==="text-area"?c(u.entityId,u.meshComponent,u.styleComponent,n):l(u.entityId,u.meshComponent,u.styleComponent,n)).catch(l=>{z.warn("Trouble creating text: ",l)}).then(l=>{if(!(l!=null&&l.text))return;let c=[Promise.resolve(l.text),o,Promise.resolve()];if(t.polygonEntityId){let u=i.geometry3DMap.get(t.polygonEntityId);if((u==null?void 0:u.type)==="geometry"){let d=u.components[0],h=u.components[1];d.textMesh=l.text,d.mesh!=null&&(l.text.position.z=h.altitude+h.height+cge)}}else c[2]=Tm().then(({syncText:u})=>u(l.text));return Promise.all(c)}).then(l=>{if(!l)return;let[c,u]=l;u.add(c),t.batchedText||(t.batchedText=u)})}s(ZV,"createText");function V5(e,t){return e._members.has(t)}s(V5,"doesBatchedTextContainsText");var cge=.5;var pge=G.object({visible:G.boolean(),color:G.string(),flipToFaceCamera:G.boolean(),font:G.string().optional(),fontSize:G.number(),margin:G.union([G.number(),G.tuple([G.number(),G.number(),G.number(),G.number()])]),outlineColor:G.string(),outlineOpacity:G.number(),outlineBlur:G.union([G.number(),G.string()]),outlineWidth:G.number(),outlineOffsetX:G.number(),outlineOffsetY:G.number(),strokeWidth:G.number(),maxWidth:G.number().optional(),maxHeight:G.number().optional(),strokeOpacity:G.number(),strokeColor:G.string(),fillOpacity:G.number(),hoverColor:G.string().optional(),id:G.union([G.string(),G.number()]),type:G.literal("text3d"),position:G.tuple([G.number(),G.number(),G.number()]),content:G.string()}),XV=pge.partial().omit({id:!0,type:!0}).strict(),YV=XV.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),KV=G.object({appearance:XV.optional(),parentId:G.string().optional()}).strict(),H5=class H5{constructor(t){m(this,"mesh",new Pi);m(this,"textMesh");m(this,"type","text3d");m(this,"feature");m(this,"parent");m(this,"batchedText");m(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?V5(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};s(H5,"Text3DComponent");var Pc=H5;f();var W5=class W5{constructor(t){m(this,"color");m(this,"dirty",!0);m(this,"visible",!0);m(this,"edgeColors");m(this,"geometry");m(this,"ranges");m(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};s(W5,"OutlineComponent");var Pm=W5;f();f();f();var q5=class q5 extends i9{constructor(r){let n=r,o=3,i=o*4;super(new Float32Array(r*i),o,r,Eb,Z6);m(this,"_width");m(this,"_height");m(this,"_propertiesLength");this._width=i,this._height=n,this._propertiesLength=o}setColor(r,n,o){let i=this.image.data,a=r*this._width;i[a]=n.r,i[a+1]=n.g,i[a+2]=n.b,i[a+3]=0,i[a+4]=o.r,i[a+5]=o.g,i[a+6]=o.b,i[a+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,o=r*this._width,i=new Rt(n[o],n[o+1],n[o+2]),a=new Rt(n[o+4],n[o+5],n[o+6]);return{color:i,topColor:a}}setTexture(r,n,o){let i=this.image.data,a=r*this._width;i[a+8]=n?1:0,i[a+9]=o?1:0,i[a+10]=0,i[a+11]=0,this.needsUpdate=!0}};s(q5,"BatchedPropertiesTexture");var a2=q5;f();var JV="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";f();var QV="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var uge=-.05,dge=1,Z5=class Z5 extends Ti{constructor(r,n,o=1){super(r);m(this,"propertiesTexture");m(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});m(this,"colorSpace",ga);m(this,"showTextures",s(r=>{let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,n,o),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new a2(n),this.uniforms.uRepeatYFactor.value=o,this.onBeforeCompile=i=>{let a=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,d=this.uniforms.uTexture,h=this.uniforms.uRepeatYFactor,y=this.uniforms.uBlendTexture;this.uniforms=i.uniforms,i.vertexShader=JV,i.fragmentShader=QV,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:uge},uMaxSideAlpha:{value:dge},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:d,uRepeatYFactor:h,uBlendTexture:y})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=us,r.wrapT=us,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=us,r.wrapT=us,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?X6:ga,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,o){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=o}setColor(r,n,o){this.propertiesTexture.setColor(r,n,o)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};s(Z5,"BatchedStandardMaterial");var ku=Z5;f();function ez(e,t){var l,c,u;let r=0;for(let d of e)r+=((c=(l=d.components[0])==null?void 0:l.geometry)==null?void 0:c.attributes.position.count)||0;let n=new Rt(t.color),o;o=new ku({color:n,side:t.side==="back"?H6:t.side==="front"?Ob:ya,opacity:(u=t.opacity)!=null?u:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let i=new jb(e.length,r,0,o),a;for(let d of e)a=d.components[0],!(!(a instanceof yr)||!a.geometry)&&(a.mesh=i,a.material=o,a.instanceIndex=i.addGeometry(a.geometry),i.addInstance(a.instanceIndex),i.userData.entities[a.instanceIndex]=d.id,o instanceof ku&&o.setColor(a.instanceIndex,n,t.topColor?new Rt(t.topColor):n));return i.perObjectFrustumCulled=!0,i.matrixAutoUpdate=!1,i}s(ez,"batchGeometries");function l2(e){return Pe(e).darken(30).toRgbString()}s(l2,"darkenColorForOutline");function tz(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let o=e.boundingBox,i=e.getAttribute("position"),a=e.getAttribute("normal"),l=e.getAttribute("uv"),c,u;e.index?(c=e.index.count/3,u=s(function(M,O){return e.index.getX(M*3+O)},"meshIndex")):(c=i.count/3,u=s(function(M,O){return M*3+O},"meshIndex"));let d=new Ii;d.makeRotationFromQuaternion(new Ch().setFromEuler(new ba(0,0,r/180*Math.PI)));let h=t.find(M=>M.face==="top"),y;h&&(y={min:n(h.bounds[1],h.bounds[0],0),max:n(h.bounds[3],h.bounds[2],o.max.z)});let b=t.find(M=>M.face==="side"),I;if(b&&(I={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],o.max.z)}),!(!I&&!y))for(let M=0;M<c;++M){let O=a.getX(u(M,0))+a.getX(u(M,1))+a.getX(u(M,2)),_=a.getY(u(M,0))+a.getY(u(M,1))+a.getY(u(M,2)),$=a.getZ(u(M,0))+a.getZ(u(M,1))+a.getZ(u(M,2)),j=Math.abs(O),F=Math.abs(_),L=Math.abs($);var S,x;j<=F&&j<=L?(S="x",F<=L?x="y":x="z"):F<=j&&F<=L?(S="y",j<=L?x="x":x="z"):(S="z",j<=F?x="x":x="y"),S==="z"&&(S=x,x="z");let q,U,V,Q,Y,se;if(x==="z"||S==="z"){if(!b||!I)continue;q=b.repeat.u,U=b.repeat.v,V=b.offset.u,Q=b.offset.v,Y=b.rotation,se=I}else{if(!h||!y)continue;q=h.repeat.u,U=h.repeat.v,V=h.offset.u,Q=h.offset.v,Y=(360-r+h.rotation)%360,se=y}let{min:re,max:ve}=se,we=new xa;we.position.set(re.x,re.y,0),we.updateMatrix(),we.updateMatrixWorld();let ye=re.clone().applyMatrix4(d),Ne=ve.clone().applyMatrix4(d),nt=Math.abs(Ne.x-ye.x),st=Math.abs(Ne.y-ye.y),qe=new Me(nt,st,ve.z).applyMatrix4(we.matrixWorld),Ye=Math.abs(qe[S]-re[S]),de=Math.abs(qe[x]-re[x]),ge=Y*Math.PI/180||0,me=Math.cos(ge),oe=Math.sin(ge),D=we.matrixWorld.clone().invert(),K=new Ch().setFromEuler(new ba(0,0,r/180*Math.PI));for(let N=0;N<3;N++){let le=new Me(i.getX(u(M,N)),i.getY(u(M,N)),i.getZ(u(M,N))).applyMatrix4(D);le.applyQuaternion(K);let ce=le.applyMatrix4(we.matrixWorld),Ce=ce.x,pr=ce.y,Bn=ce.z;var T,w;S==="x"?T=q*(Ce-re[S])/Ye+V:S==="y"?T=q*(pr-re[S])/Ye+V:T=q*(Bn-re[S])/Ye+V,x==="x"?w=U*(Ce-re[x])/de+Q:x==="y"?w=U*(pr-re[x])/de+Q:w=U*(Bn-re[x])/de+Q,T-=.5,w-=.5;let rn=T*me-w*oe+.5,In=T*oe+w*me+.5;l.setX(u(M,N),rn),l.setY(u(M,N),In)}}}s(tz,"updateUVsLegacy");f();var X5=class X5{constructor(){m(this,"focusMesh");m(this,"dirty",!0)}};s(X5,"FocusableComponent");var wm=X5;function gn(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof ip&&e.components[1]===void 0?(e.components[1]=new xm,e.components[1].dirty=!0):e instanceof Ot&&e.components[2]===void 0?(e.components[2]=new xm,e.components[2].dirty=!0):e instanceof at&&e.components[1]===void 0&&(e.components[1]=new xm,e.components[1].dirty=!0),!0):(e instanceof ip?e.components[1]=void 0:e instanceof Ot?e.components[2]=void 0:e instanceof at&&(e.components[1]=void 0),!0);if(e.type==="geometry-group"){let n;for(let o of e.userData.entities3D.values())n=r.geometry3DMap.get(o),gn(n,t,r);return!0}}return!1}s(gn,"updateInteractivity");function rz(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let n,o,i=e.components[0];for(let a of e.userData.entities3D.values())if(n=t.geometry3DMap.get(a),n){o=n.components[1],o.color===i.color&&(o.initialColor=r.color||i.color,o.color=r.color||i.color,o.dirty=!0);let l=n.components[3];l&&(l.color=l2(o.color||i.color),l.dirty=!0),o.topColor===i.topColor&&(o.topColor=r.topColor||i.topColor,o.dirty=!0)}return r.color!==void 0&&(i.color=r.color,i.dirty=!0),"topColor"in r&&(i.topColor=r.topColor,i.dirty=!0),!0}return!1}}s(rz,"updateGroupColor");function nz(e,t){if(t!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let r=e.components[0];return r.shading=r.shading||{},r.shading&&(t.start!==r.shading.start||t.end!==r.shading.end||t.intensity!==r.shading.intensity)&&(Object.assign(r.shading,t),e.userData.shadingDirty=!0),!0}return!1}s(nz,"updateGroupShading");function oz(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}s(oz,"updateImageProps");function K5(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){let n=e.components[0];for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),a;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(a=i.components[1],a.height===n.height&&(i.components[1].height=r,i.components[1].dirty=!0),i.components[3]&&(i.components[3].dirty=!0))}return e.components[0].height=r,!0}}return!1}s(K5,"updateHeight");function J5(e,t){if(t!==void 0){let r=!1;(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==e.components[1].initialColor&&(e.components[1].initialColor=t.initialColor,r=!0),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,r=!0,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}s(J5,"updateColor");function Q5(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?e.updatePosition(r(t[1],t[0],t[2]||0)):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}s(Q5,"updatePosition");function eM(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof at?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}s(eM,"updateParent");function iz(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}s(iz,"updateEnabled");function sz(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{I5.parse(t.options||{})}catch(o){return z.error(o),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",gn(e,!1,r)):(n.pointerEvents="none",gn(e,t.options.interactive,r))),az(e,t.options.rank),!0}}return!1}s(sz,"updateMarker");function az(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=om(t),!0):!1}s(az,"updateRank");function lz(e,t,r){var n,o,i,a,l;if(t!==void 0&&e.type==="label"){let c=e.components[0];t.text!==void 0&&t.text!==c.text&&(c.text=t.text,c.textDirty=!0);try{B5.parse(t.options||{})}catch(u){z.error(u);return}WV(c.appearance,((n=t.options)==null?void 0:n.appearance)||{})&&(c.textDirty=!0),qV(c.appearance,((o=t.options)==null?void 0:o.appearance)||{})&&(c.markerDirty=!0),N9(c.appearance,((i=t.options)==null?void 0:i.appearance)||{}),gn(e,(a=t.options)==null?void 0:a.interactive,r),az(e,(l=t.options)==null?void 0:l.rank)}}s(lz,"updateLabel");function cz(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}s(cz,"updateHoverColor");function pz(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}s(pz,"updateHovered");function tM(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}s(tM,"updateFlipImageToFaceCamera");function ra(e,t,r){if(r!==void 0){if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){r!==e.components[1].visible&&(e.components[1].visible=r,e.components[1].dirty=!0);let n=e.components[3];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof w9){let o=t.geometry2DMap.get(n.userData.entityId);if(o){let i=o.components[0];i instanceof ta&&(i.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}s(ra,"updateVisibility");function rM(e,t,r){if(r!==void 0){if(e.type==="geometry-group"){let n=e.components[0];if(n.opacity!==r){for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),a;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(a=i.components[1],(!a.opacity||a.opacity===n.opacity)&&(a.opacity=r,a.dirty=!0))}return e.setOpacity(r),n.opacity=r,!0}}else if(e.type==="group-container"&&e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof at&&(n=e.parent.opacity),uz(e,t,n),!0}}return!1}s(rM,"updateOpacity");function uz(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let o of e.children)(o instanceof Sn&&o.type==="geometry-group"||o instanceof at&&o.type==="group-container")&&uz(o,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let o=t.geometry3DMap.get(n),i;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(i=o.components[1],i.dirty=!0)}}s(uz,"cascadeOpacity");function dz(e,t){if(t!==void 0&&e.type==="geometry-group"){let r=e.components[0];(t==null?void 0:t.texture)!=null&&r.texture!==(t==null?void 0:t.texture)&&(r.texture=t.texture,r.dirty=!0),(t==null?void 0:t.topTexture)!=null&&r.topTexture!==(t==null?void 0:t.topTexture)&&(r.topTexture=t.topTexture,r.dirty=!0)}}s(dz,"updateGroupTexture");function fz(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof yr){let o=e.components[0];return o.detached===!1&&(o.detached=!0,o.dirty=!0),e.components[1].dirty=!0,!0}}return!1}s(fz,"updateIndividualGeometryTexture");function mz(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],o=e.components[3];o&&(o.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),t===0?r.visible=!1:r.visible=!0,r.dirty=!0;let i=e.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.shadingDirty=!0),!0}}return!1}s(mz,"updateIndividualGeometryOpacity");function c2(e,t){if(t!==void 0)if(e.type==="path"||e.type==="geometry"||e.type==="custom-geometry")e.components[1].altitude=t,e.components[1].dirty=!0;else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group")return e.setAltitude(t),!0}return!1}s(c2,"updateAltitude");function p2(e,t,r){if(r!==void 0){if(e.type==="geometry-group"&&e.components[0]!=null)for(let n of e.userData.entities3D.values()){let o=t.geometry3DMap.get(n);o instanceof Ot&&p2(o,t,r)}else if(e.type==="geometry"){let n=e.components[3],o=e.components[1];!n&&r===!0?e.components[3]=new Pm(o.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}s(p2,"updateOutline");function nM(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof yr&&r.focusable!==t)return r.focusable=t,!0}else if(e.type==="group-container"){let r=e.components[2]!==void 0;if(t===!0&&!r)return e.components[2]=new wm,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}s(nM,"updateFocusable");function hz(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}s(hz,"updateIndividualGeometryRenderOrder");function yz(e,t,r){let{visible:n,color:o}=r;if(e.type!=="path")return;let i=e.components[0];n!=null&&ra(e,t,n),o!=null&&J5(e,{color:o}),Object.assign(i,oM(r)),D9(r)||(i.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(i.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(i.dirty=!0))}s(yz,"handlePathUpdate");function oM(e){return Po(e,mge)}s(oM,"pickPathOptions");var mge=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function gz(e){if(!(e instanceof Ot&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}s(gz,"assetGeometryIsText3D");var u2=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function bz(e,t,r){ra(e,t,r.visible);let n=e.components[1],o=Po(r,u2);"margin"in r&&z.warn("update to margin is not supported atm"),"content"in r&&z.warn("content update is not supported atm");try{YV.parse(o)}catch(i){z.error(i);return}Object.keys(o).length>0&&(Object.assign(n,o),n.dirty=!0)}s(bz,"handleText3DUpdate");var hge=["color","material","opacity","verticalOffset","rotation","position","scale"];function xz(e,t){let r=Po(t,hge),n=e.components[1],o=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity,r.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(o.feature.geometry.coordinates=r.position,o.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}s(xz,"handleModelStyleUpdate");var Au,na,d2,wc,vz,$g,f2,Iz,Sz,jg,m2,Gg,Ug,h2,iM=class iM{constructor(t){E(this,wc);E(this,Au,null);E(this,na);m(this,"getCurrentSceneGLTF",s(async t=>{let r=P({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await te(this,wc,vz).call(this),o=p(this,d2).call(this,r),i=await n.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),a;if(i instanceof ArrayBuffer)a=new Blob([i],{type:"application/octet-stream"});else{let l=JSON.stringify(i,null,2);a=new Blob([l],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));E(this,d2,s(t=>{let{scale:r,light:n,onlyVisible:o}=t,i=new $l,a=new Jr().setFromObject(p(this,na).entityScene);if(p(this,$g).call(this,p(this,na).entityScene,i,o),n){let l=new Lb(16777215,.3*Math.PI);l.position.set(0,Math.max(a.max.x,a.max.y)*r*.5,a.max.y*r*4),l.lookAt(0,0,-1),l.target.position.set(0,0,-1),l.add(l.target),i.add(l)}return i},"#getExportedScene"));E(this,$g,s((t,r,n)=>{t.material&&(t instanceof Ab?te(this,wc,Iz).call(this,t).forEach(o=>r.add(o)):t instanceof dd&&r.add(te(this,wc,Sz).call(this,t))),t.children.forEach(o=>{(!n||o.visible)&&p(this,$g).call(this,o,r,n)})},"#processObject3D"));E(this,f2,s((t,r,n)=>{let o=new c9({color:new Rt(t),metalness:0});return o.opacity=r,o.transparent=n,o},"#createStandardMaterial"));E(this,jg,s(t=>{let{geometry:r,material:n,position:o,rotation:i,quaternion:a,scale:l}=t;if(!(r!=null&&r.isBufferGeometry))return t;let c=r.attributes.position,u=r.attributes.normal,d=r.attributes.uv;return p(this,m2).call(this,c,u),p(this,Ug).call(this,o,l,i,a),d&&p(this,h2).call(this,d),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=ya),t},"#convertGeometry"));E(this,m2,s((t,r)=>{let n=new Me,o=new Me;for(let i=0;i<t.count;i++)n.fromBufferAttribute(t,i),p(this,Gg).call(this,n),t.setXYZ(i,n.x,n.y,n.z),r&&(o.fromBufferAttribute(r,i),p(this,Gg).call(this,o),r.setXYZ(i,o.x,o.y,o.z))},"#convertAttributes"));E(this,Gg,s(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));E(this,Ug,s((t,r,n,o)=>{let i=t.y;t.y=t.z,t.z=-i;let a=r.y;if(r.y=r.z,r.z=a,n instanceof ba)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let l=o.y;o.set(o.x,o.z,-l,o.w)}},"#convertObjectProperties"));E(this,h2,s(t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),o=t.getY(r);t.setXY(r,n,o)}},"#convertUVs"));A(this,na,t),p(this,na).entityScene=t.entityScene,p(this,na).geometry3DMap=t.geometry3DMap}destroy(){A(this,Au,null)}};Au=new WeakMap,na=new WeakMap,d2=new WeakMap,wc=new WeakSet,vz=s(async function(){if(!p(this,Au)){let{GLTFExporter:t}=await import("./GLTFExporter-7OZO7OAN.js");A(this,Au,new t)}return p(this,Au)},"#getGLTFExporter"),$g=new WeakMap,f2=new WeakMap,Iz=s(function(t){var a,l;let r=[],o=((a=t.userData)!=null&&a.entities?Object.values((l=t.userData)==null?void 0:l.entities):[]).map(c=>p(this,na).geometry3DMap.get(c)),i=new Map;return o.forEach(c=>{var b;if(!c||!(c instanceof Ot))return;let u=c.components[1],d=c.components[2];if(!u.visible||u instanceof bs&&u.opacity===0||u instanceof Mh||u instanceof Hb)return;let h=d!=null&&d.hover?u.hoverColor||p(this,na).hoverColor:u.color,y="".concat(h,"-").concat(u.opacity,"-").concat(Number(u.visible));i.has(y)||i.set(y,[]),(b=i.get(y))==null||b.push(c)}),i.forEach((c,u)=>{let[d,h,y]=u.split("-"),b=c.reduce((T,w)=>{if(w.type==="custom-geometry")return T;let M=w.components[0];return"geometry"in M&&M.geometry instanceof n9&&T.push(M.geometry),T},[]),I=p(this,f2).call(this,d,Number(h),t.material.transparent),S=Go(b,!0),x=new We(S,I);x.position.copy(t.position),x.rotation.copy(t.rotation),x.scale.copy(t.scale),x.visible=!!y,p(this,Ug).call(this,x.position,x.scale,x.rotation,x.quaternion),r.push(p(this,jg).call(this,x))}),r},"#processBatchedMesh"),Sz=s(function(t){let r=t.geometry.clone(),n=t.material,o=new $r({color:n.color,side:ya});o.opacity=n.opacity,o.transparent=n.transparent;let i=new dd(r,o);return i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),i.visible=t.visible,p(this,jg).call(this,i)},"#processLineSegments"),jg=new WeakMap,m2=new WeakMap,Gg=new WeakMap,Ug=new WeakMap,h2=new WeakMap,s(iM,"ExporterSystem");var Bg=iM;f();f();f();var lM=ps(Az());function Dz(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}s(Dz,"JSClipperError");Dz.prototype=Error.prototype;lM.default.Error=function(e){throw new Dz(e)};var Zr=lM.default;var lbe="gray",cbe=.1,Hg=100,cM=new Zr.ClipperOffset;function pbe(e,t){cM.Clear(),t/=2;let r=e.map(o=>({X:o.x*Hg,Y:o.y*Hg}));cM.AddPath(r,Zr.JoinType.jtMiter,Zr.EndType.etClosedPolygon);let n=new Zr.Paths;return cM.Execute(n,t*Hg),n.length?n.map(i=>i.map(a=>({x:a.X/Hg,y:a.Y/Hg}))):[e]}s(pbe,"offset");function I2(e,t,r){var y,b,I,S,x;let{color:n=lbe,opacity:o=1,altitude:i=0,height:a=cbe}=r||{};Array.isArray(o)&&(o=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i},center:{x:0,y:0,z:(a+i)/2}},u=e.geometry.coordinates[0].map(T=>{let w=t(T[1],T[0]);return l.min.x=Math.min(l.min.x,w.x),l.min.y=Math.min(l.min.y,w.y),l.max.x=Math.max(l.max.x,w.x),l.max.y=Math.max(l.max.y,w.y),w});((b=(y=e.properties)==null?void 0:y.style)==null?void 0:b.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((I=e.properties)==null?void 0:I.image)!=null?u=pbe(u,((x=(S=e.properties)==null?void 0:S.style)==null?void 0:x.edgeOffset)||0):u=[u];let d=[];for(let T of u){let w=new ds;w.moveTo(T[0].x,T[0].y),T.slice(1).forEach($=>w.lineTo($.x,$.y)),w.lineTo(T[0].x,T[0].y);let M=e.geometry.coordinates.slice(1);w.holes=M.map($=>{let j=$.map(L=>t(L[1],L[0])),F=new Gl;return F.moveTo(j[0].x,j[0].y),j.slice(1).forEach(L=>F.lineTo(L.x,L.y)),F.lineTo(j[0].x,j[0].y),F});let O={bevelEnabled:!1,depth:a},_=new fs(w,O);_.userData={style:{color:n,opacity:o}},d.push(_)}if(d.length===1)return d[0];let h=Go(d);return h.userData={style:{color:n,opacity:o},_split:!0},h}s(I2,"renderPolygonGeometry");f();var ube="gray",dbe=.1;function S2(e,t,r){let{color:n=ube,opacity:o=1,altitude:i=0,height:a=dbe}=r||{};Array.isArray(o)&&(o=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i}},c={bevelEnabled:!1,depth:a},u=[];e.geometry.coordinates.forEach(h=>{let y=new ds,b=h[0].map(x=>{let T=t(x[1],x[0]);return l.min.x=Math.min(l.min.x,T.x),l.min.y=Math.min(l.min.y,T.y),l.max.x=Math.max(l.max.x,T.x),l.max.y=Math.max(l.max.y,T.y),T});y.moveTo(b[0].x,b[0].y),b.slice(1).forEach(x=>y.lineTo(x.x,x.y)),y.lineTo(b[0].x,b[0].y);let I=h.slice(1);y.holes=I.map(x=>{let T=x.map(M=>t(M[1],M[0])),w=new Gl;return w.moveTo(T[0].x,T[0].y),T.slice(1).forEach(M=>w.lineTo(M.x,M.y)),w.lineTo(T[0].x,T[0].y),w});let S=new fs(y,c);u.push(S)});let d=Go(u);return d.translate(0,0,i||0),d.userData={style:{color:n,opacity:o}},d}s(S2,"renderMultiPolygonGeometry");f();var fbe="gray",pM=new Zr.ClipperOffset,Kn=100;function Fz(e,t,r){let{color:n=fbe,opacity:o=1,width:i=1,join:a="round",cap:l="round",height:c=.01,altitude:u=0}=r||{};Array.isArray(o)&&(o=0);let d=[];for(let S=0;S<e.geometry.coordinates.length-1;S++){let x=t(e.geometry.coordinates[S][1],e.geometry.coordinates[S][0]),T=t(e.geometry.coordinates[S+1][1],e.geometry.coordinates[S+1][0]);d.push([x,T])}pM.AddPaths(d.map(S=>S.map(x=>({X:x.x*Kn,Y:x.y*Kn}))),a==="round"?Zr.JoinType.jsRound:a==="miter"?Zr.JoinType.jsMiter:Zr.JoinType.jsSquare,l==="round"?Zr.EndType.etOpenRound:l==="butt"?Zr.EndType.etOpenButt:Zr.EndType.etOpenSquare);let h=new Zr.PolyTree;pM.Execute(h,i/2*Kn);let y=[],b={bevelEnabled:!1,depth:c};for(let S of h.m_AllPolys){let x=new ds;if(S.IsHole())continue;let T=S.m_polygon;x.moveTo(T[0].X/Kn,T[0].Y/Kn),T.slice(1).forEach(w=>x.lineTo(w.X/Kn,w.Y/Kn)),x.lineTo(T[0].X/Kn,T[0].Y/Kn),x.holes=S.m_Childs.map(w=>{let M=new Gl,O=w.m_polygon;return M.moveTo(O[0].X/Kn,O[0].Y/Kn),O.slice(1).forEach(_=>M.lineTo(_.X/Kn,_.Y/Kn)),M.lineTo(O[0].X/Kn,O[0].Y/Kn),M}),y.push(new fs(x,b))}let I=Go(y);return I.translate(0,0,u||0),I.userData={style:{color:n,opacity:o}},pM.Clear(),I}s(Fz,"renderLineStringGeometry");f();var Jn=100,mbe=.22,hbe=.01;function Lz(e,t,r={}){let{width:n=mbe,height:o=hbe,color:i="gray",opacity:a=1,altitude:l=0}=r,c={min:{x:1/0,y:1/0,z:l},max:{x:-1/0,y:-1/0,z:l+o}},u={bevelEnabled:!1,depth:o},d=new Zr.ClipperOffset,h=e.geometry.coordinates.map(S=>S.map(x=>t(x[1],x[0])));d.AddPaths(h.map(S=>S.map(x=>({X:x.x*Jn,Y:x.y*Jn}))),Zr.JoinType.jsMiter,Zr.EndType.etOpenRound);let y=new Zr.PolyTree;d.Execute(y,n/2*Jn);let b=[];for(let S of y.m_AllPolys){let x=new ds;if(S.IsHole())continue;c.min.x=Math.min(c.min.x,S.m_polygon[0].X),c.min.y=Math.min(c.min.y,S.m_polygon[0].Y),c.max.x=Math.max(c.max.x,S.m_polygon[0].X),c.max.y=Math.max(c.max.y,S.m_polygon[0].Y);let T=S.m_polygon;x.moveTo(T[0].X/Jn,T[0].Y/Jn),T.slice(1).forEach(w=>x.lineTo(w.X/Jn,w.Y/Jn)),x.lineTo(T[0].X/Jn,T[0].Y/Jn),x.holes=S.m_Childs.map(w=>{let M=new Gl,O=w.m_polygon;return M.moveTo(O[0].X/Jn,O[0].Y/Jn),O.slice(1).forEach(_=>M.lineTo(_.X/Jn,_.Y/Jn)),M.lineTo(O[0].X/Jn,O[0].Y/Jn),M}),b.push(new fs(x,u))}let I=Go(b);return I.translate(0,0,l||0),I.userData={style:{color:i,opacity:a}},d.Clear(),I}s(Lz,"renderMultiLineStringGeometry");f();f();var Em=G.object({type:G.enum(["Point"]),coordinates:G.array(G.number()).min(2).max(3)});var ybe=G.object({rotation:G.array(G.number()).length(3).optional(),altitude:G.number().optional(),scale:G.array(G.number()).length(3).optional(),interactive:G.boolean().optional(),verticalOffset:G.number().optional(),id:G.union([G.number(),G.string()]).optional()}),gbe=G.object({type:G.enum(["Feature"]),geometry:Em,properties:ybe}),bbe=G.object({type:G.enum(["FeatureCollection"]),features:G.array(gbe)}),xbe=G.object({color:G.string()}),vbe=G.object({url:G.string(),color:G.string().optional(),opacity:G.number().optional(),material:G.record(G.string(),xbe).optional()});function Nz(e,t,r){G.union([G.number(),G.string()]).parse(e),bbe.parse(t),vbe.parse(r)}s(Nz,"validateModelGroup");var Wg,qg,uM=class uM{constructor(t){m(this,"mesh");m(this,"type","model");m(this,"positionDirty",!0);m(this,"outline");m(this,"geometry");m(this,"material");m(this,"feature");m(this,"instanceIndex",-1);m(this,"visible",!0);m(this,"color",new Rt);m(this,"position",new Me);E(this,Wg,0);E(this,qg,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return p(this,Wg)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Wg,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(et.degToRad(t[0]),et.degToRad(t[1]),et.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return p(this,qg)}set opacity(t){var r,n,o;if(this.mesh){if(this.mesh.children[0]instanceof jl){for(let i of this.mesh.children)if(i instanceof jl){((r=i.userData)==null?void 0:r.originalOpacity)===void 0&&(i.userData.originalOpacity=i.material.opacity);let a=jo(t,0,(n=i.userData)==null?void 0:n.originalOpacity,0,1);i.material.opacity=a,i.material.transparent=a<1,i.material.needsUpdate=!0}}else(o=this.mesh)==null||o.traverse(i=>{i instanceof We&&i.material&&(Array.isArray(i.material)?i.material.forEach(a=>{Rz(a,t)}):Rz(i.material,t))});A(this,qg,t)}}};Wg=new WeakMap,qg=new WeakMap,s(uM,"ModelComponent");var Ec=uM;function Rz(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}s(Rz,"updateMaterialOpacity");f();function C2(e){var l,c;let t=e.components[0],r=e.components[1];r.opacity!=null&&r.opacity!==t.opacity&&(t.opacity=r.opacity);let n=r.material,o=r.color;if(n||o){let u=Ibe(o,n);(l=t.mesh)==null||l.traverse(d=>{d instanceof We&&d.material&&(Array.isArray(d.material)?d.material.forEach(h=>{u[h.name]?h.color.set(u[h.name].color):h.color.set(o)}):u[d.material.name]?d.material.color.set(u[d.material.name].color):d.material.color.set(o))})}let i=(c=t.feature.geometry.coordinates[2])!=null?c:0,a=r.verticalOffset+i;t.altitude!==a&&(t.altitude=a),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}s(C2,"applyModelGeometryStyle");function Ibe(e,t){let r={};if(e&&Object.assign(r,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),t)for(let n in t)t[n].color&&(r[n]?r[n].color=t[n].color:r[n]={color:t[n].color});return r}s(Ibe,"consolidateColorAndMaterial");function Bz(e,t){var a,l;let r=e.components[0],o=(a=e.components[1].verticalOffset)!=null?a:0,i=r.feature.geometry.coordinates.slice();i[2]=((l=i[2])!=null?l:0)+o,r.mesh?r.mesh.position.copy(t(i)):r.position.copy(t(i))}s(Bz,"applyModelPosition");function Sbe(e){let{color:t,opacity:r,topColor:n,texture:o,topTexture:i}=e;return"".concat(t).concat(r).concat(n||"").concat(o||"").concat(i||"")}s(Sbe,"generateIndex");var Cbe=1e4,dM=class dM extends Be{constructor(r,n){super();m(this,"state");m(this,"convertTo3DMapPosition");m(this,"loader");m(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-BTM3ARCC.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,o){var l,c;let i=new yr(n),a=new Ot(i,new bs(R(P({},o),{url:(c=(l=n.properties)==null?void 0:l.image)==null?void 0:c.path})));return o!=null&&o.outline&&(a.components[3]=new Pm(l2(o.color))),a.id=r,a}createModelFromFeature(r,n,o){let i=new Ec(n),a=P({},o);n.properties.verticalOffset!=null&&(a.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(a.rotation=n.properties.rotation),n.properties.scale!=null&&(a.scale=n.properties.scale);let l=new Hb(a),c=new Ot(i,l);return c.id=r,c}populateEntityMesh(r,n){let o=r.components[0];o.geometry=n,o.currentHeight=r.components[1].height,o.dirty=!1}async populateModelGroup(r,n,o){let i=new Ii,a=new ba,l=new Ch,c=new Me,u=new Pi,d=await this.getGLTFLoader(),h=new Promise(y=>{d.load(n,b=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?b.scene.traverse(I=>{let S=I;if("isMesh"in S&&S.isMesh===!0){let x=new jl(S.geometry,S.material,r.size);x.userData={entities:{}},u.add(x),o.add(u)}}):(b.scene.traverse(I=>{"isMesh"in I&&I.isMesh===!0&&(I.position.set(0,0,0),I.rotation.set(0,0,0),I.scale.set(1,1,1),I.updateMatrix())}),u.add(b.scene),o.add(u),u.userData.isSingleModel=!0,u.userData.entityId=r.values().next().value,u.userData.type="model")),y()})});return this.optimizePromise.push(h.then(()=>{var I,S,x,T,w,M,O,_,$,j,F,L;let y=0,b;for(let q of r.values()){if(b=this.state.geometry3DMap.get(q),!b||(b==null?void 0:b.type)!=="model")continue;let U=b.components[0],V=b.components[1],Q=b.components[0].feature;U.mesh=u,U.instanceIndex=y,C2(b),b.components[1].dirty=!1;let{x:Y,y:se}=this.convertTo3DMapPosition(Q.geometry.coordinates[1],Q.geometry.coordinates[0],0);U.position.set(Y,se,U.altitude),a.set(et.degToRad((S=(I=V.rotation)==null?void 0:I[0])!=null?S:vd[0]),et.degToRad((T=(x=V.rotation)==null?void 0:x[1])!=null?T:vd[1]),et.degToRad((M=(w=V.rotation)==null?void 0:w[2])!=null?M:vd[2])),c.set((_=(O=V.scale)==null?void 0:O[0])!=null?_:xd[0],(j=($=V.scale)==null?void 0:$[1])!=null?j:xd[1],(L=(F=V.scale)==null?void 0:F[2])!=null?L:xd[2]),l.setFromEuler(a),i.compose(U.position,l,c),u.children.forEach(re=>{!b||(b==null?void 0:b.type)!=="model"||!(re instanceof jl)||(re.setMatrixAt(y,i),re.userData.entities[y]=b.id)}),U.mesh.userData.isSingleModel&&(U.mesh.matrix.copy(i),U.mesh.matrix.decompose(U.mesh.position,U.mesh.quaternion,U.mesh.scale)),y++}this.publish("model-loaded")})),u}populateEntityGroup(r){var l;let n,o,i,a;for(let c of r.values())a=this.state.geometry3DMap.get(c),a.components[0]instanceof yr&&(o=a.components[0].feature,i=a.components[1],o.geometry.type==="Polygon"?(n=I2(o,this.convertTo3DMapPosition,i),(l=o.properties)!=null&&l.textures&&o.properties.textures.length>0&&tz(n,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,n)):o.geometry.type==="MultiPolygon"?(n=S2(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)):o.geometry.type==="LineString"?(n=Fz(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)):o.geometry.type==="MultiLineString"&&(n=Lz(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)));return r}optimize(r){var n;if((r.visible||r.userData.preloadGeometry)&&(r instanceof Sn||r instanceof at)){for(let a of r.children)this.optimize(a);if(r instanceof at||r.userData.dirty===!1)return;let o={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(a){z.warn(a)}else r.userData.modelURL&&r.userData.dirty&&(this.populateModelGroup(r.userData.entities3D,r.userData.modelURL,r),r.userData.dirty=!1);let i=0;if(r.userData.dirty){let a=0,l;for(let c of r.userData.entities3D.values()){l=this.state.geometry3DMap.get(c);let u=l==null?void 0:l.components[0];if((l==null?void 0:l.type)==="geometry"){let d=l.components[1];a++,a>=Cbe&&(a=0,i++);let h=Sbe(d)+i;o[h]===void 0&&(o[h]={style:d,entities:[]}),o[h].entities.push(l)}else u&&"mesh"in u&&u.mesh&&((n=u.mesh)==null?void 0:n.parent)!==r&&r.add(u.mesh)}for(let c in o){let u=ez(o[c].entities,o[c].style);r.add(u),r.userData.dirty=!1}for(let c of r.userData.entities3D.values())if(l=this.state.geometry3DMap.get(c),l!=null&&l.entities2D.size>0)for(let u of l.entities2D.values())u&&(l.attach(u),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};s(dM,"MeshCreationAndOptimizationSystem");var T2=dM;f();var fM=class fM{constructor(t,r){m(this,"state");m(this,"dirty",!0);m(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof ea&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};s(fM,"DOMVisibilitySystem");var P2=fM;f();var mM=class mM{constructor(t,r){m(this,"state");m(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,o;for(let i of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(i),t){o=t.components[0];let a=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(a instanceof Ot)if(this.state.geometry3DIdsInScene.has(a.id)){n=a.components[1],o=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let l=n.visible&&n.opacity>0;o.visible!==l&&(o.visible=l)}else o.visible===!0&&(o.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};s(mM,"TwoDProjectionSystem");var w2=mM;f();f();var Tbe=s(function(){let t,r;return n=>{if((!r||!r)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",r=t.getContext("2d")),!r)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:r}}},"createMeasureCanvasContext")(),$z=s(({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:o=2,lineHeight:i=1.2,options:a={strokeText:!0}})=>{let l="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:c}=Tbe(n);c.font=l;let u=[],d=e.split(" "),h=0,y=0,b=0;for(;y<d.length;){let T=d[y];if(h===o&&h>0){u[h-1]+="...";break}if(u[h]==null&&(u[h]=T,y++),d.length===1){u[h]=T;break}if(d[y]==null)break;let{width:w}=c.measureText(u[h]+" "+d[y]);w<=r*n?(u[h]+=" "+d[y],y++):h++}u.forEach(T=>{let{width:w}=c.measureText(T);b=Math.max(w,b)});let I=t*n*i,S=u.length*I;return{maxWidth:b,maxHeight:S,lines:u.length,draw:s((T,w,M)=>{u.length===1?(a.strokeText&&T.strokeText(u[0],w,M),T.fillText(u[0],w,M)):(a.strokeText&&(T.strokeText(u[0],w,M-I/2),T.strokeText(u[1],w,M+I/2)),T.fillText(u[0],w,M-I/2),T.fillText(u[1],w,M+I/2))},"draw")}},"shaveText");f();function jz(e){let t=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?t.src="data:image/svg+xml;base64,".concat(btoa(e)):t.src=e),t}s(jz,"createImage");var Pbe=3.5,wbe=2.5,Mbe=2,Obe=5,Zg=2.5;var hM=class hM extends Be{constructor(r,n,o){super();m(this,"dirty",!1);m(this,"state");m(this,"colliderContext");m(this,"colliderCanvas");m(this,"transformRequestFunc");m(this,"transformRequest",s(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));m(this,"pinCache",{});m(this,"imageCache",{});m(this,"imagePromiseCache",{});m(this,"imageDimensionsCache",{});m(this,"textCache",{});m(this,"update",s(r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let o,i,a,l,c,u,d;for(let h of this.state.geometry2DIdsInScene)if(d=this.state.geometry2DMap.get(h),d!=null&&(u=d.components[0],u instanceof ta&&!d.disposed)){if(c=u.appearance.marker.iconVisibleAtZoomLevel,u.appearance.marker.icon!=null&&c&&r>=c!==u.iconVisible&&(u.iconVisible=r>=c,u.dirty=!0),(u.dirty||this.dirty)&&u.calculateMarkerSize(),i=u.appearance.marker.foregroundColor,a=u.appearance.marker.backgroundColor,l=md(u.markerSize,2),o="".concat(i.active,"-").concat(i.inactive,"-").concat(a.active,"-").concat(a.inactive,"-").concat(l,"-").concat(u.iconVisible),u.labelCacheId=o,this.pinCache[o]||this.prepare(u,o,this.colliderContext),u.appearance.marker.icon&&(!u.imageHash||u.markerDirty)&&this.cacheImage(u),this.textCache[u.id]==null||u.textDirty||this.dirty){u.collisionDirty=!0,this.textCache[u.id]={};let{textDrawFn:y,width:b,height:I}=this.processText(u.text,u.appearance.text.size,u.appearance.text.maxWidth,u.appearance.text.numLines,u.appearance.text.lineHeight);["left","center","right"].forEach(S=>{this.textCache[u.id][S]=this.textToCanvas(y,u.appearance.text.size,S,b,I,u.appearance.text.foregroundColor,u.appearance.text.backgroundColor)}),u.dimensions={width:Math.ceil(b/n),height:Math.ceil(I/n)}}u.canShow&&u.visible&&(u.enabled||u.visibilityNeedsUpdate!==!1)&&this.draw(u,o,this.colliderContext,r),u.dirty=!1,u.textDirty=!1,u.markerDirty=!1}this.dirty=!1},"update"));m(this,"processText",s((r,n,o,i,a)=>{let l=this.state.pixelRatio,{draw:c,maxWidth:u,maxHeight:d}=$z({text:r,size:n,pixelRatio:l,maxWidth:o,maxLines:i,lineHeight:a});return{textDrawFn:c,width:u+Zg*l*2,height:d+Zg*l*2}},"processText"));m(this,"textToCanvas",s((r,n,o,i,a,l,c)=>{let u=this.state.pixelRatio,d,h=i,y=a;window.OffscreenCanvas!=null&&!A9()?d=new OffscreenCanvas(h,y):(d=document.createElement("canvas"),d.width=h,d.height=y,d.style.width=h+"px",d.style.height=y+"px");let b=d.getContext("2d",{willReadFrequently:!0});if(!b)return;b.textAlign=o,b.font="bold ".concat(n*u,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=Zg*u,b.fillStyle=l,b.strokeStyle=c;let I=o==="left"?0:o==="center"?h/2:h-Zg*u/2;return r(b,I,(y+Zg*u/2)/2),d},"textToCanvas"));m(this,"cacheImage",s(r=>{if(!r.appearance.marker.icon)return;let n=$9(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(o=>{this.transformRequest(r.appearance.marker.icon).then(i=>{let a=jz(i.url);a.onload=()=>{this.imageCache[n]=a,this.publish("img:loaded"),o(a)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))},"cacheImage"));m(this,"createPinCanvas",s((r,n,o,i,a=1)=>{let l,c=this.state.pixelRatio,u=r.totalMarkerSize*2*c*a;window.OffscreenCanvas!=null?l=new OffscreenCanvas(u,u):(l=document.createElement("canvas"),l.width=u,l.height=u,l.style.width=u/c+"px",l.style.height=u/c+"px");let d=l.getContext("2d");return d.shadowColor="rgba(0,0,0,0.3)",d.shadowOffsetY=Mbe*c,d.shadowBlur=Obe*c,d.beginPath(),d.arc(u/2,u/2,(n/2+wbe*c/2)*a,0,2*Math.PI),d.fillStyle=o,d.fill(),d.beginPath(),d.arc(u/2,u/2,n/2*a,0,2*Math.PI),d.shadowColor="transparent",d.fillStyle=i,d.fill(),l},"createPinCanvas"));m(this,"prepare",s((r,n,o)=>{var c,u;let i=this.state.pixelRatio;o.lineWidth=4*i;let a=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active,(c=r.appearance.marker.iconSizeInterpolation)==null?void 0:c.maxScale),l=this.createPinCanvas(r,r.iconVisible?r.markerSize:Pbe*i,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive,(u=r.appearance.marker.iconSizeInterpolation)==null?void 0:u.maxScale);this.pinCache[n]=[a,l]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=o}draw(r,n,o,i){var h,y;if(!r.canShow||!r.visible)return;o.save(),o.globalAlpha=r.opacity;let a=this.state.pixelRatio,l=r.projection.x*a,c=r.projection.y*a,u=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1],d=1;if(r.appearance.marker.iconSizeInterpolation&&r.appearance.marker.iconSize){let{minZoomLevel:b,maxZoomLevel:I,minScale:S,maxScale:x}=r.appearance.marker.iconSizeInterpolation;d=jo(i,b,I,S,x)}if(r.recomputeCurrentStrategy(r.iconVisible?d:1),o.drawImage(u,l-r.totalMarkerSize*a,c-r.totalMarkerSize*a,r.totalMarkerSize*2*a,r.totalMarkerSize*2*a),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let b=this.imageCache[r.imageHash],I=(r.totalMarkerSize-r.scaledIconPadding)*a,S=r.appearance.marker.iconFit,x=I,T=I,w="".concat(r.imageHash,"_").concat(S);if(this.imageDimensionsCache[w])x=this.imageDimensionsCache[w].width,T=this.imageDimensionsCache[w].height;else{let M=b.width*a,O=b.height*a;if(S==="contain"){let _=Math.sqrt(M**2+O**2),$=I/_;x=M*$,T=O*$}if(S==="cover"){let _=I/M,$=I/O,j=Math.max(_,$);x=M*j,T=O*j}}o.save(),o.beginPath(),o.arc(l,c,I/2,0,2*Math.PI),o.closePath(),((y=(h=r==null?void 0:r.appearance)==null?void 0:h.marker)==null?void 0:y.iconOverflow)!=="visible"&&o.clip(),o.drawImage(b,l-x/2,c-T/2,x,T),o.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left!=null&&r.style.top!=null&&o.drawImage(this.textCache[r.id][r.style.textAlign],l+r.style.left*a,c+r.style.top*a),o.restore()}};s(hM,"TwoDDrawSystem");var M2=hM;f();f();var _c=class _c{constructor(){m(this,"loader");this.loader=new fd}static getInstance(){return _c.instance||(_c.instance=new _c),_c.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};s(_c,"TextureLoaderSingleton"),m(_c,"instance");var yM=_c,kc=yM.getInstance();function Ebe(e,t){let r=e.components[2],n=e.components[1];return r!=null&&r.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}s(Ebe,"processColor");var Ru,Xg,gM=class gM extends Be{constructor(r,n){super();E(this,Ru);m(this,"state");m(this,"convertTo3DMapPosition");m(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,o){var i;if(n.texture!==r.texture&&n.texture!==""&&te(this,Ru,Xg).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&te(this,Ru,Xg).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((i=r.feature.properties)==null?void 0:i.textures)&&r.feature.properties.textures.length>0)for(let a of r.feature.properties.textures)a.face==="top"&&r.topTexture!==a.path?te(this,Ru,Xg).call(this,a.path,r,"topTexture"):a.face==="side"&&r.texture!==a.path&&te(this,Ru,Xg).call(this,a.path,r,"texture"),r.blendTexture=!0;(r.texture!=null||r.topTexture!=null)&&(o!=null&&o.hover&&r.texturesVisible?r.hideTextures():r.texturesVisible||r.showTextures(),n.texture===""&&r.removeSideTexture(),n.topTexture===""&&r.removeTopTexture())}update(){var i,a,l,c,u,d,h,y;let r,n,o;for(let b of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(b),o instanceof Sn&&o.type==="geometry-group"){let I=o.components[0];if(o.userData.shadingDirty){let S=o.userData.entities3D.values().next().value;if(S==null)continue;let x=this.state.geometry3DMap.get(S);x instanceof Ot&&(x.type==="geometry"||x.type==="custom-geometry")&&(r=x.components[0],o.userData.shadingDirty&&I.shading&&this.setShading(r,I.shading));let T,w;for(let M of o.userData.entities3D.values())T=this.state.geometry3DMap.get(M),w=T.components[0],T.type==="geometry"&&w.detached&&o.userData.shadingDirty&&I.shading&&this.setShading(w,I.shading);o.userData.shadingDirty=!1}if(I.dirty){let S=o.getfirstChildEntityId();if(S){let T=this.state.geometry3DMap.get(S),w=T==null?void 0:T.components[0];w instanceof yr&&this.processTextures(w,I)}let x=I.opacity*sp(o);o.getOpacity()!==x&&o.setOpacity(x),I.dirty=!1}}else if(o&&(o.type==="geometry"||o.type==="custom-geometry")&&((i=o.components[1])!=null&&i.dirty||(a=o.components[2])!=null&&a.dirty)){let I=o.components[0],S=o.components[1];n=o.components[2];let x=Ebe(o,this.state.hoverColor);if(I.setColor(x[0],x[1]),S.visible!==I.visible&&(I.visible=S.visible,I instanceof yr&&I.textMesh)){let w=this.state.geometry3DMap.get(I.textMesh.userData.entityId);(w==null?void 0:w.type)==="text3d"&&w.components[0].polygonEntityId!=null&&(w.components[0].visible=S.visible)}S.altitude!==I.altitude&&(I.altitude=S.altitude);let T=S.opacity*sp(o);T!==I.opacity&&(I.opacity=T),S.renderOrder!==I.renderOrder&&(I.renderOrder=S.renderOrder),S.dirty=!1,I instanceof yr&&this.processTextures(I,S,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(C2(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(Bz(o,this.convertTo3DMapPosition),o.components[0].positionDirty=!1);else if((o==null?void 0:o.type)==="image"&&((l=o.components[1])!=null&&l.dirty)){r=o.components[0];let I=o.components[1];I.visible!==r.visible&&(r.visible=I.visible),I.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((c=o.components[1])!=null&&c.dirty)&&o.components[0].polygonEntityId!=null){r=o.components[0];let I=o.components[1];I.visible!=null&&I.visible!==r.visible&&(r.visible=I.visible);let{textMesh:S}=r;if(S){Object.assign(S,I.getState());let x=(u=I.hoverColor)!=null?u:this.state.text3dHoverColor;S.color=I.hoverByPolygon?x:(d=I.color)!=null?d:bd.color,S.outlineColor=I.hoverByPolygon?x:(h=I.outlineColor)!=null?h:bd.outlineColor,S.strokeColor=I.hoverByPolygon?x:(y=I.strokeColor)!=null?y:bd.strokeColor}I.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};Ru=new WeakSet,Xg=s(async function(r,n,o){if(!(!r||!n.showTextures))if(this.textureLoadingCache.has(r)){o==="topTexture"?n.topTexture=await this.textureLoadingCache.get(r):n.texture=await this.textureLoadingCache.get(r),n.showTextures();return}else{let i=new Promise((a,l)=>{kc.getLoader().load(r,c=>{o==="topTexture"?n.topTexture=c:n.texture=c,n.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{z.error("Failed to load texture: ".concat(r)),l("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,i)}},"#loadTexture"),s(gM,"DrawSystem");var O2=gM;f();var bM=class bM extends Be{constructor(r){super();m(this,"state");m(this,"animating",new Map);m(this,"isAnimating",!1);m(this,"startTime",-1);m(this,"showDuration",300);m(this,"hideDuration",250);m(this,"update",s(()=>{this.animating.clear();let r,n;for(let o of this.state.geometry2DIdsInScene)r=this.state.geometry2DMap.get(o),r&&(n=r.components[0],n instanceof ta&&(n.visibilityNeedsUpdate==="show"?(n.canShow=!0,this.animating.set(n,[n.opacity,1])):n.visibilityNeedsUpdate==="hide"&&this.animating.set(n,[n.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));m(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[o,i]]of this.animating.entries()){let a=i===1?this.showDuration:this.hideDuration,l=(r-this.startTime)/a;n.opacity=jo(l,0,1,o,i,i===0?j9:G9),r-this.startTime>=a&&(i===1?n.canShow=!0:i===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};s(bM,"TwoDVisibilitySystem");var E2=bM;f();var xM=class xM extends Be{constructor(r,n,o,i,a,l,c){super();m(this,"state");m(this,"renderer");m(this,"mode");m(this,"scene");m(this,"cameraObject");m(this,"viewCamera");m(this,"systems");m(this,"needs2DRecompute",!1);m(this,"twoDdirty",!0);m(this,"threeDdirty",!0);m(this,"frameId",null);m(this,"twoDFrameId",null);m(this,"animationFrameId",null);m(this,"nextFrame",null);m(this,"update",s((r=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(r){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise(o=>{this.frameId=requestAnimationFrame(()=>{var i,a;return((i=this.renderer)==null?void 0:i.renderer)==null?o():this.mode==="standalone"?(a=this.commitRenderState())==null?void 0:a.then(()=>{this.paint(),o()}):o()})})},"update"));m(this,"animate2D",s(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));m(this,"drawEntities2D",s(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));m(this,"updateEntities2D",s(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));m(this,"commitRenderState",s(()=>{try{let r=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),R9(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),L9(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let n=this.systems.meshOptimizationSystem.update();n&&r.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),r.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let o=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!o)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(r)}catch(r){z.error("Render failed: ",r)}},"commitRenderState"));this.renderer=r,this.state=n,this.mode=o,this.scene=i,this.cameraObject=a,this.viewCamera=l,this.systems=c,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var r;(r=this.renderer)!=null&&r.renderer&&(this.mode==="standalone"&&this.renderer.clear(),this.renderer.render(this.scene,this.state.useStandaloneCamera||this.mode==="standalone"?this.cameraObject:this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};s(xM,"RenderSystem");var _2=xM;f();var _be=G.object({interactive:G.boolean().optional(),id:G.string().optional(),nearRadius:G.number().optional(),farRadius:G.number().optional(),accentColor:G.string().optional(),displayArrowsOnPath:G.boolean().optional(),animateArrowsOnPath:G.boolean().optional(),nearZoomLevel:G.number().optional(),farZoomLevel:G.number().optional(),visibleThroughGeometry:G.boolean().optional(),dashed:G.boolean().optional()}),kbe=G.object({type:G.enum(["Feature"]),geometry:Em,properties:G.object({parentId:G.any().optional()})});function Gz(e,t){G.object({features:G.array(kbe)}).parse(e),_be.parse(t)}s(Gz,"validatePath");var Yg,vM=class vM{constructor(t,r){m(this,"type","path");m(this,"mesh",new Pi);m(this,"material");m(this,"geometry");m(this,"outline");m(this,"feature");m(this,"options");m(this,"nearRadius",.2);m(this,"farRadius",.4);m(this,"nearZoomLevel");m(this,"farZoomLevel");m(this,"nearZoomAltitude");m(this,"farZoomAltitude");m(this,"accentColor","blue");m(this,"completeFraction",1);m(this,"altitudeAdjustment",1);m(this,"displayArrowsOnPath",!1);m(this,"animateArrowsOnPath",!1);m(this,"visibleThroughGeometry",!1);m(this,"dashed",!1);m(this,"isVertical",!1);m(this,"dirty",!0);m(this,"materialDirty",!0);m(this,"position",new Me);E(this,Yg,0);var n,o,i,a,l,c,u;this.feature=t,this.options=r||{},this.accentColor=(n=r==null?void 0:r.accentColor)!=null?n:this.accentColor,this.nearRadius=(o=r==null?void 0:r.nearRadius)!=null?o:this.nearRadius,this.farRadius=(i=r==null?void 0:r.farRadius)!=null?i:this.farRadius,this.nearZoomLevel=r==null?void 0:r.nearZoomLevel,this.farZoomLevel=r==null?void 0:r.farZoomLevel,this.displayArrowsOnPath=(a=r==null?void 0:r.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(l=r==null?void 0:r.animateArrowsOnPath)!=null?l:this.animateArrowsOnPath,this.visibleThroughGeometry=(c=r==null?void 0:r.visibleThroughGeometry)!=null?c:this.visibleThroughGeometry,this.dashed=(u=r==null?void 0:r.dashed)!=null?u:this.dashed}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return p(this,Yg)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Yg,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Yg=new WeakMap,s(vM,"PathComponent");var Ac=vM;f();var IM=class IM{constructor(t){m(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof at&&t.components[0]){let n=t.components[0];if(n.dirty){for(let o of t.children)(o instanceof Sn||o instanceof at)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));n.dirty=!1}}}};s(IM,"StackSystem");var k2=IM;f();f();f();var kr=Object.freeze({Linear:Object.freeze({None:s(function(e){return e},"None"),In:s(function(e){return e},"In"),Out:s(function(e){return e},"Out"),InOut:s(function(e){return e},"InOut")}),Quadratic:Object.freeze({In:s(function(e){return e*e},"In"),Out:s(function(e){return e*(2-e)},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},"InOut")}),Cubic:Object.freeze({In:s(function(e){return e*e*e},"In"),Out:s(function(e){return--e*e*e+1},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},"InOut")}),Quartic:Object.freeze({In:s(function(e){return e*e*e*e},"In"),Out:s(function(e){return 1- --e*e*e*e},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},"InOut")}),Quintic:Object.freeze({In:s(function(e){return e*e*e*e*e},"In"),Out:s(function(e){return--e*e*e*e*e+1},"Out"),InOut:s(function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},"InOut")}),Sinusoidal:Object.freeze({In:s(function(e){return 1-Math.sin((1-e)*Math.PI/2)},"In"),Out:s(function(e){return Math.sin(e*Math.PI/2)},"Out"),InOut:s(function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))},"InOut")}),Exponential:Object.freeze({In:s(function(e){return e===0?0:Math.pow(1024,e-1)},"In"),Out:s(function(e){return e===1?1:1-Math.pow(2,-10*e)},"Out"),InOut:s(function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},"InOut")}),Circular:Object.freeze({In:s(function(e){return 1-Math.sqrt(1-e*e)},"In"),Out:s(function(e){return Math.sqrt(1- --e*e)},"Out"),InOut:s(function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},"InOut")}),Elastic:Object.freeze({In:s(function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},"In"),Out:s(function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},"Out"),InOut:s(function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:s(function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},"In"),Out:s(function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},"Out"),InOut:s(function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},"InOut")}),Bounce:Object.freeze({In:s(function(e){return 1-kr.Bounce.Out(1-e)},"In"),Out:s(function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},"Out"),InOut:s(function(e){return e<.5?kr.Bounce.In(e*2)*.5:kr.Bounce.Out(e*2-1)*.5+.5},"InOut")}),generatePow:s(function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:s(function(t){return Math.pow(t,e)},"In"),Out:s(function(t){return 1-Math.pow(1-t,e)},"Out"),InOut:s(function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5},"InOut")}},"generatePow")}),Kg=s(function(){return performance.now()},"now"),CM=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return s(e,"Group"),e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(r){return t._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=r;o<i.length;o++){var a=i[o];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},e.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,o=t;n<o.length;n++){var i=o[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=Kg()),r===void 0&&(r=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<n.length;o++){var i=this._tweens[n[o]],a=!r;i&&i.update(t,a)===!1&&!r&&this.remove(i)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),_m={Linear:s(function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=_m.Utils.Linear;return t<0?i(e[0],e[1],n):t>1?i(e[r],e[r-1],r-n):i(e[o],e[o+1>r?r:o+1],n-o)},"Linear"),Bezier:s(function(e,t){for(var r=0,n=e.length-1,o=Math.pow,i=_m.Utils.Bernstein,a=0;a<=n;a++)r+=o(1-t,n-a)*o(t,a)*e[a]*i(n,a);return r},"Bezier"),CatmullRom:s(function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=_m.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(o=Math.floor(n=r*(1+t))),i(e[(o-1+r)%r],e[o],e[(o+1)%r],e[(o+2)%r],n-o)):t<0?e[0]-(i(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(i(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):i(e[o?o-1:0],e[o],e[r<o+1?r:o+1],e[r<o+2?r:o+2],n-o)},"CatmullRom"),Utils:{Linear:s(function(e,t,r){return(t-e)*r+e},"Linear"),Bernstein:s(function(e,t){var r=_m.Utils.Factorial;return r(e)/r(t)/r(e-t)},"Bernstein"),Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:s(function(e,t,r,n,o){var i=(r-e)*.5,a=(n-t)*.5,l=o*o,c=o*l;return(2*t-2*r+i+a)*c+(-3*t+3*r-2*i-a)*l+i*o+t},"CatmullRom")}},Uz=function(){function e(){}return s(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),SM=new CM,xo=function(){function e(t,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=kr.Linear.None,this._interpolationFunction=_m.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Uz.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=SM,SM.add(this))}return s(e,"Tween"),e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,r){if(t===void 0&&(t=Kg()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var i in this._valuesEnd)o[i]=this._valuesEnd[i];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,r,n,o,i){for(var a in n){var l=t[a],c=Array.isArray(l),u=c?"array":typeof l,d=!c&&Array.isArray(n[a]);if(!(u==="undefined"||u==="function")){if(d){var h=n[a];if(h.length===0)continue;for(var y=[l],b=0,I=h.length;b<I;b+=1){var S=this._handleRelativeValue(l,h[b]);if(isNaN(S)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(S)}d&&(n[a]=y)}if((u==="object"||c)&&l&&!d){r[a]=c?[]:{};var x=l;for(var T in x)r[a][T]=x[T];o[a]=c?[]:{};var h=n[a];if(!this._isDynamic){var w={};for(var T in h)w[T]=h[T];n[a]=h=w}this._setupProperties(x,r[a],h,o[a],i)}else(typeof r[a]>"u"||i)&&(r[a]=l),c||(r[a]*=1),d?o[a]=n[a].slice().reverse():o[a]=r[a]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Kg()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Kg()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=kr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=_m.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,r){var n=this,o;if(t===void 0&&(t=Kg()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var i;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*l,u=s(function(){if(n._duration===0||a>c)return 1;var S=Math.trunc(a/l),x=a-S*l,T=Math.min(x/n._duration,1);return T===0&&a===n._duration?1:T},"calculateElapsedPortion"),d=u(),h=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),this._duration===0||a>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,I=this._chainedTweens.length;b<I;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,o){for(var i in n)if(r[i]!==void 0){var a=r[i]||0,l=n[i],c=Array.isArray(t[i]),u=Array.isArray(l),d=!c&&u;d?t[i]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(t[i],a,l,o):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(t[i]=a+(l-a)*o))}},e.prototype._handleRelativeValue=function(t,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?t+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(t){var r=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=r},e.autoStartOnUpdate=!1,e}();var rat=Uz.nextId,oa=SM,nat=oa.getAll.bind(oa),oat=oa.removeAll.bind(oa),iat=oa.add.bind(oa),sat=oa.remove.bind(oa),aat=oa.update.bind(oa);f();f();f();var Vz=s((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),zz=s((e,t)=>new De(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),TM=s((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),Jg=s((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),PM=s((e,t)=>new De((e.x+t.x)/2,(e.y+t.y)/2),"average"),wM=s(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var MM=class MM{constructor(t,r){m(this,"input1");m(this,"input2");m(this,"lastAngle");m(this,"lastDistance");m(this,"totalDistance");m(this,"first");m(this,"second");this.input1=t,this.input2=r,this.lastAngle=TM(t,r),this.lastDistance=Jg(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Jg(t,r);this.input1=t,this.input2=r;let o=TM(t,r);this.lastAngle=o,this.lastDistance=n,this.totalDistance+=(Jg(this.first,t)+Jg(this.second,r))/2,this.first=PM(this.first,t),this.second=PM(this.second,r)}};s(MM,"InputSet");var A2=MM;f();var OM=class OM{constructor(t,r,n){m(this,"touch");m(this,"camera");m(this,"cameraPlane");m(this,"viewCoordinate");m(this,"snapHolderMatrix");m(this,"snapCamera");m(this,"cameraPosition");m(this,"raycaster");m(this,"worldCoordinate");m(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new De(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new ms,this.raycaster.setFromCamera(t,this.snapCamera);let r=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=r&&r.length>0?r[0].point:null,this.snapshotted=!0}updateAnchorState(t,r){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(r),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,o;let t=new De(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let r=(o=this.raycaster)==null?void 0:o.intersectObject(this.cameraPlane,!0)[0];return r?r.point:void 0}};s(OM,"TouchAnchor");var Qg=OM;var gi={};cs(gi,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Dbe,CLIPPING_RADIUS:()=>e1,CONTROL_OPTIONS:()=>Abe,DEFAULT_ANIMATION_DURATION:()=>DM,DEFAULT_BEARING:()=>Bbe,DEFAULT_MAX_ZOOM_LEVEL:()=>Rbe,DEFAULT_MIN_ZOOM_LEVEL:()=>FM,DEFAULT_PITCH:()=>Nbe,DEFAULT_ZOOM_LEVEL:()=>Lbe,EVENTS:()=>R2,MAPLIBRE_TILE_SIZE:()=>D2,MAX_LAT:()=>_M,MAX_MERCATOR_ZOOM_LEVEL:()=>L2,MIN_LAT:()=>EM,MIN_MERCATOR_ZOOM_LEVEL:()=>F2,ROOM_MERCATOR_ZOOM_LEVEL:()=>Fbe,TWO_PI:()=>kM,WHEEL_ZOOM_MULTIPLIER:()=>AM,ZRANGE:()=>km});f();var D2=512,EM=-85.051129,_M=85.051129,e1=1e4,Abe={chain:"chain",cancel:"cancel"},kM=Math.PI*2,km=100,AM=1e4,F2=0,L2=24,Dbe=17,Fbe=20,DM=200,R2=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],Lbe=18,FM=12,Rbe=22,Nbe=0,Bbe=0;f();function Hz(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}s(Hz,"scrubMaterial");function mr(e){for(let t=e.children.length-1;t>=0;t--)mr(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){Hz(t)}):"material"in e&&typeof e.material<"u"&&Hz(e.material)}s(mr,"destroyObject3D");var N2=!1,$be=!1;var B2,$2=class $2 extends Be{constructor(r,n,o,i,a){super();m(this,"dirty",!1);m(this,"zoomDirty",!1);m(this,"rotationDirty",!1);m(this,"panDirty",!1);E(this,B2,FM);m(this,"zoomSpeed",5);m(this,"rotateSpeed",100);m(this,"enabled",!0);m(this,"enableZoom",!0);m(this,"enablePan",!0);m(this,"enablePedestal",!1);m(this,"maxPedestal",1/0);m(this,"minPedestal",0);m(this,"enableRotate",!0);m(this,"minZoomAltitude",0);m(this,"maxZoomAltitude",1/0);m(this,"ignoreZoomLimits",!1);m(this,"zoomFactor",1);m(this,"panBounds",{min:new Me(1/0,1/0),max:new Me(-1/0,-1/0),center:new Me(0,0,0),radius:1/0});m(this,"minTilt",0);m(this,"maxTilt",1.2);m(this,"MOUSE_BUTTONS",{ORBIT:Mb.RIGHT,ZOOM:Mb.MIDDLE,PAN:Mb.LEFT});m(this,"camera");m(this,"scene");m(this,"renderer");m(this,"elevation");m(this,"orbit");m(this,"cameraPlane");m(this,"raycaster",new ms);m(this,"rendererState");m(this,"options");m(this,"state",-1);m(this,"intersection");m(this,"viewState",null);m(this,"tweens",new Map);m(this,"clock",new u9(!0));m(this,"coords",{mouse:new De,rotateStart:new De,rotateEnd:new De,rotateDelta:new De,panStart:new Me,panCameraStart:new Me,panEnd:new Me,panDelta:new Me,initialShiftPos:new De,initialPedestal:0,floorAnchor:new Me});m(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});m(this,"scrollTimer",null);m(this,"lastWheelTime",0);m(this,"resetZoom",!1);m(this,"zoomStart");m(this,"pedestalScaleFactor",1);m(this,"isUserZooming",!1);m(this,"stayInsideBounds",!0);m(this,"userInteracting",!1);m(this,"cameraMoving",!1);m(this,"lastCameraMoveTime",Date.now());m(this,"raycastToFloor",s(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new Me},"raycastToFloor"));m(this,"isUserInteracting",s(()=>this.userInteracting,"isUserInteracting"));m(this,"getPosition",s(()=>new Me(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));m(this,"getPedestal",s(()=>this.orbit.position.z,"getPedestal"));m(this,"pan",s((r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));m(this,"postRender",s(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));m(this,"isCameraMoving",s(()=>this.cameraMoving,"isCameraMoving"));m(this,"lastCameraStoppedMovingTime",s(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));m(this,"setPosition",s((r,n)=>{r===void 0||n===void 0||isNaN(r)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(r,n),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));m(this,"updateCameraPosition",s((r,n)=>{let o=r-this.panBounds.center.x,i=n-this.panBounds.center.y,a=Math.sqrt(o*o+i*i);if(this.stayInsideBounds&&a>this.panBounds.radius){let l=Math.atan2(i,o),c={x:Math.cos(l)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(l)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=r,this.orbit.position.y=n},"updateCameraPosition"));m(this,"tilt",s(r=>{if(isNaN(r))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(r+this.getTilt(),this.maxTilt),this.minTilt):r+this.getTilt();n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));m(this,"zoomIn",s((r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},r,n,o)},"zoomIn"));m(this,"zoomOut",s((r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},r,n,o)},"zoomOut"));m(this,"getRotation",s(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));m(this,"cancelAnimation",s(()=>{let r=Array.from(this.tweens.keys()),n=r[r.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));m(this,"animateCamera",s((r,n,o,i,a,l)=>{let c=P({interruptible:!0},l),u={},d={},h=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(u.x=h.x,d.x=r.position.x),r.position.y!==void 0&&(u.y=h.y,d.y=r.position.y),r.position.z!==void 0&&(u.z=h.z,d.z=r.position.z)),r.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.zoom=r.zoom:d.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:M,end:O}=Bb(this.getRotation(),r.rotation);u.rotation=M,d.rotation=O}r.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.tilt=r.tilt:d.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let y=u.zoom!==d.zoom,b=u.rotation!==d.rotation,I=u.tilt!==d.tilt,S=new xo(u).to(d,v.env.TESTING?0:n).onUpdate(M=>{this.setMulti({x:M.x,y:M.y,z:M.z},M.zoom,M.rotation,M.tilt)}).onComplete(()=>{this.completeTween(S),this.publish("multi-end",{zooming:y,rotating:b,tilting:I}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,S.state=7,this.publish("multi-start",{zooming:y,rotating:b,tilting:I})),this.publish("change")});this.rendererState.tweenGroup.add(S);let x=Array.from(this.tweens.entries()),T=x[x.length-1],w=!1;return T!=null&&(T[1].interruptible?(typeof T[1].cancelledCallback=="function"&&T[1].cancelledCallback(),this.completeTween(T[0])):(w=!0,T[0].chain(S))),this.tweens.set(S,{cancelledCallback:a,interruptible:c.interruptible}),o?S.easing(o):S.easing(kr.Quadratic.In),!r.doNotAutoStart&&!w&&(S.start(),this.publish("change")),S.cameraAnimation=!0,S},"animateCamera"));m(this,"setMulti",s((r,n,o,i,a=!0)=>{this.state===-1&&this.publish("multi-start");let l=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),l=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0),l=!0)),l&&this.publish("position-updated");let c={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let u=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;u!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>e1&&(this.camera.near=n-e1,this.camera.far=n+e1):(this.camera.near=n/km,this.camera.far=n*km),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(c.rotating=!0,this.orbit.rotation.z=-o,this.publish("rotation-updated")),i!==void 0&&!isNaN(i)){let u=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;u!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=u,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)},"setMulti"));m(this,"getZoomScaledMin",s(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));m(this,"getZoomScaledMax",s(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));m(this,"setRotation",s((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=-(r%kM);o!==this.orbit.rotation.z&&(this.orbit.rotation.z=o,n||this.publish("rotation-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));m(this,"setZoomAltitude",s(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(r,this.getZoomScaledMin()),this.getZoomScaledMax()):r;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/km,this.camera.far=n*km,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));m(this,"setZoomLevel",s(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));m(this,"getZoomAltitude",s(()=>this.camera.position.z,"getZoomAltitude"));m(this,"getZoomLevel",s(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));m(this,"setTilt",s((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(r,this.maxTilt),this.minTilt):r;o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,n||this.publish("tilt-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));m(this,"getTilt",s(()=>this.elevation.rotation.x,"getTilt"));m(this,"setCameraPlaneElevation",s(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));m(this,"zoom",s(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-r;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(n,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):n,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));m(this,"getProjectionScaleFactor",s((r,n,o)=>WI(r,n,o),"getProjectionScaleFactor"));m(this,"update",s(()=>{this.orbit.updateMatrixWorld(),this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));m(this,"setPedestal",s((r,n=!1)=>{typeof r=="number"&&!isNaN(r)&&(this.orbit.position.z=r,n&&(this.publishPedestalChangeEvent(r),this.publish("pedestal-change",{pedestal:r})),this.publish("change"),this.dirty=!0)},"setPedestal"));m(this,"dispose",s(()=>{for(let r of R2)r.endsWith("start")?(this.off(r,this.setCameraMoving),r.startsWith("user")&&this.off(r,this.setUserInteracting)):(r.endsWith("end")||r.endsWith("cancel"))&&(this.off(r,this.unsetCameraMoving),r.startsWith("user")&&this.off(r,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));m(this,"createCameraPlane",s(()=>{let r=N2?2e3:1e10,n=N2?100:1,o=new Ci(r,r,n,n),i=new $r({color:0,wireframe:N2,visible:N2}),a=new We(o,i);return this.scene.add(a),a},"createCameraPlane"));m(this,"addEventListeners",s(()=>{let{domElement:r}=this.renderer;for(let n of R2)n.endsWith("start")?(this.on(n,this.setCameraMoving),n.startsWith("user")&&this.on(n,this.setUserInteracting)):(n.endsWith("end")||n.endsWith("cancel"))&&(this.on(n,this.unsetCameraMoving),n.startsWith("user")&&this.on(n,this.unsetUserInteracting));r.addEventListener("contextmenu",this.onContextMenu,!1),r.addEventListener("mousedown",this.onMouseDown,!1),r.addEventListener("wheel",this.onMouseWheel,{passive:!1}),r.addEventListener("touchstart",this.onTouchStart,!1),r.addEventListener("touchend",this.onTouchEnd,!1),r.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));m(this,"addMouseEventListeners",s(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));m(this,"addMouseMoveEventListeners",s(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));m(this,"removeMouseMoveEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));m(this,"removeEventListeners",s(()=>{let{domElement:r}=this.renderer;r.removeEventListener("contextmenu",this.onContextMenu,!1),r.removeEventListener("mousedown",this.onMouseDown,!1),r.removeEventListener("wheel",this.onMouseWheel,!1),r.removeEventListener("touchstart",this.onTouchStart,!1),r.removeEventListener("touchend",this.onTouchEnd,!1),r.removeEventListener("touchmove",this.onTouchMove,!1),r.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));m(this,"removeMouseUpEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));m(this,"onContextMenu",s(r=>{r.preventDefault()},"onContextMenu"));m(this,"onMouseUp",s(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}},"onMouseUp"));m(this,"onMouseMove",s(r=>{if(this.enabled!==!1)if(r.preventDefault(),this.mouseToScene(r),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(r)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(r)},"onMouseMove"));m(this,"onTouchStart",s(r=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(r),r.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(r),this.state=9):this.enablePan&&(this.handleTouchStartPan(r),this.state=6);break;case 2:this.touch.inputs=new A2(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));m(this,"onTouchMove",s(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n=P({},this.touch.inputs.first),o=P({},this.touch.inputs.second),i=new De(this.touch.touches[0].x,this.touch.touches[0].y),a=new De(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(r);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let l=n.y<i.y&&o.y<a.y,c=n.y>i.y&&o.y>a.y;this.enableRotate&&this.state!==4&&(c||l)?(this.handleTouchStartTilt(r),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(r.preventDefault(),r.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(r):this.enablePan&&this.state===6&&this.handleTouchMovePan(r);break;default:this.state=-1}},"onTouchMove"));m(this,"onTouchEnd",s(r=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}r.touches.length?this.onTouchStart(r):this.state=-1}},"onTouchEnd"));m(this,"handleTouchMovePan",s(r=>{let n=Object.hasOwn(r,"x")?new De(r.x,r.y):this.touch.touches[0],o=this.raycastToFloor(n);this.coords.panEnd.set(o.x,o.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleTouchMovePan"));m(this,"handleTouchStartDolly",s(()=>{let r=this.touch.touches[0].x-this.touch.touches[1].x,n=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let o=new De(this.touch.touches[0].x-r/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(o),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Qg(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Qg(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));m(this,"handleMouseMovePan",s(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(r.x,r.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));m(this,"handleTouchStartTilt",s(r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));m(this,"handleTouchMovePedestal",s(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));m(this,"handleTouchMoveTilt",s(r=>{this.coords.rotateEnd.set(r.touches[1].clientX,r.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));m(this,"handleTouchMoveDolly",s(()=>{let r=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:r.x,y:r.y},this.touch.anchor2.viewCoordinate={x:n.x,y:n.y};let o=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);o&&this.setCameraFromTransformMatrix(o),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,r),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));m(this,"handleTouchEnd",s(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));m(this,"handleTouchStartPan",s(r=>{let n=Object.hasOwn(r,"x")?new De(r.x,r.y):this.touch.touches[0],o=this.raycastToFloor(n);this.coords.panStart.set(o.x,o.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));m(this,"handleTouchStartPedestal",s(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));m(this,"onMouseDown",s(r=>{if(this.enabled!==!1){if(this.mouseToScene(r),r.preventDefault(),this.state===3&&this.publish("zoom-end"),r.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(r),this.state=0}else r.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(r),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));m(this,"onMouseWheel",s(r=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(r.preventDefault(),r.stopPropagation(),this.mouseToScene(r),this.canScrollZoom(r)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(r)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(r))},"onMouseWheel"));m(this,"handleMouseWheel",s(r=>{if(this.publish("zoom-start"),!this.canScrollZoom(r)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),o=n-wM(r)*n/AM*this.zoomSpeed;if(this.setZoomAltitude(o),this.enablePan){let i=o/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-i),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));m(this,"setCameraFromTransformMatrix",s(r=>{this.orbit.updateMatrixWorld();let n=new ba;n.setFromRotationMatrix(r,"ZYX");let o=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),i=n.z,a=new Me(0,0,1);a.applyEuler(n),a.setLength(o);let l=new Me;l.setFromMatrixPosition(r),l.sub(a),this.enablePan&&this.setPosition(l.x,l.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-i)},"setCameraFromTransformMatrix"));m(this,"makeTransformFromTouchAnchors",s((r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),i=r.worldCoordinate,a=n.worldCoordinate,l=r.reUnproject(),c=n.reUnproject();if(!l||!c||!i||!a)return null;let u=r.viewCoordinate,d=n.viewCoordinate,h=a.x-i.x,y=a.y-i.y,b=Math.atan2(y,h),I=c.x-l.x,S=c.y-l.y,x=Math.atan2(S,I),T=Vz(b,x),w=new Ii;w.makeRotationZ(-T);let M=w.clone();M.multiply(r.snapHolderMatrix);let O=s((HW,WW,qW)=>HW.elements[(WW-1)*4+qW-1],"m"),_=O(o,1,1)*O(M,1,1)-u.x*O(o,3,4)*O(M,3,1),$=O(o,1,1)*O(M,1,2)-u.x*O(o,3,4)*O(M,3,2),j=O(o,1,1)*O(M,1,3)-u.x*O(o,3,4)*O(M,3,3),F=i.x*_+i.y*$+i.z*j,L=O(o,2,2)*O(M,2,1)-u.y*O(o,3,4)*O(M,3,1),q=O(o,2,2)*O(M,2,2)-u.y*O(o,3,4)*O(M,3,2),U=O(o,2,2)*O(M,2,3)-u.y*O(o,3,4)*O(M,3,3),V=i.x*L+i.y*q+i.z*U,Q=O(o,1,1)*O(M,1,1)-d.x*O(o,3,4)*O(M,3,1),Y=O(o,1,1)*O(M,1,2)-d.x*O(o,3,4)*O(M,3,2),se=O(o,1,1)*O(M,1,3)-d.x*O(o,3,4)*O(M,3,3),re=a.x*Q+a.y*Y+a.z*se,ve=O(o,2,2)*O(M,2,1)-d.y*O(o,3,4)*O(M,3,1),we=O(o,2,2)*O(M,2,2)-d.y*O(o,3,4)*O(M,3,2),ye=O(o,2,2)*O(M,2,3)-d.y*O(o,3,4)*O(M,3,3),Ne=a.x*ve+a.y*we+a.z*ye,nt=Math.abs(Q-_),st=Math.abs(Y-$),qe=Math.abs(se-j),Ye=Math.abs(Q-L),de=Math.abs(Y-q),ge=Math.abs(se-U),me=Math.abs(ve-_),oe=Math.abs(we-$),D=Math.abs(ye-j),K=Math.abs(ve-L),N=Math.abs(we-q),pe=Math.abs(ye-U),le=Math.min(nt+st+qe,Ye+de+ge),ce=Math.min(me+oe+D,K+N+pe);le<ce&&(Q=ve,Y=we,se=ye,re=Ne);let Ce=L*j-_*U,pr=q*j-$*U,Bn=V*j-F*U,rn=Q*U-L*se,In=Y*U-q*se,tp=re*U-V*se,DI=(tp*pr-Bn*In)/(rn*pr-Ce*In),FI=(tp*Ce-Bn*rn)/(In*Ce-pr*rn),B6=q*_-$*L,UW=U*_-j*L,VW=V*_-F*L,$6=Y*L-q*Q,zW=se*L-U*Q,j6=((re*L-V*Q)*B6-VW*$6)/(zW*B6-UW*$6),Pb=M.clone();return Pb.elements[12]=DI,Pb.elements[13]=FI,Pb.elements[14]=j6,j6>0?Pb:null},"makeTransformFromTouchAnchors"));m(this,"updateTouchOrigin",s(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));m(this,"touchToScene",s(r=>{this.touch.touches=[];for(let n=0,o=r.touches.length;n<o;n++){let i=r.touches[n],a=zz(i,this.touch.origin);this.touch.touches.push(new De(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));m(this,"canScrollZoom",s(r=>{let n=wM(r),o=this.getZoomAltitude();return!(n<0&&o===this.getZoomScaledMax()||n>0&&o===this.getZoomScaledMin())},"canScrollZoom"));m(this,"mouseToScene",s(r=>{let n=this.getMousePos(r);return this.coords.mouse.x=n.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(n.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));m(this,"getMousePos",s(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));m(this,"handleMouseDownRotate",s(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));m(this,"handleMouseDownPan",s(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(r.x,r.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));m(this,"handleMouseDownPedestal",s(r=>{let n=new De(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=WI(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));m(this,"handleMouseMovePedestal",s(r=>{let n={x:r.clientX,y:r.clientY},o=this.coords.initialPedestal+this.pedestalScaleFactor*(n.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(o<this.minPedestal?o=Math.max(o,this.minPedestal):o>this.maxPedestal&&(o=Math.min(o,this.maxPedestal))),o!==this.getPedestal()&&this.setPedestal(o,!0)},"handleMouseMovePedestal"));m(this,"handleMouseMoveRotate",s(r=>{this.coords.rotateEnd.set(r.clientX,r.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));m(this,"publishUserZoomDebounced",gd(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));m(this,"publishUserZoomEvent",s(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));m(this,"setCameraMoving",s(()=>{this.cameraMoving=!0},"setCameraMoving"));m(this,"unsetCameraMoving",s(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));m(this,"setUserInteracting",s(()=>{this.userInteracting=!0},"setUserInteracting"));m(this,"unsetUserInteracting",s(()=>{this.userInteracting=!1},"unsetUserInteracting"));m(this,"publishPedestalChangeEvent",s(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));m(this,"convertAltitudeToZoomLevel",s(r=>{let[,n]=this.center,i=r*2*Math.tan(et.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(et.degToRad(n))*2*Math.PI*LI/i;return et.clamp(Math.log2(a/512),F2,L2)},"convertAltitudeToZoomLevel"));m(this,"convertZoomLevelToAltitude",s(r=>{let[,n]=this.center,o=et.clamp(r,F2,L2),i=Math.pow(2,o),a=et.clamp(n,EM,_M),l=i*512;return Math.cos(et.degToRad(a))*Math.PI*2*LI/l*this.options.canvasHeight/2/Math.tan(et.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));m(this,"completeTween",s(r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));m(this,"debugContainer",new xa);this.camera=r,this.renderer=o,this.rendererState=i,this.scene=n,this.options=a,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r)}get defaultMinZoomLevel(){return p(this,B2)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r)}get scrollPercent(){let r=this.minPedestal,n=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,n),o=Math.max(o,r),(o-r)/(n-r)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var i,a,l,c;let r=this.getPosition(),{lat:n,lon:o}=Ub((a=(i=this.rendererState.center)==null?void 0:i[1])!=null?a:0,(c=(l=this.rendererState.center)==null?void 0:l[0])!=null?c:0,r.x,r.y);return[o,n]}setCenter(r,n){var a,l,c,u;let{x:o,y:i}=Vb((l=(a=this.rendererState.center)==null?void 0:a[1])!=null?l:0,(u=(c=this.rendererState.center)==null?void 0:c[0])!=null?u:0,n,r);this.setPosition(o,i)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let o=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,i=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,a=this.options.canvasWidth,l=this.options.canvasHeight,c=this.getRotation(),u=this.getTilt(),d=this.getPosition();this.setRotation(n.rotation||c,!0),this.setTilt(n.tilt||u,!0);let h=Wz(r,{canvasWidth:a,canvasHeight:l,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:o,maxZoom:i,position:d,camera:this.camera,orbit:this.orbit});return this.setRotation(c,!0),this.setTilt(u,!0),{center:h.position,zoomLevel:this.convertAltitudeToZoomLevel(h.zoom)}}focusOn(r,n){if($be){this.debugContainer&&mr(this.debugContainer);let x=new Si(4,4,4),T=new $r({color:65280,depthTest:!1}),w=new jl(x,T,r.length),M=new Ii;r.forEach((O,_)=>{M.setPosition(O),w.setMatrixAt(_,M)}),w.instanceMatrix.needsUpdate=!0,this.debugContainer.add(w),this.scene.add(this.debugContainer)}let o=n.curve,i=n.callback,a=n.cancelledCallback,l=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,c=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,d=this.options.canvasHeight,h;n.duration!==void 0?h=n.duration:v.env.TESTING==="true"?h=0:h=DM;let y=n.padding,b=this.getRotation(),I=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let S=Wz(r,{canvasHeight:d,paddingOption:y,canvasWidth:u,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(b),this.setTilt(I),this.animateCamera({position:S.position,tilt:n.tilt,rotation:n.rotation,zoom:S.zoom},h,o,i,a,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};B2=new WeakMap,s($2,"CameraSystem"),m($2,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Am=$2;function Wz(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:o=0,canvasHeight:i,minZoom:a,maxZoom:l,camera:c,position:u}){let d={zoom:a,position:u};if(e.length===0)return d;for(let Ce of Am.CAMERA_FRAME_PADDING_SIDES)typeof n[Ce]!="number"&&(n[Ce]=0);let h=n.type==="portion"?{top:n.top*i,bottom:n.bottom*i,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(h.left+h.right>=t||h.top+h.bottom>=i)return d;r.updateMatrixWorld();let y=c.matrixWorldInverse,b=c.fov*(Math.PI/180)/2,I=b,x=Math.atan(Math.tan(b)*(t/i)),T=new Me(1/0,1/0,1/0),w=new Me(-1/0,-1/0,-1/0),M=new Jr,O=new Me;for(let Ce=0,pr=e.length;Ce<pr;Ce++)O.copy(e[Ce]),M.expandByPoint(O),O.applyMatrix4(y),T.min(O),w.max(O),O.copy(e[Ce]),O.z-=o,O.applyMatrix4(y),T.min(O),w.max(O),O.copy(e[Ce]),O.z+=o,O.applyMatrix4(y),T.min(O),w.max(O);let _=w.x-T.x,$=w.y-T.y,j=t-h.left-h.right,F=i-h.top-h.bottom,L=(w.x+T.x)/2,q=(w.y+T.y)/2,U=_/j,V=$/F,Q=a,Y=l,se=Q*Math.tan(x)*2,re=Y*Math.tan(x)*2,ve=se/t,we=re/t,ye=Math.max(U,V);ye=et.clamp(ye,ve,we);let Ne=j*ye,nt=F*ye,st={min:{x:L-Ne/2-h.left*ye,y:q-nt/2-h.bottom*ye},max:{x:L+Ne/2+h.right*ye,y:q+nt/2+h.top*ye}},qe=(st.min.x+st.max.x)/2,Ye=(st.min.y+st.max.y)/2,de=M.getCenter(new Me),ge=Math.abs(qe-st.min.x),me=Math.abs(Ye-st.min.y),oe=ge/Math.tan(x),D=me/Math.tan(I),K=new Me;K.set(qe,Ye,w.z+Math.max(oe,D)),K.applyMatrix4(c.matrixWorld);let N=new Me;N.set(qe,Ye,w.z),N.applyMatrix4(c.matrixWorld);let pe=new Me().subVectors(N,K),le=(de.z-K.z)/pe.z,ce=new Me().copy(K).add(pe.clone().multiplyScalar(le));return N.set(ce.x,ce.y,ce.z),K.sub(N),{position:ce,zoom:K.length()}}s(Wz,"getCameraFrameForPoints");f();var jbe=300,t1,r1,LM=class LM{constructor(t){m(this,"state");E(this,t1,new Me);E(this,r1,new Me);this.state=t}update(t){var o;let r,n;this.state.cameraObject.getWorldPosition(p(this,r1));for(let i of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(i),r&&(n=r.components[0],n&&"containerEl"in n&&n.markerContainer!=null)){if(n.visibilityNeedsUpdate!==!1&&(n.visibilityNeedsUpdate==="show"?n.canShow=!0:n.canShow=!1),(n.canShow&&n.visible===!0||((o=n.animation)==null?void 0:o.pending)===!0)&&!n.offscreen)if(n.options.zIndex!=null)n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(n.options.zIndex,"px)");else{r.object3d.getWorldPosition(p(this,t1));let a=p(this,r1).distanceTo(p(this,t1));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-a,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:jbe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};t1=new WeakMap,r1=new WeakMap,s(LM,"DOMDrawSystem");var j2=LM;f();var RM=class RM{constructor(){m(this,"percentExpanded",0);m(this,"activeId","");m(this,"gap",20);m(this,"dirty",!0)}};s(RM,"StackComponent");var G2=RM;f();var NM=class NM extends Be{constructor(r,n){super();m(this,"state");m(this,"dirty",!0);m(this,"domTree");m(this,"observers",new Map);m(this,"updateDimensions",s(r=>{r.forEach(n=>{var a;let i=(a=n.target.parentElement)==null?void 0:a.getAttribute("data-marker-id");if(i){let l=this.state.geometry2DMap.get(i),c=l==null?void 0:l.components[0];l&&c instanceof ea&&(c.updateDimensions(n.contentRect.width,n.contentRect.height),c.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=r,this.domTree=n}setupObserver(){var o;if(this.observers){for(let i of this.observers.values())i.disconnect();this.observers.clear()}let r,n;for(let i of this.domTree.children){let a=i.getAttribute("data-marker-id");if(a!=null&&(r=this.state.geometry2DMap.get(a),n=r.components[0],(o=n.options)!=null&&o.dynamicResize)){let l=new ResizeObserver(this.updateDimensions);l.observe(n.containerEl),this.observers.set(i.userData.entityId,l)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};s(NM,"DOMResizeSystem");var U2=NM;f();var Gbe=0,Ube=90,Vbe=(v.env.NODE_ENV==="test",!1),gl={linear:kr.Linear.None,"ease-in":kr.Quadratic.In,"ease-out":kr.Quadratic.Out,"ease-in-out":kr.Quadratic.InOut},zbe=-50,Ee,Ue,Dc,n1,o1,$M,jM=class jM{constructor(t,r,n){E(this,o1);E(this,Ee);E(this,Ue);E(this,Dc);E(this,n1);A(this,Ee,t),A(this,Ue,r),A(this,Dc,n),p(this,Ue).cameraSystem.on("pedestal-change",({pedestal:o})=>{p(this,Ee).map&&(p(this,Ee).map.transform.elevation=o,p(this,Ee).map.transform.minElevationForCurrentTile=zbe,p(this,Ee).map.triggerRepaint()),p(this,Ue).cameraSystem.setCameraPlaneElevation(o)})}get center(){return p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?p(this,Ee).map.getCenter().toArray():p(this,Ue).cameraSystem.center}setCenter(t){var r;if(p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map){(r=p(this,Ee).map)==null||r.setCenter(t),p(this,Ue).interactionSystem.handleHover();return}p(this,Ue).cameraSystem.setCenter(t[0],t[1]),p(this,Ue).interactionSystem.handleHover()}get zoomLevel(){var t;return p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?(t=p(this,Ee).map)==null?void 0:t.getZoom():p(this,Ue).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map&&((r=p(this,Ee).map)==null||r.setZoom(t)),p(this,Ue).cameraSystem.setZoomLevel(hs(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return p(this,Ue).cameraSystem.isAnimating}cancelAnimation(){p(this,Ue).cameraSystem.cancelAnimation()}get maxZoomLevel(){return p(this,Ue).cameraSystem.maxZoomLevel}get minZoomLevel(){return p(this,Ue).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){p(this,Ue).panBoundsSystem.autoMinZoomLevel=t,t&&(p(this,Ue).panBoundsSystem.dirty=!0,p(this,Ue).panBoundsSystem.update())}get autoMinZoomLevel(){return p(this,Ue).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var o;r&&this.setAutoMinZoomLevel(!1);let n=hs(t,gi.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(gi.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));p(this,Ue).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(o=p(this,Ee).map)==null||o.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=hs(t,this.minZoomLevel,gi.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(gi.MAX_MERCATOR_ZOOM_LEVEL,"."));p(this,Ue).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=p(this,Ee).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?(t=p(this,Ee).map)==null?void 0:t.getMaxPitch():et.radToDeg(p(this,Ue).cameraSystem.maxTilt)}get minPitch(){var t;return p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?(t=p(this,Ee).map)==null?void 0:t.getMinPitch():et.radToDeg(p(this,Ue).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(Gbe,t);(n=p(this,Ee).map)==null||n.setMinPitch(r),p(this,Ue).cameraSystem.minTilt=et.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(Ube,t);(n=p(this,Ee).map)==null||n.setMaxPitch(r),p(this,Ue).cameraSystem.maxTilt=et.degToRad(r)}get bearing(){var t;return p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?(t=p(this,Ee).map)==null?void 0:t.getBearing():et.radToDeg(p(this,Ue).cameraSystem.getRotation())}setBearing(t){var r;if(p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map){(r=p(this,Ee).map)==null||r.setBearing(t);return}p(this,Ue).cameraSystem.setRotation(et.degToRad(t))}get pitch(){var t;return p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?(t=p(this,Ee).map)==null?void 0:t.getPitch():et.radToDeg(p(this,Ue).cameraSystem.getTilt())}setPitch(t){var r;if(p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map){(r=p(this,Ee).map)==null||r.setPitch(t);return}p(this,Ue).cameraSystem.setTilt(et.degToRad(hs(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return p(this,Ue).cameraSystem.getPedestal()}setElevation(t){p(this,Ue).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return p(this,n1)&&p(this,n1).stop(),new Promise(n=>{var i;let o=p(this,Ue).cameraSystem.getPosition();o.z=t,p(this,Ue).cameraSystem.animateCamera({position:o},(r==null?void 0:r.duration)||300,gl[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(i=r==null?void 0:r.interruptible)!=null?i:!0})})}get insetsPadding(){return p(this,Dc).insetsPadding}get panMode(){return p(this,Ue).cameraSystem.enablePan===!1&&p(this,Ue).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(p(this,Ue).cameraSystem.enablePan=!0,p(this,Ue).cameraSystem.enablePedestal=!1):(p(this,Ue).cameraSystem.enablePan=!1,p(this,Ue).cameraSystem.enablePedestal=!0))}setInsetPadding(t){p(this,Dc).insetsPadding=Object.assign({},Ph,t)}animateTo(t){var a,l,c,u,d,h;if(p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map)return(h=p(this,Ee).map)==null||h.flyTo({center:(a=t.center)!=null?a:this.center,zoom:(l=t.zoomLevel)!=null?l:this.zoomLevel,bearing:(c=t.bearing)!=null?c:this.bearing,pitch:(u=t.pitch)!=null?u:this.pitch,duration:(d=t.duration)!=null?d:600}),Promise.resolve();let r=t.center?p(this,Ee).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?p(this,Ue).cameraSystem.convertZoomLevelToAltitude(hs(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,o=t.bearing!==void 0?et.degToRad(t.bearing):void 0,i=t.pitch!==void 0?et.degToRad(hs(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(y=>{var b;p(this,Ue).cameraSystem.animateCamera({position:r,zoom:n,rotation:o,tilt:i},t.duration||0,gl[t.easing||"ease-in-out"],()=>{p(this,Ue).interactionSystem.handleHover(),y()},y,{interruptible:(b=t==null?void 0:t.interruptible)!=null?b:!0})})}getCameraFrameForCoordinates(t,r){let n=te(this,o1,$M).call(this,r||{},()=>Promise.resolve()),{pointCloud:o}=qz(t,p(this,Ee),p(this,Dc).geometry3DMap);if(o.length===0)return z.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:a}=p(this,Ue).cameraSystem.getCameraFrameForCoordinates(o,n);return{center:p(this,Ee).convert3DMapPositionToCoordinate(i),zoomLevel:a}}focusOn(t,r){var a,l,c,u;let{pointCloud:n,geoBounds:o,firstPosition:i}=qz(t,p(this,Ee),p(this,Dc).geometry3DMap);return n.length===0?(z.error("No valid coordinates found in targets:",t),Promise.resolve()):p(this,Ee).mode==="outdoors-overlay"&&p(this,Ee).map?(n.length===1&&i?(a=p(this,Ee).map)==null||a.flyTo({center:[i[0],i[1]],duration:(r==null?void 0:r.duration)||p(this,Ee).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?p(this,Ee).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?p(this,Ee).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||p(this,Ee).map.getMaxZoom()}):(Vbe&&Hbe(p(this,Ee),o),(u=p(this,Ee).map)==null||u.fitBounds(o,{duration:(l=r==null?void 0:r.duration)!=null?l:gi.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?p(this,Ee).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?p(this,Ee).map.getPitch():r==null?void 0:r.pitch,maxZoom:(c=r==null?void 0:r.maxZoomLevel)!=null?c:p(this,Ee).map.getMaxZoom()})),p(this,Ue).interactionSystem.handleHover(),Promise.resolve()):new Promise(d=>{p(this,Ue).cameraSystem.focusOn(n,te(this,o1,$M).call(this,r||{},d))})}};Ee=new WeakMap,Ue=new WeakMap,Dc=new WeakMap,n1=new WeakMap,o1=new WeakSet,$M=s(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:p(this,Ue).cameraSystem.convertZoomLevelToAltitude(hs(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:p(this,Ue).cameraSystem.convertZoomLevelToAltitude(hs(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},Ph,t==null?void 0:t.padding):this.insetsPadding,curve:gl[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:et.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?et.degToRad(hs(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:s(()=>{p(this,Ue).interactionSystem.handleHover(),r()},"callback"),cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),s(jM,"Camera");var V2=jM;function BM(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}s(BM,"updateBounds");function qz(e,t,r){var l;let n=[],o=[1/0,1/0,-1/0,-1/0],i=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:o,firstPosition:i};let a=t.getSystems().renderSystem;(a.threeDdirty||a.twoDdirty)&&t.renderSync();for(let c of e)if(typeof c=="string"){let u=r.get(c);if(!u){z.error("Entity not found with id:",c);continue}let d=new Jr;k9(t,"userData"in u&&(l=u.userData.entityId)!=null?l:u.id,n,d,u instanceof at?u.position.z:void 0);let h=t.convert3DMapPositionToCoordinate(d.min),y=t.convert3DMapPositionToCoordinate(d.max);BM(o,h),BM(o,y),i||(i=t.convert3DMapPositionToCoordinate(d.getCenter(new Me)))}else n.push(t.convertTo3DMapPosition(c[1],c[0],c[2]||0)),BM(o,c),i||(i=c);return{pointCloud:n,geoBounds:o,firstPosition:i}}s(qz,"processTargets");function Hbe(e,t){var n,o,i,a;let r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=e.map)!=null&&n.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),(o=e.map)!=null&&o.getSource("bounds-source")&&e.map.removeSource("bounds-source"),(i=e.map)==null||i.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(a=e.map)==null||a.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}s(Hbe,"drawBounds");f();f();var Zz="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";f();var Xz="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";f();var Yz=4.291666666666667,Kz=15,Jz=25,Qz=43/60;f();var eH=["horizontal","icon"],Wbe=new Map([[eH[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[eH[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),qbe=/<svg([^>]*)>/g;function tH(e,t,r,n){let o=Wbe.get(e);return o?o.replace(qbe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}s(tH,"getLogoIcon");var rH=!1,Ht,bl,Dm,Xr,Qn,Nu,Ji,ia,GM=class GM extends Be{constructor(r,n,o){super();E(this,Ht,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:s(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});E(this,bl);E(this,Dm);E(this,Xr);E(this,Qn);E(this,Nu);E(this,Ji,0);E(this,ia,0);m(this,"dirty",!0);m(this,"getPositionAlignedCanvasCoordinates",s((r,n)=>({"top-left":{x:0,y:0},"top-right":{x:r,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:r,y:n},center:{x:r/2,y:n/2},top:{x:r/2,y:0},bottom:{x:r/2,y:n},left:{x:0,y:n/2},right:{x:r,y:n/2}})[p(this,Ht).position],"getPositionAlignedCanvasCoordinates"));m(this,"getPositionAlignedPadding",s(()=>{var o,i,a,l;let r=p(this,Ht).padding;if(typeof r=="number")return{"top-left":{x:r,y:r},"top-right":{x:-r,y:r},"bottom-left":{x:r,y:-r},"bottom-right":{x:-r,y:-r},center:{x:0,y:0},top:{x:0,y:r},bottom:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0}}[p(this,Ht).position];let n={top:(o=r.top)!=null?o:0,right:(i=r.right)!=null?i:0,bottom:(a=r.bottom)!=null?a:0,left:(l=r.left)!=null?l:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));o&&Object.entries(o).forEach(([i,a])=>{a!==void 0&&(p(this,Ht)[i]=a)}),A(this,Dm,r),A(this,bl,n)}get color(){return p(this,Ht).color==="light"?"white":"#293136"}get iconName(){return p(this,Ht).iconOnly?"icon":"horizontal"}get minWidth(){return p(this,Ht).iconOnly?Kz:75}get defaultWidth(){return p(this,Ht).iconOnly?Jz:150}get aspectRatio(){return p(this,Ht).iconOnly?Qz:Yz}get options(){return P({},p(this,Ht))}set options(r){var n,o;A(this,Ht,{padding:r.padding||p(this,Ht).padding,position:r.position||p(this,Ht).position,iconOnly:r.iconOnly||p(this,Ht).iconOnly,color:r.color||p(this,Ht).color,scale:r.scale||p(this,Ht).scale,onClick:p(this,Ht).onClick,interactive:(n=r.interactive)!=null?n:p(this,Ht).interactive,visible:(o=r.visible)!=null?o:p(this,Ht).visible})}get icon(){return tH(this.iconName,this.color,p(this,Ji)*p(this,bl).pixelRatio,p(this,ia)*p(this,bl).pixelRatio)}setSize(r,n){p(this,Qn)&&(p(this,Qn).uniforms.uSize.value.x=r,p(this,Qn).uniforms.uSize.value.y=n)}setXY(r,n){p(this,Qn)&&(p(this,Qn).uniforms.uSize.value.w=r,p(this,Qn).uniforms.uSize.value.z=n)}get width(){return p(this,Ji)}get height(){return p(this,ia)}getPositionAlignedOffset(r,n){return{"top-left":{x:0,y:0},"top-right":{x:-r,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-r,y:-n},center:{x:-(r/2),y:-(n/2)},top:{x:-(r/2),y:0},bottom:{x:-(r/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-r,y:-(n/2)}}[p(this,Ht).position]}insertIntoQuadTree(r){p(this,Nu)!=null&&typeof p(this,Ht).onClick=="function"&&p(this,Ht).interactive&&r.insert(p(this,Nu))}resize(r,n){if(p(this,Ht).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(r,n),i=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(p(this,Ji),p(this,ia)),l=Math.min(r-p(this,Ji),Math.max(0,o.x+i.x+a.x)),c=Math.min(n-p(this,ia),Math.max(0,o.y+i.y+a.y));this.setSize(p(this,Ji)/r,p(this,ia)/n),this.setXY(l/r,c/n),A(this,Nu,new Wr(l,c,p(this,Ji),p(this,ia),{entityId:"watermark"}))}update(){this.dirty&&(p(this,Ht).visible===!0?(A(this,Ji,Math.min(p(this,bl).canvasWidth,Math.max(this.minWidth,this.defaultWidth*p(this,Ht).scale))),A(this,ia,p(this,Ji)/this.aspectRatio),kc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(A(this,Qn,new Bl({uniforms:{uTexture:{value:r},uSize:{value:new e9(0,0,0,0)},uOpacity:{value:.7}},vertexShader:Zz,fragmentShader:Xz,depthWrite:!1,depthTest:!1,defines:{debug:rH},wireframe:rH,transparent:!0,visible:!0})),p(this,Xr))p(this,Xr).visible=!0,p(this,Xr).material=p(this,Qn),p(this,Xr).material.needsUpdate=!0;else{let n=new Ci(2,2,1,1);A(this,Xr,new We(n,p(this,Qn))),p(this,Xr).position.set(0,0,-1),p(this,Xr).frustumCulled=!1,p(this,Xr).renderOrder=999;let o=new Si(1,1,1),i=new We(o,new $r({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),p(this,Xr).add(i),p(this,Dm).add(p(this,Xr))}this.resize(p(this,bl).canvasWidth,p(this,bl).canvasHeight),this.publish("texture-loaded")})):p(this,Xr)&&(p(this,Xr).visible=!1),this.dirty=!1)}destroy(){p(this,Xr)&&(p(this,Dm).remove(p(this,Xr)),mr(p(this,Xr))),A(this,Xr,void 0),p(this,Qn)&&p(this,Qn).dispose(),A(this,Qn,void 0),A(this,Nu,void 0)}};Ht=new WeakMap,bl=new WeakMap,Dm=new WeakMap,Xr=new WeakMap,Qn=new WeakMap,Nu=new WeakMap,Ji=new WeakMap,ia=new WeakMap,s(GM,"WatermarkSystem");var z2=GM;f();var H2=100,Ybe=!1,UM=class UM extends Be{constructor(r,n){super();m(this,"currentTotalBoundingBox");m(this,"state");m(this,"cameraSystem");m(this,"debugMesh",null);m(this,"dirty",!0);m(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Jr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new Me(0,0,0),new Me(H2*2,H2*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(H2)));let r=new Jr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new Me),o=Math.max(n.x,n.y,n.z);for(let a of this.state.geometry2DMap.values())a.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(a.position),a.positionDirty=!1);let i=W2.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,H2)).getBoundingSphere(Kbe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new Me),min:W2.min,max:W2.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,Ybe&&this.state.entityScene.parent instanceof $l){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new xa,this.debugMesh.add(new We(new Fb(this.cameraSystem.panBounds.radius),new $r({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let a=new Me;W2.getSize(a);let l=new Si(a.x,a.y,a.z),c=new $r({color:65280,wireframe:!0,transparent:!0,opacity:.5}),u=new We(l,c);u.position.copy(this.currentTotalBoundingBox.getCenter(new Me)),this.debugMesh.add(u)}}}};s(UM,"PanBoundsSystem");var q2=UM,W2=new Jr,Kbe=new r9;f();var nH="\xA9 Mappedin",Jbe="https://info.mappedin.com/feedback",zM=["top-left","top-right","bottom-left","bottom-right"],Qbe=640,e0e=s(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),VM={custom:[],position:"bottom-right",feedback:!0},HM=class HM{constructor(t){m(this,"controlContainerEl");m(this,"controlPositions");m(this,"compact");m(this,"attribContainerEl");m(this,"attribInnerEl");m(this,"attribButtonEl");m(this,"feedbackLinkEl");m(this,"attribHTML",nH);m(this,"customAttributions",[]);m(this,"toggleAttribution",s(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=zM.reduce((r,n)=>{let o=document.createElement("div");return o.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(o),r[n]=o,r},{})}addAttributionControl(t=VM){var o;let r=t.position&&zM.includes(t.position)?t.position:VM.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[r].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=e0e(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((o=t.feedback)!=null?o:VM.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=Jbe,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let r=[nH],n=t.style.sourceCaches;for(let o in n){let i=n[o];if(i.used||i.usedForTerrain){let a=i.getSource();a.attribution&&r.indexOf(a.attribution)<0&&r.push(a.attribution)}}r=r.filter(o=>String(o).trim()),r=r.filter((o,i)=>{for(let a=i+1;a<r.length;a++)if(r[a].indexOf(o)>=0)return!1;return!0}),this.attribHTML=r.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=Qbe||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};s(HM,"HTMLControlsSystem");var Z2=HM;f();var i1,s1,WM=class WM{constructor(t,r){m(this,"mesh");m(this,"type","custom-geometry");m(this,"dirty",!0);m(this,"feature");m(this,"builder");m(this,"outline");E(this,i1,1);m(this,"color",new Rt);E(this,s1,0);this.mesh=new Pi,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){A(this,i1,t)}get opacity(){return p(this,i1)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return p(this,s1)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,s1,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};i1=new WeakMap,s1=new WeakMap,s(WM,"CustomGeometryComponent");var Fm=WM;f();var qM=class qM{constructor(t,r){m(this,"state");m(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(n);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],r=o.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(i=>{i.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};s(qM,"CustomGeometrySystem");var X2=qM;f();f();function oH(e){return e.children.some(t=>t.userData.isOutline)}s(oH,"hasOutline");var n0e=80,Bu,Lm,K2,J2,ZM=class ZM{constructor(t){m(this,"rendererState");m(this,"outlineOpacitiesDirty",!0);E(this,Bu,!0);E(this,Lm,-1/0);E(this,K2,new Map);E(this,J2,new NI({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:Ob}));this.rendererState=t}get geometries3DDirty(){return p(this,Bu)}set geometries3DDirty(t){A(this,Bu,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DMap.values())if(i instanceof at&&(i.visible||i.userData.preloadGeometry)){for(let a of i.children)if(a instanceof Sn&&a.components[0].outline&&(a.visible||i.userData.preloadGeometry)&&!oH(a)&&a.userData.entities3D.size>0)for(let l of a.userData.entities3D.values()){let c=this.rendererState.geometry3DMap.get(l),u=[];if(c instanceof Ot&&c.type==="geometry"&&c.components[3]&&c.components[3].dirty===!0&&c.components[0].geometry!=null&&c.components[0].material!=null){let x=c.components[0].geometry;if(!x)continue;u.push([c.components[3],new BI(x,n0e)])}if(u.length===0)continue;let d=Go(u.map(x=>x[1]),!1);if(d==null)continue;let h=d.getAttribute("position"),y=new Float32Array(h.count*4),b=new va(y,4);d.setAttribute("color",b);let I=0;for(let x=0;x<u.length;x++){let[T,w]=u[x],M=w.getAttribute("position").count;T.edgeColors=b,T.geometry=d,T.ranges={count:M,start:I},I+=M,w.dispose()}let S=new dd(d,p(this,J2));S.userData.isOutline=!0,a.add(S)}}A(this,Bu,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof Ot&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].geometry!=null&&a.components[0].material!=null&&a.parentObject3D instanceof Sn){let l=a.components[3].geometry;if(!l)continue;let c=a.components[3];if(!c)continue;let u=c.edgeColors;if(!u)continue;let d=new Rt(c.color);for(let S=0;S<c.ranges.count;S++){let x=c.ranges.start+S;u.setXYZ(x,d.r,d.g,d.b)}let h=a.components[1].height,b=l.getAttribute("position").array,I=-1/0;for(let S=0;S<c.ranges.count;S++){let T=(c.ranges.start+S)*3,w=b[T+2];I=Math.max(I,w)}for(let S=0;S<c.ranges.count;S++){let T=(c.ranges.start+S)*3,w=b[T+2];Math.abs(w-I)<1e-4&&(b[T+2]=Math.max(h,2e-4))}l.attributes.color.needsUpdate=!0,l.attributes.position.needsUpdate=!0,c.dirty=!1}}let o=r?jo(t,16,19,0,1):p(this,Lm);if((o!==p(this,Lm)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof yr){let a=n.components[3];if(a&&a.edgeColors&&a.geometry){let l=a.visible,c=Math.min(o,l?n.components[1].opacity*sp(n):0);if(a.currentOpacity!==c){for(let u=0;u<a.ranges.count;u++){let d=a.ranges.start+u;a.edgeColors.setW(d,c)}a.geometry.attributes.color.needsUpdate=!0}}}}A(this,Lm,o),A(this,Bu,!1),this.outlineOpacitiesDirty=!1}destroy(){p(this,K2).clear()}};Bu=new WeakMap,Lm=new WeakMap,K2=new WeakMap,J2=new WeakMap,s(ZM,"OutlineInterpolationSystem");var Y2=ZM;f();f();var XM=class XM extends We{constructor(){super(...arguments);m(this,"userData",{entityId:""})}};s(XM,"EntityMesh");var Q2=XM,o0e=G.object({flipImageToFaceCamera:G.boolean().optional(),url:G.string()}),i0e=G.object({type:G.enum(["Feature"]),properties:G.object({width:G.number(),height:G.number(),rotation:G.number().min(0).max(360).optional(),verticalOffset:G.number().optional()}),geometry:Em});function iH(e,t,r){G.union([G.number(),G.string()]).parse(e),i0e.parse(t),o0e.parse(r)}s(iH,"validateImage");var YM=class YM{constructor(t){m(this,"mesh",new Pi);m(this,"imageMesh");m(this,"outline");m(this,"type","image");m(this,"instanceIndex",-1);m(this,"geometry");m(this,"material");m(this,"feature");m(this,"position",new Me);this.feature=t}get visible(){var t,r;return(r=(t=this.mesh)==null?void 0:t.visible)!=null?r:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};s(YM,"ImageComponent");var eI=YM;f();function KM(e,t){return{x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)}}s(KM,"rotatePoint");function s0e(e,t){return e.map(r=>KM(r,t))}s(s0e,"rotatePoints");function a0e(e){let t=1/0,r=1/0,n=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),o=Math.max(o,i.y);return{minX:t,minY:r,maxX:n,maxY:o}}s(a0e,"getBounds");function l0e(e,t){let r=!1;for(let n=0,o=t.length-1;n<t.length;o=n++){let i=t[n].x,a=t[n].y,l=t[o].x,c=t[o].y;a>e.y!=c>e.y&&e.x<(l-i)*(e.y-a)/(c-a)+i&&(r=!r)}return r}s(l0e,"pointInPolygon");function sH(e,t,r,n,o){for(let i=0;i<o;i++)for(let a=0;a<n;a++)if(e[r+i][t+a]!==1)return!1;return!0}s(sH,"isValidRectangle");function c0e(e,t,r){let n=e.maxX-e.minX,o=e.maxY-e.minY,i,a,l=P({},e);return n/o>t?(a=o/r,i=a*t,l.minX+=(n-i*r)/2):(i=n/r,a=i/t,l.minY+=(o-a*r)/2),{dx:i,dy:a,gridBounds:l}}s(c0e,"calculateGridDimensions");function p0e(e,t,r,n,o){let i=Array(r).fill(0).map(()=>Array(r).fill(0));for(let a=0;a<r;a++)for(let l=0;l<r;l++){let c={x:t.minX+l*n,y:t.minY+a*o};l0e(c,e)&&(i[a][l]=1)}return i}s(p0e,"createAndFillGrid");function u0e(e,t){let r=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let o=0;o<t;o++)if(e[n][o]===1){let i=0;for(let a=1;a<=Math.min(t-o,t-n)&&sH(e,o,n,a,a);a++)i=a;r[n][o]=i}return r}s(u0e,"calculateRectSizes");function d0e(e,t,r,n,o,i){let a=0,l=0,c=0;for(let u=0;u<n;u++)for(let d=0;d<n;d++)if(e[u][d]===1){let h=Math.pow(t[u][d],2),y=r.minX+d*o,b=r.minY+u*i;a+=h,l+=y*h,c+=b*h}return{x:l/a,y:c/a}}s(d0e,"calculatePolygonCenter");function f0e(e,t,r,n,o,i,a){let l=-1/0,c=null,u=e.length,d=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let h=0;h<u;h++)for(let y=0;y<u;y++)if(e[h][y]===1)for(let b=1;b<=u-y;b++){let I=b;if(!(I>u-h)&&sH(e,y,h,b,I)){let S=b*I,x=t.minX+(y+b/2)*r,T=t.minY+(h+I/2)*n,w={x,y:T},O=Math.sqrt(Math.pow(w.x-o.x,2)+Math.pow(w.y-o.y,2))/d,_=S*(1-i)-O*i*S;_>l&&(l=_,c={center:w,width:b*r*a,height:b*n*a})}}return c}s(f0e,"findBestRectangle");function JM(e,t,r,n={}){let{scaleFactor:o=.9,centerPriority:i=.5,resolution:a=100,minimumSizeRatio:l=.5}=n,c=h9(r),u=e.width/e.height,d=s0e(t,c),h=a0e(d),{dx:y,dy:b,gridBounds:I}=c0e(h,u,a),S=p0e(d,I,a,y,b),x=u0e(S,a),T=d0e(S,x,I,a,y,b),w=f0e(S,I,y,b,T,i,o);return!w||w.width<e.width*l||w.height<e.height*l?e:R(P({},w),{center:KM(w.center,-c),rotation:r,polygonCenter:KM(T,-c)})}s(JM,"findLargestInteriorRectangle");var a1=Math.PI*2,m0e=Math.PI/2,h0e=Math.PI*1.5,y0e=md(m0e,2),g0e=md(h0e,2),b0e=.01,aH=!1,QM=class QM extends Be{constructor(r,n,o=0,i=0,a={}){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"initialBearing",0);m(this,"naturalBearing",0);m(this,"imagePlacementOptions");m(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=o,this.naturalBearing=i,this.imagePlacementOptions=a}createImageMesh(r,n,o,i=0,a,l){var I,S,x;let c={width:o.width,height:o.height,center:this.convertTo3DMapPosition(a),rotation:(I=o.rotation)!=null?I:0},u=(S=this.imagePlacementOptions.mode)!=null?S:"default",d=(()=>{switch(u){case"fit-nearest-90":let T=(this.initialBearing-this.naturalBearing+360)%180;return T>=45&&T<=135?JM(c,l,c.rotation+90,this.imagePlacementOptions):c;case"fit-initial-bearing":return JM(c,l,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return c}})();if(aH&&d.polygonCenter){let T=new We(new Fb(1),new Ti({color:65280}));T.position.set(d.polygonCenter.x,d.polygonCenter.y,i),this.rendererState.entityScene.add(T)}let h=new Ti({transparent:!0,depthWrite:!1,side:ya}),y=new Ci(d.width,d.height),b=new Q2(y);if(b.visible=!1,(x=this.getOrDownloadImage(n))==null||x.then(T=>{h.map=T,h.needsUpdate=!0,h.map.colorSpace=ga,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=r,b.material=h,aH){let T=new We(new Ci(o.width,o.height),new Ti({color:"gray"}));b.add(T);let w=new f9;b.add(w),w.scale.set(10,10,10)}return b.position.set(d.center.x,d.center.y,i+b0e),b.rotation.z=(-et.degToRad(d.rotation)+a1)%a1,b}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let o=new Promise(i=>{kc.getLoader().load(r,a=>{let l=this.imageLoadingCache.get(r);l&&!l.loaded&&(l.loaded=!0),i(a)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:o}),o}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let o=-n,i=r.imageMesh.rotation.z,a=md((i-o+a1)%a1,2);a>y0e&&a<g0e&&(r.imageMesh.rotation.z=(i+Math.PI)%a1)}update(r){var a,l,c,u,d;let n,o,i;for(let h of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(h),(n==null?void 0:n.type)==="image"){if(o=n.components[0],i=n.components[1],i.url&&o.imageMesh==null){let y=this.convertTo3DMapPosition(o.feature.geometry.coordinates),b={x:y.x,y:y.y};o.imageMesh=this.createImageMesh(n.id,i.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates,[b]),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)}o.imageMesh&&i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}else if((n==null?void 0:n.type)==="geometry"){if(o=n.components[0],i=n.components[1],i.showImage&&((a=o.feature.properties)!=null&&a.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((l=o.feature.properties)==null?void 0:l.image.position)!=null&&o.feature.geometry.coordinates!=null&&o.feature.geometry.coordinates.length>0){let y=o.feature.geometry.coordinates[0].map(I=>{let S=this.convertTo3DMapPosition(I);return{x:S.x,y:S.y}}),b=this.createImageMesh(h,(c=o.feature.properties)==null?void 0:c.image.path,(u=o.feature.properties)==null?void 0:u.image,i.height,(d=o.feature.properties)==null?void 0:d.image.position,y);o.mesh.parent.add(b),o.imageMesh=b}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(i.showImage&&!o.imageMesh.visible)if(i.url){let y=this.imageLoadingCache.get(i.url);y&&y.loaded&&(o.imageMesh.visible=!0)}else o.imageMesh.visible=!0;else!i.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1);i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}}}};s(QM,"ImageSystem");var tI=QM;f();var x0e=250,Fc,e7=class e7 extends Be{constructor(r,n){super();m(this,"cameraDirty",!0);m(this,"focusablesDirty",!0);m(this,"state");m(this,"camera");m(this,"debugEl",null);m(this,"raycasters",[]);m(this,"collisions",new Map);m(this,"focusableEntities",new Set);m(this,"debugRaycasters",!1);E(this,Fc);m(this,"update",s((r=!1,n=Date.now())=>{r||Date.now()-n>x0e||(p(this,Fc)&&cancelAnimationFrame(p(this,Fc)),A(this,Fc,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new De(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new De(r.x/1.2,r.y/1.2),o=new De(r.x+(r.x-n.x),n.y),i=new De(n.x,r.y+(r.y-n.y)),a=new De(o.x,i.y),l=new De(r.x,r.y/1.5),c=new De(r.x,r.y+(r.y-l.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[r,l,c,n,o,i,a].map((u,d)=>{if(this.debugRaycasters){let S=document.createElement("div");S.style.position="absolute",S.style.top=u.y+"px",S.style.left=u.x+"px",S.style.width="10px",S.style.height="10px",S.style.backgroundColor="red",this.debugEl.append(S)}let h=u.x/this.state.canvasWidth*2-1,y=-(u.y/this.state.canvasHeight)*2+1,b=new De(h,y),I=new ms;return I.setFromCamera(b,this.camera),[I,b,d===0?10:d<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n;for(let o of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(o),n!=null){if(n.type==="group-container"&&n.components[2]!==void 0&&n.components[2]instanceof wm){let i=n.components[2];if(i.dirty===!0||i.focusMesh==null){i.focusMesh&&mr(i.focusMesh);let a=new Jr;a.setFromObject(n);let l=new Si(a.max.x-a.min.x,a.max.y-a.min.y,a.max.z-a.min.z),c=new $r({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),u=new We(l,c);u.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,(a.min.z+a.max.z)/2),u.userData={entityId:n.userData.entityId},i.focusMesh=u,n.add(u),n.components[2].dirty=!1}this.focusableEntities.add(i.focusMesh)}else if(n.components[0]&&n.components[0]instanceof yr&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof yr&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let i=new We(r.geometry);i.userData={entityId:n.id},r.focusMesh=i}this.focusableEntities.add(r.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[n,o]of this.raycasters)n.setFromCamera(o,this.camera);for(let[n,o,i]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(l=>{var c;if((l==null?void 0:l.object)!=null&&"isMesh"in l.object&&(l!=null&&l.object.isMesh)){let u=l.object.userData.entityId,d=(c=this.collisions.get(u))!=null?c:0;this.collisions.set(u,d+i)}});let r=Array.from(this.collisions,([n,o])=>({entityId:n,weight:o})).sort((n,o)=>o.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){p(this,Fc)&&cancelAnimationFrame(p(this,Fc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Fc=new WeakMap,s(e7,"GeometryInFocusSystem");var rI=e7;f();f();f();f();function l1(e,t){t===void 0&&(t={});var r=em(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return v0e(r,t);case"MultiPolygon":return I0e(r,t);default:throw new Error("invalid poly")}}s(l1,"default");function v0e(e,t){t===void 0&&(t={});var r=em(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{};return lH(n,o)}s(v0e,"polygonToLine");function I0e(e,t){t===void 0&&(t={});var r=em(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{},i=[];return n.forEach(function(a){i.push(lH(a,o))}),op(i)}s(I0e,"multiPolygonToLine");function lH(e,t){return e.length>1?x9(e,t):Ia(e[0],t)}s(lH,"coordsToLine");function S0e(e,t){var r=!0;return gs(e,function(n){gs(t,function(o){if(r===!1)return!1;r=C0e(n.geometry,o.geometry)})}),r}s(S0e,"booleanDisjoint");function C0e(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!M0e(e.coordinates,t.coordinates);case"LineString":return!cH(t,e);case"Polygon":return!ol(e,t)}break;case"LineString":switch(t.type){case"Point":return!cH(e,t);case"LineString":return!T0e(e,t);case"Polygon":return!pH(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ol(t,e);case"LineString":return!pH(e,t);case"Polygon":return!P0e(t,e)}}return!1}s(C0e,"disjoint");function cH(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(w0e(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}s(cH,"isPointOnLine");function T0e(e,t){var r=nm(e,t);return r.features.length>0}s(T0e,"isLineOnLine");function pH(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var o=n[r];if(ol(o,e))return!0}var i=nm(t,l1(e));return i.features.length>0}s(pH,"isLineInPoly");function P0e(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var o=n[r];if(ol(o,t))return!0}for(var i=0,a=t.coordinates[0];i<a.length;i++){var l=a[i];if(ol(l,e))return!0}var c=nm(l1(e),l1(t));return c.features.length>0}s(P0e,"isPolyInPoly");function w0e(e,t,r){var n=r[0]-e[0],o=r[1]-e[1],i=t[0]-e[0],a=t[1]-e[1],l=n*a-o*i;return l!==0?!1:Math.abs(i)>=Math.abs(a)?i>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}s(w0e,"isPointOnLineSegment");function M0e(e,t){return e[0]===t[0]&&e[1]===t[1]}s(M0e,"compareCoords");var uH=S0e;function t7(e,t){var r=!1;return gs(e,function(n){gs(t,function(o){if(r===!0)return!0;r=!uH(n.geometry,o.geometry)})}),r}s(t7,"booleanIntersects");var dH=20,Lc,$u,ju,oI,c1,r7=class r7{constructor(t){m(this,"dirty",!0);m(this,"map");m(this,"stylesheetId","");m(this,"userHiddenLayers",new Set);m(this,"hiddenLayersInStyle",new Set);m(this,"centerPoint");m(this,"bbox");m(this,"polygons");m(this,"handleRender",s(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(p(this,Lc)&&(p(this,oI).call(this),A(this,Lc,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),r=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(r.length>0){for(let n of r)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],A(this,Lc,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){A(this,Lc,!0);for(let r=0;r<t.length;r+=dH){let n=t.slice(r,r+dH);p(this,$u).push(()=>{for(let o of n)if(o.geometry!=null&&"coordinates"in o.geometry){if(this.polygons==null)return;let i;if(o.geometry.type==="Polygon"?i=$b(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(i=v9(o.geometry.coordinates)),!i)continue;for(let a of this.polygons)if(t7(a,i)){this.expr.push(["!=",["id"],o.id]);continue}}})}p(this,c1).call(this)}}}},"handleRender"));m(this,"expr",[]);E(this,Lc,!1);E(this,$u,[]);E(this,ju,null);E(this,oI,s(()=>{p(this,ju)&&(globalThis.cancelAnimationFrame(p(this,ju)),A(this,ju,null)),A(this,$u,[])},"#cancelJobs"));E(this,c1,s(()=>{let t=p(this,$u).pop();typeof t=="function"&&(t(),p(this,$u).length>0&&A(this,ju,globalThis.requestAnimationFrame(p(this,c1)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],A(this,Lc,!1)},"#runJobs"));m(this,"handleStyleChange",s(t=>{var r,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let o=(n=(r=t==null?void 0:t.style)==null?void 0:r.stylesheet)==null?void 0:n.id;(!o||o!==this.stylesheetId)&&(this.stylesheetId=o,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,r){this.centerPoint=t;for(let n of r)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,r,n){this.bbox=t,this.polygons=r.reduce((o,i)=>{if(i.geometry.type==="Polygon"){let a=$b(i.geometry.coordinates);o.push(a)}else i.geometry.type==="MultiPolygon"&&o.push(...i.geometry.coordinates.map(a=>$b(a)));return o},[]);for(let o of n)this.userHiddenLayers.add(o);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};Lc=new WeakMap,$u=new WeakMap,ju=new WeakMap,oI=new WeakMap,c1=new WeakMap,s(r7,"OutdoorLayers");var nI=r7;f();f();f();f();var iI="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping y = mx + b where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // 'nearRadius' to 'farRadius' when the camera is at 'farZoom'.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";f();var n7="#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform bool dashed;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of pathRadius. Since we've\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered \"long\", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered \"short\", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path's length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping 'y = mx + b' where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the 'complete' value as it varies from 0.0 to 1.0.\n // Fragments that are at the 'complete' value or past it will be fully\n // transparent, while fragments that are at 'complete - completeLength'\n // or before it will be fully opaque. However, we adjust the 'complete'\n // value here so that it overshoots by one full 'completeLength', so that\n // the entire path will be opaque when the 'complete' value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at 'arrowMargin' instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // \"zooming off\" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as 'arrowAnimationTimer' goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a \"looping sawtooth\" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the \"looping\" design is preferred is because\n // it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (dashed) {\n float dashLength = 0.1; // Adjust this value to change the dash length\n float gapLength = 0.1; // Adjust this value to change the gap length\n float totalLength = dashLength + gapLength;\n float numSegments = ceil(1.0 / totalLength);\n float adjustedTotalLength = 1.0 / numSegments;\n float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));\n float pattern = mod(fragPathDistance, adjustedTotalLength);\n opacity = pattern < adjustedDashLength ? 1.0 : 0.0;\n }\n\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from 'pulse'\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the 'pulse' value and whether it's covered by an arrow -- but if it's\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like \"holes\" when they're overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}\n";f();var fH="void main(void) {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n}";var mH="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var E0e=new fd;function hH(e,t,r){let{nearRadius:n,farRadius:o,accentColor:i,completeFraction:a,isVertical:l,visibleThroughGeometry:c,dashed:u}=t,{color:d}=r,h=!0,y=0,b=1/0,I=t.displayArrowsOnPath,S=!0,x=I,T=n/2+_0e,w=0;e[0].z+=T;for(let oe=1;oe<e.length;++oe){e[oe].z+=T;let D=e[oe].x-e[oe-1].x,K=e[oe].z-e[oe-1].z;if(l)w+=Math.sqrt(D*D+K*K);else{let N=e[oe].y-e[oe-1].y;w+=Math.sqrt(D*D+N*N+K*K)}}if(!l){let oe=e[0],D=e[e.length-1];e.push(D.clone().setZ(D.z-.01)),e.unshift(oe.clone().setZ(oe.z-.01))}let M=new Q6;x&&(M=E0e.load(mH),M.colorSpace=ga);let O=new Rt(d),_=new Rt(i),$={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new De(1,1)},cameraParameters:{type:"v2",value:new De(y,0)},complete:{type:"f",value:h?0:1},color:{type:"c",value:O},pathLength:{type:"f",value:w},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:y},farZoom:{type:"f",value:b},pulseColor:{type:"c",value:_},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:M},displayArrowsOnPath:{type:"b",value:I},showPulse:{type:"b",value:S},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:u}},j=new a9(e);j.curveType="catmullrom",j.tension=0;let F=30,L=8,q=F*e.length,U=new l9(j,q,n,L,!1),V=new Float32Array(U.attributes.position.count);for(let oe=e.length;oe<V.length;oe++)V[oe]=oe;U.setAttribute("vertexIndex",new va(V,1));let Q=new Float32Array(U.attributes.position.count),Y=new va(Q,1);for(let oe=0;oe<=q;oe++)for(let D=0;D<=L;++D)Y.setX(oe*(L+1)+D,oe/q);U.setAttribute("pathDistance",Y);let se=new Float32Array(U.attributes.normal.count*3),re=new va(se,3);for(let oe=0;oe<q;oe++){let D=U.tangents[oe];for(let K=0;K<=L;++K)re.setXYZ(oe*(L+1)+K,D.x,D.y,D.z)}U.setAttribute("pathTangent",re);let ve=new Float32Array(U.attributes.normal.count*3),we=new va(ve,3);for(let oe=0;oe<q;oe++){let D=U.tangents[oe];var ye,Ne,nt;l?(ye=D.x*D.y,Ne=-1+D.y*D.y,nt=D.z*D.y):(ye=-D.x*D.z,Ne=-D.y*D.z,nt=1-D.z*D.z);let K=Math.sqrt(ye*ye+Ne*Ne+nt*nt);K===0&&(K=1);let N=ye/K,pe=Ne/K,le=nt/K;for(let ce=0;ce<=L;++ce)we.setXYZ(oe*(L+1)+ce,N,pe,le)}U.setAttribute("pathNormal",we);let st=new Bl({uniforms:$,vertexShader:iI,fragmentShader:n7});st.transparent=!0,st.alphaTest=.5,$.resolution.value.x=1,$.resolution.value.y=1,$.vertexes.value=V.length,$.arrowTexture.value.wrapS=us,$.arrowTexture.value.wrapT=us,$.arrowTexture.value.anisotropy=16;let qe=new We(U,st),Ye=qe.clone(),de=R(P({},$),{opacityMultiplier:{type:"f",value:.25}});de.complete.value=1,Ye.material=new Bl({uniforms:de,vertexShader:iI,fragmentShader:n7}),Ye.material.transparent=!0,Ye.material.alphaTest=.5,Ye.material.depthWrite=!1,Ye.material.depthTest=!1,de.resolution.value.x=1,de.resolution.value.y=1,de.vertexes.value=V.length,de.arrowTexture.value.wrapS=us,de.arrowTexture.value.wrapT=us,de.arrowTexture.value.anisotropy=16,de.complete.value=a,qe.userData=Ye.userData=t.mesh.userData;let ge=t.mesh;if(!c){let oe=new Bl({uniforms:$,vertexShader:iI,fragmentShader:fH}),D=new We(U,oe);D.name="stencil",D.material.colorWrite=!1,D.material.stencilWrite=!0,D.material.stencilRef=1,D.material.stencilFunc=K6,D.material.stencilZPass=kb,D.material.stencilZFail=kb,D.material.stencilFail=kb,D.material.depthWrite=!1,D.material.depthTest=!1,ge.add(D),ge.add(Ye)}ge.add(qe),c&&(qe.material.stencilWrite=!0,qe.material.stencilRef=1,qe.material.stencilFunc=Y6,qe.material.stencilZPass=_b,qe.material.stencilZFail=_b,qe.material.stencilFail=_b,qe.material.needsUpdate=!0,qe.layers.disableAll(),qe.layers.enable(Gb.ALWAYS_ON_TOP)),U.computeBoundingBox();let me=new Me;return U.boundingBox.getCenter(me),{mesh:ge,material:st,center:me}}s(hH,"buildPath");var _0e=.15;var o7=class o7 extends Be{constructor(r,n,o,i){super();m(this,"rendererState");m(this,"altitudeDirty",!0);m(this,"convertTo3DMapPosition");m(this,"getParentContainer");m(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=o,this.convertZoomLevelToAltitude=i}update(r,n,o){let i,a=!1;for(let l of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(l),i&&i.type==="path"&&i.components[0].type==="path"){let c=i.components[0],u=i.components[1],d=c.isVertical&&this.altitudeDirty;if(!(c instanceof Ac))continue;if(c.dirty||d){if(c.mesh.parent!=null)for(let y=c.mesh.children.length-1;y>=0;y--)mr(c.mesh.children[0]);let h=[];if(c.feature.features.forEach(y=>{let b=y.geometry.coordinates[2]||0,I;if(y.properties.parentId&&(I=this.getParentContainer(y.properties.parentId,!0),I!=null&&I.altitude!=null&&(b+=I.altitude,c.isVertical=!0)),!y.properties.parentId||I!=null&&I.visible){let S=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],b);h.push(S)}}),h.length>1){let{mesh:y,material:b,center:I}=hH(h,c,{color:u.color});c.mesh=y,c.material=b,c.position=I}c.dirty&&(c.nearZoomLevel!=null&&(c.nearZoomAltitude=this.convertZoomLevelToAltitude(c.nearZoomLevel)),c.farZoomLevel!=null&&(c.farZoomAltitude=this.convertZoomLevelToAltitude(c.farZoomLevel))),c.dirty=!1}u.dirty&&(c.mesh.children.forEach(h=>{h.name!=="stencil"&&(h.material.uniforms.color.value.set(u.color),h.material.visible=u.visible,h.material.needsUpdate=!0)}),c.mesh.position.z=u.altitude,u.dirty=!1),c.material&&(c.mesh.children.forEach(h=>{var b,I;if(h.name==="stencil")return;let y=h.material.uniforms;y.nearZoom.value=(b=c.nearZoomAltitude)!=null?b:r,y.farZoom.value=(I=c.farZoomAltitude)!=null?I:n,y.cameraParameters.value.x=o,c.materialDirty&&(y.nearRadius.value=c.nearRadius,y.displayArrowsOnPath.value=c.displayArrowsOnPath,y.farRadius.value=c.farRadius,y.pulseColor.value.set(c.accentColor),y.complete.value=c.completeFraction),h.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(h=>{h.name!=="stencil"&&(h.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,h.material.needsUpdate=!0)}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};s(o7,"PathSystem");var p1=o7;f();var Yr,Rm,xl,i7=class i7{constructor(t){m(this,"rendererState");m(this,"dirty",!1);E(this,Yr);E(this,Rm);E(this,xl);this.rendererState=t}updateOne(t){if(t instanceof Ot&&t.components[0]instanceof yr&&t.components[1]instanceof bs&&t.parentObject3D instanceof Sn&&(A(this,Yr,t.components[0]),A(this,xl,t.components[1]),p(this,Yr).detached&&p(this,Yr).dirty&&p(this,Yr).geometry!=null&&p(this,Yr).material!=null)){A(this,Rm,t.parentObject3D),p(this,Yr).visible=!1;let r=new Rt(p(this,xl).color),n=p(this,xl).opacity*sp(t),o=new ku({color:r,side:ya,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,p(this,Yr).material.repeatYFactor),i=new jb(1,p(this,Yr).geometry.attributes.position.count||0,0,o),a=i.addGeometry(p(this,Yr).geometry);i.addInstance(a),i.userData={entities:{0:t.id},detached:!0},p(this,Yr).instanceIndex=a,p(this,Yr).material.setColor(p(this,Yr).instanceIndex,r,p(this,xl).topColor?new Rt(p(this,xl).topColor):r),p(this,Yr).mesh=i,p(this,Yr).material=o,p(this,Rm).add(i),p(this,Yr).dirty=!1}}update(){if(!this.dirty)return;let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){A(this,Yr,void 0),A(this,Rm,void 0),A(this,xl,void 0)}};Yr=new WeakMap,Rm=new WeakMap,xl=new WeakMap,s(i7,"MeshDetachmentSystem");var sI=i7;f();f();function yH(e,t,r){var n;if(e.geometry!=null){let o=t||1e-4,i=o/e.currentHeight,a=o/r;e.geometry.scale(1,1,i),e.material&&(e.material.repeatYFactor=a),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),e.currentHeight=o}}s(yH,"updateHeight");var Gu,Rc,s7=class s7{constructor(t){m(this,"rendererState");m(this,"dirty",!1);E(this,Gu);E(this,Rc);this.rendererState=t}updateOne(t){var r;t instanceof Ot&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(A(this,Gu,t.components[0]),A(this,Rc,t.components[1]),t.type==="geometry"&&p(this,Rc).height!==p(this,Gu).currentHeight&&yH(p(this,Gu),p(this,Rc).height,p(this,Rc).initialHeight))}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){A(this,Gu,void 0),A(this,Rc,void 0)}};Gu=new WeakMap,Rc=new WeakMap,s(s7,"MeshModificationSystem");var aI=s7;f();var k0e={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},a7=class a7{constructor(t){m(this,"state",k0e);m(this,"core");this.core=t}update(t){let r={};for(let[n,o]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=o,r[n]=o);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};s(a7,"Debug");var lI=a7;f();var u1=9,A0e=!1,gH=.1;function D0e(e,t,r){for(let n=0;n<t;n++){let o=(r&16711680)>>16,i=(r&65280)>>8,a=r&255;e[n*3]=o/255,e[n*3+1]=i/255,e[n*3+2]=a/255}}s(D0e,"fillArrayWithColor");var l7=class l7{constructor(t,r,n){m(this,"state");m(this,"renderer");m(this,"renderService");m(this,"pickingTexture");m(this,"pickingMaterial");m(this,"pixelBuffer");m(this,"width",0);m(this,"height",0);m(this,"scale",1/2);m(this,"color",1);m(this,"convertTo3DMapPosition");m(this,"destroyed",!1);m(this,"enabled",!1);m(this,"backgroundId",16777215);m(this,"resize",s(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new t9(this.width,this.height,{format:Eb,type:q6,internalFormat:"RGBA"})},"resize"));m(this,"shouldShowByXY",s((t,r,n)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-r-1)*this.width,i=this.pixelBuffer[o*4],a=this.pixelBuffer[o*4+1],l=this.pixelBuffer[o*4+2],c=i<<16|a<<8|l;return c===n||c===this.backgroundId},"shouldShowByXY"));m(this,"activeOccluders",new Set);m(this,"update",s(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,r;for(let o of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(o);if(i&&i instanceof at&&i.userData.occluderFeature!=null&&i.userData.occluderId!=null&&(this.activeOccluders.add(i.userData.occluderId),i.userData.occluderDirty)){if(t=i.userData.occluderFeature,t.geometry.type==="Polygon"){let a=I2(t,this.convertTo3DMapPosition,{color:"white",height:gH});r=this.createOccluderMesh(a,i.userData.occluderId),i.add(r)}else if(t.geometry.type==="MultiPolygon"){let a=S2(t,this.convertTo3DMapPosition,{color:"white",height:gH});r=this.createOccluderMesh(a,i.userData.occluderId),i==null||i.add(r)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Rt(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(u1),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(u1),A0e?this.renderService.enabledLayers.add(u1):this.renderService.enabledLayers.delete(u1),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let o of this.state.geometry2DIdsInScene){let i=this.state.geometry2DMap.get(o);if(i&&(i==null?void 0:i.occluderId)!=null&&this.activeOccluders.has(i==null?void 0:i.occluderId)){let a=i.components[0].projection,l=Math.floor(a.x*this.scale),c=Math.floor(a.y*this.scale),u=this.shouldShowByXY(l,c,i.occluderId);i.components[0].isOccluded=!u}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=r,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new Bl({glslVersion:J6,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,r){let n=t.attributes.position,o=new Float32Array(n.count*3);D0e(o,n.count,r),t.setAttribute("color",new va(o,3))}createOccluderMesh(t,r){let n=new We(t,this.pickingMaterial);return n.layers.set(u1),this.applyId(n.geometry,r),n.userData.occluderId=r,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};s(l7,"Occlusion2DSystem");var cI=l7;var bH=new ms;var{DEFAULT_PITCH:f7,DEFAULT_BEARING:m7,DEFAULT_ZOOM_LEVEL:h7,DEFAULT_MIN_ZOOM_LEVEL:F0e,DEFAULT_MAX_ZOOM_LEVEL:L0e}=gi,R0e=et.radToDeg(.6435011087932844),wr,Ir,Uu,d1,Nm,Nc,Vu,Bm,bn,p7,W,Gt,Qi,Sr,sa,tn,H,f1,Nr,Wt,xH,vH,IH,Bc,m1,h1,y1,g1,pI,b1,x1,v1,$m,u7,zu,I1,eo,to,d7,jm,S1,y7=class y7 extends Be{constructor(r,n={}){var y,b,I,S,x,T,w,M,O,_,$,j;super();E(this,bn);m(this,"options");m(this,"container");m(this,"Debug");E(this,wr);E(this,Ir);E(this,Uu);E(this,d1);E(this,Nm);E(this,Nc);E(this,Vu);E(this,Bm);m(this,"rendererDomElement");E(this,W,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new at("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Ph,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new CM,cameraObject:new RI,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});m(this,"camera");E(this,Gt);E(this,Qi);E(this,Sr);E(this,sa);E(this,tn);E(this,H,{});E(this,f1,window.matchMedia("screen and (min-resolution: 2dppx)"));m(this,"map");E(this,Nr,s(()=>{p(this,H).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));E(this,Wt,s(()=>{p(this,H).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));E(this,Bc,"standalone");E(this,m1,s(r=>Math.trunc(r*10)/10,"#round10"));E(this,h1,s(()=>{p(this,H).twoDDrawSystem.dirty=!0,te(this,bn,p7).call(this,yd()),p(this,H).watermarkSystem.dirty=!0,p(this,H).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));E(this,y1,s(()=>{p(this,g1).call(this)},"#handleWindowResizeWithEvent"));E(this,g1,s((r,n)=>{let o=r!=null?r:this.rendererDomElement.clientWidth,i=n!=null?n:this.rendererDomElement.clientHeight;if(o===0||i===0)return;p(this,W).canvasWidth=o,p(this,W).canvasHeight=i,te(this,bn,p7).call(this,yd()),p(this,$m).call(this),te(this,bn,IH).call(this),p(this,H).cameraSystem.resize(this.canvasWidth,this.canvasHeight),p(this,H).cameraSystem.dirty=!0,p(this,H).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),p(this,H).htmlControlsSystem.resize(this.canvasWidth),p(this,H).geometryInFocusSystem.resize(),p(this,H).occlusion2DSystem.resize();let{top:a,left:l}=this.container.getBoundingClientRect();p(this,W).containerOffset=[a,l],this.publish("resize"),this.render()},"#handleWindowResize"));E(this,pI,s(()=>{this.renderSync()},"#renderFull"));E(this,b1,new Me);E(this,x1,s((r,n)=>{let o=this.mode==="standalone"?p(this,Ir):this.viewCamera;if(p(this,Ir).position.z+this.camera.elevation>n.z){p(this,b1).copy(n);let i=p(this,b1).project(o),a=(i.x+1)/2*this.canvasWidth-0/2,l=(-i.y+1)/2*this.canvasHeight-0/2,c=p(this,m1).call(this,a),u=p(this,m1).call(this,l);r.x=c,r.y=u}else r.x=-1e3,r.y=-1e3},"#project"));E(this,v1,s((r,n)=>{p(this,tn).setBufferSize(r,n),p(this,Ir).aspect=r/n,p(this,Ir).updateProjectionMatrix(),p(this,Ir).updateMatrixWorld(!0),p(this,Nm).x=r,p(this,Nm).y=n},"#setBufferSize"));E(this,$m,s(()=>{var a;let r=p(this,W).canvasWidth=this.rendererDomElement.clientWidth,n=p(this,W).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(r*this.resolutionScale),i=Math.floor(n*this.resolutionScale);p(this,v1).call(this,o,i),(a=this.map)==null||a.resize(),p(this,W).shouldMeasureCanvas=!1},"#measureCanvas"));m(this,"getParentContainer",s((r,n=!0)=>{if(!r)return n?p(this,W).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let o=p(this,W).geometry3DMap.get(r);return o instanceof at?o:(z.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?p(this,W).entityScene:void 0)}else if(r.type==="group-container"){let o=p(this,W).geometry3DMap.get(r.id);if(o instanceof at)return o}return n?p(this,W).entityScene:void 0},"getParentContainer"));m(this,"showCollisionBoxes",s(()=>{p(this,H).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));m(this,"hideCollisionBoxes",s(()=>{p(this,H).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));m(this,"projectScreenXYToCoordinate",s((r,n,o=!1)=>{var y,b;let i=p(this,W).containerOffset[0],a=p(this,W).containerOffset[1],l=(r-a)/p(this,W).canvasWidth*2-1,c=-((n-i)/p(this,W).canvasHeight)*2+1,u=new De(l,c),d,h;if(o)bH.setFromCamera(u,p(this,Ir)),d=(y=bH.intersectObject(p(this,Nc),!1)[0])==null?void 0:y.point;else{let I=p(this,H).interactionSystem.getThreeDIntersectsFromXY(u);d=(b=I==null?void 0:I[0])==null?void 0:b.point,h=p(this,H).interactionSystem.getGroupContainerIntersectsFromXY(u)}if(d)return{coordinate:this.convert3DMapPositionToCoordinate(d),groupContainers:h}},"projectScreenXYToCoordinate"));m(this,"projectCoordinateToScreenXY",s(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),o=new De;return p(this,x1).call(this,o,n),{x:o.x,y:o.y}},"projectCoordinateToScreenXY"));m(this,"convert3DMapPositionToCoordinate",s(r=>{var i,a,l,c;let{lat:n,lon:o}=Ub((a=(i=p(this,W).center)==null?void 0:i[1])!=null?a:0,(c=(l=p(this,W).center)==null?void 0:l[0])!=null?c:0,r.x,r.y);return[o,n,r.z]},"convert3DMapPositionToCoordinate"));m(this,"setBackgroundColor",s((r,n)=>{p(this,tn).setBackgroundColor(r,n)},"setBackgroundColor"));m(this,"getMetresPerPixel",s(()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,n,!0),i=this.projectScreenXYToCoordinate(r,n,!0);return o==null||i==null?void 0:Nb(o.coordinate,i.coordinate)/r},"getMetresPerPixel"));m(this,"hideOutdoorLayersUnderPoint",s((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(p(this,H).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));m(this,"hideOutdoorLayersIntersectingPolygons",s((r,n,o)=>{p(this,H).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,o),this.render()},"hideOutdoorLayersIntersectingPolygons"));E(this,zu,new s9);E(this,I1,new Ii);m(this,"render",s(()=>{var r;if(((r=p(this,H))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return p(this,H).renderSystem.update()},"render"));m(this,"renderSync",s(()=>p(this,H).renderSystem.update(!0),"renderSync"));E(this,eo,gd(()=>{this.publish("user-interaction-start",void 0)},0,!0));E(this,to,gd(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));m(this,"on",s((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&v.env.NODE_ENV!=="test"&&(z.warn('"'.concat(r,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(r))},"on"));m(this,"off",s((r,n)=>{super.off(r,n)},"off"));m(this,"getCursor",s(()=>p(this,H).interactionSystem.getCursor(),"getCursor"));m(this,"destroy",s(()=>{var r;p(this,H)&&(p(this,H).cameraSystem.off("user-dolly-start",p(this,eo)),p(this,H).cameraSystem.off("user-pan-start",p(this,eo)),p(this,H).cameraSystem.off("user-rotate-start",p(this,eo)),p(this,H).cameraSystem.off("user-zoom-start",p(this,eo)),p(this,H).cameraSystem.off("user-tilt-start",p(this,eo)),p(this,H).cameraSystem.off("user-pedestal-start",p(this,eo)),p(this,H).cameraSystem.off("user-dolly-end",p(this,to)),p(this,H).cameraSystem.off("user-pan-end",p(this,to)),p(this,H).cameraSystem.off("user-rotate-end",p(this,to)),p(this,H).cameraSystem.off("user-zoom-end",p(this,to)),p(this,H).cameraSystem.off("user-tilt-end",p(this,to)),p(this,H).cameraSystem.off("user-pedestal-end",p(this,to)),p(this,H).renderSystem.off("measure-canvas",p(this,$m)),p(this,H).meshOptimizationSystem.off("geometry-2d-added",this.render),p(this,H).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),p(this,Nr).call(this),p(this,Wt).call(this),this.renderSync(),p(this,H).renderSystem.destroy(),p(this,H).cameraSystem.off("change",this.render),p(this,H).pathSystem.off("animate:path",this.render),p(this,H).cameraSystem.dispose(),p(this,H).exporterSystem.destroy(),p(this,H).outdoorLayersSystem.destroy(),p(this,H).drawSystem.destroy(),window.removeEventListener("resize",p(this,y1),!1),p(this,f1).removeEventListener("change",p(this,h1)),p(this,Vu)&&p(this,Vu).disconnect(),this._subscribers={},p(this,tn).destroy(),(r=p(this,wr))==null||r.traverse(n=>{mr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),A(this,wr,void 0),p(this,H).htmlControlsSystem.destroy(),p(this,H).collisionSystem.destroy(),p(this,H).interactionSystem.destroy(),p(this,H).domMutationSystem.destroy(),p(this,H).geometryInFocusSystem.destroy(),A(this,H,void 0),p(this,Bc)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(p(this,sa)),this.container.removeChild(p(this,Gt)),A(this,tn,void 0))},"destroy"));E(this,jm,new Me);E(this,S1,new Me);if(p(this,W).useStandaloneCamera=(y=n.useStandaloneCamera)!=null?y:!1,p(this,W).naturalBearing=(b=n.naturalBearing)!=null?b:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!r.clientWidth||!r.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(A(this,Bc,n.mode),this.map=n.map),p(this,W).entityScene.addEventListener("childadded",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),p(this,W).entityScene.addEventListener("childremoved",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),p(this,W).geometry3DMap.set(p(this,W).entityScene.userData.entityId,p(this,W).entityScene),n.center&&(p(this,W).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,te(this,bn,xH).call(this),te(this,bn,vH).call(this),p(this,H).htmlControlsSystem=new Z2(this.container),p(this,Bc)!=="outdoors-overlay"&&p(this,H).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),v.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),A(this,tn,new Mv({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(I=n.gl)==null?void 0:I.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:s(F=>{var L;(L=n.onWebGLContextRestored)==null||L.call(n,F),p(this,Nr).call(this),p(this,Wt).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(S=n.backgroundAlpha)!=null?S:1})),A(this,wr,new $l),p(this,wr).add(p(this,W).entityScene);let o=window.__THREE_DEVTOOLS__;v.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:p(this,wr)})),o.dispatchEvent(new CustomEvent("observe",{detail:p(this,tn)}))),A(this,Ir,new RI(R0e,this.aspect,50,1e5)),p(this,W).cameraObject=p(this,Ir),A(this,d1,new o9),p(this,Ir).renderOrder=999;let i=new xa;i.add(p(this,Ir)),A(this,Bm,new xa),p(this,Bm).add(i),p(this,wr).add(p(this,Bm)),p(this,Ir).updateProjectionMatrix(),p(this,Ir).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:s(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=p(this,tn).domElement(),A(this,Nm,new De);let a=new Ci(1e6,1e6),l=new $r({color:0,visible:!1});A(this,Nc,new We(a,l)),p(this,Nc).name="worldPlane",p(this,wr).add(p(this,Nc)),(x=n.gl)!=null&&x.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",p(this,y1),!1),p(this,f1).addEventListener("change",p(this,h1)),typeof ResizeObserver=="function"&&((T=v.env)==null?void 0:T.NODE_ENV)!=="test"&&(A(this,Vu,new ResizeObserver(O9(F=>{p(this,g1).call(this,F[0].contentRect.width,F[0].contentRect.height)},50))),(w=p(this,Vu))==null||w.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(O=globalThis.MappedinDebug)!=null&&O.TEST_IOS?"1920px":"100%",v.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),p(this,W).canvasWidth=this.rendererDomElement.clientWidth,p(this,W).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,u=this.canvasHeight;p(this,H).watermarkSystem=new z2(p(this,Ir),p(this,W),n==null?void 0:n.watermark),p(this,H).watermarkSystem.on("texture-loaded",this.render),p(this,W).shouldMeasureCanvas=!0,p(this,W).pixelRatio=this.resolutionScale,p(this,v1).call(this,Math.floor(c*this.resolutionScale),Math.floor(u*this.resolutionScale));let d=new Lb(16777215,.3*Math.PI);d.position.set(-150,-150,350),p(this,wr).add(d);let h=new p9(16777215,.741*Math.PI);p(this,wr).add(h),p(this,H).cameraSystem=new Am(p(this,Ir),p(this,wr),p(this,tn).renderer,p(this,W),{mode:this.mode,canvasHeight:u,canvasWidth:c}),p(this,H).cameraSystem.on("user-dolly-start",p(this,eo)),p(this,H).cameraSystem.on("user-pan-start",p(this,eo)),p(this,H).cameraSystem.on("user-rotate-start",p(this,eo)),p(this,H).cameraSystem.on("user-zoom-start",p(this,eo)),p(this,H).cameraSystem.on("user-tilt-start",p(this,eo)),p(this,H).cameraSystem.on("user-pedestal-start",p(this,eo)),p(this,H).cameraSystem.on("user-dolly-end",p(this,to)),p(this,H).cameraSystem.on("user-pan-end",p(this,to)),p(this,H).cameraSystem.on("user-rotate-end",p(this,to)),p(this,H).cameraSystem.on("user-zoom-end",p(this,to)),p(this,H).cameraSystem.on("user-tilt-end",p(this,to)),p(this,H).cameraSystem.on("user-pedestal-end",p(this,to)),p(this,H).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),p(this,H).geometryInFocusSystem&&(p(this,H).geometryInFocusSystem.cameraDirty=!0),this.render()}),p(this,H).pathSystem=new p1(p(this,W),this.convertTo3DMapPosition,this.getParentContainer,p(this,H).cameraSystem.convertZoomLevelToAltitude),p(this,H).pathSystem.on("animate:path",this.render),p(this,H).panBoundsSystem=new q2(p(this,W),p(this,H).cameraSystem),p(this,H).panBoundsSystem.on("update",()=>{let{panBounds:F,fov:L,convertAltitudeToZoomLevel:q}=p(this,H).cameraSystem;if(p(this,H).panBoundsSystem.autoMinZoomLevel){if(F.radius<=0)return;let U=Math.min(p(this,W).canvasWidth/p(this,W).canvasHeight,1),V=L*Math.PI/180*U,Q=Math.tan(V/2),{radius:Y,center:se}=p(this,H).cameraSystem.panBounds,re=Y/Q,ve=this.getThreeCamera().getWorldPosition(new Me),we=se.distanceTo(ve),ye=Math.abs(ve.z-se.z),Ne=re*ye/we,nt=q(Ne);V9(nt,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(nt)}}),this.camera=new V2(this,p(this,H),p(this,W)),this.camera.setZoomLevel((_=n.zoomLevel)!=null?_:h7),this.camera.setBearing(($=n.bearing)!=null?$:m7),this.camera.setPitch((j=n.pitch)!=null?j:f7),this.camera.setMaxZoomLevel(L0e),this.camera.setMinZoomLevel(F0e),p(this,H).domVisiblitySystem=new P2(p(this,W),p(this,sa)),p(this,H).domMutationSystem=new U2(p(this,W),p(this,sa)),p(this,H).domMutationSystem.on("dimensions-update",()=>{p(this,H).collisionSystem.collidersDirty=!0,this.render()}),p(this,H).domDrawSystem=new j2(p(this,W)),p(this,H).collisionSystem=new Ov(p(this,Qi),p(this,W)),p(this,H).twoDDrawSystem=new M2(p(this,W),p(this,Sr),n.transformImageRequest),p(this,H).twoDDrawSystem.on("img:loaded",this.render),p(this,H).interactionSystem=new mg(this.rendererDomElement,p(this,W),p(this,Ir),p(this,Nc),p(this,H).cameraSystem.isUserInteracting),p(this,H).interactionSystem.on("doubletap-with-onefinger",F=>{var L;this.camera.animateTo({center:(L=this.projectScreenXYToCoordinate(F.clientX,F.clientY))==null?void 0:L.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:zI,easing:"ease-out"})}),p(this,H).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:zI,easing:"ease-out"})}),p(this,H).interactionSystem.on("hover",this.render),p(this,H).interactionSystem.on("click",F=>{var L,q,U,V,Q,Y;if(((L=F.entity2D)==null?void 0:L.id)==="watermark"&&typeof p(this,H).watermarkSystem.options.onClick=="function"&&p(this,H).watermarkSystem.options.interactive){p(this,H).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(F.position),geometry:F.entity3D?[(q=F.entity3D)==null?void 0:q.id]:[],paths:((U=F.entity3D)==null?void 0:U.components[0])instanceof Ac?[F.entity3D.id]:[],markers:((V=F.entity2D)==null?void 0:V.components[0])instanceof ea?[F.entity2D.id]:[],models:((Q=F.entity3D)==null?void 0:Q.components[0])instanceof Ec?[F.entity3D.id]:[],labels:((Y=F.entity2D)==null?void 0:Y.components[0])instanceof ta?[F.entity2D.id]:[],containers:Array.isArray(F.groupContainers)?F.groupContainers.map(se=>se.userData.entityId):[],pointerEvent:F.pointerEvent})}),p(this,H).interactionSystem.on("hover",F=>{var L,q,U,V,Q,Y;F.position&&((L=F.entity2D)==null?void 0:L.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(F.position),geometry:F.entity3D?[(q=F.entity3D)==null?void 0:q.id]:[],paths:((U=F.entity3D)==null?void 0:U.components[0])instanceof Ac?[F.entity3D.id]:[],markers:((V=F.entity2D)==null?void 0:V.components[0])instanceof ea?[F.entity2D.id]:[],models:((Q=F.entity3D)==null?void 0:Q.components[0])instanceof Ec?[F.entity3D.id]:[],labels:((Y=F.entity2D)==null?void 0:Y.components[0])instanceof ta?[F.entity2D.id]:[],containers:Array.isArray(F.groupContainers)?F.groupContainers.map(se=>se.userData.entityId):[]})}),p(this,H).geometryInFocusSystem=new rI(p(this,W),p(this,Ir)),p(this,H).geometryInFocusSystem.on("geometry-in-focus",F=>{this.publish("geometry-in-focus",F)}),p(this,H).twoDVisiblitySystem=new E2(p(this,W)),p(this,H).drawSystem=new O2(p(this,W),this.convertTo3DMapPosition),p(this,H).drawSystem.on("texture-loaded",this.render),p(this,H).stackSystem=new k2(p(this,W)),p(this,H).twoDProjectionSystem=new w2(p(this,W),p(this,x1)),p(this,H).exporterSystem=new Bg(p(this,W)),p(this,H).meshOptimizationSystem=new T2(p(this,W),this.convertTo3DMapPosition),p(this,H).meshOptimizationSystem.on("model-loaded",this.render),p(this,H).meshOptimizationSystem.on("geometry-2d-added",this.render),p(this,H).meshDetachmentSystem=new sI(p(this,W)),p(this,H).meshModificationSystem=new aI(p(this,W)),p(this,H).customGeometrySystem=new X2(p(this,W),this.convertTo3DMapPosition),p(this,H).outlineInterpolationSystem=new Y2(p(this,W)),p(this,H).renderSystem=new _2(p(this,tn),p(this,W),this.mode,p(this,wr),p(this,Ir),this.viewCamera,p(this,H)),p(this,H).imageSystem=new tI(p(this,W),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),p(this,H).text3DSystem=new s2(p(this,W),this.convertTo3DMapPosition),p(this,H).text3DSystem.on("render",this.render),p(this,H).imageSystem.on("image-loaded",this.render),p(this,H).renderSystem.on("pre-render",()=>this.publish("pre-render")),p(this,H).renderSystem.on("post-render",()=>this.publish("post-render")),p(this,H).renderSystem.on("measure-canvas",p(this,$m)),p(this,H).outdoorLayersSystem=new nI(this.map),p(this,H).occlusion2DSystem=new cI(p(this,W),this.convertTo3DMapPosition,p(this,tn)),n.occlusionEnabled&&p(this,H).occlusion2DSystem.enable(),this.Debug=new lI(this),n.environment!==!1&&A(this,Uu,te(this,bn,d7).call(this)),p(this,pI).call(this)}get viewCamera(){return p(this,d1)}get canvasWidth(){return p(this,W).canvasWidth}get canvasHeight(){return p(this,W).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:yd()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return p(this,Bc)}addGroupContainer(r,n,o){if(!p(this,W).geometry3DMap.has(r)&&!p(this,W).geometry2DMap.has(r)){let i=new at(r);i.addEventListener("childadded",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),i.addEventListener("childremoved",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&i.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&gn(i,n.interactive,p(this,W)),(n==null?void 0:n.focusable)!==void 0&&nM(i,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(i.userData.preloadGeometry=n.preloadGeometry),p(this,W).geometry3DMap.set(r,i);let a=this.getParentContainer(o);a instanceof at&&a.addEntity(i),p(this,Wt).call(this),this.render()}else z.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addStackContainer(r,n,o){if(p(this,W).geometry3DMap.has(r))z.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let i=new at(r);i.addEventListener("childadded",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),i.addEventListener("childremoved",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),i.components[0]=new G2,(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),p(this,W).geometry3DMap.set(r,i);let a=this.getParentContainer(o);a instanceof at&&a.addEntity(i)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,o,i,a){if(p(this,W).geometry3DMap.has(r))z.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let l=new Fm(n,o),c=new Ot(l,new bs(i));(i==null?void 0:i.interactive)!==void 0&&gn(c,i.interactive,p(this,W)),c.id=r,l.mesh.userData={entityId:r,type:"custom-geometry"},p(this,W).geometry3DMap.set(c.id,c);let u=this.getParentContainer(a);u instanceof at&&u.addEntity(c),p(this,Wt).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,o,i){var a,c;if(!p(this,W).geometry3DMap.has(r)&&!p(this,W).geometry2DMap.has(r)){let u=new Sn(r,new UI(o));u.addEventListener("childadded",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),u.addEventListener("childremoved",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),u.userData.dirty=!0,p(this,W).geometry3DMap.set(r,u);for(let h of n.features){if(h.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(h.geometry.type))continue;let y=(h==null?void 0:h.id)||((a=h==null?void 0:h.properties)==null?void 0:a.id)||At(),l=o||{color:P9},{visible:b}=l,I=$n(l,["visible"]),S=p(this,H).meshOptimizationSystem.createEntityFromFeature(y,h,R(P({},I),{outline:!0}));p(this,W).geometry3DMap.set(y,S),u.userData.entities3D.add(y)}u.setVisible((c=o==null?void 0:o.visible)!=null?c:!0),(o==null?void 0:o.altitude)!=null&&u.setAltitude(o.altitude);let d=this.getParentContainer(i);d instanceof at&&d.addEntity(u),p(this,Wt).call(this),this.render()}else z.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return p(this,H).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let o=this.getParentContainer(n),i=p(this,H).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(r,i),i}addImage(r,n,o,i){try{iH(r,n,o)}catch(a){z.error(a);return}if(!p(this,W).geometry3DMap.has(r)&&!p(this,W).geometry2DMap.has(r)){let a=new eI(n),l=new Ot(a,new bs(o));l.id=r||At(),a.mesh.userData={entityId:l.id,type:"path"},p(this,W).geometry3DMap.set(l.id,l);let c=this.getParentContainer(i);c instanceof at&&c.addEntity(l),p(this,Wt).call(this),this.render()}else z.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,o,{parent:i,onComplete:a}={}){var l,c;try{Nz(r,n,o)}catch(u){z.error(u);return}if(!p(this,W).geometry3DMap.has(r)&&!p(this,W).geometry2DMap.has(r)){let u=new Sn(r,new UI(R(P({},o),{outline:!1})));u.addEventListener("childadded",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),u.addEventListener("childremoved",()=>{p(this,Wt).call(this),p(this,Nr).call(this)}),p(this,W).geometry3DMap.set(r,u),u.userData.dirty=!0,u.userData.modelURL=o.url;for(let h of n.features){let y=h.id||h.properties.id||At(),b=p(this,H).meshOptimizationSystem.createModelFromFeature(y,h,o);(h.properties.interactive!==void 0||o.interactive!=null)&&gn(b,(l=h.properties.interactive)!=null?l:o.interactive,p(this,W)),p(this,W).geometry3DMap.set(y,b),u.userData.entities3D.add(y)}let d=this.getParentContainer(i);d instanceof at&&d.addEntity(u),p(this,Wt).call(this),(c=this.render())==null||c.then(a)}else z.error("Model group with ID '".concat(r,"' already exists. The model group cannot be added."));return{id:r,type:"geometry-group"}}addMarker2D(r,n,o,i){var l;let a=o==null?void 0:o.id;try{nV(r,n,o||{})}catch(c){z.error(c);return}if(a===void 0||!p(this,W).geometry2DMap.has(a)&&!p(this,W).geometry3DMap.has(a)){let c=te(this,bn,u7).call(this,r,new ea(n,o),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);c.id=a||String(c.id),a=c.id,(o==null?void 0:o.interactive)!=null&&o.interactive!=="pointer-events-auto"&&gn(c,o==null?void 0:o.interactive,p(this,W));let u=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?p(this,W).geometry3DMap.get(o.attachTo):void 0;u instanceof Ot&&u.attach(c),(l=this.getParentContainer(i))==null||l.addEntity(c),this.render()}else z.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addText3D(r,n,o,i){if(!p(this,W).geometry3DMap.has(r)&&!p(this,W).geometry2DMap.has(r)){let a=new Pc(R(P({},n),{properties:R(P({},n.properties),{id:r,content:n.properties.text})})),l=new Ot(a,new Mh(o==null?void 0:o.appearance));l.id=r,a.mesh.userData.entityId=r.toString(),a.mesh.userData.type="text3d",p(this,W).geometry3DMap.set(r,l);let c=this.getParentContainer(i);c instanceof at&&c.addEntity(l),p(this,Wt).call(this),this.render()}else z.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,o={}){var u,d;try{if(!n||!r)throw new Error("content and meshGeometryId are required");KV.parse(o)}catch(h){z.error(h);return}let i=p(this,W).geometry3DMap.get(r);if((i==null?void 0:i.type)!=="geometry"){z.error(".labelText3D failed: target incorrect");return}let a=i==null?void 0:i.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let h=p(this,W).geometry3DMap.get(a.textEntityId);if((h==null?void 0:h.type)!=="text3d"){z.error(".labelText3D failed: existing text3d not found");return}return{id:h.id,type:h.type}}let l=new Pc({type:"Feature",geometry:{coordinates:(u=a.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:n,id:At()}});l.polygonEntityId=r;let c=new Ot(l,new Mh(o==null?void 0:o.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",p(this,W).geometry3DMap.set(c.id.toString(),c),o.parentId&&((d=this.getParentContainer(o.parentId))==null||d.addEntity(c)),this.render(),{id:c.id,type:"text3d"}}addLabel2D(r,n,o,i){var l;let a=o==null?void 0:o.id;try{HV(r,n,o||{})}catch(c){z.error(c);return}if(a===void 0||!p(this,W).geometry2DMap.has(a)&&!p(this,W).geometry3DMap.has(a)){let c=te(this,bn,u7).call(this,r,new ta(n,o||{},p(this,W)),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);c.id=a||String(c.id),a=c.id,(o==null?void 0:o.interactive)!=null&&gn(c,o==null?void 0:o.interactive,p(this,W));let u=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?p(this,W).geometry3DMap.get(o.attachTo):void 0;u instanceof Ot&&u.attach(c),(l=this.getParentContainer(i))==null||l.addEntity(c),p(this,Nr).call(this),this.render()}else z.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(r,n={},o){var c;try{Gz(r,n||{})}catch(u){z.error(u);return}let i=new Ac(r,oM(n)),a=new Ot(i,new bs({color:(c=n==null?void 0:n.color)!=null?c:"#ff834c"}));a.id=(n==null?void 0:n.id)||At(),i.mesh.userData={entityId:a.id,type:"path"},p(this,W).geometry3DMap.set(a.id,a),(n==null?void 0:n.interactive)!=null&&gn(a,n==null?void 0:n.interactive,p(this,W));let l=this.getParentContainer(o);return l instanceof at&&l.addEntity(a),p(this,Wt).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(r){p(this,H).watermarkSystem.options=r,p(this,H).watermarkSystem.dirty=!0,p(this,H).collisionSystem.collidersDirty=!0,this.render()}remove(r){var o;let n;if(typeof r=="string"||typeof r=="number"?(n=p(this,W).geometry2DMap.get(r),n==null&&(n=p(this,W).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=p(this,W).geometry2DMap.get(r.id),n==null&&(n=p(this,W).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")p(this,W).geometry3DMap.delete(n.id),n.object3d&&mr(n.object3d);else if(n.type==="group-container"){p(this,W).geometry3DMap.delete(n.userData.entityId);for(let a of n.childrenIds.values())this.remove(a),n.userData.entities2D.delete(a);let i=n.components[2];i&&i.focusMesh&&mr(i.focusMesh),mr(n)}else if(n.type==="geometry-group"){p(this,W).geometry3DMap.delete(n.userData.entityId);for(let i of n.userData.entities3D.values())this.remove(i),n.userData.entities3D.delete(i);mr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let i=n.components[0];if(n.entities2D.size>0){for(let a of n.entities2D.values())this.remove(a);n.removeAllEntities()}if(n.object3d&&(((o=n.parentObject3D)==null?void 0:o.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),mr(n.object3d)),n.type==="geometry"){let a=n.components[3];a&&(a.visible=!1,a.dirty=!0)}"focusMesh"in i&&i.focusMesh!=null&&mr(i.focusMesh),"textMesh"in i&&i.textMesh!=null&&this.remove(i.textMesh.userData.entityId),p(this,W).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let i=n.attachedTo;if(i){let a=p(this,W).geometry3DMap.get(i);a instanceof Ot&&a.detach(n)}n.object3d&&mr(n.object3d),n.type==="label"&&delete p(this,H).twoDDrawSystem.textCache[n.id],p(this,W).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&mr(n.object3d),p(this,W).geometry3DMap.delete(n.id);else if(n.type==="text3d"){mr(n.object3d);let{batchedText:i,textMesh:a,polygonEntityId:l}=n.components[0];if(a&&(i&&i.removeText(a),mr(a)),l){p(this,H).text3DSystem.remove(l);let c=p(this,W).geometry3DMap.get(l);(c==null?void 0:c.type)==="geometry"&&(c.components[0].textMesh=void 0,c.components[0].textEntityId=void 0)}p(this,W).geometry3DMap.delete(n.id)}p(this,Wt).call(this),p(this,Nr).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return p(this,wr)}getThreeCamera(){return p(this,Ir)}async setEnvironment(r){if(p(this,wr))if(r==="basic"){p(this,Uu)||A(this,Uu,te(this,bn,d7).call(this));let n=await p(this,Uu);p(this,wr).environment=n}else p(this,wr).environment=null}getEnvironment(){var r;return(r=p(this,wr))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return p(this,H).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(p(this,H).renderSystem.threeDdirty||p(this,H).renderSystem.twoDdirty)&&this.renderSync();let n=new Jr;if(r==null)n.setFromObject(p(this,W).entityScene);else{let o=wh(p(this,W),r);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let i=o.components[0],a=i instanceof yr?i.geometry:void 0;i.mesh instanceof Ab&&a?(a.computeBoundingBox(),a.boundingBox&&n.union(a.boundingBox)):n.setFromObject(o.object3d)}else((o==null?void 0:o.type)==="geometry-group"||(o==null?void 0:o.type)==="group-container")&&(o==null?void 0:o.userData.entityId)!=null&&n.setFromObject(o)}if(rp(n))return _9(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var o,i,a,l,c,u,d,h,y,b;if(r==null)return{type:"map-view",hoverColor:p(this,W).hoverColor,text3dHoverColor:p(this,W).text3dHoverColor};let n=wh(p(this,W),r);if((n==null?void 0:n.type)==="custom-geometry"){let I=n.components[0],S=n.components[1];return{id:n.id,type:"custom-geometry",visible:S.visible,altitude:S.altitude,parent:(o=n.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(I.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let I=[];for(let x of n.userData.entities3D.values()){let T=this.getState(x);((T==null?void 0:T.type)==="geometry"||(T==null?void 0:T.type)==="model")&&I.push(T)}let S=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:S.opacity,color:S.color,initialColor:S.initialColor,height:S.height,altitude:n.altitude,topColor:S.topColor,outline:S.outline,shading:S.shading,texture:S.texture,topTexture:S.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(x=>p(this,W).geometry3DMap.get(x)).every(x=>x&&x.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(x=>this.getState(x)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(I=>this.getState(I)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let I=n.components[0],S=n.object3d.parent,x=S==null?void 0:S.userData.entityId;return{id:n.id,type:"label",text:I.text||"",parent:{id:x,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:I.enabled,visible:I.visible,initialRank:dg(I.initialRank),options:{rank:dg(I.rank),appearance:I.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let I=n.components[0],S=n.object3d.parent,x=S==null?void 0:S.userData.entityId;return{id:n.id,type:"marker",enabled:I.enabled,visible:I.visible,anchor:I.options.anchor,dynamicResize:I.options.dynamicResize,parent:{id:x,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(n.position),element:I.containerEl,initialRank:dg(I.initialRank),options:{rank:dg(I.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:I.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:I,hoverColor:S,initialColor:x,initialTopColor:T,topColor:w}=n.components[1],M=n.components[0],O=n.components[1],_=n.components[2],$=n.components[3],j=n.parentObject3D;return{id:n.id,type:"geometry",opacity:O.opacity,initialColor:x,color:I,focusable:M.focusable,initialTopColor:T,topColor:w,hoverColor:S,hovered:!!(_!=null&&_.hover),height:O.height,visible:O.visible,outline:$==null?void 0:$.visible,showImage:O.showImage,texture:O.texture,topTexture:O.topTexture,flipImageToFaceCamera:O.flipImageToFaceCamera,parent:{id:j==null?void 0:j.userData.entityId,type:j==null?void 0:j.type},position:this.convert3DMapPositionToCoordinate(M.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let I=n.components[0],S=n.components[1],x=n.components[2];return{id:n.id,type:"model",position:I.mesh?this.convert3DMapPositionToCoordinate((i=I.mesh)==null?void 0:i.getWorldPosition(new Me)):this.convert3DMapPositionToCoordinate(I.position),interactive:x!=null,material:S.material,parent:(a=n.parentObject3D)!=null&&a.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:S.visible,verticalOffset:S.verticalOffset,color:S.color,opacity:S.opacity,rotation:(l=S.rotation)!=null?l:vd,scale:(c=S.scale)!=null?c:xd}}else if((n==null?void 0:n.type)==="path"){let I=n.components[0],S=n.components[2],x=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(I.position),visible:x.visible,interactive:S!=null,completeFraction:I.completeFraction,color:x.color,accentColor:I.accentColor,nearRadius:I.nearRadius,farRadius:I.farRadius,animateArrowsOnPath:I.animateArrowsOnPath,displayArrowsOnPath:I.displayArrowsOnPath,nearZoomLevel:I.nearZoomLevel,farZoomLevel:I.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let I=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(I.position),visible:n.components[1].visible,verticalOffset:(u=I.feature.properties.verticalOffset)!=null?u:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof Pc&&"textArea"in n.components[0].feature.properties){gz(n);let I=n.components[0],S=n.components[1],{textMesh:x}=I,T=(d=I.mesh)==null?void 0:d.parent;T instanceof at&&((h=T.children.find(O=>O.type==="batchedtext"))==null||h.getWorldPosition(p(this,S1))),p(this,jm).set(0,0,0);let w=x?x.getWorldPosition(p(this,jm)):p(this,jm);return Object.assign({},bd,S.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(w.add(p(this,S1))),visible:(y=I.visible)!=null?y:!1,content:(b=I.feature.properties.content)!=null?b:""})}else return}}setState(r,n){var i,a;if(typeof r=="object"&&n==null){"hoverColor"in r&&(p(this,W).hoverColor=(i=r.hoverColor)!=null?i:p(this,W).hoverColor),"text3dHoverColor"in r&&(p(this,W).text3dHoverColor=(a=r.text3dHoverColor)!=null?a:p(this,W).text3dHoverColor);return}let o=wh(p(this,W),r);if(o!=null){if(o.type==="custom-geometry"){let l=p(this,W).geometry3DMap.get(o.id);if(l instanceof Ot&&l.components[0]instanceof Fm){let c=n;ra(o,p(this,W),c.visible),c2(o,c.altitude),Q5(o,c.position,this.convertTo3DMapPosition),eM(o,this.getParentContainer(c.parent,!1))}}else if(o.type==="path"){let l=n;gn(o,l.interactive,p(this,W))&&p(this,Wt).call(this),c2(o,l.altitude),yz(o,p(this,W),l)}else if(o.type==="model"){let l=n;gn(o,l.interactive,p(this,W))&&p(this,Wt).call(this),ra(o,p(this,W),l.visible),xz(o,l)}else if(o.type==="group-container"){let l=n;ra(o,p(this,W),l.visible)&&(p(this,H).outlineInterpolationSystem.outlineOpacitiesDirty=!0,p(this,H).pathSystem.altitudeDirty=!0),c2(o,l.altitude)&&(p(this,H).pathSystem.altitudeDirty=!0),gn(o,l.interactive,p(this,W))&&p(this,Wt).call(this),rM(o,p(this,W),l.opacity)&&(p(this,H).outlineInterpolationSystem.outlineOpacitiesDirty=!0),l.preloadGeometry&&o.userData.preloadGeometry!==!0&&(o.userData.preloadGeometry=!0,p(this,H).outlineInterpolationSystem.geometries3DDirty=!0)}else if(o.type==="geometry-group"){let l=n;ra(o,p(this,W),l.visible)&&(p(this,H).outlineInterpolationSystem.outlineOpacitiesDirty=!0),rz(o,p(this,W),l),p2(o,p(this,W),l.outline),l.height!=null&&K5(o,p(this,W),l.height),l.altitude!=null&&o.setAltitude(l.altitude),dz(o,l),nz(o,l.shading),rM(o,p(this,W),l.opacity)&&(p(this,H).outlineInterpolationSystem.outlineOpacitiesDirty=!0),gn(o,l.interactive,p(this,W))&&(p(this,Wt).call(this),p(this,Nr).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof yr){let l=n;ra(o,p(this,W),l.visible)&&(p(this,H).outlineInterpolationSystem.outlineOpacitiesDirty=!0),p2(o,p(this,W),l.outline),oz(o,l),nM(o,l.focusable)&&(p(this,H).geometryInFocusSystem.focusablesDirty=!0),hz(o,l.renderOrder)&&(p(this,H).meshDetachmentSystem.dirty=!0),mz(o,l.opacity)&&(p(this,H).meshDetachmentSystem.dirty=!0,p(this,H).outlineInterpolationSystem.outlineOpacitiesDirty=!0),tM(o,l.flipImageToFaceCamera),l.height!=null&&K5(o,p(this,W),l.height),fz(o,l)&&(p(this,H).meshDetachmentSystem.dirty=!0),J5(o,l),cz(o,l.hoverColor),gn(o,l.interactive,p(this,W)),pz(o,l.hovered)}p(this,Wt).call(this)}else if(o.type==="label"||o.type==="marker"){let l=n;lz(o,n,p(this,W)),sz(o,n,p(this,W))&&(p(this,Nr).call(this),p(this,H).domMutationSystem.dirty=!0),Q5(o,l.position,this.convertTo3DMapPosition),eM(o,this.getParentContainer(l.parent,!1))&&(p(this,Nr).call(this),p(this,H).panBoundsSystem.dirty=!0),iz(o,l.enabled),ra(o,p(this,W),l.visible)}else if(o.type==="image"){let l=n;ra(o,p(this,W),l.visible),tM(o,l.flipImageToFaceCamera)}else if(o.type==="text3d"){let l=n;bz(o,p(this,W),l)}this.render()}}convertTo3DMapPosition(r,n,o=0,i){var c,u,d,h,y;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(c=r[2])!=null?c:o,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:l}=Vb((d=(u=p(this,W).center)==null?void 0:u[1])!=null?d:0,(y=(h=p(this,W).center)==null?void 0:h[0])!=null?y:0,r,n);return i?(i.set(a,l,o),i):new Me(a,l,o)}get backgroundColor(){return typeof p(this,tn).backgroundColor=="string"?p(this,tn).backgroundColor:"#".concat(p(this,tn).backgroundColor.getHexString())}get backgroundAlpha(){return p(this,tn).backgroundAlpha}getThreeRenderer(){return p(this,tn)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?U9(n):void 0}isInView(r){let n=wh(p(this,W),r);if(p(this,I1).identity().multiply(p(this,Ir).projectionMatrix).multiply(p(this,Ir).matrixWorldInverse),p(this,zu).setFromProjectionMatrix(p(this,I1)),n instanceof ip)return p(this,zu).containsPoint(n.position);if(n instanceof Ot){let o=n==null?void 0:n.components[0];if(o instanceof Fm||o instanceof Ec)return p(this,zu).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof yr){let i=new Jr(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return p(this,zu).intersectsBox(i)}}return!1}getSystems(){return p(this,H)}getInternalState(){return p(this,W)}getTweenGroup(){return p(this,W).tweenGroup}};wr=new WeakMap,Ir=new WeakMap,Uu=new WeakMap,d1=new WeakMap,Nm=new WeakMap,Nc=new WeakMap,Vu=new WeakMap,Bm=new WeakMap,bn=new WeakSet,p7=s(function(r){var n;p(this,Bc)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),p(this,W).pixelRatio=this.resolutionScale},"#setResolutionScale"),W=new WeakMap,Gt=new WeakMap,Qi=new WeakMap,Sr=new WeakMap,sa=new WeakMap,tn=new WeakMap,H=new WeakMap,f1=new WeakMap,Nr=new WeakMap,Wt=new WeakMap,xH=s(function(){A(this,Gt,document.createElement("div")),p(this,Gt).classList.add("mappedin__smart-collision-engine__container"),A(this,Qi,document.createElement("canvas")),p(this,Qi).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(p(this,Gt)),A(this,Sr,document.createElement("canvas")),p(this,Sr).classList.add("mappedin__smart-collision-engine__container"),p(this,Sr).width=p(this,Gt).clientWidth*this.resolutionScale,p(this,Sr).height=p(this,Gt).clientHeight*this.resolutionScale,p(this,Sr).style.width=p(this,Gt).clientWidth+"px",p(this,Sr).style.height=p(this,Gt).clientHeight+"px",p(this,Gt).appendChild(p(this,Qi)),p(this,Gt).appendChild(p(this,Sr)),p(this,Qi).width=p(this,Gt).clientWidth,p(this,Qi).height=p(this,Gt).clientHeight,p(this,Sr).width=p(this,Gt).clientWidth*this.resolutionScale,p(this,Sr).height=p(this,Gt).clientHeight*this.resolutionScale,p(this,Sr).style.width=p(this,Gt).clientWidth+"px",p(this,Sr).style.height=p(this,Gt).clientHeight+"px"},"#renderEntity2DContainer"),vH=s(function(){A(this,sa,document.createElement("div")),p(this,sa).classList.add("mappedin-2d-entities"),Object.assign(p(this,sa).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(p(this,sa))},"#renderEntityDOMContainer"),IH=s(function(){p(this,Sr).width=p(this,Gt).clientWidth*this.resolutionScale,p(this,Sr).height=p(this,Gt).clientHeight*this.resolutionScale,p(this,Sr).style.width=p(this,Gt).clientWidth+"px",p(this,Sr).style.height=p(this,Gt).clientHeight+"px",p(this,Qi).width=p(this,Gt).clientWidth,p(this,Qi).height=p(this,Gt).clientHeight,p(this,Sr).width=p(this,Gt).clientWidth*this.resolutionScale,p(this,Sr).height=p(this,Gt).clientHeight*this.resolutionScale,p(this,Sr).style.width=p(this,Gt).clientWidth+"px",p(this,Sr).style.height=p(this,Gt).clientHeight+"px",p(this,H).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Bc=new WeakMap,m1=new WeakMap,h1=new WeakMap,y1=new WeakMap,g1=new WeakMap,pI=new WeakMap,b1=new WeakMap,x1=new WeakMap,v1=new WeakMap,$m=new WeakMap,u7=s(function(r,n,o,i){let a=new ip(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i);return a.occluderId=o!=null?o:p(this,H).occlusion2DSystem.backgroundId,p(this,W).geometry2DMap.set(a.id,a),a},"#createEntity2D"),zu=new WeakMap,I1=new WeakMap,eo=new WeakMap,to=new WeakMap,d7=s(async function(){return kc.load(tU).then(r=>{var n;return p(this,wr)&&((n=p(this,wr).environment)==null||n.dispose(),r.mapping=W6,p(this,wr).environment=r,this.render()),r})},"#loadEnvMap"),jm=new WeakMap,S1=new WeakMap,s(y7,"Core");var c7=y7,C1=c7;f();function N0e(e,t){B0e(e,t)(e.getScene(),t),$0e(e,t),t.addFolder("Export").add({export:s(async()=>{let a=await e.getCurrentSceneGLTF({binary:!0}),l=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let u=window.URL.createObjectURL(l);c.href=u,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(u)},"export")},"export");let o=t.addFolder("Camera"),i={get bearing(){return e.camera.bearing},set bearing(a){e.camera.setBearing(a)},get pitch(){return e.camera.pitch},set pitch(a){e.camera.setPitch(a)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(a){e.camera.setZoomLevel(a)}};o.add(i,"bearing",-359,359,1),o.add(i,"pitch",e.camera.minPitch,e.camera.maxPitch,1),o.add(i,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}s(N0e,"mountSceneGraphVisualizer");function B0e(e,t){let r=t;return s(function n(o,i){let a=i.addFolder("".concat([o.type]," ").concat(o.id.slice(0,16)));if(i.close(),o.type==="geometry"||o.type==="model"||o.type==="path"||o.type==="image"){let l={get height(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"?c.height:0},set height(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(o,{height:c})},set flipImageToFaceCamera(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="image"&&e.setState(o,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="image"?c.flipImageToFaceCamera:!1},set visible(c){let u=e.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&e.setState(o,{visible:c})},get visible(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?c.visible:!1},set outline(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(o,{outline:c})},get outline(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"?c.outline:!1},get opacity(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"?c.opacity:1},set opacity(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(u,{opacity:c})},get color(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"&&c.color?Pe(c.color).toHexString():"#ffffff"},set color(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(u,{color:c})},set interactive(c){let u=e.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(e.setState(o,{interactive:c}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"?c.interactive:!1},get completeFraction(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="path"?c.completeFraction:1},set completeFraction(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="path"&&e.setState(u,{completeFraction:c})},focus:s(()=>{},"focus")};a.add(l,"focus").onChange(()=>{let c=e.getState(o.id);(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?e.camera.focusOn([c.position]):(c==null?void 0:c.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(c))}),a.add(l,"visible"),o.type==="image"?a.add(l,"flipImageToFaceCamera"):(a.add(l,"interactive"),o.type==="path"&&a.add(l,"completeFraction",0,1,.1),o.type!=="model"&&(a.addColor(l,"color"),a.add(l,"outline"))),o.type==="geometry"&&(a.add(l,"height"),a.add(l,"opacity",0,1,.1))}else if(o.type==="marker"){let l={get interactive(){var u;let c=e.getState(o.id);return(c==null?void 0:c.type)==="marker"?(u=c.options)==null?void 0:u.interactive:!1},set interactive(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="marker"&&(e.setState(u,{options:{interactive:c}}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},focus:s(()=>{},"focus")};a.add(l,"focus").onChange(()=>{let c=e.getState(o.id);(c==null?void 0:c.type)==="marker"&&e.camera.focusOn([c.position])}),a.add(l,"interactive")}else if(o.type==="label"){let l={get interactive(){var u;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(u=c.options)==null?void 0:u.interactive:!1},set interactive(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&(e.setState(u,{options:{interactive:c}}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get text(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:c})},get"Text Color"(){var u,d;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(d=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:d.foregroundColor:"#000000"},set"Text Color"(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(o.id,{text:l.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var u,d;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(d=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:d.size:10},set"Text Size"(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var u,d;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.iconSize:10},set"Icon Size"(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var u,d,h;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(h=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:h.active:"#000000"},set"Active Foreground Color"(c){var d,h;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l.text,options:{appearance:{marker:{foregroundColor:R(P({},(h=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:h.foregroundColor),{active:c})}}}})},get"Inactive Foreground Color"(){var u,d,h;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(h=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:h.inactive:"#000000"},set"Inactive Foreground Color"(c){var d,h;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l.text,options:{appearance:{marker:{foregroundColor:R(P({},(h=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:h.foregroundColor),{inactive:c})}}}})},get"Active Background Color"(){var u,d,h;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(h=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:h.active:"#000000"},set"Active Background Color"(c){var d,h;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l.text,options:{appearance:{marker:{backgroundColor:R(P({},(h=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:h.backgroundColor),{active:c})}}}})},get"Inactive Background Color"(){var u,d,h;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(h=(d=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:h.inactive:"#000000"},set"Inactive Background Color"(c){var d,h;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l.text,options:{appearance:{marker:{backgroundColor:R(P({},(h=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:h.backgroundColor),{inactive:c})}}}})},focus:s(()=>{},"focus")};a.add(l,"focus").onChange(()=>{let c=e.getState(o.id);(c==null?void 0:c.type)==="label"&&e.camera.focusOn([c.position])}),a.add(l,"interactive"),a.add(l,"text"),a.add(l,"Text Size",10,50),a.add(l,"Icon Size",10,50),a.addColor(l,"Text Color"),a.addColor(l,"Active Background Color"),a.addColor(l,"Inactive Background Color"),a.addColor(l,"Active Foreground Color"),a.addColor(l,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let l={get opacity(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.opacity:1},set opacity(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{opacity:c})},set visible(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{visible:c})},get visible(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.visible:!1},set outline(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{outline:c})},get outline(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.outline:!1},set interactive(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&(e.setState(o,{interactive:c}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var u,d;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(d=(u=c.shading)==null?void 0:u.start)!=null?d:0},set shadingStart(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{start:c}})},get shadingEnd(){var u,d;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(d=(u=c.shading)==null?void 0:u.end)!=null?d:0},set shadingEnd(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{end:c}})},get shadingIntensity(){var u,d;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(d=(u=c.shading)==null?void 0:u.intensity)!=null?d:0},set shadingIntensity(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{intensity:c}})}};a.add(l,"visible"),a.add(l,"opacity",0,1,.1),a.add(l,"interactive"),a.add(l,"outline"),a.add(l,"shadingStart",0,1,.1),a.add(l,"shadingEnd",0,1,.1),a.add(l,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let l={set visible(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="group-container"&&e.setState(o,{visible:c})},get visible(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="group-container"?c.visible:!1},set interactive(c){let u=e.getState(o.id);(u==null?void 0:u.type)==="group-container"&&(e.setState(u,{interactive:c}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="group-container"?c.interactive:!1}};a.add(l,"visible"),a.add(l,"interactive")}if(a.close(),o.children)for(let l of o.children.values())n(l,a)},"parseChild")}s(B0e,"createParseChild");function $0e(e,t){let r=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};r.add(n,"padding",0,100,1),r.add(n,"scale",.5,1.5,.1),r.add(n,"color",["dark","light"]),r.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),r.add(n,"iconOnly"),r.onChange(()=>{e.updateWatermark(n)})}s($0e,"createWatermarkChild");var SH="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",j0e="https://auth.mappedin.com/oauth2/token";async function CH(e,t){var r,n,o,i,a,l;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:c,MercatorCoordinate:u}=await import("./outdoor-context-v4-T22T5B5J.js"),d=t.outdoorView.headers;d==null&&(d=await B9(j0e));let h=t.center||[0,0],y=new c({container:e,style:t.outdoorView.style||SH,center:h,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:h7,pitch:(o=t.pitch)!=null?o:f7,bearing:(i=t.bearing)!=null?i:m7,transformRequest:F9(d),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:yd(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),b=y.painter.context.gl,I=new C1(e,{center:h,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:b,map:y,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(a=t.naturalBearing)!=null?a:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError,useStandaloneCamera:(l=t.useStandaloneCamera)!=null?l:!1}),S={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(I.camera.minZoomLevel),y.setMaxZoom(I.camera.maxZoomLevel),I.on("camera-change",_=>{S.center=_.center,S.zoom=_.zoomLevel,S.bearing=_.bearing,S.pitch=_.pitch,y.jumpTo(S)});let x=u.fromLngLat(h,0),T=zb(x,I.viewCamera,I.camera,()=>{I.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(T),I.renderSync())});let w=!1,M=!1;y.on("idle",()=>{y&&(w||(I.publish("outdoor-view-loaded"),w=!0),M||(M=!0,I.publish("outdoor-style-loaded")))});let O=s(_=>{_&&(_.sourceDataType==="metadata"||_.sourceDataType==="visibility"||_.dataType==="style"||_.type==="terrain")&&I.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",_=>{y&&_&&_.dataType==="style"&&_.type==="styledata"&&(M=!1),O(_)}),y.on("sourcedata",O),y.on("terrain",O),y.on("error",_=>{var $;if((($=_.error)==null?void 0:$.url)===SH){z.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(d["x-mappedin-tiles-key"],'"'));return}z.warn(_)}),I}else return new C1(e,t)}s(CH,"createRenderer");f();f();f();var T1=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(T1||{}),P1=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(P1||{});f();f();var Gm=class Gm{constructor(t,r,n){m(this,"id");m(this,"text");m(this,"target");m(this,"__type",Gm.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===Gm.__type}get focusTarget(){return this.target.anchorTarget}};s(Gm,"Label"),m(Gm,"__type","Label");var $c=Gm;f();var Hu,Um=class Um{constructor(t,r,n){m(this,"id");E(this,Hu);m(this,"__type",Um.__type);m(this,"contentEl");this.id=t,this.contentEl=r,A(this,Hu,n)}get target(){return p(this,Hu)}get coordinate(){return p(this,Hu).anchorTarget}static is(t){return t.__type===Um.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){A(this,Hu,t)}};Hu=new WeakMap,s(Um,"Marker"),m(Um,"__type","Marker");var vl=Um;f();var M1,O1,Vm=class Vm{constructor(t,r,n){E(this,M1);E(this,O1);m(this,"target");m(this,"__type",Vm.__type);A(this,M1,t),A(this,O1,r),this.target=n}static is(t){return t.__type===Vm.__type}get id(){return p(this,M1)}get url(){return p(this,O1)}};M1=new WeakMap,O1=new WeakMap,s(Vm,"Image"),m(Vm,"__type","Image");var w1=Vm;f();var Hm,zm=class zm{constructor(t,r,n){m(this,"id");m(this,"groupId");m(this,"__type",zm.__type);E(this,Hm);this.id=t,this.groupId=r,A(this,Hm,n)}get target(){return p(this,Hm)}static is(t){return t.__type===zm.__type}updateTarget(t){A(this,Hm,t)}};Hm=new WeakMap,s(zm,"Model"),m(zm,"__type","Model");var Wu=zm;f();var Wm=class Wm{constructor(t,r){m(this,"id");m(this,"coordinates");m(this,"__type",Wm.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===Wm.__type}get focusTarget(){return this.coordinates}};s(Wm,"PathSegment"),m(Wm,"__type","PathSegment");var Zm=Wm,qm=class qm{constructor(t,r,n,o){m(this,"id");m(this,"animation");m(this,"coordinates");m(this,"segments");m(this,"__type",qm.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=o.map(({id:i,coordinates:a})=>new Zm(i.toString(),a))}static is(t){return t.__type===qm.__type}get focusTarget(){return this.coordinates}};s(qm,"Path"),m(qm,"__type","Path");var es=qm;f();var jc,g7=class g7{constructor(t){E(this,jc);A(this,jc,t)}get center(){return p(this,jc).center}get bearing(){return p(this,jc).bearing}get pitch(){return p(this,jc).pitch}get zoomLevel(){return p(this,jc).zoomLevel}};jc=new WeakMap,s(g7,"CameraTransform");var E1=g7;f();var Xm=class Xm{constructor(t){m(this,"id");m(this,"__type",Xm.__type);this.id=t}static is(t){return t.__type===Xm.__type}get focusTarget(){return this}};s(Xm,"Shape"),m(Xm,"__type","Shape");var Gc=Xm;f();var _1=class _1{constructor(t,r){m(this,"id");m(this,"target");m(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===_1.__type}};s(_1,"Text3D"),m(_1,"__type","Text3D");var Uc=_1;f();f();f();var G0e=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),U0e=/<svg([^>]*)>/g;function TH(e,t,r){let n=G0e.get(e);return n?n.replace(U0e,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}s(TH,"getStyledIcon");var V0e=s(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(e,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),z0e=s(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(e,'"\n />\n </svg>\n '),"getDestinationPin"),b7="#722ED1",x7="#1890FF",PH=s(({type:e="departure",color:t=x7})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?V0e(t):z0e(t),"\n </div>"),"DroppedPin"),H0e=s(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),wH=s(({type:e="stairs",color:t=b7,direction:r="up"})=>{let n=H0e("default"),o=n/2+2,i=r&&r!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(TH("connection-"+e+"-16x16","white",o)||"","\n </div>\n ").concat(i?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(r==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(o,"px; height: ").concat(o,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");f();var MH=s(async e=>new Promise(t=>setTimeout(t,e)),"ms");var W0e={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},q0e={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},Vc={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:W0e,inactivePathOptions:q0e,markerOptions:{departureColor:x7,destinationColor:b7},animatePathDrawing:!0},Il,ts,Sl,dt,A1,Cl,qu,Br,rs,vo,ns,zc,Mr,OH,EH,v7,uI,Ym,I7,Km,S7=class S7{constructor(t,r,n){E(this,Mr);E(this,Il,new Map);E(this,ts);E(this,Sl);E(this,dt,Vc);E(this,A1);E(this,Cl);E(this,qu);E(this,Br,[]);E(this,rs);E(this,vo,new Map);E(this,ns,new Map);E(this,zc,new Map);E(this,Km,s(t=>{var r;if((r=p(this,dt).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=p(this,Il).get(t.markers[0]);n!=null&&n.action.toFloor&&(p(this,dt).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}},"#handleClick"));A(this,ts,t),A(this,A1,n),A(this,Sl,r)}get currentMap(){return p(this,A1).call(this)}get isMultiFloor(){if(!p(this,Br).length)return!1;let t=new Set;for(let r of p(this,Br))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return p(this,vo).get(t)}getMarkerById(t){return p(this,Il).get(t)}get paths(){let t=new Set;return p(this,vo).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return p(this,zc).get(p(this,rs))}get activePath(){var t;if(p(this,rs))return(t=p(this,vo).get(p(this,rs).id))==null?void 0:t.path}get floorStacks(){let t=p(this,Sl).getMapData();if(!p(this,Br).length||!t)return[];let r=new Set;for(let n of p(this,Br))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i.floorStack)}return Array.from(r)}get floors(){let t=p(this,Sl).getMapData();if(!p(this,Br).length||!t)return[];let r=new Set;for(let n of p(this,Br))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i)}return Array.from(r)}setActivePathByIndex(t){let r=p(this,Br)[t];if(!p(this,Br).length){z.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!p(this,Br)[t]){z.warn("Direction #".concat(t," does not exist"));return}let n=p(this,ns).get(r);if(!n){z.warn("The direction is not a part of muli-direcional path");return}te(this,Mr,uI).call(this,n)}setActivePath(t){if(!p(this,Br).length){z.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!p(this,zc).get(t)){z.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}te(this,Mr,uI).call(this,t)}setActivePathByDirections(t){if(!p(this,Br).length){z.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=p(this,ns).get(t);if(!r){z.warn("The direction is not a part of muli-direcional path");return}te(this,Mr,uI).call(this,r)}drawSync(t,r={}){var l,c,u;p(this,qu)&&this.clear(),A(this,qu,!0),te(this,Mr,v7).call(this,r);let n=Array.isArray(t)?t:[t],o=n[0],i=n[n.length-1],a=o.coordinates[0];A(this,Br,n),a.floorId&&p(this,dt).setMapToDeparture&&this.currentMap.setFloor(a.floorId),(l=p(this,dt).createMarkers)!=null&&l.departure&&te(this,Mr,Ym).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let d=0;d<n.length;d++){let h=n[d],y=d?P({},p(this,dt).inactivePathOptions):P({},p(this,dt).pathOptions);if(h.coordinates.length<2){z.warn("Directions must have at least 2 coordinates");return}let b=this.currentMap.Paths.add(h.coordinates,R(P({},y),{animateDrawing:p(this,dt).animatePathDrawing})),I=b.paths.map(x=>x.id.toString()),S=new es(At(),b.animation,h.coordinates,b.paths);for(let x of I){p(this,vo).set(x,{path:S,entityIds:I});let T=d?R(P({},p(this,dt).inactivePathOptions),{altitude:0}):R(P({},p(this,dt).pathOptions),{altitude:.05});p(this,ts).setState(x,T)}p(this,vo).set(S.id,{path:S,entityIds:I}),p(this,ns).set(h,S),p(this,zc).set(S,h),(c=p(this,dt).createMarkers)!=null&&c.connection&&te(this,Mr,I7).call(this,h.instructions,"connection"),d===0&&(A(this,rs,p(this,ns).get(p(this,Br)[0])),p(this,ts).on("click",p(this,Km)))}(u=p(this,dt).createMarkers)!=null&&u.destination&&te(this,Mr,Ym).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),p(this,Sl).mapObjects.forEach(d=>{d.processFloorChange(d.currentFloorId)})}async draw(t,r={}){p(this,Cl)&&this.clear(),te(this,Mr,v7).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0].coordinates[0];return A(this,Br,n),i.floorId&&p(this,dt).setMapToDeparture&&this.currentMap.setFloor(i.floorId),te(this,Mr,EH).call(this,n)}clear(){p(this,Il).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),p(this,Il).clear(),p(this,vo).forEach(({path:t,entityIds:r})=>{p(this,vo).delete(t.id),r.forEach(n=>p(this,vo).delete(n)),this.currentMap.Paths.remove(r)}),p(this,Cl)&&(p(this,Cl).cancel(),A(this,Cl,void 0)),p(this,qu)&&A(this,qu,!1),A(this,Br,[]),p(this,ns).clear(),p(this,zc).clear(),A(this,rs,void 0),p(this,ts).off("click",p(this,Km)),p(this,Sl).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};Il=new WeakMap,ts=new WeakMap,Sl=new WeakMap,dt=new WeakMap,A1=new WeakMap,Cl=new WeakMap,qu=new WeakMap,Br=new WeakMap,rs=new WeakMap,vo=new WeakMap,ns=new WeakMap,zc=new WeakMap,Mr=new WeakSet,OH=s(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),EH=s(function(t){let r=t[0],n=t[t.length-1],o=!1;return A(this,Cl,{promise:new Promise(async i=>{var a,l,c;if(v.env.NODE_ENV!=="test"&&await MH(500),o||!t.length){i();return}(a=p(this,dt).createMarkers)!=null&&a.departure&&te(this,Mr,Ym).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let u=0;u<t.length;u++){let d=t[u],h=u?P({},p(this,dt).inactivePathOptions):P({},p(this,dt).pathOptions);if(d.coordinates.length<2){z.warn("Directions must have at least 2 coordinates"),i();return}let y=this.currentMap.Paths.add(d.coordinates,R(P({},h),{animateDrawing:p(this,dt).animatePathDrawing})),b=y.paths.map(S=>S.id.toString()),I=new es(At(),y.animation,d.coordinates,y.paths);for(let S of b){p(this,vo).set(S,{path:I,entityIds:b});let x=u?R(P({},p(this,dt).inactivePathOptions),{altitude:0}):R(P({},p(this,dt).pathOptions),{altitude:.05});p(this,ts).setState(S,x)}if(p(this,vo).set(I.id,{path:I,entityIds:b}),p(this,ns).set(d,I),p(this,zc).set(I,d),v.env.NODE_ENV!=="test"&&await y.animation,o){i();return}(l=p(this,dt).createMarkers)!=null&&l.connection&&te(this,Mr,I7).call(this,d.instructions,"connection"),u===0&&(A(this,rs,p(this,ns).get(p(this,Br)[0])),p(this,ts).on("click",p(this,Km)))}if((c=p(this,dt).createMarkers)!=null&&c.destination&&te(this,Mr,Ym).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),o){i();return}p(this,Sl).mapObjects.forEach(u=>{u.processFloorChange(u.currentFloorId)}),i()}),cancel:s(()=>{o=!0},"cancel")}),p(this,Cl).promise},"#drawAsync"),v7=s(function(t){var r,n,o;A(this,dt,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:Vc.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:Vc.setMapToDeparture,pathOptions:P(P({},Vc.pathOptions),t.pathOptions),inactivePathOptions:P(P({},Vc.inactivePathOptions),t.inactivePathOptions),createMarkers:P(P({},Vc.createMarkers),t.createMarkers),markerOptions:P(P({},Vc.markerOptions),t.markerOptions),animatePathDrawing:(o=t.animatePathDrawing)!=null?o:Vc.animatePathDrawing})},"#setupOptions"),uI=s(function(t){A(this,rs,t),p(this,Br).forEach(r=>{let n=p(this,ns).get(r);if(n){let o=p(this,vo).get(n.id),i=o.path.id===p(this,rs).id?R(P({},p(this,dt).pathOptions),{altitude:.05}):R(P({},p(this,dt).inactivePathOptions),{altitude:0});o.entityIds.forEach(a=>{p(this,ts).setState(a,i)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),Ym=s(function(t,r,n){var o,i,a,l,c;if(r==="connection"&&n){let u=n.action.type==="ExitConnection"?p(this,dt).markerOptions.departureColor:p(this,dt).markerOptions.destinationColor,d;if(typeof((o=p(this,dt).createMarkers)==null?void 0:o.connection)=="function"){let y=p(this,dt).createMarkers.connection(n);p(this,ts).setState(y.id.toString(),{options:{interactive:!0}}),d={id:y.id,type:"marker"}}else d=this.currentMap.Markers.add(n.coordinate,wH({type:(a=(i=n.action.connection)==null?void 0:i.type)!=null?a:n.action.connectionType,color:u,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let h=this.currentMap.Markers.getContentEl(d.id.toString());if(!h)throw new Error("marker component should exist");p(this,Il).set(d.id,{instruction:n,marker:new vl(d.id.toString(),h,n.coordinate)})}else{let u=r==="departure"?p(this,dt).markerOptions.departureColor:p(this,dt).markerOptions.destinationColor,d;typeof((l=p(this,dt).createMarkers)==null?void 0:l.departure)=="function"&&r==="departure"?d={id:p(this,dt).createMarkers.departure(n).id,type:"marker"}:typeof((c=p(this,dt).createMarkers)==null?void 0:c.destination)=="function"&&r==="destination"?d={id:p(this,dt).createMarkers.destination(n).id,type:"marker"}:d=this.currentMap.Markers.add(t,PH({type:r,color:u}),{anchor:"top",rank:"always-visible"}),p(this,Il).set(d.id,void 0)}},"#addMarker"),I7=s(function(t,r){t.filter(o=>te(this,Mr,OH).call(this,o.action)).forEach(o=>{te(this,Mr,Ym).call(this,o.coordinate,r,o)})},"#addMarkers"),Km=new WeakMap,s(S7,"Navigation");var k1=S7;f();f();f();var Z0e=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),X0e=/<svg([^>]*)>/g;function _H(e,t,r){let n=Z0e.get(e);return n?n.replace(X0e,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}s(_H,"getStyledIcon");var Zu,Jm,Io,C7,kH,AH,T7,DH,P7=class P7{constructor(t,r){E(this,Io);E(this,Zu);E(this,Jm);m(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});A(this,Zu,t),A(this,Jm,r)}auto(){let t=[],r=p(this,Jm)[Object.keys(p(this,Jm))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(o=>{let i=n.name||n.externalId;if(i){let a=p(this,Zu).Labels.add(o,i,te(this,Io,C7).call(this,n));t.push(a)}});else{n.__type==="space"&&n.name!==""&&p(this,Zu).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let o=n.name;if(o){let i=p(this,Zu).Labels.add(n,o,te(this,Io,C7).call(this,n));t.push(i)}}}),{labels:t}}};Zu=new WeakMap,Jm=new WeakMap,Io=new WeakSet,C7=s(function(t){let r=_H(te(this,Io,kH).call(this,t),"white",12);return{appearance:{text:{foregroundColor:te(this,Io,T7).call(this,t)},marker:{foregroundColor:{active:te(this,Io,T7).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:te(this,Io,DH).call(this,t)}},"#generatLabelAppearance"),kH=s(function(t){return t.__type==="connection"?te(this,Io,AH).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),AH=s(function(t){let r="";switch(t){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r},"#attemptIconNameForConnection"),T7=s(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),DH=s(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),s(P7,"Labels");var dI=P7;var w7=class w7{constructor(t,r){m(this,"Labels");m(this,"auto",s(()=>this.Labels.auto(),"auto"));this.Labels=new dI(t,r)}};s(w7,"DefaultTheme");var fI=w7;f();var Ve,F1,Tl,mI,M7,O7=class O7{constructor(t){E(this,Tl);E(this,Ve);E(this,F1);m(this,"interactions",{set:s(t=>{(t==null?void 0:t.pan)!=null&&(p(this,Ve).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(p(this,Ve).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(p(this,Ve).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:s(()=>{p(this,Ve).getSystems().cameraSystem.enablePan=!0,p(this,Ve).getSystems().cameraSystem.enableZoom=!0,p(this,Ve).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:s(()=>{p(this,Ve).getSystems().cameraSystem.enablePan=!1,p(this,Ve).getSystems().cameraSystem.enableZoom=!1,p(this,Ve).getSystems().cameraSystem.enableRotate=!1},"disable")});m(this,"setMinPitch",s(t=>{p(this,Ve).camera.setMinPitch(t)},"setMinPitch"));m(this,"setMaxPitch",s(t=>{p(this,Ve).camera.setMaxPitch(t)},"setMaxPitch"));m(this,"setMinZoomLevel",s(t=>{p(this,Ve).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));m(this,"setMaxZoomLevel",s(t=>{p(this,Ve).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));A(this,F1,t),A(this,Ve,t.core)}setScreenOffsets(t){p(this,Ve).camera.setInsetPadding(t)}get screenOffsets(){return p(this,Ve).camera.insetsPadding}get panMode(){return p(this,Ve).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&p(this,Ve).camera.setPanMode(t)}getFocusOnTransform(t,r){var o;let n=p(this,Ve).camera.getCameraFrameForCoordinates(te(this,Tl,M7).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(o=r==null?void 0:r.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new $e(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return p(this,Ve).camera.focusOn(te(this,Tl,M7).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,verticalPadding:(n=r==null?void 0:r.axisAlignedPadding)==null?void 0:n.vertical,easing:r==null?void 0:r.easing})}animateTo(t,r){var c;let{center:n,zoomLevel:o,bearing:i,pitch:a}=t,l=n!=null?n:this.center;return p(this,Ve).camera.animateTo({center:n!=null?[l.longitude,l.latitude,p(this,Ve).camera.elevation]:void 0,zoomLevel:o,bearing:i,pitch:a,duration:(c=r==null?void 0:r.duration)!=null?c:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:o=this.bearing,pitch:i=this.pitch}=t,a=[r.longitude,r.latitude];p(this,Ve).camera.setCenter(a),p(this,Ve).camera.setZoomLevel(n),p(this,Ve).camera.setBearing(o),p(this,Ve).camera.setPitch(i)}get center(){let t=p(this,Ve).camera.center;return new $e(t[1],t[0],void 0)}setAutoMinZoomLevel(t){p(this,Ve).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return p(this,Ve).camera.autoMinZoomLevel}get zoomLevel(){return p(this,Ve).camera.zoomLevel}get pitch(){return p(this,Ve).camera.pitch}get minPitch(){return p(this,Ve).camera.minPitch}get maxPitch(){return p(this,Ve).camera.maxPitch}get bearing(){let t=p(this,Ve).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return p(this,Ve).camera.minZoomLevel}get maxZoomLevel(){return p(this,Ve).camera.maxZoomLevel}setElevation(t){p(this,Ve).camera.setElevation(t)}get elevation(){return p(this,Ve).camera.elevation}animateElevation(t,r){return p(this,Ve).camera.animateElevation(t,r)}updateFacadesInView(){p(this,Ve).getSystems().geometryInFocusSystem.raycast()}};Ve=new WeakMap,F1=new WeakMap,Tl=new WeakSet,mI=s(function(t){var n,o,i,a,l,c;let r=p(this,Ve).camera.elevation;return $e.is(t)&&t.floorId!=null?(o=(n=p(this,Ve).getState(t.floorId))==null?void 0:n.altitude)!=null?o:r:Gn.is(t)?(a=(i=p(this,Ve).getState(t.id))==null?void 0:i.altitude)!=null?a:r:"floor"in t&&Gn.is(t.floor)&&(c=(l=p(this,Ve).getState(t.floor.id))==null?void 0:l.altitude)!=null?c:r},"#getFloorAltitude"),M7=s(function(t){var i;let r=[],o=(Array.isArray(t)?t:[t]).flatMap(a=>{var l;return(l=a==null?void 0:a.focusTarget)!=null?l:[a]});for(let a of o)if(a!=null)if($e.is(a)){let l=te(this,Tl,mI).call(this,a);r.push([a.longitude,a.latitude,l])}else if((a==null?void 0:a.id)!=null){let l=te(this,Tl,mI).call(this,a);if(Gn.is(a)&&((i=p(this,F1).getMapDataInternal())!=null&&i.enterpriseMode)){r.push(a.id);continue}else if("geoJSON"in a&&a.geoJSON.geometry.coordinates.length>0){C9(a.geoJSON,u=>{r.push([u[0],u[1],l])});continue}let c=p(this,Ve).getBoundingArea(a.id);if(c)r.push(...c.map(u=>[u[0],u[1],l]));else if("geoJSONBoundingBox"in a){let u=te(this,Tl,mI).call(this,a);if(a.geoJSONBoundingBox!=null){let d=[[a.geoJSONBoundingBox[0],a.geoJSONBoundingBox[1],u],[a.geoJSONBoundingBox[2],a.geoJSONBoundingBox[3],u]];r.push(...d)}}}else tS(a)&&r.push(a);return r},"#computeCoordinateCloud"),s(O7,"Camera");var D1=O7;f();var Qm,E7=class E7{constructor({currentMapGetter:t}){E(this,Qm);A(this,Qm,t)}get currentMap(){return p(this,Qm).call(this)}async getCurrentSceneGLTF(t){let r=p(this,Qm).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(z.error("There is no map to export. Please load a map first."),new Blob)}};Qm=new WeakMap,s(E7,"Exporter");var L1=E7;f();var aa,N1,_7=class _7{constructor({currentMapGetter:t}){E(this,aa,new Map);E(this,N1);A(this,N1,t)}get currentMap(){return p(this,N1).call(this)}getById(t){return p(this,aa).get(t)}add(t,r,n){let o=t.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Labels.add(o,r,R(P({},n),{attachTo:eh(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),l=new $c(a.id.toString(),r,t);return p(this,aa).set(l.id,{label:l,entityId:l.id}),l}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:s((o,i,a)=>{let l=new $c(o.toString(),i,a);p(this,aa).set(l.id,{label:l,entityId:l.id}),r.push(l)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=p(this,aa).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),p(this,aa).delete(t.id.toString()))}removeAll(){let t=[];return p(this,aa).forEach(({label:r})=>{this.remove(r),t.push(r),p(this,aa).delete(r.id.toString())}),t}};aa=new WeakMap,N1=new WeakMap,s(_7,"Labels");var R1=_7;f();f();var k7={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},FH={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},LH=.5,F7=class F7{constructor(t,r,n=new Map){m(this,"containerId");m(this,"layers");m(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};s(F7,"Layer");var Pl=F7,Xu,L7=class L7{constructor(t,r,n,o,i,a,l,c){m(this,"id");m(this,"name");m(this,"elevation");m(this,"containerId");m(this,"externalId");m(this,"metadata");m(this,"shortName");m(this,"subtitle");m(this,"occluderId");m(this,"loaded",!1);m(this,"styleMap",{});m(this,"obstructions");m(this,"entrances");m(this,"spaces");m(this,"floorImages");m(this,"floorText");m(this,"renderer");m(this,"options");m(this,"layers",new Map);m(this,"footprint");m(this,"floorStackId");m(this,"multiFloorView");m(this,"mapDataInternal");m(this,"facadesByStyleId",new Map);E(this,Xu);m(this,"load",s(()=>{var o,i,a,l,c,u,d,h,y,b,I,S,x,T;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Ea,"-").concat(this.id),{},this.id);this.layers.set(Ea,new Pl(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(Ts,"-").concat(this.id),{},this.id);this.layers.set(Ts,new Pl(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Or,"-").concat(this.id),{},this.id);if(this.layers.set(Or,new Pl(this.renderer,n.id.toString())),((o=this.footprint)==null?void 0:o.geometry)!=null&&((i=this.footprint)==null?void 0:i.geometry.coordinates.length)!==0){let w=k7;if(this.obstructions!=null&&this.obstructions.features.length>0){let _=this.obstructions.features.filter($=>$.geometry.type==="LineString"&&$.properties.kind==="Wall"&&$.properties.footprintComponent===!0);_!=null&&_.length>0&&(w=this.styleMap[(a=_[0].properties)==null?void 0:a.id])}let M=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},R(P({},w),{height:(c=(l=this.multiFloorView)==null?void 0:l.floorHeight)!=null?c:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":w.color,renderOrder:2}),this.id);this.layers.set($h,new Pl(this.renderer,M.id.toString()));let O=this.renderer.addGroupContainer("".concat(Ld,"-").concat(this.id),{},this.id);this.layers.set(Ld,new Pl(this.renderer,O.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,O.id)}if(this.spaces!=null&&this.spaces.features.length>0){let w=[],M=new Map;this.spaces.features.filter(j=>{var F;return j.geometry.type==="Polygon"&&((F=j.properties.kind)==null?void 0:F.toLowerCase())!=="void"}).forEach(j=>{var L;let F=(L=this.mapDataInternal)==null?void 0:L.facadesBySpaceId[j.properties.id];if(F){let q=M.get(F.id)||[];M.set(F.id,[...q,j])}else w.push(j)});let O=hI(w,this.styleMap),_=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),$=0;for(let[j,F]of O){let L=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat($),{features:F},th(j,this.options),_);$++;let q=_.id.toString();this.layers.get(Or).layers.set(j.id||q,L.id.toString())}if(M.size>0){let j=this.renderer.addGroupContainer("".concat(hp,"-").concat(this.id),{},this.id);this.layers.set(hp,new Pl(this.renderer,j.id.toString()));for(let[F,L]of M){let q=this.renderer.addGroupContainer(F,{focusable:!0},j),U=this.renderer.addGroupContainer("".concat(F,"-geometry"),{},q),V=hI(L,this.styleMap),Q=0;for(let[Y,se]of V){let re=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(F,"-").concat(Q),{features:se},R(P({},th(Y,this.options)),{renderOrder:3}),U);Q++;let ve=Y.id||re.id.toString();this.layers.get(hp).layers.set("".concat(F,"-").concat(ve),re.id.toString()),this.facadesByStyleId.has(ve)?(u=this.facadesByStyleId.get(ve))==null||u.push(F):this.facadesByStyleId.set(ve,[F])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let w=this.obstructions.features.filter(U=>U.geometry.type==="Polygon"&&U.properties.kind==="object"),M=hI(w,this.styleMap),O=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),_=0;for(let[U,V]of M){let Q=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(_),{features:V},th(U,this.options),O);_++;let Y=O.id.toString();this.layers.get(Or).layers.set(U.id||Y,Q.id.toString())}let $=this.obstructions.features.filter(U=>U.geometry.type==="LineString"&&U.properties.kind==="Wall"&&U.properties.footprintComponent===!1),j=this.obstructions.features.filter(U=>U.geometry.type==="LineString"&&U.properties.kind==="Wall"&&U.properties.footprintComponent===!0),F=this.entrances,L=k7,q=k7;if($!=null&&$.length>0){let U=this.styleMap[(d=$[0].properties)==null?void 0:d.id];U!=null&&(L=P({},U)),q=L;let{walls:V,entrances:Q}=A7($,(F==null?void 0:F.features)||[]),Y=Math.max(L.height-.11,LH),se=R(P({},FH),{height:Y}),re=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),Q,se,n);this.layers.get(Or).layers.set(Dd,re.id.toString());let ve=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[V]},th(L,this.options),n);this.layers.get(Or).layers.set(Zl,ve.id.toString())}if(j!=null&&j.length>0){let U=this.styleMap[(h=j[0].properties)==null?void 0:h.id];U!=null&&(q=R(P({},U),{id:Cs}));let{walls:V,entrances:Q}=A7(j,(F==null?void 0:F.features)||[]),Y=Math.max(q.height-.11,LH),se=R(P({},FH),{height:Y}),re=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),Q,se,n);this.layers.get(Or).layers.set(Fd,re.id.toString());let ve=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[V]},th(q,this.options),n);this.layers.get(Or).layers.set(Cs,ve.id.toString())}}if(this.floorImages!=null){let w=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let M of this.floorImages.features||[])"anchorId"in M.properties||"anchorId"in M.properties&&((y=M.properties)==null?void 0:y.anchorId)==null||this.renderer.addImage(At(),M,{url:M.properties.path,flipImageToFaceCamera:(b=this.options.flipImagesToFaceCamera)!=null?b:!0},w);this.layers.set(H9,new Pl(this.renderer,w.id.toString()))}if(this.floorText!=null)for(let w of this.floorText.features||[]){let M=0;"geometryId"in w.properties?M=(S=(I=this.renderer.getState(w.properties.geometryId))==null?void 0:I.height)!=null?S:0:M=(x=w.properties.verticalOffset)!=null?x:0,this.renderer.addText3D(At(),R(P({},w),{properties:R(P({},w.properties),{verticalOffset:M})}),{},this.id)}return(T=this.multiFloorView)!=null&&T.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var d,h,y,b,I;this.id=r.id,this.options=i;let u=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(d=i.preloadFloors)==null?void 0:d.map(S=>S.id).includes(r.id)},t);this.containerId=u.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,a!=null&&l!=null&&(this.styleMap=l,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(h=a.floorImages)==null?void 0:h[this.id],this.floorText=(b=(y=a.enterprise)==null?void 0:y.floorText)==null?void 0:b[this.id],this.footprint=(I=a["floor.geojson"])==null?void 0:I.features.find(S=>S.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=o,this.mapDataInternal=c}get geoJSONBoundingBox(){if(p(this,Xu))return p(this,Xu);if(!this.footprint){z.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return A(this,Xu,yI(this.footprint)),p(this,Xu)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};Xu=new WeakMap,s(L7,"FloorObject");var B1=L7;f();var R7=50,N7=!1,Y0e=1e3,hr,rh,la,os,xn,j1,Wc,nh,Yu,So,$7,Ku,G1,U1,V1,z1,wl,$H,H1,qc,j7,jH,GH,Ju,G7=class G7 extends Be{constructor({currentMapGetter:r}){super();E(this,So);E(this,hr);E(this,rh,0);E(this,la);E(this,os,!1);E(this,xn,[]);E(this,j1,0);E(this,Wc,R7);E(this,nh,!1);E(this,Yu,"collapsed");m(this,"expandedFactor",0);E(this,Ku,"all-floors");E(this,G1,s(()=>{let r=p(this,hr).call(this);if(p(this,j1)===this.expandedFactor||r==null||!p(this,os))return;A(this,j1,this.expandedFactor);let n=jo(this.expandedFactor,0,1,0,this.distanceBetweenFloors),i=jo(this.expandedFactor,0,.1,0,1)===0;p(this,xn).forEach((a,l)=>{r.api.updateState(a.containerId,{visible:i?a.id===r.currentFloorId:!0,altitude:n*l})}),this.expandedFactor===0?(A(this,os,!1),r.renderer.camera.setPanMode("default"),p(this,qc)&&p(this,qc).call(this)):this.expandedFactor===1&&(A(this,os,!1),p(this,qc)&&p(this,qc).call(this))},"#handlePreRender"));E(this,U1,s(()=>{var r,n,o;this.expanded&&A(this,rh,(n=(r=p(this,hr).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(o=p(this,hr).call(this))==null||o.renderer.on("user-interaction-end",p(this,z1))},"#handleUserInteractionStart"));E(this,V1,s(()=>{var n;let r=p(this,hr).call(this);if(r!=null&&this.expanded&&p(this,nh)&&!p(this,os)){let o=r.currentFloorId,i=[1/0,r.currentFloorId];for(let a=0;a<p(this,xn).length;a++){let l=p(this,xn)[a],c=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-a*this.distanceBetweenFloors);c<this.distanceBetweenFloors/3&&(i[0]=c,i[1]=l.id)}i[1]!==r.currentFloorId&&(r.currentFloorId=i[1],p(this,xn).forEach(a=>{r.api.updateState(a.containerId,{visible:p(this,Ku)==="all-floors"?!0:r.currentFloor.id===a.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:o}))}},"#determineCurrentMapBasedOnElevation"));E(this,z1,s(()=>{var n,o;let r=p(this,hr).call(this);if(this.expanded&&r&&p(this,rh)!==((n=r.renderer.camera.elevation)!=null?n:0)){let i=[1/0,r.currentFloorId,0];for(let a=0;a<p(this,xn).length;a++){let l=p(this,xn)[a],c=Math.abs(((o=r.renderer.camera.elevation)!=null?o:0)-a*this.distanceBetweenFloors);c<i[0]&&(i[0]=c,i[1]=l.id,i[2]=a*this.distanceBetweenFloors)}p(this,nh)&&te(this,So,$H).call(this,i[2]),A(this,rh,0),r.renderer.off("user-interaction-end",p(this,z1))}},"#handleUserInteractionEnd"));E(this,wl,null);E(this,H1,null);E(this,qc);E(this,Ju);A(this,hr,r);let n=p(this,hr).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",p(this,U1)),n.renderer.on("camera-change",p(this,V1)),n.renderer.on("pre-render",p(this,G1)))}get state(){return p(this,Yu)}get expanded(){return p(this,Yu)!=="collapsed"}get distanceBetweenFloors(){if(p(this,Wc)==="auto"){if(p(this,Ju)!=null)return p(this,Ju);let r=te(this,So,GH).call(this);if(r)return A(this,Ju,r),r}return typeof p(this,Wc)=="number"?p(this,Wc):R7}clearCachedFloorSeparationDistance(){A(this,Ju,void 0)}get includedFloors(){var r;return(r=p(this,So,$7))!=null&&r.api.mapData?p(this,xn).map(n=>{var o,i;return(i=(o=p(this,So,$7))==null?void 0:o.api.mapData)==null?void 0:i.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return p(this,Ku)}setFloorVisiblityMode(r){A(this,Ku,r);let n=p(this,hr).call(this);n!=null&&p(this,xn).forEach(o=>{n.api.updateState(o.containerId,{visible:p(this,Ku)==="all-floors"?!0:n.currentFloor.id===o.id})})}changeFloorOnElevationChanges(r){A(this,nh,r)}async expand(r){var o,i,a;let n=p(this,hr).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?A(this,Wc,"auto"):A(this,Wc,(o=r==null?void 0:r.distanceBetweenFloors)!=null?o:R7),A(this,xn,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(l=>n.floorsById.get(l.id)).filter(Boolean):n.currentFloorStack.floorObjects),p(this,xn).sort((l,c)=>l.elevation-c.elevation),p(this,xn).length<=1||this.expanded===!0?Promise.resolve():(A(this,os,!0),n.api.Camera.setPanMode((i=r==null?void 0:r.cameraPanMode)!=null?i:"elevation"),this.changeFloorOnElevationChanges((a=r==null?void 0:r.changeFloorOnElevationChanges)!=null?a:!0),te(this,So,j7).call(this,"expand",r).then(()=>{A(this,Yu,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{A(this,os,!1)}))}async collapse(r){let n=p(this,hr).call(this);if(n!=null)return this.expanded===!0?(A(this,os,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),te(this,So,j7).call(this,"collapse",r).then(()=>{A(this,Yu,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{A(this,os,!1)})):Promise.resolve()}destroy(){let r=p(this,hr).call(this);r!=null&&(r.renderer.off("user-interaction-start",p(this,U1)),r.renderer.off("camera-change",p(this,V1)),r.renderer.off("pre-render",p(this,G1)))}};hr=new WeakMap,rh=new WeakMap,la=new WeakMap,os=new WeakMap,xn=new WeakMap,j1=new WeakMap,Wc=new WeakMap,nh=new WeakMap,Yu=new WeakMap,So=new WeakSet,$7=s(function(){return p(this,hr).call(this)},"#currentMap"),Ku=new WeakMap,G1=new WeakMap,U1=new WeakMap,V1=new WeakMap,z1=new WeakMap,wl=new WeakMap,$H=s(function(r){var o,i,a;p(this,wl)&&p(this,wl).stop();let n=p(this,hr).call(this);n!=null&&(A(this,wl,new xo({elevation:(o=n.renderer.camera.elevation)!=null?o:0}).to({elevation:r},150).easing(kr.Quadratic.Out).onComplete(()=>{var l;p(this,wl)&&((l=p(this,hr).call(this))==null||l.renderer.getTweenGroup().remove(p(this,wl)))}).onUpdate(({elevation:l})=>{n.renderer.camera.setElevation(l)}).start()),(i=p(this,hr).call(this))==null||i.renderer.getTweenGroup().add(p(this,wl)),(a=p(this,hr).call(this))==null||a.renderer.render())},"#animateElevationTo"),H1=new WeakMap,qc=new WeakMap,j7=s(function(r,n){var l,c,u,d;p(this,la)&&p(this,la).stop();let o=p(this,hr).call(this);if(o==null)return Promise.reject(new Error("No current map"));let i=p(this,xn).indexOf(o.currentFloor),a=(l=o.renderer.camera.elevation)!=null?l:0;return A(this,H1,new Promise(h=>{A(this,qc,h)})),A(this,la,new xo({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(c=n==null?void 0:n.duration)!=null?c:Y0e).easing(gl[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:h})=>{this.expandedFactor=h;let y=i*this.distanceBetweenFloors;o.renderer.camera.setElevation(r==="expand"?y*h:a*h)}).onComplete(()=>{var h;p(this,la)&&((h=p(this,hr).call(this))==null||h.renderer.getTweenGroup().remove(p(this,la)))}).start()),p(this,la).cameraAnimation=!0,(u=p(this,hr).call(this))==null||u.renderer.getTweenGroup().add(p(this,la)),(d=p(this,hr).call(this))==null||d.renderer.render(),p(this,H1)},"#animate"),jH=s(function(r,n,o,i){let a=B7(r,o),l=n.clone(),c=B7(l,o);if(!rp(a)||!rp(c))return-1;let u=0,d;N7&&i.querySelectorAll(".debug-box").forEach(y=>y.remove());do{if(u>1e4)return-1;if(u+=20,l.position.z=u,l.updateMatrixWorld(),c.makeEmpty(),B7(l,o,c),d=a.intersectsBox(c),N7){let h=BH(a,"blue",i),y=BH(c,d?"red":"green",i);h.classList.add("debug-box"),y.classList.add("debug-box")}}while(d);return u},"#computeMinZOffsetToSeparateFirstTwoFloors"),GH=s(function(){let r=p(this,hr).call(this);if(!r)return;let n=r.renderer,o=n.getThreeScene();if(!r.api.mapData||!o)return;let a=p(this,xn).length>0?p(this,xn):r.currentFloorStack.floorObjects;if(a.length<2)return;let l=n.getInternalState().geometry3DMap.get(a[0].id),c=n.getInternalState().geometry3DMap.get(a[1].id);if(!l||!c)return;if($I(l,"group-container"),$I(c,"group-container"),N7){let d=new Jr;d.setFromObject(l);let h=new Jr;if(h.setFromObject(c),l.children.forEach(w=>{w instanceof We&&w.userData.debugBox&&mr(w)}),c.children.forEach(w=>{w instanceof We&&w.userData.debugBox&&mr(w)}),!rp(d)||!rp(h))return;let y=new Si(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),b=new $r({color:255,transparent:!0,opacity:.5}),I=new We(y,b);I.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),I.userData.debugBox=!0;let S=new Si(h.max.x-h.min.x,h.max.y-h.min.y,h.max.z-h.min.z),x=new $r({color:"cyan",transparent:!0,opacity:.5}),T=new We(S,x);T.position.set((h.min.x+h.max.x)/2,(h.min.y+h.max.y)/2,(h.min.z+h.max.z)/2),T.userData.debugBox=!0,l.add(I),c.add(T)}let u=te(this,So,jH).call(this,l,c,n.getThreeCamera(),n.container);if(u!==-1)return u},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),Ju=new WeakMap,s(G7,"StackedMaps");var $1=G7,Hc=new Me,RH=new De;function B7(e,t,r=new d9){return e.traverse(n=>{if(n instanceof We){let i=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let l=0;l<i.count;l++)Hc.fromBufferAttribute(i,l),Hc.applyMatrix4(n.matrixWorld),Hc.applyMatrix4(t.matrixWorldInverse),Hc.applyMatrix4(t.projectionMatrix),Hc.z<1&&Hc.z>0&&(RH.set(Hc.x,Hc.y),r.expandByPoint(RH))}}),r}s(B7,"projectToBox2D");function NH(e,t){let r=t.clientWidth,n=t.clientHeight;return new De((e.x+1)*r/2,(1-e.y)*n/2)}s(NH,"ndcToScreen");function BH(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let o=NH(new De(e.min.x,e.min.y),r),i=NH(new De(e.max.x,e.max.y),r);n.style.left="".concat(o.x,"px"),n.style.top="".concat(i.y,"px");let a=Math.abs(i.x-o.x),l=Math.abs(i.y-o.y);return n.style.width="".concat(a,"px"),n.style.height="".concat(l,"px"),r.appendChild(n),n}s(BH,"drawProjectedBox");f();f();function K0e(e,t){return"".concat(t," ").concat(e)}s(K0e,"formatMessage");var U7=class U7 extends Error{constructor(t,r=U6){super(K0e(t,r)),this.name="MappedinError"}};s(U7,"MappedinError");var Ln=U7;var oh,V7=class V7{constructor(t,r,n,o){m(this,"id");m(this,"externalId");m(this,"name");m(this,"type");m(this,"floorIds");m(this,"defaultFloorId");m(this,"floorObjects",[]);m(this,"floorObjectsByElevation",new Map);m(this,"metadata");m(this,"containerId");m(this,"facade");m(this,"renderer");E(this,oh);var a;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(a=t.floors)!=null?a:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let i=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=i.id.toString(),this.facade=o}get defaultFloor(){if(p(this,oh)==null){if(this.floorObjects.length===0)throw new Ln("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),A(this,oh,t)}return p(this,oh)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){z.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var r,n;(n=(r=this.facade)==null?void 0:r.spaces)==null||n.forEach(o=>{this.renderer.setState(o.spaceId,{visible:t})})}};oh=new WeakMap,s(V7,"FloorStackObject");var W1=V7;f();function UH(e,t,r,n){let o={outdoorOpacity:1,floorStates:[]},i=e.sort((d,h)=>d.elevation-h.elevation),a=Math.min(0,i[0].elevation),l=i[i.length-1].elevation,c,u;for(let d=a;d<=l;d++){let h=i.find(x=>x.elevation===d);if(h==null){d>=0&&(c==null?c=d:u=d);continue}let y=0,b=d<0?Math.abs(h.elevation)*r:r,I=!1;if(c===0&&u!=null){let x=r*u;y=-x,b=x,I=!0}else if(c!=null&&u!=null){let x=c,T=e.find(M=>M.elevation===x-1),w=o.floorStates.find(M=>M.floor===T);if(w){let M=r*(u-c+2);w.state.footprint=R(P({},w.state.footprint),{altitude:0,height:M,visible:!0})}}c=void 0,u=void 0;let S={floor:h,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};o.floorStates.push(S),h.id===t.id?(S.state.visible=!0,S.state.geometry.visible=!0,S.state.labels.enabled=!0,S.state.markers.enabled=!0,S.state.occlusion.enabled=!0,(h.elevation<0||I)&&(h.elevation<0&&(o.outdoorOpacity=.2),S.state.footprint.height=b,S.state.footprint.altitude=y,S.state.footprint.visible=!0)):n.includes(h.id)&&h.elevation<t.elevation?(S.state.visible=!0,S.state.geometry.visible=!0,S.state.markers.enabled=!0,S.state.occlusion.enabled=!0,S.state.footprint.visible=!0,h.elevation<0?(S.state.footprint.height=b,S.state.footprint.altitude=y,o.outdoorOpacity=.2):(S.state.footprint.height=b,S.state.footprint.altitude=y)):t.elevation>0&&h.elevation<t.elevation&&h.elevation>=0&&(S.state.visible=!0,S.state.footprint.visible=!0,S.state.footprint.height=r,S.state.footprint.altitude=y)}return o}s(UH,"getVisiblityState");var J0e={linear:kr.Linear.None,easeIn:kr.Quadratic.In,easeOut:kr.Quadratic.Out,easeInOut:kr.Quadratic.InOut},ca,W7=class W7 extends Be{constructor(r,n,o,i){var u,d,h,y;super();m(this,"floorStacksById",new Map);m(this,"floorsById",new Map);m(this,"currentFloorId","");m(this,"currentFloorStackId","");m(this,"outdoorFloorStacks",new Set);m(this,"id");m(this,"renderer");m(this,"api");m(this,"mvf");m(this,"options",{});m(this,"styleMap");m(this,"StackedMaps");m(this,"animations",new Map);m(this,"Models",{add:s((r,n,o)=>{let h=o,{floorId:i,scale:a}=h,l=$n(h,["floorId","scale"]),c=i?this.floorsById.get(i):this.currentFloor,u=P({},l);a!=null&&(u.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let d=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(y=>{var b;return{type:"Feature",properties:{id:At(),rotation:o.rotation,scale:u.scale,interactive:o.interactive,verticalOffset:y.verticalOffset+((b=o.verticalOffset)!=null?b:0)},geometry:{type:"Point",coordinates:bi(y)}}})},u,{parent:c.id});if(d==null)throw new Ln("error creating model");return this.renderer.getState(d).children},"add"),remove:s((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});m(this,"Images",{add:s((r,n,o)=>{let d=o,{floorId:i,flipImageToFaceCamera:a}=d,l=$n(d,["floorId","flipImageToFaceCamera"]),c=i?this.floorsById.get(i):this.currentFloor,u={type:"Feature",properties:l,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(At(),u,{url:n,flipImageToFaceCamera:a!=null?a:!1},c.id)},"add"),remove:s(r=>{this.renderer.remove(r)},"remove"),removeAll:s(()=>{},"removeAll")});m(this,"Markers",{add:s((r,n,o)=>{let i=H7(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),h=o,{attachTo:a}=h,l=$n(h,["attachTo"]),c=l;l.rank==="initial"&&(c.rank="medium");let u=i.layers.get(Ts),d=this.renderer.addMarker2D(bi(r),n,R(P({},c),{occluderId:i==null?void 0:i.occluderId,attachTo:a}),u==null?void 0:u.containerId);if(!d)throw new Ln("Failed to create Marker");return d},"add"),remove:s(r=>{this.renderer.remove(r)},"remove"),getContentEl:s(r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:s(()=>{},"removeAll"),setPosition:s((r,n,o)=>{var l;let i=this.renderer.getState(r),a=o?this.floorsById.get(o):this.currentFloor;if(!i){z.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(i.type!=="marker"){z.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(i,{position:n,parent:(l=a==null?void 0:a.layers.get(Ts))==null?void 0:l.containerId})},"setPosition"),animateTo:s((r,n,o,i)=>{let a=this.renderer.getState(r),l=o?this.floorsById.get(o):this.currentFloor;if(!a)return z.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(a.type!=="marker")return z.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let c=P({duration:1e3,easing:"ease-in-out"},i);this.cancelAnimation(r);let u=new xo({lon:a.position[0],lat:a.position[1]}).to({lon:n[0],lat:n[1]},c.duration).easing(J0e[c.easing]).onUpdate(({lon:d,lat:h})=>{var b;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let I=(b=l==null?void 0:l.layers.get(Ts))==null?void 0:b.containerId;I&&this.Markers.setPosition(r,[d,h],I)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(r,u),z7(u).then(()=>{this.animations.delete(r)})},"animateTo")});m(this,"Exporter",{getCurrentSceneGLTF:s(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});m(this,"Shapes",{add:s((r,n,o)=>{let i=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,a=At();return this.renderer.addGeometryGroup(a,r,n,i.id),a},"add"),remove:s(r=>(this.renderer.remove(r.id),r.id),"remove")});m(this,"Text3D",{label:s((r,n,o)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){z.warn("Enterprise mode is not enabled, skipping label creation");return}let i=VH(this.renderer,r,n,o);if(i)return{textInfo:i,target:r}},"label"),labelAll:s((r={})=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode))return z.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let o=[];return n.getByType("space").forEach(a=>{var l,c;if(a.locations[0]){let u=VH(this.renderer,a,(c=(l=a.locations[0])==null?void 0:l.name)!=null?c:a.name,r);u&&o.push({textInfo:u,target:a})}}),o},"labelAll"),remove:s(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){z.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});m(this,"Labels",{all:s(({onCreate:r,labelOptions:n={}})=>{for(let o of Object.entries(this.mvf.space)){let[i,a]=o;a&&a.features.forEach(l=>{var S,x,T,w,M;let c=(S=this.api.getMapData())==null?void 0:S.getById("space",l.properties.id);if(!c)return;let u=(x=this.styleMap[l.properties.id])==null?void 0:x.showImage,d=(T=l.properties.details)==null?void 0:T.images,h=u&&((w=d==null?void 0:d[0])!=null&&w.url)?{icon:d[0].url}:{},y=P({marker:P(P({},h),(M=n.appearance)==null?void 0:M.marker)},n.appearance),I=(i?this.floorsById.get(i):this.currentFloor).layers.get(Ea);if(l.properties.center&&c.name!==""){let O=this.renderer.addLabel2D(l.properties.center,c.name,R(P({id:l.properties.id+"-label"},n),{appearance:y,rank:n.rank,attachTo:eh(c)}),Gr.is(c)?c.id:I==null?void 0:I.containerId);O&&r(O.id,c.name,c)}})}},"all"),add:s((r,n,o={})=>{let d=o,{attachTo:i}=d,a=$n(d,["attachTo"]),l=H7(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=l.layers.get(Ea),u=this.renderer.addLabel2D(bi(r),n,R(P({},a),{occluderId:l.occluderId,attachTo:i}),c==null?void 0:c.containerId);if(!u)throw new Ln("label creating failed");return u},"add"),remove:s(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:s(()=>{},"removeAll")});m(this,"Paths",{add:s((r,n)=>{var u;let o=(u=n==null?void 0:n.animateDrawing)!=null?u:!0,i=[],a=r[0].floorId||"root",l=0;for(let d of r){let{floorId:h="root",latitude:y,longitude:b}=d;h!==a&&(l++,a=h),i[l]==null&&i.push({floorId:h,coordinates:[]});let I=h===d.floorId?d:new $e({longitude:b,latitude:y,floorId:h});i[l].coordinates.push(I)}let c=i.reduce((d,{floorId:h,coordinates:y},b)=>{if(b!==0){let S=i[b-1],x=S.coordinates[S.coordinates.length-1],T=y[0],w=bi(x),M=bi(T),O=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:S.floorId},geometry:{type:"Point",coordinates:w}},{type:"Feature",properties:{parentId:h},geometry:{type:"Point",coordinates:M}}]},n,this.id);O&&(n!=null&&n.animateDrawing&&this.renderer.setState(O.id,{completeFraction:0}),d.push(R(P({},O),{coordinates:[x,T]})))}let I=this.renderer.addPath({type:"FeatureCollection",features:y.map(S=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:bi(S)}}))},n,h);return I&&(n!=null&&n.animateDrawing&&this.renderer.setState(I.id,{completeFraction:0}),d.push(R(P({},I),{coordinates:y}))),d},[]);if(o){let d=[],h=this.api.getMapData();return c.forEach(y=>{var I;let b=HH(y,h,this.api);d.push(new xo({fraction:0}).to({fraction:1},b===!1?0:(I=n==null?void 0:n.drawDuration)!=null?I:1500).onUpdate(S=>{this.renderer.setState(y.id,{completeFraction:S.fraction})}))}),d.forEach((y,b)=>{b<d.length-1&&y.chain(d[b+1]),this.renderer.getTweenGroup().add(y)}),d[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),d[0]),{paths:c,animation:z7(d[d.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},"add"),remove:s(r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});E(this,ca,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=i.core,this.api=i,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new $1({currentMapGetter:s(()=>this,"currentMapGetter")}),this.mvf=(u=n==null?void 0:n.mvf)!=null?u:{};let a=zH(this.mvf["styles.json"]||{});if(this.styleMap=a,A(this,ca,P({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},o==null?void 0:o.multiFloorView)),!n){this.id!=="outdoors-container"&&z.warn("Map (".concat(this.id,") created with no data."));let b=new W1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(b.id,b),this.currentFloorStackId=b.id;let I=new B1(b.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,p(this,ca),o!=null?o:{});b.addFloor(I),this.floorsById.set(I.id,I),this.setFloor(I.id);return}let l=n.getMVFFeatureByType("floor-stack");if(l==null||l.length===0)throw new Ln("MVF does not contain any Floor Stacks.");for(let b of l){let I=new W1(b,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[b.id]);if(I.floorIds.length!==0){for(let S of I.floorIds){let x=n.getMVFFeatureById("floor",S);if(x!=null){let T=this.mvf.space[x.id],w=this.mvf.obstruction[x.id];if((T==null||T.features.length===0)&&(w==null||w.features.length===0))continue;let M=new B1(I.id,x,this.renderer,p(this,ca),o!=null?o:{},this.mvf,a,n);I.addFloor(M),this.floorsById.set(M.id,M)}}this.floorStacksById.set(b.id,I),this.currentFloorStackId||(this.currentFloorStackId=b.id)}}for(let[b]of Object.entries(n.facadesBySpaceId)){let I=n.getById("space",b);I&&(this.outdoorFloorStacks.add(I.floor.floorStack.id),(h=this.floorsById.get(I.floor.id))==null||h.setVisible(!0))}let c=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(o!=null&&o.initialFloor){let b=Ah(o.initialFloor);b&&this.floorsById.has(b)?c=b:z.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}c||(c=this.currentFloorStack.defaultFloor.id),this.setFloor(c)}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Ln('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let o=this.floorStacksById.get(r);if(o==null){z.error("Invalid floor stack passed to setFloorStack (".concat(r,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(o.floorObjects.length===0){z.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(o.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Ln('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var i,a,l,c,u;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),o=this.floorStacksById.get(this.currentFloorStackId);if(n&&o)if(!((i=p(this,ca))!=null&&i.enabled)||n.floorStackId!==(o==null?void 0:o.id))for(let d of this.floorStacksById.values())d.floorObjects.forEach(h=>{h.id!==r&&h.setVisible(!1)});else{let d=UH(this.currentFloorStack.floorObjects,n,p(this,ca).floorHeight,((l=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:l.map(h=>h.id))||[]);(u=(c=this.api)==null?void 0:c.Outdoor)==null||u.setOpacity(d.outdoorOpacity),d.floorStates.forEach(h=>{h.floor&&this.api.updateState(h.floor.id,h.state)}),p(this,ca).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*p(this,ca).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){z.error("Invalid floor passed to setFloor (".concat(r,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let i=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:i,floorId:r,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:i})}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getTweenGroup().remove(n))}};ca=new WeakMap,s(W7,"GeojsonApiMapObject");var q1=W7;function VH(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,R(P({},n),{parentId:t.floor.id}))}s(VH,"labelSpace");f();var is,X1,q7=class q7{constructor({currentMapGetter:t}){E(this,is,new Map);E(this,X1);A(this,X1,t)}get currentMap(){return p(this,X1).call(this)}getById(t){return p(this,is).get(t)}add(t,r,n){let o=t.anchorTarget;if(!o)throw new Error("get coordinate failed");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Markers.add(o,r,R(P({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:eh(t)}));if(a==null)throw new Error("error creating marker");let l=i.Markers.getContentEl(a.id.toString());if(!l)throw new Error("marker component should exist");let c=new vl(a.id.toString(),l,t);return p(this,is).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var n;let r=p(this,is).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),p(this,is).delete(t.id.toString()))}removeAll(){let t=[];return p(this,is).forEach(({marker:r})=>{this.remove(r),t.push(r),p(this,is).delete(r.id.toString())}),t}setPosition(t,r){var a;let n=r.anchorTarget;if(!n){z.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){z.error("Cannot determine the current map.");return}let i=p(this,is).get(t.id);if(!i){z.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(i.entityId,bi(n),(a=n.floorId)!=null?a:o.currentFloorId),i.marker.updateTarget(r)}animateTo(t,r,n){var l;let o=r.anchorTarget;if(!o)return z.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return z.error("Cannot determine the current map."),Promise.resolve();let a=p(this,is).get(t.id);return a?(a.marker.updateTarget(r),i.Markers.animateTo(a.entityId,bi(o),(l=o.floorId)!=null?l:i.currentFloorId,n)):(z.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};is=new WeakMap,X1=new WeakMap,s(q7,"Markers");var Z1=q7;f();var Ml,K1,Z7=class Z7{constructor({currentMapGetter:t}){E(this,Ml,new Map);E(this,K1);A(this,K1,t)}get currentMap(){return p(this,K1).call(this)}getById(t){return p(this,Ml).get(t)}add(t,r,n){var c;let o=t.anchorTarget;if(!o)throw new Error("Target does not implement IAnchorable.");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Images.add(bi(o),r,R(P({},n),{floorId:o.floorId,verticalOffset:o.verticalOffset+((c=n.verticalOffset)!=null?c:0)}));if(!a)throw new Error("image component should exist");let l=new w1(a.id.toString(),r,t);return p(this,Ml).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(t){var n;let r=p(this,Ml).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),p(this,Ml).delete(t.id.toString()))}removeAll(){let t=[];return p(this,Ml).forEach(({image:r})=>{this.remove(r),t.push(r),p(this,Ml).delete(r.id.toString())}),t}};Ml=new WeakMap,K1=new WeakMap,s(Z7,"Images");var Y1=Z7;f();var pa,Q1,X7=class X7{constructor({currentMapGetter:t}){E(this,pa,new Map);E(this,Q1);A(this,Q1,t)}get currentMap(){return p(this,Q1).call(this)}getById(t){return p(this,pa).get(t)}add(t,r,n){let o=[t],i=o.reduce((c,u)=>{var d;return u?(c.has(u.floorId)||c.set(u.floorId,[]),(d=c.get(u.floorId))==null||d.push(u),c):(z.error("Cannot determine coordinate from options."),c)},new Map);if(!o.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let l=[];return i.forEach((c,u)=>{let d=At();a.Models.add(d,c,R(P({},n),{url:r,floorId:u})).forEach(({id:y})=>{let b=new Wu(y.toString(),d,c[0]);p(this,pa).set(b.id,{model:b,entityId:y.toString(),groupId:d}),l.push(b)})}),l[0]}remove(t){var n;let r=p(this,pa).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),p(this,pa).delete(t.id.toString()))}removeAll(){let t=[];return p(this,pa).forEach(({model:r})=>{var o;let n=p(this,pa).get(r.id);n&&(t.push(r),(o=this.currentMap)==null||o.Models.remove(n.entityId,n.groupId),p(this,pa).delete(r.id.toString()))}),t}};pa=new WeakMap,Q1=new WeakMap,s(X7,"Models");var J1=X7;f();var ua,tb,Y7=class Y7{constructor({currentMapGetter:t}){E(this,ua,new Map);E(this,tb);A(this,tb,t)}get currentMap(){return p(this,tb).call(this)}getById(t){return p(this,ua).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Paths.add(t,r),i=o.paths.map(l=>l.id.toString()),a=new es(At(),o.animation,t,o.paths);for(let l of i)p(this,ua).set(l,{path:a,entityIds:i});return p(this,ua).set(a.id,{path:a,entityIds:i}),a}remove(t){var n;let r=p(this,ua).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),p(this,ua).delete(t.id),r.entityIds.forEach(o=>p(this,ua).delete(o)))}removeAll(){let t=[];return p(this,ua).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};ua=new WeakMap,tb=new WeakMap,s(Y7,"Paths");var eb=Y7;f();var nW=ps(L5(),1);f();var K7="#2266ff",Q0e="#808080",WH="#f5f5f5";var qH={radius:10,color:K7,inactiveColor:Q0e,heading:{color:K7,opacity:.7},accuracyRing:{color:K7,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};f();var ZH="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";f();var XH=s((e,t,r=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let n=r/Math.tan(e/2),o=r/Math.sin(e/2),i=o+t,a=10,l=new ds;l.moveTo(-o*Math.sin(e/2),o*Math.cos(e/2)-n);for(let c=0;c<a;c++)l.lineTo(-(i*Math.sin(e/2-e/a*c)),i*Math.cos(e/2-e/a*c)-n);for(let c=0;c<a;c++)l.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/a*c)),r*Math.cos(Math.PI/-2+Math.PI/a*c));return new fs(l,{depth:.1,bevelEnabled:!1,UVGenerator:txe(t)})},"createSectorGeometry"),J7=s((e,t,r)=>{let o=Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/r;return o>1?o=1:o<0&&(o=0),new De(0,o)},"generateRadialUV"),txe=s(e=>({generateTopUV:s((t,r,n,o,i)=>{let a=r[n*3],l=r[n*3+1],c=r[o*3],u=r[o*3+1],d=r[i*3],h=r[i*3+1];return[J7(a,l,e),J7(c,u,e),J7(d,h,e)]},"generateTopUV"),generateSideWallUV:s(()=>[new De(0,1),new De(0,1),new De(0,1),new De(0,1)],"generateSideWallUV")}),"radialUVGenerator");function YH(e,t){if(t==null)return e;let r={latitude:e==null?void 0:e.latitude,longitude:e==null?void 0:e.longitude,accuracy:e==null?void 0:e.accuracy,floor:e==null?void 0:e.floor,heading:e==null?void 0:e.heading};return"latitude"in t&&(r.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?e==null?void 0:e.latitude:t.latitude),"longitude"in t&&(r.longitude=t.longitude==null||t.longitude==="device"?e==null?void 0:e.longitude:t.longitude),"accuracy"in t&&(r.accuracy=t.accuracy==="device"?e==null?void 0:e.accuracy:t.accuracy),"floor"in t&&(r.floor=t.floor==="device"?e==null?void 0:e.floor:t.floor),"heading"in t&&(r.heading=t.heading==="device"?e==null?void 0:e.heading:t.heading),r}s(YH,"getPositionWithOverrides");function rxe([e,t],[r,n],[o,i]){let a=r-e,l=n-t,c=a**2+l**2;if(c===0)return;let u=((o-e)*a+(i-t)*l)/c,d;u<=0?d=[e,t]:u>=1?d=[r,n]:d=[e+u*a,t+u*l];let h=Nb([o,i],d);return{proportion:Math.max(0,Math.min(1,u)),intersection:d,distance:h}}s(rxe,"getPointLineIntersection");function KH(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,o=0,i=0;for(let a=0;a<e.length-1;a++){let l=e[a],c=e[a+1],u=rxe(l,c,t);u!=null&&u.distance<r&&(r=u.distance,n=u.intersection,o=a,i=u.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:o,proportion:i}}s(KH,"findBlueDotOnPath");function JH(e,t){let r=new Ti({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,o=.35*4,i=XH(Math.PI/6,o,n);new fd().load(ZH,l=>{r.alphaMap=l,r.needsUpdate=!0});let a=new We(i,r);return a.position.z=-.05,a.renderOrder=0,a}s(JH,"createHeadingCone");function QH(e,t){let r=new Db(1,1,.05,32),n=new Ti({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),o=new We(r,n);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}s(QH,"createAccuracyRing");function eW(e){let t=new Db(.35,.35,.07,32),r=new Ti({transparent:!0,color:WH,depthTest:!1,depthWrite:!1}),n=new We(t,r);n.renderOrder=2;let o=new Db(.35*.8,.35*.8,.01,32),i=new Ti({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),a=new We(o,i);return a.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:n,innerMesh:a}}s(eW,"createBlueDot");var oW=ps(tW(),1);var vI="blue-dot",Qu,Ol,No,Bo,El,ed,td,rd,Ar,Co,rb,_l,nb,ob,ib,sb,bI,da,kl,xI,nd,ab,fa,Q7=class Q7 extends Be{constructor(r,n){super();this.core=r;this.geoJSONApi=n;E(this,Qu,null);m(this,"geometry");E(this,Ol);E(this,No);E(this,Bo);E(this,El);E(this,ed);E(this,td);E(this,rd);E(this,Ar,qH);E(this,Co,1);E(this,rb);E(this,_l);m(this,"state","disabled");m(this,"following",!1);E(this,nb,s(r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));E(this,ob,s(r=>{var o;let n;if(r!=null){let i=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(r);n=i?p(this,nb).call(this,i.id):void 0}return n},"#getFloorByFloorLevel"));E(this,ib,s(r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,o,i,a]=r.children;if(p(this,bI).call(this),o.scale.set(p(this,Co),p(this,Co),p(this,Co)),o.position.z=.07/2*p(this,Co),i.scale.set(p(this,Co),p(this,Co),p(this,Co)),i.position.z=.07*p(this,Co),this.state==="active"){i.material.color.set(p(this,Ar).color);let l=this.accuracy;l!=null?(n.visible=!0,p(this,td)&&p(this,td).stop(),A(this,td,new xo({scale:n.scale.x}).to({scale:l/2},150).onUpdate(({scale:u})=>{n.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(p(this,td))):n.visible=!1;let c=this.heading;if(c!=null){a.visible=!0,p(this,rd)&&p(this,rd).stop();let{start:u,end:d}=Bb(a.rotation.z,-et.degToRad(c));A(this,rd,new xo({rotation:u}).to({rotation:d},150).onUpdate(({rotation:h})=>{a.rotation.z=h}).start()),this.core.getTweenGroup().add(p(this,rd)),a.scale.set(p(this,Co),p(this,Co),1)}else a.visible=!1}else this.state==="inactive"&&(i.material.color.set(p(this,Ar).inactiveColor),a.visible=!1,n.visible=!1)},"#updateGeometryPerFrame"));E(this,sb,s(r=>{var a,l;let n;try{n=axe.parse(YH(r,p(this,No)))}catch(c){p(this,da).call(this,"error"),z.error("BlueDot: Position parse failed",c instanceof G.ZodError?c.message:String(c)),this.publish("error");return}p(this,Ar).debug&&z.log("BlueDot: Parsed position",n),A(this,Bo,n),p(this,da).call(this,"position-update"),p(this,El)&&clearTimeout(p(this,El)),typeof p(this,Ar).timeout=="number"&&p(this,Ar).timeout<1/0&&A(this,El,setTimeout(()=>{p(this,Ar).debug&&z.log("BlueDot: Position timed out after ".concat(p(this,Ar).timeout,"ms")),p(this,da).call(this,"timeout"),this.core.render()},p(this,Ar).timeout)),(l=this.geoJSONApi.getMapDataInternal())==null||l.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(a=n.floor)==null?void 0:a.elevation,accuracy:n.accuracy}});let o=n.floor!=null?n.floor.id:this.geoJSONApi.currentFloor.id||"outdoors-container",i=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(vI,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}},{setup:s(c=>{let u=QH(p(this,Ar).accuracyRing.color,p(this,Ar).accuracyRing.opacity),{outerMesh:d,innerMesh:h}=eW(p(this,Ar).color),y=JH(p(this,Ar).heading.color,p(this,Ar).heading.opacity);c.add(u),u.visible=!1,c.add(d),c.add(h),c.add(y),y.visible=!1,p(this,ib).call(this,c)},"setup"),update:p(this,ib)},{visible:!0,interactive:!0},o);else{let c=this.core.getState(this.geometry);i=[c.position[0],c.position[1]]}p(this,ed)&&p(this,ed).stop(),A(this,ed,new xo(i).to([n.longitude,n.latitude],1e3).easing(kr.Cubic.Out).onUpdate(c=>{if(this.geometry){let u={position:[c[0],c[1]]};u.parent=o,this.core.setState(this.geometry,u)}}).start()),this.core.getTweenGroup().add(p(this,ed)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));m(this,"onPositionUpdate",s(r=>{var n,o,i,a,l;if(this.state!=="disabled"){try{sxe.parse(r)}catch(c){p(this,da).call(this,"error"),z.error("BlueDot: Browser sent invalid position",c instanceof G.ZodError?c.message:String(c)),this.publish("error");return}A(this,Ol,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(o=r.coords)==null?void 0:o.longitude,accuracy:(i=r.coords)==null?void 0:i.accuracy,heading:(a=r.coords)==null?void 0:a.heading,floor:p(this,ob).call(this,(l=r.coords)==null?void 0:l.floorLevel)}),p(this,sb).call(this,p(this,Ol))}},"onPositionUpdate"));m(this,"onPositionError",s(r=>{var n;switch(p(this,da).call(this,"error"),r.code){case r.PERMISSION_DENIED:z.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:z.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:z.error("Geolocation request timed out.",r);break;default:z.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)},"onPositionError"));E(this,bI,s(()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==p(this,rb)){A(this,rb,r);let o=(n=this.core.getMetresPerPixel())!=null?n:1;A(this,Co,Math.max(p(this,Ar).radius/(.35/o),1))}},"#updateScale"));E(this,da,s(r=>{let n=ixe[this.state].actions[r];if(n){switch(p(this,Ar).debug&&z.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==n&&(this.publish("state-change",{state:n,action:r}),this.state=n)}else z.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));E(this,kl);E(this,xI,s(()=>{if(p(this,kl)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(o=>o.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(o=>o.floorId===this.geoJSONApi.currentFloor.id);A(this,kl,(0,oW.default)(n.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return p(this,kl)},"#getSimplifiedDirections"));E(this,nd,s(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),p(this,fa)&&(this.off("position-update",p(this,fa)),A(this,fa,void 0)),this.following=!1,A(this,kl,void 0),this.core.off("user-interaction-start",p(this,nd)),this.geoJSONApi.currentMap.off("navigation-active-path-change",p(this,ab)),this.publish("follow-change",{following:!1})},"#cancelFollow"));E(this,ab,s(()=>{A(this,kl,void 0)},"#pathChangeHandler"));E(this,fa);m(this,"follow",s((r,n)=>{var i,a,l,c;if(r===!1){p(this,nd).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&z.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(r,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(i=n==null?void 0:n.zoomLevel)!=null?i:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(a=n==null?void 0:n.pitch)!=null?a:45,duration:(l=n==null?void 0:n.duration)!=null?l:1e3,easing:(c=n==null?void 0:n.easing)!=null?c:"ease-in-out"};this.following?p(this,fa)&&this.off("position-update",p(this,fa)):(this.following=!0,this.core.on("user-interaction-start",p(this,nd)),this.geoJSONApi.currentMap.on("navigation-active-path-change",p(this,ab))),A(this,fa,u=>{let{coordinate:d,heading:h,floor:y}=u;if(o.center=[d.longitude,d.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),A(this,kl,void 0)),r==="position-and-heading")o.bearing=h!=null?h:void 0;else if(r==="position-and-path-direction"){let b=p(this,xI).call(this);if(b!=null){let I=KH(b,[d.longitude,d.latitude]);if(I!=null){let S=b[I.segmentIndex],x=b[I.segmentIndex+1];o.bearing=y9(S,x)}}}this.core.camera.animateTo(o)}),this.on("position-update",p(this,fa)),this.publish("follow-change",{following:!0,mode:r})},"follow"))}get heading(){var r;return(r=p(this,Bo))==null?void 0:r.heading}get accuracy(){var r;return(r=p(this,Bo))==null?void 0:r.accuracy}get coordinate(){var r,n;if(p(this,Bo)!=null)return(p(this,_l)==null||((r=this.floor)==null?void 0:r.id)!==p(this,_l).floorId||p(this,Bo).latitude!==p(this,_l).latitude||p(this,Bo).longitude!==p(this,_l).longitude)&&A(this,_l,new $e(p(this,Bo).latitude,p(this,Bo).longitude,(n=this.floor)==null?void 0:n.id)),p(this,_l)}get floor(){var r;return(r=p(this,Bo))==null?void 0:r.floor}enable(r){A(this,Ar,(0,nW.default)({},r,p(this,Ar))),p(this,da).call(this,"enable"),this.watchDevicePosition(p(this,Ar).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),p(this,El)&&(clearTimeout(p(this,El)),A(this,El,void 0)),this.following&&p(this,nd).call(this),this.watchDevicePosition(!1),A(this,Bo,void 0),A(this,No,void 0),p(this,da).call(this,"disable")}watchDevicePosition(r){if(p(this,Qu)&&(navigator.geolocation.clearWatch(p(this,Qu)),A(this,Qu,null)),p(this,Ol)&&A(this,Ol,void 0),r){if(this.state==="disabled"){z.warn("BlueDot must be enabled before watching browser position.");return}A(this,Qu,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var o,i;r==null?A(this,No,void 0):"coords"in r?A(this,No,Object.assign({},p(this,No),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:p(this,ob).call(this,r.coords.floorLevel)})):(A(this,No,Object.assign({},p(this,No),r)),"floorOrFloorId"in r&&(p(this,No).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?p(this,nb).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((o=p(this,No))==null?void 0:o.latitude)!=null&&((i=p(this,No))==null?void 0:i.longitude)!=null||p(this,Ol)!=null)&&p(this,sb).call(this,p(this,Ol))}};Qu=new WeakMap,Ol=new WeakMap,No=new WeakMap,Bo=new WeakMap,El=new WeakMap,ed=new WeakMap,td=new WeakMap,rd=new WeakMap,Ar=new WeakMap,Co=new WeakMap,rb=new WeakMap,_l=new WeakMap,nb=new WeakMap,ob=new WeakMap,ib=new WeakMap,sb=new WeakMap,bI=new WeakMap,da=new WeakMap,kl=new WeakMap,xI=new WeakMap,nd=new WeakMap,ab=new WeakMap,fa=new WeakMap,s(Q7,"BlueDot");var sh=Q7,ixe={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},sxe=G.object({coords:G.object({latitude:G.number(),longitude:G.number(),accuracy:G.number(),altitude:G.number().optional().nullable(),altitudeAccuracy:G.number().optional().nullable(),heading:G.number().optional().nullable(),speed:G.number().optional().nullable(),floorLevel:G.number().optional().nullable()}),timestamp:G.number()}),axe=G.object({latitude:G.number(),longitude:G.number(),floor:G.custom().optional(),accuracy:G.number().optional(),heading:G.number().optional().nullable()});f();var Al,cb,e6=class e6{constructor({currentMapGetter:t}){E(this,Al,new Map);E(this,cb);A(this,cb,t)}get currentMap(){return p(this,cb).call(this)}getById(t){return p(this,Al).get(t)}add(t,r,n){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let i=o.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),a=new Gc(i);return p(this,Al).set(a.id,a),a}remove(t){var n;p(this,Al).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),p(this,Al).delete(t.id.toString()))}removeAll(){let t=[];return p(this,Al).forEach(r=>{this.remove(r),t.push(r.id),p(this,Al).delete(r.id.toString())}),t}};Al=new WeakMap,cb=new WeakMap,s(e6,"Shapes");var lb=e6;f();var ub,t6=class t6{constructor({currentMapGetter:t}){E(this,ub);A(this,ub,t)}get currentMap(){return p(this,ub).call(this)}setFromStyleCollection(t){var r,n,o,i;for(let a in t)for(let l of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[a]==null||!l.layers.has(Or))continue;let c=l.layers.get(Or);if(c!=null&&c.layers.has(a)&&"color"in t[a]){let h=c.layers.get(a);h&&((n=this.currentMap)==null||n.renderer.setState(h,{color:t[a].color}))}if(c&&a===Zl&&!(Cs in t)){let h=c.layers.get(Cs);h&&"color"in t[a]&&((o=this.currentMap)==null||o.renderer.setState(h,{color:t[a].color}))}if(!l.layers.has(hp))continue;let u=l.layers.get(hp),d=l.facadesByStyleId.get(a);if(d&&d.length>0)for(let h of d){let y=u.layers.get("".concat(h,"-").concat(a));y&&"color"in t[a]&&((i=this.currentMap)==null||i.renderer.setState(y,{color:t[a].color}))}}}};ub=new WeakMap,s(t6,"Style");var pb=t6;f();var r6={opacity:1},Rn,db,fb,Xc,Dl,od,n6,iW,o6=class o6{constructor(t,r){E(this,od);E(this,Rn);E(this,db,[]);E(this,fb,{opacity:"initial"});E(this,Xc,{opacity:new Map});E(this,Dl,new Set);A(this,Rn,t),A(this,db,r||[]);let n=p(this,Rn).map;n&&n.on("idle",()=>{p(this,Xc).opacity.size||te(this,od,n6).call(this,n)})}setStyle(t){var r,n;if(p(this,Rn).map){(r=p(this,Rn).map)==null||r.setStyle(t),p(this,Dl).size&&(p(this,Dl).clear(),this.hide()),te(this,od,iW).call(this),te(this,od,n6).call(this,p(this,Rn).map),this.setOpacity(p(this,fb).opacity),(n=p(this,Rn).map)==null||n.moveLayer(VI);for(let[o,i,a]of p(this,db)||[])p(this,Rn).hideOutdoorLayersIntersectingPolygons(o,i,a)}}get map(){return p(this,Rn).map}get enabled(){return!!p(this,Rn).map}get visible(){return p(this,Dl).size===0}show(){let t=p(this,Rn).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{p(this,Dl).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),p(this,Dl).clear())}hide(t=[]){let r=p(this,Rn).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(o=>{let i=r.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&i!=="none"&&(r.setLayoutProperty(o.id,"visibility","none"),p(this,Dl).add(o.id))})}setOpacity(t,r=[]){var i,a;let n=p(this,Rn).map;if(!n)return;let o=(a=(i=p(this,Rn).map)==null?void 0:i.getStyle())==null?void 0:a.layers;o&&n.once("idle",()=>{o.forEach(l=>{let c=n.getLayoutProperty(l.id,"visibility");if(!r.includes(l.id)&&c!=="none")try{let u=p(this,Xc).opacity.get(l.id);u!==void 0&&(l.id==="background"||(l.type==="symbol"?(n.setPaintProperty(l.id,"icon-opacity",t==="initial"?u[0]:t),n.setPaintProperty(l.id,"text-opacity",t==="initial"?u[1]:t)):n.setPaintProperty(l.id,"".concat(l.type,"-opacity"),t==="initial"?u[0]:t)),p(this,fb).opacity=t)}catch(u){z.warn("Error setting opacity:",u)}})})}};Rn=new WeakMap,db=new WeakMap,fb=new WeakMap,Xc=new WeakMap,Dl=new WeakMap,od=new WeakSet,n6=s(function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var i,a,l;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?p(this,Xc).opacity.set(n.id,[(i=t.getPaintProperty(n.id,"icon-opacity"))!=null?i:r6.opacity,(a=t.getPaintProperty(n.id,"text-opacity"))!=null?a:r6.opacity]):p(this,Xc).opacity.set(n.id,[(l=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?l:r6.opacity,void 0])))})},"#setInitialStyle"),iW=s(function(){Object.values(p(this,Xc)).forEach(t=>t.clear())},"#clearInitialStyle"),s(o6,"Outdoor");var ah=o6;f();function sW(){G5(!1)}s(sW,"disableText3DWorker");var Fl,Ll,Yc,i6=class i6{constructor({currentMapGetter:t}){E(this,Fl);E(this,Ll,new Map);E(this,Yc,new Map);A(this,Fl,t)}labelAll(t={}){var o,i;let r=[],n=new Set;return(i=(o=p(this,Fl).call(this))==null?void 0:o.Text3D.labelAll(t))==null||i.forEach(({textInfo:a,target:l})=>{let c=a.id.toString(),u=p(this,Yc).get(c);if(u){n.has(c)||r.push(u.text3DView),n.add(c);return}n.add(c);let d=new Uc(c,l);p(this,Ll).set(d.id,{targetId:l.id,text3d:c,text3DView:d}),p(this,Yc).set(c,{text3DView:d}),r.push(d)}),r}label(t,r,n={}){var i;if(p(this,Fl).call(this))if(Gr.is(t)){let a=(i=p(this,Fl).call(this))==null?void 0:i.Text3D.label(t,r,n);if(!a)return;let l=a.textInfo.id.toString(),c=p(this,Yc).get(l);if(c)return c.text3DView;let u=new Uc(l,a.target);return p(this,Ll).set(u.id,{targetId:a.target.id,text3d:l,text3DView:u}),p(this,Yc).set(l,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var o;let r=typeof t=="string"?t:t.id,n=p(this,Ll).get(r);n&&((o=p(this,Fl).call(this))==null||o.Text3D.remove(n.text3d),p(this,Ll).delete(r),p(this,Yc).delete(n.text3d))}removeAll(){p(this,Ll).forEach(t=>{var r;(r=p(this,Fl).call(this))==null||r.Text3D.remove(t.text3d)}),p(this,Ll).clear()}};Fl=new WeakMap,Ll=new WeakMap,Yc=new WeakMap,s(i6,"Text3D");var II=i6;var SI=.05,a6=class a6{constructor(t,r){m(this,"core");m(this,"mapObjects",[]);m(this,"id");m(this,"mapDataExternal",{});m(this,"mapsByFloorId",{});m(this,"mapData");m(this,"currentMap");m(this,"hiddenOutdoorGeometries",[]);m(this,"lastFacadeIntersected");m(this,"manualFloorVisibility",!1);m(this,"mapView");m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"Outdoor");m(this,"BlueDot");m(this,"Shapes");m(this,"Style");m(this,"Images");m(this,"update",s(()=>{this.core.render()},"update"));this.core=t,this.mapView=r,this.Camera=new D1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new q1("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",c=>{this.mapView.publish("facades-in-view-change",{facades:c.map(u=>{var d;return(d=this.getMapDataInternal())==null?void 0:d.facadesById[u]}).filter(u=>u!=null)})});let o=new E1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let i=s(c=>u=>{var $,j,F;let d=[],h=[],y=[],b=[];u.labels.forEach(L=>{let q=this.Labels.getById(L.toString());q&&d.push(q.label)}),u.markers.forEach(L=>{let q=this.Markers.getById(L.toString())||this.Navigation.getMarkerById(L.toString());q&&h.push(q.marker)}),u.models.forEach(L=>{let q=this.Models.getById(L.toString());q&&y.push(q.model)}),u.paths.forEach(L=>{let q=this.Paths.getById(L.toString())||this.Navigation.getPathById(L.toString());q&&b.push(q.path)});let I=u.geometry.includes(vI),S=u.geometry.filter(L=>L!==vI)[0],x;S&&(x=($=this.getMapDataInternal())==null?void 0:$.getById("space",S)),x||(x=(j=this.getMapDataInternal())==null?void 0:j.getById("object",S));let T=u.containers.reduce((L,q)=>{var V;let U=(V=this.getMapDataInternal())==null?void 0:V.getById("floor",q);return U&&Gn.is(U)&&L.push(U),L},[]),w,M=0;if(T.length>0){w=T[0].id;let L=this.core.getState(w);M=u.coordinate[2]?u.coordinate[2]-L.altitude:M}let O;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(L=>{this.core.setState(L.id,{hovered:!1})}),x&&Gr.is(x)&&(O=(F=this.getMapDataInternal())==null?void 0:F.facadesBySpaceId[S],O&&O.spaces.forEach(L=>{this.core.setState(L.id,{hovered:!0})})),this.lastFacadeIntersected=O;let _={coordinate:new $e({latitude:u.coordinate[1],longitude:u.coordinate[0],floorId:w,verticalOffset:M}),spaces:x&&Gr.is(x)?[x]:[],objects:x&&io.is(x)?[x]:[],markers:h,labels:d,models:y,paths:b,blueDot:I,floors:T,facades:O?[O]:[]};"pointerEvent"in u&&(_.pointerEvent=u.pointerEvent),this.mapView.publish(c,_)},"createHandler");this.core.on("hover",i("hover")),this.core.on("click",i("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let a={currentMapGetter:s(()=>this.currentMap,"currentMapGetter")};this.Markers=new Z1(a),this.Models=new J1(a),this.Labels=new R1(a),this.Text3D=new II(a),this.Exporter=new L1(a),this.Paths=new eb(a),this.Navigation=new k1(this.core,this,a.currentMapGetter),this.BlueDot=new sh(this.core,this),this.BlueDot.on("position-update",c=>{this.mapView.publish("blue-dot-position-update",c)}),this.BlueDot.on("state-change",c=>{this.mapView.publish("blue-dot-state-change",c)}),this.BlueDot.on("error",c=>{this.mapView.publish("blue-dot-error",c)}),this.BlueDot.on("follow-change",c=>{this.mapView.publish("blue-dot-follow-change",c)}),this.Outdoor=new ah(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new Y1(a),this.Shapes=new lb(a),this.Style=new pb(a);let l=new fI(r,this.mapDataExternal);this.auto=l.auto}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(t){t.forEach(r=>{r instanceof Gn&&this.core.setState(r.id,{preloadGeometry:!0})})}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Or);if(a){let l=a.layers.get(Zl);l&&this.core.setState(l,s6(r,this.core.getState(l)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Or);if(a){let l=a.layers.get(Cs);l&&this.core.setState(l,s6(r,this.core.getState(l)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Or);if(a){let l=a.layers.get(Dd);l&&this.core.setState(l,CI(r,this.core.getState(l)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Or);if(a){let l=a.layers.get(Fd);l&&this.core.setState(l,CI(r,this.core.getState(l)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if($c.is(n))return this.core.setState(n.id,aW(R(P({},r),{type:"label"}),this.core.getState(n.id)));if(vl.is(n))return this.core.setState(n.id,lW(R(P({},r),{type:"marker"}),this.core.getState(n.id)));if((Gr.is(n)||io.is(n))&&this.core.setState(n.id,cW(R(P({},r),{type:"geometry"}),this.core.getState(n.id))),Ei.is(n)&&this.core.setState(n.id,CI(R(P({},r),{type:"doors"}),this.core.getState(n.id))),Gc.is(n)&&this.core.setState(n.id,Po(r,["altitude","color","opacity"])),Wu.is(n)){let o=r,{position:i,scale:a}=o,c=$n(o,["position","scale"]);i&&(c.position=[i.longitude,i.latitude,i.verticalOffset]),a!=null&&(Array.isArray(a)?c.scale=a:c.scale=[a,a,a]),i&&n.updateTarget(i),this.core.setState(n.id,c)}if(Gn.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;this.core.setState(n.id,Po(r,["visible","altitude"]));let a=i.layers.get(Or);a!=null&&"geometry"in r&&this.core.setState(a.containerId,Po(r.geometry,["opacity","visible"]));let l=i.layers.get(Ea);l!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&l.setVisible(r.labels.enabled);let c=i.layers.get(Ts);c!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&c.setVisible(r.markers.enabled);let u=i.layers.get($h);u!=null&&"footprint"in r&&this.core.setState(u.containerId,Po(r.footprint,["visible","height","opacity","side","color","altitude"]));let d=i.layers.get(Ld);d!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&d.setVisible(r.occlusion.enabled)}if(Ho.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,Po(r,["opacity","visible"]))}if(Uc.is(n)&&this.core.setState(n.id,Po(r,u2)),es.is(n))for(let i of n.segments)this.core.setState(i.id,Po(r,["color","nearRadius","farRadius","visible","completeFraction"]));Zm.is(n)&&this.core.setState(n.id,Po(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return cg(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var h,y,b,I;let o;try{o=cg(t)}catch(S){z.error("Error adding map",S),n(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:i}=o,a=i["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new $e(a[1],a[0])});let l=i["manifest.geojson"].features[0].properties.name,c=new q1("mapObject-".concat(l),o,r,this),u=this.core.getBoundingArea(c.currentFloor.id);u==null&&z.error("Could not determine bounding box for map:",c.currentFloor.id);let d=(y=(h=r==null?void 0:r.outdoorView)==null?void 0:h.layersHiddenByGeometry)!=null?y:[];if(d.length>0){let S,x=[];for(let T of c.floorStacksById.values())if(T.defaultFloor.footprint&&T.defaultFloor.footprint.geometry!=null&&((b=T.defaultFloor.footprint.geometry)==null?void 0:b.coordinates.length)>0){let w=T.defaultFloor.footprint,M=yI(w);S==null?S=M:uW(S,M),x.push(w)}x.length>0&&S!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(S,x,d),this.hiddenOutdoorGeometries.push([S,x,d]))}if(this.mapObjects.push(c),o.getMVFFeatureByType("floor").forEach(S=>{this.mapsByFloorId[S.id]=c}),c.on("navigation-connection-click",S=>{this.mapView.publish("navigation-connection-click",S)}),c.on("navigation-active-path-change",S=>{this.mapView.publish("navigation-active-path-change",S)}),c.StackedMaps.on("stacked-maps-state-change",({state:S})=>{this.mapView.publish("stacked-maps-state-change",{state:S})}),c.on("floor-change-start",S=>{var x,T,w,M;this.mapView.publish("floor-change-start",{reason:S.reason,floor:(T=(x=this.getMapDataInternal())==null?void 0:x.getById("floor",S.floorId))!=null?T:this.currentFloor,previousFloor:(M=(w=this.getMapDataInternal())==null?void 0:w.getById("floor",S.previousFloorId))!=null?M:this.currentFloor})}),c.on("floor-change",S=>{var x,T;this.mapView.publish("floor-change",{reason:S.reason,floor:this.currentFloor,previousFloor:(T=(x=this.getMapDataInternal())==null?void 0:x.getById("floor",S.previousFloorId))!=null?T:this.currentFloor})}),this.currentMap=c,this.mapData=t,(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&u){let S=(I=r==null?void 0:r.screenOffsets)!=null?I:{top:SI*this.core.canvasHeight,left:SI*this.core.canvasWidth,right:SI*this.core.canvasWidth,bottom:SI*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:z9,padding:S}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(Ah(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(Ah(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Ln("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Ln("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Ln("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Ln("Missing currentFloor");return r}getState(t){var o,i,a,l,c,u,d,h,y,b,I,S,x,T,w,M,O,_,$,j;typeof t=="object"&&es.is(t)&&z.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=pW(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:F,topColor:L,texture:q,topTexture:U,visible:V,height:Q,opacity:Y}=n;return{type:"walls",visible:V,color:F,topColor:L,texture:q?{url:q}:void 0,topTexture:U?{url:U}:void 0,height:Q,opacity:Y}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:F,topColor:L,texture:q,topTexture:U,visible:V,opacity:Q}=n;return{type:"doors",visible:V,color:F,topColor:L,opacity:Q,texture:q?{url:q}:void 0,topTexture:U?{url:U}:void 0}}else{if(n.type==="geometry")return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor};if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((o=n.options)==null?void 0:o.rank)!==void 0&&n.options.interactive!==void 0){let F=typeof n.parent=="object"?n.parent.id:n.parent,L=this.Markers.getById(n.id.toString()),q=L!=null&&L.marker.target?L==null?void 0:L.marker.target.anchorTarget:void 0;return q==null&&(q=new $e(n.position[1],n.position[0],F.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin}}else if(n.type==="model"){let F=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(i=n.parent)==null?void 0:i.toString();return delete n.parent,R(P({},n),{position:new $e({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:F}),type:"model"})}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&t&&typeof t!="string"&&Gc.is(t)){let[F]=n.children;if(F.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(a=n.altitude)!=null?a:0,visible:n.visible,color:n.color,height:F.height,opacity:n.opacity}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof t!="string"&&Gn.is(t)){let F=(l=this.currentMap.floorsById.get(t.id))==null?void 0:l.layers.get(Or),L=F?this.core.getState(F.containerId):void 0,q=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Ea),U=(u=this.currentMap.floorsById.get(t.id))==null?void 0:u.layers.get(Ts),V=(d=this.currentMap.floorsById.get(t.id))==null?void 0:d.layers.get($h),Q=V?this.core.getState(V.containerId):void 0,Y=(h=this.currentMap.floorsById.get(t.id))==null?void 0:h.layers.get(Ld),se=Y?this.core.getState(Y.containerId):void 0;return{type:"floor",geometry:{opacity:(y=L==null?void 0:L.opacity)!=null?y:0,visible:(b=L==null?void 0:L.visible)!=null?b:!0},labels:{enabled:(I=q==null?void 0:q.visible)!=null?I:!1},markers:{enabled:(S=U==null?void 0:U.visible)!=null?S:!1},footprint:{altitude:(x=Q==null?void 0:Q.altitude)!=null?x:0,visible:(T=Q==null?void 0:Q.visible)!=null?T:!1,height:(w=Q==null?void 0:Q.height)!=null?w:0,opacity:(M=Q==null?void 0:Q.opacity)!=null?M:0,side:(O=Q==null?void 0:Q.side)!=null?O:"double",color:(_=Q==null?void 0:Q.color)!=null?_:"white"},occlusion:{enabled:($=se==null?void 0:se.visible)!=null?$:!1},visible:n.visible,altitude:(j=n.altitude)!=null?j:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Ho.is(t)){let F=this.core.getState(n.children[0].id);return{type:"facade",opacity:F.opacity,visible:F.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,r,n){var c;if(n!=null){let u=this.core.projectScreenXYToCoordinate(t,r,!0);return u?new $e(u.coordinate[1],u.coordinate[0],n.id):void 0}let o=this.core.projectScreenXYToCoordinate(t,r);if(o==null||o.coordinate==null)return;let{coordinate:i,groupContainers:a}=o,l=(c=a==null?void 0:a.find(u=>{let d=u.userData.entityId.toString();return d.includes("f_")||d.includes("m_")}))==null?void 0:c.userData.entityId.toString();return new $e(i[1],i[0],l)}getScreenCoordinateFromCoordinate(t){return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let r=new xo(t);return this.core.getTweenGroup().add(r),this.core.render(),r}removeTween(t){this.core.getTweenGroup().remove(t)}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};s(a6,"GeoJsonApi");var mb=a6;function dW(e){E9("".concat(e,"/maplibre-worker.csp.js")),_4("".concat(e,"/collision-worker.csp.js"))}s(dW,"setWorkersUrl");f();f();var l6=class l6{constructor(t){m(this,"state");m(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};s(l6,"Debug");var PI=l6;f();var fW=yn.object({environment:yn.union([yn.literal("basic"),yn.literal(!1)]).optional(),text3d:yn.object({hoverColor:yn.string().optional()}).optional(),geometry:yn.object({hoverColor:yn.string().optional()}).optional(),backgroundColor:yn.string().optional(),backgroundAlpha:yn.number().optional()}).strict();f();var wI=ps(v5(),1);var mW=s(e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||c6(e).some(r=>r<1)?!0:(console.warn=t,!1)},"isProbablyColor"),c6=s(e=>{let t=new Rt(e);return[t.r,t.g,t.b]},"stringToRgbArray"),lxe=s(e=>{let t=new Rt;return t.setRGB(e[0],e[1],e[2],ga),"#"+t.getHexString()},"rgbArrayToString"),hW=s((e,t)=>{let r=(0,wI.default)({},e),n=(0,wI.default)({},e,t),o=s((i,a,l)=>{for(let c in a){let u=i[c],d=a[c];if(typeof d=="number"&&typeof u=="number")i[c]=u+(d-u)*l;else if(typeof d=="string"&&typeof u=="string"){if(mW(u)&&mW(d)){let h=c6(u),y=c6(d);h&&y?i[c]=lxe([h[0]+(y[0]-h[0])*l,h[1]+(y[1]-h[1])*l,h[2]+(y[2]-h[2])*l]):z.warn('Color "'.concat(c,'" could not be animated!'))}}else typeof d=="object"&&d!==null&&typeof u=="object"&&u!==null?o(u,d,l):z.warn('Value "'.concat(c,'" could not be animated!'))}},"interpolate");return i=>{if(i=Math.min(Math.max(i,0),1),i===0)return e;if(i===1)return n;let a=(0,wI.default)({},r);return o(a,t,i),a}},"animationFactory");var hb,Se,Rl,p6=class p6 extends Be{constructor(r){super();E(this,hb,{});E(this,Se);E(this,Rl);m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Images");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"BlueDot");m(this,"Style");m(this,"Shapes");m(this,"Outdoor");m(this,"update",s(()=>{p(this,Se).core.render()},"update"));m(this,"getDirections",s((r,n,o)=>{var i;return(i=p(this,Se).getMapData())==null?void 0:i.getDirections(r,n,o)},"getDirections"));m(this,"getDirectionsMultiDestination",s((r,n,o)=>{var i;return(i=p(this,Se).getMapData())==null?void 0:i.getDirectionsMultiDestination(r,n,o)},"getDirectionsMultiDestination"));m(this,"on",s((r,n)=>{super.on(r,n)},"on"));m(this,"off",s((r,n)=>{super.off(r,n)},"off"));m(this,"Debug");A(this,Rl,r);let n=new mb(r,this);A(this,Se,n),this.Camera=p(this,Se).Camera,A(this,hb,p(this,Se).mapDataExternal),this.Markers=p(this,Se).Markers,this.Models=p(this,Se).Models,this.Labels=p(this,Se).Labels,this.Text3D=p(this,Se).Text3D,this.Exporter=p(this,Se).Exporter,this.Paths=p(this,Se).Paths,this.Navigation=p(this,Se).Navigation,this.BlueDot=p(this,Se).BlueDot,this.Shapes=p(this,Se).Shapes,this.Style=p(this,Se).Style,this.auto=p(this,Se).auto,this.Outdoor=p(this,Se).Outdoor,this.Images=p(this,Se).Images,p(this,Rl).container.dataset.version=v.env.npm_package_version,this.Debug=new PI(p(this,Se).core)}get StackedMaps(){return p(this,Se).currentMap.StackedMaps}updateState(r,n){return p(this,Se).updateState(r,n)}animateState(r,n,o){var u;let i=p(this,Se).getState(r);if(i==null)return z.warn("Cannot animate state of ".concat(r,".")),new Promise(h=>h());let a=hW(i,n),l=p(this,Se).tween({percent:0}).to({percent:1},(u=o==null?void 0:o.duration)!=null?u:1e3).onUpdate(({percent:d})=>{p(this,Se).updateState(r,a(d))});o!=null&&o.easing&&o.easing in gl&&l.easing(gl[o.easing]);let c=new Promise(d=>{l.onComplete(()=>{p(this,Se).removeTween(l),d()}).onStop(()=>{p(this,Se).removeTween(l),d()}),l.start()});return c.cancel=()=>{l.stop(),p(this,Se).updateState(r,a(0))},c}updateGlobalState(r){var n,o,i,a;try{fW.parse(r)}catch(l){z.error("updateGlobalState",l);return}if(typeof r=="object"){let l={};if((n=r.text3d)!=null&&n.hoverColor&&(l.text3dHoverColor=r.text3d.hoverColor),(o=r.geometry)!=null&&o.hoverColor&&(l.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let c=(i=r.backgroundColor)!=null?i:p(this,Se).core.backgroundColor,u=(a=r.backgroundAlpha)!=null?a:p(this,Se).core.backgroundAlpha;p(this,Se).core.setBackgroundColor(c,u)}r.environment!=null&&p(this,Se).core.setEnvironment(r.environment),p(this,Se).core.setState(l)}}getGlobalState(){let r=p(this,Se).core.getState();return{backgroundColor:p(this,Se).core.backgroundColor,backgroundAlpha:p(this,Se).core.backgroundAlpha,environment:p(this,Se).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return p(this,hb)}getDimensions(){return{width:p(this,Rl).canvasWidth,height:p(this,Rl).canvasHeight}}expand(r){var n;return(n=p(this,Se).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=p(this,Se).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return p(this,Se).addMap(r,n)}setFloor(r,n){return p(this,Se).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return p(this,Se).setFloorStack(r,n==null?void 0:n.context)}preloadFloors(r){p(this,Se).preloadFloors(r)}tween(r){return p(this,Se).tween(r)}removeTween(r){p(this,Se).removeTween(r)}get currentFloorStack(){return p(this,Se).currentFloorStack}get currentFloor(){return p(this,Se).currentFloor}updateWatermark(r){p(this,Se).updateWatermark(r)}getState(r){return p(this,Se).getState(r)}setHoverColor(r){p(this,Se).setHoverColor(r)}getHoverColor(){return p(this,Se).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return p(this,Se).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return p(this,Se).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return p(this,Se).isInView(r)}getDistance(r,n){var o;return(o=p(this,Se).getMapData())==null?void 0:o.getDistance(r,n)}createCoordinate(r,n,o){return typeof r=="object"?new $e(r):new $e(r,n,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(r,n,o){return p(this,Se).createCoordinateFromScreenCoordinate(r,n,o)}getScreenCoordinateFromCoordinate(r){return p(this,Se).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(v.env.INTERNAL==="true")return p(this,Se).core;throw new Error("__core is not available.")}clear(){p(this,Se).clear()}destroy(){p(this,Se).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-WRNBK432.js");await new n(this,p(this,Se)).enable(r)}async takeScreenshot(){return await p(this,Rl).renderSync(),p(this,Rl).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return p(this,Se).manualFloorVisibility}set manualFloorVisibility(r){p(this,Se).manualFloorVisibility=r}};hb=new WeakMap,Se=new WeakMap,Rl=new WeakMap,s(p6,"MapView");var lh=p6;f();f();var u6=class u6 extends Be{constructor(r){super();m(this,"gl");m(this,"el",document.createElement("div"));m(this,"core");m(this,"origin");m(this,"map");m(this,"layer");m(this,"handleStyleChange",s(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));m(this,"handleMove",s(()=>{if(!this.map)return;let[r,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(r,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(et.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(et.degToRad(this.map.getPitch()))},"handleMove"));m(this,"handleError",s(r=>{z.warn(r)},"handleError"));this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new C1(r._container,{center:this.origin,zoomLevel:r.getZoom(),pitch:r.getPitch(),bearing:r.getBearing(),gl:this.gl,map:r,mode:"outdoors-overlay"}),this.map=r,this.core.camera.setMinZoomLevel(r.getMinZoom()),this.core.camera.setMaxZoomLevel(r.getMaxZoom()),this.core.camera.setMinPitch(r.getMinPitch()),this.core.camera.setMaxPitch(r.getMaxPitch()),this.map.on("error",this.handleError);let n=M9.fromLngLat(this.origin,0);return this.layer=zb(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};s(u6,"MapLibreOverlay");var MI=u6;var id,ch,Kc,sd,yb=class yb extends Be{constructor(r,n,o){super();E(this,id);E(this,ch);E(this,Kc);E(this,sd);m(this,"on",s((r,n)=>{super.on(r,n)},"on"));m(this,"off",s((r,n)=>{super.off(r,n)},"off"));A(this,sd,new MI(r)),A(this,id,n),A(this,ch,o)}onAdd(r){var i,a;let n=p(this,sd).onAdd(r),o=R(P(P({},mp),(i=p(this,ch))!=null?i:{}),{outdoorView:P({token:p(this,id).outdoorViewToken},(a=p(this,ch))==null?void 0:a.outdoorView)});return A(this,Kc,new lh(p(this,sd).core)),p(this,Kc).addMap(p(this,id),o).then(()=>{this.publish("loaded",{mapView:p(this,Kc),mapData:p(this,id)})}),n}onRemove(){p(this,Kc)&&p(this,Kc).clear(),yb.instance=null,p(this,sd).onRemove()}};id=new WeakMap,ch=new WeakMap,Kc=new WeakMap,sd=new WeakMap,s(yb,"MappedinMapLibreOverlay"),m(yb,"instance");var ph=yb;f();var cxe=1e3*60*60*2,Jc,dh,er,ss,as,xi,ls,fh,mh,bb,cr,yW,gW,uh,OI,d6,f6,m6,h6=class h6{constructor(t,r){E(this,cr);E(this,Jc,new Be);E(this,dh);E(this,er);E(this,ss);E(this,as);E(this,xi);E(this,ls);E(this,fh);E(this,mh);E(this,bb,s(()=>{"key"in p(this,er)&&"secret"in p(this,er)&&te(this,cr,uh).call(this),te(this,cr,OI).call(this)},"#handleWindowFocus"));m(this,"on",s((t,r)=>p(this,Jc).on(t,r),"on"));m(this,"off",s((t,r)=>p(this,Jc).off(t,r),"off"));A(this,dh,t),A(this,er,r)}setMapIds(t){A(this,dh,t)}setEnterprise(t){p(this,er).enterprise=t}async readySync(){if((!("key"in p(this,er))||!("secret"in p(this,er)))&&!("accessToken"in p(this,er))){z.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[te(this,cr,uh).call(this),null];p(this,er).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);te(this,cr,m6).call(this),te(this,cr,d6).call(this,r),n!=null&&te(this,cr,f6).call(this,n),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",p(this,bb))}async refreshing(){let t=[];return p(this,ss)!=null&&t.push(p(this,ss)),p(this,as)!=null&&t.push(p(this,as)),Promise.all(t)}getAccessTokenAsync(){return te(this,cr,uh).call(this)}getSasTokensAsync(){return te(this,cr,OI).call(this)}getAccessToken(){return p(this,xi)==null?(z.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):p(this,xi)}getSasToken(t){return this.isEnterpriseMode()?(z.error("SAS tokens are not available in the enterprise mode!"),{token:""}):p(this,ls)==null?(z.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in p(this,ls).tokens?p(this,ls).tokens[t]:(z.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=p(this,er).enterprise)!=null?t:!1}destroy(){te(this,cr,m6).call(this),p(this,Jc).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",p(this,bb))}};Jc=new WeakMap,dh=new WeakMap,er=new WeakMap,ss=new WeakMap,as=new WeakMap,xi=new WeakMap,ls=new WeakMap,fh=new WeakMap,mh=new WeakMap,bb=new WeakMap,cr=new WeakSet,yW=s(function(t){var n;let r=t.token!==((n=p(this,xi))==null?void 0:n.token);A(this,xi,t),r&&p(this,Jc).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),gW=s(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=p(this,ls))==null?void 0:n.tokens);A(this,ls,t),r&&p(this,Jc).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),uh=s(async function(t=!1){var r;if("accessToken"in p(this,er)&&typeof p(this,er).accessToken=="string"){let n={token:p(this,er).accessToken,expires:Date.now()+72e5};return A(this,xi,n),n}if(!("key"in p(this,er))||!("secret"in p(this,er))||typeof p(this,er).key!="string"||typeof p(this,er).secret!="string")throw new Error("No API keys or access token provided!");return p(this,ss)!=null?p(this,ss):p(this,xi)!=null&&p(this,xi).expires!=null&&p(this,xi).expires>Date.now()&&!t?p(this,xi):(A(this,ss,ng(R(P({},p(this,er)),{key:p(this,er).key,secret:p(this,er).secret}),(r=p(this,er).enterprise)!=null?r:!1).then(n=>{let o={token:n.accessToken,expires:n.expiresTimestamp*1e3};return te(this,cr,yW).call(this,o),o})),p(this,ss).finally(()=>{A(this,ss,void 0)}),p(this,ss))},"#refreshAccessToken"),OI=s(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:p(this,as)!=null?p(this,as):p(this,ls)!=null&&p(this,ls).expires>Date.now()&&!t?p(this,ls):(A(this,as,new Promise((r,n)=>{te(this,cr,uh).call(this).then(o=>{let i={},a=p(this,dh).map(l=>qw(R(P({},p(this,er)),{mapId:l}),o.token).then(c=>{i[l]={token:c.token,expires:c.expires}}).catch(c=>{z.error("Error getting SAS token for map ".concat(l,":"),c)}));Promise.all(a).then(()=>{let l={tokens:i,expires:Math.min(...Object.values(i).map(c=>{var u;return(u=c.expires)!=null?u:1/0}))};te(this,cr,gW).call(this,l),r(l)})}).catch(o=>{n(o)})})),p(this,as).catch(r=>{throw r}).finally(()=>{A(this,as,void 0)}),p(this,as))},"#refreshSasTokens"),d6=s(function(t){if(!("key"in p(this,er))||!("secret"in p(this,er)))return;let r=t.expires!=null?t.expires-Date.now():cxe;isFinite(r)&&A(this,fh,setTimeout(()=>{te(this,cr,uh).call(this,!0).then(n=>{te(this,cr,d6).call(this,n)})},r-dG))},"#setAccessTokenRefresh"),f6=s(function(t){let r=t.expires-Date.now();isFinite(r)&&A(this,mh,setTimeout(()=>{te(this,cr,OI).call(this,!0).then(n=>{te(this,cr,f6).call(this,n)})},r-hG))},"#setSasTokensRefresh"),m6=s(function(){p(this,fh)!=null&&clearTimeout(p(this,fh)),p(this,mh)!=null&&clearTimeout(p(this,mh))},"#stopRefreshing"),s(h6,"TokenManager");var gb=h6;f();var bW=s((e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(i=>typeof i=="string"))return;let n=r.join(""),o=null;if(t){let i=document.getElementById(t);i instanceof HTMLStyleElement&&(o=i)}o==null&&(o=document.createElement("style")),t&&t!==""&&(o.id=t),o.textContent=n,document.head.appendChild(o)},"injectCSS");var xW=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var vW='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var IW=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var SW=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var CW=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var TW='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var yxe=[xW,vW,IW,SW,CW,TW],PW;function gxe(e){PW=e}s(gxe,"__setWatermarkOnClickFn");var bxe=s(async(e,t)=>{let r,n=tu();t&&n.updateByUserOption(t);try{t&&(r=(await ng(R(P({},t),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(a){z.warn("Getting access token failed. Outdoor map disabled.",a)}let o=new hh(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new vv(o)},"hydrateMapDataFromMVF"),wW=!1;function xxe(e){wW=e}s(xxe,"setUseEnterpriseAPI");var vxe=s(async(e,t)=>{var b,I,S,x,T,w,M;let r=(S="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?S:"options"in e&&"version"in((b=e.options)!=null?b:{})?(I=e.options)==null?void 0:I.version:void 0,n=R(P({},t||{}),{mvfVersion:r}),o,i=tu();i.updateByUserOption(n);let a={};if("type"in e&&typeof e.type=="string"){if(a.enterprise=(x=e.options)==null?void 0:x.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){o=await Qw(e.main,n.mvfVersion),a.languagePacks=[];for(let O of(T=e.languagePacks)!=null?T:[])O.localePack instanceof Uint8Array&&a.languagePacks.push({language:O.language,localePack:await Qf(O.localePack)})}else if(e.type==="json")o=e.main,a.languagePacks=(w=e.languagePacks)!=null?w:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(a.binaryBundle=e.main)}else o=e,a.enterprise=o.enterprise!=null;let l=Jw(o),c=l.length>0?l:[n.mapId],u=new gb(c,R(P({},n),{enterprise:a.enterprise})),d;if("accessToken"in n)d=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=i.getBaseAuthUri(a.enterprise);let O=await u.getAccessTokenAsync();d=(O==null?void 0:O.token)||""}a.outdoorViewToken=d,a.env=i,a.getMapDataOptions=n;try{await u.readySync()}catch(O){z.error("Failed to ready token manager!",O)}let h=new hh(o,a);d&&h.Analytics.init(R(P({accessToken:d,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0},n.analytics),{baseUri:i.getAnalyticsBaseUri(),context:(M=n.analytics)==null?void 0:M.context}));let y=new vv(h);if("language"in n)try{await y.changeLanguage(n.language)}catch(O){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(o),y},"hydrateMapData"),MW=s(async e=>{var S;let t=wW,r,n=tu();n.updateByUserOption(e);let o=P({},e),i=new gb([o.mapId],o);if("accessToken"in o){r=o.accessToken;let{aud:x,sub:T}=Rb(r);(W9.some(w=>x.includes(w))||T&&T.startsWith("client"))&&(t=!0,i.setEnterprise(t))}else if("key"in o&&"secret"in o)o.key.startsWith("mik_")||(t=!0,i.setEnterprise(t)),o.baseAuthUri=n.getBaseAuthUri(t),r=(await i.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");o.layoutId!=null&&(t?o.layoutId!=="draft"&&z.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):z.warn("layoutId is currently unsupported!")),o.baseUri=n.getBaseUri(t);let a=performance.now(),l,c;if(t){let x=R(P({},o),{venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"}),T=await Yw(x);l=T.compressed,c=T.localePacks}else l=await Kw(o,r);let u=performance.now(),d=await Qw(l,o.mvfVersion),h=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(d);let y=Jw(d);y.length>0?i.setMapIds(y):i.setMapIds([o.mapId]);try{await i.readySync()}catch(x){z.error("Failed to ready token manager!",x)}let b=new hh(d,{env:n,outdoorViewToken:r,tokenManager:i,enterprise:t,localePacksUrls:c,binaryBundle:l,getMapDataOptions:o}),I=new vv(b,{search:e.search});if(b.Analytics.init(R(P({accessToken:r,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0},o.analytics),{baseUri:n.getAnalyticsBaseUri(),context:(S=o.analytics)==null?void 0:S.context})),b.Analytics.sendGetMapDataEvent({parseDuration:h-u,downloadDuration:u-a,viewId:o.viewId}),"language"in o)try{await I.changeLanguage(o.language)}catch(x){}return I},"getMapData"),Ixe=MW,Sxe=s((e,t)=>{ph.instance!=null&&z.warn("Only a single map venue is supported at this time.");let r=new ph([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return ph.instance=r,r},"createMapLibreOverlay"),OW=s(async(e,t,r)=>{var u,d,h,y,b,I,S,x,T,w,M,O,_,$,j;let n=performance.now(),o=pS(r,t);o&&cS(o),((u=o.injectStyles)==null||u)&&bW(yxe,{id:"mappedin__styles"});let i=Z9((d=t.outdoorViewToken)!=null?d:""),a=cg(t);(h=o.outdoorView)!=null&&h.style&&a.envControl.updateTileServerBaseUrl((y=o.outdoorView)==null?void 0:y.style);let l=await CH(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(b=o.style)==null?void 0:b.backgroundAlpha,backgroundColor:(I=o.style)==null?void 0:I.backgroundColor,outdoorView:(S=o.outdoorView)!=null&&S.token?{headers:{"x-mappedin-tiles-key":(x=o.outdoorView)==null?void 0:x.token},style:t.getEnv().tileServerUri,enabled:!!((T=o.outdoorView)!=null&&T.enabled),lowDpi:(w=o.outdoorView)==null?void 0:w.lowDpi}:void 0,watermark:R(P({},o.watermark),{visible:(O=(M=o.watermark)==null?void 0:M.visible)!=null?O:!a.enterpriseMode&&!i.remove_watermark,onClick:PW||void 0}),attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((_=o.antialiasing)!=null&&_.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:($=o.occlusion)==null?void 0:$.enabled,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:o.imagePlacementOptions,onWebGLContextCreationError:o.onWebGLContextCreationError,onWebGLContextLost:o.onWebGLContextLost,onWebGLContextRestored:o.onWebGLContextRestored,onWebGLRendererError:o.onWebGLRendererError,useStandaloneCamera:(j=o.useStandaloneCamera)!=null?j:!1}),c=new lh(l);return await c.addMap(t,o),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:c.getDimensions()}),c},"show3dMap"),Cxe=OW;function bi(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}s(bi,"convertCoordinateToPosition");function Pxe(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}s(Pxe,"getEntranceMap");var A7=s((e,t)=>{let r=Pxe(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let o of e){let i=[o.geometry.coordinates],a=(o.properties.entrances||[]).reduce((l,c)=>(r.has(c)&&l.push(r.get(c)),l),[]);if(a.length){let{entrances:l,obstructions:c}=P4(o,a);i=c.map(u=>u.geometry.coordinates),n.entrances.features.push(...l)}n.walls.geometry.coordinates.push(...i)}return n},"cutEntrancesFromLineStrings");function aW(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.text&&(r.text=e.text),e.appearance&&(r.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!==void 0&&(r.enabled=e.enabled),e.interactive!==null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}s(aW,"translateLabelStateToGeojsonCore");function lW(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!=null&&(r.enabled=e.enabled),e.interactive!=null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}s(lW,"translateMarkerStateToGeojsonCore");function CI(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.opacity!==void 0&&(r.opacity=e.opacity)),r}s(CI,"translateDoorsStateToGeojsonCore");function s6(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity)),r}s(s6,"translateWallsStateToGeojsonCore");function cW(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(r.hoverColor=e.hoverColor),e.interactive!==void 0&&(r.interactive=e.interactive),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(r.flipImageToFaceCamera=e.flipImageToFaceCamera)),r}s(cW,"translateSpaceStateToGeojsonCore");function EW(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}s(EW,"differenceBetweenAngles");function _W(e,t){let r="Left";return e<=-Math.PI/4?r="Right":e<=-t?r="SlightRight":e<=t?r="Straight":e<=Math.PI/4?r="SlightLeft":r="Left",r}s(_W,"getRelativeBearing");function zH(e){let t={};for(let r in e){let n=e[r];if(n!=null){if(n.id=r,"polygons"in n)for(let o of n.polygons)t[o]=n;else if("lineStrings"in n)for(let o of n.lineStrings)t[o]=n;else if("points"in n)for(let o of n.points)t[o]=n}}return t}s(zH,"extractStyleMap");function hI(e,t){return e.reduce((r,n)=>{let o=t[n.properties.id];if(o==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let i=R(P({},o),{id:o.id+"-textures"});r.set(i,[n])}else r.has(o)||r.set(o,[]),r.get(o).push(n);return r},new Map)}s(hI,"groupGeometryByStyle");function th(e,t={}){var o,i,a,l,c,u,d;let r=R(P({},e),{flipImageToFaceCamera:(o=t==null?void 0:t.flipImagesToFaceCamera)!=null?o:!0}),n=(a=(i=t==null?void 0:t.style)==null?void 0:i.shading)!=null?a:t==null?void 0:t.shadingAndOutlines;if(n===!0?r.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(r.shading={start:n.start,end:n.end,intensity:n.intensity}),r.outline=(c=(l=t==null?void 0:t.style)==null?void 0:l.outlines)!=null?c:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let h=(d=(u=t==null?void 0:t.style)==null?void 0:u.wallTopColor)!=null?d:t==null?void 0:t.wallTopColor;h!=null&&(r.topColor=h)}return r}s(th,"translateToCoreStyle");var pW=s((e,t)=>{var o;let n=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Or);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Zl);case"exterior-walls":return n==null?void 0:n.layers.get(Cs);case"interior-doors":return n==null?void 0:n.layers.get(Dd);case"exterior-doors":return n==null?void 0:n.layers.get(Fd);default:return typeof e=="string"?e:e.id}},"getTargetID");function z7(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}s(z7,"tweenToPromise");function yI(e){return e.bbox?e.bbox:hd(e)}s(yI,"getBoundingBox");function uW(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]}s(uW,"expandBbox");function kW(e){return[...new Set(e)]}s(kW,"unique");function H7(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}s(H7,"getTargetFloorObject");function eh(e){if(Gr.is(e)||io.is(e))return e.id}s(eh,"getAttachableGeometryId");function HH(e,t,r){var i,a,l,c,u,d;let n=e.coordinates.length===2,o=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let h=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),y=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);h&&y&&(o=((a=(i=r.getState(h))==null?void 0:i.visible)!=null?a:!0)&&((c=(l=r.getState(y))==null?void 0:l.visible)!=null?c:!0))}else{let h=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;o=h&&(d=(u=r.getState(h))==null?void 0:u.visible)!=null?d:!0}return o}s(HH,"determineFloorVisibleBasedOnPath");var AW=Math.PI*.1,Dr,Nn,ro,ad,ld,Nl,cd,gh,vi,DW,yh,FW,y6=class y6{constructor(t,r,n,o){E(this,vi);E(this,Dr,{});E(this,Nn);E(this,ro);E(this,ad);E(this,ld);E(this,Nl);E(this,cd);E(this,gh);A(this,Nn,r),A(this,ro,t.features),A(this,ad,n),A(this,ld,o)}get path(){return p(this,ro).map(t=>p(this,Nn).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(p(this,Dr).departure)return p(this,Dr).departure;let t=p(this,ro)[0].properties.id,r=p(this,ad)[0];if(p(this,ad).length>1){for(let n of p(this,ad))if(xb(n,p(this,Nn)).includes(t)){r=n;break}}return p(this,Dr).departure=r,r}get destination(){if(p(this,Dr).destination)return p(this,Dr).destination;let t=p(this,ro)[p(this,ro).length-1].properties.id,r=p(this,ld)[0];if(p(this,ld).length>1){for(let n of p(this,ld))if(xb(n,p(this,Nn)).includes(t)){r=n;break}}return p(this,Dr).destination=r,r}get coordinates(){return p(this,Dr).coordinates?p(this,Dr).coordinates:(p(this,Dr).coordinates=p(this,ro).map(t=>new $e(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),p(this,Dr).coordinates)}get distance(){return p(this,Dr).distance?p(this,Dr).distance:(p(this,Dr).distance=p(this,ro).reduce((t,r)=>t+(r.properties.distance||0),0),p(this,Dr).distance)}get instructions(){if(p(this,ro).length<2)return[];if(p(this,Dr).instructions)return p(this,Dr).instructions;let t=[],r=0;for(let n=0;n<p(this,ro).length;n++){let o=p(this,ro)[n],i=p(this,ro)[n-1],a=p(this,ro)[n+1],l=new $e(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),c=te(this,vi,DW).call(this,{prevDirection:i,direction:o,nextDirection:a});r+=(i==null?void 0:i.properties.distance)||0;for(let u of c)u&&(t.push({action:u,distance:r,coordinate:l,node:p(this,Nn).getById("node",o.properties.id)}),r=0)}return p(this,Dr).instructions=t,p(this,Dr).instructions}};Dr=new WeakMap,Nn=new WeakMap,ro=new WeakMap,ad=new WeakMap,ld=new WeakMap,Nl=new WeakMap,cd=new WeakMap,gh=new WeakMap,vi=new WeakSet,DW=s(function(t){var I,S;let{prevDirection:r,direction:n,nextDirection:o}=t,i=r&&p(this,Nn).getById("floor",r.properties.groupBy),a=p(this,Nn).getById("floor",n.properties.groupBy),l=o&&p(this,Nn).getById("floor",o.properties.groupBy),c=[];r||c.push({type:"Departure"});let u=p(this,Nn).getMVFFeatureByNodeId("connection",n.properties.id),d=u?p(this,Nn).getById("connection",u.id):void 0,h=u&&u.nodes.length>1,y=p(this,Nn).enterpriseMode&&(!n.properties.destination||!(u!=null&&u.nodes.includes(n.properties.destination))||!(u!=null&&u.nodes.includes(n.properties.id)));if(u&&!(!h||y))if(!p(this,Nl)||p(this,Nl)==="exit")c.push(te(this,vi,yh).call(this,"TakeConnection",a,l,d,u)),A(this,Nl,"take"),A(this,cd,d),A(this,gh,u);else{let x=p(this,Nn).getMVFFeatureByNodeId("connection",(I=r==null?void 0:r.properties.id)!=null?I:""),T=p(this,Nn).getById("connection",(S=x==null?void 0:x.id)!=null?S:"");c.push(te(this,vi,yh).call(this,"ExitConnection",a,i,T,x)),A(this,Nl,"exit"),A(this,cd,d),A(this,gh,u)}else p(this,Nl)==="take"?(c.push(te(this,vi,yh).call(this,"ExitConnection",a,i,p(this,cd),p(this,gh))),A(this,Nl,"exit"),A(this,cd,d)):l&&a.id!==l.id?c.push(te(this,vi,yh).call(this,"TakeConnection",a,l,d)):i&&i.id!==a.id?c.push(te(this,vi,yh).call(this,"ExitConnection",a,i,d)):c.push(te(this,vi,FW).call(this,r,n));return o||c.push({type:"Arrival"}),c},"#getActions"),yh=s(function(t,r,n,o,i){var c,u;let a="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let d=r.elevation-n.elevation;d>0?a="down":d<0&&(a="up")}let l=(u=(c=o==null?void 0:o.type)!=null?c:i==null?void 0:i.type)!=null?u:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:a,connection:o,connectionType:l}},"#createConnectionAction"),FW=s(function(t,r){let n=r.properties.edges;if(!n||n.filter(a=>a.destination.properties.id!==(t==null?void 0:t.properties.id)&&a.destination.properties.id!==r.properties.destination).length===0)return null;let i=t?-EW(t.properties.angle,r.properties.angle):0;return Math.abs(i)>=AW?{type:"Turn",bearing:_W(i,AW),referencePosition:"At"}:null},"#createTurnAction"),s(y6,"Directions");var TI=y6,g6=class g6{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:o,multiplicativeDistanceWeightScaling:i}){m(this,"navigator");m(this,"connections");m(this,"getDirections",s((t,r,n,o)=>{let{accessible:i,smoothing:{enabled:a,radius:l},connectionIdWeightMap:c}=n,u=t.flatMap(x=>xb(x,o)),d=r.flatMap(x=>xb(x,o)),h=this.getExcludedNodeIds(n.excludedConnections).filter(x=>!u.includes(x)&&!d.includes(x)),y=this.getDisabledConnectionNodeIds(i).filter(x=>!u.includes(x)&&!d.includes(x)),b=new Map;for(let x in c){let T=o.getMVFFeatureById("connection",x);if(!T)continue;let w=this.navigator.graph.edges[T.nodes[0]];if(w){let M=w.find(O=>O.destination.properties.id===T.nodes[1]);M&&b.set(M,c[x])}}let I=this.navigator.getDirections({zones:n.zones.map(x=>{var T;return{geometry:x.geometry,cost:x.cost,map:(T=x.floor)==null?void 0:T.id}}),originIds:u,destinationNodeIds:d,excludedNodeIds:h,disabledConnectionNodeIds:y,simplify:{enabled:a,bufferRadius:l},overrideEdgeWeights:b,multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(I,t,r);let S=new TI(I,o,t,r);if(!(S.distance===0&&new Set([...u,...d]).size===u.length+d.length))return S},"getDirections"));m(this,"getExcludedNodeIds",s(t=>{if(t.length===0)return[];let r=new Set(t.map(n=>n.id));return this.connections.reduce((n,o)=>r.has(o.id)?n.concat(o.nodes):n,[])},"getExcludedNodeIds"));m(this,"getDisabledConnectionNodeIds",s(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));m(this,"addCoordinateDirections",s((t,[r],[n])=>{if(t.features.length){if($e.is(r)){let o=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if($e.is(n)){let o=this.createDirectionFeature(n,0,0),i=t.features[t.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[n.longitude,n.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(o)}}},"addCoordinateDirections"));m(this,"createDirectionFeature",s((t,r,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:r,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new tm({nodes:t,geojsonCollection:this.createCollection(r),groupBy:o,multiplicativeDistanceWeightScaling:i}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,o])=>r.concat(o.features.map(i=>(i.properties.map=n,i))),[])}}};s(g6,"DirectionsInternal");var EI=g6;function xb(e,t){var r,n,o,i;if(Ip.is(e))return e.navigationTarget.flatMap(a=>xb(a,t));if(Oa.is(e)){let a=t.Query.nearest(e,{types:["node"]});return(r=a==null?void 0:a[0])!=null&&r.feature.id?[a[0].feature.id]:[]}else if($e.is(e)){let a=t.Query.nearest(e,{types:["node"]});return(n=a==null?void 0:a[0])!=null&&n.feature.id?[a[0].feature.id]:[]}else if(Ma.is(e)){let a=t.Query.nearest(e,{types:["node"]});return(o=a==null?void 0:a[0])!=null&&o.feature.id?[a[0].feature.id]:[]}else if(Ei.is(e)){let a=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return a!=null&&a.properties.node?[a==null?void 0:a.properties.node]:[]}else if(Pa.is(e)){let a=t==null?void 0:t.getMVFFeatureById("area",e.id);return(i=a==null?void 0:a.properties.destinationNodes)!=null?i:[]}else if(Gr.is(e)){let a=t==null?void 0:t.getMVFFeatureById("space",e.id);return a==null?[]:a.properties.destinationNodes}else{if(Yl.is(e))return e.coordinates.reduce((a,l)=>{var u;let c=t.Query.nearest(l,{types:["node"]});return(u=c==null?void 0:c[0])!=null&&u.feature.id&&a.push(c[0].feature.id),a},[]);if(io.is(e)){let a=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return a!=null?a:[]}else return Ho.is(e)?e.spaces.flatMap(a=>{var l,c;return(c=(l=t==null?void 0:t.getMVFFeatureById("space",a.id))==null?void 0:l.properties.destinationNodes)!=null?c:[]}).filter(a=>typeof a=="string"):Ss.is(e)?e.nodes.map(a=>a.id):Sa.is(e)?[e.id]:[]}}s(xb,"getNodesFromTarget");f();f();f();f();f();f();function b6(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return LW(this.cover(t,r),t,r,e)}s(b6,"default");function LW(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i=e._root,a={data:n},l=e._x0,c=e._y0,u=e._x1,d=e._y1,h,y,b,I,S,x,T,w;if(!i)return e._root=a,e;for(;i.length;)if((S=t>=(h=(l+u)/2))?l=h:u=h,(x=r>=(y=(c+d)/2))?c=y:d=y,o=i,!(i=i[T=x<<1|S]))return o[T]=a,e;if(b=+e._x.call(null,i.data),I=+e._y.call(null,i.data),t===b&&r===I)return a.next=i,o?o[T]=a:e._root=a,e;do o=o?o[T]=new Array(4):e._root=new Array(4),(S=t>=(h=(l+u)/2))?l=h:u=h,(x=r>=(y=(c+d)/2))?c=y:d=y;while((T=x<<1|S)===(w=(I>=y)<<1|b>=h));return o[w]=i,o[T]=a,e}s(LW,"add");function RW(e){var t,r,n=e.length,o,i,a=new Array(n),l=new Array(n),c=1/0,u=1/0,d=-1/0,h=-1/0;for(r=0;r<n;++r)isNaN(o=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(a[r]=o,l[r]=i,o<c&&(c=o),o>d&&(d=o),i<u&&(u=i),i>h&&(h=i));if(c>d||u>h)return this;for(this.cover(c,u).cover(d,h),r=0;r<n;++r)LW(this,a[r],l[r],e[r]);return this}s(RW,"addAll");f();function x6(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var a=o-r||1,l=this._root,c,u;r>e||e>=o||n>t||t>=i;)switch(u=(t<n)<<1|e<r,c=new Array(4),c[u]=l,l=c,a*=2,u){case 0:o=r+a,i=n+a;break;case 1:r=o-a,i=n+a;break;case 2:o=r+a,n=i-a;break;case 3:r=o-a,n=i-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this}s(x6,"default");f();function v6(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}s(v6,"default");f();function I6(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}s(I6,"default");f();f();function Kr(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}s(Kr,"default");function S6(e,t,r){var n,o=this._x0,i=this._y0,a,l,c,u,d=this._x1,h=this._y1,y=[],b=this._root,I,S;for(b&&y.push(new Kr(b,o,i,d,h)),r==null?r=1/0:(o=e-r,i=t-r,d=e+r,h=t+r,r*=r);I=y.pop();)if(!(!(b=I.node)||(a=I.x0)>d||(l=I.y0)>h||(c=I.x1)<o||(u=I.y1)<i))if(b.length){var x=(a+c)/2,T=(l+u)/2;y.push(new Kr(b[3],x,T,c,u),new Kr(b[2],a,T,x,u),new Kr(b[1],x,l,c,T),new Kr(b[0],a,l,x,T)),(S=(t>=T)<<1|e>=x)&&(I=y[y.length-1],y[y.length-1]=y[y.length-1-S],y[y.length-1-S]=I)}else{var w=e-+this._x.call(null,b.data),M=t-+this._y.call(null,b.data),O=w*w+M*M;if(O<r){var _=Math.sqrt(r=O);o=e-_,i=t-_,d=e+_,h=t+_,n=b.data}}return n}s(S6,"default");f();function C6(e){if(isNaN(d=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var t,r=this._root,n,o,i,a=this._x0,l=this._y0,c=this._x1,u=this._y1,d,h,y,b,I,S,x,T;if(!r)return this;if(r.length)for(;;){if((I=d>=(y=(a+c)/2))?a=y:c=y,(S=h>=(b=(l+u)/2))?l=b:u=b,t=r,!(r=r[x=S<<1|I]))return this;if(!r.length)break;(t[x+1&3]||t[x+2&3]||t[x+3&3])&&(n=t,T=x)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(i=r.next)&&delete r.next,o?(i?o.next=i:delete o.next,this):t?(i?t[x]=i:delete t[x],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[T]=r:this._root=r),this):(this._root=i,this)}s(C6,"default");function NW(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}s(NW,"removeAll");f();function T6(){return this._root}s(T6,"default");f();function P6(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}s(P6,"default");f();function w6(e){var t=[],r,n=this._root,o,i,a,l,c;for(n&&t.push(new Kr(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,i=r.x0,a=r.y0,l=r.x1,c=r.y1)&&n.length){var u=(i+l)/2,d=(a+c)/2;(o=n[3])&&t.push(new Kr(o,u,d,l,c)),(o=n[2])&&t.push(new Kr(o,i,d,u,c)),(o=n[1])&&t.push(new Kr(o,u,a,l,d)),(o=n[0])&&t.push(new Kr(o,i,a,u,d))}return this}s(w6,"default");f();function M6(e){var t=[],r=[],n;for(this._root&&t.push(new Kr(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var o=n.node;if(o.length){var i,a=n.x0,l=n.y0,c=n.x1,u=n.y1,d=(a+c)/2,h=(l+u)/2;(i=o[0])&&t.push(new Kr(i,a,l,d,h)),(i=o[1])&&t.push(new Kr(i,d,l,c,h)),(i=o[2])&&t.push(new Kr(i,a,h,d,u)),(i=o[3])&&t.push(new Kr(i,d,h,c,u))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}s(M6,"default");f();function BW(e){return e[0]}s(BW,"defaultX");function O6(e){return arguments.length?(this._x=e,this):this._x}s(O6,"default");f();function $W(e){return e[1]}s($W,"defaultY");function E6(e){return arguments.length?(this._y=e,this):this._y}s(E6,"default");function vb(e,t,r){var n=new _6(t==null?BW:t,r==null?$W:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}s(vb,"quadtree");function _6(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}s(_6,"Quadtree");function jW(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}s(jW,"leaf_copy");var no=vb.prototype=_6.prototype;no.copy=function(){var e=new _6(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=jW(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var o=0;o<4;++o)(n=t.source[o])&&(n.length?r.push({source:n,target:t.target[o]=new Array(4)}):t.target[o]=jW(n));return e};no.add=b6;no.addAll=RW;no.cover=x6;no.data=v6;no.extent=I6;no.find=S6;no.remove=C6;no.removeAll=NW;no.root=T6;no.size=P6;no.visit=w6;no.visitAfter=M6;no.x=O6;no.y=E6;var $o,Qc,k6=class k6{constructor(t){E(this,$o,{});E(this,Qc);A(this,Qc,t)}getTreeByType(t,r,n){var a;if(p(this,$o)[t]||(p(this,$o)[t]={}),p(this,$o)[t][r]&&p(this,$o)[t][r][n])return p(this,$o)[t][r][n];p(this,$o)[t][r]||(p(this,$o)[t][r]={}),p(this,$o)[t][r][n]||(p(this,$o)[t][r][n]=vb());let o=p(this,$o)[t][r][n];o.x(l=>l.geometry.coordinates[1]),o.y(l=>l.geometry.coordinates[0]);let i=[];switch(t){case"node":i=((a=p(this,Qc).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:a.filter(l=>l.properties.neighbors.length>0))||[];break;case"point-of-interest":i=p(this,Qc).mvfPoisByFloorId[n]||[];break;case"door":i=p(this,Qc).mvfEntrancesByFloorId[n]||[];break;case"annotation":i=p(this,Qc).mvfAnnotationsByFloorId[n]||[];break}return(i==null?void 0:i.length)>0&&o.addAll(i),o}};$o=new WeakMap,Qc=new WeakMap,s(k6,"QueryCache");var _I=k6;var wxe=yn.object({limit:yn.enum(["same-floor","same-elevation"]).optional(),radius:yn.number().optional(),types:yn.array(yn.enum(["node","point-of-interest"])).min(1)}),ma,Sb,A6=class A6{constructor(t){E(this,ma);E(this,Sb);A(this,ma,t),A(this,Sb,new _I(p(this,ma)))}nearest(t,r){try{wxe.parse(r)}catch(a){z.error(a);return}let n=Bh(t);if(!n)return;let o=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let a of p(this,ma).getByType("floor-stack")){let l=a.defaultFloor;l&&o.push(l.id)}else if(r.limit==="same-elevation"){let a=p(this,ma).floorsById[n.floorId];if(a){let l=a==null?void 0:a.elevation;l&&(o=p(this,ma).getByType("floor-stack").map(c=>{var u;return(u=c.floors.find(d=>d.elevation===l))==null?void 0:u.id}).filter(Boolean))}}let i=[];for(let a of kW(r.types))for(let l of o){let c=p(this,Sb).getTreeByType(a,p(this,ma).mapName,l).find(n.latitude,n.longitude,r.radius);if(c){let u=p(this,ma).getById(a,c==null?void 0:c.properties.id);u&&i.push({distance:Zi([n.longitude,n.latitude],c.geometry.coordinates),feature:u})}}return i.sort((a,l)=>a.distance-l.distance)}};ma=new WeakMap,Sb=new WeakMap,s(A6,"Query");var Ib=A6;f();f();var Cb,D6=class D6{constructor(t){E(this,Cb);A(this,Cb,t||[])}get raw(){return p(this,Cb)}};Cb=new WeakMap,s(D6,"OpeningHours");var kI=D6;var vn,Te,Xt,bh=class bh extends jr{constructor(r,n){super(n.mvfData.id);m(this,"__type",bh.__type);m(this,"id","loc_");m(this,"name","");m(this,"externalId");m(this,"description");m(this,"logo");m(this,"phone");m(this,"social",[]);m(this,"images",[]);m(this,"links",[]);m(this,"website");m(this,"icon");E(this,vn);E(this,Te,{});E(this,Xt);A(this,vn,r),A(this,Xt,n.mvfData);for(let o in n.mvfData)o==="links"?this.links=n.mvfData.links.map(i=>new zl({mvfData:i})):o==="pictures"?this.images=n.mvfData.pictures.map(i=>{var a;return i.url?new Wl({mvfData:R(P({},i),{url:(a=i.url)!=null?a:""}),mapData:p(this,vn)}):void 0}).filter(i=>i!=null):o==="website"?n.mvfData.website&&(this.website=new zl({mvfData:n.mvfData.website})):o==="icon"?n.mvfData.icon&&(this.icon=new Wl({mvfData:{url:n.mvfData.icon},mapData:p(this,vn)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return p(this,Xt)[o]}})}static is(r){return r.__type===bh.__type}get spaces(){if(p(this,Te).spaces)return p(this,Te).spaces;if(p(this,Xt).spaces==null)return p(this,Te).spaces=[],p(this,Te).spaces;p(this,Te).spaces=[];for(let r=0;r<p(this,Xt).spaces.length;r++){let n=p(this,vn).getById("space",p(this,Xt).spaces[r].id);n&&p(this,Te).spaces.push(n)}return p(this,Te).spaces}get points(){if(p(this,Te).points)return p(this,Te).points;if(p(this,Xt).spaces==null)return p(this,Te).points=[],p(this,Te).points;p(this,Te).points=[];for(let r=0;r<p(this,Xt).spaces.length;r++){let n=p(this,vn).getById("point-of-interest",p(this,Xt).spaces[r].id);n&&p(this,Te).points.push(n)}return p(this,Te).points}get doors(){if(p(this,Te).doors)return p(this,Te).doors;if(p(this,Xt).entrances==null)return p(this,Te).doors=[],p(this,Te).doors;p(this,Te).doors=[];for(let r=0;r<p(this,Xt).entrances.length;r++){let n=p(this,vn).getById("door",p(this,Xt).entrances[r].id);n&&p(this,Te).doors.push(n)}return p(this,Te).doors}get connections(){var n;if(p(this,Te).connections)return p(this,Te).connections;if(p(this,Xt).connections==null)return p(this,Te).connections=[],p(this,Te).connections;let r=new Set;for(let o=0;o<p(this,Xt).connections.length;o++){let i=p(this,Xt).connections[o],a=p(this,vn).mvfConnectionsById[i],c=(a==null?[]:a.nodes).map(u=>p(this,vn).getById("node",u)).filter(Boolean);for(let u of c){if(u==null)continue;let d=vs([u.coordinate.longitude,u.coordinate.latitude]),y=((n=p(this,vn).connectionSpaceIdsByLatLon[d])!=null?n:[]).map(b=>p(this,vn).connectionsById[b]).filter(b=>b!=null);for(let b of y)r.add(b)}}return p(this,Te).connections=Array.from(r),p(this,Te).connections}get annotations(){if(p(this,Te).annotations)return p(this,Te).annotations;if(p(this,Xt).annotations==null)return p(this,Te).annotations=[],p(this,Te).annotations;p(this,Te).annotations=[];for(let r=0;r<p(this,Xt).annotations.length;r++){let n=p(this,vn).getById("annotation",p(this,Xt).annotations[r].id);n&&p(this,Te).annotations.push(n)}return p(this,Te).annotations}get categories(){return p(this,Te).categories?p(this,Te).categories:p(this,Xt).categories==null?(p(this,Te).categories=[],p(this,Te).categories):(p(this,Te).categories=p(this,Xt).categories.map(r=>p(this,vn).getById("location-category",r)).filter(r=>r!=null),p(this,Te).categories)}get mapObjects(){return p(this,Te).mapObjects?p(this,Te).mapObjects:p(this,Xt).obstructions==null?(p(this,Te).mapObjects=[],p(this,Te).mapObjects):(p(this,Te).mapObjects=p(this,Xt).obstructions.map(r=>p(this,vn).getById("object",r.id)).filter(r=>r!=null),p(this,Te).mapObjects)}get areas(){return p(this,Te).areas?p(this,Te).areas:p(this,Xt).areas==null?(p(this,Te).areas=[],p(this,Te).areas):(p(this,Te).areas=p(this,Xt).areas.map(r=>p(this,vn).getById("area",r.id)).filter(r=>r!=null),p(this,Te).areas)}get focusTarget(){if(p(this,Te).focusTarget)return p(this,Te).focusTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);return p(this,Te).focusTarget=r,r}get openingHours(){var r;return p(this,Te).openingHours?p(this,Te).openingHours:(p(this,Te).openingHours=new kI((r=p(this,Xt).openingHoursSpecification)!=null?r:[]),p(this,Te).openingHours)}get navigationTarget(){if(p(this,Te).navigationTarget)return p(this,Te).navigationTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);return p(this,Te).navigationTarget=r,r}toJSON(){return{id:this.id,name:this.name}}};vn=new WeakMap,Te=new WeakMap,Xt=new WeakMap,s(bh,"LocationProfile"),m(bh,"__type","location-profile");var F6=bh,Ip=F6;f();var ep,To,pd,xh=class xh extends jr{constructor(r,n){super(n.mvfData.id);m(this,"__type",xh.__type);m(this,"id","cat_");m(this,"name","");m(this,"icon","");E(this,ep);E(this,To,{});E(this,pd);A(this,ep,r),A(this,pd,n.mvfData);for(let o in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return p(this,pd)[o]}})}static is(r){return r.__type===xh.__type}get parent(){return p(this,To).parent?p(this,To).parent:(p(this,To).parent=p(this,pd).parent?p(this,ep).getById("location-category",p(this,pd).parent):void 0,p(this,To).parent)}get children(){return p(this,To).children?p(this,To).children:(p(this,To).children=p(this,ep).locationCategoriesByParentId[this.id]||[],p(this,To).children)}get locationProfiles(){if(p(this,To).locationProfiles)return p(this,To).locationProfiles;let r=[];for(let n of p(this,ep).locationProfilesByCategoryId[this.id]||[]){let o=p(this,ep).getById("location-profile",n.id);o&&r.push(o)}return p(this,To).locationProfiles=r,r}toJSON(){return{id:this.id,name:this.name}}};ep=new WeakMap,To=new WeakMap,pd=new WeakMap,s(xh,"LocationCategory"),m(xh,"__type","location-category");var L6=xh,Hh=L6;var Ae,AI,GW,vh,R6=class R6 extends Be{constructor(r,n){var l,c,u,d,h;super();E(this,AI);m(this,"Analytics");E(this,Ae,{});m(this,"Query");m(this,"mvf");m(this,"outdoorViewToken");m(this,"spaceIdsByDestinationNodeId");m(this,"objectEntranceNodeIdsByObstructionId");m(this,"obstructionIdByEntranceId");m(this,"venue");m(this,"tokenManager");m(this,"directions");m(this,"enterpriseMode",!1);m(this,"nodesById");m(this,"spacesById");m(this,"floorsById");m(this,"floorStacksById");m(this,"facadesById");m(this,"facadesBySpaceId");m(this,"connectionsById");m(this,"objectsById");m(this,"doorsById");m(this,"pointsOfInterestById");m(this,"annotationsById");m(this,"areasById");m(this,"locationProfilesById");m(this,"locationCategoriesById");m(this,"locationProfilesByExternalId");m(this,"locationsById");m(this,"locationProfilesByCategoryId");m(this,"locationCategoriesByParentId");m(this,"categoriesById");m(this,"doorsByNodeId");m(this,"mvfLocationsBySpaceId");m(this,"locationIdsByNodeId");m(this,"spaceIdsByNodeId");m(this,"mvfAnnotationsById");m(this,"mvfConnectionsById");m(this,"mvfConnectionsByNodeId");m(this,"mvfConnectionIdsByLatLon");m(this,"mvfEntrancesById");m(this,"mvfNodesById");m(this,"mvfObstructionById");m(this,"mvfSpacesById");m(this,"mvfFloorsById");m(this,"mvfFloorStacksById");m(this,"mvfAreasById");m(this,"connectionSpaceIdsByLatLon");m(this,"locationProfilesByAttachedFeatureId");m(this,"spacesByExternalId");m(this,"nodesByExternalId");m(this,"objectsByExternalId");m(this,"poisByExternalId");m(this,"floorsByExternalId");m(this,"floorStacksByExternalId");m(this,"doorsByExternalId");m(this,"areasByExternalId");m(this,"connectionsByExternalId");m(this,"locationsByExternalId");m(this,"categoriesByExternalId");m(this,"mvfNodesByFloorId");m(this,"mvfSpacesByFloorId");m(this,"mvfPoisByFloorId");m(this,"mvfEntrancesByFloorId");m(this,"mvfAnnotationsByFloorId");m(this,"localePacksUrls");m(this,"currentLanguage");m(this,"languagePacks",{});m(this,"tilesets",{});m(this,"binaryBundle");m(this,"envControl");m(this,"getMapDataOptions");E(this,vh);m(this,"getDirectionsMultiDestination",s((r,n,o)=>this.getDirections(r,n,R(P({},o),{multiDestination:!0})),"getDirectionsMultiDestination"));m(this,"getDirections",s((r,n,o)=>{let{accessible:i=!1,smoothing:a=!0,multiDestination:l=!1}=o||{},c=typeof a=="object"?a.enabled:a,u=typeof a=="object"?a.radius:void 0,d=(o==null?void 0:o.zones)||[],h={accessible:i,zones:d,smoothing:{enabled:c!=null?c:!0,radius:u!=null?u:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[],connectionIdWeightMap:(o==null?void 0:o.connectionIdWeightMap)||{}};if(l&&Array.isArray(n)){let y=Array.isArray(r)?r:[r],b=[];for(let I of n){let S=Array.isArray(I)?I:[I],x=this.directions.getDirections(y,S,h,this);if(!x){z.error("getDirections failed due to missing directions for one of the segments");return}y=S,b.push(x)}return b}else{let y=Array.isArray(r)?r:[r],b=Array.isArray(n)?n:[n];if(Array.isArray(b[0])){z.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&b[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,b[0].id),this.directions.getDirections(y,b,h,this)}},"getDirections"));m(this,"transformImageRequest",s(async r=>{var o;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!CG(r))return{url:r};if(TG(r))return{url:r};let n=Wb(r);if(!n)return{url:r};try{let i=await((o=this.tokenManager)==null?void 0:o.getSasTokensAsync()),a=i==null?void 0:i[n.mapId];if(a==null)throw new Error("SAS token not found");let[l]=r.split("?");return{url:"".concat(l,"?").concat(a.token)}}catch(i){return z.error("Failed to append SAS token to image request. Requests for private images may fail.",i),{url:r}}},"transformImageRequest"));let o=(l=n==null?void 0:n.env)!=null?l:tu();if(this.envControl=o,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new Ud,this.localePacksUrls=(c=n==null?void 0:n.localePacksUrls)!=null?c:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((u=r["tileset.json"])==null?void 0:u.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,o.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let y of r["tileset.json"].others)this.tilesets[y.key]=y;this.enterpriseMode=(d=n==null?void 0:n.enterprise)!=null?d:!1,this.tokenManager=n==null?void 0:n.tokenManager;let i=Y9(r,this);this.nodesById=i.nodesById,this.spacesById=i.spacesById,this.floorsById=i.floorsById,this.floorStacksById=i.floorStacksById,this.facadesById=i.facadesById,this.facadesBySpaceId=i.facadesBySpaceId,this.connectionsById=i.connectionsById,this.objectsById=i.objectsById,this.doorsById=i.doorsById,this.pointsOfInterestById=i.poisById,this.annotationsById=i.annotationsById,this.areasById=i.areasById,this.locationProfilesById=i.locationProfilesById,this.locationCategoriesById=i.locationCategoriesById,this.locationProfilesByCategoryId=i.locationProfilesByCategoryId,this.locationCategoriesByParentId=i.locationCategoriesByParentId,this.spacesByExternalId=i.spacesByExternalId,this.nodesByExternalId=i.nodesByExternalId,this.objectsByExternalId=i.objectsByExternalId,this.floorsByExternalId=i.floorsByExternalId,this.locationProfilesByExternalId=i.locationProfilesByExternalId,this.floorStacksByExternalId=i.floorStacksByExternalId,this.poisByExternalId=i.poisByExternalId,this.doorsByExternalId=i.doorsByExternalId,this.areasByExternalId=i.areasByExternalId,this.mvfAnnotationsById=i.mvfAnnotationsById,this.mvfConnectionsById=i.mvfConnectionsById,this.mvfConnectionsByNodeId=i.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=i.mvfConnectionIdsByLatLon,this.mvfEntrancesById=i.mvfEntrancesById,this.mvfNodesById=i.mvfNodesById,this.mvfObstructionById=i.mvfObstructionById,this.mvfSpacesById=i.mvfSpacesById,this.mvfFloorsById=i.mvfFloorsById,this.mvfFloorStacksById=i.mvfFloorStacksById,this.mvfNodesByFloorId=i.mvfNodesByFloorId,this.mvfSpacesByFloorId=i.mvfSpacesByFloorId,this.mvfPoisByFloorId=i.mvfPoisByFloorId,this.mvfEntrancesByFloorId=i.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=i.mvfAnnotationsByFloorId,this.mvfAreasById=i.mvfAreasById,this.doorsByNodeId=i.doorsByNodeId,this.spaceIdsByDestinationNodeId=i.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=i.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=i.obstructionIdByEntranceId;let a=X9(r,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.mvfLocationsBySpaceId=a.mvfLocationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=i.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=i.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.connectionsByExternalId=a.connectionsByExternalId,this.locationsByExternalId=a.locationsByExternalId,this.categoriesByExternalId=a.categoriesByExternalId,a.venue.name!=null){this.venue=new Zb(this,{mvfData:a.venue});let y={};for(let b in a.mvfLocationsById)y[b]=a.mvfLocationsById[b];for(let b in a.locationInstancesById)y[b]=a.locationInstancesById[b];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":y,"enterprise-category":a.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},(h=n==null?void 0:n.languagePacks)==null||h.forEach(({language:b,localePack:I})=>{this.languagePacks[b.code]=e4(I)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Ib(this),this.directions=new EI({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new $e(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return p(this,Ae).spaces==null&&(p(this,Ae).spaces=globalThis.Object.values(this.spacesById)),p(this,Ae).spaces}get objects(){return p(this,Ae).objects==null&&(p(this,Ae).objects=globalThis.Object.values(this.objectsById)),p(this,Ae).objects}get connections(){return p(this,Ae).connections==null&&(p(this,Ae).connections=globalThis.Object.values(this.connectionsById)),p(this,Ae).connections}get floors(){return p(this,Ae).floors==null&&(p(this,Ae).floors=globalThis.Object.values(this.floorsById)),p(this,Ae).floors}get floorStacks(){return p(this,Ae).floorStacks==null&&(p(this,Ae).floorStacks=globalThis.Object.values(this.floorStacksById)),p(this,Ae).floorStacks}get facades(){return p(this,Ae).facades==null&&(p(this,Ae).facades=globalThis.Object.values(this.facadesById)),p(this,Ae).facades}get doors(){return p(this,Ae).doors==null&&(p(this,Ae).doors=globalThis.Object.values(this.doorsById)),p(this,Ae).doors}get pointsOfInterest(){return p(this,Ae).pointsOfInterest==null&&(p(this,Ae).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),p(this,Ae).pointsOfInterest}get annotations(){return p(this,Ae).annotations==null&&(p(this,Ae).annotations=globalThis.Object.values(this.annotationsById)),p(this,Ae).annotations}get areas(){return p(this,Ae).areas==null&&(p(this,Ae).areas=globalThis.Object.values(this.areasById)),p(this,Ae).areas}get nodes(){return p(this,Ae).nodes==null&&(p(this,Ae).nodes=globalThis.Object.values(this.nodesById)),p(this,Ae).nodes}get locations(){return p(this,Ae).locations==null&&(p(this,Ae).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return p(this,Ae).categories==null&&(p(this,Ae).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return p(this,Ae).locationProfiles==null&&(p(this,Ae).locationProfiles=globalThis.Object.values(this.locationProfilesById)),p(this,Ae).locationProfiles}get locationCategories(){return p(this,Ae).locationCategories==null&&(p(this,Ae).locationCategories=globalThis.Object.values(this.locationCategoriesById)),p(this,Ae).locationCategories}get mvfFloors(){return p(this,Ae).mvfFloors==null&&(p(this,Ae).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),p(this,Ae).mvfFloors}get mvfFloorStacks(){return p(this,Ae).mvfFloorStacks==null&&(p(this,Ae).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),p(this,Ae).mvfFloorStacks}getByType(r){switch(r){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(r,n){switch(r){case"location-profile":return this.locationProfilesById[n];case"location-category":return this.locationCategoriesById[n];case"space":return this.spacesById[n];case"floor":return this.floorsById[n];case"floor-stack":return this.floorStacksById[n];case"facade":return this.facadesById[n];case"node":return this.nodesById[n];case"door":return this.doorsById[n];case"connection":let o=this.connectionsById[n];return o==null&&(o=te(this,AI,GW).call(this,this.mvfConnectionsById[n])),o;case"object":return this.objectsById[n];case"point-of-interest":return this.pointsOfInterestById[n];case"annotation":return this.annotationsById[n];case"area":return this.areasById[n];case"enterprise-location":return this.locationsById[n];case"enterprise-category":return this.categoriesById[n];default:return}}getByExternalId(r,n){var o,i,a,l,c,u,d,h,y,b,I,S;switch(r){case"location-profile":return(o=this.locationProfilesByExternalId[n])!=null?o:[];case"location-category":return[];case"space":return(i=this.spacesByExternalId[n])!=null?i:[];case"floor":return(a=this.floorsByExternalId[n])!=null?a:[];case"floor-stack":return(l=this.floorStacksByExternalId[n])!=null?l:[];case"node":return(c=this.nodesByExternalId[n])!=null?c:[];case"door":return(u=this.doorsByExternalId[n])!=null?u:[];case"connection":return(d=this.connectionsByExternalId[n])!=null?d:[];case"object":return(h=this.objectsByExternalId[n])!=null?h:[];case"point-of-interest":return(y=this.poisByExternalId[n])!=null?y:[];case"area":return(b=this.areasByExternalId[n])!=null?b:[];case"enterprise-location":return(I=this.locationsByExternalId[n])!=null?I:[];case"enterprise-category":return(S=this.categoriesByExternalId[n])!=null?S:[];default:return[]}}getMapDataById(r){var n,o,i,a,l,c,u,d,h,y;return(y=(h=(d=(u=(c=(l=(a=(i=(o=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?o:this.floorStacksById[r])!=null?i:this.facadesById[r])!=null?a:this.nodesById[r])!=null?l:this.doorsById[r])!=null?c:this.connectionsById[r])!=null?u:this.objectsById[r])!=null?d:this.pointsOfInterestById[r])!=null?h:this.annotationsById[r])!=null?y:this.areasById[r]}getMVFFeatureById(r,n){switch(r){case"space":return this.mvfSpacesById[n];case"node":return this.mvfNodesById[n];case"obstruction":return this.mvfObstructionById[n];case"floor":return this.mvfFloorsById[n];case"floor-stack":return this.mvfFloorStacksById[n];case"connection":return this.mvfConnectionsById[n];case"entrance":return this.mvfEntrancesById[n];case"annotation":return this.mvfAnnotationsById[n];case"area":return this.mvfAreasById[n];default:throw new Error("Unknown MVF feature type: ".concat(r))}}getMVFFeatureByNodeId(r,n){switch(r){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getMVFFeatureByType(r){switch(r){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getPropTranslation(r,n,o,i){var c,u;if(!this.currentLanguage)return i;let{code:a}=this.currentLanguage,l=(u=(c=this.languagePacks[a])==null?void 0:c.optimized)==null?void 0:u[r];if(l){let d=l[o];if(d!=null&&d[n]!==void 0)return d[n]}return i}async changeLanguage(r){var l;let n=r.toLowerCase();if(!n){z.error("language code must be defined");return}if(!this.currentLanguage){z.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,i=(l=this.venue)==null?void 0:l.languages.find(({code:c})=>c.toLowerCase()===n.toLowerCase());if(!i){z.warn("language not found");return}if(o===i.code)return;let a=this.languagePacks[i.code];if(!a){let c=this.localePacksUrls[i.code];if(!c){z.error("locale packs url not found for ".concat(i.code));return}p(this,vh)&&p(this,vh).abort();let u=new AbortController;A(this,vh,u);let d;try{d=await IG(c,{signal:u.signal})}catch(h){z.error("failed downloading language pack",h);return}if(!d||u.signal.aborted)return;a=e4(d),this.languagePacks[i.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=i,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let o=Bh(r),i=Bh(n);return Zi([o.longitude,o.latitude],[i.longitude,i.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var o;let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let a of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await Xw(this.localePacksUrls[a.code],{signal:i.signal}),c=await Qf(l);c&&n.push({language:{code:a.code,name:a.name},localePack:c})}}catch(l){z.warn("failed downloading language pack",l)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var o;if(!this.binaryBundle){z.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let a of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[a.code]){let l=await Xw(this.localePacksUrls[a.code],{signal:i.signal});l&&n.push({language:{code:a.code,name:a.name},localePack:l})}}catch(l){z.warn("failed downloading language pack",l)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(p(this,Ae)))p(this,Ae)[r]=null}};Ae=new WeakMap,AI=new WeakSet,GW=s(function(r){var l;let n=(l=r==null?void 0:r.nodes)==null?void 0:l[0],o=this.getById("node",n);if(o==null)return;let i=vs([o.coordinate.longitude,o.coordinate.latitude]),a=this.connectionSpaceIdsByLatLon[i];return a==null?void 0:a.map(c=>this.connectionsById[c]).find(c=>c!=null)},"#getConnectionFromMVFConnection"),vh=new WeakMap,s(R6,"MapDataInternal");var hh=R6;var Sh,ud,Tb,ha,Ih=class Ih extends wi{constructor(r,n){super(n.mvfData.id,r);m(this,"__type",Ih.__type);E(this,Sh);E(this,ud);E(this,Tb);E(this,ha,{});A(this,Sh,n.mvfData),A(this,ud,r),A(this,Tb,n.floorStackId)}static is(r){return r.__type===Ih.__type}get floorStack(){return p(this,ud).getById("floor-stack",p(this,Tb))}get spaces(){if(!p(this,ha).spaces){p(this,ha).spaces=[];for(let r of p(this,Sh).spaces){let n=p(this,ud).getById("space",r.spaceId);n&&p(this,ha).spaces.push(n)}}return p(this,ha).spaces}get center(){if(!p(this,ha).center){let r={type:"FeatureCollection",features:[]};for(let o of this.spaces){let i=p(this,ud).mvfSpacesById[o.id];i&&r.features.push(i)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=Iv(r);p(this,ha).center=new $e(n.geometry.coordinates[1],n.geometry.coordinates[0],p(this,Sh).spaces[0].floorId)}return p(this,ha).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};Sh=new WeakMap,ud=new WeakMap,Tb=new WeakMap,ha=new WeakMap,s(Ih,"Facade"),m(Ih,"__type","facade");var N6=Ih,Ho=N6;export{$e as a,Sa as b,Gr as c,Eh as d,Ho as e,Ss as f,zh as g,G as h,L5 as i,N0e as j,MW as k,OW as l,Txe as m};