@mappedin/react-sdk 6.0.1-beta.46 → 6.0.1-beta.48

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 (37) hide show
  1. package/THIRD_PARTY_LICENSES.txt +9289 -24606
  2. package/lib/esm/GLTFExporter-U7TU265Z.js +1 -0
  3. package/lib/esm/GLTFLoader-6MJPEGD7.js +1 -0
  4. package/lib/esm/browser-CR4WWHP7.js +1 -0
  5. package/lib/esm/chunk-63UMH2J3.js +1 -0
  6. package/lib/esm/chunk-7JZE7FSJ.js +1 -0
  7. package/lib/esm/chunk-B3CVW3UU.js +1 -0
  8. package/lib/esm/chunk-EIMXVMO4.js +1 -0
  9. package/lib/esm/chunk-JMCXCPZD.js +1 -0
  10. package/lib/esm/chunk-Z5U7QCEH.js +1 -0
  11. package/lib/esm/index.css +1 -1
  12. package/lib/esm/index.d.ts +350 -119
  13. package/lib/esm/index.js +1 -1
  14. package/lib/esm/inspector-U6M4QW4R.js +1 -0
  15. package/lib/esm/inspector-WWR77OPX.css +1 -0
  16. package/lib/esm/internal-M7DPGYMI.css +1 -0
  17. package/lib/esm/internal-ZUMRQSCJ.js +1 -0
  18. package/lib/esm/outdoor-context-v4-ME4STCCK.js +1 -0
  19. package/lib/esm/text3d-DNZ77VLG.js +1 -0
  20. package/package.json +6 -6
  21. package/lib/esm/GLTFExporter-HAEOIORD.js +0 -1
  22. package/lib/esm/GLTFLoader-3AR2NA3D.js +0 -1
  23. package/lib/esm/browser-LDR6NMTB.js +0 -1
  24. package/lib/esm/chunk-2OY65JNC.js +0 -1
  25. package/lib/esm/chunk-A4BAKOBA.js +0 -1
  26. package/lib/esm/chunk-GQRZXW47.js +0 -1
  27. package/lib/esm/chunk-HQPJR25Y.js +0 -1
  28. package/lib/esm/chunk-K5IZJL77.js +0 -1
  29. package/lib/esm/chunk-QARZ2ADL.js +0 -1
  30. package/lib/esm/chunk-QZW6TJU7.js +0 -1
  31. package/lib/esm/inspector-6WW7AUZN.js +0 -1
  32. package/lib/esm/inspector-GOK26VAV.css +0 -1
  33. package/lib/esm/internal-65CA5CF2.js +0 -1
  34. package/lib/esm/internal-7A3UJNAV.css +0 -1
  35. package/lib/esm/outdoor-context-v4-NRZ3P73G.js +0 -1
  36. package/lib/esm/roboto-regular-B567NWMQ.js +0 -1
  37. package/lib/esm/text3d-6FT4WNC5.js +0 -1
@@ -1 +0,0 @@
1
- import{$ as Ld,A as O8,B as E8,C as Qh,D as so,E as _8,F as x3,G as Cs,H as A8,I as Dd,J as k8,K as Ps,L as M0,M as yr,N as I3,O as Sn,P as D8,Q as Iu,R as _i,S as wt,T as lt,U as ey,V as S3,W as C3,X as N8,Y as ty,Z as B8,_ as Fd,a as K9,aa as $8,b as J9,ba as Oo,c as Q9,ca as j8,d as j,da as G8,e as m3,ea as P3,f as C0,fa as O0,g as S8,ga as E0,h as kd,ha as U8,i as P0,ia as V8,j as C8,ja as z8,k as T0,ka as _0,l as bu,la as H8,m as Is,ma as W8,n as P8,na as q8,o as T8,oa as Z8,p as b3,pa as Ts,q as _t,qa as T3,r as Fe,ra as X8,s as vu,sa as Y8,t as v3,ta as Su,u as Ss,ua as ry,v as w0,va as Rd,w as _a,wa as A0,x as xu,xa as Nd,y as w8,ya as Bd,z as M8}from"./chunk-K5IZJL77.js";import{a as Vee,ca as R8,k as F8,v as L8}from"./chunk-QARZ2ADL.js";import{a as Wo}from"./chunk-A4BAKOBA.js";import{$ as p8,$a as v8,A as o8,Aa as Oi,Ba as I0,C as i8,Ca as h8,D as Ke,Da as y8,E as _e,Fa as Ei,I as s8,J as a8,K as l8,L as Jh,M as Pe,N as Jr,O as c8,P as wi,Pa as Ad,Q as Ma,R as Oa,S as Lt,Ta as S0,U as $r,Ua as g8,V as Ea,W as u8,X as ze,Y as Mi,Ya as b8,_ as gu,_a as xs,aa as h3,ab as x8,b as y0,c as g0,ca as Xl,cb as I8,d as e8,e as Ta,f as t8,g as gs,ha as d8,ka as Yl,la as f8,ma as v0,na as y3,p as r8,pa as _d,q as n8,r as b0,ua as m8,va as Kl,wa as x0,xa as g3,ya as bs,z as wa,za as vs}from"./chunk-HQPJR25Y.js";import{a as d,b}from"./chunk-GQRZXW47.js";import{a as s,c as W,d as Pa,e as ys,f as h,g as u,h as O,i as A,j as te,k as _}from"./chunk-2OY65JNC.js";var My=W(Mt=>{"use strict";d();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.regexpCode=Mt.getEsmExportName=Mt.getProperty=Mt.safeStringify=Mt.stringify=Mt.strConcat=Mt.addCodeArg=Mt.str=Mt._=Mt.nil=Mt._Code=Mt.Name=Mt.IDENTIFIER=Mt._CodeOrName=void 0;var nC=class nC{};s(nC,"_CodeOrName");var Ty=nC;Mt._CodeOrName=Ty;Mt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var oC=class oC extends Ty{constructor(t){if(super(),!Mt.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(oC,"Name");var $u=oC;Mt.Name=$u;var iC=class iC extends Ty{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 $u&&(r[n.str]=(r[n.str]||0)+1),r),{})}};s(iC,"_Code");var Jo=iC;Mt._Code=Jo;Mt.nil=new Jo("");function g_(e,...t){let r=[e[0]],n=0;for(;n<t.length;)rC(r,t[n]),r.push(e[++n]);return new Jo(r)}s(g_,"_");Mt._=g_;var tC=new Jo("+");function b_(e,...t){let r=[wy(e[0])],n=0;for(;n<t.length;)r.push(tC),rC(r,t[n]),r.push(tC,wy(e[++n]));return hte(r),new Jo(r)}s(b_,"str");Mt.str=b_;function rC(e,t){t instanceof Jo?e.push(...t._items):t instanceof $u?e.push(t):e.push(bte(t))}s(rC,"addCodeArg");Mt.addCodeArg=rC;function hte(e){let t=1;for(;t<e.length-1;){if(e[t]===tC){let r=yte(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}s(hte,"optimize");function yte(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof $u||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 $u))return'"'.concat(e).concat(t.slice(1))}s(yte,"mergeExprItems");var h_;function gte(e,t){return t.emptyStr()?e:e.emptyStr()?t:b_(h_||(h_=_(["","",""])),e,t)}s(gte,"strConcat");Mt.strConcat=gte;function bte(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:wy(Array.isArray(e)?e.join(","):e)}s(bte,"interpolate");function vte(e){return new Jo(wy(e))}s(vte,"stringify");Mt.stringify=vte;function wy(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}s(wy,"safeStringify");Mt.safeStringify=wy;var y_;function xte(e){return typeof e=="string"&&Mt.IDENTIFIER.test(e)?new Jo(".".concat(e)):g_(y_||(y_=_(["[","]"])),e)}s(xte,"getProperty");Mt.getProperty=xte;function Ite(e){if(typeof e=="string"&&Mt.IDENTIFIER.test(e))return new Jo("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}s(Ite,"getEsmExportName");Mt.getEsmExportName=Ite;function Ste(e){return new Jo(e.toString())}s(Ste,"regexpCode");Mt.regexpCode=Ste});var dC=W(po=>{"use strict";d();Object.defineProperty(po,"__esModule",{value:!0});po.ValueScope=po.ValueScopeName=po.Scope=po.varKinds=po.UsedValueState=void 0;var uo=My(),lC=class lC extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};s(lC,"ValueError");var sC=lC,L0;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(L0||(po.UsedValueState=L0={}));po.varKinds={const:new uo.Name("const"),let:new uo.Name("let"),var:new uo.Name("var")};var cC=class cC{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof uo.Name?t:this.name(t)}name(t){return new uo.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(cC,"Scope");var R0=cC;po.Scope=R0;var v_,uC=class uC extends uo.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,uo._)(v_||(v_=_([".","[","]"])),new uo.Name(r),n)}};s(uC,"ValueScopeName");var N0=uC;po.ValueScopeName=N0;var x_,Cte=(0,uo._)(x_||(x_=_(["\n"],["\\n"]))),I_,S_,C_,pC=class pC extends R0{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Cte:uo.nil}}get(){return this._scope}name(t){return new N0(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 f=l.get(a);if(f)return f}else l=this._values[i]=new Map;l.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),p=c.length;return c[p]=r.ref,o.setValue(r,{property:i,itemIndex:p}),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,uo._)(I_||(I_=_(["","",""])),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=uo.nil;for(let a in t){let l=t[a];if(!l)continue;let c=n[a]=n[a]||new Map;l.forEach(p=>{if(c.has(p))return;c.set(p,L0.Started);let f=r(p);if(f){let m=this.opts.es5?po.varKinds.var:po.varKinds.const;i=(0,uo._)(S_||(S_=_(["",""," "," = ",";",""])),i,m,p,f,this.opts._n)}else if(f=o==null?void 0:o(p))i=(0,uo._)(C_||(C_=_(["","","",""])),i,f,this.opts._n);else throw new sC(p);c.set(p,L0.Completed)})}return i}};s(pC,"ValueScope");var aC=pC;po.ValueScope=aC});var Xe=W(Je=>{"use strict";d();Object.defineProperty(Je,"__esModule",{value:!0});Je.or=Je.and=Je.not=Je.CodeGen=Je.operators=Je.varKinds=Je.ValueScopeName=Je.ValueScope=Je.Scope=Je.Name=Je.regexpCode=Je.stringify=Je.getProperty=Je.nil=Je.strConcat=Je.str=Je._=void 0;var ct=My(),Ni=dC(),uc=My();Object.defineProperty(Je,"_",{enumerable:!0,get:s(function(){return uc._},"get")});Object.defineProperty(Je,"str",{enumerable:!0,get:s(function(){return uc.str},"get")});Object.defineProperty(Je,"strConcat",{enumerable:!0,get:s(function(){return uc.strConcat},"get")});Object.defineProperty(Je,"nil",{enumerable:!0,get:s(function(){return uc.nil},"get")});Object.defineProperty(Je,"getProperty",{enumerable:!0,get:s(function(){return uc.getProperty},"get")});Object.defineProperty(Je,"stringify",{enumerable:!0,get:s(function(){return uc.stringify},"get")});Object.defineProperty(Je,"regexpCode",{enumerable:!0,get:s(function(){return uc.regexpCode},"get")});Object.defineProperty(Je,"Name",{enumerable:!0,get:s(function(){return uc.Name},"get")});var G0=dC();Object.defineProperty(Je,"Scope",{enumerable:!0,get:s(function(){return G0.Scope},"get")});Object.defineProperty(Je,"ValueScope",{enumerable:!0,get:s(function(){return G0.ValueScope},"get")});Object.defineProperty(Je,"ValueScopeName",{enumerable:!0,get:s(function(){return G0.ValueScopeName},"get")});Object.defineProperty(Je,"varKinds",{enumerable:!0,get:s(function(){return G0.varKinds},"get")});Je.operators={GT:new ct._Code(">"),GTE:new ct._Code(">="),LT:new ct._Code("<"),LTE:new ct._Code("<="),EQ:new ct._Code("==="),NEQ:new ct._Code("!=="),NOT:new ct._Code("!"),OR:new ct._Code("||"),AND:new ct._Code("&&"),ADD:new ct._Code("+")};var TC=class TC{optimizeNodes(){return this}optimizeNames(t,r){return this}};s(TC,"Node");var Ua=TC,wC=class wC extends Ua{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ni.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=ff(this.rhs,t,r)),this}get names(){return this.rhs instanceof ct._CodeOrName?this.rhs.names:{}}};s(wC,"Def");var fC=wC,MC=class MC extends Ua{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 ct.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ff(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ct.Name?{}:{...this.lhs.names};return j0(t,this.rhs)}};s(MC,"Assign");var B0=MC,OC=class OC extends B0{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(OC,"AssignOp");var mC=OC,EC=class EC extends Ua{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};s(EC,"Label");var hC=EC,_C=class _C extends Ua{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};s(_C,"Break");var yC=_C,AC=class AC extends Ua{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};s(AC,"Throw");var gC=AC,kC=class kC extends Ua{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=ff(this.code,t,r),this}get names(){return this.code instanceof ct._CodeOrName?this.code.names:{}}};s(kC,"AnyCode");var bC=kC,DC=class DC extends Ua{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)||(Pte(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Uu(t,r.names),{})}};s(DC,"ParentNode");var Oy=DC,FC=class FC extends Oy{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};s(FC,"BlockNode");var Va=FC,LC=class LC extends Oy{};s(LC,"Root");var vC=LC,RC=class RC extends Va{};s(RC,"Else");var df=RC;df.kind="else";var pf=class pf extends Va{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 df(n):n}if(r)return t===!1?r instanceof pf?r:r.nodes:this.nodes.length?this:new pf(__(t),r instanceof pf?[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=ff(this.condition,t,r),this}get names(){let t=super.names;return j0(t,this.condition),this.else&&Uu(t,this.else.names),t}};s(pf,"If");var ju=pf;ju.kind="if";var NC=class NC extends Va{};s(NC,"For");var Gu=NC;Gu.kind="for";var BC=class BC extends Gu{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=ff(this.iteration,t,r),this}get names(){return Uu(super.names,this.iteration.names)}};s(BC,"ForLoop");var xC=BC,$C=class $C extends Gu{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ni.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=j0(super.names,this.from);return j0(t,this.to)}};s($C,"ForRange");var IC=$C,jC=class jC extends Gu{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=ff(this.iterable,t,r),this}get names(){return Uu(super.names,this.iterable.names)}};s(jC,"ForIter");var $0=jC,GC=class GC extends Va{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(GC,"Func");var Ey=GC;Ey.kind="func";var UC=class UC extends Oy{render(t){return"return "+super.render(t)}};s(UC,"Return");var _y=UC;_y.kind="return";var VC=class VC extends Va{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&&Uu(t,this.catch.names),this.finally&&Uu(t,this.finally.names),t}};s(VC,"Try");var SC=VC,zC=class zC extends Va{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};s(zC,"Catch");var Ay=zC;Ay.kind="catch";var HC=class HC extends Va{render(t){return"finally"+super.render(t)}};s(HC,"Finally");var ky=HC;ky.kind="finally";var P_,T_,w_,WC=class WC{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?"\n":""},this._extScope=t,this._scope=new Ni.Scope({parent:t}),this._nodes=[new vC]}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 fC(t,i,n)),i}const(t,r,n){return this._def(Ni.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ni.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ni.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new B0(t,r,n))}add(t,r){return this._leafNode(new mC(t,Je.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ct.nil&&this._leafNode(new bC(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,ct.addCodeArg)(r,o));return r.push("}"),new ct._Code(r)}if(t,r,n){if(this._blockNode(new ju(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 ju(t))}else(){return this._elseNode(new df)}endIf(){return this._endBlockNode(ju,df)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new xC(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ni.varKinds.var:Ni.varKinds.let){let a=this._scope.toName(t);return this._for(new IC(i,a,r,n),()=>o(a))}forOf(t,r,n,o=Ni.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let a=r instanceof ct.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ct._)(P_||(P_=_(["",".length"])),a),l=>{this.var(i,(0,ct._)(T_||(T_=_(["","[","]"])),a,l)),n(i)})}return this._for(new $0("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ni.varKinds.var:Ni.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ct._)(w_||(w_=_(["Object.keys(",")"])),r),n);let i=this._scope.toName(t);return this._for(new $0("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Gu)}label(t){return this._leafNode(new hC(t))}break(t){return this._leafNode(new yC(t))}return(t){let r=new _y;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(_y)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new SC;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Ay(i),r(i)}return n&&(this._currNode=o.finally=new ky,this.code(n)),this._endBlockNode(Ay,ky)}throw(t){return this._leafNode(new gC(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=ct.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 ju))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(WC,"CodeGen");var CC=WC;Je.CodeGen=CC;function Uu(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}s(Uu,"addNames");function j0(e,t){return t instanceof ct._CodeOrName?Uu(e,t.names):e}s(j0,"addExprNames");function ff(e,t,r){if(e instanceof ct.Name)return n(e);if(!o(e))return e;return new ct._Code(e._items.reduce((i,a)=>(a instanceof ct.Name&&(a=n(a)),a instanceof ct._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 ct._Code&&i._items.some(a=>a instanceof ct.Name&&t[a.str]===1&&r[a.str]!==void 0)}}s(ff,"optimizeExpr");function Pte(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}s(Pte,"subtractNames");var M_;function __(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ct._)(M_||(M_=_(["!",""])),PC(e))}s(__,"not");Je.not=__;var Tte=A_(Je.operators.AND);function wte(...e){return e.reduce(Tte)}s(wte,"and");Je.and=wte;var Mte=A_(Je.operators.OR);function Ote(...e){return e.reduce(Mte)}s(Ote,"or");Je.or=Ote;var O_;function A_(e){return(t,r)=>t===ct.nil?r:r===ct.nil?t:(0,ct._)(O_||(O_=_([""," "," ",""])),PC(t),e,PC(r))}s(A_,"mappend");var E_;function PC(e){return e instanceof ct.Name?e:(0,ct._)(E_||(E_=_(["(",")"])),e)}s(PC,"par")});var Ot=W(et=>{"use strict";d();Object.defineProperty(et,"__esModule",{value:!0});et.checkStrictMode=et.getErrorPath=et.Type=et.useFunc=et.setEvaluated=et.evaluatedPropsToName=et.mergeEvaluated=et.eachItem=et.unescapeJsonPointer=et.escapeJsonPointer=et.escapeFragment=et.unescapeFragment=et.schemaRefOrVal=et.schemaHasRulesButRef=et.schemaHasRules=et.checkUnknownRules=et.alwaysValidSchema=et.toHash=void 0;var qt=Xe(),Ete=My();function _te(e){let t={};for(let r of e)t[r]=!0;return t}s(_te,"toHash");et.toHash=_te;function Ate(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(J_(e,t),!Q_(t,e.self.RULES.all))}s(Ate,"alwaysValidSchema");et.alwaysValidSchema=Ate;function J_(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]||rA(e,'unknown keyword: "'.concat(i,'"'))}s(J_,"checkUnknownRules");et.checkUnknownRules=J_;function Q_(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}s(Q_,"schemaHasRules");et.schemaHasRules=Q_;function kte(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}s(kte,"schemaHasRulesButRef");et.schemaHasRulesButRef=kte;var F_,L_;function Dte({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._)(F_||(F_=_(["",""])),r)}return(0,qt._)(L_||(L_=_(["","","",""])),e,t,(0,qt.getProperty)(n))}s(Dte,"schemaRefOrVal");et.schemaRefOrVal=Dte;function Fte(e){return eA(decodeURIComponent(e))}s(Fte,"unescapeFragment");et.unescapeFragment=Fte;function Lte(e){return encodeURIComponent(ZC(e))}s(Lte,"escapeFragment");et.escapeFragment=Lte;function ZC(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}s(ZC,"escapeJsonPointer");et.escapeJsonPointer=ZC;function eA(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}s(eA,"unescapeJsonPointer");et.unescapeJsonPointer=eA;function Rte(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}s(Rte,"eachItem");et.eachItem=Rte;function k_({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(k_,"makeMergeEvaluated");var R_,N_,B_,$_,j_,G_,U_,V_,z_,H_;et.mergeEvaluated={props:k_({mergeNames:s((e,t,r)=>e.if((0,qt._)(R_||(R_=_([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,qt._)(N_||(N_=_([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,qt._)(B_||(B_=_([""," || {}"])),r)).code((0,qt._)($_||($_=_(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:s((e,t,r)=>e.if((0,qt._)(j_||(j_=_([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,qt._)(G_||(G_=_([""," || {}"])),r)),XC(e,r,t))}),"mergeToName"),mergeValues:s((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:tA}),items:k_({mergeNames:s((e,t,r)=>e.if((0,qt._)(U_||(U_=_([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,qt._)(V_||(V_=_([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:s((e,t,r)=>e.if((0,qt._)(z_||(z_=_([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,qt._)(H_||(H_=_([""," > "," ? "," : ",""])),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 W_;function tA(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,qt._)(W_||(W_=_(["{}"]))));return t!==void 0&&XC(e,r,t),r}s(tA,"evaluatedPropsToName");et.evaluatedPropsToName=tA;var q_;function XC(e,t,r){Object.keys(r).forEach(n=>e.assign((0,qt._)(q_||(q_=_(["","",""])),t,(0,qt.getProperty)(n)),!0))}s(XC,"setEvaluated");et.setEvaluated=XC;var D_={};function Nte(e,t){return e.scopeValue("func",{ref:t,code:D_[t.code]||(D_[t.code]=new Ete._Code(t.code))})}s(Nte,"useFunc");et.useFunc=Nte;var qC;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(qC||(et.Type=qC={}));var Z_,X_,Y_,K_;function Bte(e,t,r){if(e instanceof qt.Name){let n=t===qC.Num;return r?n?(0,qt._)(Z_||(Z_=_(['"[" + ',' + "]"'])),e):(0,qt._)(X_||(X_=_(['"[\'" + ',' + "\']"'])),e):n?(0,qt._)(Y_||(Y_=_(['"/" + ',""])),e):(0,qt._)(K_||(K_=_(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,qt.getProperty)(e).toString():"/"+ZC(e)}s(Bte,"getErrorPath");et.getErrorPath=Bte;function rA(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(rA,"checkStrictMode");et.checkStrictMode=rA});var za=W(YC=>{"use strict";d();Object.defineProperty(YC,"__esModule",{value:!0});var Cn=Xe(),$te={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")};YC.default=$te});var Dy=W(Pn=>{"use strict";d();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.extendErrors=Pn.resetErrorsCount=Pn.reportExtraError=Pn.reportError=Pn.keyword$DataError=Pn.keywordError=void 0;var gt=Xe(),U0=Ot(),zn=za(),nA;Pn.keywordError={message:s(({keyword:e})=>(0,gt.str)(nA||(nA=_(['must pass "','" keyword validation'])),e),"message")};var oA,iA;Pn.keyword$DataError={message:s(({keyword:e,schemaType:t})=>t?(0,gt.str)(oA||(oA=_(['"','" keyword must be '," ($data)"])),e,t):(0,gt.str)(iA||(iA=_(['"','" keyword is invalid ($data)'])),e),"message")};var sA;function jte(e,t=Pn.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:a,allErrors:l}=o,c=_A(e,t,r);(n!=null?n:a||l)?OA(i,c):EA(o,(0,gt._)(sA||(sA=_(["[","]"])),c))}s(jte,"reportError");Pn.reportError=jte;function Gte(e,t=Pn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:a}=n,l=_A(e,t,r);OA(o,l),i||a||EA(n,zn.default.vErrors)}s(Gte,"reportExtraError");Pn.reportExtraError=Gte;var aA,lA;function Ute(e,t){e.assign(zn.default.errors,t),e.if((0,gt._)(aA||(aA=_([""," !== null"])),zn.default.vErrors),()=>e.if(t,()=>e.assign((0,gt._)(lA||(lA=_(["",".length"])),zn.default.vErrors),t),()=>e.assign(zn.default.vErrors,null)))}s(Ute,"resetErrorsCount");Pn.resetErrorsCount=Ute;var cA,uA,pA,dA,fA,mA,hA;function Vte({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,zn.default.errors,l=>{e.const(a,(0,gt._)(cA||(cA=_(["","[","]"])),zn.default.vErrors,l)),e.if((0,gt._)(uA||(uA=_(["",".instancePath === undefined"])),a),()=>e.assign((0,gt._)(pA||(pA=_(["",".instancePath"])),a),(0,gt.strConcat)(zn.default.instancePath,i.errorPath))),e.assign((0,gt._)(dA||(dA=_(["",".schemaPath"])),a),(0,gt.str)(fA||(fA=_(["","/",""])),i.errSchemaPath,t)),i.opts.verbose&&(e.assign((0,gt._)(mA||(mA=_(["",".schema"])),a),r),e.assign((0,gt._)(hA||(hA=_(["",".data"])),a),n))})}s(Vte,"extendErrors");Pn.extendErrors=Vte;var yA,gA,bA,vA;function OA(e,t){let r=e.const("err",t);e.if((0,gt._)(yA||(yA=_([""," === null"])),zn.default.vErrors),()=>e.assign(zn.default.vErrors,(0,gt._)(gA||(gA=_(["[","]"])),r)),(0,gt._)(bA||(bA=_(["",".push(",")"])),zn.default.vErrors,r)),e.code((0,gt._)(vA||(vA=_(["","++"])),zn.default.errors))}s(OA,"addError");var xA,IA;function EA(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,gt._)(xA||(xA=_(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,gt._)(IA||(IA=_(["",".errors"])),n),t),r.return(!1))}s(EA,"returnErrors");var Vu={keyword:new gt.Name("keyword"),schemaPath:new gt.Name("schemaPath"),params:new gt.Name("params"),propertyName:new gt.Name("propertyName"),message:new gt.Name("message"),schema:new gt.Name("schema"),parentSchema:new gt.Name("parentSchema")},SA;function _A(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,gt._)(SA||(SA=_(["{}"]))):zte(e,t,r)}s(_A,"errorObjectCode");function zte(e,t,r={}){let{gen:n,it:o}=e,i=[Hte(o,r),Wte(e,r)];return qte(e,t,i),n.object(...i)}s(zte,"errorObject");var CA;function Hte({errorPath:e},{instancePath:t}){let r=t?(0,gt.str)(CA||(CA=_(["","",""])),e,(0,U0.getErrorPath)(t,U0.Type.Str)):e;return[zn.default.instancePath,(0,gt.strConcat)(zn.default.instancePath,r)]}s(Hte,"errorInstancePath");var PA,TA;function Wte({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,gt.str)(PA||(PA=_(["","/",""])),t,e);return r&&(o=(0,gt.str)(TA||(TA=_(["","",""])),o,(0,U0.getErrorPath)(r,U0.Type.Str))),[Vu.schemaPath,o]}s(Wte,"errorSchemaPath");var wA,MA;function qte(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:a,it:l}=e,{opts:c,propertyName:p,topSchemaRef:f,schemaPath:m}=l;n.push([Vu.keyword,o],[Vu.params,typeof t=="function"?t(e):t||(0,gt._)(wA||(wA=_(["{}"])))]),c.messages&&n.push([Vu.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Vu.schema,a],[Vu.parentSchema,(0,gt._)(MA||(MA=_(["","",""])),f,m)],[zn.default.data,i]),p&&n.push([Vu.propertyName,p])}s(qte,"extraErrorProps")});var DA=W(mf=>{"use strict";d();Object.defineProperty(mf,"__esModule",{value:!0});mf.boolOrEmptySchema=mf.topBoolOrEmptySchema=void 0;var Zte=Dy(),Xte=Xe(),Yte=za(),Kte={message:"boolean schema is false"},AA;function Jte(e){let{gen:t,schema:r,validateName:n}=e;r===!1?kA(e,!1):typeof r=="object"&&r.$async===!0?t.return(Yte.default.data):(t.assign((0,Xte._)(AA||(AA=_(["",".errors"])),n),null),t.return(!0))}s(Jte,"topBoolOrEmptySchema");mf.topBoolOrEmptySchema=Jte;function Qte(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),kA(e)):r.var(t,!0)}s(Qte,"boolOrEmptySchema");mf.boolOrEmptySchema=Qte;function kA(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,Zte.reportError)(o,Kte,void 0,t)}s(kA,"falseSchemaError")});var KC=W(hf=>{"use strict";d();Object.defineProperty(hf,"__esModule",{value:!0});hf.getRules=hf.isJSONType=void 0;var ere=["string","number","integer","boolean","null","object","array"],tre=new Set(ere);function rre(e){return typeof e=="string"&&tre.has(e)}s(rre,"isJSONType");hf.isJSONType=rre;function nre(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}s(nre,"getRules");hf.getRules=nre});var JC=W(pc=>{"use strict";d();Object.defineProperty(pc,"__esModule",{value:!0});pc.shouldUseRule=pc.shouldUseGroup=pc.schemaHasRulesForType=void 0;function ore({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&FA(e,n)}s(ore,"schemaHasRulesForType");pc.schemaHasRulesForType=ore;function FA(e,t){return t.rules.some(r=>LA(e,r))}s(FA,"shouldUseGroup");pc.shouldUseGroup=FA;function LA(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(LA,"shouldUseRule");pc.shouldUseRule=LA});var Fy=W(Tn=>{"use strict";d();Object.defineProperty(Tn,"__esModule",{value:!0});Tn.reportTypeError=Tn.checkDataTypes=Tn.checkDataType=Tn.coerceAndCheckDataType=Tn.getJSONTypes=Tn.getSchemaTypes=Tn.DataType=void 0;var ire=KC(),sre=JC(),are=Dy(),Ze=Xe(),hk=Ot(),yf;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(yf||(Tn.DataType=yf={}));function lre(e){let t=yk(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(lre,"getSchemaTypes");Tn.getSchemaTypes=lre;function yk(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(ire.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}s(yk,"getJSONTypes");Tn.getJSONTypes=yk;function cre(e,t){let{gen:r,data:n,opts:o}=e,i=ure(t,o.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,sre.schemaHasRulesForType)(e,t[0]));if(a){let l=eP(t,n,o.strictNumbers,yf.Wrong);r.if(l,()=>{i.length?pre(e,t,i):tP(e)})}return a}s(cre,"coerceAndCheckDataType");Tn.coerceAndCheckDataType=cre;var gk=new Set(["string","number","integer","boolean","null"]);function ure(e,t){return t?e.filter(r=>gk.has(r)||t==="array"&&r==="array"):[]}s(ure,"coerceToTypes");var RA,NA,BA,$A,jA,GA,UA,VA,zA,HA,WA,qA,ZA,XA,YA,KA,JA,QA,ek,tk;function pre(e,t,r){let{gen:n,data:o,opts:i}=e,a=n.let("dataType",(0,Ze._)(RA||(RA=_(["typeof ",""])),o)),l=n.let("coerced",(0,Ze._)(NA||(NA=_(["undefined"]))));i.coerceTypes==="array"&&n.if((0,Ze._)(BA||(BA=_([""," == 'object' && Array.isArray(",") && ",".length == 1"])),a,o,o),()=>n.assign(o,(0,Ze._)($A||($A=_(["","[0]"])),o)).assign(a,(0,Ze._)(jA||(jA=_(["typeof ",""])),o)).if(eP(t,o,i.strictNumbers),()=>n.assign(l,o))),n.if((0,Ze._)(GA||(GA=_([""," !== undefined"])),l));for(let p of r)(gk.has(p)||p==="array"&&i.coerceTypes==="array")&&c(p);n.else(),tP(e),n.endIf(),n.if((0,Ze._)(UA||(UA=_([""," !== undefined"])),l),()=>{n.assign(o,l),dre(e,l)});function c(p){switch(p){case"string":n.elseIf((0,Ze._)(VA||(VA=_(["",' == "number" || ',' == "boolean"'])),a,a)).assign(l,(0,Ze._)(zA||(zA=_(['"" + ',""])),o)).elseIf((0,Ze._)(HA||(HA=_([""," === null"])),o)).assign(l,(0,Ze._)(WA||(WA=_(['""']))));return;case"number":n.elseIf((0,Ze._)(qA||(qA=_(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),a,o,a,o,o,o)).assign(l,(0,Ze._)(ZA||(ZA=_(["+",""])),o));return;case"integer":n.elseIf((0,Ze._)(XA||(XA=_(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),a,o,a,o,o,o,o)).assign(l,(0,Ze._)(YA||(YA=_(["+",""])),o));return;case"boolean":n.elseIf((0,Ze._)(KA||(KA=_(["",' === "false" || '," === 0 || "," === null"])),o,o,o)).assign(l,!1).elseIf((0,Ze._)(JA||(JA=_(["",' === "true" || '," === 1"])),o,o)).assign(l,!0);return;case"null":n.elseIf((0,Ze._)(QA||(QA=_(["",' === "" || '," === 0 || "," === false"])),o,o,o)),n.assign(l,null);return;case"array":n.elseIf((0,Ze._)(ek||(ek=_(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),a,a,a,o)).assign(l,(0,Ze._)(tk||(tk=_(["[","]"])),o))}}s(c,"coerceSpecificType")}s(pre,"coerceData");var rk,nk;function dre({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ze._)(rk||(rk=_([""," !== undefined"])),t),()=>e.assign((0,Ze._)(nk||(nk=_(["","[","]"])),t,r),n))}s(dre,"assignParentData");var ok,ik,sk,ak,lk,ck,uk;function QC(e,t,r,n=yf.Correct){let o=n===yf.Correct?Ze.operators.EQ:Ze.operators.NEQ,i;switch(e){case"null":return(0,Ze._)(ok||(ok=_([""," "," null"])),t,o);case"array":i=(0,Ze._)(ik||(ik=_(["Array.isArray(",")"])),t);break;case"object":i=(0,Ze._)(sk||(sk=_([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":i=a((0,Ze._)(ak||(ak=_(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":i=a();break;default:return(0,Ze._)(lk||(lk=_(["typeof "," "," ",""])),t,o,e)}return n===yf.Correct?i:(0,Ze.not)(i);function a(l=Ze.nil){return(0,Ze.and)((0,Ze._)(ck||(ck=_(["typeof ",' == "number"'])),t),l,r?(0,Ze._)(uk||(uk=_(["isFinite(",")"])),t):Ze.nil)}}s(QC,"checkDataType");Tn.checkDataType=QC;var pk,dk;function eP(e,t,r,n){if(e.length===1)return QC(e[0],t,r,n);let o,i=(0,hk.toHash)(e);if(i.array&&i.object){let a=(0,Ze._)(pk||(pk=_(["typeof ",' != "object"'])),t);o=i.null?a:(0,Ze._)(dk||(dk=_(["!"," || ",""])),t,a),delete i.null,delete i.array,delete i.object}else o=Ze.nil;i.number&&delete i.integer;for(let a in i)o=(0,Ze.and)(o,QC(a,t,r,n));return o}s(eP,"checkDataTypes");Tn.checkDataTypes=eP;var fk,mk,fre={message:s(({schema:e})=>"must be ".concat(e),"message"),params:s(({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ze._)(fk||(fk=_(["{type: ","}"])),e):(0,Ze._)(mk||(mk=_(["{type: ","}"])),t),"params")};function tP(e){let t=mre(e);(0,are.reportError)(t,fre)}s(tP,"reportTypeError");Tn.reportTypeError=tP;function mre(e){let{gen:t,data:r,schema:n}=e,o=(0,hk.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}s(mre,"getTypeErrorContext")});var Ck=W(V0=>{"use strict";d();Object.defineProperty(V0,"__esModule",{value:!0});V0.assignDefaults=void 0;var gf=Xe(),hre=Ot();function yre(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)bk(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>bk(e,i,o.default))}s(yre,"assignDefaults");V0.assignDefaults=yre;var vk,xk,Ik,Sk;function bk(e,t,r){let{gen:n,compositeRule:o,data:i,opts:a}=e;if(r===void 0)return;let l=(0,gf._)(vk||(vk=_(["","",""])),i,(0,gf.getProperty)(t));if(o){(0,hre.checkStrictMode)(e,"default is ignored for: ".concat(l));return}let c=(0,gf._)(xk||(xk=_([""," === undefined"])),l);a.useDefaults==="empty"&&(c=(0,gf._)(Ik||(Ik=_([""," || "," === null || ",' === ""'])),c,l,l)),n.if(c,(0,gf._)(Sk||(Sk=_([""," = ",""])),l,(0,gf.stringify)(r)))}s(bk,"assignDefault")});var Qo=W(Ut=>{"use strict";d();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=Xe(),rP=Ot(),dc=za(),gre=Ot(),Pk;function bre(e,t){let{gen:r,data:n,it:o}=e;r.if(oP(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,tr._)(Pk||(Pk=_(["",""])),t)},!0),e.error()})}s(bre,"checkReportMissingProp");Ut.checkReportMissingProp=bre;var Tk;function vre({gen:e,data:t,it:{opts:r}},n,o){return(0,tr.or)(...n.map(i=>(0,tr.and)(oP(e,t,i,r.ownProperties),(0,tr._)(Tk||(Tk=_([""," = ",""])),o,i))))}s(vre,"checkMissingProp");Ut.checkMissingProp=vre;function xre(e,t){e.setParams({missingProperty:t},!0),e.error()}s(xre,"reportMissingProp");Ut.reportMissingProp=xre;var wk;function $k(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,tr._)(wk||(wk=_(["Object.prototype.hasOwnProperty"])))})}s($k,"hasPropFunc");Ut.hasPropFunc=$k;var Mk;function nP(e,t,r){return(0,tr._)(Mk||(Mk=_(["",".call(",", ",")"])),$k(e),t,r)}s(nP,"isOwnProperty");Ut.isOwnProperty=nP;var Ok,Ek;function Ire(e,t,r,n){let o=(0,tr._)(Ok||(Ok=_(["",""," !== undefined"])),t,(0,tr.getProperty)(r));return n?(0,tr._)(Ek||(Ek=_([""," && ",""])),o,nP(e,t,r)):o}s(Ire,"propertyInData");Ut.propertyInData=Ire;var _k;function oP(e,t,r,n){let o=(0,tr._)(_k||(_k=_(["",""," === undefined"])),t,(0,tr.getProperty)(r));return n?(0,tr.or)(o,(0,tr.not)(nP(e,t,r))):o}s(oP,"noPropertyInData");Ut.noPropertyInData=oP;function jk(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}s(jk,"allSchemaProperties");Ut.allSchemaProperties=jk;function Sre(e,t){return jk(t).filter(r=>!(0,rP.alwaysValidSchema)(e,t[r]))}s(Sre,"schemaProperties");Ut.schemaProperties=Sre;var Ak,kk,Dk,Fk;function Cre({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},l,c,p){let f=p?(0,tr._)(Ak||(Ak=_(["",", ",", ","",""])),e,t,n,o):t,m=[[dc.default.instancePath,(0,tr.strConcat)(dc.default.instancePath,i)],[dc.default.parentData,a.parentData],[dc.default.parentDataProperty,a.parentDataProperty],[dc.default.rootData,dc.default.rootData]];a.opts.dynamicRef&&m.push([dc.default.dynamicAnchors,dc.default.dynamicAnchors]);let y=(0,tr._)(kk||(kk=_(["",", ",""])),f,r.object(...m));return c!==tr.nil?(0,tr._)(Dk||(Dk=_(["",".call(",", ",")"])),l,c,y):(0,tr._)(Fk||(Fk=_(["","(",")"])),l,y)}s(Cre,"callValidateCode");Ut.callValidateCode=Cre;var Lk,Pre=(0,tr._)(Lk||(Lk=_(["new RegExp"]))),Rk;function Tre({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._)(Rk||(Rk=_(["","(",", ",")"])),o.code==="new RegExp"?Pre:(0,gre.useFunc)(e,o),r,n)})}s(Tre,"usePattern");Ut.usePattern=Tre;var Nk;function wre(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._)(Nk||(Nk=_(["",".length"])),r));t.forRange("i",0,c,p=>{e.subschema({keyword:n,dataProp:p,dataPropType:rP.Type.Num},i),t.if((0,tr.not)(i),l)})}s(a,"validateItems")}s(wre,"validateArray");Ut.validateArray=wre;var Bk;function Mre(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,rP.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((c,p)=>{let f=e.subschema({keyword:n,schemaProp:p,compositeRule:!0},l);t.assign(a,(0,tr._)(Bk||(Bk=_([""," || ",""])),a,l)),e.mergeValidEvaluated(f,l)||t.if((0,tr.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}s(Mre,"validateUnion");Ut.validateUnion=Mre});var Qk=W(Ds=>{"use strict";d();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.validateKeywordUsage=Ds.validSchemaType=Ds.funcKeywordCode=Ds.macroKeywordCode=void 0;var Hn=Xe(),zu=za(),Ore=Qo(),Ere=Dy();function _re(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=e,l=t.macro.call(a.self,o,i,a),c=Jk(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let p=r.name("valid");e.subschema({schema:l,schemaPath:Hn.nil,errSchemaPath:"".concat(a.errSchemaPath,"/").concat(n),topSchemaRef:c,compositeRule:!0},p),e.pass(p,()=>e.error(!0))}s(_re,"macroKeywordCode");Ds.macroKeywordCode=_re;var Uk,Vk,zk,Hk,Wk,qk;function Are(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:l,it:c}=e;Dre(c,t);let p=!l&&t.compile?t.compile.call(c.self,i,a,c):t.validate,f=Jk(n,o,p),m=n.let("valid");e.block$data(m,y),e.ok((r=t.valid)!==null&&r!==void 0?r:m);function y(){if(t.errors===!1)S(),t.modifying&&Gk(e),I(()=>e.error());else{let P=t.async?v():x();t.modifying&&Gk(e),I(()=>kre(e,P))}}s(y,"validateKeyword");function v(){let P=n.let("ruleErrs",null);return n.try(()=>S((0,Hn._)(Uk||(Uk=_(["await "])))),T=>n.assign(m,!1).if((0,Hn._)(Vk||(Vk=_([""," instanceof ",""])),T,c.ValidationError),()=>n.assign(P,(0,Hn._)(zk||(zk=_(["",".errors"])),T)),()=>n.throw(T))),P}s(v,"validateAsync");function x(){let P=(0,Hn._)(Hk||(Hk=_(["",".errors"])),f);return n.assign(P,null),S(Hn.nil),P}s(x,"validateSync");function S(P=t.async?(0,Hn._)(Wk||(Wk=_(["await "]))):Hn.nil){let T=c.opts.passContext?zu.default.this:zu.default.self,M=!("compile"in t&&!l||t.schema===!1);n.assign(m,(0,Hn._)(qk||(qk=_(["","",""])),P,(0,Ore.callValidateCode)(e,f,T,M)),t.modifying)}s(S,"assignValid");function I(P){var T;n.if((0,Hn.not)((T=t.valid)!==null&&T!==void 0?T:m),P)}s(I,"reportErrs")}s(Are,"funcKeywordCode");Ds.funcKeywordCode=Are;var Zk;function Gk(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Hn._)(Zk||(Zk=_(["","[","]"])),n.parentData,n.parentDataProperty)))}s(Gk,"modifyData");var Xk,Yk,Kk;function kre(e,t){let{gen:r}=e;r.if((0,Hn._)(Xk||(Xk=_(["Array.isArray(",")"])),t),()=>{r.assign(zu.default.vErrors,(0,Hn._)(Yk||(Yk=_([""," === null ? "," : ",".concat(",")"])),zu.default.vErrors,t,zu.default.vErrors,t)).assign(zu.default.errors,(0,Hn._)(Kk||(Kk=_(["",".length"])),zu.default.vErrors)),(0,Ere.extendErrors)(e)},()=>e.error())}s(kre,"addErrs");function Dre({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}s(Dre,"checkAsyncKeyword");function Jk(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,Hn.stringify)(r)})}s(Jk,"useKeyword");function Fre(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(Fre,"validSchemaType");Ds.validSchemaType=Fre;function Lre({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(Lre,"validateKeywordUsage");Ds.validateKeywordUsage=Lre});var sD=W(fc=>{"use strict";d();Object.defineProperty(fc,"__esModule",{value:!0});fc.extendSubschemaMode=fc.extendSubschemaData=fc.getSubschema=void 0;var Fs=Xe(),iD=Ot(),eD,tD;function Rre(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,Fs._)(eD||(eD=_(["","",""])),e.schemaPath,(0,Fs.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:l[r],schemaPath:(0,Fs._)(tD||(tD=_(["","","",""])),e.schemaPath,(0,Fs.getProperty)(t),(0,Fs.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,iD.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(Rre,"getSubschema");fc.getSubschema=Rre;var rD,nD,oD;function Nre(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:p,dataPathArr:f,opts:m}=t,y=l.let("data",(0,Fs._)(rD||(rD=_(["","",""])),t.data,(0,Fs.getProperty)(r)),!0);c(y),e.errorPath=(0,Fs.str)(nD||(nD=_(["","",""])),p,(0,iD.getErrorPath)(r,n,m.jsPropertySyntax)),e.parentDataProperty=(0,Fs._)(oD||(oD=_(["",""])),r),e.dataPathArr=[...f,e.parentDataProperty]}if(o!==void 0){let p=o instanceof Fs.Name?o:l.let("data",o,!0);c(p),a!==void 0&&(e.propertyName=a)}i&&(e.dataTypes=i);function c(p){e.data=p,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,p]}s(c,"dataContextProps")}s(Nre,"extendSubschemaData");fc.extendSubschemaData=Nre;function Bre(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(Bre,"extendSubschemaMode");fc.extendSubschemaMode=Bre});var iP=W((MEe,aD)=>{"use strict";d();aD.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 cD=W((_Ee,lD)=>{"use strict";d();var mc=lD.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(){};z0(t,n,o,e,"",e)};mc.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mc.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mc.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mc.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 z0(e,t,r,n,o,i,a,l,c,p){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,a,l,c,p);for(var f in n){var m=n[f];if(Array.isArray(m)){if(f in mc.arrayKeywords)for(var y=0;y<m.length;y++)z0(e,t,r,m[y],o+"/"+f+"/"+y,i,o,f,n,y)}else if(f in mc.propsKeywords){if(m&&typeof m=="object")for(var v in m)z0(e,t,r,m[v],o+"/"+f+"/"+$re(v),i,o,f,n,v)}else(f in mc.keywords||e.allKeys&&!(f in mc.skipKeywords))&&z0(e,t,r,m,o+"/"+f,i,o,f,n)}r(n,o,i,a,l,c,p)}}s(z0,"_traverse");function $re(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s($re,"escapeJsonPtr")});var Ly=W(fo=>{"use strict";d();Object.defineProperty(fo,"__esModule",{value:!0});fo.getSchemaRefs=fo.resolveUrl=fo.normalizeId=fo._getFullPath=fo.getFullPath=fo.inlineRef=void 0;var jre=Ot(),Gre=iP(),Ure=cD(),Vre=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function zre(e,t=!0){return typeof e=="boolean"?!0:t===!0?!sP(e):t?uD(e)<=t:!1}s(zre,"inlineRef");fo.inlineRef=zre;var Hre=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function sP(e){for(let t in e){if(Hre.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(sP)||typeof r=="object"&&sP(r))return!0}return!1}s(sP,"hasRef");function uD(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Vre.has(r)&&(typeof e[r]=="object"&&(0,jre.eachItem)(e[r],n=>t+=uD(n)),t===1/0))return 1/0}return t}s(uD,"countKeys");function pD(e,t="",r){r!==!1&&(t=bf(t));let n=e.parse(t);return dD(e,n)}s(pD,"getFullPath");fo.getFullPath=pD;function dD(e,t){return e.serialize(t).split("#")[0]+"#"}s(dD,"_getFullPath");fo._getFullPath=dD;var Wre=/#\/?$/;function bf(e){return e?e.replace(Wre,""):""}s(bf,"normalizeId");fo.normalizeId=bf;function qre(e,t,r){return r=bf(r),e.resolve(t,r)}s(qre,"resolveUrl");fo.resolveUrl=qre;var Zre=/^[a-z_][-a-z0-9._]*$/i;function Xre(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=bf(e[r]||t),i={"":o},a=pD(n,o,!1),l={},c=new Set;return Ure(e,{allKeys:!0},(m,y,v,x)=>{if(x===void 0)return;let S=a+y,I=i[x];typeof m[r]=="string"&&(I=P.call(this,m[r])),T.call(this,m.$anchor),T.call(this,m.$dynamicAnchor),i[y]=I;function P(M){let w=this.opts.uriResolver.resolve;if(M=bf(I?w(I,M):M),c.has(M))throw f(M);c.add(M);let E=this.refs[M];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?p(m,E.schema,M):M!==bf(S)&&(M[0]==="#"?(p(m,l[M],M),l[M]=m):this.refs[M]=S),M}s(P,"addRef");function T(M){if(typeof M=="string"){if(!Zre.test(M))throw new Error('invalid anchor "'.concat(M,'"'));P.call(this,"#".concat(M))}}s(T,"addAnchor")}),l;function p(m,y,v){if(y!==void 0&&!Gre(m,y))throw f(v)}s(p,"checkAmbiguosRef");function f(m){return new Error('reference "'.concat(m,'" resolves to more than one schema'))}s(f,"ambiguos")}s(Xre,"getSchemaRefs");fo.getSchemaRefs=Xre});var By=W(hc=>{"use strict";d();Object.defineProperty(hc,"__esModule",{value:!0});hc.getData=hc.KeywordCxt=hc.validateFunctionCode=void 0;var rF=DA(),fD=Fy(),lP=JC(),H0=Fy(),Yre=Ck(),Ny=Qk(),aP=sD(),we=Xe(),Ge=za(),Kre=Ly(),Ha=Ot(),Ry=Dy();function Jre(e){if(iF(e)&&(sF(e),oF(e))){tne(e);return}nF(e,()=>(0,rF.topBoolOrEmptySchema)(e))}s(Jre,"validateFunctionCode");hc.validateFunctionCode=Jre;var gD,bD,vD;function nF({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,we._)(gD||(gD=_(["",", ",""])),Ge.default.data,Ge.default.valCxt),n.$async,()=>{e.code((0,we._)(bD||(bD=_(['"use strict"; ',""])),mD(r,o))),ene(e,o),e.code(i)}):e.func(t,(0,we._)(vD||(vD=_(["",", ",""])),Ge.default.data,Qre(o)),n.$async,()=>e.code(mD(r,o)).code(i))}s(nF,"validateFunction");var xD,ID;function Qre(e){return(0,we._)(ID||(ID=_(["{",'="", ',", ",", ","=","","}={}"])),Ge.default.instancePath,Ge.default.parentData,Ge.default.parentDataProperty,Ge.default.rootData,Ge.default.data,e.dynamicRef?(0,we._)(xD||(xD=_([", ","={}"])),Ge.default.dynamicAnchors):we.nil)}s(Qre,"destructureValCxt");var SD,CD,PD,TD,wD,MD,OD,ED,_D;function ene(e,t){e.if(Ge.default.valCxt,()=>{e.var(Ge.default.instancePath,(0,we._)(SD||(SD=_(["",".",""])),Ge.default.valCxt,Ge.default.instancePath)),e.var(Ge.default.parentData,(0,we._)(CD||(CD=_(["",".",""])),Ge.default.valCxt,Ge.default.parentData)),e.var(Ge.default.parentDataProperty,(0,we._)(PD||(PD=_(["",".",""])),Ge.default.valCxt,Ge.default.parentDataProperty)),e.var(Ge.default.rootData,(0,we._)(TD||(TD=_(["",".",""])),Ge.default.valCxt,Ge.default.rootData)),t.dynamicRef&&e.var(Ge.default.dynamicAnchors,(0,we._)(wD||(wD=_(["",".",""])),Ge.default.valCxt,Ge.default.dynamicAnchors))},()=>{e.var(Ge.default.instancePath,(0,we._)(MD||(MD=_(['""'])))),e.var(Ge.default.parentData,(0,we._)(OD||(OD=_(["undefined"])))),e.var(Ge.default.parentDataProperty,(0,we._)(ED||(ED=_(["undefined"])))),e.var(Ge.default.rootData,Ge.default.data),t.dynamicRef&&e.var(Ge.default.dynamicAnchors,(0,we._)(_D||(_D=_(["{}"]))))})}s(ene,"destructureValCxtES5");function tne(e){let{schema:t,opts:r,gen:n}=e;nF(e,()=>{r.$comment&&t.$comment&&lF(e),sne(e),n.let(Ge.default.vErrors,null),n.let(Ge.default.errors,0),r.unevaluated&&rne(e),aF(e),cne(e)})}s(tne,"topSchemaObjCode");var AD,kD,DD,FD,LD,RD,ND;function rne(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,we._)(AD||(AD=_(["",".evaluated"])),r)),t.if((0,we._)(kD||(kD=_(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,we._)(DD||(DD=_(["",".props"])),e.evaluated),(0,we._)(FD||(FD=_(["undefined"]))))),t.if((0,we._)(LD||(LD=_(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,we._)(RD||(RD=_(["",".items"])),e.evaluated),(0,we._)(ND||(ND=_(["undefined"])))))}s(rne,"resetEvaluated");var BD;function mD(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,we._)(BD||(BD=_(["/*# sourceURL="," */"])),r):we.nil}s(mD,"funcSourceUrl");function nne(e,t){if(iF(e)&&(sF(e),oF(e))){one(e,t);return}(0,rF.boolOrEmptySchema)(e,t)}s(nne,"subschemaCode");function oF({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(oF,"schemaCxtHasRules");function iF(e){return typeof e.schema!="boolean"}s(iF,"isSchemaObj");var $D;function one(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&lF(e),ane(e),lne(e);let i=n.const("_errs",Ge.default.errors);aF(e,i),n.var(t,(0,we._)($D||($D=_([""," === ",""])),i,Ge.default.errors))}s(one,"subSchemaObjCode");function sF(e){(0,Ha.checkUnknownRules)(e),ine(e)}s(sF,"checkKeywords");function aF(e,t){if(e.opts.jtd)return hD(e,[],!1,t);let r=(0,fD.getSchemaTypes)(e.schema),n=(0,fD.coerceAndCheckDataType)(e,r);hD(e,r,!n,t)}s(aF,"typeAndKeywords");function ine(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ha.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}s(ine,"checkRefsAndKeywords");function sne(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ha.checkStrictMode)(e,"default is ignored in the schema root")}s(sne,"checkNoDefault");function ane(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Kre.resolveUrl)(e.opts.uriResolver,e.baseId,t))}s(ane,"updateContext");function lne(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}s(lne,"checkAsyncSchema");var jD,GD,UD;function lF({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,we._)(jD||(jD=_(["",".logger.log(",")"])),Ge.default.self,i));else if(typeof o.$comment=="function"){let a=(0,we.str)(GD||(GD=_(["","/$comment"])),n),l=e.scopeValue("root",{ref:t.root});e.code((0,we._)(UD||(UD=_(["",".opts.$comment(",", ",", ",".schema)"])),Ge.default.self,i,a,l))}}s(lF,"commentKeyword");var VD,zD,HD,WD;function cne(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,we._)(VD||(VD=_([""," === 0"])),Ge.default.errors),()=>t.return(Ge.default.data),()=>t.throw((0,we._)(zD||(zD=_(["new ","(",")"])),o,Ge.default.vErrors))):(t.assign((0,we._)(HD||(HD=_(["",".errors"])),n),Ge.default.vErrors),i.unevaluated&&une(e),t.return((0,we._)(WD||(WD=_([""," === 0"])),Ge.default.errors)))}s(cne,"returnResults");var qD,ZD;function une({gen:e,evaluated:t,props:r,items:n}){r instanceof we.Name&&e.assign((0,we._)(qD||(qD=_(["",".props"])),t),r),n instanceof we.Name&&e.assign((0,we._)(ZD||(ZD=_(["",".items"])),t),n)}s(une,"assignEvaluated");var XD;function hD(e,t,r,n){let{gen:o,schema:i,data:a,allErrors:l,opts:c,self:p}=e,{RULES:f}=p;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Ha.schemaHasRulesButRef)(i,f))){o.block(()=>uF(e,"$ref",f.all.$ref.definition));return}c.jtd||pne(e,t),o.block(()=>{for(let y of f.rules)m(y);m(f.post)});function m(y){(0,lP.shouldUseGroup)(i,y)&&(y.type?(o.if((0,H0.checkDataType)(y.type,a,c.strictNumbers)),yD(e,y),t.length===1&&t[0]===y.type&&r&&(o.else(),(0,H0.reportTypeError)(e)),o.endIf()):yD(e,y),l||o.if((0,we._)(XD||(XD=_([""," === ",""])),Ge.default.errors,n||0)))}s(m,"groupKeywords")}s(hD,"schemaKeywords");function yD(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,Yre.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,lP.shouldUseRule)(n,i)&&uF(e,i.keyword,i.definition,t.type)})}s(yD,"iterateKeywords");function pne(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(dne(e,t),e.opts.allowUnionTypes||fne(e,t),mne(e,e.dataTypes))}s(pne,"checkStrictTypes");function dne(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{cF(e.dataTypes,r)||cP(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),yne(e,t)}}s(dne,"checkContextTypes");function fne(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&cP(e,"use allowUnionTypes to allow union type keyword")}s(fne,"checkMultipleTypes");function mne(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,lP.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>hne(t,a))&&cP(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(n,'"'))}}}s(mne,"checkKeywordTypes");function hne(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}s(hne,"hasApplicableType");function cF(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}s(cF,"includesType");function yne(e,t){let r=[];for(let n of e.dataTypes)cF(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}s(yne,"narrowSchemaTypes");function cP(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,Ha.checkStrictMode)(e,t,e.opts.strictTypes)}s(cP,"strictTypesError");var YD,KD,JD,QD,uP=class uP{constructor(t,r,n){if((0,Ny.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,Ha.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",pF(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ny.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",Ge.default.errors))}result(t,r,n){this.failResult((0,we.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,we.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,we._)(YD||(YD=_([""," !== undefined && (",")"])),r,(0,we.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?Ry.reportExtraError:Ry.reportError)(this,this.def.error,r)}$dataError(){(0,Ry.reportError)(this,this.def.$dataError||Ry.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ry.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=we.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=we.nil,r=we.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,we.or)((0,we._)(KD||(KD=_([""," === undefined"])),o),r)),t!==we.nil&&n.assign(t,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==we.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,we.or)(a(),l());function a(){if(n.length){if(!(r instanceof we.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,we._)(JD||(JD=_(["",""])),(0,H0.checkDataTypes)(c,r,i.opts.strictNumbers,H0.DataType.Wrong))}return we.nil}function l(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,we._)(QD||(QD=_(["!","(",")"])),c,r)}return we.nil}}subschema(t,r){let n=(0,aP.getSubschema)(this.it,t);(0,aP.extendSubschemaData)(n,this.it,t),(0,aP.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return nne(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ha.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ha.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,we.Name)),!0}};s(uP,"KeywordCxt");var W0=uP;hc.KeywordCxt=W0;function uF(e,t,r,n){let o=new W0(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,Ny.funcKeywordCode)(o,r):"macro"in r?(0,Ny.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,Ny.funcKeywordCode)(o,r)}s(uF,"keywordCode");var gne=/^\/(?:[^~]|~0|~1)*$/,bne=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,eF,tF;function pF(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return Ge.default.rootData;if(e[0]==="/"){if(!gne.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));o=e,i=Ge.default.rootData}else{let p=bne.exec(e);if(!p)throw new Error("Invalid JSON-pointer: ".concat(e));let f=+p[1];if(o=p[2],o==="#"){if(f>=t)throw new Error(c("property/index",f));return n[t-f]}if(f>t)throw new Error(c("data",f));if(i=r[t-f],!o)return i}let a=i,l=o.split("/");for(let p of l)p&&(i=(0,we._)(eF||(eF=_(["","",""])),i,(0,we.getProperty)((0,Ha.unescapeJsonPointer)(p))),a=(0,we._)(tF||(tF=_([""," && ",""])),a,i));return a;function c(p,f){return"Cannot access ".concat(p," ").concat(f," levels up, current level is ").concat(t)}}s(pF,"getData");hc.getData=pF});var q0=W(dP=>{"use strict";d();Object.defineProperty(dP,"__esModule",{value:!0});var fP=class fP extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};s(fP,"ValidationError");var pP=fP;dP.default=pP});var $y=W(yP=>{"use strict";d();Object.defineProperty(yP,"__esModule",{value:!0});var mP=Ly(),gP=class gP extends Error{constructor(t,r,n,o){super(o||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,mP.resolveUrl)(t,r,n),this.missingSchema=(0,mP.normalizeId)((0,mP.getFullPath)(t,this.missingRef))}};s(gP,"MissingRefError");var hP=gP;yP.default=hP});var X0=W(ei=>{"use strict";d();Object.defineProperty(ei,"__esModule",{value:!0});ei.resolveSchema=ei.getCompilingSchema=ei.resolveRef=ei.compileSchema=ei.SchemaEnv=void 0;var Bi=Xe(),vne=q0(),Hu=za(),$i=Ly(),dF=Ot(),xne=By(),xP=class xP{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,$i.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(xP,"SchemaEnv");var vf=xP;ei.SchemaEnv=vf;var fF,mF;function vP(e){let t=hF.call(this,e);if(t)return t;let r=(0,$i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new Bi.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),l;e.$async&&(l=a.scopeValue("Error",{ref:vne.default,code:(0,Bi._)(fF||(fF=_(['require("ajv/dist/runtime/validation_error").default'])))}));let c=a.scopeName("validate");e.validateName=c;let p={gen:a,allErrors:this.opts.allErrors,data:Hu.default.data,parentData:Hu.default.parentData,parentDataProperty:Hu.default.parentDataProperty,dataNames:[Hu.default.data],dataPathArr:[Bi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Bi.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:l,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Bi.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Bi._)(mF||(mF=_(['""']))),opts:this.opts,self:this},f;try{this._compilations.add(e),(0,xne.validateFunctionCode)(p),a.optimize(this.opts.code.optimize);let m=a.toString();f="".concat(a.scopeRefs(Hu.default.scope),"return ").concat(m),this.opts.code.process&&(f=this.opts.code.process(f,e));let v=new Function("".concat(Hu.default.self),"".concat(Hu.default.scope),f)(this,this.scope.get());if(this.scope.value(c,{ref:v}),v.errors=null,v.schema=e.schema,v.schemaEnv=e,e.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:c,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:x,items:S}=p;v.evaluated={props:x instanceof Bi.Name?void 0:x,items:S instanceof Bi.Name?void 0:S,dynamicProps:x instanceof Bi.Name,dynamicItems:S instanceof Bi.Name},v.source&&(v.source.evaluated=(0,Bi.stringify)(v.evaluated))}return e.validate=v,e}catch(m){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),m}finally{this._compilations.delete(e)}}s(vP,"compileSchema");ei.compileSchema=vP;function Ine(e,t,r){var n;r=(0,$i.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=Pne.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 vf({schema:a,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Sne.call(this,i)}s(Ine,"resolveRef");ei.resolveRef=Ine;function Sne(e){return(0,$i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:vP.call(this,e)}s(Sne,"inlineOrCompile");function hF(e){for(let t of this._compilations)if(Cne(t,e))return t}s(hF,"getCompilingSchema");ei.getCompilingSchema=hF;function Cne(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}s(Cne,"sameSchemaEnv");function Pne(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Z0.call(this,e,t)}s(Pne,"resolve");function Z0(e,t){let r=this.opts.uriResolver.parse(t),n=(0,$i._getFullPath)(this.opts.uriResolver,r),o=(0,$i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return bP.call(this,r,e);let i=(0,$i.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let l=Z0.call(this,e,a);return typeof(l==null?void 0:l.schema)!="object"?void 0:bP.call(this,r,l)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||vP.call(this,a),i===(0,$i.normalizeId)(t)){let{schema:l}=a,{schemaId:c}=this.opts,p=l[c];return p&&(o=(0,$i.resolveUrl)(this.opts.uriResolver,o,p)),new vf({schema:l,schemaId:c,root:e,baseId:o})}return bP.call(this,r,a)}}s(Z0,"resolveSchema");ei.resolveSchema=Z0;var Tne=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bP(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,dF.unescapeFragment)(l)];if(c===void 0)return;r=c;let p=typeof r=="object"&&r[this.opts.schemaId];!Tne.has(l)&&p&&(t=(0,$i.resolveUrl)(this.opts.uriResolver,t,p))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,dF.schemaHasRulesButRef)(r,this.RULES)){let l=(0,$i.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Z0.call(this,n,l)}let{schemaId:a}=this.opts;if(i=i||new vf({schema:r,schemaId:a,root:n,baseId:t}),i.schema!==i.root.schema)return i}s(bP,"getJsonPointer")});var yF=W((ZEe,wne)=>{wne.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 bF=W((XEe,gF)=>{"use strict";d();var Mne={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};gF.exports={HEX:Mne}});var wF=W((KEe,TF)=>{"use strict";d();var{HEX:One}=bF(),Ene=/^(?:(?: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 SF(e){if(PF(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(Ene)||[],[r]=t;return r?{host:Ane(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}s(SF,"normalizeIPv4");function IP(e,t=!1){let r="",n=!0;for(let o of e){if(One[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}s(IP,"stringArrayToHexStripped");function _ne(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 p=IP(o);if(p!==void 0)n.push(p);else return r.error=!0,!1}o.length=0}return!0}s(c,"consume");for(let p=0;p<e.length;p++){let f=e[p];if(!(f==="["||f==="]"))if(f===":"){if(a===!0&&(l=!0),!c())break;if(t++,n.push(":"),t>7){r.error=!0;break}p-1>=0&&e[p-1]===":"&&(a=!0);continue}else if(f==="%"){if(!c())break;i=!0}else{o.push(f);continue}}return o.length&&(i?r.zone=o.join(""):l?n.push(o.join("")):n.push(IP(o))),r.address=n.join(""),r}s(_ne,"getIPV6");function CF(e){if(PF(e,":")<2)return{host:e,isIPV6:!1};let t=_ne(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(CF,"normalizeIPv6");function Ane(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(Ane,"stripLeadingZeros");function PF(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}s(PF,"findToken");var vF=/^\.\.?\//u,xF=/^\/\.(?:\/|$)/u,IF=/^\/\.\.(?:\/|$)/u,kne=/^\/?(?:.|\n)*?(?=\/|$)/u;function Dne(e){let t=[];for(;e.length;)if(e.match(vF))e=e.replace(vF,"");else if(e.match(xF))e=e.replace(xF,"/");else if(e.match(IF))e=e.replace(IF,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(kne);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(Dne,"removeDotSegments");function Fne(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(Fne,"normalizeComponentEncoding");function Lne(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=SF(r);if(n.isIPV4)r=n.host;else{let o=CF(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(Lne,"recomposeAuthority");TF.exports={recomposeAuthority:Lne,normalizeComponentEncoding:Fne,removeDotSegments:Dne,normalizeIPv4:SF,normalizeIPv6:CF,stringArrayToHexStripped:IP}});var kF=W((e9e,AF)=>{"use strict";d();var Rne=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Nne=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function MF(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}s(MF,"isSecure");function OF(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}s(OF,"httpParse");function EF(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(EF,"httpSerialize");function Bne(e){return e.secure=MF(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}s(Bne,"wsParse");function $ne(e){if((e.port===(MF(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($ne,"wsSerialize");function jne(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Nne);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=SP[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}s(jne,"urnParse");function Gne(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o="".concat(r,":").concat(t.nid||n),i=SP[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(Gne,"urnSerialize");function Une(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Rne.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}s(Une,"urnuuidParse");function Vne(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}s(Vne,"urnuuidSerialize");var _F={scheme:"http",domainHost:!0,parse:OF,serialize:EF},zne={scheme:"https",domainHost:_F.domainHost,parse:OF,serialize:EF},Y0={scheme:"ws",domainHost:!0,parse:Bne,serialize:$ne},Hne={scheme:"wss",domainHost:Y0.domainHost,parse:Y0.parse,serialize:Y0.serialize},Wne={scheme:"urn",parse:jne,serialize:Gne,skipNormalize:!0},qne={scheme:"urn:uuid",parse:Une,serialize:Vne,skipNormalize:!0},SP={http:_F,https:zne,ws:Y0,wss:Hne,urn:Wne,"urn:uuid":qne};AF.exports=SP});var FF=W((n9e,J0)=>{"use strict";d();var{normalizeIPv6:Zne,normalizeIPv4:Xne,removeDotSegments:jy,recomposeAuthority:Yne,normalizeComponentEncoding:K0}=wF(),CP=kF();function Kne(e,t){return typeof e=="string"?e=Ls(Wa(e,t),t):typeof e=="object"&&(e=Wa(Ls(e,t),t)),e}s(Kne,"normalize");function Jne(e,t,r){let n=Object.assign({scheme:"null"},r),o=DF(Wa(e,n),Wa(t,n),n,!0);return Ls(o,{...n,skipEscape:!0})}s(Jne,"resolve");function DF(e,t,r,n){let o={};return n||(e=Wa(Ls(e,r),r),t=Wa(Ls(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=jy(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=jy(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=jy(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=jy(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(DF,"resolveComponents");function Qne(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ls(K0(Wa(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ls(K0(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ls(K0(Wa(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ls(K0(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}s(Qne,"equal");function Ls(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=CP[(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=Yne(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=jy(l)),a===void 0&&(l=l.replace(/^\/\//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(Ls,"serialize");var eoe=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function toe(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||eoe[t])return!0;return!1}s(toe,"nonSimpleDomain");var roe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Wa(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(roe);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=Xne(n.host);if(c.isIPV4===!1){let p=Zne(c.host);n.host=p.host.toLowerCase(),i=p.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=CP[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&i===!1&&toe(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(Wa,"parse");var PP={SCHEMES:CP,normalize:Kne,resolve:Jne,resolveComponents:DF,equal:Qne,serialize:Ls,parse:Wa};J0.exports=PP;J0.exports.default=PP;J0.exports.fastUri=PP});var RF=W(TP=>{"use strict";d();Object.defineProperty(TP,"__esModule",{value:!0});var LF=FF();LF.code='require("ajv/dist/runtime/uri").default';TP.default=LF});var zF=W(sn=>{"use strict";d();Object.defineProperty(sn,"__esModule",{value:!0});sn.CodeGen=sn.Name=sn.nil=sn.stringify=sn.str=sn._=sn.KeywordCxt=void 0;var noe=By();Object.defineProperty(sn,"KeywordCxt",{enumerable:!0,get:s(function(){return noe.KeywordCxt},"get")});var xf=Xe();Object.defineProperty(sn,"_",{enumerable:!0,get:s(function(){return xf._},"get")});Object.defineProperty(sn,"str",{enumerable:!0,get:s(function(){return xf.str},"get")});Object.defineProperty(sn,"stringify",{enumerable:!0,get:s(function(){return xf.stringify},"get")});Object.defineProperty(sn,"nil",{enumerable:!0,get:s(function(){return xf.nil},"get")});Object.defineProperty(sn,"Name",{enumerable:!0,get:s(function(){return xf.Name},"get")});Object.defineProperty(sn,"CodeGen",{enumerable:!0,get:s(function(){return xf.CodeGen},"get")});var ooe=q0(),GF=$y(),ioe=KC(),Gy=X0(),soe=Xe(),Uy=Ly(),Q0=Fy(),MP=Ot(),NF=yF(),aoe=RF(),UF=s((e,t)=>new RegExp(e,t),"defaultRegExp");UF.code="new RegExp";var loe=["removeAdditional","useDefaults","coerceTypes"],coe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),uoe={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."},poe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},BF=200;function doe(e){var t,r,n,o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M,w,E,B,D,F,L;let H=e.strict,U=(t=e.code)===null||t===void 0?void 0:t.optimize,G=U===!0||U===void 0?1:U||0,J=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:UF,X=(o=e.uriResolver)!==null&&o!==void 0?o:aoe.default;return{strictSchema:(a=(i=e.strictSchema)!==null&&i!==void 0?i:H)!==null&&a!==void 0?a:!0,strictNumbers:(c=(l=e.strictNumbers)!==null&&l!==void 0?l:H)!==null&&c!==void 0?c:!0,strictTypes:(f=(p=e.strictTypes)!==null&&p!==void 0?p:H)!==null&&f!==void 0?f:"log",strictTuples:(y=(m=e.strictTuples)!==null&&m!==void 0?m:H)!==null&&y!==void 0?y:"log",strictRequired:(x=(v=e.strictRequired)!==null&&v!==void 0?v:H)!==null&&x!==void 0?x:!1,code:e.code?{...e.code,optimize:G,regExp:J}:{optimize:G,regExp:J},loopRequired:(S=e.loopRequired)!==null&&S!==void 0?S:BF,loopEnum:(I=e.loopEnum)!==null&&I!==void 0?I:BF,meta:(P=e.meta)!==null&&P!==void 0?P:!0,messages:(T=e.messages)!==null&&T!==void 0?T:!0,inlineRefs:(M=e.inlineRefs)!==null&&M!==void 0?M:!0,schemaId:(w=e.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(B=e.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(D=e.validateFormats)!==null&&D!==void 0?D:!0,unicodeRegExp:(F=e.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(L=e.int32range)!==null&&L!==void 0?L:!0,uriResolver:X}}s(doe,"requiredOptions");var OP=class OP{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...doe(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new soe.ValueScope({scope:{},prefixes:coe,es5:r,lines:n}),this.logger=boe(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,ioe.getRules)(),$F.call(this,uoe,t,"NOT SUPPORTED"),$F.call(this,poe,t,"DEPRECATED","warn"),this._metaOpts=yoe.call(this),t.formats&&moe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&hoe.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),foe.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=NF;n==="id"&&(o={...NF},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(f,m){await i.call(this,f.$schema);let y=this._addSchema(f,m);return y.validate||a.call(this,y)}async function i(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function a(f){try{return this._compileSchemaEnv(f)}catch(m){if(!(m instanceof GF.default))throw m;return l.call(this,m),await c.call(this,m.missingSchema),a.call(this,f)}}function l({missingSchema:f,missingRef:m}){if(this.refs[f])throw new Error("AnySchema ".concat(f," is loaded but ").concat(m," cannot be resolved"))}async function c(f){let m=await p.call(this,f);this.refs[f]||await i.call(this,m.$schema),this.refs[f]||this.addSchema(m,f,r)}async function p(f){let m=this._loading[f];if(m)return m;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}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,Uy.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=jF.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Gy.SchemaEnv({schema:{},schemaId:n});if(r=Gy.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=jF.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,Uy.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(xoe.call(this,n,r),!r)return(0,MP.eachItem)(n,i=>wP.call(this,i)),this;Soe.call(this,r);let o={...r,type:(0,Q0.getJSONTypes)(r.type),schemaType:(0,Q0.getJSONTypes)(r.schemaType)};return(0,MP.eachItem)(n,o.type.length===0?i=>wP.call(this,i,o):i=>o.type.forEach(a=>wP.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:p}=c.definition,f=a[l];p&&f&&(a[l]=VF(f))}}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,Uy.normalizeId)(a||n);let p=Uy.getSchemaRefs.call(this,t,n);return c=new Gy.SchemaEnv({schema:t,schemaId:l,meta:r,baseId:n,localRefs:p}),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):Gy.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{Gy.compileSchema.call(this,t)}finally{this.opts=r}}};s(OP,"Ajv");var Vy=OP;Vy.ValidationError=ooe.default;Vy.MissingRefError=GF.default;sn.default=Vy;function $F(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($F,"checkOptions");function jF(e){return e=(0,Uy.normalizeId)(e),this.schemas[e]||this.refs[e]}s(jF,"getSchEnv");function foe(){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(foe,"addInitialSchemas");function moe(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}s(moe,"addInitialFormats");function hoe(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(hoe,"addInitialKeywords");function yoe(){let e={...this.opts};for(let t of loe)delete e[t];return e}s(yoe,"getMetaSchemaOptions");var goe={log(){},warn(){},error(){}};function boe(e){if(e===!1)return goe;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(boe,"getLogger");var voe=/^[a-z_$][a-z0-9_$:-]*$/i;function xoe(e,t){let{RULES:r}=this;if((0,MP.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!voe.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(xoe,"checkKeyword");function wP(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:{...t,type:(0,Q0.getJSONTypes)(t.type),schemaType:(0,Q0.getJSONTypes)(t.schemaType)}};t.before?Ioe.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(wP,"addRule");function Ioe(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(Ioe,"addBeforeRule");function Soe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=VF(t)),e.validateSchema=this.compile(t,!0))}s(Soe,"keywordMetaschema");var Coe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function VF(e){return{anyOf:[e,Coe]}}s(VF,"schemaOrData")});var HF=W(EP=>{"use strict";d();Object.defineProperty(EP,"__esModule",{value:!0});var Poe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};EP.default=Poe});var oL=W(Wu=>{"use strict";d();Object.defineProperty(Wu,"__esModule",{value:!0});Wu.callRef=Wu.getValidate=void 0;var Toe=$y(),WF=Qo(),mo=Xe(),If=za(),qF=X0(),ev=Ot(),ZF,woe={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:p}=i;if((r==="#"||r==="#/")&&o===p.baseId)return m();let f=qF.resolveRef.call(c,p,o,r);if(f===void 0)throw new Toe.default(n.opts.uriResolver,o,r);if(f instanceof qF.SchemaEnv)return y(f);return v(f);function m(){if(i===p)return tv(e,a,i,i.$async);let x=t.scopeValue("root",{ref:p});return tv(e,(0,mo._)(ZF||(ZF=_(["",".validate"])),x),p,p.$async)}function y(x){let S=nL(e,x);tv(e,S,x,x.$async)}function v(x){let S=t.scopeValue("schema",l.code.source===!0?{ref:x,code:(0,mo.stringify)(x)}:{ref:x}),I=t.name("valid"),P=e.subschema({schema:x,dataTypes:[],schemaPath:mo.nil,topSchemaRef:S,errSchemaPath:r},I);e.mergeEvaluated(P),e.ok(I)}}},XF;function nL(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,mo._)(XF||(XF=_(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}s(nL,"getValidate");Wu.getValidate=nL;var YF,KF,JF,QF,eL,tL,rL;function tv(e,t,r,n){let{gen:o,it:i}=e,{allErrors:a,schemaEnv:l,opts:c}=i,p=c.passContext?If.default.this:mo.nil;n?f():m();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let x=o.let("valid");o.try(()=>{o.code((0,mo._)(YF||(YF=_(["await ",""])),(0,WF.callValidateCode)(e,t,p))),v(t),a||o.assign(x,!0)},S=>{o.if((0,mo._)(KF||(KF=_(["!("," instanceof ",")"])),S,i.ValidationError),()=>o.throw(S)),y(S),a||o.assign(x,!1)}),e.ok(x)}s(f,"callAsyncRef");function m(){e.result((0,WF.callValidateCode)(e,t,p),()=>v(t),()=>y(t))}s(m,"callSyncRef");function y(x){let S=(0,mo._)(JF||(JF=_(["",".errors"])),x);o.assign(If.default.vErrors,(0,mo._)(QF||(QF=_([""," === null ? "," : ",".concat(",")"])),If.default.vErrors,S,If.default.vErrors,S)),o.assign(If.default.errors,(0,mo._)(eL||(eL=_(["",".length"])),If.default.vErrors))}s(y,"addErrorsFrom");function v(x){var S;if(!i.opts.unevaluated)return;let I=(S=r==null?void 0:r.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(i.props=ev.mergeEvaluated.props(o,I.props,i.props));else{let P=o.var("props",(0,mo._)(tL||(tL=_(["",".evaluated.props"])),x));i.props=ev.mergeEvaluated.props(o,P,i.props,mo.Name)}if(i.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(i.items=ev.mergeEvaluated.items(o,I.items,i.items));else{let P=o.var("items",(0,mo._)(rL||(rL=_(["",".evaluated.items"])),x));i.items=ev.mergeEvaluated.items(o,P,i.items,mo.Name)}}s(v,"addEvaluatedFrom")}s(tv,"callRef");Wu.callRef=tv;Wu.default=woe});var iL=W(_P=>{"use strict";d();Object.defineProperty(_P,"__esModule",{value:!0});var Moe=HF(),Ooe=oL(),Eoe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Moe.default,Ooe.default];_P.default=Eoe});var cL=W(AP=>{"use strict";d();Object.defineProperty(AP,"__esModule",{value:!0});var rv=Xe(),yc=rv.operators,nv={maximum:{okStr:"<=",ok:yc.LTE,fail:yc.GT},minimum:{okStr:">=",ok:yc.GTE,fail:yc.LT},exclusiveMaximum:{okStr:"<",ok:yc.LT,fail:yc.GTE},exclusiveMinimum:{okStr:">",ok:yc.GT,fail:yc.LTE}},sL,aL,_oe={message:s(({keyword:e,schemaCode:t})=>(0,rv.str)(sL||(sL=_(["must be "," ",""])),nv[e].okStr,t),"message"),params:s(({keyword:e,schemaCode:t})=>(0,rv._)(aL||(aL=_(["{comparison: ",", limit: ","}"])),nv[e].okStr,t),"params")},lL,Aoe={keyword:Object.keys(nv),type:"number",schemaType:"number",$data:!0,error:_oe,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,rv._)(lL||(lL=_([""," "," "," || isNaN(",")"])),r,nv[t].fail,n,r))}};AP.default=Aoe});var hL=W(kP=>{"use strict";d();Object.defineProperty(kP,"__esModule",{value:!0});var zy=Xe(),uL,pL,koe={message:s(({schemaCode:e})=>(0,zy.str)(uL||(uL=_(["must be multiple of ",""])),e),"message"),params:s(({schemaCode:e})=>(0,zy._)(pL||(pL=_(["{multipleOf: ","}"])),e),"params")},dL,fL,mL,Doe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:koe,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),l=i?(0,zy._)(dL||(dL=_(["Math.abs(Math.round(",") - ",") > 1e-",""])),a,a,i):(0,zy._)(fL||(fL=_([""," !== parseInt(",")"])),a,a);e.fail$data((0,zy._)(mL||(mL=_(["("," === 0 || ("," = ","/",", ","))"])),n,a,r,n,l))}};kP.default=Doe});var gL=W(DP=>{"use strict";d();Object.defineProperty(DP,"__esModule",{value:!0});function yL(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(yL,"ucs2length");DP.default=yL;yL.code='require("ajv/dist/runtime/ucs2length").default'});var CL=W(FP=>{"use strict";d();Object.defineProperty(FP,"__esModule",{value:!0});var qu=Xe(),Foe=Ot(),Loe=gL(),bL,vL,Roe={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,qu.str)(bL||(bL=_(["must NOT have "," than "," characters"])),r,t)},params:s(({schemaCode:e})=>(0,qu._)(vL||(vL=_(["{limit: ","}"])),e),"params")},xL,IL,SL,Noe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Roe,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?qu.operators.GT:qu.operators.LT,a=o.opts.unicode===!1?(0,qu._)(xL||(xL=_(["",".length"])),r):(0,qu._)(IL||(IL=_(["","(",")"])),(0,Foe.useFunc)(e.gen,Loe.default),r);e.fail$data((0,qu._)(SL||(SL=_([""," "," ",""])),a,i,n))}};FP.default=Noe});var OL=W(LP=>{"use strict";d();Object.defineProperty(LP,"__esModule",{value:!0});var Boe=Qo(),ov=Xe(),PL,TL,$oe={message:s(({schemaCode:e})=>(0,ov.str)(PL||(PL=_(['must match pattern "','"'])),e),"message"),params:s(({schemaCode:e})=>(0,ov._)(TL||(TL=_(["{pattern: ","}"])),e),"params")},wL,ML,joe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:$oe,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,a=i.opts.unicodeRegExp?"u":"",l=r?(0,ov._)(wL||(wL=_(["(new RegExp(",", ","))"])),o,a):(0,Boe.usePattern)(e,n);e.fail$data((0,ov._)(ML||(ML=_(["!",".test(",")"])),l,t))}};LP.default=joe});var kL=W(RP=>{"use strict";d();Object.defineProperty(RP,"__esModule",{value:!0});var Hy=Xe(),EL,_L,Goe={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Hy.str)(EL||(EL=_(["must NOT have "," than "," properties"])),r,t)},params:s(({schemaCode:e})=>(0,Hy._)(_L||(_L=_(["{limit: ","}"])),e),"params")},AL,Uoe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Goe,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Hy.operators.GT:Hy.operators.LT;e.fail$data((0,Hy._)(AL||(AL=_(["Object.keys(",").length "," ",""])),r,o,n))}};RP.default=Uoe});var LL=W(NP=>{"use strict";d();Object.defineProperty(NP,"__esModule",{value:!0});var Wy=Qo(),qy=Xe(),Voe=Ot(),DL,FL,zoe={message:s(({params:{missingProperty:e}})=>(0,qy.str)(DL||(DL=_(["must have required property '","'"])),e),"message"),params:s(({params:{missingProperty:e}})=>(0,qy._)(FL||(FL=_(["{missingProperty: ","}"])),e),"params")},Hoe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:zoe,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?p():f(),l.strictRequired){let v=e.parentSchema.properties,{definedProperties:x}=e.it;for(let S of r)if((v==null?void 0:v[S])===void 0&&!x.has(S)){let I=a.schemaEnv.baseId+a.errSchemaPath,P='required property "'.concat(S,'" is not defined at "').concat(I,'" (strictRequired)');(0,Voe.checkStrictMode)(a,P,a.opts.strictRequired)}}function p(){if(c||i)e.block$data(qy.nil,m);else for(let v of r)(0,Wy.checkReportMissingProp)(e,v)}s(p,"allErrorsMode");function f(){let v=t.let("missing");if(c||i){let x=t.let("valid",!0);e.block$data(x,()=>y(v,x)),e.ok(x)}else t.if((0,Wy.checkMissingProp)(e,r,v)),(0,Wy.reportMissingProp)(e,v),t.else()}s(f,"exitOnErrorMode");function m(){t.forOf("prop",n,v=>{e.setParams({missingProperty:v}),t.if((0,Wy.noPropertyInData)(t,o,v,l.ownProperties),()=>e.error())})}s(m,"loopAllRequired");function y(v,x){e.setParams({missingProperty:v}),t.forOf(v,n,()=>{t.assign(x,(0,Wy.propertyInData)(t,o,v,l.ownProperties)),t.if((0,qy.not)(x),()=>{e.error(),t.break()})},qy.nil)}s(y,"loopUntilMissing")}};NP.default=Hoe});var $L=W(BP=>{"use strict";d();Object.defineProperty(BP,"__esModule",{value:!0});var Zy=Xe(),RL,NL,Woe={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Zy.str)(RL||(RL=_(["must NOT have "," than "," items"])),r,t)},params:s(({schemaCode:e})=>(0,Zy._)(NL||(NL=_(["{limit: ","}"])),e),"params")},BL,qoe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Woe,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Zy.operators.GT:Zy.operators.LT;e.fail$data((0,Zy._)(BL||(BL=_(["",".length "," ",""])),r,o,n))}};BP.default=qoe});var iv=W($P=>{"use strict";d();Object.defineProperty($P,"__esModule",{value:!0});var jL=iP();jL.code='require("ajv/dist/runtime/equal").default';$P.default=jL});var oR=W(GP=>{"use strict";d();Object.defineProperty(GP,"__esModule",{value:!0});var jP=Fy(),an=Xe(),Zoe=Ot(),Xoe=iv(),GL,UL,Yoe={message:s(({params:{i:e,j:t}})=>(0,an.str)(GL||(GL=_(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:s(({params:{i:e,j:t}})=>(0,an._)(UL||(UL=_(["{i: ",", j: ","}"])),e,t),"params")},VL,zL,HL,WL,qL,ZL,XL,YL,KL,JL,QL,eR,tR,rR,nR,Koe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Yoe,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"),p=i.items?(0,jP.getSchemaTypes)(i.items):[];e.block$data(c,f,(0,an._)(VL||(VL=_([""," === false"])),a)),e.ok(c);function f(){let x=t.let("i",(0,an._)(zL||(zL=_(["",".length"])),r)),S=t.let("j");e.setParams({i:x,j:S}),t.assign(c,!0),t.if((0,an._)(HL||(HL=_([""," > 1"])),x),()=>(m()?y:v)(x,S))}s(f,"validateUniqueItems");function m(){return p.length>0&&!p.some(x=>x==="object"||x==="array")}s(m,"canOptimize");function y(x,S){let I=t.name("item"),P=(0,jP.checkDataTypes)(p,I,l.opts.strictNumbers,jP.DataType.Wrong),T=t.const("indices",(0,an._)(WL||(WL=_(["{}"]))));t.for((0,an._)(qL||(qL=_([";","--;"])),x),()=>{t.let(I,(0,an._)(ZL||(ZL=_(["","[","]"])),r,x)),t.if(P,(0,an._)(XL||(XL=_(["continue"])))),p.length>1&&t.if((0,an._)(YL||(YL=_(["typeof ",' == "string"'])),I),(0,an._)(KL||(KL=_(["",' += "_"'])),I)),t.if((0,an._)(JL||(JL=_(["typeof ","[",'] == "number"'])),T,I),()=>{t.assign(S,(0,an._)(QL||(QL=_(["","[","]"])),T,I)),e.error(),t.assign(c,!1).break()}).code((0,an._)(eR||(eR=_(["","[","] = ",""])),T,I,x))})}s(y,"loopN");function v(x,S){let I=(0,Zoe.useFunc)(t,Xoe.default),P=t.name("outer");t.label(P).for((0,an._)(tR||(tR=_([";","--;"])),x),()=>t.for((0,an._)(rR||(rR=_([""," = ","; ","--;"])),S,x,S),()=>t.if((0,an._)(nR||(nR=_(["","(","[","], ","[","])"])),I,r,x,r,S),()=>{e.error(),t.assign(c,!1).break(P)})))}s(v,"loopN2")}};GP.default=Koe});var lR=W(VP=>{"use strict";d();Object.defineProperty(VP,"__esModule",{value:!0});var UP=Xe(),Joe=Ot(),Qoe=iv(),iR,eie={message:"must be equal to constant",params:s(({schemaCode:e})=>(0,UP._)(iR||(iR=_(["{allowedValue: ","}"])),e),"params")},sR,aR,tie={keyword:"const",$data:!0,error:eie,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,UP._)(sR||(sR=_(["!","(",", ",")"])),(0,Joe.useFunc)(t,Qoe.default),r,o)):e.fail((0,UP._)(aR||(aR=_([""," !== ",""])),i,r))}};VP.default=tie});var fR=W(zP=>{"use strict";d();Object.defineProperty(zP,"__esModule",{value:!0});var Xy=Xe(),rie=Ot(),nie=iv(),cR,oie={message:"must be equal to one of the allowed values",params:s(({schemaCode:e})=>(0,Xy._)(cR||(cR=_(["{allowedValues: ","}"])),e),"params")},uR,pR,dR,iie={keyword:"enum",schemaType:"array",$data:!0,error:oie,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,p=s(()=>c!=null?c:c=(0,rie.useFunc)(t,nie.default),"getEql"),f;if(l||n)f=t.let("valid"),e.block$data(f,m);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let v=t.const("vSchema",i);f=(0,Xy.or)(...o.map((x,S)=>y(v,S)))}e.pass(f);function m(){t.assign(f,!1),t.forOf("v",i,v=>t.if((0,Xy._)(uR||(uR=_(["","(",", ",")"])),p(),r,v),()=>t.assign(f,!0).break()))}s(m,"loopEnum");function y(v,x){let S=o[x];return typeof S=="object"&&S!==null?(0,Xy._)(pR||(pR=_(["","(",", ","[","])"])),p(),r,v,x):(0,Xy._)(dR||(dR=_([""," === ",""])),r,S)}s(y,"equalCode")}};zP.default=iie});var mR=W(HP=>{"use strict";d();Object.defineProperty(HP,"__esModule",{value:!0});var sie=cL(),aie=hL(),lie=CL(),cie=OL(),uie=kL(),pie=LL(),die=$L(),fie=oR(),mie=lR(),hie=fR(),yie=[sie.default,aie.default,lie.default,cie.default,uie.default,pie.default,die.default,fie.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},mie.default,hie.default];HP.default=yie});var qP=W(Yy=>{"use strict";d();Object.defineProperty(Yy,"__esModule",{value:!0});Yy.validateAdditionalItems=void 0;var Zu=Xe(),WP=Ot(),hR,yR,gie={message:s(({params:{len:e}})=>(0,Zu.str)(hR||(hR=_(["must NOT have more than "," items"])),e),"message"),params:s(({params:{len:e}})=>(0,Zu._)(yR||(yR=_(["{limit: ","}"])),e),"params")},bie={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:gie,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,WP.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}xR(e,n)}},gR,bR,vR;function xR(e,t){let{gen:r,schema:n,data:o,keyword:i,it:a}=e;a.items=!0;let l=r.const("len",(0,Zu._)(gR||(gR=_(["",".length"])),o));if(n===!1)e.setParams({len:t.length}),e.pass((0,Zu._)(bR||(bR=_([""," <= ",""])),l,t.length));else if(typeof n=="object"&&!(0,WP.alwaysValidSchema)(a,n)){let p=r.var("valid",(0,Zu._)(vR||(vR=_([""," <= ",""])),l,t.length));r.if((0,Zu.not)(p),()=>c(p)),e.ok(p)}function c(p){r.forRange("i",t.length,l,f=>{e.subschema({keyword:i,dataProp:f,dataPropType:WP.Type.Num},p),a.allErrors||r.if((0,Zu.not)(p),()=>r.break())})}s(c,"validateItems")}s(xR,"validateAdditionalItems");Yy.validateAdditionalItems=xR;Yy.default=bie});var ZP=W(Ky=>{"use strict";d();Object.defineProperty(Ky,"__esModule",{value:!0});Ky.validateTuple=void 0;var IR=Xe(),sv=Ot(),vie=Qo(),xie={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return PR(e,"additionalItems",t);r.items=!0,!(0,sv.alwaysValidSchema)(r,t)&&e.ok((0,vie.validateArray)(e))}},SR,CR;function PR(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:l}=e;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=sv.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),p=n.const("len",(0,IR._)(SR||(SR=_(["",".length"])),i));r.forEach((m,y)=>{(0,sv.alwaysValidSchema)(l,m)||(n.if((0,IR._)(CR||(CR=_([""," > ",""])),p,y),()=>e.subschema({keyword:a,schemaProp:y,dataProp:y},c)),e.ok(c))});function f(m){let{opts:y,errSchemaPath:v}=l,x=r.length,S=x===m.minItems&&(x===m.maxItems||m[t]===!1);if(y.strictTuples&&!S){let I='"'.concat(a,'" is ').concat(x,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(v,'"');(0,sv.checkStrictMode)(l,I,y.strictTuples)}}s(f,"checkStrictTuple")}s(PR,"validateTuple");Ky.validateTuple=PR;Ky.default=xie});var TR=W(XP=>{"use strict";d();Object.defineProperty(XP,"__esModule",{value:!0});var Iie=ZP(),Sie={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:s(e=>(0,Iie.validateTuple)(e,"items"),"code")};XP.default=Sie});var ER=W(YP=>{"use strict";d();Object.defineProperty(YP,"__esModule",{value:!0});var wR=Xe(),Cie=Ot(),Pie=Qo(),Tie=qP(),MR,OR,wie={message:s(({params:{len:e}})=>(0,wR.str)(MR||(MR=_(["must NOT have more than "," items"])),e),"message"),params:s(({params:{len:e}})=>(0,wR._)(OR||(OR=_(["{limit: ","}"])),e),"params")},Mie={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:wie,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,Cie.alwaysValidSchema)(n,t)&&(o?(0,Tie.validateAdditionalItems)(e,o):e.ok((0,Pie.validateArray)(e)))}};YP.default=Mie});var UR=W(KP=>{"use strict";d();Object.defineProperty(KP,"__esModule",{value:!0});var ti=Xe(),av=Ot(),_R,AR,kR,DR,Oie={message:s(({params:{min:e,max:t}})=>t===void 0?(0,ti.str)(_R||(_R=_(["must contain at least "," valid item(s)"])),e):(0,ti.str)(AR||(AR=_(["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,ti._)(kR||(kR=_(["{minContains: ","}"])),e):(0,ti._)(DR||(DR=_(["{minContains: ",", maxContains: ","}"])),e,t),"params")},FR,LR,RR,NR,BR,$R,jR,GR,Eie={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Oie,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,a,l,{minContains:c,maxContains:p}=n;i.opts.next?(a=c===void 0?1:c,l=p):a=1;let f=t.const("len",(0,ti._)(FR||(FR=_(["",".length"])),o));if(e.setParams({min:a,max:l}),l===void 0&&a===0){(0,av.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,av.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,av.alwaysValidSchema)(i,r)){let S=(0,ti._)(LR||(LR=_([""," >= ",""])),f,a);l!==void 0&&(S=(0,ti._)(RR||(RR=_([""," && "," <= ",""])),S,f,l)),e.pass(S);return}i.items=!0;let m=t.name("valid");l===void 0&&a===1?v(m,()=>t.if(m,()=>t.break())):a===0?(t.let(m,!0),l!==void 0&&t.if((0,ti._)(NR||(NR=_(["",".length > 0"])),o),y)):(t.let(m,!1),y()),e.result(m,()=>e.reset());function y(){let S=t.name("_valid"),I=t.let("count",0);v(S,()=>t.if(S,()=>x(I)))}s(y,"validateItemsWithCount");function v(S,I){t.forRange("i",0,f,P=>{e.subschema({keyword:"contains",dataProp:P,dataPropType:av.Type.Num,compositeRule:!0},S),I()})}s(v,"validateItems");function x(S){t.code((0,ti._)(BR||(BR=_(["","++"])),S)),l===void 0?t.if((0,ti._)($R||($R=_([""," >= ",""])),S,a),()=>t.assign(m,!0).break()):(t.if((0,ti._)(jR||(jR=_([""," > ",""])),S,l),()=>t.assign(m,!1).break()),a===1?t.assign(m,!0):t.if((0,ti._)(GR||(GR=_([""," >= ",""])),S,a),()=>t.assign(m,!0)))}s(x,"checkLimits")}};KP.default=Eie});var ZR=W(Rs=>{"use strict";d();Object.defineProperty(Rs,"__esModule",{value:!0});Rs.validateSchemaDeps=Rs.validatePropertyDeps=Rs.error=void 0;var JP=Xe(),_ie=Ot(),Jy=Qo(),VR,zR;Rs.error={message:s(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,JP.str)(VR||(VR=_(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:s(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,JP._)(zR||(zR=_(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var Aie={keyword:"dependencies",type:"object",schemaType:"object",error:Rs.error,code(e){let[t,r]=kie(e);WR(e,t),qR(e,r)}};function kie({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(kie,"splitDependencies");var HR;function WR(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,Jy.propertyInData)(r,n,a,o.opts.ownProperties);e.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(c,()=>{for(let p of l)(0,Jy.checkReportMissingProp)(e,p)}):(r.if((0,JP._)(HR||(HR=_([""," && (",")"])),c,(0,Jy.checkMissingProp)(e,l,i))),(0,Jy.reportMissingProp)(e,i),r.else())}}s(WR,"validatePropertyDeps");Rs.validatePropertyDeps=WR;function qR(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,a=r.name("valid");for(let l in t)(0,_ie.alwaysValidSchema)(i,t[l])||(r.if((0,Jy.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(qR,"validateSchemaDeps");Rs.validateSchemaDeps=qR;Rs.default=Aie});var KR=W(QP=>{"use strict";d();Object.defineProperty(QP,"__esModule",{value:!0});var YR=Xe(),Die=Ot(),XR,Fie={message:"property name must be valid",params:s(({params:e})=>(0,YR._)(XR||(XR=_(["{propertyName: ","}"])),e.propertyName),"params")},Lie={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Fie,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,Die.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,YR.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};QP.default=Lie});var tT=W(eT=>{"use strict";d();Object.defineProperty(eT,"__esModule",{value:!0});var lv=Qo(),ji=Xe(),Rie=za(),cv=Ot(),JR,Nie={message:"must NOT have additional properties",params:s(({params:e})=>(0,ji._)(JR||(JR=_(["{additionalProperty: ","}"])),e.additionalProperty),"params")},QR,eN,tN,rN,Bie={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Nie,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,cv.alwaysValidSchema)(a,r))return;let p=(0,lv.allSchemaProperties)(n.properties),f=(0,lv.allSchemaProperties)(n.patternProperties);m(),e.ok((0,ji._)(QR||(QR=_([""," === ",""])),i,Rie.default.errors));function m(){t.forIn("key",o,I=>{!p.length&&!f.length?x(I):t.if(y(I),()=>x(I))})}s(m,"checkAdditionalProperties");function y(I){let P;if(p.length>8){let T=(0,cv.schemaRefOrVal)(a,n.properties,"properties");P=(0,lv.isOwnProperty)(t,T,I)}else p.length?P=(0,ji.or)(...p.map(T=>(0,ji._)(eN||(eN=_([""," === ",""])),I,T))):P=ji.nil;return f.length&&(P=(0,ji.or)(P,...f.map(T=>(0,ji._)(tN||(tN=_(["",".test(",")"])),(0,lv.usePattern)(e,T),I)))),(0,ji.not)(P)}s(y,"isAdditional");function v(I){t.code((0,ji._)(rN||(rN=_(["delete ","[","]"])),o,I))}s(v,"deleteAdditional");function x(I){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){v(I);return}if(r===!1){e.setParams({additionalProperty:I}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,cv.alwaysValidSchema)(a,r)){let P=t.name("valid");c.removeAdditional==="failing"?(S(I,P,!1),t.if((0,ji.not)(P),()=>{e.reset(),v(I)})):(S(I,P),l||t.if((0,ji.not)(P),()=>t.break()))}}s(x,"additionalPropertyCode");function S(I,P,T){let M={keyword:"additionalProperties",dataProp:I,dataPropType:cv.Type.Str};T===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(M,P)}s(S,"applyAdditionalSchema")}};eT.default=Bie});var iN=W(nT=>{"use strict";d();Object.defineProperty(nT,"__esModule",{value:!0});var $ie=By(),nN=Qo(),rT=Ot(),oN=tT(),jie={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&&oN.default.code(new $ie.KeywordCxt(i,oN.default,"additionalProperties"));let a=(0,nN.allSchemaProperties)(r);for(let m of a)i.definedProperties.add(m);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=rT.mergeEvaluated.props(t,(0,rT.toHash)(a),i.props));let l=a.filter(m=>!(0,rT.alwaysValidSchema)(i,r[m]));if(l.length===0)return;let c=t.name("valid");for(let m of l)p(m)?f(m):(t.if((0,nN.propertyInData)(t,o,m,i.opts.ownProperties)),f(m),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(c);function p(m){return i.opts.useDefaults&&!i.compositeRule&&r[m].default!==void 0}s(p,"hasDefault");function f(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},c)}s(f,"applyPropertySchema")}};nT.default=jie});var pN=W(oT=>{"use strict";d();Object.defineProperty(oT,"__esModule",{value:!0});var sN=Qo(),uv=Xe(),aN=Ot(),lN=Ot(),cN,uN,Gie={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,sN.allSchemaProperties)(r),c=l.filter(S=>(0,aN.alwaysValidSchema)(i,r[S]));if(l.length===0||c.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;let p=a.strictSchema&&!a.allowMatchingProperties&&o.properties,f=t.name("valid");i.props!==!0&&!(i.props instanceof uv.Name)&&(i.props=(0,lN.evaluatedPropsToName)(t,i.props));let{props:m}=i;y();function y(){for(let S of l)p&&v(S),i.allErrors?x(S):(t.var(f,!0),x(S),t.if(f))}s(y,"validatePatternProperties");function v(S){for(let I in p)new RegExp(S).test(I)&&(0,aN.checkStrictMode)(i,"property ".concat(I," matches pattern ").concat(S," (use allowMatchingProperties)"))}s(v,"checkMatchingProperties");function x(S){t.forIn("key",n,I=>{t.if((0,uv._)(cN||(cN=_(["",".test(",")"])),(0,sN.usePattern)(e,S),I),()=>{let P=c.includes(S);P||e.subschema({keyword:"patternProperties",schemaProp:S,dataProp:I,dataPropType:lN.Type.Str},f),i.opts.unevaluated&&m!==!0?t.assign((0,uv._)(uN||(uN=_(["","[","]"])),m,I),!0):!P&&!i.allErrors&&t.if((0,uv.not)(f),()=>t.break())})})}s(x,"validateProperties")}};oT.default=Gie});var dN=W(iT=>{"use strict";d();Object.defineProperty(iT,"__esModule",{value:!0});var Uie=Ot(),Vie={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Uie.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"}};iT.default=Vie});var fN=W(sT=>{"use strict";d();Object.defineProperty(sT,"__esModule",{value:!0});var zie=Qo(),Hie={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:zie.validateUnion,error:{message:"must match a schema in anyOf"}};sT.default=Hie});var gN=W(aT=>{"use strict";d();Object.defineProperty(aT,"__esModule",{value:!0});var pv=Xe(),Wie=Ot(),mN,qie={message:"must match exactly one schema in oneOf",params:s(({params:e})=>(0,pv._)(mN||(mN=_(["{passingSchemas: ","}"])),e.passing),"params")},hN,yN,Zie={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:qie,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(p),e.result(a,()=>e.reset(),()=>e.error(!0));function p(){i.forEach((f,m)=>{let y;(0,Wie.alwaysValidSchema)(o,f)?t.var(c,!0):y=e.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},c),m>0&&t.if((0,pv._)(hN||(hN=_([""," && ",""])),c,a)).assign(a,!1).assign(l,(0,pv._)(yN||(yN=_(["[",", ","]"])),l,m)).else(),t.if(c,()=>{t.assign(a,!0),t.assign(l,m),y&&e.mergeEvaluated(y,pv.Name)})})}s(p,"validateOneOf")}};aT.default=Zie});var bN=W(lT=>{"use strict";d();Object.defineProperty(lT,"__esModule",{value:!0});var Xie=Ot(),Yie={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,Xie.alwaysValidSchema)(n,i))return;let l=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o),e.mergeEvaluated(l)})}};lT.default=Yie});var PN=W(cT=>{"use strict";d();Object.defineProperty(cT,"__esModule",{value:!0});var dv=Xe(),CN=Ot(),xN,IN,Kie={message:s(({params:e})=>(0,dv.str)(xN||(xN=_(['must match "','" schema'])),e.ifClause),"message"),params:s(({params:e})=>(0,dv._)(IN||(IN=_(["{failingKeyword: ","}"])),e.ifClause),"params")},SN,Jie={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Kie,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,CN.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=vN(n,"then"),i=vN(n,"else");if(!o&&!i)return;let a=t.let("valid",!0),l=t.name("_valid");if(c(),e.reset(),o&&i){let f=t.let("ifClause");e.setParams({ifClause:f}),t.if(l,p("then",f),p("else",f))}else o?t.if(l,p("then")):t.if((0,dv.not)(l),p("else"));e.pass(a,()=>e.error(!0));function c(){let f=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(f)}s(c,"validateIf");function p(f,m){return()=>{let y=e.subschema({keyword:f},l);t.assign(a,l),e.mergeValidEvaluated(y,a),m?t.assign(m,(0,dv._)(SN||(SN=_(["",""])),f)):e.setParams({ifClause:f})}}s(p,"validateClause")}};function vN(e,t){let r=e.schema[t];return r!==void 0&&!(0,CN.alwaysValidSchema)(e,r)}s(vN,"hasSchema");cT.default=Jie});var TN=W(uT=>{"use strict";d();Object.defineProperty(uT,"__esModule",{value:!0});var Qie=Ot(),ese={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Qie.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};uT.default=ese});var wN=W(pT=>{"use strict";d();Object.defineProperty(pT,"__esModule",{value:!0});var tse=qP(),rse=TR(),nse=ZP(),ose=ER(),ise=UR(),sse=ZR(),ase=KR(),lse=tT(),cse=iN(),use=pN(),pse=dN(),dse=fN(),fse=gN(),mse=bN(),hse=PN(),yse=TN();function gse(e=!1){let t=[pse.default,dse.default,fse.default,mse.default,hse.default,yse.default,ase.default,lse.default,sse.default,cse.default,use.default];return e?t.push(rse.default,ose.default):t.push(tse.default,nse.default),t.push(ise.default),t}s(gse,"getApplicator");pT.default=gse});var zN=W(dT=>{"use strict";d();Object.defineProperty(dT,"__esModule",{value:!0});var Er=Xe(),MN,ON,bse={message:s(({schemaCode:e})=>(0,Er.str)(MN||(MN=_(['must match format "','"'])),e),"message"),params:s(({schemaCode:e})=>(0,Er._)(ON||(ON=_(["{format: ","}"])),e),"params")},EN,_N,AN,kN,DN,FN,LN,RN,NN,BN,$N,jN,GN,UN,VN,vse={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bse,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:p,schemaEnv:f,self:m}=l;if(!c.validateFormats)return;o?y():v();function y(){let x=r.scopeValue("formats",{ref:m.formats,code:c.code.formats}),S=r.const("fDef",(0,Er._)(EN||(EN=_(["","[","]"])),x,a)),I=r.let("fType"),P=r.let("format");r.if((0,Er._)(_N||(_N=_(["typeof ",' == "object" && !('," instanceof RegExp)"])),S,S),()=>r.assign(I,(0,Er._)(AN||(AN=_(["",'.type || "string"'])),S)).assign(P,(0,Er._)(kN||(kN=_(["",".validate"])),S)),()=>r.assign(I,(0,Er._)(DN||(DN=_(['"string"'])))).assign(P,S)),e.fail$data((0,Er.or)(T(),M()));function T(){return c.strictSchema===!1?Er.nil:(0,Er._)(FN||(FN=_([""," && !",""])),a,P)}s(T,"unknownFmt");function M(){let w=f.$async?(0,Er._)(LN||(LN=_(["(",".async ? await ","(",") : ","(","))"])),S,P,n,P,n):(0,Er._)(RN||(RN=_(["","(",")"])),P,n),E=(0,Er._)(NN||(NN=_(["(typeof ",' == "function" ? '," : ",".test(","))"])),P,w,P,n);return(0,Er._)(BN||(BN=_([""," && "," !== true && "," === "," && !",""])),P,P,I,t,E)}s(M,"invalidFmt")}s(y,"validate$DataFormat");function v(){let x=m.formats[i];if(!x){T();return}if(x===!0)return;let[S,I,P]=M(x);S===t&&e.pass(w());function T(){if(c.strictSchema===!1){m.logger.warn(E());return}throw new Error(E());function E(){return'unknown format "'.concat(i,'" ignored in schema at path "').concat(p,'"')}}s(T,"unknownFormat");function M(E){let B=E instanceof RegExp?(0,Er.regexpCode)(E):c.code.formats?(0,Er._)($N||($N=_(["","",""])),c.code.formats,(0,Er.getProperty)(i)):void 0,D=r.scopeValue("formats",{key:i,ref:E,code:B});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Er._)(jN||(jN=_(["",".validate"])),D)]:["string",E,D]}s(M,"getFormat");function w(){if(typeof x=="object"&&!(x instanceof RegExp)&&x.async){if(!f.$async)throw new Error("async format in sync schema");return(0,Er._)(GN||(GN=_(["await ","(",")"])),P,n)}return typeof I=="function"?(0,Er._)(UN||(UN=_(["","(",")"])),P,n):(0,Er._)(VN||(VN=_(["",".test(",")"])),P,n)}s(w,"validCondition")}s(v,"validateFormat")}};dT.default=vse});var HN=W(fT=>{"use strict";d();Object.defineProperty(fT,"__esModule",{value:!0});var xse=zN(),Ise=[xse.default];fT.default=Ise});var WN=W(Sf=>{"use strict";d();Object.defineProperty(Sf,"__esModule",{value:!0});Sf.contentVocabulary=Sf.metadataVocabulary=void 0;Sf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Sf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ZN=W(mT=>{"use strict";d();Object.defineProperty(mT,"__esModule",{value:!0});var Sse=iL(),Cse=mR(),Pse=wN(),Tse=HN(),qN=WN(),wse=[Sse.default,Cse.default,(0,Pse.default)(),Tse.default,qN.metadataVocabulary,qN.contentVocabulary];mT.default=wse});var YN=W(fv=>{"use strict";d();Object.defineProperty(fv,"__esModule",{value:!0});fv.DiscrError=void 0;var XN;(function(e){e.Tag="tag",e.Mapping="mapping"})(XN||(fv.DiscrError=XN={}))});var rB=W(yT=>{"use strict";d();Object.defineProperty(yT,"__esModule",{value:!0});var Cf=Xe(),hT=YN(),KN=X0(),Mse=$y(),Ose=Ot(),JN,Ese={message:s(({params:{discrError:e,tagName:t}})=>e===hT.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,Cf._)(JN||(JN=_(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},QN,eB,tB,_se={keyword:"discriminator",type:"object",schemaType:"object",error:Ese,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),p=t.const("tag",(0,Cf._)(QN||(QN=_(["","",""])),r,(0,Cf.getProperty)(l)));t.if((0,Cf._)(eB||(eB=_(["typeof ",' == "string"'])),p),()=>f(),()=>e.error(!1,{discrError:hT.DiscrError.Tag,tag:p,tagName:l})),e.ok(c);function f(){let v=y();t.if(!1);for(let x in v)t.elseIf((0,Cf._)(tB||(tB=_([""," === ",""])),p,x)),t.assign(c,m(v[x]));t.else(),e.error(!1,{discrError:hT.DiscrError.Mapping,tag:p,tagName:l}),t.endIf()}s(f,"validateMapping");function m(v){let x=t.name("valid"),S=e.subschema({keyword:"oneOf",schemaProp:v},x);return e.mergeEvaluated(S,Cf.Name),x}s(m,"applyTagSchema");function y(){var v;let x={},S=P(o),I=!0;for(let w=0;w<a.length;w++){let E=a[w];if(E!=null&&E.$ref&&!(0,Ose.schemaHasRulesButRef)(E,i.self.RULES)){let D=E.$ref;if(E=KN.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D),E instanceof KN.SchemaEnv&&(E=E.schema),E===void 0)throw new Mse.default(i.opts.uriResolver,i.baseId,D)}let B=(v=E==null?void 0:E.properties)===null||v===void 0?void 0:v[l];if(typeof B!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(l,'"'));I=I&&(S||P(E)),T(B,w)}if(!I)throw new Error('discriminator: "'.concat(l,'" must be required'));return x;function P({required:w}){return Array.isArray(w)&&w.includes(l)}function T(w,E){if(w.const)M(w.const,E);else if(w.enum)for(let B of w.enum)M(B,E);else throw new Error('discriminator: "properties/'.concat(l,'" must have "const" or "enum"'))}function M(w,E){if(typeof w!="string"||w in x)throw new Error('discriminator: "'.concat(l,'" values must be unique strings'));x[w]=E}}s(y,"getMapping")}};yT.default=_se});var nB=W((l_e,Ase)=>{Ase.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 vT=W((rr,gT)=>{"use strict";d();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 kse=zF(),Dse=ZN(),Fse=rB(),oB=nB(),Lse=["/properties"],mv="http://json-schema.org/draft-07/schema",bT=class bT extends kse.default{_addVocabularies(){super._addVocabularies(),Dse.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Fse.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(oB,Lse):oB;this.addMetaSchema(t,mv,!1),this.refs["http://json-schema.org/schema"]=mv}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(mv)?mv:void 0)}};s(bT,"Ajv");var Pf=bT;rr.Ajv=Pf;gT.exports=rr=Pf;gT.exports.Ajv=Pf;Object.defineProperty(rr,"__esModule",{value:!0});rr.default=Pf;var Rse=By();Object.defineProperty(rr,"KeywordCxt",{enumerable:!0,get:s(function(){return Rse.KeywordCxt},"get")});var Tf=Xe();Object.defineProperty(rr,"_",{enumerable:!0,get:s(function(){return Tf._},"get")});Object.defineProperty(rr,"str",{enumerable:!0,get:s(function(){return Tf.str},"get")});Object.defineProperty(rr,"stringify",{enumerable:!0,get:s(function(){return Tf.stringify},"get")});Object.defineProperty(rr,"nil",{enumerable:!0,get:s(function(){return Tf.nil},"get")});Object.defineProperty(rr,"Name",{enumerable:!0,get:s(function(){return Tf.Name},"get")});Object.defineProperty(rr,"CodeGen",{enumerable:!0,get:s(function(){return Tf.CodeGen},"get")});var Nse=q0();Object.defineProperty(rr,"ValidationError",{enumerable:!0,get:s(function(){return Nse.default},"get")});var Bse=$y();Object.defineProperty(rr,"MissingRefError",{enumerable:!0,get:s(function(){return Bse.default},"get")})});var uB=W(Ns=>{"use strict";d();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.formatNames=Ns.fastFormats=Ns.fullFormats=void 0;function wf(e,t){return{validate:e,compare:t}}s(wf,"fmtDef");Ns.fullFormats={date:wf(aB,ST),time:wf(lB,CT),"date-time":wf(Use,cB),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Hse,"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:/^(?: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:Jse,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:Wse,int32:{type:"number",validate:Xse},int64:{type:"number",validate:Yse},float:{type:"number",validate:sB},double:{type:"number",validate:sB},password:!0,binary:!0};Ns.fastFormats={...Ns.fullFormats,date:wf(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ST),time:wf(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CT),"date-time":wf(/^\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,cB),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};Ns.formatNames=Object.keys(Ns.fullFormats);function $se(e){return e%4===0&&(e%100!==0||e%400===0)}s($se,"isLeapYear");var jse=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Gse=[0,31,28,31,30,31,30,31,31,30,31,30,31];function aB(e){let t=jse.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&&$se(r)?29:Gse[n])}s(aB,"date");function ST(e,t){if(e&&t)return e>t?1:e<t?-1:0}s(ST,"compareDate");var xT=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function lB(e,t){let r=xT.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(lB,"time");function CT(e,t){if(!(e&&t))return;let r=xT.exec(e),n=xT.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(CT,"compareTime");var IT=/t|\s/i;function Use(e){let t=e.split(IT);return t.length===2&&aB(t[0])&&lB(t[1],!0)}s(Use,"date_time");function cB(e,t){if(!(e&&t))return;let[r,n]=e.split(IT),[o,i]=t.split(IT),a=ST(r,o);if(a!==void 0)return a||CT(n,i)}s(cB,"compareDateTime");var Vse=/\/|:/,zse=/^(?:[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 Hse(e){return Vse.test(e)&&zse.test(e)}s(Hse,"uri");var iB=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Wse(e){return iB.lastIndex=0,iB.test(e)}s(Wse,"byte");var qse=-(2**31),Zse=2**31-1;function Xse(e){return Number.isInteger(e)&&e<=Zse&&e>=qse}s(Xse,"validateInt32");function Yse(e){return Number.isInteger(e)}s(Yse,"validateInt64");function sB(){return!0}s(sB,"validateNumber");var Kse=/[^\\]\\Z/;function Jse(e){if(Kse.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}s(Jse,"regex")});var vB=W(Mf=>{"use strict";d();Object.defineProperty(Mf,"__esModule",{value:!0});Mf.formatLimitDefinition=void 0;var Qse=vT(),Gi=Xe(),gc=Gi.operators,hv={formatMaximum:{okStr:"<=",ok:gc.LTE,fail:gc.GT},formatMinimum:{okStr:">=",ok:gc.GTE,fail:gc.LT},formatExclusiveMaximum:{okStr:"<",ok:gc.LT,fail:gc.GTE},formatExclusiveMinimum:{okStr:">",ok:gc.GT,fail:gc.LTE}},pB,dB,eae={message:s(({keyword:e,schemaCode:t})=>Gi.str(pB||(pB=_(["should be "," ",""])),hv[e].okStr,t),"message"),params:s(({keyword:e,schemaCode:t})=>Gi._(dB||(dB=_(["{comparison: ",", limit: ","}"])),hv[e].okStr,t),"params")},fB,mB,hB,yB,gB,bB;Mf.formatLimitDefinition={keyword:Object.keys(hv),type:"string",schemaType:"string",$data:!0,error:eae,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 Qse.KeywordCxt(i,l.RULES.all.format.definition,"format");c.$data?p():f();function p(){let y=t.scopeValue("formats",{ref:l.formats,code:a.code.formats}),v=t.const("fmt",Gi._(fB||(fB=_(["","[","]"])),y,c.schemaCode));e.fail$data(Gi.or(Gi._(mB||(mB=_(["typeof ",' != "object"'])),v),Gi._(hB||(hB=_([""," instanceof RegExp"])),v),Gi._(yB||(yB=_(["typeof ",'.compare != "function"'])),v),m(v)))}s(p,"validate$DataFormat");function f(){let y=c.schema,v=l.formats[y];if(!v||v===!0)return;if(typeof v!="object"||v instanceof RegExp||typeof v.compare!="function")throw new Error('"'.concat(o,'": format "').concat(y,'" does not define "compare" function'));let x=t.scopeValue("formats",{key:y,ref:v,code:a.code.formats?Gi._(gB||(gB=_(["","",""])),a.code.formats,Gi.getProperty(y)):void 0});e.fail$data(m(x))}s(f,"validateFormat");function m(y){return Gi._(bB||(bB=_(["",".compare(",", ",") "," 0"])),y,r,n,hv[o].fail)}s(m,"compareCode")},dependencies:["format"]};var tae=s(e=>(e.addKeyword(Mf.formatLimitDefinition),e),"formatLimitPlugin");Mf.default=tae});var PB=W((Qy,CB)=>{"use strict";d();Object.defineProperty(Qy,"__esModule",{value:!0});var Of=uB(),rae=vB(),PT=Xe(),xB=new PT.Name("fullFormats"),nae=new PT.Name("fastFormats"),TT=s((e,t={keywords:!0})=>{if(Array.isArray(t))return IB(e,t,Of.fullFormats,xB),e;let[r,n]=t.mode==="fast"?[Of.fastFormats,nae]:[Of.fullFormats,xB],o=t.formats||Of.formatNames;return IB(e,o,r,n),t.keywords&&rae.default(e),e},"formatsPlugin");TT.get=(e,t="full")=>{let n=(t==="fast"?Of.fastFormats:Of.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var SB;function IB(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=PT._(SB||(SB=_(['require("ajv-formats/dist/formats").',""])),n));for(let a of t)e.addFormat(a,r[a])}s(IB,"addFormats");CB.exports=Qy=TT;Object.defineProperty(Qy,"__esModule",{value:!0});Qy.default=TT});var cz=W((Dst,C4)=>{"use strict";d();var Jx=Vee();Jx.default&&(Jx=Jx.default);C4.exports=lz;C4.exports.default=lz;function lz(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 p=i-n,f=a-o,m=Math.min(p,f),y=m/2;if(m===0){var v=[n,o];return v.distance=0,v}for(var x=new Jx(void 0,Qge),S=n;S<i;S+=m)for(var I=o;I<a;I+=m)x.push(new Oc(S+y,I+y,y,e));var P=tbe(e),T=new Oc(n+p/2,o+f/2,0,e);T.d>P.d&&(P=T);for(var M=x.length;x.length;){var w=x.pop();w.d>P.d&&(P=w,r&&console.log("found best %d after %d probes",Math.round(1e4*w.d)/1e4,M)),!(w.max-P.d<=t)&&(y=w.h/2,x.push(new Oc(w.x-y,w.y-y,y,e)),x.push(new Oc(w.x+y,w.y-y,y,e)),x.push(new Oc(w.x-y,w.y+y,y,e)),x.push(new Oc(w.x+y,w.y+y,y,e)),M+=4)}r&&(console.log("num probes: "+M),console.log("best distance: "+P.d));var E=[P.x,P.y];return E.distance=P.d,E}s(lz,"polylabel");function Qge(e,t){return t.max-e.max}s(Qge,"compareMax");function Oc(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=ebe(e,t,n),this.max=this.d+this.h*Math.SQRT2}s(Oc,"Cell");function ebe(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,p=c-1;l<c;p=l++){var f=a[l],m=a[p];f[1]>t!=m[1]>t&&e<(m[0]-f[0])*(t-f[1])/(m[1]-f[1])+f[0]&&(n=!n),o=Math.min(o,rbe(e,t,f,m))}return o===0?0:(n?1:-1)*Math.sqrt(o)}s(ebe,"pointToPolygonDist");function tbe(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],p=o[l],f=c[0]*p[1]-p[0]*c[1];r+=(c[0]+p[0])*f,n+=(c[1]+p[1])*f,t+=f*3}return t===0?new Oc(o[0][0],o[0][1],0,e):new Oc(r/t,n/t,0,e)}s(tbe,"getCentroidCell");function rbe(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(rbe,"getSegDistSq")});var zz=W((z4,H4)=>{d();(function(e,t){typeof z4=="object"&&typeof H4<"u"?H4.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(z4,function(){"use strict";function e(I,P,T,M,w){s(function E(B,D,F,L,H){for(;L>F;){if(L-F>600){var U=L-F+1,G=D-F+1,J=Math.log(U),X=.5*Math.exp(2*J/3),ie=.5*Math.sqrt(J*X*(U-X)/U)*(G-U/2<0?-1:1),ee=Math.max(F,Math.floor(D-G*X/U+ie)),ge=Math.min(L,Math.floor(D+(U-G)*X/U+ie));E(B,D,ee,ge,H)}var ve=B[D],pe=F,Ae=L;for(t(B,F,D),H(B[L],ve)>0&&t(B,F,L);pe<Ae;){for(t(B,pe,Ae),pe++,Ae--;H(B[pe],ve)<0;)pe++;for(;H(B[Ae],ve)>0;)Ae--}H(B[F],ve)===0?t(B,F,Ae):t(B,++Ae,L),Ae<=D&&(F=Ae+1),D<=Ae&&(L=Ae-1)}},"t")(I,P,T||0,M||I.length-1,w||r)}s(e,"t");function t(I,P,T){var M=I[P];I[P]=I[T],I[T]=M}s(t,"i");function r(I,P){return I<P?-1:I>P?1:0}s(r,"n");var n=s(function(I){I===void 0&&(I=9),this._maxEntries=Math.max(4,I),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function o(I,P,T){if(!T)return P.indexOf(I);for(var M=0;M<P.length;M++)if(T(I,P[M]))return M;return-1}s(o,"e");function i(I,P){a(I,0,I.children.length,P,I)}s(i,"a");function a(I,P,T,M,w){w||(w=x(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var E=P;E<T;E++){var B=I.children[E];l(w,I.leaf?M(B):B)}return w}s(a,"h");function l(I,P){return I.minX=Math.min(I.minX,P.minX),I.minY=Math.min(I.minY,P.minY),I.maxX=Math.max(I.maxX,P.maxX),I.maxY=Math.max(I.maxY,P.maxY),I}s(l,"o");function c(I,P){return I.minX-P.minX}s(c,"s");function p(I,P){return I.minY-P.minY}s(p,"l");function f(I){return(I.maxX-I.minX)*(I.maxY-I.minY)}s(f,"f");function m(I){return I.maxX-I.minX+(I.maxY-I.minY)}s(m,"u");function y(I,P){return I.minX<=P.minX&&I.minY<=P.minY&&P.maxX<=I.maxX&&P.maxY<=I.maxY}s(y,"m");function v(I,P){return P.minX<=I.maxX&&P.minY<=I.maxY&&P.maxX>=I.minX&&P.maxY>=I.minY}s(v,"c");function x(I){return{children:I,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}s(x,"p");function S(I,P,T,M,w){for(var E=[P,T];E.length;)if(!((T=E.pop())-(P=E.pop())<=M)){var B=P+Math.ceil((T-P)/M/2)*M;e(I,B,P,T,w),E.push(P,B,B,T)}}return s(S,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(I){var P=this.data,T=[];if(!v(I,P))return T;for(var M=this.toBBox,w=[];P;){for(var E=0;E<P.children.length;E++){var B=P.children[E],D=P.leaf?M(B):B;v(I,D)&&(P.leaf?T.push(B):y(I,D)?this._all(B,T):w.push(B))}P=w.pop()}return T},n.prototype.collides=function(I){var P=this.data;if(!v(I,P))return!1;for(var T=[];P;){for(var M=0;M<P.children.length;M++){var w=P.children[M],E=P.leaf?this.toBBox(w):w;if(v(I,E)){if(P.leaf||y(I,E))return!0;T.push(w)}}P=T.pop()}return!1},n.prototype.load=function(I){if(!I||!I.length)return this;if(I.length<this._minEntries){for(var P=0;P<I.length;P++)this.insert(I[P]);return this}var T=this._build(I.slice(),0,I.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var M=this.data;this.data=T,T=M}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},n.prototype.insert=function(I){return I&&this._insert(I,this.data.height-1),this},n.prototype.clear=function(){return this.data=x([]),this},n.prototype.remove=function(I,P){if(!I)return this;for(var T,M,w,E=this.data,B=this.toBBox(I),D=[],F=[];E||D.length;){if(E||(E=D.pop(),M=D[D.length-1],T=F.pop(),w=!0),E.leaf){var L=o(I,E.children,P);if(L!==-1)return E.children.splice(L,1),D.push(E),this._condense(D),this}w||E.leaf||!y(E,B)?M?(T++,E=M.children[T],w=!1):E=null:(D.push(E),F.push(T),T=0,M=E,E=E.children[0])}return this},n.prototype.toBBox=function(I){return I},n.prototype.compareMinX=function(I,P){return I.minX-P.minX},n.prototype.compareMinY=function(I,P){return I.minY-P.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(I){return this.data=I,this},n.prototype._all=function(I,P){for(var T=[];I;)I.leaf?P.push.apply(P,I.children):T.push.apply(T,I.children),I=T.pop();return P},n.prototype._build=function(I,P,T,M){var w,E=T-P+1,B=this._maxEntries;if(E<=B)return i(w=x(I.slice(P,T+1)),this.toBBox),w;M||(M=Math.ceil(Math.log(E)/Math.log(B)),B=Math.ceil(E/Math.pow(B,M-1))),(w=x([])).leaf=!1,w.height=M;var D=Math.ceil(E/B),F=D*Math.ceil(Math.sqrt(B));S(I,P,T,F,this.compareMinX);for(var L=P;L<=T;L+=F){var H=Math.min(L+F-1,T);S(I,L,H,D,this.compareMinY);for(var U=L;U<=H;U+=D){var G=Math.min(U+D-1,H);w.children.push(this._build(I,U,G,M-1))}}return i(w,this.toBBox),w},n.prototype._chooseSubtree=function(I,P,T,M){for(;M.push(P),!P.leaf&&M.length-1!==T;){for(var w=1/0,E=1/0,B=void 0,D=0;D<P.children.length;D++){var F=P.children[D],L=f(F),H=(U=I,G=F,(Math.max(G.maxX,U.maxX)-Math.min(G.minX,U.minX))*(Math.max(G.maxY,U.maxY)-Math.min(G.minY,U.minY))-L);H<E?(E=H,w=L<w?L:w,B=F):H===E&&L<w&&(w=L,B=F)}P=B||P.children[0]}var U,G;return P},n.prototype._insert=function(I,P,T){var M=T?I:this.toBBox(I),w=[],E=this._chooseSubtree(M,this.data,P,w);for(E.children.push(I),l(E,M);P>=0&&w[P].children.length>this._maxEntries;)this._split(w,P),P--;this._adjustParentBBoxes(M,w,P)},n.prototype._split=function(I,P){var T=I[P],M=T.children.length,w=this._minEntries;this._chooseSplitAxis(T,w,M);var E=this._chooseSplitIndex(T,w,M),B=x(T.children.splice(E,T.children.length-E));B.height=T.height,B.leaf=T.leaf,i(T,this.toBBox),i(B,this.toBBox),P?I[P-1].children.push(B):this._splitRoot(T,B)},n.prototype._splitRoot=function(I,P){this.data=x([I,P]),this.data.height=I.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(I,P,T){for(var M,w,E,B,D,F,L,H=1/0,U=1/0,G=P;G<=T-P;G++){var J=a(I,0,G,this.toBBox),X=a(I,G,T,this.toBBox),ie=(w=J,E=X,B=void 0,D=void 0,F=void 0,L=void 0,B=Math.max(w.minX,E.minX),D=Math.max(w.minY,E.minY),F=Math.min(w.maxX,E.maxX),L=Math.min(w.maxY,E.maxY),Math.max(0,F-B)*Math.max(0,L-D)),ee=f(J)+f(X);ie<H?(H=ie,M=G,U=ee<U?ee:U):ie===H&&ee<U&&(U=ee,M=G)}return M||T-P},n.prototype._chooseSplitAxis=function(I,P,T){var M=I.leaf?this.compareMinX:c,w=I.leaf?this.compareMinY:p;this._allDistMargin(I,P,T,M)<this._allDistMargin(I,P,T,w)&&I.children.sort(M)},n.prototype._allDistMargin=function(I,P,T,M){I.children.sort(M);for(var w=this.toBBox,E=a(I,0,P,w),B=a(I,T-P,T,w),D=m(E)+m(B),F=P;F<T-P;F++){var L=I.children[F];l(E,I.leaf?w(L):L),D+=m(E)}for(var H=T-P-1;H>=P;H--){var U=I.children[H];l(B,I.leaf?w(U):U),D+=m(B)}return D},n.prototype._adjustParentBBoxes=function(I,P,T){for(var M=T;M>=0;M--)l(P[M],I)},n.prototype._condense=function(I){for(var P=I.length-1,T=void 0;P>=0;P--)I[P].children.length===0?P>0?(T=I[P-1].children).splice(T.indexOf(I[P]),1):this.clear():i(I[P],this.toBBox)},n})});var Y4=W(De=>{"use strict";d();Object.defineProperty(De,"__esModule",{value:!0});De.earthRadius=63710088e-1;De.factors={centimeters:De.earthRadius*100,centimetres:De.earthRadius*100,degrees:De.earthRadius/111325,feet:De.earthRadius*3.28084,inches:De.earthRadius*39.37,kilometers:De.earthRadius/1e3,kilometres:De.earthRadius/1e3,meters:De.earthRadius,metres:De.earthRadius,miles:De.earthRadius/1609.344,millimeters:De.earthRadius*1e3,millimetres:De.earthRadius*1e3,nauticalmiles:De.earthRadius/1852,radians:1,yards:De.earthRadius*1.0936};De.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/De.earthRadius,yards:1.0936133};De.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 _c(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(_c,"feature");De.feature=_c;function Hbe(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return W4(t).geometry;case"LineString":return Z4(t).geometry;case"Polygon":return q4(t).geometry;case"MultiPoint":return Wz(t).geometry;case"MultiLineString":return Hz(t).geometry;case"MultiPolygon":return qz(t).geometry;default:throw new Error(e+" is invalid")}}s(Hbe,"geometry");De.geometry=Hbe;function W4(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(!u2(e[0])||!u2(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return _c(n,t,r)}s(W4,"point");De.point=W4;function Wbe(e,t,r){return r===void 0&&(r={}),p2(e.map(function(n){return W4(n,t)}),r)}s(Wbe,"points");De.points=Wbe;function q4(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 _c(l,t,r)}s(q4,"polygon");De.polygon=q4;function qbe(e,t,r){return r===void 0&&(r={}),p2(e.map(function(n){return q4(n,t)}),r)}s(qbe,"polygons");De.polygons=qbe;function Z4(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 _c(n,t,r)}s(Z4,"lineString");De.lineString=Z4;function Zbe(e,t,r){return r===void 0&&(r={}),p2(e.map(function(n){return Z4(n,t)}),r)}s(Zbe,"lineStrings");De.lineStrings=Zbe;function p2(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(p2,"featureCollection");De.featureCollection=p2;function Hz(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return _c(n,t,r)}s(Hz,"multiLineString");De.multiLineString=Hz;function Wz(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return _c(n,t,r)}s(Wz,"multiPoint");De.multiPoint=Wz;function qz(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return _c(n,t,r)}s(qz,"multiPolygon");De.multiPolygon=qz;function Xbe(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return _c(n,t,r)}s(Xbe,"geometryCollection");De.geometryCollection=Xbe;function Ybe(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(Ybe,"round");De.round=Ybe;function Zz(e,t){t===void 0&&(t="kilometers");var r=De.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}s(Zz,"radiansToLength");De.radiansToLength=Zz;function X4(e,t){t===void 0&&(t="kilometers");var r=De.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}s(X4,"lengthToRadians");De.lengthToRadians=X4;function Kbe(e,t){return Xz(X4(e,t))}s(Kbe,"lengthToDegrees");De.lengthToDegrees=Kbe;function Jbe(e){var t=e%360;return t<0&&(t+=360),t}s(Jbe,"bearingToAzimuth");De.bearingToAzimuth=Jbe;function Xz(e){var t=e%(2*Math.PI);return t*180/Math.PI}s(Xz,"radiansToDegrees");De.radiansToDegrees=Xz;function Qbe(e){var t=e%360;return t*Math.PI/180}s(Qbe,"degreesToRadians");De.degreesToRadians=Qbe;function e1e(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 Zz(X4(e,t),r)}s(e1e,"convertLength");De.convertLength=e1e;function t1e(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=De.areaFactors[t];if(!n)throw new Error("invalid original units");var o=De.areaFactors[r];if(!o)throw new Error("invalid final units");return e/n*o}s(t1e,"convertArea");De.convertArea=t1e;function u2(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}s(u2,"isNumber");De.isNumber=u2;function r1e(e){return!!e&&e.constructor===Object}s(r1e,"isObject");De.isObject=r1e;function n1e(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(!u2(t))throw new Error("bbox must only contain numbers")})}s(n1e,"validateBBox");De.validateBBox=n1e;function o1e(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(o1e,"validateId");De.validateId=o1e});var eH=W(Hr=>{"use strict";d();Object.defineProperty(Hr,"__esModule",{value:!0});var Dn=Y4();function $g(e,t,r){if(e!==null)for(var n,o,i,a,l,c,p,f=0,m=0,y,v=e.type,x=v==="FeatureCollection",S=v==="Feature",I=x?e.features.length:1,P=0;P<I;P++){p=x?e.features[P].geometry:S?e.geometry:e,y=p?p.type==="GeometryCollection":!1,l=y?p.geometries.length:1;for(var T=0;T<l;T++){var M=0,w=0;if(a=y?p.geometries[T]:p,a!==null){c=a.coordinates;var E=a.type;switch(f=r&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(c,m,P,M,w)===!1)return!1;m++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],m,P,M,w)===!1)return!1;m++,E==="MultiPoint"&&M++}E==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(t(c[n][o],m,P,M,w)===!1)return!1;m++}E==="MultiLineString"&&M++,E==="Polygon"&&w++}E==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(w=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(t(c[n][o][i],m,P,M,w)===!1)return!1;m++}w++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if($g(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s($g,"coordEach");function i1e(e,t,r,n){var o=r;return $g(e,function(i,a,l,c,p){a===0&&r===void 0?o=i:o=t(o,i,a,l,c,p)},n),o}s(i1e,"coordReduce");function Yz(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(Yz,"propEach");function s1e(e,t,r){var n=r;return Yz(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(s1e,"propReduce");function Kz(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(Kz,"featureEach");function a1e(e,t,r){var n=r;return Kz(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(a1e,"featureReduce");function l1e(e){var t=[];return $g(e,function(r){t.push(r)}),t}s(l1e,"coordAll");function K4(e,t){var r,n,o,i,a,l,c,p,f,m,y=0,v=e.type==="FeatureCollection",x=e.type==="Feature",S=v?e.features.length:1;for(r=0;r<S;r++){for(l=v?e.features[r].geometry:x?e.geometry:e,p=v?e.features[r].properties:x?e.properties:{},f=v?e.features[r].bbox:x?e.bbox:void 0,m=v?e.features[r].id:x?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,p,f,m)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,y,p,f,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],y,p,f,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}s(K4,"geomEach");function c1e(e,t,r){var n=r;return K4(e,function(o,i,a,l,c){i===0&&r===void 0?n=o:n=t(n,o,i,a,l,c)}),n}s(c1e,"geomReduce");function d2(e,t){K4(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 p=0;p<r.coordinates.length;p++){var f=r.coordinates[p],m={type:c,coordinates:f};if(t(Dn.feature(m,o),n,p)===!1)return!1}})}s(d2,"flattenEach");function u1e(e,t,r){var n=r;return d2(e,function(o,i,a){i===0&&a===0&&r===void 0?n=o:n=t(n,o,i,a)}),n}s(u1e,"flattenReduce");function Jz(e,t){d2(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,p=0,f=0;if($g(r,function(m,y,v,x,S){if(l===void 0||n>c||x>p||S>f){l=m,c=n,p=x,f=S,i=0;return}var I=Dn.lineString([l,m],r.properties);if(t(I,n,o,S,i)===!1)return!1;i++,l=m})===!1)return!1}}})}s(Jz,"segmentEach");function p1e(e,t,r){var n=r,o=!1;return Jz(e,function(i,a,l,c,p){o===!1&&r===void 0?n=i:n=t(n,i,a,l,c,p),o=!0}),n}s(p1e,"segmentReduce");function Qz(e,t){if(!e)throw new Error("geojson is required");d2(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(Qz,"lineEach");function d1e(e,t,r){var n=r;return Qz(e,function(o,i,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,a,l)}),n}s(d1e,"lineReduce");function f1e(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(f1e,"findSegment");function m1e(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(m1e,"findPoint");Hr.coordAll=l1e;Hr.coordEach=$g;Hr.coordReduce=i1e;Hr.featureEach=Kz;Hr.featureReduce=a1e;Hr.findPoint=m1e;Hr.findSegment=f1e;Hr.flattenEach=d2;Hr.flattenReduce=u1e;Hr.geomEach=K4;Hr.geomReduce=c1e;Hr.lineEach=Qz;Hr.lineReduce=d1e;Hr.propEach=Yz;Hr.propReduce=s1e;Hr.segmentEach=Jz;Hr.segmentReduce=p1e});var J4=W((tpt,rH)=>{"use strict";d();var tH=Object.prototype.toString;rH.exports=s(function(t){var r=tH.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&tH.call(t.callee)==="[object Function]"),n},"isArguments")});var pH=W((opt,uH)=>{"use strict";d();var cH;Object.keys||(jg=Object.prototype.hasOwnProperty,Q4=Object.prototype.toString,nH=J4(),e5=Object.prototype.propertyIsEnumerable,oH=!e5.call({toString:null},"toString"),iH=e5.call(function(){},"prototype"),Gg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f2=s(function(e){var t=e.constructor;return t&&t.prototype===e},"equalsConstructorPrototype"),sH={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},aH=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!sH["$"+e]&&jg.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{f2(window[e])}catch{return!0}}catch{return!0}return!1}(),lH=s(function(e){if(typeof window>"u"||!aH)return f2(e);try{return f2(e)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),cH=s(function(t){var r=t!==null&&typeof t=="object",n=Q4.call(t)==="[object Function]",o=nH(t),i=r&&Q4.call(t)==="[object String]",a=[];if(!r&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var l=iH&&n;if(i&&t.length>0&&!jg.call(t,0))for(var c=0;c<t.length;++c)a.push(String(c));if(o&&t.length>0)for(var p=0;p<t.length;++p)a.push(String(p));else for(var f in t)!(l&&f==="prototype")&&jg.call(t,f)&&a.push(String(f));if(oH)for(var m=lH(t),y=0;y<Gg.length;++y)!(m&&Gg[y]==="constructor")&&jg.call(t,Gg[y])&&a.push(Gg[y]);return a},"keys"));var jg,Q4,nH,e5,oH,iH,Gg,f2,sH,aH,lH;uH.exports=cH});var h2=W((apt,mH)=>{"use strict";d();var h1e=Array.prototype.slice,y1e=J4(),dH=Object.keys,m2=dH?s(function(t){return dH(t)},"keys"):pH(),fH=Object.keys;m2.shim=s(function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=s(function(n){return y1e(n)?fH(h1e.call(n)):fH(n)},"keys"))}else Object.keys=m2;return Object.keys||m2},"shimObjectKeys");mH.exports=m2});var yH=W((upt,hH)=>{"use strict";d();hH.exports=Error});var bH=W((dpt,gH)=>{"use strict";d();gH.exports=EvalError});var xH=W((mpt,vH)=>{"use strict";d();vH.exports=RangeError});var SH=W((ypt,IH)=>{"use strict";d();IH.exports=ReferenceError});var t5=W((bpt,CH)=>{"use strict";d();CH.exports=SyntaxError});var hl=W((xpt,PH)=>{"use strict";d();PH.exports=TypeError});var wH=W((Spt,TH)=>{"use strict";d();TH.exports=URIError});var Ug=W((Ppt,MH)=>{"use strict";d();MH.exports=s(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==o||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var y2=W((Mpt,EH)=>{"use strict";d();var OH=typeof Symbol<"u"&&Symbol,g1e=Ug();EH.exports=s(function(){return typeof OH!="function"||typeof Symbol!="function"||typeof OH("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g1e()},"hasNativeSymbols")});var AH=W((_pt,_H)=>{"use strict";d();var r5={__proto__:null,foo:{}},b1e=Object;_H.exports=s(function(){return{__proto__:r5}.foo===r5.foo&&!(r5 instanceof b1e)},"hasProto")});var FH=W((Dpt,DH)=>{"use strict";d();var v1e="Function.prototype.bind called on incompatible ",x1e=Object.prototype.toString,I1e=Math.max,S1e="[object Function]",kH=s(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),C1e=s(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),P1e=s(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");DH.exports=s(function(t){var r=this;if(typeof r!="function"||x1e.apply(r)!==S1e)throw new TypeError(v1e+r);for(var n=C1e(arguments,1),o,i=s(function(){if(this instanceof o){var f=r.apply(this,kH(n,arguments));return Object(f)===f?f:this}return r.apply(t,kH(n,arguments))},"binder"),a=I1e(0,r.length-n.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(o=Function("binder","return function ("+P1e(l,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var p=s(function(){},"Empty");p.prototype=r.prototype,o.prototype=new p,p.prototype=null}return o},"bind")});var g2=W((Rpt,LH)=>{"use strict";d();var T1e=FH();LH.exports=Function.prototype.bind||T1e});var n5=W((Bpt,RH)=>{"use strict";d();var w1e=Function.prototype.call,M1e=Object.prototype.hasOwnProperty,O1e=g2();RH.exports=O1e.call(w1e,M1e)});var es=W((jpt,GH)=>{"use strict";d();var st,E1e=yH(),_1e=bH(),A1e=xH(),k1e=SH(),Cm=t5(),Sm=hl(),D1e=wH(),jH=Function,o5=s(function(e){try{return jH('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Ip=Object.getOwnPropertyDescriptor;if(Ip)try{Ip({},"")}catch{Ip=null}var i5=s(function(){throw new Sm},"throwTypeError"),F1e=Ip?function(){try{return arguments.callee,i5}catch{try{return Ip(arguments,"callee").get}catch{return i5}}}():i5,xm=y2()(),L1e=AH()(),tn=Object.getPrototypeOf||(L1e?function(e){return e.__proto__}:null),Im={},R1e=typeof Uint8Array>"u"||!tn?st:tn(Uint8Array),Sp={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?st:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?st:ArrayBuffer,"%ArrayIteratorPrototype%":xm&&tn?tn([][Symbol.iterator]()):st,"%AsyncFromSyncIteratorPrototype%":st,"%AsyncFunction%":Im,"%AsyncGenerator%":Im,"%AsyncGeneratorFunction%":Im,"%AsyncIteratorPrototype%":Im,"%Atomics%":typeof Atomics>"u"?st:Atomics,"%BigInt%":typeof BigInt>"u"?st:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?st:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?st:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?st:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":E1e,"%eval%":eval,"%EvalError%":_1e,"%Float32Array%":typeof Float32Array>"u"?st:Float32Array,"%Float64Array%":typeof Float64Array>"u"?st:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?st:FinalizationRegistry,"%Function%":jH,"%GeneratorFunction%":Im,"%Int8Array%":typeof Int8Array>"u"?st:Int8Array,"%Int16Array%":typeof Int16Array>"u"?st:Int16Array,"%Int32Array%":typeof Int32Array>"u"?st:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xm&&tn?tn(tn([][Symbol.iterator]())):st,"%JSON%":typeof JSON=="object"?JSON:st,"%Map%":typeof Map>"u"?st:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xm||!tn?st:tn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?st:Promise,"%Proxy%":typeof Proxy>"u"?st:Proxy,"%RangeError%":A1e,"%ReferenceError%":k1e,"%Reflect%":typeof Reflect>"u"?st:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?st:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xm||!tn?st:tn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?st:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xm&&tn?tn(""[Symbol.iterator]()):st,"%Symbol%":xm?Symbol:st,"%SyntaxError%":Cm,"%ThrowTypeError%":F1e,"%TypedArray%":R1e,"%TypeError%":Sm,"%Uint8Array%":typeof Uint8Array>"u"?st:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?st:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?st:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?st:Uint32Array,"%URIError%":D1e,"%WeakMap%":typeof WeakMap>"u"?st:WeakMap,"%WeakRef%":typeof WeakRef>"u"?st:WeakRef,"%WeakSet%":typeof WeakSet>"u"?st:WeakSet};if(tn)try{null.error}catch(e){NH=tn(tn(e)),Sp["%Error.prototype%"]=NH}var NH,N1e=s(function e(t){var r;if(t==="%AsyncFunction%")r=o5("async function () {}");else if(t==="%GeneratorFunction%")r=o5("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=o5("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&tn&&(r=tn(o.prototype))}return Sp[t]=r,r},"doEval"),BH={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Vg=g2(),b2=n5(),B1e=Vg.call(Function.call,Array.prototype.concat),$1e=Vg.call(Function.apply,Array.prototype.splice),$H=Vg.call(Function.call,String.prototype.replace),v2=Vg.call(Function.call,String.prototype.slice),j1e=Vg.call(Function.call,RegExp.prototype.exec),G1e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U1e=/\\(\\)?/g,V1e=s(function(t){var r=v2(t,0,1),n=v2(t,-1);if(r==="%"&&n!=="%")throw new Cm("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Cm("invalid intrinsic syntax, expected opening `%`");var o=[];return $H(t,G1e,function(i,a,l,c){o[o.length]=l?$H(c,U1e,"$1"):a||i}),o},"stringToPath"),z1e=s(function(t,r){var n=t,o;if(b2(BH,n)&&(o=BH[n],n="%"+o[0]+"%"),b2(Sp,n)){var i=Sp[n];if(i===Im&&(i=N1e(n)),typeof i>"u"&&!r)throw new Sm("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Cm("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");GH.exports=s(function(t,r){if(typeof t!="string"||t.length===0)throw new Sm("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Sm('"allowMissing" argument must be a boolean');if(j1e(/^%?[^%]*%?$/,t)===null)throw new Cm("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=V1e(t),o=n.length>0?n[0]:"",i=z1e("%"+o+"%",r),a=i.name,l=i.value,c=!1,p=i.alias;p&&(o=p[0],$1e(n,B1e([0,1],p)));for(var f=1,m=!0;f<n.length;f+=1){var y=n[f],v=v2(y,0,1),x=v2(y,-1);if((v==='"'||v==="'"||v==="`"||x==='"'||x==="'"||x==="`")&&v!==x)throw new Cm("property names with quotes must have matching quotes");if((y==="constructor"||!m)&&(c=!0),o+="."+y,a="%"+o+"%",b2(Sp,a))l=Sp[a];else if(l!=null){if(!(y in l)){if(!r)throw new Sm("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ip&&f+1>=n.length){var S=Ip(l,y);m=!!S,m&&"get"in S&&!("originalValue"in S.get)?l=S.get:l=l[y]}else m=b2(l,y),l=l[y];m&&!c&&(Sp[a]=l)}}return l},"GetIntrinsic")});var I2=W((Vpt,UH)=>{"use strict";d();var H1e=es(),x2=H1e("%Object.defineProperty%",!0)||!1;if(x2)try{x2({},"a",{value:1})}catch{x2=!1}UH.exports=x2});var C2=W((Hpt,VH)=>{"use strict";d();var W1e=es(),S2=W1e("%Object.getOwnPropertyDescriptor%",!0);if(S2)try{S2([],"length")}catch{S2=null}VH.exports=S2});var P2=W((qpt,WH)=>{"use strict";d();var zH=I2(),q1e=t5(),Pm=hl(),HH=C2();WH.exports=s(function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Pm("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Pm("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Pm("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Pm("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Pm("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Pm("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!HH&&HH(t,r);if(zH)zH(t,r,{configurable:a===null&&c?c.configurable:!a,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:i===null&&c?c.writable:!i});else if(l||!o&&!i&&!a)t[r]=n;else throw new q1e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var T2=W((Ypt,ZH)=>{"use strict";d();var s5=I2(),qH=s(function(){return!!s5},"hasPropertyDescriptors");qH.hasArrayLengthDefineBug=s(function(){if(!s5)return null;try{return s5([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");ZH.exports=qH});var Ac=W((Qpt,JH)=>{"use strict";d();var Z1e=h2(),X1e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Y1e=Object.prototype.toString,K1e=Array.prototype.concat,XH=P2(),J1e=s(function(e){return typeof e=="function"&&Y1e.call(e)==="[object Function]"},"isFunction"),YH=T2()(),Q1e=s(function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!J1e(n)||!n())return}YH?XH(e,t,r,!0):XH(e,t,r)},"defineProperty"),KH=s(function(e,t){var r=arguments.length>2?arguments[2]:{},n=Z1e(t);X1e&&(n=K1e.call(n,Object.getOwnPropertySymbols(t)));for(var o=0;o<n.length;o+=1)Q1e(e,n[o],t[n[o]],r[n[o]])},"defineProperties");KH.supportsDescriptors=!!YH;JH.exports=KH});var nW=W((rdt,rW)=>{"use strict";d();var e0e=es(),QH=P2(),t0e=T2()(),eW=C2(),tW=hl(),r0e=e0e("%Math.floor%");rW.exports=s(function(t,r){if(typeof t!="function")throw new tW("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||r0e(r)!==r)throw new tW("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in t&&eW){var a=eW(t,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(i=!1)}return(o||i||!n)&&(t0e?QH(t,"length",r,!0,!0):QH(t,"length",r)),t},"setFunctionLength")});var Cp=W((idt,w2)=>{"use strict";d();var a5=g2(),M2=es(),n0e=nW(),o0e=hl(),sW=M2("%Function.prototype.apply%"),aW=M2("%Function.prototype.call%"),lW=M2("%Reflect.apply%",!0)||a5.call(aW,sW),oW=I2(),i0e=M2("%Math.max%");w2.exports=s(function(t){if(typeof t!="function")throw new o0e("a function is required");var r=lW(a5,aW,arguments);return n0e(r,1+i0e(0,t.length-(arguments.length-1)),!0)},"callBind");var iW=s(function(){return lW(a5,sW,arguments)},"applyBind");oW?oW(w2.exports,"apply",{value:iW}):w2.exports.apply=iW});var Bo=W((ldt,pW)=>{"use strict";d();var cW=es(),uW=Cp(),s0e=uW(cW("String.prototype.indexOf"));pW.exports=s(function(t,r){var n=cW(t,!!r);return typeof n=="function"&&s0e(t,".prototype.")>-1?uW(n):n},"callBoundIntrinsic")});var l5=W((pdt,yW)=>{"use strict";d();var a0e=h2(),mW=Ug()(),hW=Bo(),dW=Object,l0e=hW("Array.prototype.push"),fW=hW("Object.prototype.propertyIsEnumerable"),c0e=mW?Object.getOwnPropertySymbols:null;yW.exports=s(function(t,r){if(t==null)throw new TypeError("target must be an object");var n=dW(t);if(arguments.length===1)return n;for(var o=1;o<arguments.length;++o){var i=dW(arguments[o]),a=a0e(i),l=mW&&(Object.getOwnPropertySymbols||c0e);if(l)for(var c=l(i),p=0;p<c.length;++p){var f=c[p];fW(i,f)&&l0e(a,f)}for(var m=0;m<a.length;++m){var y=a[m];if(fW(i,y)){var v=i[y];n[y]=v}}}return n},"assign")});var u5=W((mdt,gW)=>{"use strict";d();var c5=l5(),u0e=s(function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var a in o)i+=a;return e!==i},"lacksProperEnumerationOrder"),p0e=s(function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch{return e[1]==="y"}return!1},"assignHasPendingExceptions");gW.exports=s(function(){return!Object.assign||u0e()||p0e()?c5:Object.assign},"getPolyfill")});var vW=W((gdt,bW)=>{"use strict";d();var d0e=Ac(),f0e=u5();bW.exports=s(function(){var t=f0e();return d0e(Object,{assign:t},{assign:s(function(){return Object.assign!==t},"assign")}),t},"shimAssign")});var CW=W((xdt,SW)=>{"use strict";d();var m0e=Ac(),h0e=Cp(),y0e=l5(),xW=u5(),g0e=vW(),b0e=h0e.apply(xW()),IW=s(function(t,r){return b0e(Object,arguments)},"assign");m0e(IW,{getPolyfill:xW,implementation:y0e,shim:g0e});SW.exports=IW});var TW=W((Cdt,PW)=>{"use strict";d();var Hg=s(function(){return typeof s(function(){},"f").name=="string"},"functionsHaveNames"),zg=Object.getOwnPropertyDescriptor;if(zg)try{zg([],"length")}catch{zg=null}Hg.functionsHaveConfigurableNames=s(function(){if(!Hg()||!zg)return!1;var t=zg(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var v0e=Function.prototype.bind;Hg.boundFunctionsHaveNames=s(function(){return Hg()&&typeof v0e=="function"&&s(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");PW.exports=Hg});var OW=W((wdt,MW)=>{"use strict";d();var wW=P2(),x0e=T2()(),I0e=TW().functionsHaveConfigurableNames(),S0e=hl();MW.exports=s(function(t,r){if(typeof t!="function")throw new S0e("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||I0e)&&(x0e?wW(t,"name",r,!0,!0):wW(t,"name",r)),t},"setFunctionName")});var p5=W((Edt,EW)=>{"use strict";d();var C0e=OW(),P0e=hl(),T0e=Object;EW.exports=C0e(s(function(){if(this==null||this!==T0e(this))throw new P0e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var d5=W((kdt,_W)=>{"use strict";d();var w0e=p5(),M0e=Ac().supportsDescriptors,O0e=Object.getOwnPropertyDescriptor;_W.exports=s(function(){if(M0e&&/a/mig.flags==="gim"){var t=O0e(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:s(function(){r+="d"},"get")}),Object.defineProperty(n,"sticky",{get:s(function(){r+="y"},"get")}),r==="dy")return t.get}}return w0e},"getPolyfill")});var DW=W((Ldt,kW)=>{"use strict";d();var E0e=Ac().supportsDescriptors,_0e=d5(),A0e=Object.getOwnPropertyDescriptor,k0e=Object.defineProperty,D0e=TypeError,AW=Object.getPrototypeOf,F0e=/a/;kW.exports=s(function(){if(!E0e||!AW)throw new D0e("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=_0e(),r=AW(F0e),n=A0e(r,"flags");return(!n||n.get!==t)&&k0e(r,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var NW=W((Bdt,RW)=>{"use strict";d();var L0e=Ac(),R0e=Cp(),N0e=p5(),FW=d5(),B0e=DW(),LW=R0e(FW());L0e(LW,{getPolyfill:FW,implementation:N0e,shim:B0e});RW.exports=LW});var kc=W((jdt,BW)=>{"use strict";d();var $0e=Ug();BW.exports=s(function(){return $0e()&&!!Symbol.toStringTag},"hasToStringTagShams")});var m5=W((Vdt,jW)=>{"use strict";d();var j0e=kc()(),G0e=Bo(),f5=G0e("Object.prototype.toString"),O2=s(function(t){return j0e&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:f5(t)==="[object Arguments]"},"isArguments"),$W=s(function(t){return O2(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&f5(t)!=="[object Array]"&&f5(t.callee)==="[object Function]"},"isArguments"),U0e=function(){return O2(arguments)}();O2.isLegacyArguments=$W;jW.exports=U0e?O2:$W});var GW=W(()=>{d()});var aq=W((Xdt,sq)=>{d();var P5=typeof Map=="function"&&Map.prototype,h5=Object.getOwnPropertyDescriptor&&P5?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,_2=P5&&h5&&typeof h5.get=="function"?h5.get:null,UW=P5&&Map.prototype.forEach,T5=typeof Set=="function"&&Set.prototype,y5=Object.getOwnPropertyDescriptor&&T5?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,A2=T5&&y5&&typeof y5.get=="function"?y5.get:null,VW=T5&&Set.prototype.forEach,V0e=typeof WeakMap=="function"&&WeakMap.prototype,qg=V0e?WeakMap.prototype.has:null,z0e=typeof WeakSet=="function"&&WeakSet.prototype,Zg=z0e?WeakSet.prototype.has:null,H0e=typeof WeakRef=="function"&&WeakRef.prototype,zW=H0e?WeakRef.prototype.deref:null,W0e=Boolean.prototype.valueOf,q0e=Object.prototype.toString,Z0e=Function.prototype.toString,X0e=String.prototype.match,w5=String.prototype.slice,Fc=String.prototype.replace,Y0e=String.prototype.toUpperCase,HW=String.prototype.toLowerCase,eq=RegExp.prototype.test,WW=Array.prototype.concat,ta=Array.prototype.join,K0e=Array.prototype.slice,qW=Math.floor,v5=typeof BigInt=="function"?BigInt.prototype.valueOf:null,g5=Object.getOwnPropertySymbols,x5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Tm||!0)?Symbol.toStringTag:null,tq=Object.prototype.propertyIsEnumerable,ZW=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function XW(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||eq.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-qW(-e):qW(e);if(n!==e){var o=String(n),i=w5.call(t,o.length+1);return Fc.call(o,r,"$&_")+"."+Fc.call(Fc.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Fc.call(t,r,"$&_")}s(XW,"addNumericSeparator");var I5=GW(),YW=I5.custom,KW=nq(YW)?YW:null;sq.exports=s(function e(t,r,n,o){var i=r||{};if(Dc(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Dc(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Dc(i,"customInspect")?i.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Dc(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Dc(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return iq(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?XW(t,c):c}if(typeof t=="bigint"){var p=String(t)+"n";return l?XW(t,p):p}var f=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof t=="object")return S5(t)?"[Array]":"[Object]";var m=hve(i,n);if(typeof o>"u")o=[];else if(oq(o,t)>=0)return"[Circular]";function y(J,X,ie){if(X&&(o=K0e.call(o),o.push(X)),ie){var ee={depth:i.depth};return Dc(i,"quoteStyle")&&(ee.quoteStyle=i.quoteStyle),e(J,ee,n+1,o)}return e(J,i,n+1,o)}if(s(y,"inspect"),typeof t=="function"&&!JW(t)){var v=sve(t),x=E2(t,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(x.length>0?" { "+ta.call(x,", ")+" }":"")}if(nq(t)){var S=Tm?Fc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):x5.call(t);return typeof t=="object"&&!Tm?Wg(S):S}if(dve(t)){for(var I="<"+HW.call(String(t.nodeName)),P=t.attributes||[],T=0;T<P.length;T++)I+=" "+P[T].name+"="+rq(J0e(P[T].value),"double",i);return I+=">",t.childNodes&&t.childNodes.length&&(I+="..."),I+="</"+HW.call(String(t.nodeName))+">",I}if(S5(t)){if(t.length===0)return"[]";var M=E2(t,y);return m&&!mve(M)?"["+C5(M,m)+"]":"[ "+ta.call(M,", ")+" ]"}if(eve(t)){var w=E2(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!tq.call(t,"cause")?"{ ["+String(t)+"] "+ta.call(WW.call("[cause]: "+y(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ta.call(w,", ")+" }"}if(typeof t=="object"&&a){if(KW&&typeof t[KW]=="function"&&I5)return I5(t,{depth:f-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(ave(t)){var E=[];return UW&&UW.call(t,function(J,X){E.push(y(X,t,!0)+" => "+y(J,t))}),QW("Map",_2.call(t),E,m)}if(uve(t)){var B=[];return VW&&VW.call(t,function(J){B.push(y(J,t))}),QW("Set",A2.call(t),B,m)}if(lve(t))return b5("WeakMap");if(pve(t))return b5("WeakSet");if(cve(t))return b5("WeakRef");if(rve(t))return Wg(y(Number(t)));if(ove(t))return Wg(y(v5.call(t)));if(nve(t))return Wg(W0e.call(t));if(tve(t))return Wg(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!Q0e(t)&&!JW(t)){var D=E2(t,y),F=ZW?ZW(t)===Object.prototype:t instanceof Object||t.constructor===Object,L=t instanceof Object?"":"null prototype",H=!F&&Fn&&Object(t)===t&&Fn in t?w5.call(Lc(t),8,-1):L?"Object":"",U=F||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",G=U+(H||L?"["+ta.call(WW.call([],H||[],L||[]),": ")+"] ":"");return D.length===0?G+"{}":m?G+"{"+C5(D,m)+"}":G+"{ "+ta.call(D,", ")+" }"}return String(t)},"inspect_");function rq(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}s(rq,"wrapQuotes");function J0e(e){return Fc.call(String(e),/"/g,"&quot;")}s(J0e,"quote");function S5(e){return Lc(e)==="[object Array]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(S5,"isArray");function Q0e(e){return Lc(e)==="[object Date]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(Q0e,"isDate");function JW(e){return Lc(e)==="[object RegExp]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(JW,"isRegExp");function eve(e){return Lc(e)==="[object Error]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(eve,"isError");function tve(e){return Lc(e)==="[object String]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(tve,"isString");function rve(e){return Lc(e)==="[object Number]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(rve,"isNumber");function nve(e){return Lc(e)==="[object Boolean]"&&(!Fn||!(typeof e=="object"&&Fn in e))}s(nve,"isBoolean");function nq(e){if(Tm)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!x5)return!1;try{return x5.call(e),!0}catch{}return!1}s(nq,"isSymbol");function ove(e){if(!e||typeof e!="object"||!v5)return!1;try{return v5.call(e),!0}catch{}return!1}s(ove,"isBigInt");var ive=Object.prototype.hasOwnProperty||function(e){return e in this};function Dc(e,t){return ive.call(e,t)}s(Dc,"has");function Lc(e){return q0e.call(e)}s(Lc,"toStr");function sve(e){if(e.name)return e.name;var t=X0e.call(Z0e.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}s(sve,"nameOf");function oq(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}s(oq,"indexOf");function ave(e){if(!_2||!e||typeof e!="object")return!1;try{_2.call(e);try{A2.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}s(ave,"isMap");function lve(e){if(!qg||!e||typeof e!="object")return!1;try{qg.call(e,qg);try{Zg.call(e,Zg)}catch{return!0}return e instanceof WeakMap}catch{}return!1}s(lve,"isWeakMap");function cve(e){if(!zW||!e||typeof e!="object")return!1;try{return zW.call(e),!0}catch{}return!1}s(cve,"isWeakRef");function uve(e){if(!A2||!e||typeof e!="object")return!1;try{A2.call(e);try{_2.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}s(uve,"isSet");function pve(e){if(!Zg||!e||typeof e!="object")return!1;try{Zg.call(e,Zg);try{qg.call(e,qg)}catch{return!0}return e instanceof WeakSet}catch{}return!1}s(pve,"isWeakSet");function dve(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}s(dve,"isElement");function iq(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return iq(w5.call(e,0,t.maxStringLength),t)+n}var o=Fc.call(Fc.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fve);return rq(o,"single",t)}s(iq,"inspectString");function fve(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+Y0e.call(t.toString(16))}s(fve,"lowbyte");function Wg(e){return"Object("+e+")"}s(Wg,"markBoxed");function b5(e){return e+" { ? }"}s(b5,"weakCollectionOf");function QW(e,t,r,n){var o=n?C5(r,n):ta.call(r,", ");return e+" ("+t+") {"+o+"}"}s(QW,"collectionOf");function mve(e){for(var t=0;t<e.length;t++)if(oq(e[t],"\n")>=0)return!1;return!0}s(mve,"singleLineValues");function hve(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=ta.call(Array(e.indent+1)," ");else return null;return{base:r,prev:ta.call(Array(t+1),r)}}s(hve,"getIndent");function C5(e,t){if(e.length===0)return"";var r="\n"+t.prev+t.base;return r+ta.call(e,","+r)+"\n"+t.prev}s(C5,"indentedJoin");function E2(e,t){var r=S5(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=Dc(e,o)?t(e[o],e):""}var i=typeof g5=="function"?g5(e):[],a;if(Tm){a={};for(var l=0;l<i.length;l++)a["$"+i[l]]=i[l]}for(var c in e)Dc(e,c)&&(r&&String(Number(c))===c&&c<e.length||Tm&&a["$"+c]instanceof Symbol||(eq.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if(typeof g5=="function")for(var p=0;p<i.length;p++)tq.call(e,i[p])&&n.push("["+t(i[p])+"]: "+t(e[i[p]],e));return n}s(E2,"arrObjKeys")});var O5=W((Jdt,cq)=>{"use strict";d();var lq=es(),wm=Bo(),yve=aq(),gve=hl(),k2=lq("%WeakMap%",!0),D2=lq("%Map%",!0),bve=wm("WeakMap.prototype.get",!0),vve=wm("WeakMap.prototype.set",!0),xve=wm("WeakMap.prototype.has",!0),Ive=wm("Map.prototype.get",!0),Sve=wm("Map.prototype.set",!0),Cve=wm("Map.prototype.has",!0),M5=s(function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},"listGetNode"),Pve=s(function(e,t){var r=M5(e,t);return r&&r.value},"listGet"),Tve=s(function(e,t,r){var n=M5(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},"listSet"),wve=s(function(e,t){return!!M5(e,t)},"listHas");cq.exports=s(function(){var t,r,n,o={assert:s(function(i){if(!o.has(i))throw new gve("Side channel does not contain "+yve(i))},"assert"),get:s(function(i){if(k2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return bve(t,i)}else if(D2){if(r)return Ive(r,i)}else if(n)return Pve(n,i)},"get"),has:s(function(i){if(k2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return xve(t,i)}else if(D2){if(r)return Cve(r,i)}else if(n)return wve(n,i);return!1},"has"),set:s(function(i,a){k2&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new k2),vve(t,i,a)):D2?(r||(r=new D2),Sve(r,i,a)):(n||(n={key:{},next:null}),Tve(n,i,a))},"set")};return o},"getSideChannel")});var pq=W((tft,uq)=>{"use strict";d();var Mve=n5(),Xg=O5()(),yl=hl(),E5={assert:s(function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");if(Xg.assert(e),!E5.has(e,t))throw new yl("`"+t+"` is not present on `O`")},"assert"),get:s(function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");var r=Xg.get(e);return r&&r["$"+t]},"get"),has:s(function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");var r=Xg.get(e);return!!r&&Mve(r,"$"+t)},"has"),set:s(function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new yl("`O` is not an object");if(typeof t!="string")throw new yl("`slot` must be a string");var n=Xg.get(e);n||(n={},Xg.set(e,n)),n["$"+t]=r},"set")};Object.freeze&&Object.freeze(E5);uq.exports=E5});var mq=W((oft,fq)=>{"use strict";d();var Yg=pq(),Ove=SyntaxError,dq=typeof StopIteration=="object"?StopIteration:null;fq.exports=s(function(t){if(!dq)throw new Ove("this environment lacks StopIteration");Yg.set(t,"[[Done]]",!1);var r={next:s(function(){var o=Yg.get(this,"[[Iterator]]"),i=Yg.get(o,"[[Done]]");try{return{done:i,value:i?void 0:o.next()}}catch(a){if(Yg.set(o,"[[Done]]",!0),a!==dq)throw a;return{done:!0,value:void 0}}},"next")};return Yg.set(r,"[[Iterator]]",t),r},"getStopIterationIterator")});var _5=W((aft,hq)=>{d();var Eve={}.toString;hq.exports=Array.isArray||function(e){return Eve.call(e)=="[object Array]"}});var A5=W((cft,yq)=>{"use strict";d();var _ve=String.prototype.valueOf,Ave=s(function(t){try{return _ve.call(t),!0}catch{return!1}},"tryStringObject"),kve=Object.prototype.toString,Dve="[object String]",Fve=kc()();yq.exports=s(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:Fve?Ave(t):kve.call(t)===Dve},"isString")});var D5=W((dft,vq)=>{"use strict";d();var k5=typeof Map=="function"&&Map.prototype?Map:null,Lve=typeof Set=="function"&&Set.prototype?Set:null,F2;k5||(F2=s(function(t){return!1},"isMap"));var bq=k5?Map.prototype.has:null,gq=Lve?Set.prototype.has:null;!F2&&!bq&&(F2=s(function(t){return!1},"isMap"));vq.exports=F2||s(function(t){if(!t||typeof t!="object")return!1;try{if(bq.call(t),gq)try{gq.call(t)}catch{return!0}return t instanceof k5}catch{}return!1},"isMap")});var L5=W((hft,Sq)=>{"use strict";d();var Rve=typeof Map=="function"&&Map.prototype?Map:null,F5=typeof Set=="function"&&Set.prototype?Set:null,L2;F5||(L2=s(function(t){return!1},"isSet"));var xq=Rve?Map.prototype.has:null,Iq=F5?Set.prototype.has:null;!L2&&!Iq&&(L2=s(function(t){return!1},"isSet"));Sq.exports=L2||s(function(t){if(!t||typeof t!="object")return!1;try{if(Iq.call(t),xq)try{xq.call(t)}catch{return!0}return t instanceof F5}catch{}return!1},"isSet")});var Fq=W((bft,B2)=>{"use strict";d();var Cq=m5(),Pq=mq();y2()()||Ug()()?(R2=Symbol.iterator,B2.exports=s(function(t){if(t!=null&&typeof t[R2]<"u")return t[R2]();if(Cq(t))return Array.prototype[R2].call(t)},"getIterator")):(Tq=_5(),wq=A5(),R5=es(),Mq=R5("%Map%",!0),Oq=R5("%Set%",!0),bi=Bo(),N5=bi("Array.prototype.push"),B5=bi("String.prototype.charCodeAt"),Eq=bi("String.prototype.slice"),_q=s(function(t,r){var n=t.length;if(r+1>=n)return r+1;var o=B5(t,r);if(o<55296||o>56319)return r+1;var i=B5(t,r+1);return i<56320||i>57343?r+1:r+2},"advanceStringIndex"),N2=s(function(t){var r=0;return{next:s(function(){var o=r>=t.length,i;return o||(i=t[r],r+=1),{done:o,value:i}},"next")}},"getArrayIterator"),$5=s(function(t,r){if(Tq(t)||Cq(t))return N2(t);if(wq(t)){var n=0;return{next:s(function(){var i=_q(t,n),a=Eq(t,n,i);return n=i,{done:i>t.length,value:a}},"next")}}if(r&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},"getNonCollectionIterator"),!Mq&&!Oq?B2.exports=s(function(t){if(t!=null)return $5(t,!0)},"getIterator"):(Aq=D5(),kq=L5(),j5=bi("Map.prototype.forEach",!0),G5=bi("Set.prototype.forEach",!0),(typeof b>"u"||!b.versions||!b.versions.node)&&(U5=bi("Map.prototype.iterator",!0),V5=bi("Set.prototype.iterator",!0)),z5=bi("Map.prototype.@@iterator",!0)||bi("Map.prototype._es6-shim iterator_",!0),H5=bi("Set.prototype.@@iterator",!0)||bi("Set.prototype._es6-shim iterator_",!0),Dq=s(function(t){if(Aq(t)){if(U5)return Pq(U5(t));if(z5)return z5(t);if(j5){var r=[];return j5(t,function(o,i){N5(r,[i,o])}),N2(r)}}if(kq(t)){if(V5)return Pq(V5(t));if(H5)return H5(t);if(G5){var n=[];return G5(t,function(o){N5(n,o)}),N2(n)}}},"getCollectionIterator"),B2.exports=s(function(t){return Dq(t)||$5(t)},"getIterator")));var R2,Tq,wq,R5,Mq,Oq,bi,N5,B5,Eq,_q,N2,$5,Aq,kq,j5,G5,U5,V5,z5,H5,Dq});var W5=W((Ift,Rq)=>{"use strict";d();var Lq=s(function(e){return e!==e},"numberIsNaN");Rq.exports=s(function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||Lq(t)&&Lq(r))},"is")});var q5=W((Pft,Nq)=>{"use strict";d();var Nve=W5();Nq.exports=s(function(){return typeof Object.is=="function"?Object.is:Nve},"getPolyfill")});var $q=W((Mft,Bq)=>{"use strict";d();var Bve=q5(),$ve=Ac();Bq.exports=s(function(){var t=Bve();return $ve(Object,{is:t},{is:s(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var Vq=W((_ft,Uq)=>{"use strict";d();var jve=Ac(),Gve=Cp(),Uve=W5(),jq=q5(),Vve=$q(),Gq=Gve(jq(),Object);jve(Gq,{getPolyfill:jq,implementation:Uve,shim:Vve});Uq.exports=Gq});var X5=W((kft,qq)=>{"use strict";d();var zve=Cp(),Wq=Bo(),Hve=es(),Z5=Hve("%ArrayBuffer%",!0),$2=Wq("ArrayBuffer.prototype.byteLength",!0),Wve=Wq("Object.prototype.toString"),zq=!!Z5&&!$2&&new Z5(0).slice,Hq=!!zq&&zve(zq);qq.exports=s($2||Hq?function(t){if(!t||typeof t!="object")return!1;try{return $2?$2(t):Hq(t,0),!0}catch{return!1}}:Z5?function(t){return Wve(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var Xq=W((Lft,Zq)=>{"use strict";d();var qve=Date.prototype.getDay,Zve=s(function(t){try{return qve.call(t),!0}catch{return!1}},"tryDateGetDayCall"),Xve=Object.prototype.toString,Yve="[object Date]",Kve=kc()();Zq.exports=s(function(t){return typeof t!="object"||t===null?!1:Kve?Zve(t):Xve.call(t)===Yve},"isDateObject")});var eZ=W((Bft,Qq)=>{"use strict";d();var Y5=Bo(),Yq=kc()(),Kq,Jq,K5,J5;Yq&&(Kq=Y5("Object.prototype.hasOwnProperty"),Jq=Y5("RegExp.prototype.exec"),K5={},j2=s(function(){throw K5},"throwRegexMarker"),J5={toString:j2,valueOf:j2},typeof Symbol.toPrimitive=="symbol"&&(J5[Symbol.toPrimitive]=j2));var j2,Jve=Y5("Object.prototype.toString"),Qve=Object.getOwnPropertyDescriptor,exe="[object RegExp]";Qq.exports=s(Yq?function(t){if(!t||typeof t!="object")return!1;var r=Qve(t,"lastIndex"),n=r&&Kq(r,"value");if(!n)return!1;try{Jq(t,J5)}catch(o){return o===K5}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Jve(t)===exe},"isRegex")});var nZ=W((Gft,rZ)=>{"use strict";d();var txe=Bo(),tZ=txe("SharedArrayBuffer.prototype.byteLength",!0);rZ.exports=s(tZ?function(t){if(!t||typeof t!="object")return!1;try{return tZ(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var iZ=W((zft,oZ)=>{"use strict";d();var rxe=Number.prototype.toString,nxe=s(function(t){try{return rxe.call(t),!0}catch{return!1}},"tryNumberObject"),oxe=Object.prototype.toString,ixe="[object Number]",sxe=kc()();oZ.exports=s(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:sxe?nxe(t):oxe.call(t)===ixe},"isNumberObject")});var lZ=W((qft,aZ)=>{"use strict";d();var sZ=Bo(),axe=sZ("Boolean.prototype.toString"),lxe=sZ("Object.prototype.toString"),cxe=s(function(t){try{return axe(t),!0}catch{return!1}},"booleanBrandCheck"),uxe="[object Boolean]",pxe=kc()();aZ.exports=s(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:pxe&&Symbol.toStringTag in t?cxe(t):lxe(t)===uxe},"isBoolean")});var dZ=W((Yft,Q5)=>{"use strict";d();var dxe=Object.prototype.toString,fxe=y2()();fxe?(cZ=Symbol.prototype.toString,uZ=/^Symbol\(.*\)$/,pZ=s(function(t){return typeof t.valueOf()!="symbol"?!1:uZ.test(cZ.call(t))},"isRealSymbolObject"),Q5.exports=s(function(t){if(typeof t=="symbol")return!0;if(dxe.call(t)!=="[object Symbol]")return!1;try{return pZ(t)}catch{return!1}},"isSymbol")):Q5.exports=s(function(t){return!1},"isSymbol");var cZ,uZ,pZ});var hZ=W((Qft,mZ)=>{"use strict";d();var fZ=typeof BigInt<"u"&&BigInt;mZ.exports=s(function(){return typeof fZ=="function"&&typeof BigInt=="function"&&typeof fZ(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var bZ=W((rmt,eO)=>{"use strict";d();var mxe=hZ()();mxe?(yZ=BigInt.prototype.valueOf,gZ=s(function(t){try{return yZ.call(t),!0}catch{}return!1},"tryBigIntObject"),eO.exports=s(function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:gZ(t)},"isBigInt")):eO.exports=s(function(t){return!1},"isBigInt");var yZ,gZ});var xZ=W((imt,vZ)=>{"use strict";d();var hxe=A5(),yxe=iZ(),gxe=lZ(),bxe=dZ(),vxe=bZ();vZ.exports=s(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(hxe(t))return"String";if(yxe(t))return"Number";if(gxe(t))return"Boolean";if(bxe(t))return"Symbol";if(vxe(t))return"BigInt"},"whichBoxedPrimitive")});var CZ=W((lmt,SZ)=>{"use strict";d();var G2=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,IZ=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,U2;G2||(U2=s(function(t){return!1},"isWeakMap"));var rO=G2?G2.prototype.has:null,tO=IZ?IZ.prototype.has:null;!U2&&!rO&&(U2=s(function(t){return!1},"isWeakMap"));SZ.exports=U2||s(function(t){if(!t||typeof t!="object")return!1;try{if(rO.call(t,rO),tO)try{tO.call(t,tO)}catch{return!0}return t instanceof G2}catch{}return!1},"isWeakMap")});var TZ=W((pmt,oO)=>{"use strict";d();var xxe=es(),PZ=Bo(),Ixe=xxe("%WeakSet%",!0),nO=PZ("WeakSet.prototype.has",!0);nO?(V2=PZ("WeakMap.prototype.has",!0),oO.exports=s(function(t){if(!t||typeof t!="object")return!1;try{if(nO(t,nO),V2)try{V2(t,V2)}catch{return!0}return t instanceof Ixe}catch{}return!1},"isWeakSet")):oO.exports=s(function(t){return!1},"isWeakSet");var V2});var MZ=W((mmt,wZ)=>{"use strict";d();var Sxe=D5(),Cxe=L5(),Pxe=CZ(),Txe=TZ();wZ.exports=s(function(t){if(t&&typeof t=="object"){if(Sxe(t))return"Map";if(Cxe(t))return"Set";if(Pxe(t))return"WeakMap";if(Txe(t))return"WeakSet"}return!1},"whichCollection")});var AZ=W((gmt,_Z)=>{"use strict";d();var EZ=Function.prototype.toString,Mm=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,sO,z2;if(typeof Mm=="function"&&typeof Object.defineProperty=="function")try{sO=Object.defineProperty({},"length",{get:s(function(){throw z2},"get")}),z2={},Mm(function(){throw 42},null,sO)}catch(e){e!==z2&&(Mm=null)}else Mm=null;var wxe=/^\s*class\b/,aO=s(function(t){try{var r=EZ.call(t);return wxe.test(r)}catch{return!1}},"isES6ClassFunction"),iO=s(function(t){try{return aO(t)?!1:(EZ.call(t),!0)}catch{return!1}},"tryFunctionToStr"),H2=Object.prototype.toString,Mxe="[object Object]",Oxe="[object Function]",Exe="[object GeneratorFunction]",_xe="[object HTMLAllCollection]",Axe="[object HTML document.all class]",kxe="[object HTMLCollection]",Dxe=typeof Symbol=="function"&&!!Symbol.toStringTag,Fxe=!(0 in[,]),lO=s(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(OZ=document.all,H2.call(OZ)===H2.call(document.all)&&(lO=s(function(t){if((Fxe||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=H2.call(t);return(r===_xe||r===Axe||r===kxe||r===Mxe)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var OZ;_Z.exports=s(Mm?function(t){if(lO(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Mm(t,null,sO)}catch(r){if(r!==z2)return!1}return!aO(t)&&iO(t)}:function(t){if(lO(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Dxe)return iO(t);if(aO(t))return!1;var r=H2.call(t);return r!==Oxe&&r!==Exe&&!/^\[object HTML/.test(r)?!1:iO(t)},"isCallable")});var FZ=W((xmt,DZ)=>{"use strict";d();var Lxe=AZ(),Rxe=Object.prototype.toString,kZ=Object.prototype.hasOwnProperty,Nxe=s(function(t,r,n){for(var o=0,i=t.length;o<i;o++)kZ.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},"forEachArray"),Bxe=s(function(t,r,n){for(var o=0,i=t.length;o<i;o++)n==null?r(t.charAt(o),o,t):r.call(n,t.charAt(o),o,t)},"forEachString"),$xe=s(function(t,r,n){for(var o in t)kZ.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},"forEachObject"),jxe=s(function(t,r,n){if(!Lxe(r))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),Rxe.call(t)==="[object Array]"?Nxe(t,r,o):typeof t=="string"?Bxe(t,r,o):$xe(t,r,o)},"forEach");DZ.exports=jxe});var RZ=W((Cmt,LZ)=>{"use strict";d();LZ.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var BZ=W((Tmt,NZ)=>{"use strict";d();var cO=RZ(),Gxe=typeof globalThis>"u"?global:globalThis;NZ.exports=s(function(){for(var t=[],r=0;r<cO.length;r++)typeof Gxe[cO[r]]=="function"&&(t[t.length]=cO[r]);return t},"availableTypedArrays")});var VZ=W((Omt,UZ)=>{"use strict";d();var q2=FZ(),Uxe=BZ(),$Z=Cp(),dO=Bo(),W2=C2(),Vxe=dO("Object.prototype.toString"),GZ=kc()(),jZ=typeof globalThis>"u"?global:globalThis,pO=Uxe(),fO=dO("String.prototype.slice"),uO=Object.getPrototypeOf,zxe=dO("Array.prototype.indexOf",!0)||s(function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},"indexOf"),Z2={__proto__:null};GZ&&W2&&uO?q2(pO,function(e){var t=new jZ[e];if(Symbol.toStringTag in t){var r=uO(t),n=W2(r,Symbol.toStringTag);if(!n){var o=uO(r);n=W2(o,Symbol.toStringTag)}Z2["$"+e]=$Z(n.get)}}):q2(pO,function(e){var t=new jZ[e],r=t.slice||t.set;r&&(Z2["$"+e]=$Z(r))});var Hxe=s(function(t){var r=!1;return q2(Z2,function(n,o){if(!r)try{"$"+n(t)===o&&(r=fO(o,1))}catch{}}),r},"tryAllTypedArrays"),Wxe=s(function(t){var r=!1;return q2(Z2,function(n,o){if(!r)try{n(t),r=fO(o,1)}catch{}}),r},"tryAllSlices");UZ.exports=s(function(t){if(!t||typeof t!="object")return!1;if(!GZ){var r=fO(Vxe(t),8,-1);return zxe(pO,r)>-1?r:r!=="Object"?!1:Wxe(t)}return W2?Hxe(t):null},"whichTypedArray")});var WZ=W((Amt,HZ)=>{"use strict";d();var qxe=Bo(),zZ=qxe("ArrayBuffer.prototype.byteLength",!0),Zxe=X5();HZ.exports=s(function(t){return Zxe(t)?zZ?zZ(t):t.byteLength:NaN},"byteLength")});var gX=W((Fmt,yX)=>{"use strict";d();var fX=CW(),ra=Bo(),qZ=NW(),Xxe=es(),Om=Fq(),Yxe=O5(),ZZ=Vq(),XZ=m5(),YZ=_5(),KZ=X5(),JZ=Xq(),QZ=eZ(),eX=nZ(),tX=h2(),rX=xZ(),nX=MZ(),oX=VZ(),iX=WZ(),sX=ra("SharedArrayBuffer.prototype.byteLength",!0),aX=ra("Date.prototype.getTime"),mO=Object.getPrototypeOf,lX=ra("Object.prototype.toString"),Y2=Xxe("%Set%",!0),hO=ra("Map.prototype.has",!0),K2=ra("Map.prototype.get",!0),cX=ra("Map.prototype.size",!0),J2=ra("Set.prototype.add",!0),mX=ra("Set.prototype.delete",!0),Q2=ra("Set.prototype.has",!0),X2=ra("Set.prototype.size",!0);function uX(e,t,r,n){for(var o=Om(e),i;(i=o.next())&&!i.done;)if(ts(t,i.value,r,n))return mX(e,i.value),!0;return!1}s(uX,"setHasEqualElement");function hX(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}s(hX,"findLooseMatchingPrimitives");function Kxe(e,t,r,n,o,i){var a=hX(r);if(a!=null)return a;var l=K2(t,a),c=fX({},o,{strict:!1});return typeof l>"u"&&!hO(t,a)||!ts(n,l,c,i)?!1:!hO(e,a)&&ts(n,l,c,i)}s(Kxe,"mapMightHaveLoosePrim");function Jxe(e,t,r){var n=hX(r);return n!=null?n:Q2(t,n)&&!Q2(e,n)}s(Jxe,"setMightHaveLoosePrim");function pX(e,t,r,n,o,i){for(var a=Om(e),l,c;(l=a.next())&&!l.done;)if(c=l.value,ts(r,c,o,i)&&ts(n,K2(t,c),o,i))return mX(e,c),!0;return!1}s(pX,"mapHasEqualEntry");function ts(e,t,r,n){var o=r||{};if(o.strict?ZZ(e,t):e===t)return!0;var i=rX(e),a=rX(t);if(i!==a)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return o.strict?ZZ(e,t):e==t;var l=n.has(e),c=n.has(t),p;if(l&&c){if(n.get(e)===n.get(t))return!0}else p={};return l||n.set(e,p),c||n.set(t,p),t2e(e,t,o,n)}s(ts,"internalDeepEqual");function dX(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}s(dX,"isBuffer");function Qxe(e,t,r,n){if(X2(e)!==X2(t))return!1;for(var o=Om(e),i=Om(t),a,l,c;(a=o.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new Y2),J2(c,a.value);else if(!Q2(t,a.value)){if(r.strict||!Jxe(e,t,a.value))return!1;c||(c=new Y2),J2(c,a.value)}if(c){for(;(l=i.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!uX(c,l.value,r.strict,n))return!1}else if(!r.strict&&!Q2(e,l.value)&&!uX(c,l.value,r.strict,n))return!1;return X2(c)===0}return!0}s(Qxe,"setEquiv");function e2e(e,t,r,n){if(cX(e)!==cX(t))return!1;for(var o=Om(e),i=Om(t),a,l,c,p,f,m;(a=o.next())&&!a.done;)if(p=a.value[0],f=a.value[1],p&&typeof p=="object")c||(c=new Y2),J2(c,p);else if(m=K2(t,p),typeof m>"u"&&!hO(t,p)||!ts(f,m,r,n)){if(r.strict||!Kxe(e,t,p,f,r,n))return!1;c||(c=new Y2),J2(c,p)}if(c){for(;(l=i.next())&&!l.done;)if(p=l.value[0],m=l.value[1],p&&typeof p=="object"){if(!pX(c,e,p,m,r,n))return!1}else if(!r.strict&&(!e.has(p)||!ts(K2(e,p),m,r,n))&&!pX(c,e,p,m,fX({},r,{strict:!1}),n))return!1;return X2(c)===0}return!0}s(e2e,"mapEquiv");function t2e(e,t,r,n){var o,i;if(typeof e!=typeof t||e==null||t==null||lX(e)!==lX(t)||XZ(e)!==XZ(t))return!1;var a=YZ(e),l=YZ(t);if(a!==l)return!1;var c=e instanceof Error,p=t instanceof Error;if(c!==p||(c||p)&&(e.name!==t.name||e.message!==t.message))return!1;var f=QZ(e),m=QZ(t);if(f!==m||(f||m)&&(e.source!==t.source||qZ(e)!==qZ(t)))return!1;var y=JZ(e),v=JZ(t);if(y!==v||(y||v)&&aX(e)!==aX(t)||r.strict&&mO&&mO(e)!==mO(t))return!1;var x=oX(e),S=oX(t);if(x!==S)return!1;if(x||S){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var I=dX(e),P=dX(t);if(I!==P)return!1;if(I||P){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var T=KZ(e),M=KZ(t);if(T!==M)return!1;if(T||M)return iX(e)!==iX(t)?!1:typeof Uint8Array=="function"&&ts(new Uint8Array(e),new Uint8Array(t),r,n);var w=eX(e),E=eX(t);if(w!==E)return!1;if(w||E)return sX(e)!==sX(t)?!1:typeof Uint8Array=="function"&&ts(new Uint8Array(e),new Uint8Array(t),r,n);if(typeof e!=typeof t)return!1;var B=tX(e),D=tX(t);if(B.length!==D.length)return!1;for(B.sort(),D.sort(),o=B.length-1;o>=0;o--)if(B[o]!=D[o])return!1;for(o=B.length-1;o>=0;o--)if(i=B[o],!ts(e[i],t[i],r,n))return!1;var F=nX(e),L=nX(t);return F!==L?!1:F==="Set"||L==="Set"?Qxe(e,t,r,n):F==="Map"?e2e(e,t,r,n):!0}s(t2e,"objEquiv");yX.exports=s(function(t,r,n){return ts(t,r,n,Yxe())},"deepEqual")});var DX=W(kt=>{"use strict";d();Object.defineProperty(kt,"__esModule",{value:!0});function r2e(e){return e&&e.__esModule?e:{default:e}}s(r2e,"_interopRequireDefault");var n2e=Object.defineProperty,jt=s((e,t)=>n2e(e,"name",{value:t,configurable:!0}),"__name"),o2e=gX(),i2e=r2e(o2e),Em,bX=(Em=class{constructor(t){this.direction=!1,this.compareProperties=!0;var r,n,o;this.precision=10**-((r=t==null?void 0:t.precision)!=null?r:17),this.direction=(n=t==null?void 0:t.direction)!=null?n:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,r){if(t.type!==r.type||!Kg(t,r))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,r.coordinates);case"LineString":return this.compareLine(t.coordinates,r.coordinates);case"Polygon":return this.comparePolygon(t,r);case"GeometryCollection":return this.compareGeometryCollection(t,r);case"Feature":return this.compareFeature(t,r);case"FeatureCollection":return this.compareFeatureCollection(t,r);default:if(t.type.startsWith("Multi")){let n=yO(t),o=yO(r);return n.every(i=>o.some(a=>this.compare(i,a)))}}return!1}compareCoord(t,r){return t.length===r.length&&t.every((n,o)=>Math.abs(n-r[o])<this.precision)}compareLine(t,r,n=0,o=!1){if(!Kg(t,r))return!1;let i=t,a=r;if(o&&!this.compareCoord(i[0],a[0])){let c=this.fixStartIndex(a,i);if(c)a=c;else return!1}let l=this.compareCoord(i[n],a[n]);return this.direction||l?this.comparePath(i,a):this.compareCoord(i[n],a[a.length-(1+n)])?this.comparePath(i.slice().reverse(),a):!1}fixStartIndex(t,r){let n,o=-1;for(let i=0;i<t.length;i++)if(this.compareCoord(t[i],r[0])){o=i;break}return o>=0&&(n=[].concat(t.slice(o,t.length),t.slice(1,o+1))),n}comparePath(t,r){return t.every((n,o)=>this.compareCoord(n,r[o]))}comparePolygon(t,r){if(this.compareLine(t.coordinates[0],r.coordinates[0],1,!0)){let n=t.coordinates.slice(1,t.coordinates.length),o=r.coordinates.slice(1,r.coordinates.length);return n.every(i=>o.some(a=>this.compareLine(i,a,1,!0)))}return!1}compareGeometryCollection(t,r){return Kg(t.geometries,r.geometries)&&this.compareBBox(t,r)&&t.geometries.every((n,o)=>this.compare(n,r.geometries[o]))}compareFeature(t,r){return t.id===r.id&&(this.compareProperties?i2e.default.call(void 0,t.properties,r.properties):!0)&&this.compareBBox(t,r)&&this.compare(t.geometry,r.geometry)}compareFeatureCollection(t,r){return Kg(t.features,r.features)&&this.compareBBox(t,r)&&t.features.every((n,o)=>this.compare(n,r.features[o]))}compareBBox(t,r){return!t.bbox&&!r.bbox||(t.bbox&&r.bbox?this.compareCoord(t.bbox,r.bbox):!1)}},s(Em,"_GeojsonEquality"),Em);jt(bX,"GeojsonEquality");var s2e=bX;function Kg(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}s(Kg,"sameLength");jt(Kg,"sameLength");function yO(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}s(yO,"explode");jt(yO,"explode");var xo=63710088e-1,bO={centimeters:xo*100,centimetres:xo*100,degrees:360/(2*Math.PI),feet:xo*3.28084,inches:xo*39.37,kilometers:xo/1e3,kilometres:xo/1e3,meters:xo,metres:xo,miles:xo/1609.344,millimeters:xo*1e3,millimetres:xo*1e3,nauticalmiles:xo/1852,radians:1,yards:xo*1.0936},gO={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,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function gl(e,t,r={}){let 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(gl,"feature");jt(gl,"feature");function vX(e,t,r={}){switch(e){case"Point":return eI(t).geometry;case"LineString":return rI(t).geometry;case"Polygon":return tI(t).geometry;case"MultiPoint":return xO(t).geometry;case"MultiLineString":return vO(t).geometry;case"MultiPolygon":return IO(t).geometry;default:throw new Error(e+" is invalid")}}s(vX,"geometry");jt(vX,"geometry");function eI(e,t,r={}){if(!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(!Jg(e[0])||!Jg(e[1]))throw new Error("coordinates must contain numbers");return gl({type:"Point",coordinates:e},t,r)}s(eI,"point");jt(eI,"point");function xX(e,t,r={}){return Qg(e.map(n=>eI(n,t)),r)}s(xX,"points");jt(xX,"points");function tI(e,t,r={}){for(let o of e){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let i=0;i<o[o.length-1].length;i++)if(o[o.length-1][i]!==o[0][i])throw new Error("First and last Position are not equivalent.")}return gl({type:"Polygon",coordinates:e},t,r)}s(tI,"polygon");jt(tI,"polygon");function IX(e,t,r={}){return Qg(e.map(n=>tI(n,t)),r)}s(IX,"polygons");jt(IX,"polygons");function rI(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return gl({type:"LineString",coordinates:e},t,r)}s(rI,"lineString");jt(rI,"lineString");function SX(e,t,r={}){return Qg(e.map(n=>rI(n,t)),r)}s(SX,"lineStrings");jt(SX,"lineStrings");function Qg(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}s(Qg,"featureCollection");jt(Qg,"featureCollection");function vO(e,t,r={}){return gl({type:"MultiLineString",coordinates:e},t,r)}s(vO,"multiLineString");jt(vO,"multiLineString");function xO(e,t,r={}){return gl({type:"MultiPoint",coordinates:e},t,r)}s(xO,"multiPoint");jt(xO,"multiPoint");function IO(e,t,r={}){return gl({type:"MultiPolygon",coordinates:e},t,r)}s(IO,"multiPolygon");jt(IO,"multiPolygon");function CX(e,t,r={}){return gl({type:"GeometryCollection",geometries:e},t,r)}s(CX,"geometryCollection");jt(CX,"geometryCollection");function PX(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,t||0);return Math.round(e*r)/r}s(PX,"round");jt(PX,"round");function SO(e,t="kilometers"){let r=bO[t];if(!r)throw new Error(t+" units is invalid");return e*r}s(SO,"radiansToLength");jt(SO,"radiansToLength");function nI(e,t="kilometers"){let r=bO[t];if(!r)throw new Error(t+" units is invalid");return e/r}s(nI,"lengthToRadians");jt(nI,"lengthToRadians");function TX(e,t){return CO(nI(e,t))}s(TX,"lengthToDegrees");jt(TX,"lengthToDegrees");function wX(e){let t=e%360;return t<0&&(t+=360),t}s(wX,"bearingToAzimuth");jt(wX,"bearingToAzimuth");function CO(e){return e%(2*Math.PI)*180/Math.PI}s(CO,"radiansToDegrees");jt(CO,"radiansToDegrees");function MX(e){return e%360*Math.PI/180}s(MX,"degreesToRadians");jt(MX,"degreesToRadians");function OX(e,t="kilometers",r="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return SO(nI(e,t),r)}s(OX,"convertLength");jt(OX,"convertLength");function EX(e,t="meters",r="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");let n=gO[t];if(!n)throw new Error("invalid original units");let o=gO[r];if(!o)throw new Error("invalid final units");return e/n*o}s(EX,"convertArea");jt(EX,"convertArea");function Jg(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}s(Jg,"isNumber");jt(Jg,"isNumber");function _X(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}s(_X,"isObject");jt(_X,"isObject");function AX(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(t=>{if(!Jg(t))throw new Error("bbox must only contain numbers")})}s(AX,"validateBBox");jt(AX,"validateBBox");function kX(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(kX,"validateId");jt(kX,"validateId");kt.GeojsonEquality=s2e;kt.areaFactors=gO;kt.bearingToAzimuth=wX;kt.convertArea=EX;kt.convertLength=OX;kt.degreesToRadians=MX;kt.earthRadius=xo;kt.factors=bO;kt.feature=gl;kt.featureCollection=Qg;kt.geometry=vX;kt.geometryCollection=CX;kt.isNumber=Jg;kt.isObject=_X;kt.lengthToDegrees=TX;kt.lengthToRadians=nI;kt.lineString=rI;kt.lineStrings=SX;kt.multiLineString=vO;kt.multiPoint=xO;kt.multiPolygon=IO;kt.point=eI;kt.points=xX;kt.polygon=tI;kt.polygons=IX;kt.radiansToDegrees=CO;kt.radiansToLength=SO;kt.round=PX;kt.validateBBox=AX;kt.validateId=kX});var zX=W(Wr=>{"use strict";d();Object.defineProperty(Wr,"__esModule",{value:!0});var a2e=Object.defineProperty,hn=s((e,t)=>a2e(e,"name",{value:t,configurable:!0}),"__name"),Ln=DX();function _m(e,t,r){if(e!==null)for(var n,o,i,a,l,c,p,f=0,m=0,y,v=e.type,x=v==="FeatureCollection",S=v==="Feature",I=x?e.features.length:1,P=0;P<I;P++){p=x?e.features[P].geometry:S?e.geometry:e,y=p?p.type==="GeometryCollection":!1,l=y?p.geometries.length:1;for(var T=0;T<l;T++){var M=0,w=0;if(a=y?p.geometries[T]:p,a!==null){c=a.coordinates;var E=a.type;switch(f=r&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(c,m,P,M,w)===!1)return!1;m++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],m,P,M,w)===!1)return!1;m++,E==="MultiPoint"&&M++}E==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-f;o++){if(t(c[n][o],m,P,M,w)===!1)return!1;m++}E==="MultiLineString"&&M++,E==="Polygon"&&w++}E==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(w=0,o=0;o<c[n].length;o++){for(i=0;i<c[n][o].length-f;i++){if(t(c[n][o][i],m,P,M,w)===!1)return!1;m++}w++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(_m(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(_m,"coordEach");hn(_m,"coordEach");function FX(e,t,r,n){var o=r;return _m(e,function(i,a,l,c,p){a===0&&r===void 0?o=i:o=t(o,i,a,l,c,p)},n),o}s(FX,"coordReduce");hn(FX,"coordReduce");function PO(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(PO,"propEach");hn(PO,"propEach");function LX(e,t,r){var n=r;return PO(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(LX,"propReduce");hn(LX,"propReduce");function TO(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(TO,"featureEach");hn(TO,"featureEach");function RX(e,t,r){var n=r;return TO(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}s(RX,"featureReduce");hn(RX,"featureReduce");function NX(e){var t=[];return _m(e,function(r){t.push(r)}),t}s(NX,"coordAll");hn(NX,"coordAll");function oI(e,t){var r,n,o,i,a,l,c,p,f,m,y=0,v=e.type==="FeatureCollection",x=e.type==="Feature",S=v?e.features.length:1;for(r=0;r<S;r++){for(l=v?e.features[r].geometry:x?e.geometry:e,p=v?e.features[r].properties:x?e.properties:{},f=v?e.features[r].bbox:x?e.bbox:void 0,m=v?e.features[r].id:x?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,p,f,m)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,y,p,f,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],y,p,f,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}s(oI,"geomEach");hn(oI,"geomEach");function BX(e,t,r){var n=r;return oI(e,function(o,i,a,l,c){i===0&&r===void 0?n=o:n=t(n,o,i,a,l,c)}),n}s(BX,"geomReduce");hn(BX,"geomReduce");function eb(e,t){oI(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(Ln.feature.call(void 0,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 p=0;p<r.coordinates.length;p++){var f=r.coordinates[p],m={type:c,coordinates:f};if(t(Ln.feature.call(void 0,m,o),n,p)===!1)return!1}})}s(eb,"flattenEach");hn(eb,"flattenEach");function $X(e,t,r){var n=r;return eb(e,function(o,i,a){i===0&&a===0&&r===void 0?n=o:n=t(n,o,i,a)}),n}s($X,"flattenReduce");hn($X,"flattenReduce");function wO(e,t){eb(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,p=0,f=0;if(_m(r,function(m,y,v,x,S){if(l===void 0||n>c||x>p||S>f){l=m,c=n,p=x,f=S,i=0;return}var I=Ln.lineString.call(void 0,[l,m],r.properties);if(t(I,n,o,S,i)===!1)return!1;i++,l=m})===!1)return!1}}})}s(wO,"segmentEach");hn(wO,"segmentEach");function jX(e,t,r){var n=r,o=!1;return wO(e,function(i,a,l,c,p){o===!1&&r===void 0?n=i:n=t(n,i,a,l,c,p),o=!0}),n}s(jX,"segmentReduce");hn(jX,"segmentReduce");function MO(e,t){if(!e)throw new Error("geojson is required");eb(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(Ln.lineString.call(void 0,a[l],r.properties),n,o,l)===!1)return!1;break}}})}s(MO,"lineEach");hn(MO,"lineEach");function GX(e,t,r){var n=r;return MO(e,function(o,i,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,a,l)}),n}s(GX,"lineReduce");hn(GX,"lineReduce");function UX(e,t){if(t=t||{},!Ln.isObject.call(void 0,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),Ln.lineString.call(void 0,[c[i],c[i+1]],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),Ln.lineString.call(void 0,[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),Ln.lineString.call(void 0,[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),Ln.lineString.call(void 0,[c[n][o][i],c[n][o][i+1]],a,t)}throw new Error("geojson is invalid")}s(UX,"findSegment");hn(UX,"findSegment");function VX(e,t){if(t=t||{},!Ln.isObject.call(void 0,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 Ln.point.call(void 0,c,a,t);case"MultiPoint":return n<0&&(n=c.length+n),Ln.point.call(void 0,c[n],a,t);case"LineString":return i<0&&(i=c.length+i),Ln.point.call(void 0,c[i],a,t);case"Polygon":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),Ln.point.call(void 0,c[o][i],a,t);case"MultiLineString":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),Ln.point.call(void 0,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),Ln.point.call(void 0,c[n][o][i],a,t)}throw new Error("geojson is invalid")}s(VX,"findPoint");hn(VX,"findPoint");Wr.coordAll=NX;Wr.coordEach=_m;Wr.coordReduce=FX;Wr.featureEach=TO;Wr.featureReduce=RX;Wr.findPoint=VX;Wr.findSegment=UX;Wr.flattenEach=eb;Wr.flattenReduce=$X;Wr.geomEach=oI;Wr.geomReduce=BX;Wr.lineEach=MO;Wr.lineReduce=GX;Wr.propEach=PO;Wr.propReduce=LX;Wr.segmentEach=wO;Wr.segmentReduce=jX});var HX=W(iI=>{"use strict";d();Object.defineProperty(iI,"__esModule",{value:!0});var l2e=Object.defineProperty,c2e=s((e,t)=>l2e(e,"name",{value:t,configurable:!0}),"__name"),u2e=zX();function OO(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return u2e.coordEach.call(void 0,e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}s(OO,"bbox");c2e(OO,"bbox");var p2e=OO;iI.bbox=OO;iI.default=p2e});var YX=W((Zmt,EO)=>{d();var na=zz(),qX=Y4(),ZX=eH(),Am=HX().default,d2e=ZX.featureEach,Wmt=ZX.coordEach,qmt=qX.polygon,WX=qX.featureCollection;function XX(e){var t=new na(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Am(r),na.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:Am(o),n.push(o)}):d2e(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Am(o),n.push(o)}),na.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:Am(r),na.prototype.remove.call(this,r,n)},t.clear=function(){return na.prototype.clear.call(this)},t.search=function(r){var n=na.prototype.search.call(this,this.toBBox(r));return WX(n)},t.collides=function(r){return na.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=na.prototype.all.call(this);return WX(r)},t.toJSON=function(){return na.prototype.toJSON.call(this)},t.fromJSON=function(r){return na.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=Am(r);else if(r.type==="FeatureCollection")n=Am(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}s(XX,"geojsonRbush");EO.exports=XX;EO.exports.default=XX});var E7=W((yb,Hm)=>{d();var OIe=200,FY="__lodash_hash_undefined__",EIe=800,_Ie=16,LY=9007199254740991,RY="[object Arguments]",AIe="[object Array]",kIe="[object AsyncFunction]",DIe="[object Boolean]",FIe="[object Date]",LIe="[object Error]",NY="[object Function]",RIe="[object GeneratorFunction]",NIe="[object Map]",BIe="[object Number]",$Ie="[object Null]",BY="[object Object]",jIe="[object Proxy]",GIe="[object RegExp]",UIe="[object Set]",VIe="[object String]",zIe="[object Undefined]",HIe="[object WeakMap]",WIe="[object ArrayBuffer]",qIe="[object DataView]",ZIe="[object Float32Array]",XIe="[object Float64Array]",YIe="[object Int8Array]",KIe="[object Int16Array]",JIe="[object Int32Array]",QIe="[object Uint8Array]",eSe="[object Uint8ClampedArray]",tSe="[object Uint16Array]",rSe="[object Uint32Array]",nSe=/[\\^$.*+?()[\]{}|]/g,oSe=/^\[object .+?Constructor\]$/,iSe=/^(?:0|[1-9]\d*)$/,ar={};ar[ZIe]=ar[XIe]=ar[YIe]=ar[KIe]=ar[JIe]=ar[QIe]=ar[eSe]=ar[tSe]=ar[rSe]=!0;ar[RY]=ar[AIe]=ar[WIe]=ar[DIe]=ar[qIe]=ar[FIe]=ar[LIe]=ar[NY]=ar[NIe]=ar[BIe]=ar[BY]=ar[GIe]=ar[UIe]=ar[VIe]=ar[HIe]=!1;var $Y=typeof global=="object"&&global&&global.Object===Object&&global,sSe=typeof self=="object"&&self&&self.Object===Object&&self,vb=$Y||sSe||Function("return this")(),jY=typeof yb=="object"&&yb&&!yb.nodeType&&yb,gb=jY&&typeof Hm=="object"&&Hm&&!Hm.nodeType&&Hm,GY=gb&&gb.exports===jY,v7=GY&&$Y.process,TY=function(){try{var e=gb&&gb.require&&gb.require("util").types;return e||v7&&v7.binding&&v7.binding("util")}catch{}}(),wY=TY&&TY.isTypedArray;function aSe(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(aSe,"apply");function lSe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(lSe,"baseTimes");function cSe(e){return function(t){return e(t)}}s(cSe,"baseUnary");function uSe(e,t){return e==null?void 0:e[t]}s(uSe,"getValue");function pSe(e,t){return function(r){return e(t(r))}}s(pSe,"overArg");var dSe=Array.prototype,fSe=Function.prototype,PI=Object.prototype,x7=vb["__core-js_shared__"],TI=fSe.toString,Sl=PI.hasOwnProperty,MY=function(){var e=/[^.]+$/.exec(x7&&x7.keys&&x7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),UY=PI.toString,mSe=TI.call(Object),hSe=RegExp("^"+TI.call(Sl).replace(nSe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),SI=GY?vb.Buffer:void 0,OY=vb.Symbol,EY=vb.Uint8Array,_Y=SI?SI.allocUnsafe:void 0,VY=pSe(Object.getPrototypeOf,Object),AY=Object.create,ySe=PI.propertyIsEnumerable,gSe=dSe.splice,Up=OY?OY.toStringTag:void 0,CI=function(){try{var e=w7(Object,"defineProperty");return e({},"",{}),e}catch{}}(),bSe=SI?SI.isBuffer:void 0,kY=Math.max,vSe=Date.now,zY=w7(vb,"Map"),bb=w7(Object,"create"),xSe=function(){function e(){}return s(e,"object"),function(t){if(!zp(t))return{};if(AY)return AY(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Vp(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(Vp,"Hash");function ISe(){this.__data__=bb?bb(null):{},this.size=0}s(ISe,"hashClear");function SSe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}s(SSe,"hashDelete");function CSe(e){var t=this.__data__;if(bb){var r=t[e];return r===FY?void 0:r}return Sl.call(t,e)?t[e]:void 0}s(CSe,"hashGet");function PSe(e){var t=this.__data__;return bb?t[e]!==void 0:Sl.call(t,e)}s(PSe,"hashHas");function TSe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=bb&&t===void 0?FY:t,this}s(TSe,"hashSet");Vp.prototype.clear=ISe;Vp.prototype.delete=SSe;Vp.prototype.get=CSe;Vp.prototype.has=PSe;Vp.prototype.set=TSe;function Cl(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(Cl,"ListCache");function wSe(){this.__data__=[],this.size=0}s(wSe,"listCacheClear");function MSe(e){var t=this.__data__,r=wI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():gSe.call(t,r,1),--this.size,!0}s(MSe,"listCacheDelete");function OSe(e){var t=this.__data__,r=wI(t,e);return r<0?void 0:t[r][1]}s(OSe,"listCacheGet");function ESe(e){return wI(this.__data__,e)>-1}s(ESe,"listCacheHas");function _Se(e,t){var r=this.__data__,n=wI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}s(_Se,"listCacheSet");Cl.prototype.clear=wSe;Cl.prototype.delete=MSe;Cl.prototype.get=OSe;Cl.prototype.has=ESe;Cl.prototype.set=_Se;function Wm(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(Wm,"MapCache");function ASe(){this.size=0,this.__data__={hash:new Vp,map:new(zY||Cl),string:new Vp}}s(ASe,"mapCacheClear");function kSe(e){var t=OI(this,e).delete(e);return this.size-=t?1:0,t}s(kSe,"mapCacheDelete");function DSe(e){return OI(this,e).get(e)}s(DSe,"mapCacheGet");function FSe(e){return OI(this,e).has(e)}s(FSe,"mapCacheHas");function LSe(e,t){var r=OI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}s(LSe,"mapCacheSet");Wm.prototype.clear=ASe;Wm.prototype.delete=kSe;Wm.prototype.get=DSe;Wm.prototype.has=FSe;Wm.prototype.set=LSe;function qm(e){var t=this.__data__=new Cl(e);this.size=t.size}s(qm,"Stack");function RSe(){this.__data__=new Cl,this.size=0}s(RSe,"stackClear");function NSe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}s(NSe,"stackDelete");function BSe(e){return this.__data__.get(e)}s(BSe,"stackGet");function $Se(e){return this.__data__.has(e)}s($Se,"stackHas");function jSe(e,t){var r=this.__data__;if(r instanceof Cl){var n=r.__data__;if(!zY||n.length<OIe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wm(n)}return r.set(e,t),this.size=r.size,this}s(jSe,"stackSet");qm.prototype.clear=RSe;qm.prototype.delete=NSe;qm.prototype.get=BSe;qm.prototype.has=$Se;qm.prototype.set=jSe;function GSe(e,t){var r=P7(e),n=!r&&C7(e),o=!r&&!n&&ZY(e),i=!r&&!n&&!o&&YY(e),a=r||n||o||i,l=a?lSe(e.length,String):[],c=l.length;for(var p in e)(t||Sl.call(e,p))&&!(a&&(p=="length"||o&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||WY(p,c)))&&l.push(p);return l}s(GSe,"arrayLikeKeys");function I7(e,t,r){(r!==void 0&&!EI(e[t],r)||r===void 0&&!(t in e))&&T7(e,t,r)}s(I7,"assignMergeValue");function USe(e,t,r){var n=e[t];(!(Sl.call(e,t)&&EI(n,r))||r===void 0&&!(t in e))&&T7(e,t,r)}s(USe,"assignValue");function wI(e,t){for(var r=e.length;r--;)if(EI(e[r][0],t))return r;return-1}s(wI,"assocIndexOf");function T7(e,t,r){t=="__proto__"&&CI?CI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}s(T7,"baseAssignValue");var VSe=r3e();function MI(e){return e==null?e===void 0?zIe:$Ie:Up&&Up in Object(e)?n3e(e):c3e(e)}s(MI,"baseGetTag");function DY(e){return xb(e)&&MI(e)==RY}s(DY,"baseIsArguments");function zSe(e){if(!zp(e)||a3e(e))return!1;var t=O7(e)?hSe:oSe;return t.test(f3e(e))}s(zSe,"baseIsNative");function HSe(e){return xb(e)&&XY(e.length)&&!!ar[MI(e)]}s(HSe,"baseIsTypedArray");function WSe(e){if(!zp(e))return l3e(e);var t=qY(e),r=[];for(var n in e)n=="constructor"&&(t||!Sl.call(e,n))||r.push(n);return r}s(WSe,"baseKeysIn");function HY(e,t,r,n,o){e!==t&&VSe(t,function(i,a){if(o||(o=new qm),zp(i))qSe(e,t,a,r,HY,n,o);else{var l=n?n(S7(e,a),i,a+"",e,t,o):void 0;l===void 0&&(l=i),I7(e,a,l)}},KY)}s(HY,"baseMerge");function qSe(e,t,r,n,o,i,a){var l=S7(e,r),c=S7(t,r),p=a.get(c);if(p){I7(e,r,p);return}var f=i?i(l,c,r+"",e,t,a):void 0,m=f===void 0;if(m){var y=P7(c),v=!y&&ZY(c),x=!y&&!v&&YY(c);f=c,y||v||x?P7(l)?f=l:m3e(l)?f=QSe(l):v?(m=!1,f=YSe(c,!0)):x?(m=!1,f=JSe(c,!0)):f=[]:h3e(c)||C7(c)?(f=l,C7(l)?f=y3e(l):(!zp(l)||O7(l))&&(f=o3e(c))):m=!1}m&&(a.set(c,f),o(f,c,n,i,a),a.delete(c)),I7(e,r,f)}s(qSe,"baseMergeDeep");function ZSe(e,t){return p3e(u3e(e,t,JY),e+"")}s(ZSe,"baseRest");var XSe=CI?function(e,t){return CI(e,"toString",{configurable:!0,enumerable:!1,value:b3e(t),writable:!0})}:JY;function YSe(e,t){if(t)return e.slice();var r=e.length,n=_Y?_Y(r):new e.constructor(r);return e.copy(n),n}s(YSe,"cloneBuffer");function KSe(e){var t=new e.constructor(e.byteLength);return new EY(t).set(new EY(e)),t}s(KSe,"cloneArrayBuffer");function JSe(e,t){var r=t?KSe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}s(JSe,"cloneTypedArray");function QSe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}s(QSe,"copyArray");function e3e(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?T7(r,l,c):USe(r,l,c)}return r}s(e3e,"copyObject");function t3e(e){return ZSe(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&&i3e(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(t3e,"createAssigner");function r3e(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(r3e,"createBaseFor");function OI(e,t){var r=e.__data__;return s3e(t)?r[typeof t=="string"?"string":"hash"]:r.map}s(OI,"getMapData");function w7(e,t){var r=uSe(e,t);return zSe(r)?r:void 0}s(w7,"getNative");function n3e(e){var t=Sl.call(e,Up),r=e[Up];try{e[Up]=void 0;var n=!0}catch{}var o=UY.call(e);return n&&(t?e[Up]=r:delete e[Up]),o}s(n3e,"getRawTag");function o3e(e){return typeof e.constructor=="function"&&!qY(e)?xSe(VY(e)):{}}s(o3e,"initCloneObject");function WY(e,t){var r=typeof e;return t=t==null?LY:t,!!t&&(r=="number"||r!="symbol"&&iSe.test(e))&&e>-1&&e%1==0&&e<t}s(WY,"isIndex");function i3e(e,t,r){if(!zp(r))return!1;var n=typeof t;return(n=="number"?M7(r)&&WY(t,r.length):n=="string"&&t in r)?EI(r[t],e):!1}s(i3e,"isIterateeCall");function s3e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}s(s3e,"isKeyable");function a3e(e){return!!MY&&MY in e}s(a3e,"isMasked");function qY(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||PI;return e===r}s(qY,"isPrototype");function l3e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(l3e,"nativeKeysIn");function c3e(e){return UY.call(e)}s(c3e,"objectToString");function u3e(e,t,r){return t=kY(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=kY(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),aSe(e,this,l)}}s(u3e,"overRest");function S7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}s(S7,"safeGet");var p3e=d3e(XSe);function d3e(e){var t=0,r=0;return function(){var n=vSe(),o=_Ie-(n-r);if(r=n,o>0){if(++t>=EIe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}s(d3e,"shortOut");function f3e(e){if(e!=null){try{return TI.call(e)}catch{}try{return e+""}catch{}}return""}s(f3e,"toSource");function EI(e,t){return e===t||e!==e&&t!==t}s(EI,"eq");var C7=DY(function(){return arguments}())?DY:function(e){return xb(e)&&Sl.call(e,"callee")&&!ySe.call(e,"callee")},P7=Array.isArray;function M7(e){return e!=null&&XY(e.length)&&!O7(e)}s(M7,"isArrayLike");function m3e(e){return xb(e)&&M7(e)}s(m3e,"isArrayLikeObject");var ZY=bSe||v3e;function O7(e){if(!zp(e))return!1;var t=MI(e);return t==NY||t==RIe||t==kIe||t==jIe}s(O7,"isFunction");function XY(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=LY}s(XY,"isLength");function zp(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}s(zp,"isObject");function xb(e){return e!=null&&typeof e=="object"}s(xb,"isObjectLike");function h3e(e){if(!xb(e)||MI(e)!=BY)return!1;var t=VY(e);if(t===null)return!0;var r=Sl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&TI.call(r)==mSe}s(h3e,"isPlainObject");var YY=wY?cSe(wY):HSe;function y3e(e){return e3e(e,KY(e))}s(y3e,"toPlainObject");function KY(e){return M7(e)?GSe(e,!0):WSe(e)}s(KY,"keysIn");var g3e=t3e(function(e,t,r){HY(e,t,r)});function b3e(e){return function(){return e}}s(b3e,"constant");function JY(e){return e}s(JY,"identity");function v3e(){return!1}s(v3e,"stubFalse");Hm.exports=g3e});var z7=W((Cb,Xm)=>{d();var q3e=200,vK="__lodash_hash_undefined__",Z3e=800,X3e=16,xK=9007199254740991,IK="[object Arguments]",Y3e="[object Array]",K3e="[object AsyncFunction]",J3e="[object Boolean]",Q3e="[object Date]",eCe="[object Error]",SK="[object Function]",tCe="[object GeneratorFunction]",rCe="[object Map]",nCe="[object Number]",oCe="[object Null]",CK="[object Object]",iCe="[object Proxy]",sCe="[object RegExp]",aCe="[object Set]",lCe="[object String]",cCe="[object Undefined]",uCe="[object WeakMap]",pCe="[object ArrayBuffer]",dCe="[object DataView]",fCe="[object Float32Array]",mCe="[object Float64Array]",hCe="[object Int8Array]",yCe="[object Int16Array]",gCe="[object Int32Array]",bCe="[object Uint8Array]",vCe="[object Uint8ClampedArray]",xCe="[object Uint16Array]",ICe="[object Uint32Array]",SCe=/[\\^$.*+?()[\]{}|]/g,CCe=/^\[object .+?Constructor\]$/,PCe=/^(?:0|[1-9]\d*)$/,lr={};lr[fCe]=lr[mCe]=lr[hCe]=lr[yCe]=lr[gCe]=lr[bCe]=lr[vCe]=lr[xCe]=lr[ICe]=!0;lr[IK]=lr[Y3e]=lr[pCe]=lr[J3e]=lr[dCe]=lr[Q3e]=lr[eCe]=lr[SK]=lr[rCe]=lr[nCe]=lr[CK]=lr[sCe]=lr[aCe]=lr[lCe]=lr[uCe]=!1;var PK=typeof global=="object"&&global&&global.Object===Object&&global,TCe=typeof self=="object"&&self&&self.Object===Object&&self,wb=PK||TCe||Function("return this")(),TK=typeof Cb=="object"&&Cb&&!Cb.nodeType&&Cb,Pb=TK&&typeof Xm=="object"&&Xm&&!Xm.nodeType&&Xm,wK=Pb&&Pb.exports===TK,D7=wK&&PK.process,uK=function(){try{var e=Pb&&Pb.require&&Pb.require("util").types;return e||D7&&D7.binding&&D7.binding("util")}catch{}}(),pK=uK&&uK.isTypedArray;function MK(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(MK,"apply");function wCe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(wCe,"baseTimes");function MCe(e){return function(t){return e(t)}}s(MCe,"baseUnary");function OCe(e,t){return e==null?void 0:e[t]}s(OCe,"getValue");function ECe(e,t){return function(r){return e(t(r))}}s(ECe,"overArg");var _Ce=Array.prototype,ACe=Function.prototype,FI=Object.prototype,F7=wb["__core-js_shared__"],LI=ACe.toString,wl=FI.hasOwnProperty,dK=function(){var e=/[^.]+$/.exec(F7&&F7.keys&&F7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),OK=FI.toString,kCe=LI.call(Object),DCe=RegExp("^"+LI.call(wl).replace(SCe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kI=wK?wb.Buffer:void 0,fK=wb.Symbol,mK=wb.Uint8Array,hK=kI?kI.allocUnsafe:void 0,EK=ECe(Object.getPrototypeOf,Object),yK=Object.create,FCe=FI.propertyIsEnumerable,LCe=_Ce.splice,Wp=fK?fK.toStringTag:void 0,DI=function(){try{var e=G7(Object,"defineProperty");return e({},"",{}),e}catch{}}(),RCe=kI?kI.isBuffer:void 0,gK=Math.max,NCe=Date.now,_K=G7(wb,"Map"),Tb=G7(Object,"create"),BCe=function(){function e(){}return s(e,"object"),function(t){if(!Tl(t))return{};if(yK)return yK(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function qp(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(qp,"Hash");function $Ce(){this.__data__=Tb?Tb(null):{},this.size=0}s($Ce,"hashClear");function jCe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}s(jCe,"hashDelete");function GCe(e){var t=this.__data__;if(Tb){var r=t[e];return r===vK?void 0:r}return wl.call(t,e)?t[e]:void 0}s(GCe,"hashGet");function UCe(e){var t=this.__data__;return Tb?t[e]!==void 0:wl.call(t,e)}s(UCe,"hashHas");function VCe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tb&&t===void 0?vK:t,this}s(VCe,"hashSet");qp.prototype.clear=$Ce;qp.prototype.delete=jCe;qp.prototype.get=GCe;qp.prototype.has=UCe;qp.prototype.set=VCe;function Ml(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(Ml,"ListCache");function zCe(){this.__data__=[],this.size=0}s(zCe,"listCacheClear");function HCe(e){var t=this.__data__,r=RI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():LCe.call(t,r,1),--this.size,!0}s(HCe,"listCacheDelete");function WCe(e){var t=this.__data__,r=RI(t,e);return r<0?void 0:t[r][1]}s(WCe,"listCacheGet");function qCe(e){return RI(this.__data__,e)>-1}s(qCe,"listCacheHas");function ZCe(e,t){var r=this.__data__,n=RI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}s(ZCe,"listCacheSet");Ml.prototype.clear=zCe;Ml.prototype.delete=HCe;Ml.prototype.get=WCe;Ml.prototype.has=qCe;Ml.prototype.set=ZCe;function Ym(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(Ym,"MapCache");function XCe(){this.size=0,this.__data__={hash:new qp,map:new(_K||Ml),string:new qp}}s(XCe,"mapCacheClear");function YCe(e){var t=BI(this,e).delete(e);return this.size-=t?1:0,t}s(YCe,"mapCacheDelete");function KCe(e){return BI(this,e).get(e)}s(KCe,"mapCacheGet");function JCe(e){return BI(this,e).has(e)}s(JCe,"mapCacheHas");function QCe(e,t){var r=BI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}s(QCe,"mapCacheSet");Ym.prototype.clear=XCe;Ym.prototype.delete=YCe;Ym.prototype.get=KCe;Ym.prototype.has=JCe;Ym.prototype.set=QCe;function Km(e){var t=this.__data__=new Ml(e);this.size=t.size}s(Km,"Stack");function ePe(){this.__data__=new Ml,this.size=0}s(ePe,"stackClear");function tPe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}s(tPe,"stackDelete");function rPe(e){return this.__data__.get(e)}s(rPe,"stackGet");function nPe(e){return this.__data__.has(e)}s(nPe,"stackHas");function oPe(e,t){var r=this.__data__;if(r instanceof Ml){var n=r.__data__;if(!_K||n.length<q3e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ym(n)}return r.set(e,t),this.size=r.size,this}s(oPe,"stackSet");Km.prototype.clear=ePe;Km.prototype.delete=tPe;Km.prototype.get=rPe;Km.prototype.has=nPe;Km.prototype.set=oPe;function iPe(e,t){var r=B7(e),n=!r&&N7(e),o=!r&&!n&&LK(e),i=!r&&!n&&!o&&NK(e),a=r||n||o||i,l=a?wCe(e.length,String):[],c=l.length;for(var p in e)(t||wl.call(e,p))&&!(a&&(p=="length"||o&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||DK(p,c)))&&l.push(p);return l}s(iPe,"arrayLikeKeys");function L7(e,t,r){(r!==void 0&&!$I(e[t],r)||r===void 0&&!(t in e))&&$7(e,t,r)}s(L7,"assignMergeValue");function sPe(e,t,r){var n=e[t];(!(wl.call(e,t)&&$I(n,r))||r===void 0&&!(t in e))&&$7(e,t,r)}s(sPe,"assignValue");function RI(e,t){for(var r=e.length;r--;)if($I(e[r][0],t))return r;return-1}s(RI,"assocIndexOf");function $7(e,t,r){t=="__proto__"&&DI?DI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}s($7,"baseAssignValue");var aPe=vPe();function NI(e){return e==null?e===void 0?cCe:oCe:Wp&&Wp in Object(e)?xPe(e):wPe(e)}s(NI,"baseGetTag");function bK(e){return Mb(e)&&NI(e)==IK}s(bK,"baseIsArguments");function lPe(e){if(!Tl(e)||PPe(e))return!1;var t=V7(e)?DCe:CCe;return t.test(_Pe(e))}s(lPe,"baseIsNative");function cPe(e){return Mb(e)&&RK(e.length)&&!!lr[NI(e)]}s(cPe,"baseIsTypedArray");function uPe(e){if(!Tl(e))return TPe(e);var t=FK(e),r=[];for(var n in e)n=="constructor"&&(t||!wl.call(e,n))||r.push(n);return r}s(uPe,"baseKeysIn");function j7(e,t,r,n,o){e!==t&&aPe(t,function(i,a){if(o||(o=new Km),Tl(i))pPe(e,t,a,r,j7,n,o);else{var l=n?n(R7(e,a),i,a+"",e,t,o):void 0;l===void 0&&(l=i),L7(e,a,l)}},BK)}s(j7,"baseMerge");function pPe(e,t,r,n,o,i,a){var l=R7(e,r),c=R7(t,r),p=a.get(c);if(p){L7(e,r,p);return}var f=i?i(l,c,r+"",e,t,a):void 0,m=f===void 0;if(m){var y=B7(c),v=!y&&LK(c),x=!y&&!v&&NK(c);f=c,y||v||x?B7(l)?f=l:APe(l)?f=yPe(l):v?(m=!1,f=fPe(c,!0)):x?(m=!1,f=hPe(c,!0)):f=[]:kPe(c)||N7(c)?(f=l,N7(l)?f=DPe(l):(!Tl(l)||V7(l))&&(f=IPe(c))):m=!1}m&&(a.set(c,f),o(f,c,n,i,a),a.delete(c)),L7(e,r,f)}s(pPe,"baseMergeDeep");function AK(e,t){return OPe(MPe(e,t,$K),e+"")}s(AK,"baseRest");var dPe=DI?function(e,t){return DI(e,"toString",{configurable:!0,enumerable:!1,value:RPe(t),writable:!0})}:$K;function fPe(e,t){if(t)return e.slice();var r=e.length,n=hK?hK(r):new e.constructor(r);return e.copy(n),n}s(fPe,"cloneBuffer");function mPe(e){var t=new e.constructor(e.byteLength);return new mK(t).set(new mK(e)),t}s(mPe,"cloneArrayBuffer");function hPe(e,t){var r=t?mPe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}s(hPe,"cloneTypedArray");function yPe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}s(yPe,"copyArray");function gPe(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?$7(r,l,c):sPe(r,l,c)}return r}s(gPe,"copyObject");function bPe(e){return AK(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&&SPe(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(bPe,"createAssigner");function vPe(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(vPe,"createBaseFor");function kK(e,t,r,n,o,i){return Tl(e)&&Tl(t)&&(i.set(t,e),j7(e,t,void 0,kK,i),i.delete(t)),e}s(kK,"customDefaultsMerge");function BI(e,t){var r=e.__data__;return CPe(t)?r[typeof t=="string"?"string":"hash"]:r.map}s(BI,"getMapData");function G7(e,t){var r=OCe(e,t);return lPe(r)?r:void 0}s(G7,"getNative");function xPe(e){var t=wl.call(e,Wp),r=e[Wp];try{e[Wp]=void 0;var n=!0}catch{}var o=OK.call(e);return n&&(t?e[Wp]=r:delete e[Wp]),o}s(xPe,"getRawTag");function IPe(e){return typeof e.constructor=="function"&&!FK(e)?BCe(EK(e)):{}}s(IPe,"initCloneObject");function DK(e,t){var r=typeof e;return t=t==null?xK:t,!!t&&(r=="number"||r!="symbol"&&PCe.test(e))&&e>-1&&e%1==0&&e<t}s(DK,"isIndex");function SPe(e,t,r){if(!Tl(r))return!1;var n=typeof t;return(n=="number"?U7(r)&&DK(t,r.length):n=="string"&&t in r)?$I(r[t],e):!1}s(SPe,"isIterateeCall");function CPe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}s(CPe,"isKeyable");function PPe(e){return!!dK&&dK in e}s(PPe,"isMasked");function FK(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||FI;return e===r}s(FK,"isPrototype");function TPe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(TPe,"nativeKeysIn");function wPe(e){return OK.call(e)}s(wPe,"objectToString");function MPe(e,t,r){return t=gK(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=gK(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),MK(e,this,l)}}s(MPe,"overRest");function R7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}s(R7,"safeGet");var OPe=EPe(dPe);function EPe(e){var t=0,r=0;return function(){var n=NCe(),o=X3e-(n-r);if(r=n,o>0){if(++t>=Z3e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}s(EPe,"shortOut");function _Pe(e){if(e!=null){try{return LI.call(e)}catch{}try{return e+""}catch{}}return""}s(_Pe,"toSource");function $I(e,t){return e===t||e!==e&&t!==t}s($I,"eq");var N7=bK(function(){return arguments}())?bK:function(e){return Mb(e)&&wl.call(e,"callee")&&!FCe.call(e,"callee")},B7=Array.isArray;function U7(e){return e!=null&&RK(e.length)&&!V7(e)}s(U7,"isArrayLike");function APe(e){return Mb(e)&&U7(e)}s(APe,"isArrayLikeObject");var LK=RCe||NPe;function V7(e){if(!Tl(e))return!1;var t=NI(e);return t==SK||t==tCe||t==K3e||t==iCe}s(V7,"isFunction");function RK(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xK}s(RK,"isLength");function Tl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}s(Tl,"isObject");function Mb(e){return e!=null&&typeof e=="object"}s(Mb,"isObjectLike");function kPe(e){if(!Mb(e)||NI(e)!=CK)return!1;var t=EK(e);if(t===null)return!0;var r=wl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&LI.call(r)==kCe}s(kPe,"isPlainObject");var NK=pK?MCe(pK):cPe;function DPe(e){return gPe(e,BK(e))}s(DPe,"toPlainObject");var FPe=AK(function(e){return e.push(void 0,kK),MK(LPe,void 0,e)});function BK(e){return U7(e)?iPe(e,!0):uPe(e)}s(BK,"keysIn");var LPe=bPe(function(e,t,r,n){j7(e,t,r,n)});function RPe(e){return function(){return e}}s(RPe,"constant");function $K(e){return e}s($K,"identity");function NPe(){return!1}s(NPe,"stubFalse");Xm.exports=FPe});var OJ=W((w1t,Fb)=>{"use strict";d();var tTe=!1,Kp=!1,IJ=!0,SJ=!1,g={},CJ=!1;typeof Fb<"u"&&Fb.exports?(Fb.exports=g,CJ=!0):typeof document<"u"?window.ClipperLib=g:self.ClipperLib=g;var KI;CJ?(Zr="chrome",KI="Netscape"):(Zr=navigator.userAgent.toString().toLowerCase(),KI=navigator.appName);var Zr,ot={};Zr.indexOf("chrome")!=-1&&Zr.indexOf("chromium")==-1?ot.chrome=1:ot.chrome=0;Zr.indexOf("chromium")!=-1?ot.chromium=1:ot.chromium=0;Zr.indexOf("safari")!=-1&&Zr.indexOf("chrome")==-1&&Zr.indexOf("chromium")==-1?ot.safari=1:ot.safari=0;Zr.indexOf("firefox")!=-1?ot.firefox=1:ot.firefox=0;Zr.indexOf("firefox/17")!=-1?ot.firefox17=1:ot.firefox17=0;Zr.indexOf("firefox/15")!=-1?ot.firefox15=1:ot.firefox15=0;Zr.indexOf("firefox/3")!=-1?ot.firefox3=1:ot.firefox3=0;Zr.indexOf("opera")!=-1?ot.opera=1:ot.opera=0;Zr.indexOf("msie 10")!=-1?ot.msie10=1:ot.msie10=0;Zr.indexOf("msie 9")!=-1?ot.msie9=1:ot.msie9=0;Zr.indexOf("msie 8")!=-1?ot.msie8=1:ot.msie8=0;Zr.indexOf("msie 7")!=-1?ot.msie7=1:ot.msie7=0;Zr.indexOf("msie ")!=-1?ot.msie=1:ot.msie=0;g.biginteger_used=null;var Vc,rTe=0xdeadbeefcafe,vJ=(rTe&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 ht(){return new ne(null)}s(ht,"nbi");function nTe(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(nTe,"am1");function oTe(e,t,r,n,o,i){for(var a=t&32767,l=t>>15;--i>=0;){var c=this[e]&32767,p=this[e++]>>15,f=l*c+p*a;c=a*c+((f&32767)<<15)+r[n]+(o&1073741823),o=(c>>>30)+(f>>>15)+l*p+(o>>>30),r[n++]=c&1073741823}return o}s(oTe,"am2");function iTe(e,t,r,n,o,i){for(var a=t&16383,l=t>>14;--i>=0;){var c=this[e]&16383,p=this[e++]>>14,f=l*c+p*a;c=a*c+((f&16383)<<14)+r[n]+o,o=(c>>28)+(f>>14)+l*p,r[n++]=c&268435455}return o}s(iTe,"am3");vJ&&KI=="Microsoft Internet Explorer"?(ne.prototype.am=oTe,Vc=30):vJ&&KI!="Netscape"?(ne.prototype.am=nTe,Vc=26):(ne.prototype.am=iTe,Vc=28);ne.prototype.DB=Vc;ne.prototype.DM=(1<<Vc)-1;ne.prototype.DV=1<<Vc;var h6=52;ne.prototype.FV=Math.pow(2,h6);ne.prototype.F1=h6-Vc;ne.prototype.F2=2*Vc-h6;var sTe="0123456789abcdefghijklmnopqrstuvwxyz",QI=new Array,rh,Ii;rh=48;for(Ii=0;Ii<=9;++Ii)QI[rh++]=Ii;rh=97;for(Ii=10;Ii<36;++Ii)QI[rh++]=Ii;rh=65;for(Ii=10;Ii<36;++Ii)QI[rh++]=Ii;function xJ(e){return sTe.charAt(e)}s(xJ,"int2char");function PJ(e,t){var r=QI[e.charCodeAt(t)];return r==null?-1:r}s(PJ,"intAt");function aTe(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}s(aTe,"bnpCopyTo");function lTe(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(lTe,"bnpFromInt");function Uc(e){var t=ht();return t.fromInt(e),t}s(Uc,"nbv");function cTe(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:PJ(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(cTe,"bnpFromString");function uTe(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}s(uTe,"bnpClamp");function pTe(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=xJ(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+=xJ(n));return o?i:"0"}s(pTe,"bnToString");function dTe(){var e=ht();return ne.ZERO.subTo(this,e),e}s(dTe,"bnNegate");function fTe(){return this.s<0?this.negate():this}s(fTe,"bnAbs");function mTe(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(mTe,"bnCompareTo");function eS(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(eS,"nbits");function hTe(){return this.t<=0?0:this.DB*(this.t-1)+eS(this[this.t-1]^this.s&this.DM)}s(hTe,"bnBitLength");function yTe(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(yTe,"bnpDLShiftTo");function gTe(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(gTe,"bnpDRShiftTo");function bTe(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(bTe,"bnpLShiftTo");function vTe(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(vTe,"bnpRShiftTo");function xTe(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(xTe,"bnpSubTo");function ITe(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(ITe,"bnpMultiplyTo");function STe(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(STe,"bnpSquareTo");function CTe(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=ht());var i=ht(),a=this.s,l=e.s,c=this.DB-eS(n[n.t-1]);c>0?(n.lShiftTo(c,i),o.lShiftTo(c,r)):(n.copyTo(i),o.copyTo(r));var p=i.t,f=i[p-1];if(f!=0){var m=f*(1<<this.F1)+(p>1?i[p-2]>>this.F2:0),y=this.FV/m,v=(1<<this.F1)/m,x=1<<this.F2,S=r.t,I=S-p,P=t==null?ht():t;for(i.dlShiftTo(I,P),r.compareTo(P)>=0&&(r[r.t++]=1,r.subTo(P,r)),ne.ONE.dlShiftTo(p,P),P.subTo(i,i);i.t<p;)i[i.t++]=0;for(;--I>=0;){var T=r[--S]==f?this.DM:Math.floor(r[S]*y+(r[S-1]+x)*v);if((r[S]+=i.am(0,T,r,I,0,p))<T)for(i.dlShiftTo(I,P),r.subTo(P,r);r[S]<--T;)r.subTo(P,r)}t!=null&&(r.drShiftTo(p,t),a!=l&&ne.ZERO.subTo(t,t)),r.t=p,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&ne.ZERO.subTo(r,r)}}}s(CTe,"bnpDivRemTo");function PTe(e){var t=ht();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ne.ZERO)>0&&e.subTo(t,t),t}s(PTe,"bnMod");function Jp(e){this.m=e}s(Jp,"Classic");function TTe(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}s(TTe,"cConvert");function wTe(e){return e}s(wTe,"cRevert");function MTe(e){e.divRemTo(this.m,null,e)}s(MTe,"cReduce");function OTe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(OTe,"cMulTo");function ETe(e,t){e.squareTo(t),this.reduce(t)}s(ETe,"cSqrTo");Jp.prototype.convert=TTe;Jp.prototype.revert=wTe;Jp.prototype.reduce=MTe;Jp.prototype.mulTo=OTe;Jp.prototype.sqrTo=ETe;function _Te(){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(_Te,"bnpInvDigit");function Qp(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(Qp,"Montgomery");function ATe(e){var t=ht();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(ATe,"montConvert");function kTe(e){var t=ht();return e.copyTo(t),this.reduce(t),t}s(kTe,"montRevert");function DTe(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(DTe,"montReduce");function FTe(e,t){e.squareTo(t),this.reduce(t)}s(FTe,"montSqrTo");function LTe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(LTe,"montMulTo");Qp.prototype.convert=ATe;Qp.prototype.revert=kTe;Qp.prototype.reduce=DTe;Qp.prototype.mulTo=LTe;Qp.prototype.sqrTo=FTe;function RTe(){return(this.t>0?this[0]&1:this.s)==0}s(RTe,"bnpIsEven");function NTe(e,t){if(e>4294967295||e<1)return ne.ONE;var r=ht(),n=ht(),o=t.convert(this),i=eS(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(NTe,"bnpExp");function BTe(e,t){var r;return e<256||t.isEven()?r=new Jp(t):r=new Qp(t),this.exp(e,r)}s(BTe,"bnModPowInt");ne.prototype.copyTo=aTe;ne.prototype.fromInt=lTe;ne.prototype.fromString=cTe;ne.prototype.clamp=uTe;ne.prototype.dlShiftTo=yTe;ne.prototype.drShiftTo=gTe;ne.prototype.lShiftTo=bTe;ne.prototype.rShiftTo=vTe;ne.prototype.subTo=xTe;ne.prototype.multiplyTo=ITe;ne.prototype.squareTo=STe;ne.prototype.divRemTo=CTe;ne.prototype.invDigit=_Te;ne.prototype.isEven=RTe;ne.prototype.exp=NTe;ne.prototype.toString=pTe;ne.prototype.negate=dTe;ne.prototype.abs=fTe;ne.prototype.compareTo=mTe;ne.prototype.bitLength=hTe;ne.prototype.mod=PTe;ne.prototype.modPowInt=BTe;ne.ZERO=Uc(0);ne.ONE=Uc(1);function $Te(){var e=ht();return this.copyTo(e),e}s($Te,"bnClone");function jTe(){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(jTe,"bnIntValue");function GTe(){return this.t==0?this.s:this[0]<<24>>24}s(GTe,"bnByteValue");function UTe(){return this.t==0?this.s:this[0]<<16>>16}s(UTe,"bnShortValue");function VTe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}s(VTe,"bnpChunkSize");function zTe(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}s(zTe,"bnSigNum");function HTe(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=Uc(r),o=ht(),i=ht(),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(HTe,"bnpToRadix");function WTe(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=PJ(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(WTe,"bnpFromRadix");function qTe(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),y6,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(qTe,"bnpFromNumber");function ZTe(){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(ZTe,"bnToByteArray");function XTe(e){return this.compareTo(e)==0}s(XTe,"bnEquals");function YTe(e){return this.compareTo(e)<0?this:e}s(YTe,"bnMin");function KTe(e){return this.compareTo(e)>0?this:e}s(KTe,"bnMax");function JTe(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(JTe,"bnpBitwiseTo");function QTe(e,t){return e&t}s(QTe,"op_and");function ewe(e){var t=ht();return this.bitwiseTo(e,QTe,t),t}s(ewe,"bnAnd");function y6(e,t){return e|t}s(y6,"op_or");function twe(e){var t=ht();return this.bitwiseTo(e,y6,t),t}s(twe,"bnOr");function TJ(e,t){return e^t}s(TJ,"op_xor");function rwe(e){var t=ht();return this.bitwiseTo(e,TJ,t),t}s(rwe,"bnXor");function wJ(e,t){return e&~t}s(wJ,"op_andnot");function nwe(e){var t=ht();return this.bitwiseTo(e,wJ,t),t}s(nwe,"bnAndNot");function owe(){for(var e=ht(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}s(owe,"bnNot");function iwe(e){var t=ht();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}s(iwe,"bnShiftLeft");function swe(e){var t=ht();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}s(swe,"bnShiftRight");function awe(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(awe,"lbit");function lwe(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+awe(this[e]);return this.s<0?this.t*this.DB:-1}s(lwe,"bnGetLowestSetBit");function cwe(e){for(var t=0;e!=0;)e&=e-1,++t;return t}s(cwe,"cbit");function uwe(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=cwe(this[r]^t);return e}s(uwe,"bnBitCount");function pwe(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}s(pwe,"bnTestBit");function dwe(e,t){var r=ne.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}s(dwe,"bnpChangeBit");function fwe(e){return this.changeBit(e,y6)}s(fwe,"bnSetBit");function mwe(e){return this.changeBit(e,wJ)}s(mwe,"bnClearBit");function hwe(e){return this.changeBit(e,TJ)}s(hwe,"bnFlipBit");function ywe(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(ywe,"bnpAddTo");function gwe(e){var t=ht();return this.addTo(e,t),t}s(gwe,"bnAdd");function bwe(e){var t=ht();return this.subTo(e,t),t}s(bwe,"bnSubtract");function vwe(e){var t=ht();return this.multiplyTo(e,t),t}s(vwe,"bnMultiply");function xwe(){var e=ht();return this.squareTo(e),e}s(xwe,"bnSquare");function Iwe(e){var t=ht();return this.divRemTo(e,t,null),t}s(Iwe,"bnDivide");function Swe(e){var t=ht();return this.divRemTo(e,null,t),t}s(Swe,"bnRemainder");function Cwe(e){var t=ht(),r=ht();return this.divRemTo(e,t,r),new Array(t,r)}s(Cwe,"bnDivideAndRemainder");function Pwe(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}s(Pwe,"bnpDMultiply");function Twe(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(Twe,"bnpDAddOffset");function Lb(){}s(Lb,"NullExp");function MJ(e){return e}s(MJ,"nNop");function wwe(e,t,r){e.multiplyTo(t,r)}s(wwe,"nMulTo");function Mwe(e,t){e.squareTo(t)}s(Mwe,"nSqrTo");Lb.prototype.convert=MJ;Lb.prototype.revert=MJ;Lb.prototype.mulTo=wwe;Lb.prototype.sqrTo=Mwe;function Owe(e){return this.exp(e,new Lb)}s(Owe,"bnPow");function Ewe(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(Ewe,"bnpMultiplyLowerTo");function _we(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(_we,"bnpMultiplyUpperTo");function nh(e){this.r2=ht(),this.q3=ht(),ne.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}s(nh,"Barrett");function Awe(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=ht();return e.copyTo(t),this.reduce(t),t}s(Awe,"barrettConvert");function kwe(e){return e}s(kwe,"barrettRevert");function Dwe(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(Dwe,"barrettReduce");function Fwe(e,t){e.squareTo(t),this.reduce(t)}s(Fwe,"barrettSqrTo");function Lwe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}s(Lwe,"barrettMulTo");nh.prototype.convert=Awe;nh.prototype.revert=kwe;nh.prototype.reduce=Dwe;nh.prototype.mulTo=Lwe;nh.prototype.sqrTo=Fwe;function Rwe(e,t){var r=e.bitLength(),n,o=Uc(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 Jp(t):t.isEven()?i=new nh(t):i=new Qp(t);var a=new Array,l=3,c=n-1,p=(1<<n)-1;if(a[1]=i.convert(this),n>1){var f=ht();for(i.sqrTo(a[1],f);l<=p;)a[l]=ht(),i.mulTo(f,a[l-2],a[l]),l+=2}var m=e.t-1,y,v=!0,x=ht(),S;for(r=eS(e[m])-1;m>=0;){for(r>=c?y=e[m]>>r-c&p:(y=(e[m]&(1<<r+1)-1)<<c-r,m>0&&(y|=e[m-1]>>this.DB+r-c)),l=n;(y&1)==0;)y>>=1,--l;if((r-=l)<0&&(r+=this.DB,--m),v)a[y].copyTo(o),v=!1;else{for(;l>1;)i.sqrTo(o,x),i.sqrTo(x,o),l-=2;l>0?i.sqrTo(o,x):(S=o,o=x,x=S),i.mulTo(x,a[y],o)}for(;m>=0&&(e[m]&1<<r)==0;)i.sqrTo(o,x),S=o,o=x,x=S,--r<0&&(r=this.DB-1,--m)}return i.revert(o)}s(Rwe,"bnModPow");function Nwe(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(Nwe,"bnGCD");function Bwe(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(Bwe,"bnpModInt");function $we(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return ne.ZERO;for(var r=e.clone(),n=this.clone(),o=Uc(1),i=Uc(0),a=Uc(0),l=Uc(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($we,"bnModInverse");var Jn=[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],jwe=(1<<26)/Jn[Jn.length-1];function Gwe(e){var t,r=this.abs();if(r.t==1&&r[0]<=Jn[Jn.length-1]){for(t=0;t<Jn.length;++t)if(r[0]==Jn[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Jn.length;){for(var n=Jn[t],o=t+1;o<Jn.length&&n<jwe;)n*=Jn[o++];for(n=r.modInt(n);t<o;)if(n%Jn[t++]==0)return!1}return r.millerRabin(e)}s(Gwe,"bnIsProbablePrime");function Uwe(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>Jn.length&&(e=Jn.length);for(var o=ht(),i=0;i<e;++i){o.fromInt(Jn[Math.floor(Math.random()*Jn.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(Uwe,"bnpMillerRabin");ne.prototype.chunkSize=VTe;ne.prototype.toRadix=HTe;ne.prototype.fromRadix=WTe;ne.prototype.fromNumber=qTe;ne.prototype.bitwiseTo=JTe;ne.prototype.changeBit=dwe;ne.prototype.addTo=ywe;ne.prototype.dMultiply=Pwe;ne.prototype.dAddOffset=Twe;ne.prototype.multiplyLowerTo=Ewe;ne.prototype.multiplyUpperTo=_we;ne.prototype.modInt=Bwe;ne.prototype.millerRabin=Uwe;ne.prototype.clone=$Te;ne.prototype.intValue=jTe;ne.prototype.byteValue=GTe;ne.prototype.shortValue=UTe;ne.prototype.signum=zTe;ne.prototype.toByteArray=ZTe;ne.prototype.equals=XTe;ne.prototype.min=YTe;ne.prototype.max=KTe;ne.prototype.and=ewe;ne.prototype.or=twe;ne.prototype.xor=rwe;ne.prototype.andNot=nwe;ne.prototype.not=owe;ne.prototype.shiftLeft=iwe;ne.prototype.shiftRight=swe;ne.prototype.getLowestSetBit=lwe;ne.prototype.bitCount=uwe;ne.prototype.testBit=pwe;ne.prototype.setBit=fwe;ne.prototype.clearBit=mwe;ne.prototype.flipBit=hwe;ne.prototype.add=gwe;ne.prototype.subtract=bwe;ne.prototype.multiply=vwe;ne.prototype.divide=Iwe;ne.prototype.remainder=Swe;ne.prototype.divideAndRemainder=Cwe;ne.prototype.modPow=Rwe;ne.prototype.modInverse=$we;ne.prototype.pow=Owe;ne.prototype.gcd=Nwe;ne.prototype.isProbablePrime=Gwe;ne.prototype.square=xwe;var tt=ne;tt.prototype.IsNegative=function(){return this.compareTo(tt.ZERO)==-1};tt.op_Equality=function(e,t){return e.compareTo(t)==0};tt.op_Inequality=function(e,t){return e.compareTo(t)!=0};tt.op_GreaterThan=function(e,t){return e.compareTo(t)>0};tt.op_LessThan=function(e,t){return e.compareTo(t)<0};tt.op_Addition=function(e,t){return new tt(e).add(new tt(t))};tt.op_Subtraction=function(e,t){return new tt(e).subtract(new tt(t))};tt.Int128Mul=function(e,t){return new tt(e).multiply(new tt(t))};tt.op_Division=function(e,t){return e.divide(t)};tt.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof JI>"u"&&(JI=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 JI;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};JI(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)};ot.msie||ot.opera||ot.safari?g.Cast_Int32=function(e){return e|0}:g.Cast_Int32=function(e){return~~e};ot.chrome?g.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:ot.firefox&&typeof Number.toInteger=="function"?g.Cast_Int64=function(e){return Number.toInteger(e)}:ot.msie7||ot.msie8?g.Cast_Int64=function(e){return parseInt(e,10)}:ot.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,Kp)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};Kp?(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};SJ&&(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;tTe?(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&&tt.op_Equality(tt.Int128Mul(e.X-t.X,r.Y-t.Y),tt.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?tt.op_Equality(tt.Int128Mul(r.Delta.Y,n.Delta.X),tt.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?tt.op_Equality(tt.Int128Mul(o.Y-i.Y,i.X-a.X),tt.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?tt.op_Equality(tt.Int128Mul(o.Y-i.Y,a.X-l.X),tt.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?tt.op_Equality(tt.Int128Mul(e.Delta.Y,t.Delta.X),tt.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?tt.op_Equality(tt.Int128Mul(e.Y-t.Y,t.X-r.X),tt.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?tt.op_Equality(tt.Int128Mul(e.Y-t.Y,r.X-n.X),tt.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){IJ?!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],p=c,f=c;;){if(g.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==c&&(c=p.Next),p=this.RemoveEdge(p),f=p;continue}if(p.Prev==p.Next)break;if(r&&g.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==c&&(c=p.Next),p=this.RemoveEdge(p),p=p.Prev,f=p;continue}if(p=p.Next,p==f)break}if(!r&&p==p.Next||r&&p.Prev==p.Next)return!1;r||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=g.ClipperBase.Skip);var m=c;p=c;do this.InitEdge2(p,t),p=p.Next,a&&p.Curr.Y!=c.Curr.Y&&(a=!1);while(p!=c);if(a){if(r)return!1;p.Prev.OutIdx=g.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var y=new g.LocalMinima;for(y.Next=null,y.Y=p.Bot.Y,y.LeftBound=null,y.RightBound=p,y.RightBound.Side=g.EdgeSide.esRight,y.RightBound.WindDelta=0;p.Next.OutIdx!=g.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(y),this.m_edges.push(o),!0}this.m_edges.push(o);for(var v,x=null;p=this.FindNextLocMin(p),p!=x;){x==null&&(x=p);var y=new g.LocalMinima;y.Next=null,y.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(y.LeftBound=p.Prev,y.RightBound=p,v=!1):(y.LeftBound=p,y.RightBound=p.Prev,v=!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,p=this.ProcessBound(y.LeftBound,v);var S=this.ProcessBound(y.RightBound,!v);y.LeftBound.OutIdx==g.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==g.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),v||(p=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,Kp&&(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,Kp&&(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)};Kp&&(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),Kp&&(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),Kp&&(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,p;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),p=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),p=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 f=e.OutIdx,m=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==m){y.OutIdx=f,y.Side=p;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(IJ&&(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 p,f,m,y;e.PolyTyp==g.PolyType.ptSubject?(p=this.m_SubjFillType,m=this.m_ClipFillType):(p=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==g.PolyType.ptSubject?(f=this.m_SubjFillType,y=this.m_ClipFillType):(f=this.m_ClipFillType,y=this.m_SubjFillType);var v,x;switch(p){case g.PolyFillType.pftPositive:v=e.WindCnt;break;case g.PolyFillType.pftNegative:v=-e.WindCnt;break;default:v=Math.abs(e.WindCnt);break}switch(f){case g.PolyFillType.pftPositive:x=t.WindCnt;break;case g.PolyFillType.pftNegative:x=-t.WindCnt;break;default:x=Math.abs(t.WindCnt);break}if(a&&l)o||i||v!==0&&v!=1||x!==0&&x!=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)(x===0||x==1)&&(this.AddOutPt(e,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if(l)(v===0||v==1)&&(this.AddOutPt(t,r),g.Clipper.SwapSides(e,t),g.Clipper.SwapPolyIndexes(e,t));else if((v===0||v==1)&&(x===0||x==1)&&!o&&!i){var S,I;switch(m){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:I=t.WindCnt2;break;case g.PolyFillType.pftNegative:I=-t.WindCnt2;break;default:I=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(v==1&&x==1)switch(this.m_ClipType){case g.ClipType.ctIntersection:S>0&&I>0&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctUnion:S<=0&&I<=0&&this.AddLocalMinPoly(e,t,r);break;case g.ClipType.ctDifference:(e.PolyTyp==g.PolyType.ptClip&&S>0&&I>0||e.PolyTyp==g.PolyType.ptSubject&&S<=0&&I<=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,p=this.GetNextInAEL(e,n);p!==null&&!(p.Curr.X==e.Top.X&&e.NextInLML!==null&&p.Dx<e.NextInLML.Dx);){var f=this.GetNextInAEL(p,n);if(n==g.Direction.dLeftToRight&&p.Curr.X<=i||n==g.Direction.dRightToLeft&&p.Curr.X>=o){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),p==l&&c){n==g.Direction.dLeftToRight?this.IntersectEdges(e,p,p.Top,!1):this.IntersectEdges(p,e,p.Top,!1),l.OutIdx>=0&&g.Error("ProcessHorizontal error");return}else if(n==g.Direction.dLeftToRight){var m=new g.IntPoint(p.Curr.X,e.Curr.Y);this.IntersectEdges(e,p,m,!0)}else{var m=new g.IntPoint(p.Curr.X,e.Curr.Y);this.IntersectEdges(p,e,m,!0)}this.SwapPositionsInAEL(e,p)}else if(n==g.Direction.dLeftToRight&&p.Curr.X>=i||n==g.Direction.dRightToLeft&&p.Curr.X<=o)break;p=f}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 v=e.PrevInAEL,f=e.NextInAEL;if(v!==null&&v.Curr.X==e.Bot.X&&v.Curr.Y==e.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&g.ClipperBase.SlopesEqual(e,v,this.m_UseFullRange)){var x=this.AddOutPt(v,e.Bot);this.AddJoin(y,x,e.Top)}else if(f!==null&&f.Curr.X==e.Bot.X&&f.Curr.Y==e.Bot.Y&&f.WindDelta!==0&&f.OutIdx>=0&&f.Curr.Y>f.Top.Y&&g.ClipperBase.SlopesEqual(e,f,this.m_UseFullRange)){var x=this.AddOutPt(f,e.Bot);this.AddJoin(y,x,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{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 Vwe=s(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),zwe=s(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),Hwe=s(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),Wwe=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");ot.msie?g.Clipper.Round=Vwe:ot.chromium?g.Clipper.Round=Hwe:ot.safari?g.Clipper.Round=Wwe:g.Clipper.Round=zwe;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 p=a.Pt.Y>e.OffPt.Y;return c==p?!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 f={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,o.Pt.X,i.Pt.X,a.Pt.X,f))return!1;var m=f.Left,y=f.Right,v=new g.IntPoint,x;return n.Pt.X>=m&&n.Pt.X<=y?(v.X=n.Pt.X,v.Y=n.Pt.Y,x=n.Pt.X>o.Pt.X):i.Pt.X>=m&&i.Pt.X<=y?(v.X=i.Pt.X,v.Y=i.Pt.Y,x=i.Pt.X>a.Pt.X):o.Pt.X>=m&&o.Pt.X<=y?(v.X=o.Pt.X,v.Y=o.Pt.Y,x=o.Pt.X>n.Pt.X):(v.X=a.Pt.X,v.Y=a.Pt.Y,x=a.Pt.X>i.Pt.X),e.OutPt1=n,e.OutPt2=i,this.JoinHorz(n,o,i,a,v,x)}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 I=a.Pt.Y>i.Pt.Y||!g.ClipperBase.SlopesEqual(i.Pt,a.Pt,e.OffPt,this.m_UseFullRange);if(I){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==I?!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};SJ&&(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 p=new Array(i),f=0,m=e.length,y=e[f];f<m;f++,y=e[f])p[f]=new g.IntPoint(t[c].X+y.X,t[c].Y+y.Y);l.push(p)}else for(var c=0;c<a;c++){for(var p=new Array(i),f=0,m=e.length,y=e[f];f<m;f++,y=e[f])p[f]=new g.IntPoint(t[c].X-y.X,t[c].Y-y.Y);l.push(p)}for(var v=new Array,c=0;c<a-1+o;c++)for(var f=0;f<i;f++){var x=new Array;x.push(l[c%a][f%i]),x.push(l[(c+1)%a][f%i]),x.push(l[(c+1)%a][(f+1)%i]),x.push(l[c%a][(f+1)%i]),g.Clipper.Orientation(x)||x.reverse(),v.push(x)}var S=new g.Clipper(0);return S.AddPaths(v,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,p=0,f=i.length;p<f;++p){var c=g.Clipper.Minkowski(r,i[p],!0,o);l.AddPaths(c,g.PolyType.ptSubject,!0)}o&&l.AddPaths(i,g.PolyType.ptClip,!0);var m=new g.Paths;return l.Execute(g.ClipType.ctUnion,m,a,a),m}};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};JI(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 p=a;a=a*this.m_cos-this.m_sin*l,l=p*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 f=i-1,c=0;c<i;c++)f=this.OffsetPoint(c,f,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==g.EndType.etClosedLine){for(var f=i-1,c=0;c<i;c++)f=this.OffsetPoint(c,f,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=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(-m.X,-m.Y),f=0;for(var c=i-1;c>=0;c--)f=this.OffsetPoint(c,f,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var f=0,c=1;c<i-1;++c)f=this.OffsetPoint(c,f,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;f=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,f):this.DoRound(c,f)}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),f=i-1;for(var c=f-1;c>0;--c)f=this.OffsetPoint(c,f,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)):(f=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,p,f,m,y=[],v=0;v<o;v++)if(a=n[v],i=a.length,i!==0){if(i<3){l=a,y.push(l);continue}for(l=a,c=t*t,p=a[0],f=1,m=1;m<i;m++)(a[m].X-p.X)*(a[m].X-p.X)+(a[m].Y-p.Y)*(a[m].Y-p.Y)<=c||(l[f]=a[m],p=a[m],f++);p=a[f-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=c&&f--,f<i&&l.splice(f,i-f),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,p,f,m,y,v,x,S,I,P,T,M=e.length,w=t*t,E=[];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?(v=1,o.push({X:o[0].X,Y:o[0].Y}),l=o.length):v=0,y=[],n=0;n<l-2;n++)c=o[n],f=o[n+1],p=o[n+2],P=c.X,T=c.Y,x=p.X-P,S=p.Y-T,(x!==0||S!==0)&&(I=((f.X-P)*x+(f.Y-T)*S)/(x*x+S*S),I>1?(P=p.X,T=p.Y):I>0&&(P+=x*I,T+=S*I)),x=f.X-P,S=f.Y-T,m=x*x+S*S,m<=w&&(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}),v&&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&&E.push(a)}return!e[0]instanceof Array&&(E=E[0]),typeof E>"u"&&(E=[[]]),E};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,p=0,f=0,m=e.length;if(m<2)return 0;for(t&&(e[m]=e[0],m++);--m;)i=e[m],l=i.X,c=i.Y,a=e[m-1],p=a.X,f=a.Y,o+=n((l-p)*(l-p)+(c-f)*(c-f));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,p,f;for(l=0;l<o;l++)for(i=n[l],r.holes[l]=i.Contour(),c=0,p=i.Childs(),f=p.length;c<f;c++)a=p[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};Fb.exports=g});var YQ=W((Awt,YS)=>{d();(function(){"use strict";function e(a,l){var c=a.x-l.x,p=a.y-l.y;return c*c+p*p}s(e,"getSqDist");function t(a,l,c){var p=l.x,f=l.y,m=c.x-p,y=c.y-f;if(m!==0||y!==0){var v=((a.x-p)*m+(a.y-f)*y)/(m*m+y*y);v>1?(p=c.x,f=c.y):v>0&&(p+=m*v,f+=y*v)}return m=a.x-p,y=a.y-f,m*m+y*y}s(t,"getSqSegDist");function r(a,l){for(var c=a[0],p=[c],f,m=1,y=a.length;m<y;m++)f=a[m],e(f,c)>l&&(p.push(f),c=f);return c!==f&&p.push(f),p}s(r,"simplifyRadialDist");function n(a,l,c,p,f){for(var m=p,y,v=l+1;v<c;v++){var x=t(a[v],a[l],a[c]);x>m&&(y=v,m=x)}m>p&&(y-l>1&&n(a,l,y,p,f),f.push(a[y]),c-y>1&&n(a,y,c,p,f))}s(n,"simplifyDPStep");function o(a,l){var c=a.length-1,p=[a[0]];return n(a,0,c,l,p),p.push(a[c]),p}s(o,"simplifyDouglasPeucker");function i(a,l,c){if(a.length<=2)return a;var p=l!==void 0?l*l:1;return a=c?a:r(a,p),a=o(a,p),a}s(i,"simplify"),typeof define=="function"&&define.amd?define(function(){return i}):typeof YS<"u"?(YS.exports=i,YS.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});d();d();var $d=class $d{constructor(t,r,n){h(this,"__type",$d.__type);h(this,"id",_t());h(this,"latitude");h(this,"longitude");h(this,"floorId");h(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===$d.__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($d,"Coordinate"),h($d,"__type","coordinate");var w3=$d,Le=w3;d();var M3=class M3{constructor(t){h(this,"id");this.id=t}};s(M3,"BaseMetaData");var jr=M3;var ws,Un,Cu,Jl,jd=class jd extends jr{constructor(r,n){super(n.mvfData.properties.id);h(this,"__type",jd.__type);O(this,ws);O(this,Un,{});O(this,Cu);O(this,Jl);A(this,ws,r),A(this,Cu,n.floorId),A(this,Jl,n.mvfData)}static is(r){return r.__type===jd.__type}get locations(){return u(this,Un).locations?u(this,Un).locations:(u(this,Un).locations=(u(this,ws).locationIdsByNodeId[this.id]||[]).map(r=>u(this,ws).getById("enterprise-location",r)).filter(Boolean),u(this,Un).locations)}get space(){var r;return u(this,ws).getById("space",(r=u(this,ws).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=u(this,ws).getById("floor",u(this,Cu));if(r==null)throw new Error("Floor ".concat(u(this,Cu)," not found!"));return r}get coordinate(){if(u(this,Un).coordinate==null){let[r,n]=u(this,Jl).geometry.coordinates;u(this,Un).coordinate=new Le(n,r,u(this,Cu))}return u(this,Un).coordinate}get externalId(){var r;return(r=u(this,Jl).properties.externalId)!=null?r:""}get neighbors(){if(u(this,Un).neighbours==null){let r=u(this,Jl).properties.neighbors.map(n=>{let o=u(this,ws).getById("node",n.id);if(o==null)throw new Error("Node ".concat(n.id," not found!"));return o});u(this,Un).neighbours=r}return u(this,Un).neighbours}get geoJSON(){return{...u(this,Jl),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(u(this,Un)))delete u(this,Un)[r]}};ws=new WeakMap,Un=new WeakMap,Cu=new WeakMap,Jl=new WeakMap,s(jd,"Node"),h(jd,"__type","node");var O3=jd,Aa=O3;d();d();var Pu,E3=class E3{constructor(t,r){h(this,"id");O(this,Pu);this.id=t}get geoJSONBoundingBox(){return u(this,Pu)?u(this,Pu):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(A(this,Pu,Dd(this.geoJSON)),u(this,Pu))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Pu=new WeakMap,s(E3,"BaseMapData");var Ai=E3;var Ql,qo,ki,Ud,ny,A3,Gd=class Gd extends Ai{constructor(r,n){super(n.mvfData.id,r);O(this,ny);h(this,"__type",Gd.__type);O(this,Ql);O(this,qo,{});O(this,ki);O(this,Ud);A(this,Ql,r),A(this,ki,n.mvfData),A(this,Ud,n.facadeId)}static is(r){return r.__type===Gd.__type}get type(){return u(this,ki).type}get name(){var r;return(r=te(this,ny,A3).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=te(this,ny,A3).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=u(this,ki).externalId)!=null?r:""}get floors(){var r,n;if(u(this,qo).floors==null){let o=((n=(r=u(this,ki).floors)!=null?r:u(this,ki).maps)!=null?n:[]).reduce((i,a)=>{let l=u(this,Ql).floorsById[a];return l&&i.push(l),i},[]);o.length===0&&j.error("Floor stack ".concat(this.id," has no floors")),u(this,qo).floors=o}return u(this,qo).floors}get defaultFloor(){if(u(this,qo).defaultFloor!=null)return u(this,qo).defaultFloor;let r=u(this,ki).defaultFloor?u(this,Ql).getById("floor",u(this,ki).defaultFloor):void 0;return u(this,qo).defaultFloor=r||this.floors.reduce((n,o)=>Math.abs(o.elevation)<Math.abs(n.elevation)?o:n),u(this,qo).defaultFloor}get facade(){return u(this,Ud)?u(this,Ql).facadesById[u(this,Ud)]: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(u(this,qo)))delete u(this,qo)[r]}};Ql=new WeakMap,qo=new WeakMap,ki=new WeakMap,Ud=new WeakMap,ny=new WeakSet,A3=s(function(r){return u(this,Ql).getPropTranslation(this.__type,r,this.id,u(this,ki)[r])},"#translate"),s(Gd,"FloorStack"),h(Gd,"__type","floor-stack");var _3=Gd,oy=_3;d();d();d();d();d();d();var sy,ka,iy=class iy extends jr{constructor(r){super(String(_t()));O(this,sy,{});O(this,ka);A(this,ka,r.mvfData)}static is(r){return r.__type===iy.__type}get url(){return u(this,ka).url}get name(){if("displayName"in u(this,ka))return u(this,ka).displayName;if("label"in u(this,ka))return u(this,ka).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(u(this,sy)))delete u(this,sy)[r]}};sy=new WeakMap,ka=new WeakMap,s(iy,"Hyperlink"),h(iy,"__type","hyperlink");var k3=iy,ec=k3;d();d();function ay(e){return typeof e=="string"?e:e.id}s(ay,"getId");function F3(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}s(F3,"isPosition");var D3=8,Ms=s(e=>typeof e=="number"?e.toFixed(D3):F3(e)?e[1].toFixed(D3)+"-"+e[0].toFixed(D3):e.map(t=>Ms(t)).join("-"),"serializeCoords"),zee=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"),k0=s(e=>{if(!zee(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 cy,tc,Tu,ly=class ly extends jr{constructor(r){super(String(_t()));O(this,cy,{});O(this,tc);O(this,Tu);A(this,tc,r.mvfData),A(this,Tu,r.mapData)}static is(r){return r.__type===ly.__type}get url(){let r=u(this,tc).url;if(u(this,Tu).tokenManager==null)return r;let n=k0(u(this,tc).url);if(n==null)return r;let o=n.mapId;try{if(u(this,Tu).tokenManager.isEnterpriseMode())return r;let i=u(this,Tu).tokenManager.getSasToken(o).token;if(i==null||i==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(i)}catch(i){return j.error("Error getting SAS token for image",{error:i,url:r}),r}}get name(){return u(this,tc).altText}get altText(){return u(this,tc).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(u(this,cy)))delete u(this,cy)[r]}};cy=new WeakMap,tc=new WeakMap,Tu=new WeakMap,s(ly,"ImageMetaData"),h(ly,"__type","image");var L3=ly,rc=L3;var Vd,Di,Da,R3=class R3 extends Ai{constructor(r,n){super(n.properties.id,r);O(this,Vd);O(this,Di);O(this,Da,{});A(this,Vd,r),A(this,Di,n)}get externalId(){var r;return(r=u(this,Di).properties.externalId)!=null?r:""}get name(){var n,o,i,a,l;let r="";return"details"in u(this,Di).properties||(r=(n=u(this,Di).properties.externalId)!=null?n:""),r===""&&(r=(i=(o=u(this,Di).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=u(this,Di).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(u(this,Da).images!=null)return u(this,Da).images;let r=(i=(o=(n=u(this,Di).properties.details)==null?void 0:n.images)==null?void 0:o.map(c=>new rc({mvfData:c,mapData:u(this,Vd)})))!=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:[]),u(this,Da).images=r,r}get links(){var n,o,i,a,l;if(u(this,Da).links!=null)return u(this,Da).links;let r=(i=(o=(n=u(this,Di).properties.details)==null?void 0:n.links)==null?void 0:o.map(c=>new ec({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:[]),u(this,Da).links=r,r}get locationProfiles(){var r;return(r=u(this,Vd).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};Vd=new WeakMap,Di=new WeakMap,Da=new WeakMap,s(R3,"DetailedMapData");var on=R3;var uy,wu,Hd,Wd,zd=class zd extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",zd.__type);O(this,uy);O(this,wu);O(this,Hd,{});O(this,Wd);A(this,uy,r),A(this,wu,n.floorId),A(this,Wd,n.mvfData)}static is(r){return r.__type===zd.__type}get center(){var r;if(u(this,Hd).center==null){let[n,o]=(r=u(this,Wd).properties.center)!=null?r:[0,0];u(this,Hd).center=new Le(o,n,u(this,wu))}return u(this,Hd).center}get floor(){let r=u(this,uy).getById("floor",u(this,wu));if(r==null)throw new Error("Floor ".concat(u(this,wu)," not found!"));return r}get geoJSON(){return{...u(this,Wd),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};uy=new WeakMap,wu=new WeakMap,Hd=new WeakMap,Wd=new WeakMap,s(zd,"Area"),h(zd,"__type","area");var N3=zd,Fa=N3;d();var Mu,La,Ou,Zd,qd=class qd extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",qd.__type);O(this,Mu);O(this,La);O(this,Ou);O(this,Zd);A(this,La,{}),A(this,Zd,n.mvfData),A(this,Mu,r),A(this,Ou,n.floorId)}static is(r){return r.__type===qd.__type}get floor(){let r=u(this,Mu).getById("floor",u(this,Ou));if(r==null)throw new Error("Floor ".concat(u(this,Ou)," not found!"));return r}get center(){if(u(this,La).center==null){let[[r,n],[o,i]]=u(this,Zd).geometry.coordinates,a=(r+o)/2,l=(n+i)/2;u(this,La).center=new Le(l,a,u(this,Ou))}return u(this,La).center}get isExterior(){var o;let r=u(this,Mu).obstructionIdByEntranceId[this.id],n=u(this,Mu).getMVFFeatureById("obstruction",r);return(o=n==null?void 0:n.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...u(this,Zd),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(u(this,La)))delete u(this,La)[r]}};Mu=new WeakMap,La=new WeakMap,Ou=new WeakMap,Zd=new WeakMap,s(qd,"Door"),h(qd,"__type","door");var B3=qd,Fi=B3;d();var nc,Eu,Eo,Os,Xd=class Xd extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",Xd.__type);O(this,nc);O(this,Eu);O(this,Eo,{});O(this,Os);A(this,nc,r),A(this,Eu,n.floorId),A(this,Os,n.mvfData)}getMvfData(){return u(this,Os)}static is(r){return r.__type===Xd.__type}get type(){return Wee(u(this,Os).properties.kind)}get locations(){if(u(this,Eo).locations)return u(this,Eo).locations;u(this,Eo).locations=[];let r=u(this,nc).mvfLocationsBySpaceId[u(this,Os).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let o=u(this,nc).getById("enterprise-location",n.id);o&&u(this,Eo).locations.push(o)}return u(this,Eo).locations}get floor(){let r=u(this,nc).getById("floor",u(this,Eu));if(r==null)throw new Error("Floor ".concat(u(this,Eu)," not found!"));return r}get doors(){return u(this,Os).properties.destinationNodes.reduce((r,n)=>{let o=u(this,nc).doorsByNodeId[n];return o&&r.push(o),r},[])}get center(){var r;if(u(this,Eo).center==null){let[n,o]=(r=u(this,Os).properties.center)!=null?r:[0,0];u(this,Eo).center=new Le(o,n,u(this,Eu))}return u(this,Eo).center}get geoJSON(){return{...u(this,Os),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(u(this,Eo)))delete u(this,Eo)[r]}};nc=new WeakMap,Eu=new WeakMap,Eo=new WeakMap,Os=new WeakMap,s(Xd,"Space"),h(Xd,"__type","space");var $3=Xd,Hee=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Wee(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return Hee.includes(t)?t:"room"}s(Wee,"validateSpaceType");var Gr=$3;d();var Zo,Yt,Xo,py,G3,Yd=class Yd extends Ai{constructor(r,n){super(n.mvfData.properties.id,r);O(this,py);h(this,"__type",Yd.__type);O(this,Zo);O(this,Yt,{});O(this,Xo);A(this,Zo,r),A(this,Xo,n.mvfData)}static is(r){return r.__type===Yd.__type}get focusTarget(){return this}get name(){var r,n;return"name"in u(this,Xo).properties?(n=te(this,py,G3).call(this,"name"))!=null?n:"":(r=u(this,Xo).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in u(this,Xo).properties?(n=te(this,py,G3).call(this,"shortName"))!=null?n:"":(r=u(this,Xo).properties.externalId)!=null?r:""}get externalId(){var r;return(r=u(this,Xo).properties.externalId)!=null?r:""}get elevation(){return u(this,Xo).properties.elevation}get spaces(){if(u(this,Yt).spaces==null){let r=u(this,Zo).spaces.filter(n=>n.floor.id===this.id);u(this,Yt).spaces=r}return u(this,Yt).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=u(this,Xo).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(u(this,Yt).objects==null){let r=u(this,Zo).objects.filter(n=>n.floor.id===this.id);u(this,Yt).objects=r}return u(this,Yt).objects}get connections(){if(u(this,Yt).connections==null){let r=u(this,Zo).connections.filter(n=>n.floors.includes(this));u(this,Yt).connections=r}return u(this,Yt).connections}get doors(){if(u(this,Yt).doors==null){let r=u(this,Zo).doors.filter(n=>n.floor.id===this.id);u(this,Yt).doors=r}return u(this,Yt).doors}get annotations(){if(u(this,Yt).annotations==null){let r=u(this,Zo).annotations.filter(n=>n.floor.id===this.id);u(this,Yt).annotations=r}return u(this,Yt).annotations}get pois(){if(u(this,Yt).pois==null){let r=u(this,Zo).pointsOfInterest.filter(n=>n.floor.id===this.id);u(this,Yt).pois=r}return u(this,Yt).pois}get floorStack(){if(u(this,Yt).floorStack==null){let r=u(this,Zo).floorStacks.find(n=>n.floors.includes(this));u(this,Yt).floorStack=r}return u(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(u(this,Yt)))delete u(this,Yt)[r]}};Zo=new WeakMap,Yt=new WeakMap,Xo=new WeakMap,py=new WeakSet,G3=s(function(r){let n=u(this,Xo).properties[r];return u(this,Zo).getPropTranslation(this.__type,r,this.id,n)},"#translate"),s(Yd,"Floor"),h(Yd,"__type","floor");var j3=Yd,ao=j3;d();d();d();var dy=s(e=>e!=null,"notNull");d();function fy(e){let t;if(Gr.is(e)||Fi.is(e)||lo.is(e)||Fa.is(e)||Yo.is(e))t=e.center;else if(Ra.is(e)||Na.is(e))t=e.coordinate;else if(Le.is(e))t=e;else if(Aa.is(e))t=e.coordinate;else if(Es.is(e))t=e.coordinates[0];else return;return t}s(fy,"getCoordinateFromStuffs");d();d();var _u={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}},_s="ExteriorWalls",oc="Walls",K8=0,Kd="InteriorDoors",Jd="ExteriorDoors",Or="GeometryLayer",Ba="LabelsLayer",As="MarkersLayer",my="FootprintLayer",Qd="OcclusionLayer",J8="ImagesLayer",Au="FacadesLayer";var Q8=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],e_={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function U3(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&j.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}s(U3,"validateOptions");function V3(e,t){var o,i,a,l,c,p;let r=((o=e==null?void 0:e.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,n={..._u,...e,outdoorView:{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=_u.outdoorView)==null?void 0:l.layersHiddenByGeometry,...e==null?void 0:e.outdoorView},bearing:(p=(c=e==null?void 0:e.bearing)!=null?c:t.naturalBearing)!=null?p:0,imagePlacementOptions:{..._u.imagePlacementOptions,...e==null?void 0:e.imagePlacementOptions},multiFloorView:{..._u.multiFloorView,...e==null?void 0:e.multiFloorView}};return r&&n.outdoorView&&(n.outdoorView.token=r),n}s(V3,"handleShow3DMapOptionDefault");function t_(e){let t={remove_watermark:!1};if(e)try{let r=C0(e);Object.assign(t,r.capabilities)}catch(r){j.error("Error decoding capabilities from token",r)}return t}s(t_,"handleTokenCapabilities");var ic,Ko,$a,ef=class ef extends on{constructor(r,n){let o=Object.values(n.mvfDataByFloorId)[0];super(r,o);h(this,"__type",ef.__type);O(this,ic);O(this,Ko);O(this,$a);A(this,Ko,{}),A(this,ic,r),A(this,$a,n.mvfDataByFloorId)}static is(r){return r.__type===ef.__type}get accessible(){var r;return(r=Object.values(u(this,$a))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(u(this,$a))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(u(this,$a))[0].properties.extra}get coordinates(){return u(this,Ko).coordinates==null&&(u(this,Ko).coordinates=Object.entries(u(this,$a)).map(([r,n])=>new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),u(this,Ko).coordinates}get nodes(){return Object.values(u(this,$a))[0].properties.nodes.map(r=>u(this,ic).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?u(this,ic).getById("floor",r.floorId):void 0).filter(dy)}get locationProfiles(){var n,o,i,a,l;if(u(this,Ko).locationProfiles!=null)return u(this,Ko).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],p=Ms(c),f=(l=u(this,ic).mvfConnectionIdsByLatLon[p])!=null?l:[];for(let m of f){let y=u(this,ic).locationProfilesByAttachedFeatureId[m];if(y!=null){r=y;break}}}return u(this,Ko).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(u(this,Ko)))delete u(this,Ko)[r]}};ic=new WeakMap,Ko=new WeakMap,$a=new WeakMap,s(ef,"Connection"),h(ef,"__type","connection");var z3=ef,sc=z3;d();var hy,ku,ac,Du,tf=class tf extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",tf.__type);O(this,hy);O(this,ku);O(this,ac,{});O(this,Du);A(this,hy,r),A(this,ku,n.floorId),A(this,Du,n.mvfData)}static is(r){return r.__type===tf.__type}get type(){let r=u(this,Du).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=u(this,hy).getById("floor",u(this,ku));if(r==null)throw new Error("Floor ".concat(u(this,ku)," not found!"));return r}get center(){var r;if(u(this,ac).center==null){let[n,o]=(r=u(this,Du).properties.center)!=null?r:[0,0];u(this,ac).center=new Le(o,n,u(this,ku))}return u(this,ac).center}get geoJSON(){return{...u(this,Du),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(u(this,ac)))u(this,ac)[r]=null}};hy=new WeakMap,ku=new WeakMap,ac=new WeakMap,Du=new WeakMap,s(tf,"MapObject"),h(tf,"__type","object");var H3=tf,lo=H3;d();var yy,Fu,lc,nf,rf=class rf extends on{constructor(r,n){super(r,n.mvfData);h(this,"__type",rf.__type);O(this,yy);O(this,Fu);O(this,lc,{});O(this,nf);A(this,yy,r),A(this,nf,n.mvfData),A(this,Fu,n.floorId)}static is(r){return r.__type===rf.__type}get floor(){let r=u(this,yy).getById("floor",u(this,Fu));if(r==null)throw new Error("Floor ".concat(u(this,Fu)," not found!"));return r}get coordinate(){var r;if(u(this,lc).coordinate==null){let[n,o]=(r=u(this,nf).geometry.coordinates)!=null?r:[0,0];u(this,lc).coordinate=new Le(o,n,u(this,Fu))}return u(this,lc).coordinate}get geoJSON(){return{...u(this,nf),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 u(this,lc))u(this,lc)[r]=null}};yy=new WeakMap,Fu=new WeakMap,lc=new WeakMap,nf=new WeakMap,s(rf,"PointOfInterest"),h(rf,"__type","point-of-interest");var W3=rf,Ra=W3;d();var gy,Lu,cc,Ru,by,Z3,of=class of extends on{constructor(r,n){super(r,n.mvfData);O(this,by);h(this,"__type",of.__type);O(this,gy);O(this,Lu);O(this,cc,{});O(this,Ru);A(this,gy,r),A(this,Lu,n.floorId),A(this,Ru,n.mvfData)}static is(r){return r.__type===of.__type}get group(){return te(this,by,Z3).call(this).group}get type(){return te(this,by,Z3).call(this).type}get coordinate(){if(u(this,cc).coordinate==null){let[r,n]=u(this,Ru).geometry.coordinates;u(this,cc).coordinate=new Le(n,r,u(this,Lu))}return u(this,cc).coordinate}get floor(){let r=u(this,gy).getById("floor",u(this,Lu));if(r==null)throw new Error("Floor ".concat(u(this,Lu)," not found!"));return r}get geoJSON(){return{...u(this,Ru),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(u(this,cc)))delete u(this,cc)[r]}};gy=new WeakMap,Lu=new WeakMap,cc=new WeakMap,Ru=new WeakMap,by=new WeakSet,Z3=s(function(){let[r,n]=u(this,Ru).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),s(of,"Annotation"),h(of,"__type","annotation");var q3=of,Na=q3;d();var qee=s((e,t)=>{var c,p,f,m,y,v,x,S,I,P,T;let r={},n={},o={},i={},a={},l={};for(let M of e["location.json"]||[]){let w=new Nu(t,{mvfData:M});if(r[M.id]=w,M.externalId&&(i[M.externalId]==null&&(i[M.externalId]=[]),i[M.externalId].push(w)),M.categories)for(let B of M.categories)a[B]==null&&(a[B]=[]),a[B].push(w);let E=[...(p=(c=M.obstructions)==null?void 0:c.map(B=>B.id))!=null?p:[],...(m=(f=M.spaces)==null?void 0:f.map(B=>B.id))!=null?m:[],...(v=(y=M.annotations)==null?void 0:y.map(B=>B.id))!=null?v:[],...(x=M.connections)!=null?x:[],...(I=(S=M.entrances)==null?void 0:S.map(B=>B.id))!=null?I:[],...(T=(P=M.areas)==null?void 0:P.map(B=>B.id))!=null?T:[]];for(let B of E)B&&(l[B]==null&&(l[B]=[]),l[B].push(w))}for(let M of e["category.json"]||[]){let w=new xy(t,{mvfData:M});n[M.id]=w,M.parent&&(o[M.parent]==null&&(o[M.parent]=[]),o[M.parent].push(w))}return{locationCategoriesByParentId:o,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:i,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:l}},"processMVFLocationProfilesAndCategories"),Zee=s((e,t,r)=>{var I,P;let n={},o={},i={},a={},l={},c={},p={},f={},m={},y={},v={},x={},S=globalThis.Object.keys(e.space);for(let T of S){let M=e.space[T];if(M!=null)for(let w of M.features){x[w.properties.id]=T,p[w.properties.id]=w;for(let E of w.properties.destinationNodes)l[E]==null&&(l[E]=[]),l[E].push(w.properties.id);if(w.properties.kind==="desk-entrance"&&(c[w.properties.externalId]==null&&(c[w.properties.externalId]=[]),c[w.properties.externalId].push(...w.properties.destinationNodes)),!["void","desk-entrance"].includes((I=w.properties.kind)!=null?I:"")){if((P=w.properties.kind)!=null&&P.includes("connection")){let E=Ms(w.geometry.coordinates);y[E]==null&&(y[E]=[]),y[E].push(w.properties.id);continue}if(w.properties.kind==="poi"){let E=new Ra(r,{floorId:T,mvfData:w});i[w.properties.id]=E,m[T]||(m[T]=[]),m[T].push(w),w.properties.externalId&&(a[w.properties.externalId]==null&&(a[w.properties.externalId]=[]),a[w.properties.externalId].push(E))}else{let E=new Gr(r,{floorId:T,mvfData:w});n[w.properties.id]=E,w.properties.externalId&&(o[w.properties.externalId]==null&&(o[w.properties.externalId]=[]),o[w.properties.externalId].push(E)),f[T]||(f[T]=[]),f[T].push(w)}}}}for(let T in y){let M=y[T],w={};for(let B of M){let D=x[B],F=p[B],L=t==null?void 0:t["n_"+F.properties.id.split("s_")[1]];w[D]={...F,properties:{...F.properties,accessible:(L==null?void 0:L.accessible)===!0}}}let E=new sc(r,{mvfDataByFloorId:w});v[E.id]=E}return{spacesById:n,spacesByExternalId:o,poisById:i,poisByExternalId:a,connectionsById:v,spaceIdsByDestinationNodeId:l,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:p,connectionIdsByLatLon:y,mvfSpacesByFloorId:f,mvfPoisByFloorId:m}},"processMVFSpaces"),Xee=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 p=new Aa(t,{mvfData:c,floorId:(a=c.properties.floor)!=null?a:c.properties.map});r[c.properties.id]=p,c.properties.externalId&&(n[c.properties.externalId]==null&&(n[c.properties.externalId]=[]),n[c.properties.externalId].push(p));let f=(l=c.properties.floor)!=null?l:c.properties.map;i[f]||(i[f]=[]),i[f].push(c)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}},"processMVFNodes"),Yee=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 p of c.features){o[p.properties.id]=p;for(let m of p.properties.entrances)i[m]=p.properties.id;if(p.properties.kind==="Wall")continue;let f=new lo(t,{floorId:l,mvfData:p});r[p.properties.id]=f,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(f))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:o,obstructionIdByEntranceId:i}},"processMVFObstructions"),Kee=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 ao(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 ao(t,{mvfData:{properties:i}});r[i.id]=a}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:o}},"processMVFFloors"),Jee=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 p of l){let f=(c=e.facade)==null?void 0:c[p.id],m=new oy(t,{mvfData:p,facadeId:f==null?void 0:f.id});if(r[p.id]=m,p.externalId&&(n[p.externalId]==null&&(n[p.externalId]=[]),n[p.externalId].push(m)),o[p.id]=p,f){let y=new Yo(t,{mvfData:f,floorStackId:p.id});i[f.id]=y;for(let v of f.spaces)a[v.spaceId]=y}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:o,facadesById:i,facadesBySpaceId:a}},"processMVFFloorStacks"),Qee=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=Ms(l.geometry.coordinates);n[c]==null&&(n[c]=[]),n[c].push(a.id)}return i},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),ete=s((e,t)=>{let r={},n={},o={},i={},a={},l=globalThis.Object.keys(e.entrance);for(let c of l){let p=e.entrance[c];if(p!=null)for(let f of p.features){i[f.properties.id]=f;let m=new Fi(t,{floorId:c,mvfData:f});f.properties.node&&(o[f.properties.node]=m),r[f.properties.id]=m,f.properties.externalId&&(n[f.properties.externalId]==null&&(n[f.properties.externalId]=[]),n[f.properties.externalId].push(m)),a[c]||(a[c]=[]),a[c].push(f)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:o,mvfEntrancesById:i,mvfEntrancesByFloorId:a}},"processMVFEntrances"),tte=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 p=c.properties;p.textArea=l,p.textArea&&(p.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),rte=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 p=c.properties;p.image=l,p.image&&(p.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),nte=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 p=c.properties;p.style={styleId:i,edgeOffset:a.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),ote=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"),ite=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 p=new Na(t,{floorId:a,mvfData:c});r[c.properties.id]=p,o[a]||(o[a]=[]),o[a].push(c)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o}},"processMVFAnnotations"),ste=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 p=new Fa(t,{floorId:a,mvfData:c});r[c.properties.id]=p,c.properties.externalId&&(n[c.properties.externalId]==null&&(n[c.properties.externalId]=[]),n[c.properties.externalId].push(p))}}return{areasById:r,areasByExternalId:n,mvfAreasById:o}},"processMVFAreas"),r_=s((e,t)=>{var P,T,M,w,E,B,D,F,L,H,U,G,J;let r={},n={},o={},i={},a=((T=(P=e.enterprise)==null?void 0:P.locations)!=null?T:[]).reduce((X,ie)=>(X[ie.id]=ie,X),{}),l={},c={},p={},f={},m={},y={},v=((M=e.enterprise)==null?void 0:M.venue)||{},x={},S={};for(let X of(E=(w=e.enterprise)==null?void 0:w.categories)!=null?E:[]){let ie=new vy(t,{mvfData:X});l[X.id]=ie,X.externalId&&(c[X.externalId]==null&&(c[X.externalId]=[]),c[X.externalId].push(ie)),p[X.id]=X,X.locations.forEach(ee=>{m[ee]==null&&(m[ee]=[]),m[ee].push(X.id)})}let I={};for(let X of(D=(B=e.enterprise)==null?void 0:B.locationInstances)!=null?D:[]){let ie=a[X.parent],ee=Object.keys(ie),ge={};for(let pe of ee)ge[pe]=void 0;let ve={...ge,polygons:[],nodes:[],...X};I[ve.parent]==null&&(I[ve.parent]=[]),I[ve.parent].push(new Es(t,{mvfData:ve,categoryIds:((L=(F=e.enterprise)==null?void 0:F.categoryPriorities)==null?void 0:L[ve.id])||m[ve.id],parentId:X.parent})),x[ve.id]=X}for(let X in e.space){let ie=e.space[X];if(ie!=null)for(let ee of ie.features)for(let ge of ee.properties.destinationNodes)S[ge]==null&&(S[ge]=[]),S[ge].push(ee.properties.id)}for(let X of(U=(H=e.enterprise)==null?void 0:H.locations)!=null?U:[]){let ie=new Es(t,{mvfData:X,categoryIds:((J=(G=e.enterprise)==null?void 0:G.categoryPriorities)==null?void 0:J[X.id])||m[X.id],locationInstances:I[X.id]});o[X.id]=ie,X.externalId&&(i[X.externalId]==null&&(i[X.externalId]=[]),i[X.externalId].push(ie)),X.nodes.forEach(ee=>{y[ee.id]==null&&(y[ee.id]=[]),y[ee.id].push(X.id)});for(let ee of X.polygons)f[ee.id]==null&&(f[ee.id]=[]),f[ee.id].push(X)}if(t.enterpriseMode===!0){for(let X in t.mvfConnectionsById){let ie={},ee=t.mvfConnectionsById[X];for(let ge of t.mvfConnectionsById[X].nodes){let ve=t.nodesById[ge];ve!=null&&(ie[ve.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[ve.coordinate.longitude,ve.coordinate.latitude]},properties:{id:X,externalId:ee.externalId,kind:"enterprise."+ee.type,destinationNodes:[],flags:"",type:ee.type,nodes:ee.nodes,accessible:ee.accessible,extra:ee.extra,details:ee.details}})}Object.keys(ie).length>0&&(r[X]=new sc(t,{mvfDataByFloorId:ie}),ee.externalId&&(n[ee.externalId]==null&&(n[ee.externalId]=[]),n[ee.externalId].push(r[X])))}t.connectionsById=r}return{spaceIdsByNodeId:S,connectionsByExternalId:n,locationIdsByNodeId:y,mvfLocationsBySpaceId:f,mvfLocationsById:a,mvfCategoriesById:p,locationsById:o,locationsByExternalId:i,locationInstancesById:x,categoriesById:l,categoriesByExternalId:c,venue:v}},"createEnterpriseDataFromMVF"),n_=s((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}=Xee(e,t),{mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfConnectionIdsByLatLon:c}=Qee(e,o),{spacesById:p,spacesByExternalId:f,spaceIdsByDestinationNodeId:m,poisById:y,poisByExternalId:v,mvfSpacesById:x,objectEntranceNodeIdsByObstructionId:S,connectionsById:I,connectionIdsByLatLon:P,mvfSpacesByFloorId:T,mvfPoisByFloorId:M}=Zee(e,l,t),{objectsById:w,objectsByExternalId:E,mvfObstructionById:B,obstructionIdByEntranceId:D}=Yee(e,t),{floorsById:F,floorsByExternalId:L,mvfFloorsById:H}=Kee(e,t),{floorStacksById:U,floorStacksByExternalId:G,mvfFloorStacksById:J,facadesById:X,facadesBySpaceId:ie}=Jee(e,t),{doorsById:ee,doorsByExternalId:ge,doorsByNodeId:ve,mvfEntrancesById:pe,mvfEntrancesByFloorId:Ae}=ete(e,t),{annotationsById:yt,mvfAnnotationsById:it,mvfAnnotationsByFloorId:Ye}=ite(e,t),{areasById:Ve,areasByExternalId:de,mvfAreasById:he}=ste(e,t);rte(e,x,B),tte(e,x,B),nte(e,x),ote(e,x,B);let{locationCategoriesByParentId:re,locationProfilesById:se,locationCategoriesById:k,locationProfilesByExternalId:K,locationProfilesByCategoryId:R,locationProfilesByAttachedFeatureId:ce}=qee(e,t);return{spacesById:p,spacesByExternalId:f,nodesById:r,nodesByExternalId:n,objectsById:w,objectsByExternalId:E,floorsById:F,floorsByExternalId:L,floorStacksById:U,floorStacksByExternalId:G,facadesById:X,facadesBySpaceId:ie,connectionsById:I,doorsById:ee,doorsByExternalId:ge,doorsByNodeId:ve,poisById:y,poisByExternalId:v,annotationsById:yt,areasById:Ve,areasByExternalId:de,spaceIdsByDestinationNodeId:m,objectEntranceNodeIdsByObstructionId:S,obstructionIdByEntranceId:D,connectionIdsByLatLon:P,locationProfilesById:se,locationCategoriesById:k,locationProfilesByExternalId:K,locationProfilesByCategoryId:R,locationCategoriesByParentId:re,mvfSpacesById:x,mvfNodesById:o,mvfObstructionById:B,mvfFloorsById:H,mvfFloorStacksById:J,mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfEntrancesById:pe,mvfAnnotationsById:it,mvfNodesByFloorId:i,mvfSpacesByFloorId:T,mvfPoisByFloorId:M,mvfAreasById:he,mvfEntrancesByFloorId:Ae,mvfAnnotationsByFloorId:Ye,locationProfilesByAttachedFeatureId:ce,mvfConnectionIdsByLatLon:c}},"createDataFromMVF");d();d();d();var ate=s(function(){let t=globalThis.fetch;return{fetch(...r){if(!dy(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")(),o_=ate.fetch;var l_=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],i_=l_[0],c_="https://api-gateway.mappedin.com/track-analytics/a/",u_="deny-watchposition",p_="load-mapview",d_="load-mapdata",f_="change-language",m_="query-directions";var ja,Li,sf,D0,Y3=class Y3{constructor(){O(this,sf);O(this,ja,Object.freeze({}));O(this,Li);h(this,"oneTimeEventsSent",new Set);h(this,"sendGetDirectionsEvent",T8((t,r)=>this.sendAnalyticEvent(m_,{start:t,end:r,type:"location_to_location"}),2500));A(this,Li,te(this,sf,D0).call(this,u(this,ja)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){A(this,ja,{}),A(this,Li,te(this,sf,D0).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return A(this,ja,Object.freeze(Object.assign({},u(this,ja),t))),A(this,Li,te(this,sf,D0).call(this,t)),u(this,Li)}updateState(t){let r={...t};r.mapId&&(r.analyticsBaseUrl=X3({...u(this,Li),mapId:r.mapId})),r.context&&(r.context=a_(r.context)),r.baseUri&&(r.analyticsBaseUrl=X3({baseUri:r.baseUri,mapId:u(this,Li).mapId})),Object.assign(u(this,Li),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 u(this,Li)}getContext(){return this.getState().context||u(this,ja).context||i_}getSessionId(){return this.getState().sessionId||u(this,ja).sessionId||s_()}sendAnalyticEvent(t,r={}){let n=this.getState(),o=cte(n.analyticsBaseUrl,t),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":n.deviceId};if(n.logEvents&&j.log("Analytics.track",o,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return j.warn("Auth needs to be ready to send analytics.");let a={...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)),o_(o,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(t,r){if(pte.includes(t))return j.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=ute.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(d_,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(f_,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(u_)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(p_,{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)}};ja=new WeakMap,Li=new WeakMap,sf=new WeakSet,D0=s(function(t){var n,o,i,a;let r=(n=t.baseUri)!=null?n:c_;return{baseUri:r,analyticsBaseUrl:X3({...t,baseUri:r}),version:((o=b==null?void 0:b.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||lte(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||s_(),platformString:t.platformString||"",context:a_(t.context)||i_,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(Y3,"AnalyticsInternal");var af=Y3;function X3({mapId:e,baseUri:t=c_}){return"".concat(t).concat(e,"/")}s(X3,"getBaseUrl");function lte(){return vu.getInstance().loadLocalData("deviceId")}s(lte,"getDeviceIDFromStorage");function s_(){return vu.getInstance().loadSessionData("id")}s(s_,"getSessionIDFromStorage");function cte(e,t){return e+t}s(cte,"buildUrl");function a_(e){return l_.find(t=>t===e)}s(a_,"getValidContext");var ute=["$select-location","$select-category","$query-suggest","$query-search"],pte=[p_,d_,m_,u_,f_],M7e=new af,Ga,K3=class K3{constructor(t){O(this,Ga);h(this,"capture");h(this,"updateState");A(this,Ga,t),this.capture=u(this,Ga).capture.bind(u(this,Ga)),this.updateState=u(this,Ga).updateState.bind(u(this,Ga))}getState(){return Object.assign({},u(this,Ga).getState())}};Ga=new WeakMap,s(K3,"Analytics");var Iy=K3;d();var dte=new Set(["polygons"]),Ri,pr,co,Sy,lf=class lf extends jr{constructor(r,n){super(n.mvfData.externalId);h(this,"__type",lf.__type);h(this,"description");h(this,"name","");h(this,"amenity");h(this,"externalId","");h(this,"extra");h(this,"gallery");h(this,"instances");h(this,"logo");h(this,"operationHours");h(this,"phone");h(this,"picture");h(this,"shortName");h(this,"showFloatingLabelWhenImagePresent");h(this,"showLogo");h(this,"siblingGroups");h(this,"social");h(this,"sortOrder",-1);h(this,"states");h(this,"tags");h(this,"type","");O(this,Ri);O(this,pr,{});O(this,co);O(this,Sy);A(this,Ri,r),A(this,co,n.mvfData),A(this,Sy,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let o in n.mvfData)!dte.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(n.parentId){let i=u(this,Ri).locationsById[n.parentId];return u(this,co)[o]!=null?u(this,Ri).getPropTranslation(this.__type,o,u(this,co).id,u(this,co)[o]):u(this,Ri).getPropTranslation(this.__type,o,u(this,co).id,i[o])}return u(this,Ri).getPropTranslation(this.__type,o,u(this,co).id,u(this,co)[o])}})}static is(r){return r.__type===lf.__type}get focusTarget(){return this.spaces}get categories(){return u(this,pr).categories?u(this,pr).categories:(u(this,pr).categories=(u(this,Sy).map(r=>u(this,Ri).getById("enterprise-category",r))||[]).filter(Boolean),u(this,pr).categories)}get coordinates(){if(u(this,pr).coordinates)return u(this,pr).coordinates;u(this,pr).coordinates=[];for(let r=0;r<this.nodes.length;r++)u(this,pr).coordinates.push(this.nodes[r].coordinate);return u(this,pr).coordinates}get nodes(){if(u(this,pr).nodes)return u(this,pr).nodes;u(this,pr).nodes=[];for(let r=0;r<u(this,co).nodes.length;r++){let n=u(this,Ri).getById("node",u(this,co).nodes[r].id);n&&u(this,pr).nodes.push(n)}return u(this,pr).nodes}get spaces(){if(u(this,pr).spaces)return u(this,pr).spaces;u(this,pr).spaces=[];for(let r=0;r<u(this,co).polygons.length;r++){let n=u(this,Ri).getById("space",u(this,co).polygons[r].id);n&&u(this,pr).spaces.push(n)}return u(this,pr).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(u(this,pr)))delete u(this,pr)[r]}};Ri=new WeakMap,pr=new WeakMap,co=new WeakMap,Sy=new WeakMap,s(lf,"EnterpriseLocation"),h(lf,"__type","enterprise-location");var J3=lf,Es=J3;d();var fte=new Set,Bu,Vn,ks,cf=class cf extends jr{constructor(r,n){super(n.mvfData.externalId);h(this,"__type",cf.__type);h(this,"name","");h(this,"color");h(this,"externalId","");h(this,"extra");h(this,"icon");h(this,"iconFromDefaultList");h(this,"sortOrder",-1);h(this,"picture");O(this,Bu);O(this,Vn,{});O(this,ks);A(this,Bu,r),A(this,ks,n.mvfData);for(let o in n.mvfData)!fte.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return u(this,Bu).getPropTranslation(this.__type,o,u(this,ks).id,u(this,ks)[o])}})}static is(r){return r.__type===cf.__type}get children(){if(u(this,Vn).children)return u(this,Vn).children;u(this,Vn).children=[];for(let r=0;r<u(this,ks).children.length;r++){let n=u(this,Bu).getById("enterprise-category",u(this,ks).children[r]);n&&u(this,Vn).children.push(n)}return u(this,Vn).children}get locations(){if(u(this,Vn).locations)return u(this,Vn).locations;u(this,Vn).locations=[];for(let r=0;r<u(this,ks).locations.length;r++){let n=u(this,Bu).getById("enterprise-location",u(this,ks).locations[r]);n&&u(this,Vn).locations.push(n)}return u(this,Vn).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(u(this,Vn)))delete u(this,Vn)[r]}};Bu=new WeakMap,Vn=new WeakMap,ks=new WeakMap,s(cf,"EnterpriseCategory"),h(cf,"__type","enterprise-category");var Q3=cf,vy=Q3;d();var mte=new Set,Cy,Py,uf=class uf extends jr{constructor(r,n){super(n.mvfData.externalId);h(this,"__type",uf.__type);h(this,"countrycode");h(this,"externalId","");h(this,"defaultLanguage",{code:"en",name:"English"});h(this,"defaultMap");h(this,"extra");h(this,"icon");h(this,"languages",[]);h(this,"links",[]);h(this,"logo");h(this,"mappedinWebUrl");h(this,"slug","");h(this,"topLocations");h(this,"tzid");O(this,Cy,{});O(this,Py);A(this,Py,n.mvfData);for(let o in n.mvfData)!mte.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=n.mvfData[o])}static is(r){return r.__type===uf.__type}get name(){var r;return(r=u(this,Py).name)!=null?r:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(u(this,Cy)))delete u(this,Cy)[r]}};Cy=new WeakMap,Py=new WeakMap,s(uf,"EnterpriseVenue"),h(uf,"__type","enterprise-venue");var eC=uf,F0=eC;d();d();d();d();d();d();var wB=ys(vT(),1),MB=ys(PB(),1);d();var oae=s(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function yv(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(yv);let t={...e};for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let o=yv(n);if(oae(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]={...o,allOf:[o.allOf[i]]};continue}}t[r]=o}return t}s(yv,"cleanupInvalidArrayAllOf");var TB={$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 T_e=MB.default.default(new wB.default.default).compile(yv(TB));d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();var ut={};Pa(ut,{HasPropertyKey:()=>sae,IsArray:()=>wn,IsAsyncIterator:()=>wT,IsBigInt:()=>eg,IsBoolean:()=>bc,IsDate:()=>Xu,IsFunction:()=>MT,IsIterator:()=>OT,IsNull:()=>ET,IsNumber:()=>Ui,IsObject:()=>Vt,IsRegExp:()=>tg,IsString:()=>Kt,IsSymbol:()=>_T,IsUint8Array:()=>qa,IsUndefined:()=>gr});d();function sae(e,t){return t in e}s(sae,"HasPropertyKey");function wT(e){return Vt(e)&&!wn(e)&&!qa(e)&&Symbol.asyncIterator in e}s(wT,"IsAsyncIterator");function wn(e){return Array.isArray(e)}s(wn,"IsArray");function eg(e){return typeof e=="bigint"}s(eg,"IsBigInt");function bc(e){return typeof e=="boolean"}s(bc,"IsBoolean");function Xu(e){return e instanceof globalThis.Date}s(Xu,"IsDate");function MT(e){return typeof e=="function"}s(MT,"IsFunction");function OT(e){return Vt(e)&&!wn(e)&&!qa(e)&&Symbol.iterator in e}s(OT,"IsIterator");function ET(e){return e===null}s(ET,"IsNull");function Ui(e){return typeof e=="number"}s(Ui,"IsNumber");function Vt(e){return typeof e=="object"&&e!==null}s(Vt,"IsObject");function tg(e){return e instanceof globalThis.RegExp}s(tg,"IsRegExp");function Kt(e){return typeof e=="string"}s(Kt,"IsString");function _T(e){return typeof e=="symbol"}s(_T,"IsSymbol");function qa(e){return e instanceof globalThis.Uint8Array}s(qa,"IsUint8Array");function gr(e){return e===void 0}s(gr,"IsUndefined");function aae(e){return e.map(t=>gv(t))}s(aae,"ArrayType");function lae(e){return new Date(e.getTime())}s(lae,"DateType");function cae(e){return new Uint8Array(e)}s(cae,"Uint8ArrayType");function uae(e){return new RegExp(e.source,e.flags)}s(uae,"RegExpType");function pae(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=gv(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=gv(e[r]);return t}s(pae,"ObjectType");function gv(e){return wn(e)?aae(e):Xu(e)?lae(e):qa(e)?cae(e):tg(e)?uae(e):Vt(e)?pae(e):e}s(gv,"Visit");function nr(e){return gv(e)}s(nr,"Clone");function OB(e){return e.map(t=>rg(t))}s(OB,"CloneRest");function rg(e,t){return t===void 0?nr(e):nr({...t,...e})}s(rg,"CloneType");d();d();d();function bv(e){return He(e)&&Symbol.asyncIterator in e}s(bv,"IsAsyncIterator");function vv(e){return He(e)&&Symbol.iterator in e}s(vv,"IsIterator");function AT(e){return He(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}s(AT,"IsStandardObject");function xv(e){return e instanceof Promise}s(xv,"IsPromise");function Wn(e){return e instanceof Date&&Number.isFinite(e.getTime())}s(Wn,"IsDate");function EB(e){return e instanceof globalThis.Map}s(EB,"IsMap");function _B(e){return e instanceof globalThis.Set}s(_B,"IsSet");function ri(e){return ArrayBuffer.isView(e)}s(ri,"IsTypedArray");function Ef(e){return e instanceof globalThis.Uint8Array}s(Ef,"IsUint8Array");function Re(e,t){return t in e}s(Re,"HasPropertyKey");function He(e){return e!==null&&typeof e=="object"}s(He,"IsObject");function Ue(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}s(Ue,"IsArray");function br(e){return e===void 0}s(br,"IsUndefined");function Za(e){return e===null}s(Za,"IsNull");function Bs(e){return typeof e=="boolean"}s(Bs,"IsBoolean");function Me(e){return typeof e=="number"}s(Me,"IsNumber");function Iv(e){return Number.isInteger(e)}s(Iv,"IsInteger");function ln(e){return typeof e=="bigint"}s(ln,"IsBigInt");function pt(e){return typeof e=="string"}s(pt,"IsString");function vc(e){return typeof e=="function"}s(vc,"IsFunction");function Xa(e){return typeof e=="symbol"}s(Xa,"IsSymbol");function cn(e){return ln(e)||Bs(e)||Za(e)||Me(e)||pt(e)||Xa(e)||br(e)}s(cn,"IsValueType");var Ft;(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=He(a);return e.AllowArrayObject?l:l&&!Ue(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?Me(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})(Ft||(Ft={}));d();function dae(e){return globalThis.Object.freeze(e).map(t=>ng(t))}s(dae,"ImmutableArray");function fae(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=ng(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=ng(e[r]);return globalThis.Object.freeze(t)}s(fae,"ImmutableObject");function ng(e){return wn(e)?dae(e):Xu(e)?e:qa(e)?e:tg(e)?e:Vt(e)?fae(e):e}s(ng,"Immutable");function Q(e,t){let r=t!==void 0?{...t,...e}:e;switch(Ft.InstanceMode){case"freeze":return ng(r);case"clone":return nr(r);default:return r}}s(Q,"CreateType");d();var kT=class kT extends Error{constructor(t){super(t)}};s(kT,"TypeBoxError");var ke=kT;d();d();d();var or=Symbol.for("TypeBox.Transform"),Ya=Symbol.for("TypeBox.Readonly"),qn=Symbol.for("TypeBox.Optional"),ni=Symbol.for("TypeBox.Hint"),q=Symbol.for("TypeBox.Kind");function AB(e){return Vt(e)&&e[Ya]==="Readonly"}s(AB,"IsReadonly");function $s(e){return Vt(e)&&e[qn]==="Optional"}s($s,"IsOptional");function DT(e){return bt(e,"Any")}s(DT,"IsAny");function Ka(e){return bt(e,"Array")}s(Ka,"IsArray");function og(e){return bt(e,"AsyncIterator")}s(og,"IsAsyncIterator");function FT(e){return bt(e,"BigInt")}s(FT,"IsBigInt");function LT(e){return bt(e,"Boolean")}s(LT,"IsBoolean");function ig(e){return bt(e,"Constructor")}s(ig,"IsConstructor");function mae(e){return bt(e,"Date")}s(mae,"IsDate");function sg(e){return bt(e,"Function")}s(sg,"IsFunction");function Yu(e){return bt(e,"Integer")}s(Yu,"IsInteger");function _r(e){return bt(e,"Intersect")}s(_r,"IsIntersect");function ag(e){return bt(e,"Iterator")}s(ag,"IsIterator");function bt(e,t){return Vt(e)&&q in e&&e[q]===t}s(bt,"IsKindOf");function Ja(e){return bt(e,"Literal")}s(Ja,"IsLiteral");function _o(e){return bt(e,"MappedKey")}s(_o,"IsMappedKey");function sr(e){return bt(e,"MappedResult")}s(sr,"IsMappedResult");function xc(e){return bt(e,"Never")}s(xc,"IsNever");function hae(e){return bt(e,"Not")}s(hae,"IsNot");function yae(e){return bt(e,"Null")}s(yae,"IsNull");function Ku(e){return bt(e,"Number")}s(Ku,"IsNumber");function Ur(e){return bt(e,"Object")}s(Ur,"IsObject");function Ju(e){return bt(e,"Promise")}s(Ju,"IsPromise");function RT(e){return bt(e,"Record")}s(RT,"IsRecord");function NT(e){return bt(e,"Ref")}s(NT,"IsRef");function BT(e){return bt(e,"RegExp")}s(BT,"IsRegExp");function lg(e){return bt(e,"String")}s(lg,"IsString");function gae(e){return bt(e,"Symbol")}s(gae,"IsSymbol");function Ao(e){return bt(e,"TemplateLiteral")}s(Ao,"IsTemplateLiteral");function bae(e){return bt(e,"This")}s(bae,"IsThis");function _f(e){return Vt(e)&&or in e}s(_f,"IsTransform");function Vi(e){return bt(e,"Tuple")}s(Vi,"IsTuple");function vae(e){return bt(e,"Undefined")}s(vae,"IsUndefined");function Et(e){return bt(e,"Union")}s(Et,"IsUnion");function xae(e){return bt(e,"Uint8Array")}s(xae,"IsUint8Array");function Iae(e){return bt(e,"Unknown")}s(Iae,"IsUnknown");function Sae(e){return bt(e,"Unsafe")}s(Sae,"IsUnsafe");function Cae(e){return bt(e,"Void")}s(Cae,"IsVoid");function Ic(e){return Vt(e)&&q in e&&Kt(e[q])}s(Ic,"IsKind");function zi(e){return DT(e)||Ka(e)||LT(e)||FT(e)||og(e)||ig(e)||mae(e)||sg(e)||Yu(e)||_r(e)||ag(e)||Ja(e)||_o(e)||sr(e)||xc(e)||hae(e)||yae(e)||Ku(e)||Ur(e)||Ju(e)||RT(e)||NT(e)||BT(e)||lg(e)||gae(e)||Ao(e)||bae(e)||Vi(e)||vae(e)||Et(e)||xae(e)||Iae(e)||Sae(e)||Cae(e)||Ic(e)}s(zi,"IsSchema");var N={};Pa(N,{IsAny:()=>LB,IsArray:()=>RB,IsAsyncIterator:()=>NB,IsBigInt:()=>BB,IsBoolean:()=>$B,IsConstructor:()=>jB,IsDate:()=>GB,IsFunction:()=>UB,IsInteger:()=>VB,IsIntersect:()=>zB,IsIterator:()=>HB,IsKind:()=>h$,IsKindOf:()=>ft,IsLiteral:()=>ug,IsLiteralBoolean:()=>Eae,IsLiteralNumber:()=>qB,IsLiteralString:()=>WB,IsLiteralValue:()=>ZB,IsMappedKey:()=>XB,IsMappedResult:()=>YB,IsNever:()=>KB,IsNot:()=>JB,IsNull:()=>QB,IsNumber:()=>e$,IsObject:()=>t$,IsOptional:()=>Oae,IsPromise:()=>r$,IsProperties:()=>UT,IsReadonly:()=>Mae,IsRecord:()=>n$,IsRecursive:()=>_ae,IsRef:()=>o$,IsRegExp:()=>i$,IsSchema:()=>dt,IsString:()=>s$,IsSymbol:()=>a$,IsTemplateLiteral:()=>l$,IsThis:()=>c$,IsTransform:()=>Jt,IsTuple:()=>u$,IsUint8Array:()=>p$,IsUndefined:()=>Af,IsUnion:()=>VT,IsUnionLiteral:()=>Aae,IsUnknown:()=>d$,IsUnsafe:()=>f$,IsVoid:()=>m$,TypeGuardUnknownTypeError:()=>$T});d();var zT=class zT extends ke{};s(zT,"TypeGuardUnknownTypeError");var $T=zT,Pae=["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 kB(e){try{return new RegExp(e),!0}catch{return!1}}s(kB,"IsPattern");function jT(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(jT,"IsControlCharacterFree");function DB(e){return GT(e)||dt(e)}s(DB,"IsAdditionalProperties");function cg(e){return gr(e)||eg(e)}s(cg,"IsOptionalBigInt");function Zt(e){return gr(e)||Ui(e)}s(Zt,"IsOptionalNumber");function GT(e){return gr(e)||bc(e)}s(GT,"IsOptionalBoolean");function Rt(e){return gr(e)||Kt(e)}s(Rt,"IsOptionalString");function Tae(e){return gr(e)||Kt(e)&&jT(e)&&kB(e)}s(Tae,"IsOptionalPattern");function wae(e){return gr(e)||Kt(e)&&jT(e)}s(wae,"IsOptionalFormat");function FB(e){return gr(e)||dt(e)}s(FB,"IsOptionalSchema");function Mae(e){return Vt(e)&&e[Ya]==="Readonly"}s(Mae,"IsReadonly");function Oae(e){return Vt(e)&&e[qn]==="Optional"}s(Oae,"IsOptional");function LB(e){return ft(e,"Any")&&Rt(e.$id)}s(LB,"IsAny");function RB(e){return ft(e,"Array")&&e.type==="array"&&Rt(e.$id)&&dt(e.items)&&Zt(e.minItems)&&Zt(e.maxItems)&&GT(e.uniqueItems)&&FB(e.contains)&&Zt(e.minContains)&&Zt(e.maxContains)}s(RB,"IsArray");function NB(e){return ft(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Rt(e.$id)&&dt(e.items)}s(NB,"IsAsyncIterator");function BB(e){return ft(e,"BigInt")&&e.type==="bigint"&&Rt(e.$id)&&cg(e.exclusiveMaximum)&&cg(e.exclusiveMinimum)&&cg(e.maximum)&&cg(e.minimum)&&cg(e.multipleOf)}s(BB,"IsBigInt");function $B(e){return ft(e,"Boolean")&&e.type==="boolean"&&Rt(e.$id)}s($B,"IsBoolean");function jB(e){return ft(e,"Constructor")&&e.type==="Constructor"&&Rt(e.$id)&&wn(e.parameters)&&e.parameters.every(t=>dt(t))&&dt(e.returns)}s(jB,"IsConstructor");function GB(e){return ft(e,"Date")&&e.type==="Date"&&Rt(e.$id)&&Zt(e.exclusiveMaximumTimestamp)&&Zt(e.exclusiveMinimumTimestamp)&&Zt(e.maximumTimestamp)&&Zt(e.minimumTimestamp)&&Zt(e.multipleOfTimestamp)}s(GB,"IsDate");function UB(e){return ft(e,"Function")&&e.type==="Function"&&Rt(e.$id)&&wn(e.parameters)&&e.parameters.every(t=>dt(t))&&dt(e.returns)}s(UB,"IsFunction");function VB(e){return ft(e,"Integer")&&e.type==="integer"&&Rt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}s(VB,"IsInteger");function UT(e){return Vt(e)&&Object.entries(e).every(([t,r])=>jT(t)&&dt(r))}s(UT,"IsProperties");function zB(e){return ft(e,"Intersect")&&!(Kt(e.type)&&e.type!=="object")&&wn(e.allOf)&&e.allOf.every(t=>dt(t)&&!Jt(t))&&Rt(e.type)&&(GT(e.unevaluatedProperties)||FB(e.unevaluatedProperties))&&Rt(e.$id)}s(zB,"IsIntersect");function HB(e){return ft(e,"Iterator")&&e.type==="Iterator"&&Rt(e.$id)&&dt(e.items)}s(HB,"IsIterator");function ft(e,t){return Vt(e)&&q in e&&e[q]===t}s(ft,"IsKindOf");function WB(e){return ug(e)&&Kt(e.const)}s(WB,"IsLiteralString");function qB(e){return ug(e)&&Ui(e.const)}s(qB,"IsLiteralNumber");function Eae(e){return ug(e)&&bc(e.const)}s(Eae,"IsLiteralBoolean");function ug(e){return ft(e,"Literal")&&Rt(e.$id)&&ZB(e.const)}s(ug,"IsLiteral");function ZB(e){return bc(e)||Ui(e)||Kt(e)}s(ZB,"IsLiteralValue");function XB(e){return ft(e,"MappedKey")&&wn(e.keys)&&e.keys.every(t=>Ui(t)||Kt(t))}s(XB,"IsMappedKey");function YB(e){return ft(e,"MappedResult")&&UT(e.properties)}s(YB,"IsMappedResult");function KB(e){return ft(e,"Never")&&Vt(e.not)&&Object.getOwnPropertyNames(e.not).length===0}s(KB,"IsNever");function JB(e){return ft(e,"Not")&&dt(e.not)}s(JB,"IsNot");function QB(e){return ft(e,"Null")&&e.type==="null"&&Rt(e.$id)}s(QB,"IsNull");function e$(e){return ft(e,"Number")&&e.type==="number"&&Rt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}s(e$,"IsNumber");function t$(e){return ft(e,"Object")&&e.type==="object"&&Rt(e.$id)&&UT(e.properties)&&DB(e.additionalProperties)&&Zt(e.minProperties)&&Zt(e.maxProperties)}s(t$,"IsObject");function r$(e){return ft(e,"Promise")&&e.type==="Promise"&&Rt(e.$id)&&dt(e.item)}s(r$,"IsPromise");function n$(e){return ft(e,"Record")&&e.type==="object"&&Rt(e.$id)&&DB(e.additionalProperties)&&Vt(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&kB(r[0])&&Vt(t.patternProperties)&&dt(t.patternProperties[r[0]])})(e)}s(n$,"IsRecord");function _ae(e){return Vt(e)&&ni in e&&e[ni]==="Recursive"}s(_ae,"IsRecursive");function o$(e){return ft(e,"Ref")&&Rt(e.$id)&&Kt(e.$ref)}s(o$,"IsRef");function i$(e){return ft(e,"RegExp")&&Rt(e.$id)&&Kt(e.source)&&Kt(e.flags)&&Zt(e.maxLength)&&Zt(e.minLength)}s(i$,"IsRegExp");function s$(e){return ft(e,"String")&&e.type==="string"&&Rt(e.$id)&&Zt(e.minLength)&&Zt(e.maxLength)&&Tae(e.pattern)&&wae(e.format)}s(s$,"IsString");function a$(e){return ft(e,"Symbol")&&e.type==="symbol"&&Rt(e.$id)}s(a$,"IsSymbol");function l$(e){return ft(e,"TemplateLiteral")&&e.type==="string"&&Kt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}s(l$,"IsTemplateLiteral");function c$(e){return ft(e,"This")&&Rt(e.$id)&&Kt(e.$ref)}s(c$,"IsThis");function Jt(e){return Vt(e)&&or in e}s(Jt,"IsTransform");function u$(e){return ft(e,"Tuple")&&e.type==="array"&&Rt(e.$id)&&Ui(e.minItems)&&Ui(e.maxItems)&&e.minItems===e.maxItems&&(gr(e.items)&&gr(e.additionalItems)&&e.minItems===0||wn(e.items)&&e.items.every(t=>dt(t)))}s(u$,"IsTuple");function Af(e){return ft(e,"Undefined")&&e.type==="undefined"&&Rt(e.$id)}s(Af,"IsUndefined");function Aae(e){return VT(e)&&e.anyOf.every(t=>WB(t)||qB(t))}s(Aae,"IsUnionLiteral");function VT(e){return ft(e,"Union")&&Rt(e.$id)&&Vt(e)&&wn(e.anyOf)&&e.anyOf.every(t=>dt(t))}s(VT,"IsUnion");function p$(e){return ft(e,"Uint8Array")&&e.type==="Uint8Array"&&Rt(e.$id)&&Zt(e.minByteLength)&&Zt(e.maxByteLength)}s(p$,"IsUint8Array");function d$(e){return ft(e,"Unknown")&&Rt(e.$id)}s(d$,"IsUnknown");function f$(e){return ft(e,"Unsafe")}s(f$,"IsUnsafe");function m$(e){return ft(e,"Void")&&e.type==="void"&&Rt(e.$id)}s(m$,"IsVoid");function h$(e){return Vt(e)&&q in e&&Kt(e[q])&&!Pae.includes(e[q])}s(h$,"IsKind");function dt(e){return Vt(e)&&(LB(e)||RB(e)||$B(e)||BB(e)||NB(e)||jB(e)||GB(e)||UB(e)||VB(e)||zB(e)||HB(e)||ug(e)||XB(e)||YB(e)||KB(e)||JB(e)||QB(e)||e$(e)||t$(e)||r$(e)||n$(e)||o$(e)||i$(e)||s$(e)||a$(e)||l$(e)||c$(e)||u$(e)||Af(e)||VT(e)||p$(e)||d$(e)||f$(e)||m$(e)||h$(e))}s(dt,"IsSchema");d();var HT="(true|false)",pg="(0|[1-9][0-9]*)",WT="(.*)",kae="(?!.*)",ZAe="^".concat(HT,"$"),Qa="^".concat(pg,"$"),el="^".concat(WT,"$"),y$="^".concat(kae,"$");d();var Zn={};Pa(Zn,{Clear:()=>Fae,Delete:()=>Lae,Entries:()=>Dae,Get:()=>Bae,Has:()=>Rae,Set:()=>Nae});d();var kf=new Map;function Dae(){return new Map(kf)}s(Dae,"Entries");function Fae(){return kf.clear()}s(Fae,"Clear");function Lae(e){return kf.delete(e)}s(Lae,"Delete");function Rae(e){return kf.has(e)}s(Rae,"Has");function Nae(e,t){kf.set(e,t)}s(Nae,"Set");function Bae(e){return kf.get(e)}s(Bae,"Get");var Vr={};Pa(Vr,{Clear:()=>jae,Delete:()=>Gae,Entries:()=>$ae,Get:()=>zae,Has:()=>Uae,Set:()=>Vae});d();var Df=new Map;function $ae(){return new Map(Df)}s($ae,"Entries");function jae(){return Df.clear()}s(jae,"Clear");function Gae(e){return Df.delete(e)}s(Gae,"Delete");function Uae(e){return Df.has(e)}s(Uae,"Has");function Vae(e,t){Df.set(e,t)}s(Vae,"Set");function zae(e){return Df.get(e)}s(zae,"Get");d();function g$(e,t){return e.includes(t)}s(g$,"SetIncludes");function b$(e){return[...new Set(e)]}s(b$,"SetDistinct");function Hae(e,t){return e.filter(r=>t.includes(r))}s(Hae,"SetIntersect");function Wae(e,t){return e.reduce((r,n)=>Hae(r,n),t)}s(Wae,"SetIntersectManyResolve");function v$(e){return e.length===1?e[0]:e.length>1?Wae(e.slice(1),e[0]):[]}s(v$,"SetIntersectMany");function x$(e){let t=[];for(let r of e)t.push(...r);return t}s(x$,"SetUnionMany");d();function Sc(e){return Q({[q]:"Any"},e)}s(Sc,"Any");d();function Sv(e,t){return Q({[q]:"Array",type:"array",items:e},t)}s(Sv,"Array");d();function Cv(e,t){return Q({[q]:"AsyncIterator",type:"AsyncIterator",items:e},t)}s(Cv,"AsyncIterator");d();d();d();function qae(e,t){let{[t]:r,...n}=e;return n}s(qae,"DiscardKey");function Cr(e,t){return t.reduce((r,n)=>qae(r,n),e)}s(Cr,"Discard");d();function Nt(e){return Q({[q]:"Never",not:{}},e)}s(Nt,"Never");d();d();function vt(e){return Q({[q]:"MappedResult",properties:e})}s(vt,"MappedResult");d();d();function Pv(e,t,r){return Q({[q]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}s(Pv,"Constructor");d();function Cc(e,t,r){return Q({[q]:"Function",type:"Function",parameters:e,returns:t},r)}s(Cc,"Function");d();d();d();d();function dg(e,t){return Q({[q]:"Union",anyOf:e},t)}s(dg,"UnionCreate");function Zae(e){return e.some(t=>$s(t))}s(Zae,"IsUnionOptional");function I$(e){return e.map(t=>$s(t)?Xae(t):t)}s(I$,"RemoveOptionalFromRest");function Xae(e){return Cr(e,[qn])}s(Xae,"RemoveOptionalFromType");function Yae(e,t){return Zae(e)?ho(dg(I$(e),t)):dg(I$(e),t)}s(Yae,"ResolveUnion");function js(e,t){return e.length===0?Nt(t):e.length===1?Q(e[0],t):Yae(e,t)}s(js,"UnionEvaluated");d();function Bt(e,t){return e.length===0?Nt(t):e.length===1?Q(e[0],t):dg(e,t)}s(Bt,"Union");d();d();d();var ZT=class ZT extends ke{};s(ZT,"TemplateLiteralParserError");var Tv=ZT;function Kae(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}s(Kae,"Unescape");function qT(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}s(qT,"IsNonEscaped");function tl(e,t){return qT(e,t,"(")}s(tl,"IsOpenParen");function fg(e,t){return qT(e,t,")")}s(fg,"IsCloseParen");function S$(e,t){return qT(e,t,"|")}s(S$,"IsSeparator");function Jae(e){if(!(tl(e,0)&&fg(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(tl(e,r)&&(t+=1),fg(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}s(Jae,"IsGroup");function Qae(e){return e.slice(1,e.length-1)}s(Qae,"InGroup");function ele(e){let t=0;for(let r=0;r<e.length;r++)if(tl(e,r)&&(t+=1),fg(e,r)&&(t-=1),S$(e,r)&&t===0)return!0;return!1}s(ele,"IsPrecedenceOr");function tle(e){for(let t=0;t<e.length;t++)if(tl(e,t))return!0;return!1}s(tle,"IsPrecedenceAnd");function rle(e){let[t,r]=[0,0],n=[];for(let i=0;i<e.length;i++)if(tl(e,i)&&(t+=1),fg(e,i)&&(t-=1),S$(e,i)&&t===0){let a=e.slice(r,i);a.length>0&&n.push(Ff(a)),r=i+1}let o=e.slice(r);return o.length>0&&n.push(Ff(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}s(rle,"Or");function nle(e){function t(o,i){if(!tl(o,i))throw new Tv("TemplateLiteralParser: Index must point to open parens");let a=0;for(let l=i;l<o.length;l++)if(tl(o,l)&&(a+=1),fg(o,l)&&(a-=1),a===0)return[i,l];throw new Tv("TemplateLiteralParser: Unclosed group parens in expression")}s(t,"Group");function r(o,i){for(let a=i;a<o.length;a++)if(tl(o,a))return[i,a];return[i,o.length]}s(r,"Range");let n=[];for(let o=0;o<e.length;o++)if(tl(e,o)){let[i,a]=t(e,o),l=e.slice(i,a+1);n.push(Ff(l)),o=a}else{let[i,a]=r(e,o),l=e.slice(i,a);l.length>0&&n.push(Ff(l)),o=a-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}s(nle,"And");function Ff(e){return Jae(e)?Ff(Qae(e)):ele(e)?rle(e):tle(e)?nle(e):{type:"const",const:Kae(e)}}s(Ff,"TemplateLiteralParse");function Lf(e){return Ff(e.slice(1,e.length-1))}s(Lf,"TemplateLiteralParseExact");var YT=class YT extends ke{};s(YT,"TemplateLiteralFiniteError");var XT=YT;function ole(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(ole,"IsNumberExpression");function ile(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(ile,"IsBooleanExpression");function sle(e){return e.type==="const"&&e.const===".*"}s(sle,"IsStringExpression");function Qu(e){return ole(e)||sle(e)?!1:ile(e)?!0:e.type==="and"?e.expr.every(t=>Qu(t)):e.type==="or"?e.expr.every(t=>Qu(t)):e.type==="const"?!0:(()=>{throw new XT("Unknown expression type")})()}s(Qu,"IsTemplateLiteralExpressionFinite");function wv(e){let t=Lf(e.pattern);return Qu(t)}s(wv,"IsTemplateLiteralFinite");d();var JT=class JT extends ke{};s(JT,"TemplateLiteralGenerateError");var KT=JT;function*C$(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of C$(e.slice(1)))yield"".concat(t).concat(r)}s(C$,"GenerateReduce");function*ale(e){return yield*C$(e.expr.map(t=>[...mg(t)]))}s(ale,"GenerateAnd");function*lle(e){for(let t of e.expr)yield*mg(t)}s(lle,"GenerateOr");function*cle(e){return yield e.const}s(cle,"GenerateConst");function*mg(e){return e.type==="and"?yield*ale(e):e.type==="or"?yield*lle(e):e.type==="const"?yield*cle(e):(()=>{throw new KT("Unknown expression")})()}s(mg,"TemplateLiteralExpressionGenerate");function Rf(e){let t=Lf(e.pattern);return Qu(t)?[...mg(t)]:[]}s(Rf,"TemplateLiteralGenerate");d();d();function At(e,t){return Q({[q]:"Literal",const:e,type:typeof e},t)}s(At,"Literal");d();function Mv(e){return Q({[q]:"Boolean",type:"boolean"},e)}s(Mv,"Boolean");d();function Nf(e){return Q({[q]:"BigInt",type:"bigint"},e)}s(Nf,"BigInt");d();function Gs(e){return Q({[q]:"Number",type:"number"},e)}s(Gs,"Number");d();function oi(e){return Q({[q]:"String",type:"string"},e)}s(oi,"String");function*ule(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield Mv():t==="number"?yield Gs():t==="bigint"?yield Nf():t==="string"?yield oi():yield(()=>{let r=t.split("|").map(n=>At(n.trim()));return r.length===0?Nt():r.length===1?r[0]:js(r)})()}s(ule,"FromUnion");function*ple(e){if(e[1]!=="{"){let t=At("$"),r=QT(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=ule(e.slice(2,t)),n=QT(e.slice(t+1));return yield*[...r,...n]}yield At(e)}s(ple,"FromTerminal");function*QT(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=At(e.slice(0,t)),n=ple(e.slice(t));return yield*[r,...n]}yield At(e)}s(QT,"FromSyntax");function P$(e){return[...QT(e)]}s(P$,"TemplateLiteralSyntax");d();var rw=class rw extends ke{};s(rw,"TemplateLiteralPatternError");var ew=rw;function dle(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(dle,"Escape");function T$(e,t){return Ao(e)?e.pattern.slice(1,e.pattern.length-1):Et(e)?"(".concat(e.anyOf.map(r=>T$(r,t)).join("|"),")"):Ku(e)?"".concat(t).concat(pg):Yu(e)?"".concat(t).concat(pg):FT(e)?"".concat(t).concat(pg):lg(e)?"".concat(t).concat(WT):Ja(e)?"".concat(t).concat(dle(e.const.toString())):LT(e)?"".concat(t).concat(HT):(()=>{throw new ew("Unexpected Kind '".concat(e[q],"'"))})()}s(T$,"Visit");function tw(e){return"^".concat(e.map(t=>T$(t,"")).join(""),"$")}s(tw,"TemplateLiteralPattern");d();function ep(e){let r=Rf(e).map(n=>At(n));return js(r)}s(ep,"TemplateLiteralToUnion");d();function Ov(e,t){let r=Kt(e)?tw(P$(e)):tw(e);return Q({[q]:"TemplateLiteral",type:"string",pattern:r},t)}s(Ov,"TemplateLiteral");function fle(e){return Rf(e).map(r=>r.toString())}s(fle,"FromTemplateLiteral");function mle(e){let t=[];for(let r of e)t.push(...yo(r));return t}s(mle,"FromUnion");function hle(e){return[e.toString()]}s(hle,"FromLiteral");function yo(e){return[...new Set(Ao(e)?fle(e):Et(e)?mle(e.anyOf):Ja(e)?hle(e.const):Ku(e)?["[number]"]:Yu(e)?["[number]"]:[])]}s(yo,"IndexPropertyKeys");d();function yle(e,t,r){let n={};for(let o of Object.getOwnPropertyNames(t))n[o]=Bf(e,yo(t[o]),r);return n}s(yle,"FromProperties");function gle(e,t,r){return yle(e,t.properties,r)}s(gle,"FromMappedResult");function w$(e,t,r){let n=gle(e,t,r);return vt(n)}s(w$,"IndexFromMappedResult");function O$(e,t){return e.map(r=>E$(r,t))}s(O$,"FromRest");function ble(e){return e.filter(t=>!xc(t))}s(ble,"FromIntersectRest");function vle(e,t){return Ev(ble(O$(e,t)))}s(vle,"FromIntersect");function xle(e){return e.some(t=>xc(t))?[]:e}s(xle,"FromUnionRest");function Ile(e,t){return js(xle(O$(e,t)))}s(Ile,"FromUnion");function Sle(e,t){return t in e?e[t]:t==="[number]"?js(e):Nt()}s(Sle,"FromTuple");function Cle(e,t){return t==="[number]"?e:Nt()}s(Cle,"FromArray");function Ple(e,t){return t in e?e[t]:Nt()}s(Ple,"FromProperty");function E$(e,t){var r;return _r(e)?vle(e.allOf,t):Et(e)?Ile(e.anyOf,t):Vi(e)?Sle((r=e.items)!=null?r:[],t):Ka(e)?Cle(e.items,t):Ur(e)?Ple(e.properties,t):Nt()}s(E$,"IndexFromPropertyKey");function hg(e,t){return t.map(r=>E$(e,r))}s(hg,"IndexFromPropertyKeys");function M$(e,t){return js(hg(e,t))}s(M$,"FromSchema");function Bf(e,t,r){return sr(t)?w$(e,t,r):_o(t)?_$(e,t,r):Q(zi(t)?M$(e,yo(t)):M$(e,t),r)}s(Bf,"Index");function Tle(e,t,r){return{[t]:Bf(e,[t],nr(r))}}s(Tle,"MappedIndexPropertyKey");function wle(e,t,r){return t.reduce((n,o)=>({...n,...Tle(e,o,r)}),{})}s(wle,"MappedIndexPropertyKeys");function Mle(e,t,r){return wle(e,t.keys,r)}s(Mle,"MappedIndexProperties");function _$(e,t,r){let n=Mle(e,t,r);return vt(n)}s(_$,"IndexFromMappedKey");d();function _v(e,t){return Q({[q]:"Iterator",type:"Iterator",items:e},t)}s(_v,"Iterator");d();function Ole(e){let t=[];for(let r in e)$s(e[r])||t.push(r);return t}s(Ole,"RequiredKeys");function Ele(e,t){let r=Ole(e),n=r.length>0?{[q]:"Object",type:"object",properties:e,required:r}:{[q]:"Object",type:"object",properties:e};return Q(n,t)}s(Ele,"_Object");var zt=Ele;d();function Av(e,t){return Q({[q]:"Promise",type:"Promise",item:e},t)}s(Av,"Promise");d();d();function _le(e){return Q(Cr(e,[Ya]))}s(_le,"RemoveReadonly");function Ale(e){return Q({...e,[Ya]:"Readonly"})}s(Ale,"AddReadonly");function kle(e,t){return t===!1?_le(e):Ale(e)}s(kle,"ReadonlyWithFlag");function ii(e,t){let r=t!=null?t:!0;return sr(e)?A$(e,r):kle(e,r)}s(ii,"Readonly");function Dle(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ii(e[n],t);return r}s(Dle,"FromProperties");function Fle(e,t){return Dle(e.properties,t)}s(Fle,"FromMappedResult");function A$(e,t){let r=Fle(e,t);return vt(r)}s(A$,"ReadonlyFromMappedResult");d();function Us(e,t){return Q(e.length>0?{[q]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[q]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}s(Us,"Tuple");function k$(e,t){return e in t?si(e,t[e]):vt(t)}s(k$,"FromMappedResult");function Lle(e){return{[e]:At(e)}}s(Lle,"MappedKeyToKnownMappedResultProperties");function Rle(e){let t={};for(let r of e)t[r]=At(r);return t}s(Rle,"MappedKeyToUnknownMappedResultProperties");function Nle(e,t){return g$(t,e)?Lle(e):Rle(t)}s(Nle,"MappedKeyToMappedResultProperties");function Ble(e,t){let r=Nle(e,t);return k$(e,r)}s(Ble,"FromMappedKey");function yg(e,t){return t.map(r=>si(e,r))}s(yg,"FromRest");function $le(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=si(e,t[n]);return r}s($le,"FromProperties");function si(e,t){var n;let r={...t};return $s(t)?ho(si(e,Cr(t,[qn]))):AB(t)?ii(si(e,Cr(t,[Ya]))):sr(t)?k$(e,t.properties):_o(t)?Ble(e,t.keys):ig(t)?Pv(yg(e,t.parameters),si(e,t.returns),r):sg(t)?Cc(yg(e,t.parameters),si(e,t.returns),r):og(t)?Cv(si(e,t.items),r):ag(t)?_v(si(e,t.items),r):_r(t)?go(yg(e,t.allOf),r):Et(t)?Bt(yg(e,t.anyOf),r):Vi(t)?Us(yg(e,(n=t.items)!=null?n:[]),r):Ur(t)?zt($le(e,t.properties),r):Ka(t)?Sv(si(e,t.items),r):Ju(t)?Av(si(e,t.item),r):t}s(si,"FromSchemaType");function jle(e,t){let r={};for(let n of e)r[n]=si(n,t);return r}s(jle,"MappedFunctionReturnType");function D$(e,t,r){let n=zi(e)?yo(e):e,o=t({[q]:"MappedKey",keys:n}),i=jle(n,o);return zt(i,r)}s(D$,"Mapped");d();function Gle(e){return Q(Cr(e,[qn]))}s(Gle,"RemoveOptional");function Ule(e){return Q({...e,[qn]:"Optional"})}s(Ule,"AddOptional");function Vle(e,t){return t===!1?Gle(e):Ule(e)}s(Vle,"OptionalWithFlag");function ho(e,t){let r=t!=null?t:!0;return sr(e)?F$(e,r):Vle(e,r)}s(ho,"Optional");function zle(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ho(e[n],t);return r}s(zle,"FromProperties");function Hle(e,t){return zle(e.properties,t)}s(Hle,"FromMappedResult");function F$(e,t){let r=Hle(e,t);return vt(r)}s(F$,"OptionalFromMappedResult");d();function gg(e,t={}){let r=e.every(o=>Ur(o)),n=zi(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Q(t.unevaluatedProperties===!1||zi(t.unevaluatedProperties)||r?{...n,[q]:"Intersect",type:"object",allOf:e}:{...n,[q]:"Intersect",allOf:e},t)}s(gg,"IntersectCreate");function Wle(e){return e.every(t=>$s(t))}s(Wle,"IsIntersectOptional");function qle(e){return Cr(e,[qn])}s(qle,"RemoveOptionalFromType");function L$(e){return e.map(t=>$s(t)?qle(t):t)}s(L$,"RemoveOptionalFromRest");function Zle(e,t){return Wle(e)?ho(gg(L$(e),t)):gg(L$(e),t)}s(Zle,"ResolveIntersect");function Ev(e,t={}){if(e.length===0)return Nt(t);if(e.length===1)return Q(e[0],t);if(e.some(r=>_f(r)))throw new Error("Cannot intersect transform types");return Zle(e,t)}s(Ev,"IntersectEvaluated");d();function go(e,t){if(e.length===0)return Nt(t);if(e.length===1)return Q(e[0],t);if(e.some(r=>_f(r)))throw new Error("Cannot intersect transform types");return gg(e,t)}s(go,"Intersect");function R$(e){return e.map(t=>nw(t))}s(R$,"FromRest");function Xle(e){return go(R$(e))}s(Xle,"FromIntersect");function Yle(e){return Bt(R$(e))}s(Yle,"FromUnion");function Kle(e){return nw(e)}s(Kle,"FromPromise");function nw(e){return _r(e)?Xle(e.allOf):Et(e)?Yle(e.anyOf):Ju(e)?Kle(e.item):e}s(nw,"AwaitedResolve");function N$(e,t){return Q(nw(e),t)}s(N$,"Awaited");d();d();d();d();function B$(e){let t=[];for(let r of e)t.push(Qr(r));return t}s(B$,"FromRest");function Jle(e){let t=B$(e);return x$(t)}s(Jle,"FromIntersect");function Qle(e){let t=B$(e);return v$(t)}s(Qle,"FromUnion");function ece(e){return e.map((t,r)=>r.toString())}s(ece,"FromTuple");function tce(e){return["[number]"]}s(tce,"FromArray");function rce(e){return globalThis.Object.getOwnPropertyNames(e)}s(rce,"FromProperties");function nce(e){return ow?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}s(nce,"FromPatternProperties");function Qr(e){var t;return _r(e)?Jle(e.allOf):Et(e)?Qle(e.anyOf):Vi(e)?ece((t=e.items)!=null?t:[]):Ka(e)?tce(e.items):Ur(e)?rce(e.properties):RT(e)?nce(e.patternProperties):[]}s(Qr,"KeyOfPropertyKeys");var ow=!1;function rl(e){ow=!0;let t=Qr(e);ow=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}s(rl,"KeyOfPattern");function oce(e){return e.map(t=>t==="[number]"?Gs():At(t))}s(oce,"KeyOfPropertyKeysToRest");function kv(e,t){if(sr(e))return $$(e,t);{let r=Qr(e),n=oce(r),o=js(n);return Q(o,t)}}s(kv,"KeyOf");function ice(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=kv(e[n],nr(t));return r}s(ice,"FromProperties");function sce(e,t){return ice(e.properties,t)}s(sce,"FromMappedResult");function $$(e,t){let r=sce(e,t);return vt(r)}s($$,"KeyOfFromMappedResult");d();function Pc(e){let t=Qr(e),r=hg(e,t);return t.map((n,o)=>[t[o],r[o]])}s(Pc,"KeyOfPropertyEntries");function ace(e){let t=[];for(let r of e)t.push(...Qr(r));return b$(t)}s(ace,"CompositeKeys");function lce(e){return e.filter(t=>!xc(t))}s(lce,"FilterNever");function cce(e,t){let r=[];for(let n of e)r.push(...hg(n,[t]));return lce(r)}s(cce,"CompositeProperty");function uce(e,t){let r={};for(let n of t)r[n]=Ev(cce(e,n));return r}s(uce,"CompositeProperties");function j$(e,t){let r=ace(e),n=uce(e,r);return zt(n,t)}s(j$,"Composite");d();d();function Dv(e){return Q({[q]:"Date",type:"Date"},e)}s(Dv,"Date");d();function Fv(e){return Q({[q]:"Null",type:"null"},e)}s(Fv,"Null");d();function Lv(e){return Q({[q]:"Symbol",type:"symbol"},e)}s(Lv,"Symbol");d();function Rv(e){return Q({[q]:"Undefined",type:"undefined"},e)}s(Rv,"Undefined");d();function Nv(e){return Q({[q]:"Uint8Array",type:"Uint8Array"},e)}s(Nv,"Uint8Array");d();function nl(e){return Q({[q]:"Unknown"},e)}s(nl,"Unknown");function pce(e){return e.map(t=>iw(t,!1))}s(pce,"FromArray");function dce(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ii(iw(e[r],!1));return t}s(dce,"FromProperties");function Bv(e,t){return t===!0?e:ii(e)}s(Bv,"ConditionalReadonly");function iw(e,t){return wT(e)?Bv(Sc(),t):OT(e)?Bv(Sc(),t):wn(e)?ii(Us(pce(e))):qa(e)?Nv():Xu(e)?Dv():Vt(e)?Bv(zt(dce(e)),t):MT(e)?Bv(Cc([],nl()),t):gr(e)?Rv():ET(e)?Fv():_T(e)?Lv():eg(e)?Nf():Ui(e)?At(e):bc(e)?At(e):Kt(e)?At(e):zt({})}s(iw,"FromValue");function G$(e,t){return Q(iw(e,!0),t)}s(G$,"Const");d();function U$(e,t){return Us(e.parameters,t)}s(U$,"ConstructorParameters");d();function bg(e,t){return e.map(r=>Hi(r,t))}s(bg,"FromRest");function fce(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Hi(e[n],t);return r}s(fce,"FromProperties");function mce(e,t){return e.parameters=bg(e.parameters,t),e.returns=Hi(e.returns,t),e}s(mce,"FromConstructor");function hce(e,t){return e.parameters=bg(e.parameters,t),e.returns=Hi(e.returns,t),e}s(hce,"FromFunction");function yce(e,t){return e.allOf=bg(e.allOf,t),e}s(yce,"FromIntersect");function gce(e,t){return e.anyOf=bg(e.anyOf,t),e}s(gce,"FromUnion");function bce(e,t){return gr(e.items)||(e.items=bg(e.items,t)),e}s(bce,"FromTuple");function vce(e,t){return e.items=Hi(e.items,t),e}s(vce,"FromArray");function xce(e,t){return e.properties=fce(e.properties,t),e}s(xce,"FromObject");function Ice(e,t){return e.item=Hi(e.item,t),e}s(Ice,"FromPromise");function Sce(e,t){return e.items=Hi(e.items,t),e}s(Sce,"FromAsyncIterator");function Cce(e,t){return e.items=Hi(e.items,t),e}s(Cce,"FromIterator");function Pce(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 Hi(n,t)}s(Pce,"FromRef");function Tce(e,t){return ig(e)?mce(e,t):sg(e)?hce(e,t):_r(e)?yce(e,t):Et(e)?gce(e,t):Vi(e)?bce(e,t):Ka(e)?vce(e,t):Ur(e)?xce(e,t):Ju(e)?Ice(e,t):og(e)?Sce(e,t):ag(e)?Cce(e,t):NT(e)?Pce(e,t):e}s(Tce,"DerefResolve");function Hi(e,t){return Tce(rg(e),OB(t))}s(Hi,"Deref");d();function V$(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=>At(i));return Bt(o,{...t,[ni]:"Enum"})}s(V$,"Enum");d();d();d();var dw=class dw extends ke{};s(dw,"ExtendsResolverError");var aw=dw,Y;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(Y||(Y={}));function ai(e){return e===Y.False?e:Y.True}s(ai,"IntoBooleanResult");function $f(e){throw new aw(e)}s($f,"Throw");function Fr(e){return N.IsNever(e)||N.IsIntersect(e)||N.IsUnion(e)||N.IsUnknown(e)||N.IsAny(e)}s(Fr,"IsStructuralRight");function Lr(e,t){return N.IsNever(t)?Y$(e,t):N.IsIntersect(t)?$v(e,t):N.IsUnion(t)?pw(e,t):N.IsUnknown(t)?ej(e,t):N.IsAny(t)?uw(e,t):$f("StructuralRight")}s(Lr,"StructuralRight");function uw(e,t){return Y.True}s(uw,"FromAnyRight");function wce(e,t){return N.IsIntersect(t)?$v(e,t):N.IsUnion(t)&&t.anyOf.some(r=>N.IsAny(r)||N.IsUnknown(r))?Y.True:N.IsUnion(t)?Y.Union:N.IsUnknown(t)||N.IsAny(t)?Y.True:Y.Union}s(wce,"FromAny");function Mce(e,t){return N.IsUnknown(e)?Y.False:N.IsAny(e)?Y.Union:N.IsNever(e)?Y.True:Y.False}s(Mce,"FromArrayRight");function Oce(e,t){return N.IsObject(t)&&jv(t)?Y.True:Fr(t)?Lr(e,t):N.IsArray(t)?ai($t(e.items,t.items)):Y.False}s(Oce,"FromArray");function Ece(e,t){return Fr(t)?Lr(e,t):N.IsAsyncIterator(t)?ai($t(e.items,t.items)):Y.False}s(Ece,"FromAsyncIterator");function _ce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsBigInt(t)?Y.True:Y.False}s(_ce,"FromBigInt");function Z$(e,t){return N.IsLiteralBoolean(e)||N.IsBoolean(e)?Y.True:Y.False}s(Z$,"FromBooleanRight");function Ace(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsBoolean(t)?Y.True:Y.False}s(Ace,"FromBoolean");function kce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsConstructor(t)?e.parameters.length>t.parameters.length?Y.False:e.parameters.every((r,n)=>ai($t(t.parameters[n],r))===Y.True)?ai($t(e.returns,t.returns)):Y.False:Y.False}s(kce,"FromConstructor");function Dce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsDate(t)?Y.True:Y.False}s(Dce,"FromDate");function Fce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsFunction(t)?e.parameters.length>t.parameters.length?Y.False:e.parameters.every((r,n)=>ai($t(t.parameters[n],r))===Y.True)?ai($t(e.returns,t.returns)):Y.False:Y.False}s(Fce,"FromFunction");function X$(e,t){return N.IsLiteral(e)&&ut.IsNumber(e.const)||N.IsNumber(e)||N.IsInteger(e)?Y.True:Y.False}s(X$,"FromIntegerRight");function Lce(e,t){return N.IsInteger(t)||N.IsNumber(t)?Y.True:Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):Y.False}s(Lce,"FromInteger");function $v(e,t){return t.allOf.every(r=>$t(e,r)===Y.True)?Y.True:Y.False}s($v,"FromIntersectRight");function Rce(e,t){return e.allOf.some(r=>$t(r,t)===Y.True)?Y.True:Y.False}s(Rce,"FromIntersect");function Nce(e,t){return Fr(t)?Lr(e,t):N.IsIterator(t)?ai($t(e.items,t.items)):Y.False}s(Nce,"FromIterator");function Bce(e,t){return N.IsLiteral(t)&&t.const===e.const?Y.True:Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsString(t)?Q$(e,t):N.IsNumber(t)?K$(e,t):N.IsInteger(t)?X$(e,t):N.IsBoolean(t)?Z$(e,t):Y.False}s(Bce,"FromLiteral");function Y$(e,t){return Y.False}s(Y$,"FromNeverRight");function $ce(e,t){return Y.True}s($ce,"FromNever");function z$(e){let[t,r]=[e,0];for(;N.IsNot(t);)t=t.not,r+=1;return r%2===0?t:nl()}s(z$,"UnwrapTNot");function jce(e,t){return N.IsNot(e)?$t(z$(e),t):N.IsNot(t)?$t(e,z$(t)):$f("Invalid fallthrough for Not")}s(jce,"FromNot");function Gce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsNull(t)?Y.True:Y.False}s(Gce,"FromNull");function K$(e,t){return N.IsLiteralNumber(e)||N.IsNumber(e)||N.IsInteger(e)?Y.True:Y.False}s(K$,"FromNumberRight");function Uce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsInteger(t)||N.IsNumber(t)?Y.True:Y.False}s(Uce,"FromNumber");function bo(e,t){return Object.getOwnPropertyNames(e.properties).length===t}s(bo,"IsObjectPropertyCount");function H$(e){return jv(e)}s(H$,"IsObjectStringLike");function W$(e){return bo(e,0)||bo(e,1)&&"description"in e.properties&&N.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(N.IsString(e.properties.description.anyOf[0])&&N.IsUndefined(e.properties.description.anyOf[1])||N.IsString(e.properties.description.anyOf[1])&&N.IsUndefined(e.properties.description.anyOf[0]))}s(W$,"IsObjectSymbolLike");function sw(e){return bo(e,0)}s(sw,"IsObjectNumberLike");function q$(e){return bo(e,0)}s(q$,"IsObjectBooleanLike");function Vce(e){return bo(e,0)}s(Vce,"IsObjectBigIntLike");function zce(e){return bo(e,0)}s(zce,"IsObjectDateLike");function Hce(e){return jv(e)}s(Hce,"IsObjectUint8ArrayLike");function Wce(e){let t=Gs();return bo(e,0)||bo(e,1)&&"length"in e.properties&&ai($t(e.properties.length,t))===Y.True}s(Wce,"IsObjectFunctionLike");function qce(e){return bo(e,0)}s(qce,"IsObjectConstructorLike");function jv(e){let t=Gs();return bo(e,0)||bo(e,1)&&"length"in e.properties&&ai($t(e.properties.length,t))===Y.True}s(jv,"IsObjectArrayLike");function Zce(e){let t=Cc([Sc()],Sc());return bo(e,0)||bo(e,1)&&"then"in e.properties&&ai($t(e.properties.then,t))===Y.True}s(Zce,"IsObjectPromiseLike");function J$(e,t){return $t(e,t)===Y.False||N.IsOptional(e)&&!N.IsOptional(t)?Y.False:Y.True}s(J$,"Property");function Mn(e,t){return N.IsUnknown(e)?Y.False:N.IsAny(e)?Y.Union:N.IsNever(e)||N.IsLiteralString(e)&&H$(t)||N.IsLiteralNumber(e)&&sw(t)||N.IsLiteralBoolean(e)&&q$(t)||N.IsSymbol(e)&&W$(t)||N.IsBigInt(e)&&Vce(t)||N.IsString(e)&&H$(t)||N.IsSymbol(e)&&W$(t)||N.IsNumber(e)&&sw(t)||N.IsInteger(e)&&sw(t)||N.IsBoolean(e)&&q$(t)||N.IsUint8Array(e)&&Hce(t)||N.IsDate(e)&&zce(t)||N.IsConstructor(e)&&qce(t)||N.IsFunction(e)&&Wce(t)?Y.True:N.IsRecord(e)&&N.IsString(lw(e))?t[ni]==="Record"?Y.True:Y.False:N.IsRecord(e)&&N.IsNumber(lw(e))?bo(t,0)?Y.True:Y.False:Y.False}s(Mn,"FromObjectRight");function Xce(e,t){return Fr(t)?Lr(e,t):N.IsRecord(t)?li(e,t):N.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!N.IsOptional(t.properties[r]))return Y.False;if(N.IsOptional(t.properties[r]))return Y.True;if(J$(e.properties[r],t.properties[r])===Y.False)return Y.False}return Y.True})():Y.False}s(Xce,"FromObject");function Yce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)&&Zce(t)?Y.True:N.IsPromise(t)?ai($t(e.item,t.item)):Y.False}s(Yce,"FromPromise");function lw(e){return Qa in e.patternProperties?Gs():el in e.patternProperties?oi():$f("Unknown record key pattern")}s(lw,"RecordKey");function cw(e){return Qa in e.patternProperties?e.patternProperties[Qa]:el in e.patternProperties?e.patternProperties[el]:$f("Unable to get record value schema")}s(cw,"RecordValue");function li(e,t){let[r,n]=[lw(t),cw(t)];return N.IsLiteralString(e)&&N.IsNumber(r)&&ai($t(e,n))===Y.True?Y.True:N.IsUint8Array(e)&&N.IsNumber(r)||N.IsString(e)&&N.IsNumber(r)||N.IsArray(e)&&N.IsNumber(r)?$t(e,n):N.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(J$(n,e.properties[o])===Y.False)return Y.False;return Y.True})():Y.False}s(li,"FromRecordRight");function Kce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?$t(cw(e),cw(t)):Y.False}s(Kce,"FromRecord");function Jce(e,t){let r=N.IsRegExp(e)?oi():e,n=N.IsRegExp(t)?oi():t;return $t(r,n)}s(Jce,"FromRegExp");function Q$(e,t){return N.IsLiteral(e)&&ut.IsString(e.const)||N.IsString(e)?Y.True:Y.False}s(Q$,"FromStringRight");function Qce(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsString(t)?Y.True:Y.False}s(Qce,"FromString");function eue(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsSymbol(t)?Y.True:Y.False}s(eue,"FromSymbol");function tue(e,t){return N.IsTemplateLiteral(e)?$t(ep(e),t):N.IsTemplateLiteral(t)?$t(e,ep(t)):$f("Invalid fallthrough for TemplateLiteral")}s(tue,"FromTemplateLiteral");function rue(e,t){return N.IsArray(t)&&e.items!==void 0&&e.items.every(r=>$t(r,t.items)===Y.True)}s(rue,"IsArrayOfTuple");function nue(e,t){return N.IsNever(e)?Y.True:N.IsUnknown(e)?Y.False:N.IsAny(e)?Y.Union:Y.False}s(nue,"FromTupleRight");function oue(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)&&jv(t)||N.IsArray(t)&&rue(e,t)?Y.True:N.IsTuple(t)?ut.IsUndefined(e.items)&&!ut.IsUndefined(t.items)||!ut.IsUndefined(e.items)&&ut.IsUndefined(t.items)?Y.False:ut.IsUndefined(e.items)&&!ut.IsUndefined(t.items)||e.items.every((r,n)=>$t(r,t.items[n])===Y.True)?Y.True:Y.False:Y.False}s(oue,"FromTuple");function iue(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsUint8Array(t)?Y.True:Y.False}s(iue,"FromUint8Array");function sue(e,t){return Fr(t)?Lr(e,t):N.IsObject(t)?Mn(e,t):N.IsRecord(t)?li(e,t):N.IsVoid(t)?cue(e,t):N.IsUndefined(t)?Y.True:Y.False}s(sue,"FromUndefined");function pw(e,t){return t.anyOf.some(r=>$t(e,r)===Y.True)?Y.True:Y.False}s(pw,"FromUnionRight");function aue(e,t){return e.anyOf.every(r=>$t(r,t)===Y.True)?Y.True:Y.False}s(aue,"FromUnion");function ej(e,t){return Y.True}s(ej,"FromUnknownRight");function lue(e,t){return N.IsNever(t)?Y$(e,t):N.IsIntersect(t)?$v(e,t):N.IsUnion(t)?pw(e,t):N.IsAny(t)?uw(e,t):N.IsString(t)?Q$(e,t):N.IsNumber(t)?K$(e,t):N.IsInteger(t)?X$(e,t):N.IsBoolean(t)?Z$(e,t):N.IsArray(t)?Mce(e,t):N.IsTuple(t)?nue(e,t):N.IsObject(t)?Mn(e,t):N.IsUnknown(t)?Y.True:Y.False}s(lue,"FromUnknown");function cue(e,t){return N.IsUndefined(e)||N.IsUndefined(e)?Y.True:Y.False}s(cue,"FromVoidRight");function uue(e,t){return N.IsIntersect(t)?$v(e,t):N.IsUnion(t)?pw(e,t):N.IsUnknown(t)?ej(e,t):N.IsAny(t)?uw(e,t):N.IsObject(t)?Mn(e,t):N.IsVoid(t)?Y.True:Y.False}s(uue,"FromVoid");function $t(e,t){return N.IsTemplateLiteral(e)||N.IsTemplateLiteral(t)?tue(e,t):N.IsRegExp(e)||N.IsRegExp(t)?Jce(e,t):N.IsNot(e)||N.IsNot(t)?jce(e,t):N.IsAny(e)?wce(e,t):N.IsArray(e)?Oce(e,t):N.IsBigInt(e)?_ce(e,t):N.IsBoolean(e)?Ace(e,t):N.IsAsyncIterator(e)?Ece(e,t):N.IsConstructor(e)?kce(e,t):N.IsDate(e)?Dce(e,t):N.IsFunction(e)?Fce(e,t):N.IsInteger(e)?Lce(e,t):N.IsIntersect(e)?Rce(e,t):N.IsIterator(e)?Nce(e,t):N.IsLiteral(e)?Bce(e,t):N.IsNever(e)?$ce(e,t):N.IsNull(e)?Gce(e,t):N.IsNumber(e)?Uce(e,t):N.IsObject(e)?Xce(e,t):N.IsRecord(e)?Kce(e,t):N.IsString(e)?Qce(e,t):N.IsSymbol(e)?eue(e,t):N.IsTuple(e)?oue(e,t):N.IsPromise(e)?Yce(e,t):N.IsUint8Array(e)?iue(e,t):N.IsUndefined(e)?sue(e,t):N.IsUnion(e)?aue(e,t):N.IsUnknown(e)?lue(e,t):N.IsVoid(e)?uue(e,t):$f("Unknown left type operand '".concat(e[q],"'"))}s($t,"Visit");function Tc(e,t){return $t(e,t)}s(Tc,"ExtendsCheck");d();d();d();function pue(e,t,r,n,o){let i={};for(let a of globalThis.Object.getOwnPropertyNames(e))i[a]=jf(e[a],t,r,n,nr(o));return i}s(pue,"FromProperties");function due(e,t,r,n,o){return pue(e.properties,t,r,n,o)}s(due,"FromMappedResult");function tj(e,t,r,n,o){let i=due(e,t,r,n,o);return vt(i)}s(tj,"ExtendsFromMappedResult");function fue(e,t,r,n){let o=Tc(e,t);return o===Y.Union?Bt([r,n]):o===Y.True?r:n}s(fue,"ExtendsResolve");function jf(e,t,r,n,o){return sr(e)?tj(e,t,r,n,o):_o(e)?Q(rj(e,t,r,n,o)):Q(fue(e,t,r,n),o)}s(jf,"Extends");function mue(e,t,r,n,o){return{[e]:jf(At(e),t,r,n,nr(o))}}s(mue,"FromPropertyKey");function hue(e,t,r,n,o){return e.reduce((i,a)=>({...i,...mue(a,t,r,n,o)}),{})}s(hue,"FromPropertyKeys");function yue(e,t,r,n,o){return hue(e.keys,t,r,n,o)}s(yue,"FromMappedKey");function rj(e,t,r,n,o){let i=yue(e,t,r,n,o);return vt(i)}s(rj,"ExtendsFromMappedKey");d();function gue(e){return e.allOf.every(t=>ol(t))}s(gue,"Intersect");function bue(e){return e.anyOf.some(t=>ol(t))}s(bue,"Union");function vue(e){return!ol(e.not)}s(vue,"Not");function ol(e){return e[q]==="Intersect"?gue(e):e[q]==="Union"?bue(e):e[q]==="Not"?vue(e):e[q]==="Undefined"}s(ol,"ExtendsUndefinedCheck");d();function nj(e,t){return Gf(ep(e),t)}s(nj,"ExcludeFromTemplateLiteral");function xue(e,t){let r=e.filter(n=>Tc(n,t)===Y.False);return r.length===1?r[0]:Bt(r)}s(xue,"ExcludeRest");function Gf(e,t,r={}){return Ao(e)?Q(nj(e,t),r):sr(e)?Q(oj(e,t),r):Q(Et(e)?xue(e.anyOf,t):Tc(e,t)!==Y.False?Nt():e,r)}s(Gf,"Exclude");function Iue(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Gf(e[n],t);return r}s(Iue,"FromProperties");function Sue(e,t){return Iue(e.properties,t)}s(Sue,"FromMappedResult");function oj(e,t){let r=Sue(e,t);return vt(r)}s(oj,"ExcludeFromMappedResult");d();d();d();function ij(e,t){return Uf(ep(e),t)}s(ij,"ExtractFromTemplateLiteral");function Cue(e,t){let r=e.filter(n=>Tc(n,t)!==Y.False);return r.length===1?r[0]:Bt(r)}s(Cue,"ExtractRest");function Uf(e,t,r){return Ao(e)?Q(ij(e,t),r):sr(e)?Q(sj(e,t),r):Q(Et(e)?Cue(e.anyOf,t):Tc(e,t)!==Y.False?e:Nt(),r)}s(Uf,"Extract");function Pue(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Uf(e[n],t);return r}s(Pue,"FromProperties");function Tue(e,t){return Pue(e.properties,t)}s(Tue,"FromMappedResult");function sj(e,t){let r=Tue(e,t);return vt(r)}s(sj,"ExtractFromMappedResult");d();function aj(e,t){return Q(e.returns,t)}s(aj,"InstanceType");d();function lj(e){return Q({[q]:"Integer",type:"integer"},e)}s(lj,"Integer");d();d();d();function wue(e,t,r){return{[e]:Wi(At(e),t,nr(r))}}s(wue,"MappedIntrinsicPropertyKey");function Mue(e,t,r){return e.reduce((o,i)=>({...o,...wue(i,t,r)}),{})}s(Mue,"MappedIntrinsicPropertyKeys");function Oue(e,t,r){return Mue(e.keys,t,r)}s(Oue,"MappedIntrinsicProperties");function cj(e,t,r){let n=Oue(e,t,r);return vt(n)}s(cj,"IntrinsicFromMappedKey");function Eue(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}s(Eue,"ApplyUncapitalize");function _ue(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}s(_ue,"ApplyCapitalize");function Aue(e){return e.toUpperCase()}s(Aue,"ApplyUppercase");function kue(e){return e.toLowerCase()}s(kue,"ApplyLowercase");function Due(e,t,r){let n=Lf(e.pattern);if(!Qu(n))return{...e,pattern:uj(e.pattern,t)};let a=[...mg(n)].map(p=>At(p)),l=pj(a,t),c=Bt(l);return Ov([c],r)}s(Due,"FromTemplateLiteral");function uj(e,t){return typeof e=="string"?t==="Uncapitalize"?Eue(e):t==="Capitalize"?_ue(e):t==="Uppercase"?Aue(e):t==="Lowercase"?kue(e):e:e.toString()}s(uj,"FromLiteralValue");function pj(e,t){return e.map(r=>Wi(r,t))}s(pj,"FromRest");function Wi(e,t,r={}){return _o(e)?cj(e,t,r):Ao(e)?Due(e,t,r):Et(e)?Bt(pj(e.anyOf,t),r):Ja(e)?At(uj(e.const,t),r):Q(e,r)}s(Wi,"Intrinsic");function dj(e,t={}){return Wi(e,"Capitalize",t)}s(dj,"Capitalize");d();function fj(e,t={}){return Wi(e,"Lowercase",t)}s(fj,"Lowercase");d();function mj(e,t={}){return Wi(e,"Uncapitalize",t)}s(mj,"Uncapitalize");d();function hj(e,t={}){return Wi(e,"Uppercase",t)}s(hj,"Uppercase");d();function yj(e,t){return Q({[q]:"Not",not:e},t)}s(yj,"Not");d();d();d();function Fue(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Vf(e[o],t,nr(r));return n}s(Fue,"FromProperties");function Lue(e,t,r){return Fue(e.properties,t,r)}s(Lue,"FromMappedResult");function gj(e,t,r){let n=Lue(e,t,r);return vt(n)}s(gj,"OmitFromMappedResult");function Rue(e,t){return e.map(r=>fw(r,t))}s(Rue,"FromIntersect");function Nue(e,t){return e.map(r=>fw(r,t))}s(Nue,"FromUnion");function Bue(e,t){let{[t]:r,...n}=e;return n}s(Bue,"FromProperty");function $ue(e,t){return t.reduce((r,n)=>Bue(r,n),e)}s($ue,"FromProperties");function jue(e,t){let r=Cr(e,[or,"$id","required","properties"]),n=$ue(e.properties,t);return zt(n,r)}s(jue,"FromObject");function fw(e,t){return _r(e)?go(Rue(e.allOf,t)):Et(e)?Bt(Nue(e.anyOf,t)):Ur(e)?jue(e,t):zt({})}s(fw,"OmitResolve");function Vf(e,t,r){if(_o(t))return bj(e,t,r);if(sr(e))return gj(e,t,r);let n=zi(t)?yo(t):t;return Q({...fw(e,n),...r})}s(Vf,"Omit");function Gue(e,t,r){return{[t]:Vf(e,[t],nr(r))}}s(Gue,"FromPropertyKey");function Uue(e,t,r){return t.reduce((n,o)=>({...n,...Gue(e,o,r)}),{})}s(Uue,"FromPropertyKeys");function Vue(e,t,r){return Uue(e,t.keys,r)}s(Vue,"FromMappedKey");function bj(e,t,r){let n=Vue(e,t,r);return vt(n)}s(bj,"OmitFromMappedKey");d();function vj(e,t){return Us(e.parameters,t)}s(vj,"Parameters");d();d();function xj(e){return e.map(t=>Ij(t))}s(xj,"FromRest");function zue(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ho(e[r]);return t}s(zue,"FromProperties");function Hue(e){let t=Cr(e,[or,"$id","required","properties"]),r=zue(e.properties);return zt(r,t)}s(Hue,"FromObject");function Ij(e){return _r(e)?go(xj(e.allOf)):Et(e)?Bt(xj(e.anyOf)):Ur(e)?Hue(e):zt({})}s(Ij,"PartialResolve");function Gv(e,t){return sr(e)?Sj(e,t):Q({...Ij(e),...t})}s(Gv,"Partial");function Wue(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Gv(e[n],nr(t));return r}s(Wue,"FromProperties");function que(e,t){return Wue(e.properties,t)}s(que,"FromMappedResult");function Sj(e,t){let r=que(e,t);return vt(r)}s(Sj,"PartialFromMappedResult");d();d();d();function Zue(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=zf(e[o],t,nr(r));return n}s(Zue,"FromProperties");function Xue(e,t,r){return Zue(e.properties,t,r)}s(Xue,"FromMappedResult");function Cj(e,t,r){let n=Xue(e,t,r);return vt(n)}s(Cj,"PickFromMappedResult");function Yue(e,t){return e.map(r=>mw(r,t))}s(Yue,"FromIntersect");function Kue(e,t){return e.map(r=>mw(r,t))}s(Kue,"FromUnion");function Jue(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}s(Jue,"FromProperties");function Que(e,t){let r=Cr(e,[or,"$id","required","properties"]),n=Jue(e.properties,t);return zt(n,r)}s(Que,"FromObject");function mw(e,t){return _r(e)?go(Yue(e.allOf,t)):Et(e)?Bt(Kue(e.anyOf,t)):Ur(e)?Que(e,t):zt({})}s(mw,"PickResolve");function zf(e,t,r){if(_o(t))return Pj(e,t,r);if(sr(e))return Cj(e,t,r);let n=zi(t)?yo(t):t;return Q({...mw(e,n),...r})}s(zf,"Pick");function epe(e,t,r){return{[t]:zf(e,[t],nr(r))}}s(epe,"FromPropertyKey");function tpe(e,t,r){return t.reduce((n,o)=>({...n,...epe(e,o,r)}),{})}s(tpe,"FromPropertyKeys");function rpe(e,t,r){return tpe(e,t.keys,r)}s(rpe,"FromMappedKey");function Pj(e,t,r){let n=rpe(e,t,r);return vt(n)}s(Pj,"PickFromMappedKey");d();function Tj(e){return ii(ho(e))}s(Tj,"ReadonlyOptional");d();function tp(e,t,r){return Q({[q]:"Record",type:"object",patternProperties:{[e]:t}},r)}s(tp,"RecordCreateFromPattern");function hw(e,t,r){let n={};for(let o of e)n[o]=t;return zt(n,{...r,[ni]:"Record"})}s(hw,"RecordCreateFromKeys");function npe(e,t,r){return wv(e)?hw(yo(e),t,r):tp(e.pattern,t,r)}s(npe,"FromTemplateLiteralKey");function ope(e,t,r){return hw(yo(Bt(e)),t,r)}s(ope,"FromUnionKey");function ipe(e,t,r){return hw([e.toString()],t,r)}s(ipe,"FromLiteralKey");function spe(e,t,r){return tp(e.source,t,r)}s(spe,"FromRegExpKey");function ape(e,t,r){let n=gr(e.pattern)?el:e.pattern;return tp(n,t,r)}s(ape,"FromStringKey");function lpe(e,t,r){return tp(el,t,r)}s(lpe,"FromAnyKey");function cpe(e,t,r){return tp(y$,t,r)}s(cpe,"FromNeverKey");function upe(e,t,r){return tp(Qa,t,r)}s(upe,"FromIntegerKey");function ppe(e,t,r){return tp(Qa,t,r)}s(ppe,"FromNumberKey");function wj(e,t,r={}){return Et(e)?ope(e.anyOf,t,r):Ao(e)?npe(e,t,r):Ja(e)?ipe(e.const,t,r):Yu(e)?upe(e,t,r):Ku(e)?ppe(e,t,r):BT(e)?spe(e,t,r):lg(e)?ape(e,t,r):DT(e)?lpe(e,t,r):xc(e)?cpe(e,t,r):Nt(r)}s(wj,"Record");d();var dpe=0;function Mj(e,t={}){gr(t.$id)&&(t.$id="T".concat(dpe++));let r=rg(e({[q]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Q({[ni]:"Recursive",...r},t)}s(Mj,"Recursive");d();function Oj(e,t){if(Kt(e))return Q({[q]:"Ref",$ref:e},t);if(gr(e.$id))throw new Error("Reference target type must specify an $id");return Q({[q]:"Ref",$ref:e.$id},t)}s(Oj,"Ref");d();function Ej(e,t){let r=Kt(e)?new globalThis.RegExp(e):e;return Q({[q]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}s(Ej,"RegExp");d();d();function _j(e){return e.map(t=>Aj(t))}s(_j,"FromRest");function fpe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Cr(e[r],[qn]);return t}s(fpe,"FromProperties");function mpe(e){let t=Cr(e,[or,"$id","required","properties"]),r=fpe(e.properties);return zt(r,t)}s(mpe,"FromObject");function Aj(e){return _r(e)?go(_j(e.allOf)):Et(e)?Bt(_j(e.anyOf)):Ur(e)?mpe(e):zt({})}s(Aj,"RequiredResolve");function Uv(e,t){return sr(e)?kj(e,t):Q({...Aj(e),...t})}s(Uv,"Required");function hpe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Uv(e[n],t);return r}s(hpe,"FromProperties");function ype(e,t){return hpe(e.properties,t)}s(ype,"FromMappedResult");function kj(e,t){let r=ype(e,t);return vt(r)}s(kj,"RequiredFromMappedResult");d();function gpe(e){var t;return _r(e)?e.allOf:Et(e)?e.anyOf:Vi(e)?(t=e.items)!=null?t:[]:[]}s(gpe,"RestResolve");function Dj(e){return gpe(e)}s(Dj,"Rest");d();function Fj(e,t){return Q(e.returns,t)}s(Fj,"ReturnType");d();function Lj(e){return JSON.parse(JSON.stringify(e))}s(Lj,"Strict");d();var bw=class bw{constructor(t){this.schema=t}Decode(t){return new gw(this.schema,t)}};s(bw,"TransformDecodeBuilder");var yw=bw,vw=class vw{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,[or]:i}}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return{...r,[or]:n}}Encode(t){return _f(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};s(vw,"TransformEncodeBuilder");var gw=vw;function Rj(e){return new yw(e)}s(Rj,"Transform");d();function Vv(e={}){var t;return Q({[q]:(t=e[q])!=null?t:"Unsafe"},e)}s(Vv,"Unsafe");d();function Nj(e){return Q({[q]:"Void",type:"void"},e)}s(Nj,"Void");d();var xw={};Pa(xw,{Any:()=>Sc,Array:()=>Sv,AsyncIterator:()=>Cv,Awaited:()=>N$,BigInt:()=>Nf,Boolean:()=>Mv,Capitalize:()=>dj,Composite:()=>j$,Const:()=>G$,Constructor:()=>Pv,ConstructorParameters:()=>U$,Date:()=>Dv,Deref:()=>Hi,Enum:()=>V$,Exclude:()=>Gf,Extends:()=>jf,Extract:()=>Uf,Function:()=>Cc,Index:()=>Bf,InstanceType:()=>aj,Integer:()=>lj,Intersect:()=>go,Iterator:()=>_v,KeyOf:()=>kv,Literal:()=>At,Lowercase:()=>fj,Mapped:()=>D$,Never:()=>Nt,Not:()=>yj,Null:()=>Fv,Number:()=>Gs,Object:()=>zt,Omit:()=>Vf,Optional:()=>ho,Parameters:()=>vj,Partial:()=>Gv,Pick:()=>zf,Promise:()=>Av,Readonly:()=>ii,ReadonlyOptional:()=>Tj,Record:()=>wj,Recursive:()=>Mj,Ref:()=>Oj,RegExp:()=>Ej,Required:()=>Uv,Rest:()=>Dj,ReturnType:()=>Fj,Strict:()=>Lj,String:()=>oi,Symbol:()=>Lv,TemplateLiteral:()=>Ov,Transform:()=>Rj,Tuple:()=>Us,Uint8Array:()=>Nv,Uncapitalize:()=>mj,Undefined:()=>Rv,Union:()=>Bt,Unknown:()=>nl,Unsafe:()=>Vv,Uppercase:()=>hj,Void:()=>Nj});d();var C=xw;var dr=s((e,t)=>C.Unsafe(C.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),On=dr("g","GeometryId"),xt=dr("f","FloorId"),Iw=[On,xt];d();d();var vg=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."}),Sw=C.Partial(vg,{$id:"Details",description:"Additional information about a given entity."}),qi=C.Object({details:C.Optional(C.Ref(Sw))},{$id:"WithDetails"}),rp=s(e=>{let t=[...e].sort(),r=C.Pick(vg,e),n=C.Omit(vg,e);return C.Object({details:C.Intersect([r,C.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),Cw=[vg,Sw];d();d();var Pw=C.Record(C.String(),C.Unknown(),{$id:"Extra"}),Zi=C.Object({extra:C.Optional(C.Ref(Pw))}),Tw=[Pw];d();d();var Hf=C.Object({geometryId:C.Ref(On),floorId:C.Ref(xt)},{$id:"GeometryAnchor"}),bpe=C.Object({geometryAnchor:C.Ref(Hf)}),np=s((e,t)=>C.Object({geometryAnchors:C.Array(C.Ref(Hf),e)},t),"WithGeometryAnchors"),ww=[Hf];d();d();d();d();d();var Wf=C.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),qf=C.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),op=C.Tuple([C.Ref(Wf),C.Ref(qf)],{$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(op)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),zv=C.Object({type:C.Literal("MultiPoint"),coordinates:C.Array(C.Ref(op))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),Hv=C.Object({type:C.Literal("LineString"),coordinates:C.Array(C.Ref(op),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Wv=C.Object({type:C.Literal("MultiLineString"),coordinates:C.Array(C.Array(C.Ref(op),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),Bj=C.Array(C.Ref(op),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),Mw=C.Array(C.Ref(Bj),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Zf=C.Object({type:C.Literal("Polygon"),coordinates:C.Ref(Mw)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),Xf=C.Object({type:C.Literal("MultiPolygon"),coordinates:C.Array(C.Ref(Mw))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),un=s((e,t,r)=>C.Object({type:C.Literal("Feature"),geometry:e,properties:t},r),"Feature"),Xn=s((e,t,r)=>C.Object({type:C.Literal("FeatureCollection"),features:C.Array(e,r)},t),"FeatureCollection"),Ow=[Wf,qf,op,En,zv,Hv,Wv,Bj,Mw,Zf,Xf];var $j=C.Intersect([C.Object({id:C.Ref(xt),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."}))}),qi],{$id:"FloorProperties"}),jj=un(C.Union([C.Ref(Zf),C.Ref(Xf),C.Null()]),C.Ref($j),{$id:"FloorFeature"}),Gj=Xn(C.Ref(jj),{$id:"FloorCollection"}),vpe=C.Object({floors:C.Ref(Gj)}),Uj={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:vpe,references:[$j,jj,Gj]};d();d();d();var Ew=class Ew{constructor(t){h(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(Ew,"OptionIterator");var qv=Ew,_w=class _w{constructor(t){h(this,"_tag","Some");h(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 Vj(t(this.value))}mapAsync(t){return t(this.value).then(r=>Vj(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:wc()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?wc():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return me(this.value)}okOrElse(t){return me(this.value)}iter(){return new qv(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?Yf([this.value,t.value]):wc()}zipWith(t,r){return t.isSome()?Yf(r(this.value,t.value)):wc()}get[Symbol.toStringTag](){return"Some"}};s(_w,"Some");var Zv=_w,Aw=class Aw{constructor(){h(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 be(t)}okOrElse(t){return be(t())}iter(){return new qv(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};s(Aw,"None");var Xv=Aw,Yf=s(e=>new Zv(e),"some"),wc=s(()=>new Xv,"none"),Vj=s(e=>e instanceof Zv||e instanceof Xv?e:e==null?wc():Yf(e),"option");var Fw=class Fw{constructor(t){h(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(Fw,"ResultIterator");var Yv=Fw,Lw=class Lw{constructor(t){h(this,"_tag","Ok");h(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 Yf(this.value)}err(){return wc()}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 me(t(this.value))}async mapAsync(t){return t(this.value).then(me)}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 Yv(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(Lw,"Ok");var kw=Lw,Kv=class Kv{constructor(t){h(this,"_tag","Err");h(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 wc()}err(){return Yf(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 Yv(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 Kv(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(Kv,"Err");var Dw=Kv,me=s(e=>new kw(e),"ok"),be=s(e=>new Dw(e),"err");d();var Vs;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Vs||(Vs={}));var xpe=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"),il=s(e=>{let t=xpe(e);return s(n=>{let o=t.get(n);return o==null?be({kind:Vs.UnknownFloorError,properties:{floorId:n}}):me(o)},"floorLookup")},"createFloorLookup");d();d();d();d();var Pr=s(e=>C.Unsafe(e),"PartialRecord");d();var mt=s(e=>Object.keys(e),"typedKeys");d();var zj=s(e=>{if(e.floors==null)return be({kind:Vs.FloorMissingError,properties:null});if(e.geometry==null)return be({kind:Vs.GeometryMissingError,properties:null});let t=il(e);for(let r of mt(e.geometry)){let n=t(r);if(n.isErr())return n}return me(!0)},"validateGeometry");var Hj=C.Intersect([C.Object({id:C.Ref(On)}),qi],{$id:"GeometryProperties"}),Wj=un(C.Union([C.Ref(En),C.Ref(zv),C.Ref(Hv),C.Ref(Wv),C.Ref(Zf),C.Ref(Xf)]),C.Ref(Hj),{$id:"GeometryFeature"}),qj=Xn(C.Ref(Wj),{$id:"GeometryCollection"}),Ipe=C.Object({geometry:Pr(C.Record(xt,C.Ref(qj),{additionalProperties:!1}))},{$id:"GeometrySchema"}),Spe=/^geometry\/(.*)\.geojson$/,Zj={name:"core:geometry",schema:Ipe,intoBundle:s(function*(e){if(e.geometry!=null)for(let t of mt(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(Spe))==null?void 0:o[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[Hj,Wj,qj],integrityCheck:zj};d();d();var It=s(e=>Object.entries(e),"typedEntries");var Cpe=s(e=>{var r;let t=new Map;for(let[n,o]of It((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=Cpe(e);return s((n,o)=>{let i=t.get(n);if(i==null)return be({kind:Vs.UnknownFloorError,properties:{floorId:n}});let a=i.get(o);return a==null?be({kind:Vs.UnknownGeometryError,properties:{floorId:n,geometryId:o}}):me(a)},"geometryLookup")},"createGeometryLookup");d();var Rw=C.Object({type:C.Literal("file"),name:C.String({description:"The name of the file."})},{$id:"ManifestFile"}),Xj=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(Rw)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),Yj=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(Xj),C.Ref(Rw)]),{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(xt,{description:"The default floor ID of the map."})),language:C.Optional(C.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),Kj=Xn(un(En,C.Ref(Yj)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),Ppe=C.Object({manifest:C.Ref(Kj)}),Jj={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:Ppe,references:[Rw,Xj,Yj,Kj]};var ci=C.Object({geometryId:C.Ref(On)},{$id:"WithGeometryId"}),Jv=C.Object({geometryIds:C.Array(C.Ref(On))},{$id:"WithGeometryIds"}),Nw=[ci,Jv];d();d();var Qj=s((e,t)=>C.Unsafe(C.Transform(C.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),vo=s((e,t)=>{let r=Qj(e,t),n=[...e,"unknown"],o=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:r,values:n,record:o}},"SafeStringEnum");d();d();d();var xg;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(xg||(xg={}));var eG=s(e=>{var n;if(e.annotations==null)return me(!0);let t=zr(e),r=new Set(mt((n=e.annotationSymbols)!=null?n:{}));for(let o of mt(e.annotations)){let i=e.annotations[o];if(i!=null)for(let a of i){if(!r.has(a.symbolKey))return be({kind:xg.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 be({kind:xg.AnnotationNonPointGeometryError,properties:{annotationId:a.id,floorId:o,geometryId:a.geometryId}})}}return me(!0)},"validateAnnotations");var tG=dr("a","AnnotationId"),Bw=C.Intersect([ci,C.Object({id:C.Ref(tG,{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"}),rG=C.Object({url:C.String({format:"uri",description:"The URL for the symbol."}),name:C.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),Tpe=C.Object({annotations:Pr(C.Record(xt,C.Array(C.Ref(Bw)),{additionalProperties:!1})),annotationSymbols:Pr(C.Record(C.Index(Bw,["symbolKey"]),C.Ref(rG)))},{$id:"AnnotationsSchema"}),wpe=/^annotations\/(.*)\.json$/,nG={name:"ext:mvf-annotations",schema:Tpe,intoBundle:s(function*(e){if(e.annotations!=null)for(let t of mt(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(wpe))==null?void 0:o[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[tG,Bw,rG],integrityCheck:eG};d();d();d();d();d();d();d();d();var jw=class jw extends ke{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};s(jw,"TypeSystemDuplicateTypeKind");var $w=jw,Gw=class Gw extends ke{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};s(Gw,"TypeSystemDuplicateFormat");var Ig=Gw,Qv;(function(e){function t(n,o){if(Vr.Has(n))throw new $w(n);return Vr.Set(n,o),(i={})=>Vv({...i,[q]:n})}s(t,"Type"),e.Type=t;function r(n,o){if(Zn.Has(n))throw new Ig(n);return Zn.Set(n,o),n}s(r,"Format"),e.Format=r})(Qv||(Qv={}));d();d();d();function Mpe(e){switch(e.errorType){case Z.ArrayContains:return"Expected array to contain at least one matching value";case Z.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case Z.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case Z.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case Z.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case Z.ArrayUniqueItems:return"Expected array elements to be unique";case Z.Array:return"Expected array";case Z.AsyncIterator:return"Expected AsyncIterator";case Z.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case Z.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case Z.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case Z.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case Z.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case Z.BigInt:return"Expected bigint";case Z.Boolean:return"Expected boolean";case Z.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case Z.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case Z.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case Z.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case Z.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case Z.Date:return"Expected Date";case Z.Function:return"Expected function";case Z.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case Z.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case Z.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case Z.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case Z.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case Z.Integer:return"Expected integer";case Z.IntersectUnevaluatedProperties:return"Unexpected property";case Z.Intersect:return"Expected all values to match";case Z.Iterator:return"Expected Iterator";case Z.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case Z.Never:return"Never";case Z.Not:return"Value should not match";case Z.Null:return"Expected null";case Z.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case Z.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case Z.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case Z.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case Z.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case Z.Number:return"Expected number";case Z.Object:return"Expected object";case Z.ObjectAdditionalProperties:return"Unexpected property";case Z.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case Z.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case Z.ObjectRequiredProperty:return"Expected required property";case Z.Promise:return"Expected Promise";case Z.RegExp:return"Expected string to match regular expression";case Z.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case Z.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case Z.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case Z.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case Z.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case Z.String:return"Expected string";case Z.Symbol:return"Expected symbol";case Z.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case Z.Tuple:return"Expected tuple";case Z.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case Z.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case Z.Uint8Array:return"Expected Uint8Array";case Z.Undefined:return"Expected undefined";case Z.Union:return"Expected union value";case Z.Void:return"Expected void";case Z.Kind:return"Expected kind '".concat(e.schema[q],"'");default:return"Unknown error type"}}s(Mpe,"DefaultErrorFunction");var Ope=Mpe;function oG(){return Ope}s(oG,"GetErrorFunction");d();var Vw=class Vw extends ke{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};s(Vw,"TypeDereferenceError");var Uw=Vw;function Epe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new Uw(e);return St(r,t)}s(Epe,"Resolve");function ui(e,t){return!pt(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}s(ui,"Pushref");function St(e,t){return e[q]==="This"||e[q]==="Ref"?Epe(e,t):e}s(St,"Deref");d();var Hw=class Hw extends ke{constructor(t){super("Unable to hash value"),this.value=t}};s(Hw,"ValueHashError");var zw=Hw,ko;(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"})(ko||(ko={}));var Kf=BigInt("14695981039346656037"),[_pe,Ape]=[BigInt("1099511628211"),BigInt("18446744073709551616")],kpe=Array.from({length:256}).map((e,t)=>BigInt(t)),iG=new Float64Array(1),sG=new DataView(iG.buffer),aG=new Uint8Array(iG.buffer);function*Dpe(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(Dpe,"NumberToBytes");function Fpe(e){_n(ko.Array);for(let t of e)Jf(t)}s(Fpe,"ArrayType");function Lpe(e){_n(ko.Boolean),_n(e?1:0)}s(Lpe,"BooleanType");function Rpe(e){_n(ko.BigInt),sG.setBigInt64(0,e);for(let t of aG)_n(t)}s(Rpe,"BigIntType");function Npe(e){_n(ko.Date),Jf(e.getTime())}s(Npe,"DateType");function Bpe(e){_n(ko.Null)}s(Bpe,"NullType");function $pe(e){_n(ko.Number),sG.setFloat64(0,e);for(let t of aG)_n(t)}s($pe,"NumberType");function jpe(e){_n(ko.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Jf(t),Jf(e[t])}s(jpe,"ObjectType");function Gpe(e){_n(ko.String);for(let t=0;t<e.length;t++)for(let r of Dpe(e.charCodeAt(t)))_n(r)}s(Gpe,"StringType");function Upe(e){_n(ko.Symbol),Jf(e.description)}s(Upe,"SymbolType");function Vpe(e){_n(ko.Uint8Array);for(let t=0;t<e.length;t++)_n(e[t])}s(Vpe,"Uint8ArrayType");function zpe(e){return _n(ko.Undefined)}s(zpe,"UndefinedType");function Jf(e){if(Ue(e))return Fpe(e);if(Bs(e))return Lpe(e);if(ln(e))return Rpe(e);if(Wn(e))return Npe(e);if(Za(e))return Bpe(e);if(Me(e))return $pe(e);if(He(e))return jpe(e);if(pt(e))return Gpe(e);if(Xa(e))return Upe(e);if(Ef(e))return Vpe(e);if(br(e))return zpe(e);throw new zw(e)}s(Jf,"Visit");function _n(e){Kf=Kf^kpe[e],Kf=Kf*_pe%Ape}s(_n,"FNV1A64");function Mc(e){return Kf=BigInt("14695981039346656037"),Jf(e),Kf}s(Mc,"Hash");d();var qw=class qw extends ke{constructor(t){super("Unknown type"),this.schema=t}};s(qw,"ValueCheckUnknownTypeError");var Ww=qw;function Hpe(e){return e[q]==="Any"||e[q]==="Unknown"}s(Hpe,"IsAnyOrUnknown");function rt(e){return e!==void 0}s(rt,"IsDefined");function Wpe(e,t,r){return!0}s(Wpe,"FromAny");function qpe(e,t,r){if(!Ue(r)||rt(e.minItems)&&!(r.length>=e.minItems)||rt(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=Mc(a);if(i.has(l))return!1;i.add(l)}return!0}())return!1;if(!(rt(e.contains)||Me(e.minContains)||Me(e.maxContains)))return!0;let n=rt(e.contains)?e.contains:Nt(),o=r.reduce((i,a)=>pn(n,t,a)?i+1:i,0);return!(o===0||Me(e.minContains)&&o<e.minContains||Me(e.maxContains)&&o>e.maxContains)}s(qpe,"FromArray");function Zpe(e,t,r){return bv(r)}s(Zpe,"FromAsyncIterator");function Xpe(e,t,r){return!(!ln(r)||rt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||rt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||rt(e.maximum)&&!(r<=e.maximum)||rt(e.minimum)&&!(r>=e.minimum)||rt(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}s(Xpe,"FromBigInt");function Ype(e,t,r){return Bs(r)}s(Ype,"FromBoolean");function Kpe(e,t,r){return pn(e.returns,t,r.prototype)}s(Kpe,"FromConstructor");function Jpe(e,t,r){return!(!Wn(r)||rt(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||rt(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||rt(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||rt(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||rt(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}s(Jpe,"FromDate");function Qpe(e,t,r){return vc(r)}s(Qpe,"FromFunction");function ede(e,t,r){return!(!Iv(r)||rt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||rt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||rt(e.maximum)&&!(r<=e.maximum)||rt(e.minimum)&&!(r>=e.minimum)||rt(e.multipleOf)&&r%e.multipleOf!==0)}s(ede,"FromInteger");function tde(e,t,r){let n=e.allOf.every(o=>pn(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(rl(e)),i=Object.getOwnPropertyNames(r).every(a=>o.test(a));return n&&i}else if(dt(e.unevaluatedProperties)){let o=new RegExp(rl(e)),i=Object.getOwnPropertyNames(r).every(a=>o.test(a)||pn(e.unevaluatedProperties,t,r[a]));return n&&i}else return n}s(tde,"FromIntersect");function rde(e,t,r){return vv(r)}s(rde,"FromIterator");function nde(e,t,r){return r===e.const}s(nde,"FromLiteral");function ode(e,t,r){return!1}s(ode,"FromNever");function ide(e,t,r){return!pn(e.not,t,r)}s(ide,"FromNot");function sde(e,t,r){return Za(r)}s(sde,"FromNull");function ade(e,t,r){return!(!Ft.IsNumberLike(r)||rt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||rt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||rt(e.minimum)&&!(r>=e.minimum)||rt(e.maximum)&&!(r<=e.maximum)||rt(e.multipleOf)&&r%e.multipleOf!==0)}s(ade,"FromNumber");function lde(e,t,r){if(!Ft.IsObjectLike(r)||rt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||rt(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])||(ol(i)||Hpe(i))&&!(o in r))return!1}else if(Ft.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(lde,"FromObject");function cde(e,t,r){return xv(r)}s(cde,"FromPromise");function ude(e,t,r){if(!Ft.IsRecordLike(r)||rt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||rt(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(([p,f])=>i.test(p)?pn(o,t,f):!0),l=typeof e.additionalProperties=="object"?Object.entries(r).every(([p,f])=>i.test(p)?!0:pn(e.additionalProperties,t,f)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(p=>i.test(p)):!0;return a&&l&&c}s(ude,"FromRecord");function pde(e,t,r){return pn(St(e,t),t,r)}s(pde,"FromRef");function dde(e,t,r){let n=new RegExp(e.source,e.flags);return rt(e.minLength)&&!(r.length>=e.minLength)||rt(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}s(dde,"FromRegExp");function fde(e,t,r){return!pt(r)||rt(e.minLength)&&!(r.length>=e.minLength)||rt(e.maxLength)&&!(r.length<=e.maxLength)||rt(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:rt(e.format)?Zn.Has(e.format)?Zn.Get(e.format)(r):!1:!0}s(fde,"FromString");function mde(e,t,r){return Xa(r)}s(mde,"FromSymbol");function hde(e,t,r){return pt(r)&&new RegExp(e.pattern).test(r)}s(hde,"FromTemplateLiteral");function yde(e,t,r){return pn(St(e,t),t,r)}s(yde,"FromThis");function gde(e,t,r){if(!Ue(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(gde,"FromTuple");function bde(e,t,r){return br(r)}s(bde,"FromUndefined");function vde(e,t,r){return e.anyOf.some(n=>pn(n,t,r))}s(vde,"FromUnion");function xde(e,t,r){return!(!Ef(r)||rt(e.maxByteLength)&&!(r.length<=e.maxByteLength)||rt(e.minByteLength)&&!(r.length>=e.minByteLength))}s(xde,"FromUint8Array");function Ide(e,t,r){return!0}s(Ide,"FromUnknown");function Sde(e,t,r){return Ft.IsVoidLike(r)}s(Sde,"FromVoid");function Cde(e,t,r){return Vr.Has(e[q])?Vr.Get(e[q])(e,r):!1}s(Cde,"FromKind");function pn(e,t,r){let n=rt(e.$id)?[...t,e]:t,o=e;switch(o[q]){case"Any":return Wpe(o,n,r);case"Array":return qpe(o,n,r);case"AsyncIterator":return Zpe(o,n,r);case"BigInt":return Xpe(o,n,r);case"Boolean":return Ype(o,n,r);case"Constructor":return Kpe(o,n,r);case"Date":return Jpe(o,n,r);case"Function":return Qpe(o,n,r);case"Integer":return ede(o,n,r);case"Intersect":return tde(o,n,r);case"Iterator":return rde(o,n,r);case"Literal":return nde(o,n,r);case"Never":return ode(o,n,r);case"Not":return ide(o,n,r);case"Null":return sde(o,n,r);case"Number":return ade(o,n,r);case"Object":return lde(o,n,r);case"Promise":return cde(o,n,r);case"Record":return ude(o,n,r);case"Ref":return pde(o,n,r);case"RegExp":return dde(o,n,r);case"String":return fde(o,n,r);case"Symbol":return mde(o,n,r);case"TemplateLiteral":return hde(o,n,r);case"This":return yde(o,n,r);case"Tuple":return gde(o,n,r);case"Undefined":return bde(o,n,r);case"Union":return vde(o,n,r);case"Uint8Array":return xde(o,n,r);case"Unknown":return Ide(o,n,r);case"Void":return Sde(o,n,r);default:if(!Vr.Has(o[q]))throw new Ww(o);return Cde(o,n,r)}}s(pn,"Visit");function Qe(...e){return e.length===3?pn(e[0],e[1],e[2]):pn(e[0],[],e[1])}s(Qe,"Check");var Z;(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"})(Z||(Z={}));var Xw=class Xw extends ke{constructor(t){super("Unknown type"),this.schema=t}};s(Xw,"ValueErrorsUnknownTypeError");var Zw=Xw;function sl(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}s(sl,"EscapeKey");function nt(e){return e!==void 0}s(nt,"IsDefined");var Yw=class Yw{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};s(Yw,"ValueErrorIterator");var pi=Yw;function ue(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:oG()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}s(ue,"Create");function*Pde(e,t,r,n){}s(Pde,"FromAny");function*Tde(e,t,r,n){if(!Ue(n))return yield ue(Z.Array,e,r,n);nt(e.minItems)&&!(n.length>=e.minItems)&&(yield ue(Z.ArrayMinItems,e,r,n)),nt(e.maxItems)&&!(n.length<=e.maxItems)&&(yield ue(Z.ArrayMaxItems,e,r,n));for(let a=0;a<n.length;a++)yield*dn(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=Mc(l);if(a.has(c))return!1;a.add(c)}return!0}()&&(yield ue(Z.ArrayUniqueItems,e,r,n)),!(nt(e.contains)||nt(e.minContains)||nt(e.maxContains)))return;let o=nt(e.contains)?e.contains:Nt(),i=n.reduce((a,l,c)=>dn(o,t,"".concat(r).concat(c),l).next().done===!0?a+1:a,0);i===0&&(yield ue(Z.ArrayContains,e,r,n)),Me(e.minContains)&&i<e.minContains&&(yield ue(Z.ArrayMinContains,e,r,n)),Me(e.maxContains)&&i>e.maxContains&&(yield ue(Z.ArrayMaxContains,e,r,n))}s(Tde,"FromArray");function*wde(e,t,r,n){bv(n)||(yield ue(Z.AsyncIterator,e,r,n))}s(wde,"FromAsyncIterator");function*Mde(e,t,r,n){if(!ln(n))return yield ue(Z.BigInt,e,r,n);nt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ue(Z.BigIntExclusiveMaximum,e,r,n)),nt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ue(Z.BigIntExclusiveMinimum,e,r,n)),nt(e.maximum)&&!(n<=e.maximum)&&(yield ue(Z.BigIntMaximum,e,r,n)),nt(e.minimum)&&!(n>=e.minimum)&&(yield ue(Z.BigIntMinimum,e,r,n)),nt(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield ue(Z.BigIntMultipleOf,e,r,n))}s(Mde,"FromBigInt");function*Ode(e,t,r,n){Bs(n)||(yield ue(Z.Boolean,e,r,n))}s(Ode,"FromBoolean");function*Ede(e,t,r,n){yield*dn(e.returns,t,r,n.prototype)}s(Ede,"FromConstructor");function*_de(e,t,r,n){if(!Wn(n))return yield ue(Z.Date,e,r,n);nt(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield ue(Z.DateExclusiveMaximumTimestamp,e,r,n)),nt(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield ue(Z.DateExclusiveMinimumTimestamp,e,r,n)),nt(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield ue(Z.DateMaximumTimestamp,e,r,n)),nt(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield ue(Z.DateMinimumTimestamp,e,r,n)),nt(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield ue(Z.DateMultipleOfTimestamp,e,r,n))}s(_de,"FromDate");function*Ade(e,t,r,n){vc(n)||(yield ue(Z.Function,e,r,n))}s(Ade,"FromFunction");function*kde(e,t,r,n){if(!Iv(n))return yield ue(Z.Integer,e,r,n);nt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ue(Z.IntegerExclusiveMaximum,e,r,n)),nt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ue(Z.IntegerExclusiveMinimum,e,r,n)),nt(e.maximum)&&!(n<=e.maximum)&&(yield ue(Z.IntegerMaximum,e,r,n)),nt(e.minimum)&&!(n>=e.minimum)&&(yield ue(Z.IntegerMinimum,e,r,n)),nt(e.multipleOf)&&n%e.multipleOf!==0&&(yield ue(Z.IntegerMultipleOf,e,r,n))}s(kde,"FromInteger");function*Dde(e,t,r,n){let o=!1;for(let i of e.allOf)for(let a of dn(i,t,r,n))o=!0,yield a;if(o)return yield ue(Z.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let i=new RegExp(rl(e));for(let a of Object.getOwnPropertyNames(n))i.test(a)||(yield ue(Z.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(a),n))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(rl(e));for(let a of Object.getOwnPropertyNames(n))if(!i.test(a)){let l=dn(e.unevaluatedProperties,t,"".concat(r,"/").concat(a),n[a]).next();l.done||(yield l.value)}}}s(Dde,"FromIntersect");function*Fde(e,t,r,n){vv(n)||(yield ue(Z.Iterator,e,r,n))}s(Fde,"FromIterator");function*Lde(e,t,r,n){n!==e.const&&(yield ue(Z.Literal,e,r,n))}s(Lde,"FromLiteral");function*Rde(e,t,r,n){yield ue(Z.Never,e,r,n)}s(Rde,"FromNever");function*Nde(e,t,r,n){dn(e.not,t,r,n).next().done===!0&&(yield ue(Z.Not,e,r,n))}s(Nde,"FromNot");function*Bde(e,t,r,n){Za(n)||(yield ue(Z.Null,e,r,n))}s(Bde,"FromNull");function*$de(e,t,r,n){if(!Ft.IsNumberLike(n))return yield ue(Z.Number,e,r,n);nt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ue(Z.NumberExclusiveMaximum,e,r,n)),nt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ue(Z.NumberExclusiveMinimum,e,r,n)),nt(e.maximum)&&!(n<=e.maximum)&&(yield ue(Z.NumberMaximum,e,r,n)),nt(e.minimum)&&!(n>=e.minimum)&&(yield ue(Z.NumberMinimum,e,r,n)),nt(e.multipleOf)&&n%e.multipleOf!==0&&(yield ue(Z.NumberMultipleOf,e,r,n))}s($de,"FromNumber");function*jde(e,t,r,n){if(!Ft.IsObjectLike(n))return yield ue(Z.Object,e,r,n);nt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ue(Z.ObjectMinProperties,e,r,n)),nt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ue(Z.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 ue(Z.ObjectRequiredProperty,e.properties[l],"".concat(r,"/").concat(sl(l)),void 0));if(e.additionalProperties===!1)for(let l of a)i.includes(l)||(yield ue(Z.ObjectAdditionalProperties,e,"".concat(r,"/").concat(sl(l)),n[l]));if(typeof e.additionalProperties=="object")for(let l of a)i.includes(l)||(yield*dn(e.additionalProperties,t,"".concat(r,"/").concat(sl(l)),n[l]));for(let l of i){let c=e.properties[l];e.required&&e.required.includes(l)?(yield*dn(c,t,"".concat(r,"/").concat(sl(l)),n[l]),ol(e)&&!(l in n)&&(yield ue(Z.ObjectRequiredProperty,c,"".concat(r,"/").concat(sl(l)),void 0))):Ft.IsExactOptionalProperty(n,l)&&(yield*dn(c,t,"".concat(r,"/").concat(sl(l)),n[l]))}}s(jde,"FromObject");function*Gde(e,t,r,n){xv(n)||(yield ue(Z.Promise,e,r,n))}s(Gde,"FromPromise");function*Ude(e,t,r,n){if(!Ft.IsRecordLike(n))return yield ue(Z.Object,e,r,n);nt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ue(Z.ObjectMinProperties,e,r,n)),nt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ue(Z.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*dn(i,t,"".concat(r,"/").concat(sl(l)),c));if(typeof e.additionalProperties=="object")for(let[l,c]of Object.entries(n))a.test(l)||(yield*dn(e.additionalProperties,t,"".concat(r,"/").concat(sl(l)),c));if(e.additionalProperties===!1){for(let[l,c]of Object.entries(n))if(!a.test(l))return yield ue(Z.ObjectAdditionalProperties,e,"".concat(r,"/").concat(sl(l)),c)}}s(Ude,"FromRecord");function*Vde(e,t,r,n){yield*dn(St(e,t),t,r,n)}s(Vde,"FromRef");function*zde(e,t,r,n){if(!pt(n))return yield ue(Z.String,e,r,n);if(nt(e.minLength)&&!(n.length>=e.minLength)&&(yield ue(Z.StringMinLength,e,r,n)),nt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ue(Z.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield ue(Z.RegExp,e,r,n)}s(zde,"FromRegExp");function*Hde(e,t,r,n){if(!pt(n))return yield ue(Z.String,e,r,n);nt(e.minLength)&&!(n.length>=e.minLength)&&(yield ue(Z.StringMinLength,e,r,n)),nt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ue(Z.StringMaxLength,e,r,n)),pt(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield ue(Z.StringPattern,e,r,n))),pt(e.format)&&(Zn.Has(e.format)?Zn.Get(e.format)(n)||(yield ue(Z.StringFormat,e,r,n)):yield ue(Z.StringFormatUnknown,e,r,n))}s(Hde,"FromString");function*Wde(e,t,r,n){Xa(n)||(yield ue(Z.Symbol,e,r,n))}s(Wde,"FromSymbol");function*qde(e,t,r,n){if(!pt(n))return yield ue(Z.String,e,r,n);new RegExp(e.pattern).test(n)||(yield ue(Z.StringPattern,e,r,n))}s(qde,"FromTemplateLiteral");function*Zde(e,t,r,n){yield*dn(St(e,t),t,r,n)}s(Zde,"FromThis");function*Xde(e,t,r,n){if(!Ue(n))return yield ue(Z.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield ue(Z.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield ue(Z.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*dn(e.items[o],t,"".concat(r,"/").concat(o),n[o])}s(Xde,"FromTuple");function*Yde(e,t,r,n){br(n)||(yield ue(Z.Undefined,e,r,n))}s(Yde,"FromUndefined");function*Kde(e,t,r,n){if(Qe(e,t,n))return;let o=e.anyOf.map(i=>new pi(dn(i,t,r,n)));yield ue(Z.Union,e,r,n,o)}s(Kde,"FromUnion");function*Jde(e,t,r,n){if(!Ef(n))return yield ue(Z.Uint8Array,e,r,n);nt(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield ue(Z.Uint8ArrayMaxByteLength,e,r,n)),nt(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield ue(Z.Uint8ArrayMinByteLength,e,r,n))}s(Jde,"FromUint8Array");function*Qde(e,t,r,n){}s(Qde,"FromUnknown");function*efe(e,t,r,n){Ft.IsVoidLike(n)||(yield ue(Z.Void,e,r,n))}s(efe,"FromVoid");function*tfe(e,t,r,n){Vr.Get(e[q])(e,n)||(yield ue(Z.Kind,e,r,n))}s(tfe,"FromKind");function*dn(e,t,r,n){let o=nt(e.$id)?[...t,e]:t,i=e;switch(i[q]){case"Any":return yield*Pde(i,o,r,n);case"Array":return yield*Tde(i,o,r,n);case"AsyncIterator":return yield*wde(i,o,r,n);case"BigInt":return yield*Mde(i,o,r,n);case"Boolean":return yield*Ode(i,o,r,n);case"Constructor":return yield*Ede(i,o,r,n);case"Date":return yield*_de(i,o,r,n);case"Function":return yield*Ade(i,o,r,n);case"Integer":return yield*kde(i,o,r,n);case"Intersect":return yield*Dde(i,o,r,n);case"Iterator":return yield*Fde(i,o,r,n);case"Literal":return yield*Lde(i,o,r,n);case"Never":return yield*Rde(i,o,r,n);case"Not":return yield*Nde(i,o,r,n);case"Null":return yield*Bde(i,o,r,n);case"Number":return yield*$de(i,o,r,n);case"Object":return yield*jde(i,o,r,n);case"Promise":return yield*Gde(i,o,r,n);case"Record":return yield*Ude(i,o,r,n);case"Ref":return yield*Vde(i,o,r,n);case"RegExp":return yield*zde(i,o,r,n);case"String":return yield*Hde(i,o,r,n);case"Symbol":return yield*Wde(i,o,r,n);case"TemplateLiteral":return yield*qde(i,o,r,n);case"This":return yield*Zde(i,o,r,n);case"Tuple":return yield*Xde(i,o,r,n);case"Undefined":return yield*Yde(i,o,r,n);case"Union":return yield*Kde(i,o,r,n);case"Uint8Array":return yield*Jde(i,o,r,n);case"Unknown":return yield*Qde(i,o,r,n);case"Void":return yield*efe(i,o,r,n);default:if(!Vr.Has(i[q]))throw new Zw(e);return yield*tfe(i,o,r,n)}}s(dn,"Visit");function zs(...e){let t=e.length===3?dn(e[0],e[1],"",e[2]):dn(e[0],[],"",e[1]);return new pi(t)}s(zs,"Errors");d();var rfe=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},cG=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)},Kw,ex,uG,Qw=class Qw extends ke{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),Kw.add(this),ex.set(this,void 0),rfe(this,ex,t,"f"),this.error=r}Errors(){return new pi(cG(this,Kw,"m",uG).call(this))}};s(Qw,"AssertError");var Jw=Qw;ex=new WeakMap,Kw=new WeakSet,uG=s(function*(){this.error&&(yield this.error),yield*cG(this,ex,"f")},"_AssertError_Iterator");function lG(e,t,r){if(!Qe(e,t,r))throw new Jw(zs(e,t,r))}s(lG,"AssertValue");function tx(...e){return e.length===3?lG(e[0],e[1],e[2]):lG(e[0],[],e[1])}s(tx,"Assert");d();d();d();function nfe(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Ct(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Ct(e[r]);return t}s(nfe,"FromObject");function ofe(e){return e.map(t=>Ct(t))}s(ofe,"FromArray");function ife(e){return e.slice()}s(ife,"FromTypedArray");function sfe(e){return new Map(Ct([...e.entries()]))}s(sfe,"FromMap");function afe(e){return new Set(Ct([...e.entries()]))}s(afe,"FromSet");function lfe(e){return new Date(e.toISOString())}s(lfe,"FromDate");function Ct(e){if(Ue(e))return ofe(e);if(Wn(e))return lfe(e);if(ri(e))return ife(e);if(EB(e))return sfe(e);if(_B(e))return afe(e);if(He(e))return nfe(e);if(cn(e))return e;throw new Error("ValueClone: Unable to clone value")}s(Ct,"Clone");var eM=class eM extends ke{constructor(t,r){super(r),this.schema=t}};s(eM,"ValueCreateError");var Do=eM;function Pt(e){return vc(e)?e():Ct(e)}s(Pt,"FromDefault");function cfe(e,t){return Re(e,"default")?Pt(e.default):{}}s(cfe,"FromAny");function ufe(e,t){if(e.uniqueItems===!0&&!Re(e,"default"))throw new Do(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!Re(e,"default"))throw new Do(e,"Array with the contains constraint requires a default value");return"default"in e?Pt(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>Fo(e.items,t)):[]}s(ufe,"FromArray");function pfe(e,t){return Re(e,"default")?Pt(e.default):async function*(){}()}s(pfe,"FromAsyncIterator");function dfe(e,t){return Re(e,"default")?Pt(e.default):BigInt(0)}s(dfe,"FromBigInt");function ffe(e,t){return Re(e,"default")?Pt(e.default):!1}s(ffe,"FromBoolean");function mfe(e,t){if(Re(e,"default"))return Pt(e.default);{let r=Fo(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(mfe,"FromConstructor");function hfe(e,t){return Re(e,"default")?Pt(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}s(hfe,"FromDate");function yfe(e,t){return Re(e,"default")?Pt(e.default):()=>Fo(e.returns,t)}s(yfe,"FromFunction");function gfe(e,t){return Re(e,"default")?Pt(e.default):e.minimum!==void 0?e.minimum:0}s(gfe,"FromInteger");function bfe(e,t){if(Re(e,"default"))return Pt(e.default);{let r=e.allOf.reduce((n,o)=>{let i=Fo(o,t);return typeof i=="object"?{...n,...i}:i},{});if(!Qe(e,t,r))throw new Do(e,"Intersect produced invalid value. Consider using a default value.");return r}}s(bfe,"FromIntersect");function vfe(e,t){return Re(e,"default")?Pt(e.default):function*(){}()}s(vfe,"FromIterator");function xfe(e,t){return Re(e,"default")?Pt(e.default):e.const}s(xfe,"FromLiteral");function Ife(e,t){if(Re(e,"default"))return Pt(e.default);throw new Do(e,"Never types cannot be created. Consider using a default value.")}s(Ife,"FromNever");function Sfe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Do(e,"Not types must have a default value")}s(Sfe,"FromNot");function Cfe(e,t){return Re(e,"default")?Pt(e.default):null}s(Cfe,"FromNull");function Pfe(e,t){return Re(e,"default")?Pt(e.default):e.minimum!==void 0?e.minimum:0}s(Pfe,"FromNumber");function Tfe(e,t){if(Re(e,"default"))return Pt(e.default);{let r=new Set(e.required),n={};for(let[o,i]of Object.entries(e.properties))r.has(o)&&(n[o]=Fo(i,t));return n}}s(Tfe,"FromObject");function wfe(e,t){return Re(e,"default")?Pt(e.default):Promise.resolve(Fo(e.item,t))}s(wfe,"FromPromise");function Mfe(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(Re(e,"default"))return Pt(e.default);if(r===el||r===Qa)return{};{let o=r.slice(1,r.length-1).split("|"),i={};for(let a of o)i[a]=Fo(n,t);return i}}s(Mfe,"FromRecord");function Ofe(e,t){return Re(e,"default")?Pt(e.default):Fo(St(e,t),t)}s(Ofe,"FromRef");function Efe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Do(e,"RegExp types cannot be created. Consider using a default value.")}s(Efe,"FromRegExp");function _fe(e,t){if(e.pattern!==void 0){if(Re(e,"default"))return Pt(e.default);throw new Do(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(Re(e,"default"))return Pt(e.default);throw new Do(e,"String types with formats must specify a default value")}else return Re(e,"default")?Pt(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}s(_fe,"FromString");function Afe(e,t){return Re(e,"default")?Pt(e.default):"value"in e?Symbol.for(e.value):Symbol()}s(Afe,"FromSymbol");function kfe(e,t){if(Re(e,"default"))return Pt(e.default);if(!wv(e))throw new Do(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Rf(e)[0]}s(kfe,"FromTemplateLiteral");function Dfe(e,t){if(pG++>Gfe)throw new Do(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Re(e,"default")?Pt(e.default):Fo(St(e,t),t)}s(Dfe,"FromThis");function Ffe(e,t){return Re(e,"default")?Pt(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>Fo(e.items[n],t))}s(Ffe,"FromTuple");function Lfe(e,t){if(Re(e,"default"))return Pt(e.default)}s(Lfe,"FromUndefined");function Rfe(e,t){if(Re(e,"default"))return Pt(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return Fo(e.anyOf[0],t)}s(Rfe,"FromUnion");function Nfe(e,t){return Re(e,"default")?Pt(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}s(Nfe,"FromUint8Array");function Bfe(e,t){return Re(e,"default")?Pt(e.default):{}}s(Bfe,"FromUnknown");function $fe(e,t){if(Re(e,"default"))return Pt(e.default)}s($fe,"FromVoid");function jfe(e,t){if(Re(e,"default"))return Pt(e.default);throw new Error("User defined types must specify a default value")}s(jfe,"FromKind");function Fo(e,t){let r=ui(e,t),n=e;switch(n[q]){case"Any":return cfe(n,r);case"Array":return ufe(n,r);case"AsyncIterator":return pfe(n,r);case"BigInt":return dfe(n,r);case"Boolean":return ffe(n,r);case"Constructor":return mfe(n,r);case"Date":return hfe(n,r);case"Function":return yfe(n,r);case"Integer":return gfe(n,r);case"Intersect":return bfe(n,r);case"Iterator":return vfe(n,r);case"Literal":return xfe(n,r);case"Never":return Ife(n,r);case"Not":return Sfe(n,r);case"Null":return Cfe(n,r);case"Number":return Pfe(n,r);case"Object":return Tfe(n,r);case"Promise":return wfe(n,r);case"Record":return Mfe(n,r);case"Ref":return Ofe(n,r);case"RegExp":return Efe(n,r);case"String":return _fe(n,r);case"Symbol":return Afe(n,r);case"TemplateLiteral":return kfe(n,r);case"This":return Dfe(n,r);case"Tuple":return Ffe(n,r);case"Undefined":return Lfe(n,r);case"Union":return Rfe(n,r);case"Uint8Array":return Nfe(n,r);case"Unknown":return Bfe(n,r);case"Void":return $fe(n,r);default:if(!Vr.Has(n[q]))throw new Do(n,"Unknown type");return jfe(n,r)}}s(Fo,"Visit");var Gfe=512,pG=0;function di(...e){return pG=0,e.length===2?Fo(e[0],e[1]):Fo(e[0],[])}s(di,"Create");var rM=class rM extends ke{constructor(t,r){super(r),this.schema=t}};s(rM,"ValueCastError");var rx=rM;function Ufe(e,t,r){if(e[q]==="Object"&&typeof r=="object"&&!Za(r)){let n=e,o=Object.getOwnPropertyNames(r),i=Object.entries(n.properties),[a,l]=[1/i.length,i.length];return i.reduce((c,[p,f])=>{let m=f[q]==="Literal"&&f.const===r[p]?l:0,y=Qe(f,t,r[p])?a:0,v=o.includes(p)?a:0;return c+(m+y+v)},0)}else return Qe(e,t,r)?1:0}s(Ufe,"ScoreUnion");function Vfe(e,t,r){let n=e.anyOf.map(a=>St(a,t)),[o,i]=[n[0],0];for(let a of n){let l=Ufe(a,t,r);l>i&&(o=a,i=l)}return o}s(Vfe,"SelectUnion");function zfe(e,t,r){if("default"in e)return typeof r=="function"?e.default:Ct(e.default);{let n=Vfe(e,t,r);return tM(n,t,r)}}s(zfe,"CastUnion");function Hfe(e,t,r){return Qe(e,t,r)?Ct(r):di(e,t)}s(Hfe,"DefaultClone");function Wfe(e,t,r){return Qe(e,t,r)?r:di(e,t)}s(Wfe,"Default");function qfe(e,t,r){if(Qe(e,t,r))return Ct(r);let n=Ue(r)?Ct(r):di(e,t),o=Me(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,a=(Me(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(c=>Hs(e.items,t,c));if(e.uniqueItems!==!0)return a;let l=[...new Set(a)];if(!Qe(e,t,l))throw new rx(e,"Array cast produced invalid data due to uniqueItems constraint");return l}s(qfe,"FromArray");function Zfe(e,t,r){if(Qe(e,t,r))return di(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]=Hs(a,t,r.prototype[i]));return o}s(Zfe,"FromConstructor");function Xfe(e,t,r){let n=di(e,t),o=He(n)&&He(r)?{...n,...r}:r;return Qe(e,t,o)?o:di(e,t)}s(Xfe,"FromIntersect");function Yfe(e,t,r){throw new rx(e,"Never types cannot be cast")}s(Yfe,"FromNever");function Kfe(e,t,r){if(Qe(e,t,r))return r;if(r===null||typeof r!="object")return di(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]=Hs(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]=Hs(e.additionalProperties,t,r[a]))}return o}s(Kfe,"FromObject");function Jfe(e,t,r){if(Qe(e,t,r))return Ct(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return di(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n],i={};for(let[a,l]of Object.entries(r))i[a]=Hs(o,t,l);return i}s(Jfe,"FromRecord");function Qfe(e,t,r){return Hs(St(e,t),t,r)}s(Qfe,"FromRef");function eme(e,t,r){return Hs(St(e,t),t,r)}s(eme,"FromThis");function tme(e,t,r){return Qe(e,t,r)?Ct(r):Ue(r)?e.items===void 0?[]:e.items.map((n,o)=>Hs(n,t,r[o])):di(e,t)}s(tme,"FromTuple");function rme(e,t,r){return Qe(e,t,r)?Ct(r):zfe(e,t,r)}s(rme,"FromUnion");function Hs(e,t,r){let n=pt(e.$id)?[...t,e]:t,o=e;switch(e[q]){case"Array":return qfe(o,n,r);case"Constructor":return Zfe(o,n,r);case"Intersect":return Xfe(o,n,r);case"Never":return Yfe(o,n,r);case"Object":return Kfe(o,n,r);case"Record":return Jfe(o,n,r);case"Ref":return Qfe(o,n,r);case"This":return eme(o,n,r);case"Tuple":return tme(o,n,r);case"Union":return rme(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Hfe(e,t,r);default:return Wfe(o,n,r)}}s(Hs,"Visit");function tM(...e){return e.length===3?Hs(e[0],e[1],e[2]):Hs(e[0],[],e[1])}s(tM,"Cast");d();function nme(e){return Ic(e)&&e[q]!=="Unsafe"}s(nme,"IsCheckable");function ome(e,t,r){return Ue(r)?r.map(n=>Lo(e.items,t,n)):r}s(ome,"FromArray");function ime(e,t,r){let n=e.unevaluatedProperties,i=e.allOf.map(l=>Lo(l,t,Ct(r))).reduce((l,c)=>He(c)?{...l,...c}:c,{});if(!He(r)||!He(i)||!Ic(n))return i;let a=Qr(e);for(let l of Object.getOwnPropertyNames(r))a.includes(l)||Qe(n,t,r[l])&&(i[l]=Lo(n,t,r[l]));return i}s(ime,"FromIntersect");function sme(e,t,r){if(!He(r)||Ue(r))return r;let n=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Re(e.properties,o)){r[o]=Lo(e.properties[o],t,r[o]);continue}if(Ic(n)&&Qe(n,t,r[o])){r[o]=Lo(n,t,r[o]);continue}delete r[o]}return r}s(sme,"FromObject");function ame(e,t,r){if(!He(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]=Lo(a,t,r[c]);continue}if(Ic(n)&&Qe(n,t,r[c])){r[c]=Lo(n,t,r[c]);continue}delete r[c]}return r}s(ame,"FromRecord");function lme(e,t,r){return Lo(St(e,t),t,r)}s(lme,"FromRef");function cme(e,t,r){return Lo(St(e,t),t,r)}s(cme,"FromThis");function ume(e,t,r){if(!Ue(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]=Lo(e.items[o],t,r[o]);return r.length>n?r.slice(0,n):r}s(ume,"FromTuple");function pme(e,t,r){for(let n of e.anyOf)if(nme(n)&&Qe(n,t,r))return Lo(n,t,r);return r}s(pme,"FromUnion");function Lo(e,t,r){let n=pt(e.$id)?[...t,e]:t,o=e;switch(o[q]){case"Array":return ome(o,n,r);case"Intersect":return ime(o,n,r);case"Object":return sme(o,n,r);case"Record":return ame(o,n,r);case"Ref":return lme(o,n,r);case"This":return cme(o,n,r);case"Tuple":return ume(o,n,r);case"Union":return pme(o,n,r);default:return r}}s(Lo,"Visit");function nx(...e){return e.length===3?Lo(e[0],e[1],e[2]):Lo(e[0],[],e[1])}s(nx,"Clean");d();function ox(e){return pt(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}s(ox,"IsStringNumeric");function dme(e){return ln(e)||Bs(e)||Me(e)}s(dme,"IsValueToString");function Sg(e){return e===!0||Me(e)&&e===1||ln(e)&&e===BigInt("1")||pt(e)&&(e.toLowerCase()==="true"||e==="1")}s(Sg,"IsValueTrue");function Cg(e){return e===!1||Me(e)&&(e===0||Object.is(e,-0))||ln(e)&&e===BigInt("0")||pt(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}s(Cg,"IsValueFalse");function fme(e){return pt(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}s(fme,"IsTimeStringWithTimeZone");function mme(e){return pt(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}s(mme,"IsTimeStringWithoutTimeZone");function hme(e){return pt(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(hme,"IsDateTimeStringWithTimeZone");function yme(e){return pt(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(yme,"IsDateTimeStringWithoutTimeZone");function gme(e){return pt(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}s(gme,"IsDateString");function bme(e,t){let r=fG(e);return r===t?r:e}s(bme,"TryConvertLiteralString");function vme(e,t){let r=mG(e);return r===t?r:e}s(vme,"TryConvertLiteralNumber");function xme(e,t){let r=dG(e);return r===t?r:e}s(xme,"TryConvertLiteralBoolean");function Ime(e,t){return pt(e.const)?bme(t,e.const):Me(e.const)?vme(t,e.const):Bs(e.const)?xme(t,e.const):t}s(Ime,"TryConvertLiteral");function dG(e){return Sg(e)?!0:Cg(e)?!1:e}s(dG,"TryConvertBoolean");function Sme(e){let t=s(r=>r.split(".")[0],"truncateInteger");return ox(e)?BigInt(t(e)):Me(e)?BigInt(Math.trunc(e)):Cg(e)?BigInt(0):Sg(e)?BigInt(1):e}s(Sme,"TryConvertBigInt");function fG(e){return dme(e)?e.toString():Xa(e)&&e.description!==void 0?e.description.toString():e}s(fG,"TryConvertString");function mG(e){return ox(e)?parseFloat(e):Sg(e)?1:Cg(e)?0:e}s(mG,"TryConvertNumber");function Cme(e){return ox(e)?parseInt(e):Me(e)?e|0:Sg(e)?1:Cg(e)?0:e}s(Cme,"TryConvertInteger");function Pme(e){return pt(e)&&e.toLowerCase()==="null"?null:e}s(Pme,"TryConvertNull");function Tme(e){return pt(e)&&e==="undefined"?void 0:e}s(Tme,"TryConvertUndefined");function wme(e){return Wn(e)?e:Me(e)?new Date(e):Sg(e)?new Date(1):Cg(e)?new Date(0):ox(e)?new Date(parseInt(e)):mme(e)?new Date("1970-01-01T".concat(e,".000Z")):fme(e)?new Date("1970-01-01T".concat(e)):yme(e)?new Date("".concat(e,".000Z")):hme(e)?new Date(e):gme(e)?new Date("".concat(e,"T00:00:00.000Z")):e}s(wme,"TryConvertDate");function Mme(e,t,r){return(Ue(r)?r:[r]).map(o=>Ws(e.items,t,o))}s(Mme,"FromArray");function Ome(e,t,r){return Sme(r)}s(Ome,"FromBigInt");function Eme(e,t,r){return dG(r)}s(Eme,"FromBoolean");function _me(e,t,r){return wme(r)}s(_me,"FromDate");function Ame(e,t,r){return Cme(r)}s(Ame,"FromInteger");function kme(e,t,r){return e.allOf.reduce((n,o)=>Ws(o,t,n),r)}s(kme,"FromIntersect");function Dme(e,t,r){return Ime(e,r)}s(Dme,"FromLiteral");function Fme(e,t,r){return Pme(r)}s(Fme,"FromNull");function Lme(e,t,r){return mG(r)}s(Lme,"FromNumber");function Rme(e,t,r){if(!He(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))Re(r,n)&&(r[n]=Ws(e.properties[n],t,r[n]));return r}s(Rme,"FromObject");function Nme(e,t,r){if(!He(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o];for(let[a,l]of Object.entries(r))r[a]=Ws(i,t,l);return r}s(Nme,"FromRecord");function Bme(e,t,r){return Ws(St(e,t),t,r)}s(Bme,"FromRef");function $me(e,t,r){return fG(r)}s($me,"FromString");function jme(e,t,r){return pt(r)||Me(r)?Symbol(r):r}s(jme,"FromSymbol");function Gme(e,t,r){return Ws(St(e,t),t,r)}s(Gme,"FromThis");function Ume(e,t,r){return Ue(r)&&!br(e.items)?r.map((o,i)=>i<e.items.length?Ws(e.items[i],t,o):o):r}s(Ume,"FromTuple");function Vme(e,t,r){return Tme(r)}s(Vme,"FromUndefined");function zme(e,t,r){for(let n of e.anyOf){let o=Ws(n,t,Ct(r));if(Qe(n,t,o))return o}return r}s(zme,"FromUnion");function Ws(e,t,r){let n=ui(e,t),o=e;switch(e[q]){case"Array":return Mme(o,n,r);case"BigInt":return Ome(o,n,r);case"Boolean":return Eme(o,n,r);case"Date":return _me(o,n,r);case"Integer":return Ame(o,n,r);case"Intersect":return kme(o,n,r);case"Literal":return Dme(o,n,r);case"Null":return Fme(o,n,r);case"Number":return Lme(o,n,r);case"Object":return Rme(o,n,r);case"Record":return Nme(o,n,r);case"Ref":return Bme(o,n,r);case"String":return $me(o,n,r);case"Symbol":return jme(o,n,r);case"This":return Gme(o,n,r);case"Tuple":return Ume(o,n,r);case"Undefined":return Vme(o,n,r);case"Union":return zme(o,n,r);default:return r}}s(Ws,"Visit");function ix(...e){return e.length===3?Ws(e[0],e[1],e[2]):Ws(e[0],[],e[1])}s(ix,"Convert");d();d();var nM=class nM extends ke{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(nM,"TransformDecodeCheckError");var Qf=nM,oM=class oM extends ke{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(oM,"TransformDecodeError");var ip=oM;function vr(e,t,r){try{return Jt(e)?e[or].Decode(r):r}catch(n){throw new ip(e,t,r,n)}}s(vr,"Default");function Hme(e,t,r,n){return Ue(n)?vr(e,r,n.map((o,i)=>qs(e.items,t,"".concat(r,"/").concat(i),o))):vr(e,r,n)}s(Hme,"FromArray");function Wme(e,t,r,n){if(!He(n)||cn(n))return vr(e,r,n);let o=Pc(e),i=o.map(f=>f[0]),a={...n};for(let[f,m]of o)f in a&&(a[f]=qs(m,t,"".concat(r,"/").concat(f),a[f]));if(!Jt(e.unevaluatedProperties))return vr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.unevaluatedProperties,p={...a};for(let f of l)i.includes(f)||(p[f]=vr(c,"".concat(r,"/").concat(f),p[f]));return vr(e,r,p)}s(Wme,"FromIntersect");function qme(e,t,r,n){return vr(e,r,qs(e.not,t,r,n))}s(qme,"FromNot");function Zme(e,t,r,n){if(!He(n))return vr(e,r,n);let o=Qr(e),i={...n};for(let p of o)Re(i,p)&&(br(i[p])&&(!Af(e.properties[p])||Ft.IsExactOptionalProperty(i,p))||(i[p]=qs(e.properties[p],t,"".concat(r,"/").concat(p),i[p])));if(!dt(e.additionalProperties))return vr(e,r,i);let a=Object.getOwnPropertyNames(i),l=e.additionalProperties,c={...i};for(let p of a)o.includes(p)||(c[p]=vr(l,"".concat(r,"/").concat(p),c[p]));return vr(e,r,c)}s(Zme,"FromObject");function Xme(e,t,r,n){if(!He(n))return vr(e,r,n);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),a={...n};for(let f of Object.getOwnPropertyNames(n))i.test(f)&&(a[f]=qs(e.patternProperties[o],t,"".concat(r,"/").concat(f),a[f]));if(!dt(e.additionalProperties))return vr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let f of l)i.test(f)||(p[f]=vr(c,"".concat(r,"/").concat(f),p[f]));return vr(e,r,p)}s(Xme,"FromRecord");function Yme(e,t,r,n){let o=St(e,t);return vr(e,r,qs(o,t,r,n))}s(Yme,"FromRef");function Kme(e,t,r,n){let o=St(e,t);return vr(e,r,qs(o,t,r,n))}s(Kme,"FromThis");function Jme(e,t,r,n){return Ue(n)&&Ue(e.items)?vr(e,r,e.items.map((o,i)=>qs(o,t,"".concat(r,"/").concat(i),n[i]))):vr(e,r,n)}s(Jme,"FromTuple");function Qme(e,t,r,n){for(let o of e.anyOf){if(!Qe(o,t,n))continue;let i=qs(o,t,r,n);return vr(e,r,i)}return vr(e,r,n)}s(Qme,"FromUnion");function qs(e,t,r,n){let o=ui(e,t),i=e;switch(e[q]){case"Array":return Hme(i,o,r,n);case"Intersect":return Wme(i,o,r,n);case"Not":return qme(i,o,r,n);case"Object":return Zme(i,o,r,n);case"Record":return Xme(i,o,r,n);case"Ref":return Yme(i,o,r,n);case"Symbol":return vr(i,r,n);case"This":return Kme(i,o,r,n);case"Tuple":return Jme(i,o,r,n);case"Union":return Qme(i,o,r,n);default:return vr(i,r,n)}}s(qs,"Visit");function em(e,t,r){return qs(e,t,"",r)}s(em,"TransformDecode");d();var iM=class iM extends ke{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};s(iM,"TransformEncodeCheckError");var tm=iM,sM=class sM extends ke{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(sM,"TransformEncodeError");var sp=sM;function An(e,t,r){try{return Jt(e)?e[or].Encode(r):r}catch(n){throw new sp(e,t,r,n)}}s(An,"Default");function ehe(e,t,r,n){let o=An(e,r,n);return Ue(o)?o.map((i,a)=>Zs(e.items,t,"".concat(r,"/").concat(a),i)):o}s(ehe,"FromArray");function the(e,t,r,n){let o=An(e,r,n);if(!He(n)||cn(n))return o;let i=Pc(e),a=i.map(m=>m[0]),l={...o};for(let[m,y]of i)m in l&&(l[m]=Zs(y,t,"".concat(r,"/").concat(m),l[m]));if(!Jt(e.unevaluatedProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,f={...l};for(let m of c)a.includes(m)||(f[m]=An(p,"".concat(r,"/").concat(m),f[m]));return f}s(the,"FromIntersect");function rhe(e,t,r,n){return An(e.not,r,An(e,r,n))}s(rhe,"FromNot");function nhe(e,t,r,n){let o=An(e,r,n);if(!He(o))return o;let i=Qr(e),a={...o};for(let f of i)Re(a,f)&&(br(a[f])&&(!Af(e.properties[f])||Ft.IsExactOptionalProperty(a,f))||(a[f]=Zs(e.properties[f],t,"".concat(r,"/").concat(f),a[f])));if(!dt(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let f of l)i.includes(f)||(p[f]=An(c,"".concat(r,"/").concat(f),p[f]));return p}s(nhe,"FromObject");function ohe(e,t,r,n){let o=An(e,r,n);if(!He(n))return o;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...o};for(let m of Object.getOwnPropertyNames(n))a.test(m)&&(l[m]=Zs(e.patternProperties[i],t,"".concat(r,"/").concat(m),l[m]));if(!dt(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,f={...l};for(let m of c)a.test(m)||(f[m]=An(p,"".concat(r,"/").concat(m),f[m]));return f}s(ohe,"FromRecord");function ihe(e,t,r,n){let o=St(e,t),i=Zs(o,t,r,n);return An(e,r,i)}s(ihe,"FromRef");function she(e,t,r,n){let o=St(e,t),i=Zs(o,t,r,n);return An(e,r,i)}s(she,"FromThis");function ahe(e,t,r,n){let o=An(e,r,n);return Ue(e.items)?e.items.map((i,a)=>Zs(i,t,"".concat(r,"/").concat(a),o[a])):[]}s(ahe,"FromTuple");function lhe(e,t,r,n){for(let o of e.anyOf){if(!Qe(o,t,n))continue;let i=Zs(o,t,r,n);return An(e,r,i)}for(let o of e.anyOf){let i=Zs(o,t,r,n);if(Qe(e,t,i))return An(e,r,i)}return An(e,r,n)}s(lhe,"FromUnion");function Zs(e,t,r,n){let o=ui(e,t),i=e;switch(e[q]){case"Array":return ehe(i,o,r,n);case"Intersect":return the(i,o,r,n);case"Not":return rhe(i,o,r,n);case"Object":return nhe(i,o,r,n);case"Record":return ohe(i,o,r,n);case"Ref":return ihe(i,o,r,n);case"This":return she(i,o,r,n);case"Tuple":return ahe(i,o,r,n);case"Union":return lhe(i,o,r,n);default:return An(i,r,n)}}s(Zs,"Visit");function sx(e,t,r){return Zs(e,t,"",r)}s(sx,"TransformEncode");d();function che(e,t){return Jt(e)||en(e.items,t)}s(che,"FromArray");function uhe(e,t){return Jt(e)||en(e.items,t)}s(uhe,"FromAsyncIterator");function phe(e,t){return Jt(e)||en(e.returns,t)||e.parameters.some(r=>en(r,t))}s(phe,"FromConstructor");function dhe(e,t){return Jt(e)||en(e.returns,t)||e.parameters.some(r=>en(r,t))}s(dhe,"FromFunction");function fhe(e,t){return Jt(e)||Jt(e.unevaluatedProperties)||e.allOf.some(r=>en(r,t))}s(fhe,"FromIntersect");function mhe(e,t){return Jt(e)||en(e.items,t)}s(mhe,"FromIterator");function hhe(e,t){return Jt(e)||en(e.not,t)}s(hhe,"FromNot");function yhe(e,t){return Jt(e)||Object.values(e.properties).some(r=>en(r,t))||dt(e.additionalProperties)&&en(e.additionalProperties,t)}s(yhe,"FromObject");function ghe(e,t){return Jt(e)||en(e.item,t)}s(ghe,"FromPromise");function bhe(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Jt(e)||en(n,t)||dt(e.additionalProperties)&&Jt(e.additionalProperties)}s(bhe,"FromRecord");function vhe(e,t){return Jt(e)?!0:en(St(e,t),t)}s(vhe,"FromRef");function xhe(e,t){return Jt(e)?!0:en(St(e,t),t)}s(xhe,"FromThis");function Ihe(e,t){return Jt(e)||!br(e.items)&&e.items.some(r=>en(r,t))}s(Ihe,"FromTuple");function She(e,t){return Jt(e)||e.anyOf.some(r=>en(r,t))}s(She,"FromUnion");function en(e,t){let r=ui(e,t),n=e;if(e.$id&&aM.has(e.$id))return!1;switch(e.$id&&aM.add(e.$id),e[q]){case"Array":return che(n,r);case"AsyncIterator":return uhe(n,r);case"Constructor":return phe(n,r);case"Function":return dhe(n,r);case"Intersect":return fhe(n,r);case"Iterator":return mhe(n,r);case"Not":return hhe(n,r);case"Object":return yhe(n,r);case"Promise":return ghe(n,r);case"Record":return bhe(n,r);case"Ref":return vhe(n,r);case"This":return xhe(n,r);case"Tuple":return Ihe(n,r);case"Union":return She(n,r);default:return Jt(e)}}s(en,"Visit");var aM=new Set;function Xs(e,t){return aM.clear(),en(e,t)}s(Xs,"HasTransform");function hG(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Qe(t,r,n))throw new Qf(t,n,zs(t,r,n).First());return Xs(t,r)?em(t,r,n):n}s(hG,"Decode");d();function al(e,t){let r=Re(e,"default")?e.default:void 0,n=vc(r)?r():Ct(r);return br(t)?n:He(t)&&He(n)?Object.assign(n,t):t}s(al,"ValueOrDefault");function lM(e){return Ic(e)&&"default"in e}s(lM,"HasDefaultProperty");function Che(e,t,r){let n=al(e,r);if(!Ue(n))return n;for(let o=0;o<n.length;o++)n[o]=Ro(e.items,t,n[o]);return n}s(Che,"FromArray");function Phe(e,t,r){return Wn(r)?r:al(e,r)}s(Phe,"FromDate");function The(e,t,r){let n=al(e,r);return e.allOf.reduce((o,i)=>{let a=Ro(i,t,n);return He(a)?{...o,...a}:a},{})}s(The,"FromIntersect");function whe(e,t,r){let n=al(e,r);if(!He(n))return n;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let a=Ro(e.properties[i],t,n[i]);br(a)||(n[i]=Ro(e.properties[i],t,n[i]))}if(!lM(e.additionalProperties))return n;for(let i of Object.getOwnPropertyNames(n))o.includes(i)||(n[i]=Ro(e.additionalProperties,t,n[i]));return n}s(whe,"FromObject");function Mhe(e,t,r){let n=al(e,r);if(!He(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)&&lM(a)&&(n[c]=Ro(a,t,n[c]));if(!lM(o))return n;for(let c of Object.getOwnPropertyNames(n))l.test(c)||(n[c]=Ro(o,t,n[c]));return n}s(Mhe,"FromRecord");function Ohe(e,t,r){return Ro(St(e,t),t,al(e,r))}s(Ohe,"FromRef");function Ehe(e,t,r){return Ro(St(e,t),t,r)}s(Ehe,"FromThis");function _he(e,t,r){let n=al(e,r);if(!Ue(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]=Ro(o[a],t,n[a]));return n}s(_he,"FromTuple");function Ahe(e,t,r){let n=al(e,r);for(let o of e.anyOf){let i=Ro(o,t,Ct(n));if(Qe(o,t,i))return i}return n}s(Ahe,"FromUnion");function Ro(e,t,r){let n=ui(e,t),o=e;switch(o[q]){case"Array":return Che(o,n,r);case"Date":return Phe(o,n,r);case"Intersect":return The(o,n,r);case"Object":return whe(o,n,r);case"Record":return Mhe(o,n,r);case"Ref":return Ohe(o,n,r);case"This":return Ehe(o,n,r);case"Tuple":return _he(o,n,r);case"Union":return Ahe(o,n,r);default:return al(o,r)}}s(Ro,"Visit");function ax(...e){return e.length===3?Ro(e[0],e[1],e[2]):Ro(e[0],[],e[1])}s(ax,"Default");d();d();var fi={};Pa(fi,{Delete:()=>Dhe,Format:()=>Pg,Get:()=>Lhe,Has:()=>Fhe,Set:()=>khe,ValuePointerRootDeleteError:()=>cx,ValuePointerRootSetError:()=>lx});d();var cM=class cM extends ke{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};s(cM,"ValuePointerRootSetError");var lx=cM,uM=class uM extends ke{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};s(uM,"ValuePointerRootDeleteError");var cx=uM;function yG(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}s(yG,"Escape");function*Pg(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 yG(e.slice(t,r))),t=n+1):r=n;yield yG(e.slice(t))}s(Pg,"Format");function khe(e,t,r){if(t==="")throw new lx(e,t,r);let[n,o,i]=[null,e,""];for(let a of Pg(t))o[a]===void 0&&(o[a]={}),n=o,o=o[a],i=a;n[i]=r}s(khe,"Set");function Dhe(e,t){if(t==="")throw new cx(e,t);let[r,n,o]=[null,e,""];for(let i of Pg(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(Dhe,"Delete");function Fhe(e,t){if(t==="")return!0;let[r,n,o]=[null,e,""];for(let i of Pg(t)){if(n[i]===void 0)return!1;r=n,n=n[i],o=i}return Object.getOwnPropertyNames(r).includes(o)}s(Fhe,"Has");function Lhe(e,t){if(t==="")return e;let r=e;for(let n of Pg(t)){if(r[n]===void 0)return;r=r[n]}return r}s(Lhe,"Get");d();function Rhe(e,t){if(!He(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=>ap(e[o],t[o]))}s(Rhe,"ObjectType");function Nhe(e,t){return Wn(t)&&e.getTime()===t.getTime()}s(Nhe,"DateType");function Bhe(e,t){return!Ue(t)||e.length!==t.length?!1:e.every((r,n)=>ap(r,t[n]))}s(Bhe,"ArrayType");function $he(e,t){return!ri(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>ap(r,t[n]))}s($he,"TypedArrayType");function jhe(e,t){return e===t}s(jhe,"ValueType");function ap(e,t){if(Wn(e))return Nhe(e,t);if(ri(e))return $he(e,t);if(Ue(e))return Bhe(e,t);if(He(e))return Rhe(e,t);if(cn(e))return jhe(e,t);throw new Error("ValueEquals: Unable to compare value")}s(ap,"Equal");var Ghe=zt({type:At("insert"),path:oi(),value:nl()}),Uhe=zt({type:At("update"),path:oi(),value:nl()}),Vhe=zt({type:At("delete"),path:oi()}),bG=Bt([Ghe,Uhe,Vhe]),pM=class pM extends ke{constructor(t,r){super(r),this.value=t}};s(pM,"ValueDiffError");var ux=pM;function px(e,t){return{type:"update",path:e,value:t}}s(px,"CreateUpdate");function vG(e,t){return{type:"insert",path:e,value:t}}s(vG,"CreateInsert");function xG(e){return{type:"delete",path:e}}s(xG,"CreateDelete");function gG(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ux(e,"Cannot diff objects with symbols")}s(gG,"AssertDiffable");function*zhe(e,t,r){if(gG(t),gG(r),!AT(r))return yield px(e,r);let n=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let i of o)Re(t,i)||(yield vG("".concat(e,"/").concat(i),r[i]));for(let i of n)Re(r,i)&&(ap(t,r)||(yield*dx("".concat(e,"/").concat(i),t[i],r[i])));for(let i of n)Re(r,i)||(yield xG("".concat(e,"/").concat(i)))}s(zhe,"ObjectType");function*Hhe(e,t,r){if(!Ue(r))return yield px(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*dx("".concat(e,"/").concat(n),t[n],r[n]);for(let n=0;n<r.length;n++)n<t.length||(yield vG("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield xG("".concat(e,"/").concat(n)))}s(Hhe,"ArrayType");function*Whe(e,t,r){if(!ri(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*dx("".concat(e,"/").concat(n),t[n],r[n])}s(Whe,"TypedArrayType");function*qhe(e,t,r){t!==r&&(yield px(e,r))}s(qhe,"ValueType");function*dx(e,t,r){if(AT(t))return yield*zhe(e,t,r);if(Ue(t))return yield*Hhe(e,t,r);if(ri(t))return yield*Whe(e,t,r);if(cn(t))return yield*qhe(e,t,r);throw new ux(t,"Unable to diff value")}s(dx,"Visit");function IG(e,t){return[...dx("",e,t)]}s(IG,"Diff");function Zhe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}s(Zhe,"IsRootUpdate");function Xhe(e){return e.length===0}s(Xhe,"IsIdentity");function SG(e,t){if(Zhe(t))return Ct(t[0].value);if(Xhe(t))return Ct(e);let r=Ct(e);for(let n of t)switch(n.type){case"insert":{fi.Set(r,n.path,n.value);break}case"update":{fi.Set(r,n.path,n.value);break}case"delete":{fi.Delete(r,n.path);break}}return r}s(SG,"Patch");d();function CG(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=Xs(t,r)?sx(t,r,n):n;if(!Qe(t,r,o))throw new tm(t,o,zs(t,r,o).First());return o}s(CG,"Encode");d();var fM=class fM extends ke{constructor(t){super(t)}};s(fM,"ValueMutateError");var fx=fM;function Yhe(e,t,r,n){if(!He(r))fi.Set(e,t,Ct(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)dM(e,"".concat(t,"/").concat(a),r[a],n[a])}}s(Yhe,"ObjectType");function Khe(e,t,r,n){if(!Ue(r))fi.Set(e,t,Ct(n));else{for(let o=0;o<n.length;o++)dM(e,"".concat(t,"/").concat(o),r[o],n[o]);r.splice(n.length)}}s(Khe,"ArrayType");function Jhe(e,t,r,n){if(ri(r)&&r.length===n.length)for(let o=0;o<r.length;o++)r[o]=n[o];else fi.Set(e,t,Ct(n))}s(Jhe,"TypedArrayType");function Qhe(e,t,r,n){r!==n&&fi.Set(e,t,n)}s(Qhe,"ValueType");function dM(e,t,r,n){if(Ue(n))return Khe(e,t,r,n);if(ri(n))return Jhe(e,t,r,n);if(He(n))return Yhe(e,t,r,n);if(cn(n))return Qhe(e,t,r,n)}s(dM,"Visit");function PG(e){return ri(e)||cn(e)}s(PG,"IsNonMutableValue");function eye(e,t){return He(e)&&Ue(t)||Ue(e)&&He(t)}s(eye,"IsMismatchedValue");function TG(e,t){if(PG(e)||PG(t))throw new fx("Only object and array types can be mutated at the root level");if(eye(e,t))throw new fx("Cannot assign due type mismatch of assignable values");dM(e,"",e,t)}s(TG,"Mutate");d();var tye=[(e,t,r)=>Ct(r),(e,t,r)=>ax(e,t,r),(e,t,r)=>nx(e,t,r),(e,t,r)=>ix(e,t,r),(e,t,r)=>(tx(e,t,r),r),(e,t,r)=>Xs(e,t)?em(e,t,r):r];function wG(e,t,r){return tye.reduce((n,o)=>o(e,t,n),r)}s(wG,"ParseValue");function MG(...e){return e.length===3?wG(e[0],e[1],e[2]):wG(e[0],[],e[1])}s(MG,"Parse");d();var ll={};Pa(ll,{Assert:()=>tx,Cast:()=>tM,Check:()=>Qe,Clean:()=>nx,Clone:()=>Ct,Convert:()=>ix,Create:()=>di,Decode:()=>hG,Default:()=>ax,Diff:()=>IG,Edit:()=>bG,Encode:()=>CG,Equal:()=>ap,Errors:()=>zs,Hash:()=>Mc,Mutate:()=>TG,Parse:()=>MG,Patch:()=>SG,ValueErrorIterator:()=>pi});d();d();var hM=class hM extends ke{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));h(this,"schema");this.schema=r}};s(hM,"TypeDereferenceError");var mM=hM;function rye(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new mM(e);return lp(r,t)}s(rye,"Resolve");function mx(e,t){return!ut.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}s(mx,"Pushref");function lp(e,t){return e[q]==="This"||e[q]==="Ref"?rye(e,t):e}s(lp,"Deref");d();function nye(e,t,r){let n=e.get(t);if(n!==void 0)return n;let o=Xs(t,r);return e.set(t,o),o}s(nye,"HasTransformCached");function hx(){let e=new WeakMap;return{HasTransform:s((t,r)=>nye(e,t,r),"HasTransform")}}s(hx,"CreateTransformCache");function xr(e,t,r){try{return N.IsTransform(e)?e[or].Decode(r):r}catch(n){throw new ip(e,t,r,n)}}s(xr,"Default");function oye(e,t,r,n,o){return ut.IsArray(n)?xr(e,r,n.map((i,a)=>Ys(e.items,t,"".concat(r,"/").concat(a),i,o))):xr(e,r,n)}s(oye,"FromArray");function iye(e,t,r,n,o){if(!ut.IsObject(n)||cn(n))return xr(e,r,n);let i=Pc(e),a=i.map(m=>m[0]),l={...n};for(let[m,y]of i)m in l&&(l[m]=Ys(y,t,"".concat(r,"/").concat(m),l[m],o));if(!N.IsTransform(e.unevaluatedProperties))return xr(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,f={...l};for(let m of c)a.includes(m)||(f[m]=xr(p,"".concat(r,"/").concat(m),f[m]));return xr(e,r,f)}s(iye,"FromIntersect");function sye(e,t,r,n,o){return xr(e,r,Ys(e.not,t,r,n,o))}s(sye,"FromNot");function aye(e,t,r,n,o){if(!ut.IsObject(n))return xr(e,r,n);let i=Qr(e),a={...n};for(let f of i)ut.HasPropertyKey(a,f)&&(ut.IsUndefined(a[f])&&(!N.IsUndefined(e.properties[f])||Ft.IsExactOptionalProperty(a,f))||(a[f]=Ys(e.properties[f],t,"".concat(r,"/").concat(f),a[f],o)));if(!N.IsSchema(e.additionalProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let f of l)i.includes(f)||(p[f]=xr(c,"".concat(r,"/").concat(f),p[f]));return xr(e,r,p)}s(aye,"FromObject");function lye(e,t,r,n,o){if(!ut.IsObject(n))return xr(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...n};for(let m of Object.getOwnPropertyNames(n))a.test(m)&&(l[m]=Ys(e.patternProperties[i],t,"".concat(r,"/").concat(m),l[m],o));if(!N.IsSchema(e.additionalProperties))return xr(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,f={...l};for(let m of c)a.test(m)||(f[m]=xr(p,"".concat(r,"/").concat(m),f[m]));return xr(e,r,f)}s(lye,"FromRecord");function cye(e,t,r,n,o){let i=lp(e,t);return xr(e,r,Ys(i,t,r,n,o))}s(cye,"FromRef");function uye(e,t,r,n,o){let i=lp(e,t);return xr(e,r,Ys(i,t,r,n,o))}s(uye,"FromThis");function pye(e,t,r,n,o){return ut.IsArray(n)&&ut.IsArray(e.items)?xr(e,r,e.items.map((i,a)=>Ys(i,t,"".concat(r,"/").concat(a),n[a],o))):xr(e,r,n)}s(pye,"FromTuple");function dye(e,t,r,n,o){for(let i of e.anyOf){if(!ll.Check(i,t,n))continue;let a=Ys(i,t,r,n,o);return xr(e,r,a)}return xr(e,r,n)}s(dye,"FromUnion");function Ys(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=mx(e,t),a=e;switch(e[q]){case"Array":return oye(a,i,r,n,o);case"Intersect":return iye(a,i,r,n,o);case"Not":return sye(a,i,r,n,o);case"Object":return aye(a,i,r,n,o);case"Record":return lye(a,i,r,n,o);case"Ref":return cye(a,i,r,n,o);case"Symbol":return xr(a,r,n);case"This":return uye(a,i,r,n,o);case"Tuple":return pye(a,i,r,n,o);case"Union":return dye(a,i,r,n,o);default:return xr(a,r,n)}}s(Ys,"Visit");function OG(e,t,r){let n=hx();return Ys(e,t,"",r,n)}s(OG,"FastTransformDecode");d();function kn(e,t,r){try{return N.IsTransform(e)?e[or].Encode(r):r}catch(n){throw new sp(e,t,r,n)}}s(kn,"Default");function fye(e,t,r,n,o){let i=kn(e,r,n);return ut.IsArray(i)?i.map((a,l)=>Ks(e.items,t,"".concat(r,"/").concat(l),a,o)):i}s(fye,"FromArray");function mye(e,t,r,n,o){let i=kn(e,r,n);if(!ut.IsObject(n)||cn(n))return i;let a=Pc(e),l=a.map(y=>y[0]),c={...i};for(let[y,v]of a)y in c&&(c[y]=Ks(v,t,"".concat(r,"/").concat(y),c[y],o));if(!N.IsTransform(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),f=e.unevaluatedProperties,m={...c};for(let y of p)l.includes(y)||(m[y]=kn(f,"".concat(r,"/").concat(y),m[y]));return m}s(mye,"FromIntersect");function hye(e,t,r,n){return kn(e.not,r,kn(e,r,n))}s(hye,"FromNot");function yye(e,t,r,n,o){let i=kn(e,r,n);if(!ut.IsObject(i))return i;let a=Qr(e),l={...i};for(let m of a)ut.HasPropertyKey(l,m)&&(ut.IsUndefined(l[m])&&(!N.IsUndefined(e.properties[m])||Ft.IsExactOptionalProperty(l,m))||(l[m]=Ks(e.properties[m],t,"".concat(r,"/").concat(m),l[m],o)));if(!N.IsSchema(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,f={...l};for(let m of c)a.includes(m)||(f[m]=kn(p,"".concat(r,"/").concat(m),f[m]));return f}s(yye,"FromObject");function gye(e,t,r,n,o){let i=kn(e,r,n);if(!ut.IsObject(n))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(a),c={...i};for(let y of Object.getOwnPropertyNames(n))l.test(y)&&(c[y]=Ks(e.patternProperties[a],t,"".concat(r,"/").concat(y),c[y],o));if(!N.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),f=e.additionalProperties,m={...c};for(let y of p)l.test(y)||(m[y]=kn(f,"".concat(r,"/").concat(y),m[y]));return m}s(gye,"FromRecord");function bye(e,t,r,n,o){let i=lp(e,t),a=Ks(i,t,r,n,o);return kn(e,r,a)}s(bye,"FromRef");function vye(e,t,r,n,o){let i=lp(e,t),a=Ks(i,t,r,n,o);return kn(e,r,a)}s(vye,"FromThis");function xye(e,t,r,n,o){let i=kn(e,r,n);return ut.IsArray(e.items)?e.items.map((a,l)=>Ks(a,t,"".concat(r,"/").concat(l),i[l],o)):[]}s(xye,"FromTuple");function Iye(e,t,r,n,o){for(let i of e.anyOf){if(!ll.Check(i,t,n))continue;let a=Ks(i,t,r,n,o);return kn(e,r,a)}for(let i of e.anyOf){let a=Ks(i,t,r,n,o);if(ll.Check(e,t,a))return kn(e,r,a)}return kn(e,r,n)}s(Iye,"FromUnion");function Ks(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=mx(e,t),a=e;switch(e[q]){case"Array":return fye(a,i,r,n,o);case"Intersect":return mye(a,i,r,n,o);case"Not":return hye(a,i,r,n);case"Object":return yye(a,i,r,n,o);case"Record":return gye(a,i,r,n,o);case"Ref":return bye(a,i,r,n,o);case"This":return vye(a,i,r,n,o);case"Tuple":return xye(a,i,r,n,o);case"Union":return Iye(a,i,r,n,o);default:return kn(a,r,n)}}s(Ks,"Visit");function EG(e,t,r){let n=hx();return Ks(e,t,"",r,n)}s(EG,"FastTransformEncode");d();var xM=class xM{constructor(t,r,n,o){this.schema=t,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=Xs(t,r)}Code(){return this.code}Errors(t){return zs(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new Qf(this.schema,t,this.Errors(t).First());return this.hasTransform?em(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?sx(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new tm(this.schema,t,this.Errors(t).First());return r}};s(xM,"TypeCheck");var yM=xM,cl;(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})(cl||(cl={}));var yx;(function(e){function t(i){return i.length===0?!1:cl.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(!(cl.IsAlpha(l)||cl.IsNumeric(l)||cl.DollarSign(l)||cl.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})(yx||(yx={}));var gM;(function(e){function t(r){let n=[];for(let o=0;o<r.length;o++){let i=r.charCodeAt(o);cl.IsNumeric(i)||cl.IsAlpha(i)?n.push(r.charAt(o)):n.push("_".concat(i,"_"))}return n.join("").replace(/__/g,"_")}s(t,"Encode"),e.Encode=t})(gM||(gM={}));var bM;(function(e){function t(r){return r.replace(/'/g,"\\'")}s(t,"Escape"),e.Escape=t})(bM||(bM={}));var IM=class IM extends ke{constructor(t){super("Unknown type"),this.schema=t}};s(IM,"TypeCompilerUnknownTypeError");var vM=IM,SM=class SM extends ke{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};s(SM,"TypeCompilerTypeGuardError");var gx=SM,cp;(function(e){function t(a,l,c){return Ft.ExactOptionalPropertyTypes?"('".concat(l,"' in ").concat(a," ? ").concat(c," : true)"):"(".concat(yx.Encode(a,l)," !== undefined ? ").concat(c," : true)")}s(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(a){return Ft.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 Ft.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 Ft.AllowNaN?"typeof ".concat(a," === 'number'"):"Number.isFinite(".concat(a,")")}s(o,"IsNumberLike"),e.IsNumberLike=o;function i(a){return Ft.AllowNullVoid?"(".concat(a," === undefined || ").concat(a," === null)"):"".concat(a," === undefined")}s(i,"IsVoidLike"),e.IsVoidLike=i})(cp||(cp={}));var bx;(function(e){function t(k){return k[q]==="Any"||k[q]==="Unknown"}s(t,"IsAnyOrUnknown");function*r(k,K,R){yield"true"}s(r,"FromAny");function*n(k,K,R){yield"Array.isArray(".concat(R,")");let[ce,oe]=[Ve("value","any"),Ve("acc","number")];Me(k.maxItems)&&(yield"".concat(R,".length <= ").concat(k.maxItems)),Me(k.minItems)&&(yield"".concat(R,".length >= ").concat(k.minItems));let le=Ae(k.items,K,"value");if(yield"".concat(R,".every((").concat(ce,") => ").concat(le,")"),dt(k.contains)||Me(k.minContains)||Me(k.maxContains)){let xe=dt(k.contains)?k.contains:Nt(),ur=Ae(xe,K,"value"),Gn=Me(k.minContains)?["(count >= ".concat(k.minContains,")")]:[],nn=Me(k.maxContains)?["(count <= ".concat(k.maxContains,")")]:[],In="const count = value.reduce((".concat(oe,", ").concat(ce,") => ").concat(ur," ? acc + 1 : acc, 0)"),yu=["(count > 0)",...Gn,...nn].join(" && ");yield"((".concat(ce,") => { ").concat(In,"; return ").concat(yu,"})(").concat(R,")")}if(k.uniqueItems===!0){let ur="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(ce,") => { ").concat(ur," )(").concat(R,")")}}s(n,"FromArray");function*o(k,K,R){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(R,")")}s(o,"FromAsyncIterator");function*i(k,K,R){yield"(typeof ".concat(R," === 'bigint')"),ln(k.exclusiveMaximum)&&(yield"".concat(R," < BigInt(").concat(k.exclusiveMaximum,")")),ln(k.exclusiveMinimum)&&(yield"".concat(R," > BigInt(").concat(k.exclusiveMinimum,")")),ln(k.maximum)&&(yield"".concat(R," <= BigInt(").concat(k.maximum,")")),ln(k.minimum)&&(yield"".concat(R," >= BigInt(").concat(k.minimum,")")),ln(k.multipleOf)&&(yield"(".concat(R," % BigInt(").concat(k.multipleOf,")) === 0"))}s(i,"FromBigInt");function*a(k,K,R){yield"(typeof ".concat(R," === 'boolean')")}s(a,"FromBoolean");function*l(k,K,R){yield*ve(k.returns,K,"".concat(R,".prototype"))}s(l,"FromConstructor");function*c(k,K,R){yield"(".concat(R," instanceof Date) && Number.isFinite(").concat(R,".getTime())"),Me(k.exclusiveMaximumTimestamp)&&(yield"".concat(R,".getTime() < ").concat(k.exclusiveMaximumTimestamp)),Me(k.exclusiveMinimumTimestamp)&&(yield"".concat(R,".getTime() > ").concat(k.exclusiveMinimumTimestamp)),Me(k.maximumTimestamp)&&(yield"".concat(R,".getTime() <= ").concat(k.maximumTimestamp)),Me(k.minimumTimestamp)&&(yield"".concat(R,".getTime() >= ").concat(k.minimumTimestamp)),Me(k.multipleOfTimestamp)&&(yield"(".concat(R,".getTime() % ").concat(k.multipleOfTimestamp,") === 0"))}s(c,"FromDate");function*p(k,K,R){yield"(typeof ".concat(R," === 'function')")}s(p,"FromFunction");function*f(k,K,R){yield"Number.isInteger(".concat(R,")"),Me(k.exclusiveMaximum)&&(yield"".concat(R," < ").concat(k.exclusiveMaximum)),Me(k.exclusiveMinimum)&&(yield"".concat(R," > ").concat(k.exclusiveMinimum)),Me(k.maximum)&&(yield"".concat(R," <= ").concat(k.maximum)),Me(k.minimum)&&(yield"".concat(R," >= ").concat(k.minimum)),Me(k.multipleOf)&&(yield"(".concat(R," % ").concat(k.multipleOf,") === 0"))}s(f,"FromInteger");function*m(k,K,R){let ce=k.allOf.map(oe=>Ae(oe,K,R)).join(" && ");if(k.unevaluatedProperties===!1){let oe=it("".concat(new RegExp(rl(k)),";")),le="Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(oe,".test(key))");yield"(".concat(ce," && ").concat(le,")")}else if(dt(k.unevaluatedProperties)){let oe=it("".concat(new RegExp(rl(k)),";")),le="Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(oe,".test(key) || ").concat(Ae(k.unevaluatedProperties,K,"".concat(R,"[key]")),")");yield"(".concat(ce," && ").concat(le,")")}else yield"(".concat(ce,")")}s(m,"FromIntersect");function*y(k,K,R){yield"(typeof value === 'object' && Symbol.iterator in ".concat(R,")")}s(y,"FromIterator");function*v(k,K,R){typeof k.const=="number"||typeof k.const=="boolean"?yield"(".concat(R," === ").concat(k.const,")"):yield"(".concat(R," === '").concat(bM.Escape(k.const),"')")}s(v,"FromLiteral");function*x(k,K,R){yield"false"}s(x,"FromNever");function*S(k,K,R){let ce=Ae(k.not,K,R);yield"(!".concat(ce,")")}s(S,"FromNot");function*I(k,K,R){yield"(".concat(R," === null)")}s(I,"FromNull");function*P(k,K,R){yield cp.IsNumberLike(R),Me(k.exclusiveMaximum)&&(yield"".concat(R," < ").concat(k.exclusiveMaximum)),Me(k.exclusiveMinimum)&&(yield"".concat(R," > ").concat(k.exclusiveMinimum)),Me(k.maximum)&&(yield"".concat(R," <= ").concat(k.maximum)),Me(k.minimum)&&(yield"".concat(R," >= ").concat(k.minimum)),Me(k.multipleOf)&&(yield"(".concat(R," % ").concat(k.multipleOf,") === 0"))}s(P,"FromNumber");function*T(k,K,R){yield cp.IsObjectLike(R),Me(k.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length >= ").concat(k.minProperties)),Me(k.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length <= ").concat(k.maxProperties));let ce=Object.getOwnPropertyNames(k.properties);for(let oe of ce){let le=yx.Encode(R,oe),xe=k.properties[oe];if(k.required&&k.required.includes(oe))yield*ve(xe,K,le),(ol(xe)||t(xe))&&(yield"('".concat(oe,"' in ").concat(R,")"));else{let ur=Ae(xe,K,le);yield cp.IsExactOptionalProperty(R,oe,ur)}}if(k.additionalProperties===!1)if(k.required&&k.required.length===ce.length)yield"Object.getOwnPropertyNames(".concat(R,").length === ").concat(ce.length);else{let oe="[".concat(ce.map(le=>"'".concat(le,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(oe,".includes(key))")}if(typeof k.additionalProperties=="object"){let oe=Ae(k.additionalProperties,K,"".concat(R,"[key]")),le="[".concat(ce.map(xe=>"'".concat(xe,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(le,".includes(key) || ").concat(oe,"))")}}s(T,"FromObject");function*M(k,K,R){yield"(typeof value === 'object' && typeof ".concat(R,".then === 'function')")}s(M,"FromPromise");function*w(k,K,R){yield cp.IsRecordLike(R),Me(k.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length >= ").concat(k.minProperties)),Me(k.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length <= ").concat(k.maxProperties));let[ce,oe]=Object.entries(k.patternProperties)[0],le=it("".concat(new RegExp(ce))),xe=Ae(oe,K,"value"),ur=dt(k.additionalProperties)?Ae(k.additionalProperties,K,R):k.additionalProperties===!1?"false":"true",Gn="(".concat(le,".test(key) ? ").concat(xe," : ").concat(ur,")");yield"(Object.entries(".concat(R,").every(([key, value]) => ").concat(Gn,"))")}s(w,"FromRecord");function*E(k,K,R){let ce=St(k,K);if(pe.functions.has(k.$ref))return yield"".concat(yt(k.$ref),"(").concat(R,")");yield*ve(ce,K,R)}s(E,"FromRef");function*B(k,K,R){let ce=it("".concat(new RegExp(k.source,k.flags),";"));yield"(typeof ".concat(R," === 'string')"),Me(k.maxLength)&&(yield"".concat(R,".length <= ").concat(k.maxLength)),Me(k.minLength)&&(yield"".concat(R,".length >= ").concat(k.minLength)),yield"".concat(ce,".test(").concat(R,")")}s(B,"FromRegExp");function*D(k,K,R){if(yield"(typeof ".concat(R," === 'string')"),Me(k.maxLength)&&(yield"".concat(R,".length <= ").concat(k.maxLength)),Me(k.minLength)&&(yield"".concat(R,".length >= ").concat(k.minLength)),k.pattern!==void 0){let ce=it("".concat(new RegExp(k.pattern),";"));yield"".concat(ce,".test(").concat(R,")")}k.format!==void 0&&(yield"format('".concat(k.format,"', ").concat(R,")"))}s(D,"FromString");function*F(k,K,R){yield"(typeof ".concat(R," === 'symbol')")}s(F,"FromSymbol");function*L(k,K,R){yield"(typeof ".concat(R," === 'string')");let ce=it("".concat(new RegExp(k.pattern),";"));yield"".concat(ce,".test(").concat(R,")")}s(L,"FromTemplateLiteral");function*H(k,K,R){yield"".concat(yt(k.$ref),"(").concat(R,")")}s(H,"FromThis");function*U(k,K,R){if(yield"Array.isArray(".concat(R,")"),k.items===void 0)return yield"".concat(R,".length === 0");yield"(".concat(R,".length === ").concat(k.maxItems,")");for(let ce=0;ce<k.items.length;ce++){let oe=Ae(k.items[ce],K,"".concat(R,"[").concat(ce,"]"));yield"".concat(oe)}}s(U,"FromTuple");function*G(k,K,R){yield"".concat(R," === undefined")}s(G,"FromUndefined");function*J(k,K,R){let ce=k.anyOf.map(oe=>Ae(oe,K,R));yield"(".concat(ce.join(" || "),")")}s(J,"FromUnion");function*X(k,K,R){yield"".concat(R," instanceof Uint8Array"),Me(k.maxByteLength)&&(yield"(".concat(R,".length <= ").concat(k.maxByteLength,")")),Me(k.minByteLength)&&(yield"(".concat(R,".length >= ").concat(k.minByteLength,")"))}s(X,"FromUint8Array");function*ie(k,K,R){yield"true"}s(ie,"FromUnknown");function*ee(k,K,R){yield cp.IsVoidLike(R)}s(ee,"FromVoid");function*ge(k,K,R){let ce=pe.instances.size;pe.instances.set(ce,k),yield"kind('".concat(k[q],"', ").concat(ce,", ").concat(R,")")}s(ge,"FromKind");function*ve(k,K,R,ce=!0){let oe=pt(k.$id)?[...K,k]:K,le=k;if(ce&&pt(k.$id)){let xe=yt(k.$id);if(pe.functions.has(xe))return yield"".concat(xe,"(").concat(R,")");{let ur=Ye(xe,k,K,"value",!1);return pe.functions.set(xe,ur),yield"".concat(xe,"(").concat(R,")")}}switch(le[q]){case"Any":return yield*r(le,oe,R);case"Array":return yield*n(le,oe,R);case"AsyncIterator":return yield*o(le,oe,R);case"BigInt":return yield*i(le,oe,R);case"Boolean":return yield*a(le,oe,R);case"Constructor":return yield*l(le,oe,R);case"Date":return yield*c(le,oe,R);case"Function":return yield*p(le,oe,R);case"Integer":return yield*f(le,oe,R);case"Intersect":return yield*m(le,oe,R);case"Iterator":return yield*y(le,oe,R);case"Literal":return yield*v(le,oe,R);case"Never":return yield*x(le,oe,R);case"Not":return yield*S(le,oe,R);case"Null":return yield*I(le,oe,R);case"Number":return yield*P(le,oe,R);case"Object":return yield*T(le,oe,R);case"Promise":return yield*M(le,oe,R);case"Record":return yield*w(le,oe,R);case"Ref":return yield*E(le,oe,R);case"RegExp":return yield*B(le,oe,R);case"String":return yield*D(le,oe,R);case"Symbol":return yield*F(le,oe,R);case"TemplateLiteral":return yield*L(le,oe,R);case"This":return yield*H(le,oe,R);case"Tuple":return yield*U(le,oe,R);case"Undefined":return yield*G(le,oe,R);case"Union":return yield*J(le,oe,R);case"Uint8Array":return yield*X(le,oe,R);case"Unknown":return yield*ie(le,oe,R);case"Void":return yield*ee(le,oe,R);default:if(!Vr.Has(le[q]))throw new vM(k);return yield*ge(le,oe,R)}}s(ve,"Visit");let pe={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Ae(k,K,R,ce=!0){return"(".concat([...ve(k,K,R,ce)].join(" && "),")")}s(Ae,"CreateExpression");function yt(k){return"check_".concat(gM.Encode(k))}s(yt,"CreateFunctionName");function it(k){let K="local_".concat(pe.variables.size);return pe.variables.set(K,"const ".concat(K," = ").concat(k)),K}s(it,"CreateVariable");function Ye(k,K,R,ce,oe=!0){let[le,xe]=["\n",In=>"".padStart(In," ")],ur=Ve("value","any"),Gn=de("boolean"),nn=[...ve(K,R,ce,oe)].map(In=>"".concat(xe(4)).concat(In)).join(" &&".concat(le));return"function ".concat(k,"(").concat(ur,")").concat(Gn," {").concat(le).concat(xe(2),"return (").concat(le).concat(nn).concat(le).concat(xe(2),")\n}")}s(Ye,"CreateFunction");function Ve(k,K){let R=pe.language==="typescript"?": ".concat(K):"";return"".concat(k).concat(R)}s(Ve,"CreateParameter");function de(k){return pe.language==="typescript"?": ".concat(k):""}s(de,"CreateReturns");function he(k,K,R){let ce=Ye("check",k,K,"value"),oe=Ve("value","any"),le=de("boolean"),xe=[...pe.functions.values()],ur=[...pe.variables.values()],Gn=pt(k.$id)?"return function check(".concat(oe,")").concat(le," {\n return ").concat(yt(k.$id),"(value)\n}"):"return ".concat(ce);return[...ur,...xe,Gn].join("\n")}s(he,"Build");function re(...k){let K={language:"javascript"},[R,ce,oe]=k.length===2&&Ue(k[1])?[k[0],k[1],K]:k.length===2&&!Ue(k[1])?[k[0],[],k[1]]:k.length===3?[k[0],k[1],k[2]]:k.length===1?[k[0],[],K]:[null,[],K];if(pe.language=oe.language,pe.variables.clear(),pe.functions.clear(),pe.instances.clear(),!dt(R))throw new gx(R);for(let le of ce)if(!dt(le))throw new gx(le);return he(R,ce,oe)}s(re,"Code"),e.Code=re;function se(k,K=[]){let R=re(k,K,{language:"javascript"}),ce=globalThis.Function("kind","format","hash",R),oe=new Map(pe.instances);function le(nn,In,yu){if(!Vr.Has(nn)||!oe.has(In))return!1;let d3=Vr.Get(nn),f3=oe.get(In);return d3(f3,yu)}s(le,"typeRegistryFunction");function xe(nn,In){return Zn.Has(nn)?Zn.Get(nn)(In):!1}s(xe,"formatRegistryFunction");function ur(nn){return Mc(nn)}s(ur,"hashFunction");let Gn=ce(le,xe,ur);return new yM(k,K,Gn,R)}s(se,"Compile"),e.Compile=se})(bx||(bx={}));d();d();var _G={},Sye=s(function(e,t,r,n,o){var i=new Worker(_G[t]||(_G[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 p=new Error(c[0]);p.code=c[1],p.stack=c[2],o(p,null)}else o(null,l)},i.postMessage(r,n),i},"wk"),Qt=Uint8Array,Yn=Uint16Array,Mg=Int32Array,im=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]),sm=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]),Tg=new Qt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),FG=s(function(e,t){for(var r=new Yn(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Mg(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"),LG=FG(im,2),EM=LG.b,Cx=LG.r;EM[28]=258,Cx[258]=28;var RG=FG(sm,0),NG=RG.b,PM=RG.r,wg=new Yn(32768);for(Dt=0;Dt<32768;++Dt)ul=(Dt&43690)>>1|(Dt&21845)<<1,ul=(ul&52428)>>2|(ul&13107)<<2,ul=(ul&61680)>>4|(ul&3855)<<4,wg[Dt]=((ul&65280)>>8|(ul&255)<<8)>>1;var ul,Dt,hi=s(function(e,t,r){for(var n=e.length,o=0,i=new Yn(t);o<n;++o)e[o]&&++i[e[o]-1];var a=new Yn(t);for(o=1;o<t;++o)a[o]=a[o-1]+i[o-1]<<1;var l;if(r){l=new Yn(1<<t);var c=15-t;for(o=0;o<n;++o)if(e[o])for(var p=o<<4|e[o],f=t-e[o],m=a[e[o]-1]++<<f,y=m|(1<<f)-1;m<=y;++m)l[wg[m]>>c]=p}else for(l=new Yn(n),o=0;o<n;++o)e[o]&&(l[o]=wg[a[e[o]-1]++]>>15-e[o]);return l},"hMap"),pl=new Qt(288);for(Dt=0;Dt<144;++Dt)pl[Dt]=8;var Dt;for(Dt=144;Dt<256;++Dt)pl[Dt]=9;var Dt;for(Dt=256;Dt<280;++Dt)pl[Dt]=7;var Dt;for(Dt=280;Dt<288;++Dt)pl[Dt]=8;var Dt,om=new Qt(32);for(Dt=0;Dt<32;++Dt)om[Dt]=5;var Dt,BG=hi(pl,9,0),$G=hi(pl,9,1),jG=hi(om,5,0),GG=hi(om,5,1),xx=s(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),mi=s(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),Ix=s(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),Og=s(function(e){return(e+7)/8|0},"shft"),up=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"),Mx={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},UG=["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||UG[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Rr),!r)throw n;return n},"err"),VG=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 p=s(function(R){var ce=r.length;if(R>ce){var oe=new Qt(Math.max(ce*2,R));oe.set(r),r=oe}},"cbuf"),f=t.f||0,m=t.p||0,y=t.b||0,v=t.l,x=t.d,S=t.m,I=t.n,P=o*8;do{if(!v){f=mi(e,m,1);var T=mi(e,m+1,3);if(m+=3,T)if(T==1)v=$G,x=GG,S=9,I=5;else if(T==2){var B=mi(e,m,31)+257,D=mi(e,m+10,15)+4,F=B+mi(e,m+5,31)+1;m+=14;for(var L=new Qt(F),H=new Qt(19),U=0;U<D;++U)H[Tg[U]]=mi(e,m+U*3,7);m+=D*3;for(var G=xx(H),J=(1<<G)-1,X=hi(H,G,1),U=0;U<F;){var ie=X[mi(e,m,J)];m+=ie&15;var M=ie>>4;if(M<16)L[U++]=M;else{var ee=0,ge=0;for(M==16?(ge=3+mi(e,m,3),m+=2,ee=L[U-1]):M==17?(ge=3+mi(e,m,7),m+=3):M==18&&(ge=11+mi(e,m,127),m+=7);ge--;)L[U++]=ee}}var ve=L.subarray(0,B),pe=L.subarray(B);S=xx(ve),I=xx(pe),v=hi(ve,S,1),x=hi(pe,I,1)}else Rr(1);else{var M=Og(m)+4,w=e[M-4]|e[M-3]<<8,E=M+w;if(E>o){c&&Rr(0);break}l&&p(y+w),r.set(e.subarray(M,E),y),t.b=y+=w,t.p=m=E*8,t.f=f;continue}if(m>P){c&&Rr(0);break}}l&&p(y+131072);for(var Ae=(1<<S)-1,yt=(1<<I)-1,it=m;;it=m){var ee=v[Ix(e,m)&Ae],Ye=ee>>4;if(m+=ee&15,m>P){c&&Rr(0);break}if(ee||Rr(2),Ye<256)r[y++]=Ye;else if(Ye==256){it=m,v=null;break}else{var Ve=Ye-254;if(Ye>264){var U=Ye-257,de=im[U];Ve=mi(e,m,(1<<de)-1)+EM[U],m+=de}var he=x[Ix(e,m)&yt],re=he>>4;he||Rr(3),m+=he&15;var pe=NG[re];if(re>3){var de=sm[re];pe+=Ix(e,m)&(1<<de)-1,m+=de}if(m>P){c&&Rr(0);break}l&&p(y+131072);var se=y+Ve;if(y<pe){var k=i-pe,K=Math.min(pe,se);for(k+y<0&&Rr(3);y<K;++y)r[y]=n[k+y]}for(;y<se;++y)r[y]=r[y-pe]}}t.l=v,t.p=it,t.b=y,t.f=f,v&&(f=1,t.m=S,t.d=x,t.n=I)}while(!f);return y!=r.length&&a?up(r,0,y):r.subarray(0,y)},"inflt"),Js=s(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),rm=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"),Sx=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:AM,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(E,B){return E.f-B.f}),r.push({s:-1,f:25001});var l=r[0],c=r[1],p=0,f=1,m=2;for(r[0]={s:-1,f:l.f+c.f,l,r:c};f!=o-1;)l=r[r[p].f<r[m].f?p++:m++],c=r[p!=f&&r[p].f<r[m].f?p++:m++],r[f++]={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 v=new Yn(y+1),x=Px(r[f-1],v,0);if(x>t){var n=0,S=0,I=x-t,P=1<<I;for(i.sort(function(B,D){return v[D.s]-v[B.s]||B.f-D.f});n<o;++n){var T=i[n].s;if(v[T]>t)S+=P-(1<<x-v[T]),v[T]=t;else break}for(S>>=I;S>0;){var M=i[n].s;v[M]<t?S-=1<<t-v[M]++-1:++n}for(;n>=0&&S;--n){var w=i[n].s;v[w]==t&&(--v[w],++S)}x=t}return{t:new Qt(v),l:x}},"hTree"),Px=s(function(e,t,r){return e.s==-1?Math.max(Px(e.l,t,r+1),Px(e.r,t,r+1)):t[e.s]=r},"ln"),TM=s(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Yn(++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"),nm=s(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),_M=s(function(e,t,r){var n=r.length,o=Og(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"),wM=s(function(e,t,r,n,o,i,a,l,c,p,f){Js(t,f++,r),++o[256];for(var m=Sx(o,15),y=m.t,v=m.l,x=Sx(i,15),S=x.t,I=x.l,P=TM(y),T=P.c,M=P.n,w=TM(S),E=w.c,B=w.n,D=new Yn(19),F=0;F<T.length;++F)++D[T[F]&31];for(var F=0;F<E.length;++F)++D[E[F]&31];for(var L=Sx(D,7),H=L.t,U=L.l,G=19;G>4&&!H[Tg[G-1]];--G);var J=p+5<<3,X=nm(o,pl)+nm(i,om)+a,ie=nm(o,y)+nm(i,S)+a+14+3*G+nm(D,H)+2*D[16]+3*D[17]+7*D[18];if(c>=0&&J<=X&&J<=ie)return _M(t,f,e.subarray(c,c+p));var ee,ge,ve,pe;if(Js(t,f,1+(ie<X)),f+=2,ie<X){ee=hi(y,v,0),ge=y,ve=hi(S,I,0),pe=S;var Ae=hi(H,U,0);Js(t,f,M-257),Js(t,f+5,B-1),Js(t,f+10,G-4),f+=14;for(var F=0;F<G;++F)Js(t,f+3*F,H[Tg[F]]);f+=3*G;for(var yt=[T,E],it=0;it<2;++it)for(var Ye=yt[it],F=0;F<Ye.length;++F){var Ve=Ye[F]&31;Js(t,f,Ae[Ve]),f+=H[Ve],Ve>15&&(Js(t,f,Ye[F]>>5&127),f+=Ye[F]>>12)}}else ee=BG,ge=pl,ve=jG,pe=om;for(var F=0;F<l;++F){var de=n[F];if(de>255){var Ve=de>>18&31;rm(t,f,ee[Ve+257]),f+=ge[Ve+257],Ve>7&&(Js(t,f,de>>23&31),f+=im[Ve]);var he=de&31;rm(t,f,ve[he]),f+=pe[he],he>3&&(rm(t,f,de>>5&8191),f+=sm[he])}else rm(t,f,ee[de]),f+=ge[de]}return rm(t,f,ee[256]),f+ge[256]},"wblk"),zG=new Mg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),AM=new Qt(0),HG=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),p=i.l,f=(i.r||0)&7;if(t){f&&(c[0]=i.r>>3);for(var m=zG[t-1],y=m>>13,v=m&8191,x=(1<<r)-1,S=i.p||new Yn(32768),I=i.h||new Yn(x+1),P=Math.ceil(r/3),T=2*P,M=s(function(le){return(e[le]^e[le+1]<<P^e[le+2]<<T)&x},"hsh"),w=new Mg(25e3),E=new Yn(288),B=new Yn(32),D=0,F=0,L=i.i||0,H=0,U=i.w||0,G=0;L+2<a;++L){var J=M(L),X=L&32767,ie=I[J];if(S[X]=ie,I[J]=X,U<=L){var ee=a-L;if((D>7e3||H>24576)&&(ee>423||!p)){f=wM(e,c,0,w,E,B,F,H,G,L-G,f),H=D=F=0,G=L;for(var ge=0;ge<286;++ge)E[ge]=0;for(var ge=0;ge<30;++ge)B[ge]=0}var ve=2,pe=0,Ae=v,yt=X-ie&32767;if(ee>2&&J==M(L-yt))for(var it=Math.min(y,ee)-1,Ye=Math.min(32767,L),Ve=Math.min(258,ee);yt<=Ye&&--Ae&&X!=ie;){if(e[L+ve]==e[L+ve-yt]){for(var de=0;de<Ve&&e[L+de]==e[L+de-yt];++de);if(de>ve){if(ve=de,pe=yt,de>it)break;for(var he=Math.min(yt,de-2),re=0,ge=0;ge<he;++ge){var se=L-yt+ge&32767,k=S[se],K=se-k&32767;K>re&&(re=K,ie=se)}}}X=ie,ie=S[X],yt+=X-ie&32767}if(pe){w[H++]=268435456|Cx[ve]<<18|PM[pe];var R=Cx[ve]&31,ce=PM[pe]&31;F+=im[R]+sm[ce],++E[257+R],++B[ce],U=L+ve,++D}else w[H++]=e[L],++E[e[L]]}}for(L=Math.max(L,U);L<a;++L)w[H++]=e[L],++E[e[L]];f=wM(e,c,p,w,E,B,F,H,G,L-G,f),p||(i.r=f&7|c[f/8|0]<<3,f-=7,i.h=I,i.p=S,i.i=L,i.w=U)}else{for(var L=i.w||0;L<a+p;L+=65535){var oe=L+65535;oe>=a&&(c[f/8|0]=p,oe=a),f=_M(c,f+1,e.subarray(L,oe))}i.i=a}return up(l,0,n+Og(f)+o)},"dflt"),Cye=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}(),Pye=s(function(){var e=-1;return{p:s(function(t){for(var r=e,n=0;n<t.length;++n)r=Cye[r&255^t[n]]^r>>>8;e=r},"p"),d:s(function(){return~e},"d")}},"crc");var WG=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 HG(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"),kM=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"),AG=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 p=l.toString();if(l.prototype)if(p.indexOf("[native code]")!=-1){var f=p.indexOf(" ",8)+1;t+=p.slice(f,p.indexOf("(",f))}else{t+=p;for(var m in l.prototype)t+=";"+c+".prototype."+m+"="+l.prototype[m].toString()}else t+=p}else r[c]=l}return t},"wcln"),vx=[],Tye=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"),wye=s(function(e,t,r,n){if(!vx[r]){for(var o="",i={},a=e.length-1,l=0;l<a;++l)o=AG(e[l],o,i);vx[r]={c:AG(e[a],o,i),e:i}}var c=kM({},vx[r].e);return Sye(vx[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,c,Tye(c),n)},"wrkr"),Mye=s(function(){return[Qt,Yn,Mg,im,sm,Tg,EM,NG,$G,GG,wg,UG,hi,xx,mi,Ix,Og,up,Rr,VG,FM,Ox,qG]},"bInflt"),Oye=s(function(){return[Qt,Yn,Mg,im,sm,Tg,Cx,PM,BG,pl,jG,om,wg,zG,AM,hi,Js,rm,Sx,Px,TM,nm,_M,wM,Og,up,HG,WG,DM,Ox]},"bDflt");var Ox=s(function(e){return postMessage(e,[e.buffer])},"pbf"),qG=s(function(e){return e&&{out:e.size&&new Qt(e.size),dictionary:e.dictionary}},"gopt"),ZG=s(function(e,t,r,n,o,i){var a=wye(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 Qs=s(function(e,t){return e[t]|e[t+1]<<8},"b2"),Xi=s(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),CM=s(function(e,t){return Xi(e,t)+Xi(e,t+4)*4294967296},"b8"),fn=s(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function Eye(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Rr(7),ZG(e,t,[Oye],function(n){return Ox(DM(n.data[0],n.data[1]))},0,r)}s(Eye,"deflate");function DM(e,t){return WG(e,t||{},0,0)}s(DM,"deflateSync");function _ye(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Rr(7),ZG(e,t,[Mye],function(n){return Ox(FM(n.data[0],qG(n.data[1])))},1,r)}s(_ye,"inflate");function FM(e,t){return VG(e,{i:2},t&&t.out,t&&t.dictionary)}s(FM,"inflateSync");var XG=s(function(e,t,r,n){for(var o in e){var i=e[o],a=t+o,l=n;Array.isArray(i)&&(l=kM(n,i[1]),i=i[0]),i instanceof Qt?r[a]=[i,l]:(r[a+="/"]=[new Qt(0),l],XG(i,a,r,n))}},"fltn"),kG=typeof TextEncoder<"u"&&new TextEncoder,MM=typeof TextDecoder<"u"&&new TextDecoder,Aye=0;try{MM.decode(AM,{stream:!0}),Aye=1}catch{}var kye=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:up(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 Tx(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(kG)return kG.encode(e);for(var o=e.length,i=new Qt(e.length+(e.length>>1)),a=0,l=s(function(f){i[a++]=f},"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 p=e.charCodeAt(n);p<128||t?l(p):p<2048?(l(192|p>>6),l(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|e.charCodeAt(++n)&1023,l(240|p>>18),l(128|p>>12&63),l(128|p>>6&63),l(128|p&63)):(l(224|p>>12),l(128|p>>6&63),l(128|p&63))}return up(i,0,a)}s(Tx,"strToU8");function LM(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(MM)return MM.decode(e);var o=kye(e),i=o.s,r=o.r;return r.length&&Rr(8),i}}s(LM,"strFromU8");var Dye=s(function(e,t){return t+30+Qs(e,t+26)+Qs(e,t+28)},"slzh"),Fye=s(function(e,t,r){var n=Qs(e,t+28),o=LM(e.subarray(t+46,t+46+n),!(Qs(e,t+8)&2048)),i=t+46+n,a=Xi(e,t+20),l=r&&a==4294967295?Lye(e,i):[a,Xi(e,t+24),Xi(e,t+42)],c=l[0],p=l[1],f=l[2];return[Qs(e,t+10),c,p,o,i+Qs(e,t+30)+Qs(e,t+32),f]},"zh"),Lye=s(function(e,t){for(;Qs(e,t)!=1;t+=4+Qs(e,t+2));return[CM(e,t+12),CM(e,t+4),CM(e,t+20)]},"z64e"),OM=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"),DG=s(function(e,t,r,n,o,i,a,l){var c=n.length,p=r.extra,f=l&&l.length,m=OM(p);fn(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),v=y.getFullYear()-1980;if((v<0||v>119)&&Rr(10),fn(e,t,v<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>1),t+=4,i!=-1&&(fn(e,t,r.crc),fn(e,t+4,i<0?-i-2:i),fn(e,t+8,r.size)),fn(e,t+12,c),fn(e,t+14,m),t+=16,a!=null&&(fn(e,t,f),fn(e,t+6,r.attrs),fn(e,t+10,a),t+=14),e.set(n,t),t+=c,m)for(var x in p){var S=p[x],I=S.length;fn(e,t,+x),fn(e,t+2,I),e.set(S,t+4),t+=4+I}return f&&(e.set(l,t),t+=f),t},"wzh"),Rye=s(function(e,t,r,n,o){fn(e,t,101010256),fn(e,t+8,r),fn(e,t+10,r),fn(e,t+12,n),fn(e,t+16,o)},"wzf");function YG(e,t,r){r||(r=t,t={}),typeof r!="function"&&Rr(7);var n={};XG(e,"",n,t);var o=Object.keys(n),i=o.length,a=0,l=0,c=i,p=new Array(i),f=[],m=s(function(){for(var I=0;I<f.length;++I)f[I]()},"tAll"),y=s(function(I,P){wx(function(){r(I,P)})},"cbd");wx(function(){y=r});var v=s(function(){var I=new Qt(l+22),P=a,T=l-a;l=0;for(var M=0;M<c;++M){var w=p[M];try{var E=w.c.length;DG(I,l,w,w.f,w.u,E);var B=30+w.f.length+OM(w.extra),D=l+B;I.set(w.c,D),DG(I,a,w,w.f,w.u,E,l,w.m),a+=16+B+(w.m?w.m.length:0),l=D+E}catch(F){return y(F,null)}}Rye(I,a,p.length,T,P),y(null,I)},"cbf");i||v();for(var x=s(function(I){var P=o[I],T=n[P],M=T[0],w=T[1],E=Pye(),B=M.length;E.p(M);var D=Tx(P),F=D.length,L=w.comment,H=L&&Tx(L),U=H&&H.length,G=OM(w.extra),J=w.level==0?0:8,X=s(function(ie,ee){if(ie)m(),y(ie,null);else{var ge=ee.length;p[I]=kM(w,{size:B,crc:E.d(),c:ee,f:D,m:H,u:F!=P.length||H&&L.length!=U,compression:J}),a+=30+F+G+ge,l+=76+2*(F+G)+(U||0)+ge,--i||v()}},"cbl");if(F>65535&&X(Rr(11,0,1),null),!J)X(null,M);else if(B<16e4)try{X(null,DM(M,w))}catch(ie){X(ie,null)}else f.push(Eye(M,w,X))},"_loop_1"),S=0;S<c;++S)x(S);return m}s(YG,"zip");var wx=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function KG(e,t,r){r||(r=t,t={}),typeof r!="function"&&Rr(7);var n=[],o=s(function(){for(var I=0;I<n.length;++I)n[I]()},"tAll"),i={},a=s(function(I,P){wx(function(){r(I,P)})},"cbd");wx(function(){a=r});for(var l=e.length-22;Xi(e,l)!=101010256;--l)if(!l||e.length-l>65558)return a(Rr(13,0,1),null),o;var c=Qs(e,l+8);if(c){var p=c,f=Xi(e,l+16),m=f==4294967295||p==65535;if(m){var y=Xi(e,l-12);m=Xi(e,y)==101075792,m&&(p=c=Xi(e,y+32),f=Xi(e,y+48))}for(var v=t&&t.filter,x=s(function(I){var P=Fye(e,f,m),T=P[0],M=P[1],w=P[2],E=P[3],B=P[4],D=P[5],F=Dye(e,D);f=B;var L=s(function(U,G){U?(o(),a(U,null)):(G&&(i[E]=G),--c||a(null,i))},"cbl");if(!v||v({name:E,size:M,originalSize:w,compression:T}))if(!T)L(null,up(e,F,F+M));else if(T==8){var H=e.subarray(F,F+M);if(w<524288||M>.8*w)try{L(null,FM(H,{out:new Qt(w)}))}catch(U){L(U,null)}else n.push(_ye(H,{size:w},L))}else L(Rr(14,"unknown compression type "+T,1),null);else L(null,null)},"_loop_3"),S=0;S<p;++S)x(S)}else a(null,{});return o}s(KG,"unzip");d();var Nye=s(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Bye=s(e=>e!=null,"notNull"),Ex=s((e,t,r=0)=>{var n;if(N.IsNull(e))return"null";if(N.IsUndefined(e))return"undefined";if(N.IsString(e))return"<string>";if(N.IsNumber(e))return"<number>";if(N.IsBoolean(e))return"<boolean>";if(N.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(N.IsRef(e)){let o=t.find(i=>i.$id===e.$ref);return o==null?e.$ref:Ex(o,t,r)}if(N.IsArray(e))return"".concat(Ex(e.items,t,r+1),"[]");if(N.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let i="".concat(e.anyOf.map(a=>Ex(a,t,r+1)).filter(Bye).join(" | "));return r>0?"(".concat(i,")"):i}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),$ye=s((e,t,r)=>{var i;let n=t.message;N.IsUnion(t.schema)&&(n="Expected one of: ".concat(Ex(t.schema,r)));let o="#/definitions/".concat(e).concat((i=Nye(t.path))!=null?i:"");return"".concat(o,": ").concat(n)},"errorHandler"),_x=s((e,t,r)=>{let n=t.First();if(n!=null)return $ye(e,n,r)},"shortError");var am;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(am||(am={}));var NM=class NM extends Error{constructor(r,n){super(n);h(this,"name");h(this,"kind");this.name="CompressError",this.kind=r}};s(NM,"CompressError");var lm=NM,jye=s(e=>new lm(am.Archive,e.message),"flateErrorIntoCompressError"),Gye=s(e=>{let t=Object.values(Mx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Uye=s((e,t,r)=>{var n;return new lm(am.Validate,(n=_x(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),Vye=s(e=>new lm(am.Encode,e.message),"encodeErrorIntoCompressError"),zye=s(e=>new lm(am.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),RM=s((e,t,r)=>t instanceof sp?Vye(t):t instanceof pi?Uye(e,t,r):Gye(t)?jye(t):zye(t),"intoCompressError");d();var cm;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(cm||(cm={}));var $M=class $M extends Error{constructor(r,n){super(n);h(this,"name");h(this,"kind");this.name="DecompressError",this.kind=r}};s($M,"DecompressError");var um=$M,Hye=s(e=>new um(cm.Unarchive,e.message),"flateErrorIntoDecompressError"),Wye=s(e=>{let t=Object.values(Mx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),qye=s((e,t,r)=>{var n;return new um(cm.Validate,(n=_x(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),Zye=s(e=>new um(cm.Decode,e.message),"decodeErrorIntoDecompressError"),Xye=s(e=>new um(cm.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),BM=s((e,t,r)=>t instanceof ip?Zye(t):t instanceof pi?qye(e,t,r):Wye(t)?Hye(t):Xye(t),"intoDecompressError");d();d();d();var Yye=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Kye=[0,31,28,31,30,31,30,31,31,30,31,30,31],Jye=s(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),Ax=s(e=>{let t=Yye.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&&Jye(r)?29:Kye[n])},"date");d();var Qye=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,kx=s(e=>{let t=Qye.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 p=n-c*a,f=r-l*a-(p<0?1:0);return(f===23||f===-1)&&(p===59||p===-1)&&o<61},"time");var ege=/t|\s/i,JG=s(e=>{let t=e.split(ege);return t.length===2&&Ax(t[0])&&kx(t[1])},"dateTime");d();var tge=/\/|:/,rge=/^(?:[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,QG=s(e=>tge.test(e)&&rge.test(e),"uri");var nge=[["date",Ax],["time",kx],["date-time",JG],["uri",QG]],eU=s(()=>{for(let[e,t]of nge)try{Qv.Format(e,t)}catch(r){if(r instanceof Ig)continue;throw r}},"registerFormats");d();d();d();var tU=s(e=>e instanceof Error?e:new Error(String(e)),"asError");var Dx=s(e=>(...t)=>{try{return me(e(...t))}catch(r){return be(tU(r))}},"safeFn");var oge=Dx((e,t)=>{let r={};for(let n of t)for(let o of n.intoBundle(e))r[o.path]=Tx(JSON.stringify(o.contents));return r}),jM=s(async(e,t,r)=>oge(e,t).andThenAsync(n=>new Promise(o=>{YG(n,{...r,consume:!0},(i,a)=>{o(i?be(i):me(a))})})),"compress");d();d();function Fx(e,t,r=[]){let n={...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=ige(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 p=new Map(i.map(y=>[rU(y,l),y])),m=c.map(y=>{let v=p.get(rU(y,l));return v?Fx(y,v,r):y});n[a]=m}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]=Fx(l,i,r):n[o]=i}}else n[o]=i;return n}s(Fx,"deepMergeOn");function ige(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(ige,"findIdentifierKey");function rU(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}s(rU,"getValueByKeyPath");var sge=s(e=>e,"identity"),age=s(e=>JSON.parse(LM(e)),"jsonDecode"),lge=s((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,sge)!==void 0),"isFileExpected"),cge=Dx((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,age);if(a){r=Fx(r,a,[]);break}}}return r}),GM=s(async(e,t)=>new Promise(r=>KG(e,{filter:s(n=>lge(n,t),"filter")},(n,o)=>{r(n?be(n):me(o))})).then(r=>r.andThen(n=>cge(n,t))),"decompress");d();var uge=s(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),pge=s(e=>{if(e.length<2)return!1;let t=e.filter(uge);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),Lx=s(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&pge(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Lx(r)])):Array.isArray(e)?e.map(Lx):e,"fixDuplicateAllOf");d();var Rx=s(e=>typeof e=="object"&&e!=null&&"$ref"in e?{...e,$ref:"#/definitions/".concat(e.$ref)}:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Rx(r)])):Array.isArray(e)?e.map(Rx):e,"prefixReferences");var pm;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(pm||(pm={}));var dge=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"),fge=s((...e)=>{let t=new Map;for(let r of dge(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return be({kind:pm.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 me(t)},"computeReferenceMap"),yi,pp,dl,Yi,Bx=class Bx{constructor(t,r,n,o){O(this,yi);O(this,pp);O(this,dl,[]);O(this,Yi);A(this,yi,t),A(this,pp,r),A(this,dl,n),A(this,Yi,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(!N.IsSchema(n))return be({kind:pm.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let o=fge(Ow.values(),Iw.values(),Cw.values(),Tw.values(),ww.values(),Nw.values(),t.extensions.flatMap(i=>{var a;return(a=i.references)!=null?a:[]}).values());if(!o.isOk())return o;try{eU();let i=bx.Compile(n,[...o.value.values()]);return me(new Bx(n,i,t.extensions,o.value))}catch(i){return i instanceof ke?be({kind:pm.TypeboxError,message:i.message,original:i}):be({kind:pm.UnknownError,message:"An unknown error occurred while compiling the schema",original:i})}}is(t){return u(this,pp).Check(t)}parse(t){return u(this,pp).Check(t)?me(t):be(u(this,pp).Errors(t))}decode(t){try{return me(OG(u(this,yi),[...u(this,Yi).values()],t))}catch(r){return be(r)}}encode(t){try{return me(EG(u(this,yi),[...u(this,Yi).values()],t))}catch(r){return be(r)}}verify(t){for(let r of u(this,dl))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return be(n.error)}return me(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([u(this,yi),...u(this,Yi).values()])),r=Lx(Rx({$id:"#/definitions/".concat((n=u(this,yi).$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=>jM(r,u(this,dl))).then(r=>r.mapErr(n=>{var o;return RM((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>jM(r,u(this,dl))).then(r=>r.mapErr(n=>{var o;return RM((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}async decompress(t){return GM(t,u(this,dl)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var o;return BM((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}async decompressUnsafe(t){return GM(t,u(this,dl)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var o;return BM((o=u(this,yi).$id)!=null?o:"CoreMVF",n,[...u(this,Yi).values()])}))}};yi=new WeakMap,pp=new WeakMap,dl=new WeakMap,Yi=new WeakMap,s(Bx,"MVFParser");var Nx=Bx;var dm,UM=class UM{constructor(){O(this,dm,[]);this.extend=this.extend.bind(this)}extend(t){return u(this,dm).push(t),this}extendOptional(t){let r={...t,schema:C.Partial(t.schema)};return u(this,dm).push(r),this}build(){return Nx.create(this)}get extensions(){return u(this,dm)}};dm=new WeakMap,s(UM,"MVFParserBuilder");var $x=UM;var nU=s(()=>new $x().extend(Uj).extend(Zj).extend(Jj),"createParser");var dp=dr("lcat","LocationCategoryId"),VM=C.Intersect([C.Object({id:C.Ref(dp),parent:C.Optional(C.Ref(dp))}),rp(["name"]),Zi],{$id:"LocationCategory"}),oU=[dp,VM];d();d();var fp;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(fp||(fp={}));var iU=s(e=>{var o,i,a,l,c,p,f,m,y;if(e.locationCategories==null&&e.locations==null)return me(!0);let t=new Set((i=(o=e.locationCategories)==null?void 0:o.map(v=>v.id))!=null?i:[]);for(let v of(a=e.locationCategories)!=null?a:[])if(v.parent!=null&&!t.has(v.parent))return be({kind:fp.UnknownParentCategoryError,properties:{categoryId:v.id,parentCategoryId:v.parent}});let r=zr(e);for(let v of(l=e.locations)!=null?l:[]){for(let x of v.categories)if(!t.has(x))return be({kind:fp.UnknownCategoryError,properties:{locationId:v.id,categoryId:x}});for(let x of v.geometryAnchors){let S=r(x.floorId,x.geometryId);if(S.isErr())return S}}let n=new Set((p=(c=e.locations)==null?void 0:c.map(v=>v.id))!=null?p:[]);for(let v of(f=e.locationInstances)!=null?f:[]){if(!n.has(v.parentId))return be({kind:fp.UnknownParentLocationError,properties:{locationInstanceId:v.id,parentLocationId:v.parentId}});for(let x of(m=v.categories)!=null?m:[])if(!t.has(x))return be({kind:fp.UnknownCategoryError,properties:{locationId:v.id,categoryId:x}});for(let x of(y=v.geometryAnchors)!=null?y:[]){let S=r(x.floorId,x.geometryId);if(S.isErr())return S}}return me(!0)},"validateLocations");d();var mp=dr("loc","LocationId"),jx=dr("loci","LocationInstanceId"),sU=C.Object({name:C.String(),url:C.String({format:"uri"})},{$id:"LocationSocial"}),aU=C.Object({url:C.String({format:"uri"})},{$id:"LocationImage"}),zM=C.Object({label:C.String(),url:C.String({format:"uri"})},{$id:"LocationLink"}),HM=C.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),lU=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"}),mge="PublicHolidays",WM=C.Union([lU,C.Literal(mge)],{$id:"OpeningHoursDayOrPublicHoliday"}),Gx=C.Object({"@type":C.Optional(C.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:C.Optional(C.Ref(HM,{description:"The time the opening hours start"})),closes:C.Optional(C.Ref(HM,{description:"The time the opening hours end"})),dayOfWeek:C.Optional(C.Union([C.Ref(WM),C.Array(C.Ref(WM))],{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"}),Ux=C.Intersect([C.Object({id:C.Ref(mp),categories:C.Array(C.Ref(dp)),logo:C.Optional(C.String({format:"uri"})),phone:C.Optional(C.String()),social:C.Array(C.Ref(sU)),images:C.Array(C.Ref(aU)),links:C.Array(C.Ref(zM)),website:C.Optional(C.Ref(zM)),openingHours:C.Optional(C.Array(C.Ref(Gx)))}),rp(["name"]),np(),Zi],{$id:"Location"}),qM=C.Intersect([C.Object({id:C.Ref(jx),parentId:C.Ref(mp)}),C.Partial(C.Omit(Ux,["id","parentId"]))],{$id:"LocationInstance"}),Vx=[mp,jx,sU,aU,zM,HM,lU,WM,Gx,Ux,qM];var hge=C.Object({locations:C.Array(C.Ref(Ux)),locationCategories:C.Array(C.Ref(VM)),locationInstances:C.Optional(C.Array(C.Ref(qM)))},{$id:"LocationsExtensionSchema"}),cU="locations.json",uU="location-categories.json",pU="location-instances.json",dU={name:"ext:locations",schema:hge,intoBundle:s(function*(e){e.locations!=null&&(yield{path:cU,contents:e.locations}),e.locationCategories!=null&&(yield{path:uU,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:pU,contents:e.locationInstances})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===cU)return{locations:r(t)};if(e===uU)return{locationCategories:r(t)};if(e===pU)return{locationInstances:r(t)}},"fromBundle"),references:[...oU,...Vx],integrityCheck:iU};d();d();var ea;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(ea||(ea={}));var fU=s(e=>{var c,p,f,m,y,v,x,S,I,P,T,M,w,E,B,D,F,L,H,U;if(e.enterprise==null)return me(!0);let t=e.enterprise,r=new Set((p=(c=e.locationCategories)==null?void 0:c.map(G=>G.id))!=null?p:[]);for(let G of(f=t.categories)!=null?f:[])if(!r.has(G.categoryId))return be({kind:ea.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:G.id,locationCategoryId:G.categoryId}});let n=new Set((y=(m=e.locations)==null?void 0:m.map(G=>G.id))!=null?y:[]);for(let G of(v=t.locations)!=null?v:[]){if(!n.has(G.locationId))return be({kind:ea.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:G.id,locationId:G.locationId}});for(let J of(x=G.siblingGroups)!=null?x:[])for(let X of(S=J.siblings)!=null?S:[])if(!n.has(X))return be({kind:ea.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:G.id,siblingLocationId:X,label:J.label}})}let o=new Set((P=(I=e.enterprise.locations)==null?void 0:I.map(G=>G.id))!=null?P:[]);if(((T=t.venue)==null?void 0:T.topLocations)!=null){for(let G of t.venue.topLocations)if(!o.has(G))return be({kind:ea.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:G}})}let i=new Set((w=(M=e.locationInstances)==null?void 0:M.map(G=>G.id))!=null?w:[]);for(let G of(E=t.locationInstances)!=null?E:[]){if(!o.has(G.parentId))return be({kind:ea.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:G.id,enterpriseLocationId:G.parentId}});if(!i.has(G.locationInstanceId))return be({kind:ea.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:G.id,locationInstanceId:G.locationInstanceId}});for(let J of(B=G.siblingGroups)!=null?B:[])for(let X of(D=J.siblings)!=null?D:[])if(!n.has(X))return be({kind:ea.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:G.id,siblingLocationId:X,label:J.label}})}let a=il(e),l=zr(e);for(let[G,J]of It((F=t.floorText)!=null?F:{})){let X=a(G);if(X.isErr())return X;for(let ie of J.features){if(!("geometryId"in ie.properties))continue;let ee=l(G,ie.properties.geometryId);if(ee.isErr())return ee}}for(let[G,J]of It((L=t.textures)!=null?L:{})){let X=a(G);if(X.isErr())return X;for(let ie of J){let ee=l(G,ie.geometryId);if(ee.isErr())return ee}}for(let[G,J]of It((H=t.layers)!=null?H:{})){let X=a(G);if(X.isErr())return X;for(let ie of mt(J!=null?J:{})){let ee=l(G,ie);if(ee.isErr())return ee}}for(let[G,J]of It((U=t.textAreas)!=null?U:{})){let X=a(G);if(X.isErr())return X;for(let ie of J.features)if("geometryId"in ie.properties){let ee=l(G,ie.properties.geometryId);if(ee.isErr())return ee}}return me(!0)},"validateCMS");d();d();var hp=dr("el","EnterpriseLocationId"),ZM=dr("ec","EnterpriseCategoryId"),XM=dr("eli","EnterpriseLocationInstanceId"),YM=dr("ev","EnterpriseVenueId"),KM=dr("eft","EnterpriseFloorTextId"),mU=[hp,ZM,XM,YM,KM];var hU=C.Object({id:C.Ref(ZM),categoryId:C.Ref(dp),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"}),JM=C.Object({categories:C.Optional(C.Array(C.Ref(hU)))},{$id:"EnterpriseCategoriesSchema"}),yU=[hU,JM];d();var gU=vo(["left","center","right"]),yge=gU.schema,Ftt=gU.values,QM=C.Object({id:C.Ref(KM),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:yge},{$id:"FloorTextCommonProperties"}),e4=C.Intersect([C.Ref(QM),ci],{$id:"AnchoredFloorTextProperties"}),t4=C.Intersect([C.Ref(QM),C.Object({verticalOffset:C.Number()})],{$id:"FloatingFloorTextProperties"}),bU=C.Union([C.Ref(e4),C.Ref(t4)],{$id:"FloorTextProperties"}),vU=un(En,C.Ref(bU),{$id:"FloorTextFeature"}),gge=un(En,C.Ref(e4),{$id:"AnchoredFloorTextFeature"}),bge=un(En,C.Ref(t4),{$id:"FloatingFloorTextFeature"}),xU=Xn(C.Ref(vU),{$id:"EnterpriseFloorTextFeatureCollection"}),IU=C.Record(xt,C.Ref(xU),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),r4=C.Object({floorText:C.Optional(C.Ref(IU))},{$id:"EnterpriseFloorTextSchema"}),SU=[QM,e4,t4,bU,vU,gge,bge,xU,IU,r4];d();var CU=Pr(C.Record(On,C.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),PU=Pr(C.Record(xt,C.Ref(CU),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),n4=C.Object({layers:C.Optional(C.Ref(PU))},{$id:"EnterpriseLayersSchema"}),TU=[CU,PU,n4];d();d();d();var o4=vo(["closed-temporarily","new","pop-up","coming-soon","relocated"]),vge=o4.schema,Htt=o4.values,Wtt=o4.record,i4=C.Object({type:vge,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."}),s4=C.Object({label:C.String(),siblings:C.Array(C.Ref(mp))},{$id:"SiblingGroup"}),zx=C.Object({name:C.String(),code:C.String()},{$id:"Language"}),wU=[i4,s4,zx];var Hx=C.Object({id:C.Ref(hp),locationId:C.Ref(mp),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(i4),{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(s4))),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"}),a4=C.Object({locations:C.Optional(C.Array(C.Ref(Hx)))},{$id:"EnterpriseLocationsSchema"}),MU=[Hx,a4];var OU=C.Intersect([C.Object({id:C.Ref(XM),parentId:C.Ref(hp),locationInstanceId:C.Ref(jx)}),C.Partial(C.Omit(Hx,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),l4=C.Object({locationInstances:C.Optional(C.Array(C.Ref(OU)))},{$id:"EnterpriseLocationInstancesSchema"}),EU=[OU,l4];d();var c4=vo(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),_U=c4.schema,prt=c4.values,drt=c4.record,u4=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(_U),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"}),AU=C.Intersect([C.Ref(u4),ci],{$id:"EnterpriseAnchoredTextAreaProperties"}),kU=C.Intersect([C.Ref(u4),C.Object({verticalOffset:C.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),DU=C.Union([AU,kU],{$id:"EnterpriseTextAreaProperties"}),FU=un(C.Ref(En),DU,{$id:"EnterpriseTextAreaFeature"}),LU=Xn(C.Ref(FU),{$id:"EnterpriseTextAreaCollection"}),RU=C.Record(xt,C.Ref(LU),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),NU=C.Object({textAreas:C.Optional(C.Ref(RU))},{$id:"EnterpriseTextAreasSchema"}),BU=[_U,u4,AU,kU,DU,FU,LU,RU];d();var p4=C.Object({u:C.Number(),v:C.Number()},{$id:"EnterpriseTextureUV"}),d4=vo(["top","side"],{$id:"EnterpriseTextureFace"}),$U=d4.schema,grt=d4.values,brt=d4.record,f4=vo(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),jU=f4.schema,vrt=f4.values,xrt=f4.record,GU=C.Tuple([Wf,qf,Wf,qf],{$id:"EnterpriseTextureBounds"}),UU=C.Intersect([C.Object({repeat:C.Ref(p4),offset:C.Ref(p4),rotation:C.Number({minimum:0,maximum:360}),path:C.String({format:"uri"}),face:C.Ref($U),surface:C.Ref(jU),bounds:C.Ref(GU)},{$id:"EnterpriseTextureProperties"}),ci],{$id:"EnterpriseTexture"}),VU=C.Array(C.Ref(UU),{$id:"EnterpriseTextures"}),zU=C.Record(xt,C.Ref(VU),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),m4=C.Object({textures:C.Optional(C.Ref(zU))},{$id:"EnterpriseTexturesSchema"}),HU=[UU,VU,m4,p4,$U,jU,GU,zU];d();var WU=C.Intersect([C.Object({id:C.Ref(YM),slug:C.String(),defaultLanguage:C.Ref(zx),languages:C.Array(C.Ref(zx)),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(hp))),operationHours:C.Optional(C.Array(C.Ref(Gx))),coverImage:C.Optional(C.String({format:"uri"}))}),rp(["name"]),Zi],{$id:"EnterpriseVenue"}),h4=C.Object({venue:C.Optional(C.Ref(WU))},{$id:"EnterpriseVenueSchema"}),qU=[WU,h4];var XU=C.Intersect([h4,a4,l4,JM,m4,r4,n4,NU],{$id:"EnterpriseProperties"}),ZU=C.Object({enterprise:C.Optional(C.Ref(XU))},{$id:"CMSExtensionSchema"}),xge=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,YU={name:"ext:cms",schema:ZU,intoBundle:s(function*(e){var r,n,o,i,a,l;if(e.enterprise==null)return;let t=e.enterprise;for(let c of mt(t))switch(c){case"floorText":for(let p of mt((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(p,".geojson"),contents:((n=t.floorText)!=null?n:{})[p]};continue;case"textures":for(let p of mt((o=t.textures)!=null?o:{}))yield{path:"enterprise/textures/".concat(p,".json"),contents:((i=t.textures)!=null?i:{})[p]};continue;case"textAreas":for(let p of mt((a=t.textAreas)!=null?a:{}))yield{path:"enterprise/textAreas/".concat(p,".geojson"),contents:((l=t.textAreas)!=null?l:{})[p]};continue;default:yield{path:"enterprise/".concat(c,".json"),contents:t[c]};continue}},"intoBundle"),fromBundle:s((e,t,r)=>{let n=e.match(xge);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:[XU,ZU,...qU,...MU,...EU,...yU,...HU,...TU,...SU,...BU,...mU,...wU,...Vx],integrityCheck:fU};d();d();d();d();var Ki;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Ki||(Ki={}));var KU=s(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return me(!0);let r=Object.entries(t).map(([i,a])=>({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 be({kind:Ki.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:"navigationFlags.".concat(i.key)}});if(i.index!=n){if(o!=31)return be({kind:Ki.NavigationFlagMissingDeclaration,properties:{index:n,bit:o+1,path:"navigationFlags"}});if(i.index!=n+1||i.bit!=0)return be({kind:Ki.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=i.index,o=0}else{if(i.bit!==o+1)return be({kind:Ki.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:o+1,path:"navigationFlags"}});o=i.bit}}return me(!0)},"validateNavigationFlags");d();function fm(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}s(fm,"hasFlag");d();var JU=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"),mm=s((e,t,r)=>{if(t.index==-1&&e.length===0)return me(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return be({kind:Ki.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>JU)return be({kind:Ki.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:JU,path:r}});continue}else if(i>t.flag)return be({kind:Ki.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:t.flag,path:r}})}return me(!0)},"validateFlags");var Ige=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"}),QU=C.Intersect([Ige,qi],{$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.'}),y4={accessible:"accessible",outdoors:"outdoors"},eV=C.Record(C.String(),QU,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),Sge=C.Object({navigationFlags:C.Ref(eV)},{$id:"NavigationFlagsSchema"}),Wx=C.Array(C.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),g4=C.Object({flags:C.Ref(Wx)},{$id:"WithFlags"}),yp=C.Intersect([Hf,g4],{$id:"FlaggedGeometryAnchor"}),Cge=C.Object({geometryAnchor:yp},{$id:"WithFlaggedGeometryAnchor"}),Pge=C.Object({geometryAnchors:C.Array(yp)},{$id:"WithFlaggedGeometryAnchors"}),tV={name:"ext:mvf-navigation-flags",schema:Sge,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:[QU,eV,Wx,yp,Cge,Pge],integrityCheck:KU};d();var rV=s(e=>{if(e.connections==null)return me(!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=mm(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=mm(a.flags,r,"connections[".concat(n,"].exits[").concat(i,"]"));if(c.isErr())return c}}return me(!0)},"validateConnections");var oV=dr("c","ConnectionId"),{schema:Tge,values:Mnt,record:wge}=vo(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),iV=Tge;var b4=wge,sV=C.Intersect([C.Object({id:C.Ref(oV,{description:"The unique identifier for the connection."}),entrances:C.Array(C.Ref(yp)),exits:C.Array(C.Ref(yp)),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(iV,{description:"The type of connection."})}),qi,Zi],{$id:"ConnectionsProperties"}),aV=C.Array(C.Ref(sV),{$id:"ConnectionsCollection"}),Mge=C.Object({connections:C.Ref(aV)},{$id:"ConnectionsExtensionSchema"}),nV="connections.json",lV={name:"ext:connections",schema:Mge,intoBundle:s(function*(e){e.connections!=null&&(yield{path:nV,contents:e.connections})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===nV)return{connections:r(t)}},"fromBundle"),references:[sV,aV,iV,oV,yp,Wx],integrityCheck:rV};d();d();var cV=s(e=>{if(e.defaultStyle==null)return me(!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 me(!0)},"validateDefaultStyle");var uV=C.Intersect([np(),Zi,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"}),pV=C.Record(C.String(),C.Ref(uV),{$id:"DefaultStyleCollection",additionalProperties:!1}),Oge=C.Object({defaultStyle:C.Ref(pV)},{$id:"DefaultStyleSchema"}),dV={name:"ext:mvf-default-style",schema:Oge,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:[uV,pV],integrityCheck:cV};d();d();d();d();var qx;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(qx||(qx={}));var fV=s(e=>{if(e.floorStacks==null)return me(!0);let t=il(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 be({kind:qx.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return me(!0)},"validateFloorStacks");var Zx=dr("fs","FloorStackId"),hV=C.Intersect([C.Object({id:C.Ref(Zx,{description:"The unique identifier for the floor stack."}),floors:C.Array(C.Ref(xt),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:C.Optional(C.Ref(xt,{description:"The default floor for the floor stack."}))}),qi],{$id:"FloorStacksProperties"}),yV=C.Array(C.Ref(hV),{$id:"FloorStackCollection"}),Ege=C.Object({floorStacks:C.Ref(yV)},{$id:"FloorStackExtensionSchema"}),mV="floor-stacks.json",gV={name:"ext:floor-stacks",schema:Ege,intoBundle:s(function*(e){e.floorStacks!=null&&(yield{path:mV,contents:e.floorStacks})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===mV)return{floorStacks:r(t)}},"fromBundle"),references:[Zx,hV,yV],integrityCheck:fV};d();d();var _g;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(_g||(_g={}));var bV=s(e=>{if(e.facade==null)return me(!0);if(e.floorStacks==null)return be({kind:_g.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=zr(e);for(let[n,o]of It(e.facade))if(o!=null){if(!t.has(n))return be({kind:_g.UnknownFloorStackError,properties:{floorStackId:n}});for(let i of o.geometryAnchors){let a=r(i.floorId,i.geometryId);if(a.isErr())return a}}return me(!0)},"validateFacade");var vV=dr("fc","FacadeId"),xV=C.Intersect([C.Object({id:C.Ref(vV)}),np({minItems:1})],{$id:"FacadeProperties"}),_ge=C.Object({facade:Pr(C.Record(Zx,C.Ref(xV),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),Age=/^facade\/(.*)\.json$/,IV={name:"ext:facade",schema:_ge,intoBundle:s(function*(e){if(e.facade!=null)for(let t of mt(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(Age))==null?void 0:o[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[vV,xV],integrityCheck:bV};d();d();var SV=s(e=>{if(e.floorImages==null)return me(!0);let t=zr(e);for(let[r,n]of It(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 me(!0)},"validateFloorImages");var v4=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"}),CV=C.Intersect([C.Ref(v4),ci],{$id:"AnchoredFloorImageProperties"}),PV=C.Intersect([C.Ref(v4),C.Object({verticalOffset:C.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),TV=C.Union([CV,PV],{$id:"FloorImageProperties"}),wV=un(C.Ref(En),TV,{$id:"FloorImageFeature"}),MV=Xn(C.Ref(wV),{$id:"FloorImageCollection"}),kge=C.Object({floorImages:Pr(C.Record(xt,C.Ref(MV),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),Dge=/^floorImages\/(.*)\.geojson$/,OV={name:"ext:floor-images",schema:kge,intoBundle:s(function*(e){if(e.floorImages!=null)for(let t of mt(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(Dge))==null?void 0:o[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[v4,CV,PV,TV,wV,MV],integrityCheck:SV};d();d();var EV=s(e=>{if(e.kinds==null)return me(!0);let t=zr(e);for(let[r,n]of It(e.kinds))if(n!=null)for(let o of mt(n)){let i=t(r,o);if(i.isErr())return i}return me(!0)},"validateKinds");var{values:qot,schema:Fge,record:Zot}=vo(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),_V=Fge;var AV=Pr(C.Record(On,C.Ref(_V),{additionalProperties:!1,$id:"GeometryKinds"})),Lge=C.Object({kinds:Pr(C.Record(xt,C.Ref(AV),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),Rge=/^kinds\/(.*)\.json$/,kV={name:"ext:kinds",schema:Lge,intoBundle:s(function*(e){if(e.kinds!=null)for(let t of mt(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(Rge))==null?void 0:o[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[_V,AV],integrityCheck:EV};d();d();d();var Xx;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(Xx||(Xx={}));var DV=s(e=>{if(e.nodes==null)return me(!0);let t=zr(e),r=Eg(e);for(let[n,o]of It(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 p=t(n,c);if(p.isErr())return p}for(let[c,p]of l.properties.neighbors.entries()){if(!i.has(p.id))return be({kind:Xx.UnknownNeighbor,properties:{floorId:n,nodeId:l.properties.id,neighborId:p.id}});let f=mm(p.flags,r,'nodes["'.concat(n,'"].features[').concat(a,"].properties.neighbors[").concat(c,"]"));if(f.isErr())return f}}}return me(!0)},"validateNodes");var x4=dr("n","NodeId"),FV=C.Intersect([C.Object({id:C.Ref(x4,{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."})}),g4],{$id:"NodeNeighbor"}),LV=C.Intersect([C.Object({id:C.Ref(x4,{description:"The unique identifier for the node."}),neighbors:C.Array(C.Ref(FV),{description:"The neighbors of the node."})}),Jv],{$id:"NodeProperties"}),RV=un(C.Ref(En),LV,{$id:"NodeFeature"}),NV=Xn(C.Ref(RV),{$id:"NodeCollection"}),Nge=C.Object({nodes:Pr(C.Record(xt,C.Ref(NV),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Bge=/^nodes\/(.*)\.json$/,BV={name:"ext:nodes",schema:Nge,intoBundle:s(function*(e){if(e.nodes!=null)for(let t of mt(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(Bge))==null?void 0:o[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[x4,FV,LV,RV,NV],integrityCheck:DV};d();d();d();var Yx;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(Yx||(Yx={}));var $V=s(e=>{if(e.outdoors==null)return me(!0);let t=il(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 be({kind:Yx.FloorInFloorStackError,properties:{floorId:r,floorStackId:o.id}})}}return me(!0)},"validateOutdoors");var GV=C.Object({floors:C.Array(C.Ref(xt),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),$ge=C.Object({outdoors:C.Ref(GV)},{$id:"OutdoorsExtensionSchema"}),jV="outdoors.json",UV={name:"ext:outdoors",schema:$ge,intoBundle:s(function*(e){e.outdoors!=null&&(yield{path:jV,contents:e.outdoors})},"intoBundle"),fromBundle:s((e,t,r)=>{if(e===jV)return{outdoors:r(t)}},"fromBundle"),references:[GV],integrityCheck:$V};d();d();d();var Kx;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Kx||(Kx={}));var VV=s(e=>{if(e.tileset==null)return me(!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 be({kind:Kx.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return me(!0)},"validateTilesets");var I4=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."}),zV=C.Object({default:C.Ref(I4,{description:"The default tileset style, which should be used."}),others:C.Optional(C.Array(C.Ref(I4,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),jge=C.Object({tileset:C.Ref(zV)},{$id:"TilesetExtensionSchema"}),HV={name:"ext:mvf-tileset",schema:jge,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:[I4,zV],integrityCheck:VV};d();var WV=C.Object({},{$id:"WalkableProperties"}),qV=C.Object({},{$id:"NonWalkableProperties"}),ZV=Pr(C.Record(On,C.Ref(WV),{$id:"WalkableGeometries",additionalProperties:!1})),XV=Pr(C.Record(On,C.Ref(qV),{$id:"NonWalkableGeometries",additionalProperties:!1})),Gge=C.Object({walkable:Pr(C.Record(xt,C.Ref(ZV),{additionalProperties:!1})),nonwalkable:Pr(C.Record(xt,C.Ref(XV),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),Uge=/^walkable\/(.*)\.json$/,Vge=/^nonwalkable\/(.*)\.json$/,YV={name:"ext:mvf-traversability",schema:Gge,intoBundle:s(function*(e){if(e.walkable!=null)for(let t of mt(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of mt(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(Uge))==null?void 0:i[1];if(n!=null)return{walkable:{[n]:r(t)}};let o=(a=e.match(Vge))==null?void 0:a[1];if(o!=null)return{nonwalkable:{[o]:r(t)}}},"fromBundle"),references:[WV,qV,ZV,XV]};d();d();function KV(e){return e.replace(/^g_/,"s_")}s(KV,"toSpaceId");function zge(e){return e.replace(/^g_/,"o_")}s(zge,"toObstructionId");function Hge(e){return e.replace(/^g_/,"w_")}s(Hge,"toWindowId");function Wge(e){return e.replace(/^g_/,"ar_")}s(Wge,"convertAreaId");function qge(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({...e,geometry:{type:i,coordinates:a},properties:{...e.properties,id:"".concat(t,"-").concat(o++),kind:r}});return n}default:return[{...e,properties:{...e.properties,id:t,kind:r}}]}}s(qge,"splitMultiPartGeometryFeatureWithNewId");function Ag(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 p=qge(i,r(l),c),f=p.map(y=>y.properties.id),m=f.map(y=>({geometryId:y,floorId:a}));o.set(l,{ids:f,features:p,anchors:m})}}return o}s(Ag,"mapGeometryToOtherIds");function JV(e){var c,p,f;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(m=>m!==void 0).flatMap(It)),n=It(e.geometry).flatMap(([m,y])=>{var v;return((v=y==null?void 0:y.features)!=null?v:[]).map(x=>({feature:x,floorId:m}))}).flat(),o=new Set(Object.values((p=e.walkable)!=null?p:{}).filter(m=>m!==void 0).flatMap(mt)),i=new Set(Object.values((f=e.nonwalkable)!=null?f:{}).filter(m=>m!==void 0).flatMap(mt)),a=new Set(Array.from(r.entries()).filter(([m,y])=>y==="area").map(([m])=>m)),l=new Set(Array.from(r.entries()).filter(([m,y])=>y==="window").map(([m])=>m));return o.size>0&&(t.space=Ag(n,o,KV,r)),i.size>0&&(t.obstruction=Ag(n,i,zge,r)),a.size>0&&(t.area=Ag(n,a,Wge,r)),l.size>0&&(t.window=Ag(n,l,Hge,r)),o.size===0&&i.size===0&&a.size===0&&(t.space=Ag(n,new Set(n.map(m=>m.feature.properties.id)),KV,r)),t}s(JV,"createGeometryMaps");function QV(e){let t=Zge(e),r=JV(e),n=Xge(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}s(QV,"buildBuilderOptions");function Zge(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(Zge,"buildNodesByGeometryId");function Xge(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(Xge,"buildGeometryFeatureById");d();function ez(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,o]of It(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 p={id:l.id,externalId:l.externalId,symbolId:l.symbolKey};a.features.push({type:"Feature",geometry:c.geometry,properties:p})}r[n]=a}return{annotation:r}}s(ez,"buildAnnotations");d();function tz(e,{nodesByGeometryId:t}){var a,l,c,p,f,m,y;let r={"connection.json":[],entrance:{}},n=(a=e.navigationFlags)==null?void 0:a[y4.accessible],o=(l=e.navigationFlags)==null?void 0:l[y4.outdoors],i=new Map(Object.values((c=e.geometry)!=null?c:{}).flatMap(v=>{var x;return(x=v==null?void 0:v.features)!=null?x:[]}).map(v=>[v.properties.id,v]));for(let v of(p=e.connections)!=null?p:[]){if(S4(v,i)){let P=Yge(v,i,t,o);for(let[T,M]of P)r.entrance[T]||(r.entrance[T]={type:"FeatureCollection",features:[]}),r.entrance[T].features.push(M);continue}let x=n!=null&&v.entrances.every(P=>fm(P,n))&&v.exits.every(P=>fm(P,n)),S=Array.from(new Set([...v.entrances.map(P=>t.get(P.geometryId)),...v.exits.map(P=>t.get(P.geometryId))].flat().filter(P=>P!=null))),I={id:v.id,externalId:(m=(f=v.details)==null?void 0:f.externalId)!=null?m:"",type:v.type,accessible:x,nodes:S};(y=v.details)!=null&&y.name&&(I.details={name:v.details.name}),v.extra&&(I.extra=v.extra),r["connection.json"].push(I)}return r}s(tz,"buildConnections");function S4(e,t){return e.type==b4.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}s(S4,"isLineDoor");function Yge(e,t,r,n){var i,a;if(e.type!==b4.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 p={type:"Feature",geometry:c.geometry,properties:{id:e.id,externalId:(a=(i=e.details)==null?void 0:i.externalId)!=null?a:"",isExterior:Kge(e,n)}},f=e.details;f&&(p.properties.details={name:f.name,description:f.description},f.icon&&(p.properties.details.images=[{url:f.icon,altText:"".concat(f.name," icon")}]));let m=r.get(l.geometryId);m&&m.length>0&&(p.properties.node=m[0]),o.push([l.floorId,p])}}return o}s(Yge,"buildEntranceFeaturesFromConnection");function Kge(e,t){return e.entrances.some(r=>fm(r,t))||e.exits.some(r=>fm(r,t))}s(Kge,"isExterior");d();function nz(e,{geometryMaps:t,nodesByGeometryId:r}){var T,M,w,E,B,D,F,L,H,U,G,J,X,ie,ee,ge,ve,pe,Ae,yt,it,Ye,Ve;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},o=(T=e.manifest)==null?void 0:T.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={...n.venue,slug:de.slug,name:(M=de.details.name)!=null?M:n.venue.name,externalId:(w=de.details.externalId)!=null?w:"",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(he=>[he.id,he]));for(let he of c){let re=de.get(he.locationId);if(re){let se=re.details,k={id:he.id,name:se.name,externalId:(E=se.externalId)!=null?E:"",type:he.type,sortOrder:he.sortOrder,amenity:he.amenity,description:se.description,extra:re.extra,links:re.links,operationHours:re.openingHours,gallery:he.gallery,logo:re.logo,shortName:se.shortName,picture:he.picture,showFloatingLabelWhenImagePresent:he.showFloatingLabelWhenImagePresent,showLogo:he.showLogo,siblingGroups:he.siblingGroups,states:he.states,tags:he.tags,spaces:[],nodes:[],polygons:[]};re.phone&&(k.phone={number:re.phone});let K=rz(re.social);re.website&&(K.website=re.website.url),k.social=K;for(let R of re.geometryAnchors){let ce=t.space.get(R.geometryId);if(ce){let le=new Set(ce.features.filter(xe=>xe.geometry.type==="Polygon").map(xe=>xe.properties.id));for(let xe of ce.anchors)k.spaces.push({floor:xe.floorId,id:xe.geometryId}),le.has(xe.geometryId)&&k.polygons.push({map:xe.floorId,id:xe.geometryId})}let oe=r.get(R.geometryId);for(let le of oe!=null?oe:[])k.nodes.push({map:R.floorId,id:le})}n.locations.push(k);for(let R of re.categories)i.set(R,[...(B=i.get(R))!=null?B:[],he.id]);a.set(he.id,re.categories)}}}let p=e.enterprise.locationInstances,f=e.locationInstances;if(p&&f){let de=new Map(f.map(re=>[re.id,re])),he=[];for(let re of p){let se=de.get(re.locationInstanceId);if(se){let k={id:re.id,parent:re.parentId,name:(D=se.details)==null?void 0:D.name,externalId:(F=se.details)==null?void 0:F.externalId,type:re.type,sortOrder:re.sortOrder,amenity:re.amenity,description:(L=se.details)==null?void 0:L.description,extra:se.extra,links:se.links,operationHours:se.openingHours,gallery:re.gallery,picture:re.picture,showFloatingLabelWhenImagePresent:re.showFloatingLabelWhenImagePresent,showLogo:re.showLogo,siblingGroups:re.siblingGroups,states:re.states,tags:re.tags,logo:se.logo,shortName:(H=se.details)==null?void 0:H.shortName};se.phone&&(k.phone={number:se.phone});let K=rz((U=se.social)!=null?U:[]);if(se.website&&(K.website=se.website.url),Object.keys(K).length>0&&(k.social=K),(G=se.geometryAnchors)!=null&&G.length){let R=se.geometryAnchors.flatMap(ce=>{var oe,le;return(le=(oe=t.space.get(ce.geometryId))==null?void 0:oe.anchors)!=null?le:[]});R.length>0&&(k.spaces=R.map(ce=>({floor:ce.floorId,id:ce.geometryId})))}if(se.geometryAnchors){k.spaces=[],k.polygons=[],k.nodes=[];for(let R of se.geometryAnchors){let ce=t.space.get(R.geometryId);if(ce){let le=new Set(ce.features.filter(xe=>xe.geometry.type==="Polygon").map(xe=>xe.properties.id));for(let xe of ce.anchors)k.spaces.push({floor:xe.floorId,id:xe.geometryId}),le.has(xe.geometryId)&&k.polygons.push({map:xe.floorId,id:xe.geometryId})}let oe=r.get(R.geometryId);for(let le of oe!=null?oe:[])k.nodes.push({map:R.floorId,id:le})}}he.push(k)}}he.length>0&&(n.locationInstances=he)}let m=e.locationCategories,y=e.enterprise.categories;if(m&&y){let de=[],he=new Map(m.map(K=>[K.id,K])),re=new Map(y.map(K=>[K.categoryId,K.id])),se=new Map;for(let K of m){let R=re.get(K.parent);if(R){let ce=(J=se.get(R))!=null?J:[];ce.push(K.id),se.set(R,ce)}}for(let K of y){let R=he.get(K.categoryId);if(R){let oe=((X=se.get(K.id))!=null?X:[]).map(xe=>re.get(xe)).filter(xe=>xe!==void 0),le={id:K.id,name:R.details.name,externalId:(ie=R.details.externalId)!=null?ie:"",sortOrder:K.sortOrder,children:oe,locations:(ee=i.get(K.categoryId))!=null?ee:[],icon:R.details.icon,picture:K.picture,color:K.color,extra:R.extra,iconFromDefaultList:K.iconFromDefaultList};de.push(le)}}n.categories=de;let k={};for(let[K,R]of a.entries())k[K]=R.map(ce=>re.get(ce)).filter(ce=>ce!==void 0);n.categoryPriorities=k}let v={};for(let[de,he]of Object.entries((ge=e.defaultStyle)!=null?ge:{}))if(he.buffer>0){let re=he.geometryAnchors.flatMap(se=>{var k,K;return(K=(k=t.space.get(se.geometryId))==null?void 0:k.anchors)!=null?K:[]});v[de]={edgeOffset:he.buffer,geometryAnchors:re}}Object.keys(v).length>0&&(n.enterpriseStyles=v);let x=new Map;for(let de of Object.values((ve=e.enterprise.layers)!=null?ve:{}))if(de)for(let[he,re]of It(de)){if(typeof re!="string")continue;let se=(pe=x.get(re))!=null?pe:{name:re,id:"ely_".concat(re),spaces:[]};se.spaces.push(...(yt=(Ae=t.space.get(he))==null?void 0:Ae.anchors.map(k=>({floorId:k.floorId,spaceId:k.geometryId})))!=null?yt:[]),x.set(re,se)}x.size>0&&(n.layers=Array.from(x.values()));let S=[];for(let de of Object.values((it=e.enterprise.textures)!=null?it:{}))for(let he of de){let re=(Ye=t.space.get(he.geometryId))==null?void 0:Ye.anchors;!re||re.length<1||he.face==="unknown"||he.surface==="unknown"||S.push({repeat:he.repeat,offset:he.offset,rotation:he.rotation,path:he.path,face:he.face,surface:he.surface,bounds:he.bounds,geometryAnchors:re})}S.length>0&&(n.textures=S);let I={};for(let[de,he]of Object.entries((Ve=e.enterprise.floorText)!=null?Ve:{})){let re={type:"FeatureCollection",features:[]};for(let se of he.features){if(se.properties.align==="unknown")continue;let k={align:se.properties.align,color:se.properties.color,fontFamily:se.properties.fontFamily,fontSize:se.properties.fontSize,rotation:se.properties.rotation,text:se.properties.text,visible:se.properties.visible};"geometryId"in se.properties?k.geometryId=se.properties.geometryId:k.verticalOffset=se.properties.verticalOffset,re.features.push({type:"Feature",geometry:se.geometry,properties:k})}re.features.length>0&&(I[de]=re)}Object.keys(I).length>0&&(n.floorText=I);let P={enterprise:n};if(e.enterprise.textAreas){let de={};for(let[he,re]of It(e.enterprise.textAreas)){let se={type:"FeatureCollection",features:[]};for(let k of re.features){if(k.properties.align==="unknown")continue;let K={align:k.properties.align,maxWidth:k.properties.maxWidth,maxHeight:k.properties.maxHeight,rotation:k.properties.rotation};"geometryId"in k.properties?K.anchorId=k.properties.geometryId:K.verticalOffset=k.properties.verticalOffset;let R={type:"Feature",geometry:k.geometry,properties:K};se.features.push(R)}de[he]=se}P.textAreas=de}return P}s(nz,"buildEnterprise");var Jge=["facebook","instagram","twitter"];function rz(e){let t={};for(let{name:r,url:n}of e){let o=r.toLowerCase();Jge.includes(o)&&(t[o]=n)}return t}s(rz,"convertSocials");d();function oz(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[o,i]of It(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(p=>({floorId:a,spaceId:p}))}).filter(a=>a!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}s(oz,"buildFacade");d();function iz(e,t={}){var o,i,a,l,c,p,f,m,y,v,x,S;let r={type:"FeatureCollection",features:[]},n=[];for(let I of e.floors.features)n.push({id:I.properties.id.replace(/^f_/,"m_"),externalId:(i=(o=I.properties.details)==null?void 0:o.externalId)!=null?i:"",elevation:I.properties.elevation,name:(l=(a=I.properties.details)==null?void 0:a.name)!=null?l:"",shortName:(p=(c=I.properties.details)==null?void 0:c.shortName)!=null?p:"",subtitle:I.properties.subtitle}),r.features.push({type:"Feature",geometry:I.geometry,properties:{id:I.properties.id,externalId:(m=(f=I.properties.details)==null?void 0:f.externalId)!=null?m:"",elevation:I.properties.elevation,name:(v=(y=I.properties.details)==null?void 0:y.name)!=null?v:"",shortName:(S=(x=I.properties.details)==null?void 0:x.shortName)!=null?S:"",subtitle:I.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}s(iz,"buildFloors");d();function sz(e,{geometryMaps:t}){var o,i,a,l,c;let r={},n={};for(let[p,f]of It((o=e.floorImages)!=null?o:{})){let m={features:[],type:"FeatureCollection"};for(let y of(i=f==null?void 0:f.features)!=null?i:[])if("verticalOffset"in y.properties)m.features.push(y);else{let{geometryId:v,...x}=y.properties,S=(c=(a=t.space.get(v))==null?void 0:a.ids[0])!=null?c:(l=t.obstruction.get(v))==null?void 0:l.ids[0];if(!S)continue;let I={geometry:y.geometry,properties:{...x,anchorId:S},type:y.type};m.features.push(I)}n[p]=m}return Object.keys(n).length>0&&(r.floorImages=n),r}s(sz,"buildFloorImages");d();function az(e,t={}){var o,i,a,l,c,p,f;let r=[];for(let m of(o=e==null?void 0:e.floorStacks)!=null?o:[]){let y={id:m.id,floors:m.floors,maps:m.floors,externalId:(a=(i=m.details)==null?void 0:i.externalId)!=null?a:"",name:(c=(l=m.details)==null?void 0:l.name)!=null?c:"",shortName:(f=(p=m.details)==null?void 0:p.shortName)!=null?f:"",type:"Building"};m.defaultFloor&&(y.defaultFloor=m.defaultFloor),r.push(y)}if(e.outdoors){let m={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(m)}return{"floorstack.json":r,"mapstack.geojson":r}}s(az,"buildFloorStacks");d();d();var uz=ys(cz(),1);var nbe=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"),obe=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,p]=o[a],[f,m]=o[l];p>n!=m>n&&r<(f-c)*(n-p)/(m-p)+c&&(i=!i)}return i},"pointInPolygon"),ibe=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"),sbe=s(e=>{let t=nbe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),Qx=s(e=>{try{let r=ibe(e).geometry.coordinates;if(!obe(r,e)){let o=(0,uz.default)(e.geometry.coordinates,sbe(e));return me([o[0],o[1]])}return me(r)}catch{return be(new Error("Unable to calculate center of polygon"))}},"labelCenter");function P4(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}s(P4,"isPolygonFeature");function pz(e,{geometryMaps:t,nodesByGeometryId:r}){var p,f,m,y,v,x,S,I,P;let n=pbe(e.defaultStyle),o={},i={},a={},l={};for(let T of mt(e.geometry)){let M=e.geometry[T];if(!M)continue;let w=[],E=[],B=[],D=[];for(let F of M.features){let L=F.properties.id,H=n.has(L),U=(p=r.get(L))!=null?p:[];for(let G of(m=(f=t.space.get(L))==null?void 0:f.features)!=null?m:[])w.push(abe(G,U));for(let G of(v=(y=t.obstruction.get(L))==null?void 0:y.features)!=null?v:[])E.push(lbe(G,H));for(let G of(S=(x=t.area.get(L))==null?void 0:x.features)!=null?S:[])B.push(cbe(G,U));for(let G of(P=(I=t.window.get(L))==null?void 0:I.features)!=null?P:[])D.push(ube(G))}w.length>0&&(o[T]={type:"FeatureCollection",features:w.filter(F=>F!==null)}),E.length>0&&(i[T]={type:"FeatureCollection",features:E.filter(F=>F!==null)}),B.length>0&&(a[T]={type:"FeatureCollection",features:B.filter(F=>F!==null)}),D.length>0&&(l[T]={type:"FeatureCollection",features:D.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(pz,"buildGeometry");function abe(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}),P4(r)&&(r.properties.center=Qx(r).unwrapOr(void 0)),r}s(abe,"buildSpace");function lbe(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 P4(n)&&(n.properties.center=Qx(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(lbe,"buildObstruction");function cbe(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 P4(n)&&(n.properties.center=Qx(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(cbe,"buildArea");function ube(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}s(ube,"buildWindow");function pbe(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(pbe,"calculateFootprintGeometry");d();function dz(e,{geometryMaps:t,geometryFeatureById:r}){var o,i,a,l,c,p,f,m,y,v,x,S,I;if(!e.locationCategories&&!e.locations)return{};let n={};if((o=e.locationCategories)!=null&&o.length){let P=[];for(let T of e.locationCategories){let M={id:T.id,name:T.details.name,icon:(i=T.details.icon)!=null?i:""};T.parent&&(M.parent=T.parent),P.push(M)}n["category.json"]=P}if((a=e.locations)!=null&&a.length){let P=dbe(e,{geometryFeatureById:r}),T=[];for(let M of e.locations){let w={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};T.push(w);for(let{geometryId:E,floorId:B}of M.geometryAnchors)w.spaces.push(...(p=(c=t.space.get(E))==null?void 0:c.ids.map(D=>({id:D,floor:B})))!=null?p:[]),w.obstructions.push(...(m=(f=t.obstruction.get(E))==null?void 0:f.ids.map(D=>({id:D,floor:B})))!=null?m:[]),w.areas.push(...(v=(y=t.area.get(E))==null?void 0:y.ids.map(D=>({id:D,floor:B})))!=null?v:[]),w.entrances.push(...(x=P.entrancesByGeometryId.get(E))!=null?x:[]),w.connections.push(...(S=P.connectionsByGeometryId.get(E))!=null?S:[]),w.annotations.push(...(I=P.annotationsByGeometryId.get(E))!=null?I:[])}n["location.json"]=T}return n}s(dz,"buildLocations");function dbe(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 It(e.annotations))for(let c of l!=null?l:[]){let p=c.geometryId,f=c.id,m=(n=r.annotationsByGeometryId.get(p))!=null?n:[];m.push({floor:a,id:f}),r.annotationsByGeometryId.set(p,m)}if(e.connections)for(let a of e.connections){let l=S4(a,t),c=Array.from(new Map([...a.entrances,...a.exits].map(p=>["".concat(p.geometryId,"_").concat(p.floorId),p])).values());for(let p of c){let f=p.geometryId;if(l){let m=(o=r.entrancesByGeometryId.get(f))!=null?o:[];m.push({floor:p.floorId,id:a.id}),r.entrancesByGeometryId.set(f,m)}else{let m=(i=r.connectionsByGeometryId.get(f))!=null?i:[];m.push(a.id),r.connectionsByGeometryId.set(f,m)}}}return r}s(dbe,"buildLocationAttachmentMaps");d();function fz(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(fz,"buildManifest");d();function mz(e,{geometryMaps:t}){var l,c,p,f,m,y,v,x,S,I,P,T,M,w,E;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,o=new Map;for(let B of(c=(l=e.floors)==null?void 0:l.features)!=null?c:[])o.set(B.properties.id,B.properties.elevation);let i=new Map;for(let B of Object.values((p=e.nodes)!=null?p:{}))for(let D of(f=B==null?void 0:B.features)!=null?f:[])for(let F of D.properties.geometryIds)i.set(F,[...(m=i.get(F))!=null?m:[],D.properties.id]);let a=new Map;for(let B of(y=e.connections)!=null?y:[]){let D=B.exits.map(F=>{var L;return{...F,nodes:(L=i.get(F.geometryId))!=null?L:[]}});for(let F of B.entrances){let L=(v=i.get(F.geometryId))!=null?v:[];for(let H of L)for(let U of D){let G=Math.abs(((x=o.get(F.floorId))!=null?x:0)-((S=o.get(U.floorId))!=null?S:0))*B.floorCostMultiplier,J=(I=a.get(H))!=null?I:[];J.push(...U.nodes.map(X=>({id:X,weight:G+B.entryCost}))),a.set(H,J)}}}for(let[B,D]of It((P=e.nodes)!=null?P:{}))for(let F of(T=D==null?void 0:D.features)!=null?T:[]){let L=(M=t.space.get(F.properties.geometryIds[0]))==null?void 0:M.features[0],H=(L==null?void 0:L.geometry.type)==="Point"&&((w=L==null?void 0:L.properties.details)!=null&&w.externalId)?L.properties.details.externalId:"",U={type:"Feature",geometry:F.geometry,properties:{id:F.properties.id,floor:B,space:F.properties.geometryIds.map(G=>{var J;return(J=t.space.get(G))==null?void 0:J.ids}).flat().filter(G=>G!==void 0),neighbors:[...F.properties.neighbors.map(G=>({id:G.id,weight:G.extraCost})),...(E=a.get(F.properties.id))!=null?E:[]],map:B,externalId:H}};n.push(U)}return r}s(mz,"buildNodes");d();function fbe(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(fbe,"groupGeometryByType");function hz(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(p=>p.features),...Array.from(t.obstruction.values()).map(p=>p.features)],i=new Map(o.flatMap(p=>p.map(f=>[f.properties.id,f.geometry.type])));for(let[p,f]of It(e.defaultStyle)){let m=fbe(f.geometryAnchors.flatMap(y=>{var v,x,S,I;return[...(x=(v=t.space.get(y.geometryId))==null?void 0:v.ids)!=null?x:[],...(I=(S=t.obstruction.get(y.geometryId))==null?void 0:S.ids)!=null?I:[]]}),i);if(m.Point&&m.Point.length>0){let y={points:Array.from(m.Point.values()),showImage:((a=f.extra)==null?void 0:a.showImage)!==void 0?((l=f.extra)==null?void 0:l.showImage)===!0:f.opacity!==0};n["".concat(p,".Point")]=y}if(m.LineString&&m.LineString.length>0){let y={lineStrings:Array.from(m.LineString.values()),altitude:f.altitude,color:f.color,height:f.height,opacity:f.opacity,width:f.buffer};n["".concat(p,".LineString")]=y}if(m.Polygon&&m.Polygon.length>0){let y={polygons:Array.from(m.Polygon.values()),altitude:f.altitude,color:f.color,height:f.height,opacity:f.opacity};((c=f.extra)==null?void 0:c.showImage)!==void 0&&(y.showImage=f.extra.showImage===!0),n["".concat(p,".Polygon")]=y}}return r}s(hz,"buildStyles");var mbe=nU().extendOptional(tV).extendOptional(BV).extendOptional(lV).extendOptional(kV).extendOptional(YV).extendOptional(dV).extendOptional(gV).extendOptional(UV).extendOptional(HV).extendOptional(OV).extendOptional(IV).extendOptional(nG).extendOptional(dU).extendOptional(YU).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function hbe(e){let t=QV(e),r=iz(e,t),n=pz(e,t),o=mz(e,t),i=tz(e,t),a=hz(e,t),l=az(e,t),c=sz(e,t),p=oz(e,t),f=ez(e,t),m=dz(e,t),y=nz(e,t),v=fz(e,t);return{...r,...n,...o,...i,...a,...l,"tileset.json":e.tileset,...c,...p,...f,...m,...y,...v}}s(hbe,"convertUnzippedStandardMVFv3ToParsedMVFv2");async function T4(e){let t=await mbe.decompress(e);return t.isOk()?me(hbe(t.value)):be(t.error)}s(T4,"extractAndConvertMVFv3");d();function hm(e){return e.endsWith("/")?e:"".concat(e,"/")}s(hm,"normalizeUrl");d();var ym="https://app.mappedin.com/",yz="https://auth.mappedin.com/";d();d();var ybe=s(e=>{let t=Date.now();return e-t},"fromNow"),e2=s((e,t)=>ybe(e)<=t*60*1e3,"shouldRefreshToken");var bz=60,vz=bz*60*1e3,gz="accessTokens";async function kg(e,t=!1){let r="".concat(e.key),n=vu.getInstance(),o=(n==null?void 0:n.loadSessionData(gz))||{},i=Math.floor(Date.now()/1e3);if(o[r]&&!e2(o[r].expiresTimestamp*1e3,bz))return o[r];let a=t?await gbe(e,i):await bbe(e,i),l={...o,[r]:a};return n==null||n.saveSessionData(gz,l),a}s(kg,"getAccessToken");async function gbe(e,t){var i;let r="".concat((i=e.baseAuthUri)!=null?i:yz,"oauth2/token"),n=await Ji()(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(gbe,"fetchAccessTokenEnterprise");async function bbe(e,t){let r="".concat(e.baseAuthUri?hm(e.baseAuthUri):ym,"api/api-key/token"),n=await Ji()(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(bbe,"fetchAccessToken");d();var Iz=60,Sz=Iz*60*1e3,xz="miSasTokens";async function w4(e,t){let r="".concat(t,"__").concat(e.mapId),n=vu.getInstance(),o=(n==null?void 0:n.loadSessionData(xz))||{};if(o[r]&&!e2(o[r].expires,Iz))return o[r];let i=await vbe(e,t),a={...o,[r]:{token:i.token,expires:new Date(i.expires).getTime()}};return n==null||n.saveSessionData(xz,a),i}s(w4,"getSasToken");async function vbe(e,t){let r="".concat(e.baseUri?hm(e.baseUri):ym,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await Ji()(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(vbe,"fetchSasToken");var Cz=globalThis.fetch,wz,xbe=(wz=b==null?void 0:b.env)==null?void 0:wz.npm_package_version;function Ji(){if(Cz==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Cz}s(Ji,"isomorphicFetch");var M4={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Mz(e){var r;let t={...M4,...e};return t.headers={...t.headers,"mappedin-sdk-version":xbe},t.things=[],"platformString"in e&&(t.headers={...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(Mz,"parseOptions");function Ibe(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(Ibe,"constructParamsForRequest");async function Sbe(e,t,r=!1){let n=Ibe(e,t,r),o=await Ji()(n.url,n.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}s(Sbe,"generateAPIRequest");var Cbe=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 j.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){j.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:i,locale_packs:a}}return r},"getPerspectivesFromResponse");async function Pbe(e,t="exports/mvf/1/bundle"){var p,f;let r=Mz({baseUri:"https://api-gateway.mappedin.com/",...M4,...e}),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((p=r.version)!=null?p:"2.0.0");r.headers["Content-Type"]="application/zip";let o=await Sbe(r,n),i=o.url,a=o.locale_packs,l=(f=r.perspective)!=null?f:M4.perspective,c=Cbe(o);if(l!=null&&l!==""&&c!=null){let m=c[l];m==null?j.warn("Perspective ".concat(l," not found in response! Loading default perspective instead.")):(j.log('Loading perspective "'.concat(l,'"')),i=m.url,a=m.locale_packs)}return{url:i,localePacks:a,updated_at:o.updated_at}}s(Pbe,"getVenueMVFURL");var Dg=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function O4(e,{signal:t}){let r=await(await Ji()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}s(O4,"getLanguagePackUnitArray");async function gm(e){let r=(await import("./browser-LDR6NMTB.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let o=r["enterprise/locations.json"];o&&(n.enterprise.locations=JSON.parse(Dg().decode(o)));let i=r["enterprise/categories.json"];i&&(n.enterprise.categories=JSON.parse(Dg().decode(i)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(Dg().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(Dg().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(Dg().decode(r["manifest.json"]))),n}s(gm,"parseLanguagePack");async function Oz(e,{signal:t}){try{let r=await(await Ji()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await gm(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}s(Oz,"downloadLanguagePack");async function E4(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 Pbe(e,n),a=await Ji()(o).then(c=>c.arrayBuffer()),l=new Uint8Array(a);t({compressed:l,localePacks:i})}catch(n){r(n)}})}s(E4,"downloadVenueBundleMVFAPIGateway");async function _4(e,t){return new Promise(async(r,n)=>{try{let{url:o}=await Tbe(e,t),i=await Ji()(o).then(l=>l.arrayBuffer()),a=new Uint8Array(i);r(a)}catch(o){n(o)}})}s(_4,"downloadMVF");async function Tbe(e,t){let r=new URL("".concat(e.baseUri?hm(e.baseUri):ym,"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 Ji()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}s(Tbe,"getMakerBundleURL");function t2(e){var n,o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M,w;let t=new TextDecoder,r=t.decode.bind(t);try{let E={"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&&(E.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(E.enterprise.locations=JSON.parse(r((o=e.enterprise)==null?void 0:o["locations.json"]))),(i=e.enterprise)!=null&&i["categories.json"]&&(E.enterprise.categories=JSON.parse(r((a=e.enterprise)==null?void 0:a["categories.json"]))),(l=e.enterprise)!=null&&l["venue.json"]&&(E.enterprise.venue=JSON.parse(r((c=e.enterprise)==null?void 0:c["venue.json"]))),(p=e.enterprise)!=null&&p["layers.json"]&&(E.enterprise.layers=JSON.parse(r((f=e.enterprise)==null?void 0:f["layers.json"]))),(m=e.enterprise)!=null&&m["locationInstances.json"]&&(E.enterprise.locationInstances=JSON.parse(r((y=e.enterprise)==null?void 0:y["locationInstances.json"]))),(v=e.enterprise)!=null&&v["enterpriseStyles.json"]&&(E.enterprise.enterpriseStyles=JSON.parse(r((x=e.enterprise)==null?void 0:x["enterpriseStyles.json"]))),(S=e.enterprise)!=null&&S["textures.json"]&&(E.enterprise.textures=JSON.parse(r((I=e.enterprise)==null?void 0:I["textures.json"]))),(P=e.enterprise)!=null&&P["floorText.json"]&&(E.enterprise.floorText=JSON.parse(r((T=e.enterprise)==null?void 0:T["floorText.json"]))),(M=e.enterprise)!=null&&M["categoryPriorities.json"]&&(E.enterprise.categoryPriorities=JSON.parse(r((w=e.enterprise)==null?void 0:w["categoryPriorities.json"])))),e["floorstack.json"]!=null?E["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(E["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),E["floorstack.json"]==null&&E["mapstack.json"]==null&&E["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(E["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),E["floor.geojson"]==null&&E["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(E["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(E["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(E["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(E["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){E.annotation={};let D=Object.keys(e.annotation);for(let F of D){let L=F.replace(/\.json|\.geojson/g,"");E.annotation[L]=JSON.parse(r(e.annotation[F]))}}let B=Object.keys(e.space);for(let D of B){let F=D.replace(/\.json|\.geojson/g,"");E.space[F]=JSON.parse(r(e.space[D]))}if(e.obstruction!=null){let D=Object.keys(e.obstruction);for(let F of D){let L=F.replace(/\.json|\.geojson/g,"");E.obstruction[L]=JSON.parse(r(e.obstruction[F]))}}else E.obstruction={};if(e.entrance!=null){let D=Object.keys(e.entrance);for(let F of D){let L=F.replace(/\.json|\.geojson/g,"");E.entrance[L]=JSON.parse(r(e.entrance[F]))}}else E.entrance={};if("floorImages"in e&&e.floorImages!=null){E.floorImages={};for(let D of Object.keys(e.floorImages)){let F=D.replace(/\.json|\.geojson/g,"");E.floorImages[F]=JSON.parse(r(e.floorImages[D]))}}if("textAreas"in e&&e.textAreas!=null){E.textAreas={};for(let D of Object.keys(e.textAreas)){let F=D.replace(/\.json|\.geojson/g,"");E.textAreas[F]=JSON.parse(r(e.textAreas[D]))}}if("facade"in e&&e.facade!=null){E.facade={};for(let D of Object.keys(e.facade)){let F=D.replace(/\.json|\.geojson/g,"");E.facade[F]=JSON.parse(r(e.facade[D]))}}if("area"in e&&e.area!=null){E.area={};for(let D of Object.keys(e.area)){let F=D.replace(/\.json|\.geojson/g,"");E.area[F]=JSON.parse(r(e.area[D]))}}return E}catch(E){throw j.error(E),new Error("MVF parsing failed! Probably encountered a bad file.")}}s(t2,"parseMVF");function wbe(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(wbe,"validateStaticMVFFiles");async function r2(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-LDR6NMTB.js")).unzipSync(e);if(!wbe(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"){j.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(r2,"unzipMVF");function gp(){let e="us",t={};function r(){return _be(kbe(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?Pz.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?Pz.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}s(gp,"createEnvControl");var Ez=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"}),Pz=Object.freeze({...Ez,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Mbe=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"}),Obe=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"}),Ebe=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 _be(e,t){return{...e,...t}}s(_be,"getAuthStateByEnvironment");var Abe={eu:Mbe,us:Ez,"us-staging-enterprise":Obe,"us-staging-self-serve":Ebe};function kbe(e){return Abe[e]}s(kbe,"getEnvironmentAuthState");var A4=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"),Tz=s(async e=>{let t=performance.now(),r=await T4(e);return j.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw j.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function k4(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await r2(e);return t2(r)}catch{return Tz(e)}case"3.0.0":return Tz(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}s(k4,"unzipAndParseMVFv2");d();function D4(e){var o,i,a,l,c,p;let t=((i=(o=e.enterprise)==null?void 0:o.locations)==null?void 0:i.reduce((f,m)=>(f[m.id]=m,f),{}))||{};for(let f of((a=e.enterprise)==null?void 0:a.locationInstances)||[])t[f.id]=f;let r={};for(let f of e["floorstack.json"]||[])r[f.id]=f;let n={};for(let f of((l=e["floor.geojson"])==null?void 0:l.features)||[])f.properties&&f.properties.id&&(n[f.properties.id]=f.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((p=(c=e.enterprise)==null?void 0:c.categories)==null?void 0:p.reduce((f,m)=>(f[m.id]=m,f),{}))||{},"floor-stack":r,floor:n}}}s(D4,"parseLocalePackToLanguagePack");function _z(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}s(_z,"isMappedinCdnUrl");function Az(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}s(Az,"hasSasToken");d();d();d();d();d();d();d();var F4=class F4{constructor({origin:t,destination:r,distance:n=0,angle:o=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:a=!0}){h(this,"origin");h(this,"destination");h(this,"distance");h(this,"angle");h(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(F4,"Edge");var bp=F4;d();d();d();d();function gi(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(gi,"getCoord");function No(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(No,"getCoords");function bm(e){return e.type==="Feature"?e.geometry:e}s(bm,"getGeom");function kz(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}s(kz,"getType");function fl(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=gi(e),o=bm(t),i=o.type,a=t.bbox,l=o.coordinates;if(a&&Dbe(n,a)===!1)return!1;i==="Polygon"&&(l=[l]);for(var c=!1,p=0;p<l.length&&!c;p++)if(Dz(n,l[p][0],r.ignoreBoundary)){for(var f=!1,m=1;m<l[p].length&&!f;)Dz(n,l[p][m],!r.ignoreBoundary)&&(f=!0),m++;f||(c=!0)}return c}s(fl,"booleanPointInPolygon");function Dz(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],p=t[i][1],f=e[1]*(a-c)+l*(c-e[0])+p*(e[0]-a)===0&&(a-e[0])*(c-e[0])<=0&&(l-e[1])*(p-e[1])<=0;if(f)return!r;var m=l>e[1]!=p>e[1]&&e[0]<(c-a)*(e[1]-l)/(p-l)+a;m&&(n=!n)}return n}s(Dz,"inRing");function Dbe(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}s(Dbe,"inBBox");d();d();function ml([e,t],[r,n]){let o=t-n,i=e-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}s(ml,"getAngle");d();var Fbe=63710088e-1;function Qi(e,t){let[r,n]=e.map(f=>f*Math.PI/180),[o,i]=t.map(f=>f*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),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return Fbe*p}s(Qi,"getDistance");d();d();function n2(e,t,r,n){let[o,i]=e,[a,l]=t,[c,p]=r,[f,m]=n;if(i===l&&o===a||p===m&&c===f)return null;let y=(f-c)*(l-i)-(m-p)*(a-o);if(y===0)return null;let v=((m-p)*(o-c)-(f-c)*(i-p))/y,x=((l-i)*(o-c)-(a-o)*(i-p))/y;if(v<0||v>1||x<0||x>1)return null;let S=i+v*(l-i);return[o+v*(a-o),S]}s(n2,"getLineIntersection");d();d();function vp(e,t,r,n){n===void 0&&(n={});var o=gi(e),i=so(o[0]),a=so(o[1]),l=so(r),c=E8(t,n.units),p=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),f=i+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(p)),m=Qh(f),y=Qh(p);return Ss([m,y],n.properties)}s(vp,"destination");function L4(e,t,r,n){let o=vp(e,r/1e3,n),i=vp(t,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}s(L4,"getOffsetLine");d();function R4(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(R4,"radToDegNormalized");var Fz=111e3;function Lz(e,t,r=[],n=0){let o=!0,i=e.geometry.coordinates,a=t.geometry.coordinates,l=R4(ml(i,a)-Math.PI/2),c=R4(ml(i,a)+Math.PI/2),p=n/Fz,f=n/(Fz*Math.cos(i[1]*Math.PI/180)),m=Math.min(i[1],a[1])-p,y=Math.max(i[1],a[1])+p,v=Math.min(i[0],a[0])-f,x=Math.max(i[0],a[0])+f;for(let S of r)if(!(Math.max(S[0][1],S[1][1])<m||Math.min(S[0][1],S[1][1])>y||Math.max(S[0][0],S[1][0])<v||Math.min(S[0][0],S[1][0])>x)){if(n>0){let I=L4(i,a,n,l),P=L4(i,a,n,c);if(n2(I[0],I[1],S[0],S[1])||n2(P[0],P[1],S[0],S[1])){o=!1;return}}else if(n2(i,a,S[0],S[1])){o=!1;return}}return o}s(Lz,"hasLineOfSight");var xp,mn,N4,Rz,Nz,Bz,$z,jz,Gz,i2,B4=class B4{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){O(this,mn);h(this,"edges",{});h(this,"nodesById");h(this,"nodesByGroup",new Map);O(this,xp);O(this,i2,s((t,r)=>{let n=0;for(let o of r)(!o[u(this,xp)]||o[u(this,xp)]===t.properties[u(this,xp)])&&fl(t.geometry.coordinates,o.geometry.geometry)&&(n+=Math.max(0,o.cost));return n},"#getZonalCost"));A(this,xp,r);let{features:o}=t;this.nodesById=te(this,mn,Rz).call(this,o),te(this,mn,Nz).call(this),te(this,mn,Bz).call(this,o,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,o)=>{let i=Qi(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}){let a=te(this,mn,N4).call(this,t),l=te(this,mn,N4).call(this,r);if(a.length===0||l.length===0)return[];let{frontier:c,cameFrom:p,costSoFar:f}=te(this,mn,$z).call(this,a,l);for(;c.length>0;){let m=c.shift();if(!m)break;if(te(this,mn,jz).call(this,m.origin,l))return te(this,mn,Gz).call(this,p,m.origin.properties.id);for(let y of this.edges[m.origin.properties.id]){if(o!=null&&o.has(y.origin.properties.id)&&y.destination.properties.map!==y.origin.properties.map)continue;let v=f[m.origin.properties.id]+y.weight+u(this,i2).call(this,y.destination,i);if(!(v===1/0||n!=null&&n.has(y.destination.properties.id))&&(f[y.destination.properties.id]==null||v<f[y.destination.properties.id])){let x=v+this.getShortestEuclideanDistance(y.destination,l);f[y.destination.properties.id]=v,p[y.destination.properties.id]=y,c.push({origin:y.destination,priority:x})}}c.sort((y,v)=>y.priority-v.priority)}return[]}};xp=new WeakMap,mn=new WeakSet,N4=s(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),Rz=s(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),Nz=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"),Bz=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],p=Qi(o.geometry.coordinates,c.geometry.coordinates),f=ml(o.geometry.coordinates,c.geometry.coordinates);return new bp({origin:o,destination:c,pathWeight:l,distance:p,angle:f,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),$z=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"),jz=s(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),Gz=s(function(t,r){let n=[],o=t[r];for(;o;)n.push(o),o=t[o.origin.properties.id];return n.reverse()},"#reconstructPath"),i2=new WeakMap,s(B4,"NavigationGraph");var o2=B4;var Lbe=.4,$4=class $4{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o}){h(this,"groupBy");h(this,"graph");h(this,"geometryEdgesByMapId",new Map);h(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"));h(this,"getDistance",s((t,r)=>Qi(t,r),"getDistance"));h(this,"getAngle",s((t,r)=>ml(t,r),"getAngle"));this.groupBy=n,this.graph=new o2({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((p,f)=>{this.geometryEdgesByMapId.get(c).push([p,l[f+1]||l[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:o,disabledConnectionNodeIds:i,simplify:a,multiplicativeDistanceWeightScaling:l}){var m,y;let c=(m=a==null?void 0:a.enabled)!=null?m:!0,p=t!=null?t:[],f=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:p,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(i)});return f.length===0?{type:"FeatureCollection",features:[]}:(c&&(f=this.simplifyAllSteps(f,(y=a==null?void 0:a.bufferRadius)!=null?y:Lbe,l)),this.generatePath(f))}simplifyAllSteps(t,r,n){var p,f;let o=[],i=[t[0]];for(let m=1;m<t.length;m++)if(this.groupBy!=="default"&&t[m].origin.properties[this.groupBy]!==t[m-1].origin.properties[this.groupBy]){let y=t[m-1].origin.properties[this.groupBy],v=(p=this.geometryEdgesByMapId.get(y))!=null?p:[];o.push(...this.simplifySteps(i,v,r,n)),i=[t[m]]}else i.push(t[m]);let a=t[t.length-1],l=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],c=(f=this.geometryEdgesByMapId.get(l))!=null?f:[];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||!Lz(t[a].origin,t[l].origin,r,n)){let c=l-1;i.push(new bp({...t[a],destination:t[c].origin,distance:Qi(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates),angle:ml(t[a].origin.geometry.coordinates,t[c].origin.geometry.coordinates)})),a=c}return i.push(new bp({...t[a],destination:t[t.length-1].origin,distance:Qi(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:ml(t[a].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),i}};s($4,"Navigator");var vm=$4;d();var f5e={};Pa(f5e,{Annotation:()=>Na,Area:()=>Fa,Connection:()=>sc,Coordinate:()=>Le,DOORS:()=>h1,Door:()=>Fi,E_SDK_LOG_LEVEL:()=>J9,EnterpriseCategory:()=>vy,EnterpriseLocation:()=>Es,EnterpriseVenue:()=>F0,Facade:()=>Yo,Floor:()=>ao,FloorStack:()=>oy,Hyperlink:()=>ec,ImageMetaData:()=>rc,LocationCategory:()=>xy,LocationProfile:()=>Nu,MAPPEDIN_COLORS:()=>e_,MapObject:()=>lo,Node:()=>Aa,PointOfInterest:()=>Ra,Space:()=>Gr,WALLS:()=>m1,__setWatermarkOnClickFn:()=>s5e,createMapLibreOverlay:()=>p5e,disableText3DWorker:()=>tee,enableTestMode:()=>DO,getMapData:()=>See,getMapDataEnterprise:()=>u5e,hydrateMapData:()=>c5e,hydrateMapDataFromMVF:()=>a5e,parseMVF:()=>t2,preloadFont:()=>K7,setLoggerLevel:()=>Q9,setUseEnterpriseAPI:()=>l5e,setWorkersUrl:()=>aee,show3dMap:()=>Cee,show3dMapGeojson:()=>d5e,unzipMVF:()=>r2});d();d();d();d();var Lg,Rg,Ng,j4=class j4{constructor(t,r,{enabled:n=!1}={}){O(this,Lg);h(this,"searchInstance");O(this,Rg);O(this,Ng);h(this,"enabled",!1);A(this,Lg,t),A(this,Rg,r),A(this,Ng,()=>{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 j.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return j.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return j.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return j.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-65CA5CF2.js").then(({InternalSearch:t})=>new t(u(this,Lg)))),u(this,Rg).on("language-change",u(this,Ng)),await this.searchInstance)}};Lg=new WeakMap,Rg=new WeakMap,Ng=new WeakMap,s(j4,"Search");var Fg=j4;var Uz=new WeakMap,Tr,U4=class U4 extends Fe{constructor(r,{search:n}={}){super();O(this,Tr);h(this,"Analytics");h(this,"Search");h(this,"Query");h(this,"getDirections",s((r,n,o)=>u(this,Tr).getDirections(r,n,o),"getDirections"));h(this,"getDirectionsMultiDestination",s((r,n,o)=>u(this,Tr).getDirectionsMultiDestination(r,n,o),"getDirectionsMultiDestination"));A(this,Tr,r),Uz.set(this,r),this.Analytics=new Iy(r.Analytics),this.Query=r.Query,this.Search=new Fg(this,r,{enabled:n==null?void 0:n.enabled}),u(this,Tr).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return u(this,Tr).getEnv()}getAccessToken(){var r;return(r=u(this,Tr).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return u(this,Tr).mapName}get mapCenter(){return u(this,Tr).mapCenter}get organizationId(){return u(this,Tr).organizationId}get outdoorViewToken(){return u(this,Tr).outdoorViewToken}getByType(r){return u(this,Tr).getByType(r)}getById(r,n){return u(this,Tr).getById(r,n)}getByExternalId(r,n){return u(this,Tr).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return u(this,Tr).changeLanguage(r)}get currentLanguage(){return u(this,Tr).currentLanguage}get naturalBearing(){var r;return(r=u(this,Tr).naturalBearing)!=null?r:0}getDistance(r,n){return u(this,Tr).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return u(this,Tr).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return u(this,Tr).toJSONBundle({downloadLanguagePacks:r})}};Tr=new WeakMap,s(U4,"MapData");var G4=U4,s2=G4;function Bg(e){let t=Uz.get(e);if(!t)throw new Error("MapDataInternal not found");return t}s(Bg,"getMapDataInternal");d();d();d();d();d();function Rbe(e,t,r){r===void 0&&(r={});for(var n=gi(e),o=No(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")),Nbe(o[i],o[i+1],n,a,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}s(Rbe,"booleanPointOnLine");function Nbe(e,t,r,n,o){var i=r[0],a=r[1],l=e[0],c=e[1],p=t[0],f=t[1],m=r[0]-l,y=r[1]-c,v=p-l,x=f-c,S=m*x-y*v;if(o!==null){if(Math.abs(S)>o)return!1}else if(S!==0)return!1;if(n){if(n==="start")return Math.abs(v)>=Math.abs(x)?v>0?l<i&&i<=p:p<=i&&i<l:x>0?c<a&&a<=f:f<=a&&a<c;if(n==="end")return Math.abs(v)>=Math.abs(x)?v>0?l<=i&&i<p:p<i&&i<=l:x>0?c<=a&&a<f:f<a&&a<=c;if(n==="both")return Math.abs(v)>=Math.abs(x)?v>0?l<i&&i<p:p<i&&i<l:x>0?c<a&&a<f:f<a&&a<c}else return Math.abs(v)>=Math.abs(x)?v>0?l<=i&&i<=p:p<=i&&i<=l:x>0?c<=a&&a<=f:f<=a&&a<=c;return!1}s(Nbe,"isPointOnLineSegment");var Vz=Rbe;d();function Bbe(e,t){t===void 0&&(t={});var r=Dd(e),n=(r[0]+r[2])/2,o=(r[1]+r[3])/2;return Ss([n,o],t.properties,t)}s(Bbe,"center");var a2=Bbe;d();d();function $be(e,t,r){r===void 0&&(r={});var n=gi(e),o=gi(t),i=so(o[1]-n[1]),a=so(o[0]-n[0]),l=so(n[1]),c=so(o[1]),p=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return O8(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),r.units)}s($be,"distance");var Ec=$be;function l2(e,t){return t===void 0&&(t={}),A8(e,function(r,n){var o=n.geometry.coordinates;return r+Ec(o[0],o[1],t)},0)}s(l2,"length");d();d();d();function c2(e,t,r){if(r===void 0&&(r={}),r.final===!0)return jbe(e,t);var n=gi(e),o=gi(t),i=so(n[0]),a=so(o[0]),l=so(n[1]),c=so(o[1]),p=Math.sin(a-i)*Math.cos(c),f=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-i);return Qh(Math.atan2(p,f))}s(c2,"bearing");function jbe(e,t){var r=c2(t,e);return r=(r+180)%360,r}s(jbe,"calculateFinalBearing");d();d();function Gbe(e){if(!e)throw new Error("geojson is required");var t=[];return Cs(e,function(r){Ube(r,t)}),xu(t)}s(Gbe,"lineSegment");function Ube(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=No(n);break;case"LineString":r=[No(n)]}r.forEach(function(o){var i=Vbe(o,e.properties);i.forEach(function(a){a.id=t.length,t.push(a)})})}}s(Ube,"lineSegmentFeature");function Vbe(e,t){var r=[];return e.reduce(function(n,o){var i=_a([n,o],t);return i.bbox=zbe(n,o),r.push(i),o}),r}s(Vbe,"createSegments");function zbe(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,p=n>i?n:i;return[a,l,c,p]}s(zbe,"bbox");var V4=Gbe;var JX=ys(YX(),1);function f2e(e,t){var r={},n=[];if(e.type==="LineString"&&(e=v3(e)),t.type==="LineString"&&(t=v3(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=KX(e,t);return o&&n.push(o),xu(n)}var i=(0,JX.default)();return i.load(V4(t)),x3(V4(e),function(a){x3(i.search(a),function(l){var c=KX(a,l);if(c){var p=No(c).join(",");r[p]||(r[p]=!0,n.push(c))}})}),xu(n)}s(f2e,"lineIntersect");function KX(e,t){var r=No(e),n=No(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],p=n[0][1],f=n[1][0],m=n[1][1],y=(m-p)*(a-o)-(f-c)*(l-i),v=(f-c)*(i-p)-(m-p)*(o-c),x=(a-o)*(i-p)-(l-i)*(o-c);if(y===0)return null;var S=v/y,I=x/y;if(S>=0&&S<=1&&I>=0&&I<=1){var P=o+S*(a-o),T=i+S*(l-i);return Ss([P,T])}return null}s(KX,"intersects");var km=f2e;function m2e(e,t,r){r===void 0&&(r={});var n=Ss([1/0,1/0],{dist:1/0}),o=0;return Cs(e,function(i){for(var a=No(i),l=0;l<a.length-1;l++){var c=Ss(a[l]);c.properties.dist=Ec(t,c,r);var p=Ss(a[l+1]);p.properties.dist=Ec(t,p,r);var f=Ec(c,p,r),m=Math.max(c.properties.dist,p.properties.dist),y=c2(c,p),v=vp(t,m,y+90,r),x=vp(t,m,y-90,r),S=km(_a([v.geometry.coordinates,x.geometry.coordinates]),_a([c.geometry.coordinates,p.geometry.coordinates])),I=null;S.features.length>0&&(I=S.features[0],I.properties.dist=Ec(t,I,r),I.properties.location=o+Ec(c,I,r)),c.properties.dist<n.properties.dist&&(n=c,n.properties.index=l,n.properties.location=o),p.properties.dist<n.properties.dist&&(n=p,n.properties.index=l+1,n.properties.location=o+f),I&&I.properties.dist<n.properties.dist&&(n=I,n.properties.index=l),o+=f}}),n}s(m2e,"nearestPointOnLine");var tb=m2e;function h2e(e,t,r){var n=No(r);if(kz(r)!=="LineString")throw new Error("line must be a LineString");var o=tb(r,e),i=tb(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),_a(l,r.properties)}s(h2e,"lineSlice");var _O=h2e;var y2e=1e-7;function AO(e){return{type:"Point",coordinates:e}}s(AO,"point");function g2e(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,o=r.map(i=>tb(e,AO(i)));return n.reduce((i,a)=>{let l=_O(AO(a),o[0],e),c=_O(AO(a),o[1],e),p=l2(l)<l2(c)?l:c;return p.properties={...e.properties,entrances:[]},i.concat([p])},[])}s(g2e,"splitObstructionByEntrance");function kO(e,t){return t.reduce((r,n)=>{let o={epsilon:y2e},i=r.obstructions.findIndex(l=>Vz(a2(n),l,o)),a=r.obstructions[i];if(a){let[l,c]=g2e(a,n);r.entrances.push(n),r.obstructions.splice(i,1,l,c)}return r},{obstructions:[e],entrances:[]})}s(kO,"findAndSplitObstructionByAllEntrances");d();d();d();d();(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 QX="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=";d();d();var eY=!1;function DO(){eY=!0}s(DO,"enableTestMode");function tY(){return eY}s(tY,"isTestMode");var FO=class FO{constructor(t){h(this,"backgroundAlpha",1);h(this,"backgroundColor",new Lt);h(this,"width",0);h(this,"height",0);h(this,"options",{});h(this,"renderer");h(this,"enabledLayers",new Set([0,1]));h(this,"handleWebGLContextCreationError",s(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));h(this,"handleWebGLContextLost",s(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));h(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,tY()?(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 Lt,"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"),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 I8({canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Lt((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(l){j.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();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),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){b.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(FO,"Renderer");var sI=FO;d();d();var rY='"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';d();d();d();d();d();function nY(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(nY,"contains");d();function oY(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}s(oY,"intersectPoint");d();function iY(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,p=e.y+e.h;return r<c&&a<o&&n<p&&l<i}s(iY,"intersects");d();function bl(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}s(bl,"appendItems");d();var LO=class LO{constructor(t,r,n,o,i){h(this,"x");h(this,"y");h(this,"w");h(this,"h");h(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:nY(this,t)}intersects(t){return iY(this,t)}intersectsPoint(t){return oY(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};s(LO,"Rectangle");var qr=LO;var Pp=class Pp{constructor(t,r){h(this,"topLeft");h(this,"topRight");h(this,"bottomLeft");h(this,"bottomRight");h(this,"divided",!1);h(this,"boundary");h(this,"capacity",16);h(this,"objects",[]);h(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 Pp(new qr(t,r,n/2,o/2),this),this.topRight=new Pp(new qr(t+n/2,r,n/2,o/2),this),this.bottomLeft=new Pp(new qr(t,r+o/2,n/2,o/2),this),this.bottomRight=new Pp(new qr(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&&(bl(r,this.topLeft.queryRect(t)),bl(r,this.topRight.queryRect(t)),bl(r,this.bottomLeft.queryRect(t)),bl(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(bl(r,this.topLeft.queryPoint(t)),bl(r,this.topRight.queryPoint(t)),bl(r,this.bottomLeft.queryPoint(t)),bl(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(Pp,"QuadTree");var oa=Pp;d();d();var sY=["","","low","medium","high","always-visible"];function aY(e){return Math.min(5,Math.max(2,e))}s(aY,"clampTierNumber");function Dm(e){if(typeof e=="number")return aY(e);let t=sY.indexOf(e);return t===-1?3:t}s(Dm,"convertCollisionRankingTierToNumber");function rb(e){let t=aY(e);return sY[t]}s(rb,"convertNumberToCollisionRankingTier");function cY(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 p=Date.now();!l&&r.leading===!1&&(l=p);let f=t-(p-l);return n=globalThis,o=arguments,f<=0||f>t?(a&&(clearTimeout(a),a=null),l=p,i=e.apply(n,o),a||(n=o=null)):!a&&r.trailing!==!1&&(a=setTimeout(c,f)),i}}s(cY,"throttle");var Tp=!1,RO="",v2e=150,BO=class BO extends Fe{constructor(r,n,o=RO?new Worker(RO):new Worker(URL.createObjectURL(new Blob([rY],{type:"text/javascript"})))){super();h(this,"worker");h(this,"debugContext");h(this,"debugCanvas");h(this,"collidersDirty",!0);h(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);h(this,"visibleCollidersQTree",new oa(new qr(0,0,0,0)));h(this,"interactiveCollidersQTree",new oa(new qr(0,0,0,0)));h(this,"coreState");h(this,"postMessage");h(this,"showCollisionBoxes",s(()=>{Tp=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{Tp=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));h(this,"currentMsgId","");h(this,"working",!1);h(this,"_postMessage",s(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));h(this,"componentArray",[]);h(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 p=this.coreState.geometry2DMap.get(c);p&&(l=p.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"));h(this,"resolve",s(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,o=-1,i,a,l;Tp&&(this.visibleCollidersQTree=new oa(new qr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new oa(new qr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let c=0;c<this.componentArray.length;c++){let p=this.componentArray[c];n[c]!=null&&(o=n[c][0],i=n[c][2],p.offscreen=n[c][1]===1,o!==-1&&i!=null?(l=new qr(i.x,i.y,i.w,i.h,{entityId:p.id}),Tp&&this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(p.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new qr(i.x,i.y,i.w,i.h,{entityId:p.id})),(p.canShow===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),o!==-1&&o!==p.currentStrategyIndex&&(p.activeBoundingBox=l,p.onStrategySelected(o))):((p.canShow===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),o!==-1&&o!==p.currentStrategyIndex&&p.onStrategySelected(o)))}Tp&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));h(this,"drawDebug",s(()=>{Tp&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));h(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=cY(this._postMessage,v2e,!1),Tp?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(BO,"CollisionSystem");var aI=BO;function NO(e){RO=e}s(NO,"setWorkerUrl");d();d();d();d();var jO=class jO{constructor(t){h(this,"type");h(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};s(jO,"Tap");var lI=jO,GO=class GO{constructor(){h(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(GO,"TapsController");var cI=GO;d();function uY(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 lt&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}s(uY,"getUniqueIntersectedGroupContainers");var Fm,UO=class UO extends Fe{constructor(r,n,o,i,a){super();h(this,"raycaster",new xs);h(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});h(this,"coreState");h(this,"camera");h(this,"worldPlane");h(this,"_quadtree",new oa(new qr(0,0,0,0)));h(this,"_container");h(this,"lastPointerEvent");h(this,"cursor","grab");h(this,"touchesCount",0);h(this,"isUserInteracting");h(this,"hasTouched",!1);O(this,Fm);h(this,"onPointerMoveRaf",s(r=>{this.lastPointerEvent=r,u(this,Fm)&&cancelAnimationFrame(u(this,Fm)),A(this,Fm,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));h(this,"onPointerMove",s(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));h(this,"tapsControl",new cI);h(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 lI(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));h(this,"clickTimeout");h(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"));h(this,"dirty3D",!0);h(this,"cachedHitBoxes",{entities:[],groups:[]});h(this,"ndcPoint",new _e);h(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){return this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(o=>{var i,a;return((i=o.object)==null?void 0:i.name)==="worldPlane"||((a=o.object)==null?void 0:a.visible)})}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=uY(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=C2e(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 I,P,T,M,w;let n=[r.offsetX,r.offsetY],o=this._quadtree.queryPoint(n),[i]=o.filter(E=>E.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),p=(I=c[0])==null?void 0:I.point,f=[],m=[];for(let E of c.filter(B=>B.object.name!=="worldPlane"))E.object instanceof ze&&E.object.material.depthTest===!1?f.push(E):m.push(E);let y=(T=(P=f[0])!=null?P:m[0])!=null?T:void 0,v,x;if(y!=null){if(v=T2e(y.object,this.coreState.geometry3DMap),!v){let E=(M=y==null?void 0:y.instanceId)!=null?M:y==null?void 0:y.batchId;v=E!=null&&(y!=null&&y.object.userData.entities)?this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entities[E]):this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entityId)}v!=null&&v.components[2]&&(x=v)}let S=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((w=i==null?void 0:i.userData)==null?void 0:w.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(i==null?void 0:i.userData.entityId),entity3D:x,position:p,groupContainers:S}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&dY(this.state.lastHover,!1,this.coreState),r&&dY(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!P8(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}};Fm=new WeakMap,s(UO,"InteractionSystem");var ob=UO;function dY(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(dY,"updateHover");function C2e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}s(C2e,"processCursor");function P2e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Xl)return;if(t.userData.isSingleModel)return t;t=t.parent}}s(P2e,"findModelParent");function T2e(e,t){let r=P2e(e);return r?t.get(r.userData.entityId):void 0}s(T2e,"findModelParentEntity");d();d();var Tt;(function(e){e.assertEqual=o=>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"&&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})(Tt||(Tt={}));var zO;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(zO||(zO={}));var ye=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Rc=s(e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},"getParsedType"),ae=Tt.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"]),w2e=s(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),yI=class yI extends Error{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}get errors(){return this.issues}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 p=a.path[c];c===a.path.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(r(a))):l[p]=l[p]||{_errors:[]},l=l[p],c++}}},"processError");return o(this),n}static assert(t){if(!(t instanceof yI))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.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(yI,"ZodError");var jo=yI;jo.create=e=>new jo(e);var $m=s((e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===ye.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,Tt.jsonStringifyReplacer));break;case ae.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(Tt.joinValues(e.keys,", "));break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(Tt.joinValues(e.options));break;case ae.invalid_enum_value:r="Invalid enum value. Expected ".concat(Tt.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,'"'):Tt.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,Tt.assertNever(e)}return{message:r}},"errorMap"),hY=$m;function M2e(e){hY=e}s(M2e,"setErrorMap");function uI(){return hY}s(uI,"getErrorMap");var pI=s(e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let l="",c=n.filter(p=>!!p).slice().reverse();for(let p of c)l=p(a,{data:t,defaultError:l}).message;return{...o,path:i,message:l}},"makeIssue"),O2e=[];function fe(e,t){let r=uI(),n=pI({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===$m?void 0:$m].filter(o=>!!o)});e.common.issues.push(n)}s(fe,"addIssueToContext");var gI=class gI{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 $e;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 gI.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 $e;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(gI,"ParseStatus");var Rn=gI,$e=Object.freeze({status:"aborted"}),Rm=s(e=>({status:"dirty",value:e}),"DIRTY"),Kn=s(e=>({status:"valid",value:e}),"OK"),HO=s(e=>e.status==="aborted","isAborted"),WO=s(e=>e.status==="dirty","isDirty"),db=s(e=>e.status==="valid","isValid"),fb=s(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function dI(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)}s(dI,"__classPrivateFieldGet");function yY(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}s(yY,"__classPrivateFieldSet");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 ib,sb,ZO=class ZO{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||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};s(ZO,"ParseInputLazyPath");var xi=ZO,fY=s((e,t)=>{if(db(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 jo(e.common.issues);return this._error=r,this._error}}},"handleResult");function We(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 c,p;let{message:f}=e;return a.code==="invalid_enum_value"?{message:f!=null?f:l.defaultError}:typeof l.data>"u"?{message:(c=f!=null?f:n)!==null&&c!==void 0?c:l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:(p=f!=null?f:r)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:o}}s(We,"processCreateParams");var XO=class XO{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)}get description(){return this._def.description}_getType(t){return Rc(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Rc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:Rc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(fb(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 n;let o={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rc(t)},i=this._parseSync({data:t,path:o.path,parent:o});return fY(o,i)}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:Rc(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(fb(o)?o:Promise.resolve(o));return fY(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({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 Go({schema:this,typeName:Ne.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return vi.create(this,this._def)}nullable(){return aa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Il.create(this,this._def)}promise(){return $c.create(this,this._def)}or(t){return Dp.create([this,t],this._def)}and(t){return Fp.create(this,t,this._def)}transform(t){return new Go({...We(this._def),schema:this,typeName:Ne.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new $p({...We(this._def),innerType:this,defaultValue:r,typeName:Ne.ZodDefault})}brand(){return new mb({typeName:Ne.ZodBranded,type:this,...We(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new jp({...We(this._def),innerType:this,catchValue:r,typeName:Ne.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return hb.create(this,t)}readonly(){return Gp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};s(XO,"ZodType");var qe=XO,E2e=/^c[^\s-]{8,}$/i,_2e=/^[0-9a-z]+$/,A2e=/^[0-9A-HJKMNP-TV-Z]{26}$/,k2e=/^[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,D2e=/^[a-z0-9_-]{21}$/i,F2e=/^[-+]?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)?)??$/,L2e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R2e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",VO,N2e=/^(?:(?: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])$/,B2e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,$2e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gY="((\\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])))",j2e=new RegExp("^".concat(gY,"$"));function bY(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}s(bY,"timeRegexSource");function G2e(e){return new RegExp("^".concat(bY(e),"$"))}s(G2e,"timeRegex");function vY(e){let t="".concat(gY,"T").concat(bY(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(vY,"datetimeRegex");function U2e(e,t){return!!((t==="v4"||!t)&&N2e.test(e)||(t==="v6"||!t)&&B2e.test(e))}s(U2e,"isValidIP");var wp=class wp extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ye.string,received:i.parsedType}),$e}let n=new Rn,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")L2e.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")VO||(VO=new RegExp(R2e,"u")),VO.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")k2e.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")D2e.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")E2e.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")_2e.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")A2e.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{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"?vY(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"?j2e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:ae.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?G2e(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"?F2e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"duration",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?U2e(t.data,i.version)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"ip",code:ae.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?$2e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"base64",code:ae.invalid_string,message:i.message}),n.dirty()):Tt.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ae.invalid_string,...Oe.errToObj(n)})}_addCheck(t){return new wp({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...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({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!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?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({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({kind:"duration",...Oe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Oe.errToObj(r)})}includes(t,r){return this._addCheck({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({kind:"startsWith",value:t,...Oe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Oe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Oe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Oe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Oe.errToObj(r)})}nonempty(t){return this.min(1,Oe.errToObj(t))}trim(){return new wp({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wp({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wp({...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 isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}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(wp,"ZodString");var Nc=wp;Nc.create=e=>{var t;return new Nc({checks:[],typeName:Ne.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...We(e)})};function V2e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return i%a/Math.pow(10,o)}s(V2e,"floatSafeRemainder");var ab=class ab 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)!==ye.number){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ye.number,received:i.parsedType}),$e}let n,o=new Rn;for(let i of this._def.checks)i.kind==="int"?Tt.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"?V2e(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()):Tt.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 ab({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Oe.toString(o)}]})}_addCheck(t){return new ab({...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"&&Tt.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(ab,"ZodNumber");var Mp=ab;Mp.create=e=>new Mp({checks:[],typeName:Ne.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...We(e)});var lb=class lb extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ye.bigint){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ye.bigint,received:i.parsedType}),$e}let n,o=new Rn;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()):Tt.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 lb({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Oe.toString(o)}]})}_addCheck(t){return new lb({...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(lb,"ZodBigInt");var Op=lb;Op.create=e=>{var t;return new Op({checks:[],typeName:Ne.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...We(e)})};var YO=class YO extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ye.boolean,received:n.parsedType}),$e}return Kn(t.data)}};s(YO,"ZodBoolean");var Ep=YO;Ep.create=e=>new Ep({typeName:Ne.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...We(e)});var bI=class bI extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_type,expected:ye.date,received:i.parsedType}),$e}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return fe(i,{code:ae.invalid_date}),$e}let n=new Rn,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()):Tt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new bI({...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(bI,"ZodDate");var _p=bI;_p.create=e=>new _p({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ne.ZodDate,...We(e)});var KO=class KO extends qe{_parse(t){if(this._getType(t)!==ye.symbol){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ye.symbol,received:n.parsedType}),$e}return Kn(t.data)}};s(KO,"ZodSymbol");var jm=KO;jm.create=e=>new jm({typeName:Ne.ZodSymbol,...We(e)});var JO=class JO extends qe{_parse(t){if(this._getType(t)!==ye.undefined){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ye.undefined,received:n.parsedType}),$e}return Kn(t.data)}};s(JO,"ZodUndefined");var Ap=JO;Ap.create=e=>new Ap({typeName:Ne.ZodUndefined,...We(e)});var QO=class QO extends qe{_parse(t){if(this._getType(t)!==ye.null){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ye.null,received:n.parsedType}),$e}return Kn(t.data)}};s(QO,"ZodNull");var kp=QO;kp.create=e=>new kp({typeName:Ne.ZodNull,...We(e)});var e7=class e7 extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Kn(t.data)}};s(e7,"ZodAny");var Bc=e7;Bc.create=e=>new Bc({typeName:Ne.ZodAny,...We(e)});var t7=class t7 extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Kn(t.data)}};s(t7,"ZodUnknown");var xl=t7;xl.create=e=>new xl({typeName:Ne.ZodUnknown,...We(e)});var r7=class r7 extends qe{_parse(t){let r=this._getOrReturnCtx(t);return fe(r,{code:ae.invalid_type,expected:ye.never,received:r.parsedType}),$e}};s(r7,"ZodNever");var rs=r7;rs.create=e=>new rs({typeName:Ne.ZodNever,...We(e)});var n7=class n7 extends qe{_parse(t){if(this._getType(t)!==ye.undefined){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ye.void,received:n.parsedType}),$e}return Kn(t.data)}};s(n7,"ZodVoid");var Gm=n7;Gm.create=e=>new Gm({typeName:Ne.ZodVoid,...We(e)});var Nm=class Nm extends qe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ye.array)return fe(r,{code:ae.invalid_type,expected:ye.array,received:r.parsedType}),$e;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 xi(r,a,r.path,l)))).then(a=>Rn.mergeArray(n,a));let i=[...r.data].map((a,l)=>o.type._parseSync(new xi(r,a,r.path,l)));return Rn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Nm({...this._def,minLength:{value:t,message:Oe.toString(r)}})}max(t,r){return new Nm({...this._def,maxLength:{value:t,message:Oe.toString(r)}})}length(t,r){return new Nm({...this._def,exactLength:{value:t,message:Oe.toString(r)}})}nonempty(t){return this.min(1,t)}};s(Nm,"ZodArray");var Il=Nm;Il.create=(e,t)=>new Il({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ne.ZodArray,...We(t)});function Lm(e){if(e instanceof Io){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=vi.create(Lm(n))}return new Io({...e._def,shape:s(()=>t,"shape")})}else return e instanceof Il?new Il({...e._def,type:Lm(e.element)}):e instanceof vi?vi.create(Lm(e.unwrap())):e instanceof aa?aa.create(Lm(e.unwrap())):e instanceof sa?sa.create(e.items.map(t=>Lm(t))):e}s(Lm,"deepPartialify");var $o=class $o 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=Tt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ye.object){let p=this._getOrReturnCtx(t);return fe(p,{code:ae.invalid_type,expected:ye.object,received:p.parsedType}),$e}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof rs&&this._def.unknownKeys==="strip"))for(let p in o.data)a.includes(p)||l.push(p);let c=[];for(let p of a){let f=i[p],m=o.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new xi(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof rs){let p=this._def.unknownKeys;if(p==="passthrough")for(let f of l)c.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")l.length>0&&(fe(o,{code:ae.unrecognized_keys,keys:l}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let f of l){let m=o.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new xi(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let p=[];for(let f of c){let m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>Rn.mergeObjectSync(n,p)):Rn.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return Oe.errToObj,new $o({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:s((r,n)=>{var o,i,a,l;let c=(a=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,r,n).message)!==null&&a!==void 0?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Oe.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}},"errorMap")}:{}})}strip(){return new $o({...this._def,unknownKeys:"strip"})}passthrough(){return new $o({...this._def,unknownKeys:"passthrough"})}extend(t){return new $o({...this._def,shape:s(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new $o({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:s(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:Ne.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new $o({...this._def,catchall:t})}pick(t){let r={};return Tt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new $o({...this._def,shape:s(()=>r,"shape")})}omit(t){let r={};return Tt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new $o({...this._def,shape:s(()=>r,"shape")})}deepPartial(){return Lm(this)}partial(t){let r={};return Tt.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}),new $o({...this._def,shape:s(()=>r,"shape")})}required(t){let r={};return Tt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof vi;)i=i._def.innerType;r[n]=i}}),new $o({...this._def,shape:s(()=>r,"shape")})}keyof(){return xY(Tt.objectKeys(this.shape))}};s($o,"ZodObject");var Io=$o;Io.create=(e,t)=>new Io({shape:s(()=>e,"shape"),unknownKeys:"strip",catchall:rs.create(),typeName:Ne.ZodObject,...We(t)});Io.strictCreate=(e,t)=>new Io({shape:s(()=>e,"shape"),unknownKeys:"strict",catchall:rs.create(),typeName:Ne.ZodObject,...We(t)});Io.lazycreate=(e,t)=>new Io({shape:e,unknownKeys:"strip",catchall:rs.create(),typeName:Ne.ZodObject,...We(t)});var o7=class o7 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 jo(l.ctx.common.issues));return fe(r,{code:ae.invalid_union,unionErrors:a}),$e}if(s(o,"handleResults"),r.common.async)return Promise.all(n.map(async i=>{let a={...r,common:{...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 p={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:p});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let l=a.map(c=>new jo(c));return fe(r,{code:ae.invalid_union,unionErrors:l}),$e}}get options(){return this._def.options}};s(o7,"ZodUnion");var Dp=o7;Dp.create=(e,t)=>new Dp({options:e,typeName:Ne.ZodUnion,...We(t)});var vl=s(e=>e instanceof Lp?vl(e.schema):e instanceof Go?vl(e.innerType()):e instanceof Rp?[e.value]:e instanceof Np?e.options:e instanceof Bp?Tt.objectValues(e.enum):e instanceof $p?vl(e._def.innerType):e instanceof Ap?[void 0]:e instanceof kp?[null]:e instanceof vi?[void 0,...vl(e.unwrap())]:e instanceof aa?[null,...vl(e.unwrap())]:e instanceof mb||e instanceof Gp?vl(e.unwrap()):e instanceof jp?vl(e._def.innerType):[],"getDiscriminator"),vI=class vI extends qe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.object)return fe(r,{code:ae.invalid_type,expected:ye.object,received:r.parsedType}),$e;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]}),$e)}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=vl(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 vI({typeName:Ne.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...We(n)})}};s(vI,"ZodDiscriminatedUnion");var fI=vI;function qO(e,t){let r=Rc(e),n=Rc(t);if(e===t)return{valid:!0,data:e};if(r===ye.object&&n===ye.object){let o=Tt.objectKeys(t),i=Tt.objectKeys(e).filter(l=>o.indexOf(l)!==-1),a={...e,...t};for(let l of i){let c=qO(e[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(r===ye.array&&n===ye.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=qO(a,l);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===ye.date&&n===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}s(qO,"mergeValues");var i7=class i7 extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=s((i,a)=>{if(HO(i)||HO(a))return $e;let l=qO(i.value,a.value);return l.valid?((WO(i)||WO(a))&&r.dirty(),{status:r.value,value:l.data}):(fe(n,{code:ae.invalid_intersection_types}),$e)},"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(i7,"ZodIntersection");var Fp=i7;Fp.create=(e,t,r)=>new Fp({left:e,right:t,typeName:Ne.ZodIntersection,...We(r)});var xI=class xI extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.array)return fe(n,{code:ae.invalid_type,expected:ye.array,received:n.parsedType}),$e;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"}),$e;!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 xi(n,a,n.path,l)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>Rn.mergeArray(r,a)):Rn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new xI({...this._def,rest:t})}};s(xI,"ZodTuple");var sa=xI;sa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sa({items:e,typeName:Ne.ZodTuple,rest:null,...We(t)})};var cb=class cb 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!==ye.object)return fe(n,{code:ae.invalid_type,expected:ye.object,received:n.parsedType}),$e;let o=[],i=this._def.keyType,a=this._def.valueType;for(let l in n.data)o.push({key:i._parse(new xi(n,l,n.path,l)),value:a._parse(new xi(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Rn.mergeObjectAsync(r,o):Rn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof qe?new cb({keyType:t,valueType:r,typeName:Ne.ZodRecord,...We(n)}):new cb({keyType:Nc.create(),valueType:t,typeName:Ne.ZodRecord,...We(r)})}};s(cb,"ZodRecord");var mI=cb,s7=class s7 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!==ye.map)return fe(n,{code:ae.invalid_type,expected:ye.map,received:n.parsedType}),$e;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([l,c],p)=>({key:o._parse(new xi(n,l,n.path,[p,"key"])),value:i._parse(new xi(n,c,n.path,[p,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let c of a){let p=await c.key,f=await c.value;if(p.status==="aborted"||f.status==="aborted")return $e;(p.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(p.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let c of a){let p=c.key,f=c.value;if(p.status==="aborted"||f.status==="aborted")return $e;(p.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(p.value,f.value)}return{status:r.value,value:l}}}};s(s7,"ZodMap");var Um=s7;Um.create=(e,t,r)=>new Um({valueType:t,keyType:e,typeName:Ne.ZodMap,...We(r)});var ub=class ub extends qe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.set)return fe(n,{code:ae.invalid_type,expected:ye.set,received:n.parsedType}),$e;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 p=new Set;for(let f of c){if(f.status==="aborted")return $e;f.status==="dirty"&&r.dirty(),p.add(f.value)}return{status:r.value,value:p}}s(a,"finalizeSet");let l=[...n.data.values()].map((c,p)=>i._parse(new xi(n,c,n.path,p)));return n.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,r){return new ub({...this._def,minSize:{value:t,message:Oe.toString(r)}})}max(t,r){return new ub({...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(ub,"ZodSet");var Vm=ub;Vm.create=(e,t)=>new Vm({valueType:e,minSize:null,maxSize:null,typeName:Ne.ZodSet,...We(t)});var Bm=class Bm extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.function)return fe(r,{code:ae.invalid_type,expected:ye.function,received:r.parsedType}),$e;function n(l,c){return pI({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,uI(),$m].filter(p=>!!p),issueData:{code:ae.invalid_arguments,argumentsError:c}})}s(n,"makeArgsIssue");function o(l,c){return pI({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,uI(),$m].filter(p=>!!p),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 $c){let l=this;return Kn(async function(...c){let p=new jo([]),f=await l._def.args.parseAsync(c,i).catch(v=>{throw p.addIssue(n(c,v)),p}),m=await Reflect.apply(a,this,f);return await l._def.returns._def.type.parseAsync(m,i).catch(v=>{throw p.addIssue(o(m,v)),p})})}else{let l=this;return Kn(function(...c){let p=l._def.args.safeParse(c,i);if(!p.success)throw new jo([n(c,p.error)]);let f=Reflect.apply(a,this,p.data),m=l._def.returns.safeParse(f,i);if(!m.success)throw new jo([o(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Bm({...this._def,args:sa.create(t).rest(xl.create())})}returns(t){return new Bm({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Bm({args:t||sa.create([]).rest(xl.create()),returns:r||xl.create(),typeName:Ne.ZodFunction,...We(n)})}};s(Bm,"ZodFunction");var hI=Bm,a7=class a7 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(a7,"ZodLazy");var Lp=a7;Lp.create=(e,t)=>new Lp({getter:e,typeName:Ne.ZodLazy,...We(t)});var l7=class l7 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}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}};s(l7,"ZodLiteral");var Rp=l7;Rp.create=(e,t)=>new Rp({value:e,typeName:Ne.ZodLiteral,...We(t)});function xY(e,t){return new Np({values:e,typeName:Ne.ZodEnum,...We(t)})}s(xY,"createZodEnum");var pb=class pb extends qe{constructor(){super(...arguments),ib.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{expected:Tt.joinValues(n),received:r.parsedType,code:ae.invalid_type}),$e}if(dI(this,ib,"f")||yY(this,ib,new Set(this._def.values),"f"),!dI(this,ib,"f").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}),$e}return Kn(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 pb.create(t,{...this._def,...r})}exclude(t,r=this._def){return pb.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};s(pb,"ZodEnum");var Np=pb;ib=new WeakMap;Np.create=xY;var c7=class c7 extends qe{constructor(){super(...arguments),sb.set(this,void 0)}_parse(t){let r=Tt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ye.string&&n.parsedType!==ye.number){let o=Tt.objectValues(r);return fe(n,{expected:Tt.joinValues(o),received:n.parsedType,code:ae.invalid_type}),$e}if(dI(this,sb,"f")||yY(this,sb,new Set(Tt.getValidEnumValues(this._def.values)),"f"),!dI(this,sb,"f").has(t.data)){let o=Tt.objectValues(r);return fe(n,{received:n.data,code:ae.invalid_enum_value,options:o}),$e}return Kn(t.data)}get enum(){return this._def.values}};s(c7,"ZodNativeEnum");var Bp=c7;sb=new WeakMap;Bp.create=(e,t)=>new Bp({values:e,typeName:Ne.ZodNativeEnum,...We(t)});var u7=class u7 extends qe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ye.promise&&r.common.async===!1)return fe(r,{code:ae.invalid_type,expected:ye.promise,received:r.parsedType}),$e;let n=r.parsedType===ye.promise?r.data:Promise.resolve(r.data);return Kn(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};s(u7,"ZodPromise");var $c=u7;$c.create=(e,t)=>new $c({type:e,typeName:Ne.ZodPromise,...We(t)});var p7=class p7 extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ne.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 $e;let c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?$e:c.status==="dirty"||r.value==="dirty"?Rm(c.value):c});{if(r.value==="aborted")return $e;let l=this._def.schema._parseSync({data:a,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?Rm(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"?$e:(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"?$e:(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(!db(a))return a;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=>db(a)?Promise.resolve(o.transform(a.value,i)).then(l=>({status:r.value,value:l})):a);Tt.assertNever(o)}};s(p7,"ZodEffects");var Go=p7;Go.create=(e,t,r)=>new Go({schema:e,typeName:Ne.ZodEffects,effect:t,...We(r)});Go.createWithPreprocess=(e,t,r)=>new Go({schema:t,effect:{type:"preprocess",transform:e},typeName:Ne.ZodEffects,...We(r)});var d7=class d7 extends qe{_parse(t){return this._getType(t)===ye.undefined?Kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};s(d7,"ZodOptional");var vi=d7;vi.create=(e,t)=>new vi({innerType:e,typeName:Ne.ZodOptional,...We(t)});var f7=class f7 extends qe{_parse(t){return this._getType(t)===ye.null?Kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};s(f7,"ZodNullable");var aa=f7;aa.create=(e,t)=>new aa({innerType:e,typeName:Ne.ZodNullable,...We(t)});var m7=class m7 extends qe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ye.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};s(m7,"ZodDefault");var $p=m7;$p.create=(e,t)=>new $p({innerType:e,typeName:Ne.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...We(t)});var h7=class h7 extends qe{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return fb(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jo(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new jo(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};s(h7,"ZodCatch");var jp=h7;jp.create=(e,t)=>new jp({innerType:e,typeName:Ne.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...We(t)});var y7=class y7 extends qe{_parse(t){if(this._getType(t)!==ye.nan){let n=this._getOrReturnCtx(t);return fe(n,{code:ae.invalid_type,expected:ye.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}};s(y7,"ZodNaN");var zm=y7;zm.create=e=>new zm({typeName:Ne.ZodNaN,...We(e)});var z2e=Symbol("zod_brand"),g7=class g7 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(g7,"ZodBranded");var mb=g7,II=class II 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"?$e:i.status==="dirty"?(r.dirty(),Rm(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"?$e: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 II({in:t,out:r,typeName:Ne.ZodPipeline})}};s(II,"ZodPipeline");var hb=II,b7=class b7 extends qe{_parse(t){let r=this._def.innerType._parse(t),n=s(o=>(db(o)&&(o.value=Object.freeze(o.value)),o),"freeze");return fb(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};s(b7,"ZodReadonly");var Gp=b7;Gp.create=(e,t)=>new Gp({innerType:e,typeName:Ne.ZodReadonly,...We(t)});function IY(e,t={},r){return e?Bc.create().superRefine((n,o)=>{var i,a;if(!e(n)){let l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,c=(a=(i=l.fatal)!==null&&i!==void 0?i:r)!==null&&a!==void 0?a:!0,p=typeof l=="string"?{message:l}:l;o.addIssue({code:"custom",...p,fatal:c})}}):Bc.create()}s(IY,"custom");var H2e={object:Io.lazycreate},Ne;(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"})(Ne||(Ne={}));var W2e=s((e,t={message:"Input not instance of ".concat(e.name)})=>IY(r=>r instanceof e,t),"instanceOfType"),SY=Nc.create,CY=Mp.create,q2e=zm.create,Z2e=Op.create,PY=Ep.create,X2e=_p.create,Y2e=jm.create,K2e=Ap.create,J2e=kp.create,Q2e=Bc.create,eIe=xl.create,tIe=rs.create,rIe=Gm.create,nIe=Il.create,oIe=Io.create,iIe=Io.strictCreate,sIe=Dp.create,aIe=fI.create,lIe=Fp.create,cIe=sa.create,uIe=mI.create,pIe=Um.create,dIe=Vm.create,fIe=hI.create,mIe=Lp.create,hIe=Rp.create,yIe=Np.create,gIe=Bp.create,bIe=$c.create,mY=Go.create,vIe=vi.create,xIe=aa.create,IIe=Go.createWithPreprocess,SIe=hb.create,CIe=s(()=>SY().optional(),"ostring"),PIe=s(()=>CY().optional(),"onumber"),TIe=s(()=>PY().optional(),"oboolean"),wIe={string:s(e=>Nc.create({...e,coerce:!0}),"string"),number:s(e=>Mp.create({...e,coerce:!0}),"number"),boolean:s(e=>Ep.create({...e,coerce:!0}),"boolean"),bigint:s(e=>Op.create({...e,coerce:!0}),"bigint"),date:s(e=>_p.create({...e,coerce:!0}),"date")},MIe=$e,$=Object.freeze({__proto__:null,defaultErrorMap:$m,setErrorMap:M2e,getErrorMap:uI,makeIssue:pI,EMPTY_PATH:O2e,addIssueToContext:fe,ParseStatus:Rn,INVALID:$e,DIRTY:Rm,OK:Kn,isAborted:HO,isDirty:WO,isValid:db,isAsync:fb,get util(){return Tt},get objectUtil(){return zO},ZodParsedType:ye,getParsedType:Rc,ZodType:qe,datetimeRegex:vY,ZodString:Nc,ZodNumber:Mp,ZodBigInt:Op,ZodBoolean:Ep,ZodDate:_p,ZodSymbol:jm,ZodUndefined:Ap,ZodNull:kp,ZodAny:Bc,ZodUnknown:xl,ZodNever:rs,ZodVoid:Gm,ZodArray:Il,ZodObject:Io,ZodUnion:Dp,ZodDiscriminatedUnion:fI,ZodIntersection:Fp,ZodTuple:sa,ZodRecord:mI,ZodMap:Um,ZodSet:Vm,ZodFunction:hI,ZodLazy:Lp,ZodLiteral:Rp,ZodEnum:Np,ZodNativeEnum:Bp,ZodPromise:$c,ZodEffects:Go,ZodTransformer:Go,ZodOptional:vi,ZodNullable:aa,ZodDefault:$p,ZodCatch:jp,ZodNaN:zm,BRAND:z2e,ZodBranded:mb,ZodPipeline:hb,ZodReadonly:Gp,custom:IY,Schema:qe,ZodSchema:qe,late:H2e,get ZodFirstPartyTypeKind(){return Ne},coerce:wIe,any:Q2e,array:nIe,bigint:Z2e,boolean:PY,date:X2e,discriminatedUnion:aIe,effect:mY,enum:yIe,function:fIe,instanceof:W2e,intersection:lIe,lazy:mIe,literal:hIe,map:pIe,nan:q2e,nativeEnum:gIe,never:tIe,null:J2e,nullable:xIe,number:CY,object:oIe,oboolean:TIe,onumber:PIe,optional:vIe,ostring:CIe,pipeline:SIe,preprocess:IIe,promise:bIe,record:uIe,set:dIe,strictObject:iIe,string:SY,symbol:Y2e,transformer:mY,tuple:cIe,undefined:K2e,union:sIe,unknown:eIe,void:rIe,NEVER:MIe,ZodIssueCode:ae,quotelessJson:w2e,ZodError:jo});var eK=ys(E7());var Ib=4,x3e=8,I3e="0.6",QY="low-priority-pin",_7=$.object({rank:$.union([$.enum(["low","medium","high","always-visible"]),$.number()]).optional(),interactive:$.union([$.boolean(),$.literal("pointer-events-auto")]).optional(),id:$.string().optional(),anchor:$.union([$.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),$.array($.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:$.boolean().optional(),zIndex:$.number().optional(),lowPriorityPin:$.object({enabled:$.boolean().optional(),size:$.number().positive().optional(),color:$.string().optional()}).optional()});function tK(e,t,r){$.array($.number()).min(2).max(3).parse(e),$.string().parse(t),_7.parse(r)}s(tK,"validateMarker");var S3e=Object.freeze({enabled:!0,size:x3e,color:"#666"}),Hp=class Hp{constructor(t,r={}){h(this,"id");h(this,"type","marker");h(this,"rank",0);h(this,"initialRank",0);h(this,"activeAnchor","center");h(this,"pointerEvents","none");h(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...S3e}});h(this,"projection",new _e);h(this,"enabled",!0);h(this,"canShow",!1);h(this,"visible",!0);h(this,"isOccluded",!1);h(this,"offscreen",!1);h(this,"strategyIndex",-1);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"markerContainer");h(this,"containerEl");h(this,"contentEl",null);h(this,"contentHtml","");h(this,"style",{top:"0px",left:"0px"});h(this,"dirty",!1);h(this,"attachedDirty",!0);h(this,"collisionDirty",!0);h(this,"visibilityNeedsUpdate","show");h(this,"animation",null);h(this,"currentStrategyIndex",-1);h(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",QY);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=I3e,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",p=-a/2+"px";switch(this.style.top=c,this.style.left=p,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=p}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));h(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)||_t(),this.options=(0,eK.default)(this.options,r),typeof r.rank=="string")this.rank=Dm(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let a=Math.trunc(b.env.NODE_ENV==="test"?Hp.testId:Hp.testId*10)/10;Hp.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,p=t/2,f=t/2;switch(a){case"top":{l=r,c=0;break}case"bottom":{l=0,c=r;break}case"left":{p=t,f=0;break}case"right":{p=0,f=t;break}case"top-left":{l=r,p=t,c=0,f=0;break}case"top-right":{l=r,f=t,c=0,p=0;break}case"bottom-left":{c=r,p=t,l=0,f=0;break}case"bottom-right":{c=r,f=t,l=0,p=0;break}}return[l+Ib,c+Ib,p+Ib,f+Ib]},"getBoundingBox")}));if((i=this.options.lowPriorityPin)!=null&&i.enabled){let a={name:QY,getBoundingBox:s(()=>{let l=Math.max(2,Ib/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(Hp,"MarkerComponent"),h(Hp,"testId",0);var la=Hp;d();d();d();d();d();var A7=class A7{constructor(){h(this,"hover",!1);h(this,"dirty",!1)}};s(A7,"InteractionComponent");var Zm=A7;d();d();function _I(e){"@babel/helpers - typeof";return _I=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},_I(e)}s(_I,"_typeof");var C3e=/^\s+/,P3e=/\s+$/;function Ce(e,t){if(e=e||"",t=t||{},e instanceof Ce)return e;if(!(this instanceof Ce))return new Ce(e,t);var r=T3e(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(Ce,"tinycolor");Ce.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=lK(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:s(function(){var t=nK(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=nK(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=rK(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=rK(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 oK(this._r,this._g,this._b,t)},"toHex"),toHexString:s(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:s(function(t){return E3e(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:G3e[oK(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:s(function(t){var r="#"+iK(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Ce(t);n="#"+iK(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 Ce(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(D3e,arguments)},"lighten"),brighten:s(function(){return this._applyModification(F3e,arguments)},"brighten"),darken:s(function(){return this._applyModification(L3e,arguments)},"darken"),desaturate:s(function(){return this._applyModification(_3e,arguments)},"desaturate"),saturate:s(function(){return this._applyModification(A3e,arguments)},"saturate"),greyscale:s(function(){return this._applyModification(k3e,arguments)},"greyscale"),spin:s(function(){return this._applyModification(R3e,arguments)},"spin"),_applyCombination:s(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:s(function(){return this._applyCombination($3e,arguments)},"analogous"),complement:s(function(){return this._applyCombination(N3e,arguments)},"complement"),monochromatic:s(function(){return this._applyCombination(j3e,arguments)},"monochromatic"),splitcomplement:s(function(){return this._applyCombination(B3e,arguments)},"splitcomplement"),triad:s(function(){return this._applyCombination(sK,[3])},"triad"),tetrad:s(function(){return this._applyCombination(sK,[4])},"tetrad")};Ce.fromRatio=function(e,t){if(_I(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=Sb(e[n]));e=r}return Ce(e,t)};function T3e(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=H3e(e)),_I(e)=="object"&&(Pl(e.r)&&Pl(e.g)&&Pl(e.b)?(t=w3e(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Pl(e.h)&&Pl(e.s)&&Pl(e.v)?(n=Sb(e.s),o=Sb(e.v),t=O3e(e.h,n,o),a=!0,l="hsv"):Pl(e.h)&&Pl(e.s)&&Pl(e.l)&&(n=Sb(e.s),i=Sb(e.l),t=M3e(e.h,n,i),a=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=lK(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(T3e,"inputToRGB");function w3e(e,t,r){return{r:fr(e,255)*255,g:fr(t,255)*255,b:fr(r,255)*255}}s(w3e,"rgbToRgb");function rK(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(rK,"rgbToHsl");function M3e(e,t,r){var n,o,i;e=fr(e,360),t=fr(t,100),r=fr(r,100);function a(p,f,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(f-p)*6*m:m<1/2?f:m<2/3?p+(f-p)*(2/3-m)*6:p}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(M3e,"hslToRgb");function nK(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(nK,"rgbToHsv");function O3e(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,p=[r,a,i,i,l,r][c],f=[l,r,r,a,i,i][c],m=[i,i,l,r,r,a][c];return{r:p*255,g:f*255,b:m*255}}s(O3e,"hsvToRgb");function oK(e,t,r,n){var o=[os(Math.round(e).toString(16)),os(Math.round(t).toString(16)),os(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(oK,"rgbToHex");function E3e(e,t,r,n,o){var i=[os(Math.round(e).toString(16)),os(Math.round(t).toString(16)),os(Math.round(r).toString(16)),os(cK(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(E3e,"rgbaToHex");function iK(e,t,r,n){var o=[os(cK(n)),os(Math.round(e).toString(16)),os(Math.round(t).toString(16)),os(Math.round(r).toString(16))];return o.join("")}s(iK,"rgbaToArgbHex");Ce.equals=function(e,t){return!e||!t?!1:Ce(e).toRgbString()==Ce(t).toRgbString()};Ce.random=function(){return Ce.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function _3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.s-=t/100,r.s=AI(r.s),Ce(r)}s(_3e,"_desaturate");function A3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.s+=t/100,r.s=AI(r.s),Ce(r)}s(A3e,"_saturate");function k3e(e){return Ce(e).desaturate(100)}s(k3e,"_greyscale");function D3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.l+=t/100,r.l=AI(r.l),Ce(r)}s(D3e,"_lighten");function F3e(e,t){t=t===0?0:t||10;var r=Ce(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)))),Ce(r)}s(F3e,"_brighten");function L3e(e,t){t=t===0?0:t||10;var r=Ce(e).toHsl();return r.l-=t/100,r.l=AI(r.l),Ce(r)}s(L3e,"_darken");function R3e(e,t){var r=Ce(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Ce(r)}s(R3e,"_spin");function N3e(e){var t=Ce(e).toHsl();return t.h=(t.h+180)%360,Ce(t)}s(N3e,"_complement");function sK(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Ce(e).toHsl(),n=[Ce(e)],o=360/t,i=1;i<t;i++)n.push(Ce({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}s(sK,"polyad");function B3e(e){var t=Ce(e).toHsl(),r=t.h;return[Ce(e),Ce({h:(r+72)%360,s:t.s,l:t.l}),Ce({h:(r+216)%360,s:t.s,l:t.l})]}s(B3e,"_splitcomplement");function $3e(e,t,r){t=t||6,r=r||30;var n=Ce(e).toHsl(),o=360/r,i=[Ce(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(Ce(n));return i}s($3e,"_analogous");function j3e(e,t){t=t||6;for(var r=Ce(e).toHsv(),n=r.h,o=r.s,i=r.v,a=[],l=1/t;t--;)a.push(Ce({h:n,s:o,v:i})),i=(i+l)%1;return a}s(j3e,"_monochromatic");Ce.mix=function(e,t,r){r=r===0?0:r||50;var n=Ce(e).toRgb(),o=Ce(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 Ce(a)};Ce.readability=function(e,t){var r=Ce(e),n=Ce(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Ce.isReadable=function(e,t,r){var n=Ce.readability(e,t),o,i;switch(i=!1,o=W3e(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};Ce.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 p=0;p<t.length;p++)i=Ce.readability(e,t[p]),i>o&&(o=i,n=Ce(t[p]));return Ce.isReadable(e,n,{level:l,size:c})||!a?n:(r.includeFallbackColors=!1,Ce.mostReadable(e,["#fff","#000"],r))};var k7=Ce.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"},G3e=Ce.hexNames=U3e(k7);function U3e(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}s(U3e,"flip");function lK(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}s(lK,"boundAlpha");function fr(e,t){V3e(e)&&(e="100%");var r=z3e(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 AI(e){return Math.min(1,Math.max(0,e))}s(AI,"clamp01");function Uo(e){return parseInt(e,16)}s(Uo,"parseIntFromHex");function V3e(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}s(V3e,"isOnePointZero");function z3e(e){return typeof e=="string"&&e.indexOf("%")!=-1}s(z3e,"isPercentage");function os(e){return e.length==1?"0"+e:""+e}s(os,"pad2");function Sb(e){return e<=1&&(e=e*100+"%"),e}s(Sb,"convertToPercentage");function cK(e){return Math.round(parseFloat(e)*255).toString(16)}s(cK,"convertDecimalToHex");function aK(e){return Uo(e)/255}s(aK,"convertHexToDecimal");var ns=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 Pl(e){return!!ns.CSS_UNIT.exec(e)}s(Pl,"isValidCSSUnit");function H3e(e){e=e.replace(C3e,"").replace(P3e,"").toLowerCase();var t=!1;if(k7[e])e=k7[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ns.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ns.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ns.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ns.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ns.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ns.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ns.hex8.exec(e))?{r:Uo(r[1]),g:Uo(r[2]),b:Uo(r[3]),a:aK(r[4]),format:t?"name":"hex8"}:(r=ns.hex6.exec(e))?{r:Uo(r[1]),g:Uo(r[2]),b:Uo(r[3]),format:t?"name":"hex"}:(r=ns.hex4.exec(e))?{r:Uo(r[1]+""+r[1]),g:Uo(r[2]+""+r[2]),b:Uo(r[3]+""+r[3]),a:aK(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=ns.hex3.exec(e))?{r:Uo(r[1]+""+r[1]),g:Uo(r[2]+""+r[2]),b:Uo(r[3]+""+r[3]),format:t?"name":"hex"}:!1}s(H3e,"stringInputToObject");function W3e(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(W3e,"validateWCAG2Parms");var H7=ys(z7());var q7=$.object({rank:$.union([$.enum(["low","medium","high","always-visible"]),$.number()]).optional(),interactive:$.boolean().optional(),appearance:$.object({margin:$.number().min(6).optional(),text:$.object({numLines:$.number().optional(),lineHeight:$.number().optional(),size:$.number().optional(),maxWidth:$.number().optional(),foregroundColor:$.string().optional(),backgroundColor:$.string().optional()}).optional(),marker:$.object({size:$.number().optional(),foregroundColor:$.object({active:$.string().optional(),inactive:$.string().optional()}).optional(),backgroundColor:$.object({active:$.string().optional(),inactive:$.string().optional()}).optional()}).optional()}).optional()});function VK(e,t,r){$.array($.number()).min(2).max(3).parse(e),$.string().parse(t),q7.parse(r||{})}s(VK,"validateLabel");var Jm={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}}},BPe={lightOnDark:{...Jm,text:{...Jm.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Jm.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Jm,text:{...Jm.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Jm.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},$Pe="LOW_PRIORITY",jK=4,jPe=6,GPe=20,UPe=2.5,VPe=2,zPe="cover",HPe=-1/0,GK=6.5,UK={heightAbovePolygon:0,appearance:BPe.darkOnLight};var Zp=class Zp{constructor(t,r,n){h(this,"lines",0);h(this,"id");h(this,"rank");h(this,"type","label");h(this,"initialRank");h(this,"contextConfigured",!1);h(this,"fillText");h(this,"newStyle",{});h(this,"opacity",0);h(this,"visibilityNeedsUpdate",!1);h(this,"text");h(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});h(this,"projection",new _e);h(this,"labelCacheId");h(this,"_cache",{});h(this,"appearance");h(this,"options");h(this,"visible",!0);h(this,"enabled",!0);h(this,"isOccluded",!1);h(this,"offscreen",!1);h(this,"canShow",!1);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"currentStrategyIndex",-1);h(this,"totalMarkerSize",0);h(this,"dirty",!0);h(this,"attachedDirty",!0);h(this,"collisionDirty",!0);h(this,"lastTextAlign");h(this,"imageHash");h(this,"markerSize",0);h(this,"iconVisible",!1);h(this,"dp");h(this,"animate",!0);h(this,"onStrategySelected",s(t=>{if(this.currentStrategyIndex===t)return;let r=this.strategies[t];r&&r.onStrategySelected(this),this.currentStrategyIndex=t;let n=this.style;this.style=this.newStyle,this.newStyle=n},"onStrategySelected"));h(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:_t(),this.options=(0,H7.default)({},r,UK),this.text=t,this.dp=(l=1)=>l*n.pixelRatio,typeof r.rank=="string")this.rank=Dm(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(b.env.NODE_ENV==="test"?Zp.testId:Zp.testId*10)/10;Zp.testId+=.001,this.rank=l,this.initialRank=l}let o=(0,H7.default)({},this.options.appearance,UK.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||Ce(o.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:o.marker.backgroundColor.active,inactive:o.marker.backgroundColor.inactive||Ce(o.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:o.marker.icon,iconSize:o.marker.iconSize||GPe,iconPadding:(a=o.marker.iconPadding)!=null?a:VPe,iconFit:o.marker.iconFit||zPe,iconOverflow:o.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:o.marker.iconVisibleAtZoomLevel==null?HPe:o.marker.iconVisibleAtZoomLevel}}}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(GK),this.totalMarkerSize=Math.ceil((this.markerSize+UPe)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,o=Math.max(jPe,n),i=this.iconVisible?o/2:0,a=this.iconVisible?this.totalMarkerSize:GK,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+jK,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-jK,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:$Pe,getBoundingBox:s(()=>[a/2+i,a/2+i,a/2+i,a/2+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}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(){}};s(Zp,"LabelComponent"),h(Zp,"testId",0);var W7=Zp,ca=W7;d();d();var Q7=class Q7 extends Fe{constructor(r,n){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");h(this,"textSet",new Set);h(this,"batchedTextMap",new Map);h(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var l,c,p;let n,o,i,a=[];for(let f of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(f),(n==null?void 0:n.type)==="text3d"){o=n.components[0],i=n.components[1];let m=(l=o.mesh)==null?void 0:l.parent;if(!m||!(m instanceof lt)||!(o instanceof jc))continue;if("textArea"in o.feature.properties&&o.mesh!=null&&o.polygonEntityId!=null&&o.textMesh==null&&o.mesh.parent!=null&&((p=(c=o.feature.properties)==null?void 0:c.textArea)==null?void 0:p.position)!=null){if(this.textSet.has(o.polygonEntityId))continue;this.textSet.add(o.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,Qm().then(({BatchedText:x})=>{let S=new x;return S.type="batchedtext",m.add(S),S}));let v=this.batchedTextMap.get(m);if(!v)throw new Error("batched text required");a.push(zK({entityId:f,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:v,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(f.toString()))continue;this.textSet.add(f.toString()),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,Qm().then(({BatchedText:x})=>{let S=new x;return S.type="batchedtext",m.add(S),S}));let v=this.batchedTextMap.get(m);if(!v)throw new Error("batched text required");a.push(zK({entityId:f,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:v,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let y=this.batchedTextMap.get(m);o.textMesh&&y&&o.polygonEntityId!=null&&Promise.all([y,Promise.resolve({meshComponent:o,styleComponent:i})]).then(([v,{meshComponent:x,styleComponent:S}])=>{let{textMesh:I}=x;if(v&&I){let P=J7(v,I);x.visible&&!P?v.add(I):!x.visible&&P&&v.remove(I)}S.flipToFaceCamera&&this.flipIfNeeded(x,r)})}return Promise.all(a)}flipIfNeeded(r,n){let o=r.textMesh;if(!o)return!1;let i=o.rotation.z,a=P3(i+n);a>Math.PI/2&&a<3*Math.PI/2&&(o.rotation.z=P3(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 Oi(i.maxWidth,i.maxHeight),l=new ze(a,new $r({color:"pink"})),{textMesh:c}=n;if(!c)continue;let p=this.convertTo3DMapPosition(i.position,Ob);l.position.copy(p),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,Z7.identity(),Z7.makeRotationAxis(new Pe(0,0,1),c.userData.rotationZ),Ob.set(i.maxWidth/2,0,0),Ob.applyMatrix4(Z7),l.position.x-=Ob.x,l.position.y-=Ob.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(Q7,"Text3DSystem");var jI=Q7;function Y7(e){Qm().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}s(Y7,"configureWorker");var Z7=new wi,Ob=new Pe,X7;async function K7(e){let{preloadFont:t}=await Qm();return t(e)}s(K7,"preloadFont");function Qm(){return X7||(X7=import("./text3d-6FT4WNC5.js").then(e=>e)),X7}s(Qm,"getText3DService");async function zK({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:o,rendererState:i,type:a="text-area"}){return Promise.all([Qm(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:l,createTroikaTextArea:c},p])=>a==="text-area"?c(p.entityId,p.meshComponent,p.styleComponent,n):l(p.entityId,p.meshComponent,p.styleComponent,n)).catch(l=>{j.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 p=i.geometry3DMap.get(t.polygonEntityId);if((p==null?void 0:p.type)==="geometry"){let f=p.components[0],m=p.components[1];f.textMesh=l.text,f.mesh!=null&&(l.text.position.z=m.altitude+m.height+WPe)}}else c[2]=Qm().then(({syncText:p})=>p(l.text));return Promise.all(c)}).then(l=>{if(!l)return;let[c,p]=l;p.add(c),t.batchedText||(t.batchedText=p)})}s(zK,"createText");function J7(e,t){return e._members.has(t)}s(J7,"doesBatchedTextContainsText");var WPe=.5;var qPe=$.object({visible:$.boolean(),color:$.string(),flipToFaceCamera:$.boolean(),font:$.string().optional(),fontSize:$.number(),margin:$.union([$.number(),$.tuple([$.number(),$.number(),$.number(),$.number()])]),outlineColor:$.string(),outlineOpacity:$.number(),outlineBlur:$.union([$.number(),$.string()]),outlineWidth:$.number(),outlineOffsetX:$.number(),outlineOffsetY:$.number(),strokeWidth:$.number(),maxWidth:$.number().optional(),maxHeight:$.number().optional(),strokeOpacity:$.number(),strokeColor:$.string(),fillOpacity:$.number(),hoverColor:$.string().optional(),id:$.union([$.string(),$.number()]),type:$.literal("text3d"),position:$.tuple([$.number(),$.number(),$.number()]),content:$.string()}),HK=qPe.partial().omit({id:!0,type:!0}).strict(),WK=HK.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),qK=$.object({appearance:HK.optional(),parentId:$.string().optional()}).strict(),e6=class e6{constructor(t){h(this,"mesh",new _i);h(this,"textMesh");h(this,"type","text3d");h(this,"feature");h(this,"parent");h(this,"batchedText");h(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?J7(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(e6,"Text3DComponent");var jc=e6;d();var t6=class t6{constructor(t){h(this,"color");h(this,"dirty",!0);h(this,"visible",!0);h(this,"edgeColors");h(this,"geometry");h(this,"ranges");h(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(t6,"OutlineComponent");var eh=t6;d();d();d();var r6=class r6 extends d8{constructor(r){let n=r,o=3,i=o*4;super(new Float32Array(r*i),o,r,b0,n8);h(this,"_width");h(this,"_height");h(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 Lt(n[o],n[o+1],n[o+2]),a=new Lt(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(r6,"BatchedPropertiesTexture");var GI=r6;var ZK="#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";var XK="#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 YPe=-.05,KPe=1,n6=class n6 extends Ei{constructor(r,n,o=1){super(r);h(this,"propertiesTexture");h(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});h(this,"colorSpace",wa);h(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 GI(n),this.uniforms.uRepeatYFactor.value=o,this.onBeforeCompile=i=>{let a=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,f=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor,y=this.uniforms.uBlendTexture;this.uniforms=i.uniforms,i.vertexShader=ZK,i.fragmentShader=XK,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:YPe},uMaxSideAlpha:{value:KPe},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:f,uRepeatYFactor:m,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=gs,r.wrapT=gs,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=gs,r.wrapT=gs,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?o8:wa,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(n6,"BatchedStandardMaterial");var Xp=n6;d();function YK(e,t){var l,c,p;let r=0;for(let f of e)r+=((c=(l=f.components[0])==null?void 0:l.geometry)==null?void 0:c.attributes.position.count)||0;let n=new Lt(t.color),o;o=new Xp({color:n,side:t.side==="back"?e8:t.side==="front"?g0:Ta,opacity:(p=t.opacity)!=null?p:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let i=new M0(e.length,r,0,o),a;for(let f of e)a=f.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]=f.id,o instanceof Xp&&o.setColor(a.instanceIndex,n,t.topColor?new Lt(t.topColor):n));return i.perObjectFrustumCulled=!0,i.matrixAutoUpdate=!1,i}s(YK,"batchGeometries");function UI(e){return Ce(e).darken(30).toRgbString()}s(UI,"darkenColorForOutline");function KK(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,p;e.index?(c=e.index.count/3,p=s(function(M,w){return e.index.getX(M*3+w)},"meshIndex")):(c=i.count/3,p=s(function(M,w){return M*3+w},"meshIndex"));let f=new wi;f.makeRotationFromQuaternion(new Jh().setFromEuler(new Ma(0,0,r/180*Math.PI)));let m=t.find(M=>M.face==="top"),y;m&&(y={min:n(m.bounds[1],m.bounds[0],0),max:n(m.bounds[3],m.bounds[2],o.max.z)});let v=t.find(M=>M.face==="side"),x;if(v&&(x={min:n(v.bounds[1],v.bounds[0],0),max:n(v.bounds[3],v.bounds[2],o.max.z)}),!(!x&&!y))for(let M=0;M<c;++M){let w=a.getX(p(M,0))+a.getX(p(M,1))+a.getX(p(M,2)),E=a.getY(p(M,0))+a.getY(p(M,1))+a.getY(p(M,2)),B=a.getZ(p(M,0))+a.getZ(p(M,1))+a.getZ(p(M,2)),D=Math.abs(w),F=Math.abs(E),L=Math.abs(B);var S,I;D<=F&&D<=L?(S="x",F<=L?I="y":I="z"):F<=D&&F<=L?(S="y",D<=L?I="x":I="z"):(S="z",D<=F?I="x":I="y"),S==="z"&&(S=I,I="z");let H,U,G,J,X,ie;if(I==="z"||S==="z"){if(!v||!x)continue;H=v.repeat.u,U=v.repeat.v,G=v.offset.u,J=v.offset.v,X=v.rotation,ie=x}else{if(!m||!y)continue;H=m.repeat.u,U=m.repeat.v,G=m.offset.u,J=m.offset.v,X=(360-r+m.rotation)%360,ie=y}let{min:ee,max:ge}=ie,ve=new Oa;ve.position.set(ee.x,ee.y,0),ve.updateMatrix(),ve.updateMatrixWorld();let pe=ee.clone().applyMatrix4(f),Ae=ge.clone().applyMatrix4(f),yt=Math.abs(Ae.x-pe.x),it=Math.abs(Ae.y-pe.y),Ye=new Pe(yt,it,ge.z).applyMatrix4(ve.matrixWorld),Ve=Math.abs(Ye[S]-ee[S]),de=Math.abs(Ye[I]-ee[I]),he=X*Math.PI/180||0,re=Math.cos(he),se=Math.sin(he),k=ve.matrixWorld.clone().invert(),K=new Jh().setFromEuler(new Ma(0,0,r/180*Math.PI));for(let R=0;R<3;R++){let oe=new Pe(i.getX(p(M,R)),i.getY(p(M,R)),i.getZ(p(M,R))).applyMatrix4(k);oe.applyQuaternion(K);let le=oe.applyMatrix4(ve.matrixWorld),xe=le.x,ur=le.y,Gn=le.z;var P,T;S==="x"?P=H*(xe-ee[S])/Ve+G:S==="y"?P=H*(ur-ee[S])/Ve+G:P=H*(Gn-ee[S])/Ve+G,I==="x"?T=U*(xe-ee[I])/de+J:I==="y"?T=U*(ur-ee[I])/de+J:T=U*(Gn-ee[I])/de+J,P-=.5,T-=.5;let nn=P*re-T*se+.5,In=P*se+T*re+.5;l.setX(p(M,R),nn),l.setY(p(M,R),In)}}}s(KK,"updateUVsLegacy");d();var o6=class o6{constructor(){h(this,"focusMesh");h(this,"dirty",!0)}};s(o6,"FocusableComponent");var th=o6;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 Iu&&e.components[1]===void 0?(e.components[1]=new Zm,e.components[1].dirty=!0):e instanceof wt&&e.components[2]===void 0?(e.components[2]=new Zm,e.components[2].dirty=!0):e instanceof lt&&e.components[1]===void 0&&(e.components[1]=new Zm,e.components[1].dirty=!0),!0):(e instanceof Iu?e.components[1]=void 0:e instanceof wt?e.components[2]=void 0:e instanceof lt&&(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 JK(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=UI(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(JK,"updateGroupColor");function QK(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(QK,"updateGroupShading");function eJ(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(eJ,"updateImageProps");function s6(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(s6,"updateHeight");function a6(e,t){t!==void 0&&(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&(e.components[1].initialColor=t.initialColor),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor),e.components[1].dirty=!0)}s(a6,"updateColor");function l6(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?(e.object3d.position.copy(r(t[1],t[0],t[2]||0)),e.positionDirty=!0):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}s(l6,"updatePosition");function c6(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof lt?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}s(c6,"updateParent");function tJ(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}s(tJ,"updateEnabled");function rJ(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{_7.parse(t.options||{})}catch(o){return j.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))),nJ(e,t.options.rank),!0}}return!1}s(rJ,"updateMarker");function nJ(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Dm(t),!0):!1}s(nJ,"updateRank");function oJ(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&&(c.text=t.text,c.dirty=!0);try{q7.parse(t.options||{})}catch(p){j.error(p);return}((n=t.options)==null?void 0:n.appearance)!==void 0&&Object.keys((o=t.options)==null?void 0:o.appearance).length>0&&(z8(c.appearance,((i=t.options)==null?void 0:i.appearance)||{}),c.dirty=!0),gn(e,(a=t.options)==null?void 0:a.interactive,r),nJ(e,(l=t.options)==null?void 0:l.rank)}}s(oJ,"updateLabel");function iJ(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}s(iJ,"updateHoverColor");function sJ(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(sJ,"updateHovered");function u6(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}s(u6,"updateFlipImageToFaceCamera");function ua(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"){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 D8){let o=t.geometry2DMap.get(n.userData.entityId);if(o){let i=o.components[0];i instanceof ca&&(i.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}s(ua,"updateVisibility");function p6(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 lt&&(n=e.parent.opacity),aJ(e,t,n),!0}}return!1}s(p6,"updateOpacity");function aJ(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 lt&&o.type==="group-container")&&aJ(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(aJ,"cascadeOpacity");function lJ(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(lJ,"updateGroupTexture");function cJ(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),!0}}return!1}s(cJ,"updateIndividualGeometryTexture");function uJ(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(uJ,"updateIndividualGeometryOpacity");function VI(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(VI,"updateAltitude");function zI(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 wt&&zI(o,t,r)}else if(e.type==="geometry"){let n=e.components[3],o=e.components[1];!n&&r===!0?e.components[3]=new eh(o.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}s(zI,"updateOutline");function d6(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 th,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}s(d6,"updateFocusable");function pJ(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(pJ,"updateIndividualGeometryRenderOrder");function dJ(e,t,r){let{visible:n,color:o}=r;if(e.type!=="path")return;let i=e.components[0];n!=null&&ua(e,t,n),o!=null&&a6(e,{color:o}),Object.assign(i,f6(r)),j8(r)||(i.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(i.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(i.dirty=!0))}s(dJ,"handlePathUpdate");function f6(e){return Oo(e,QPe)}s(f6,"pickPathOptions");var QPe=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel"];function fJ(e){if(!(e instanceof wt&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}s(fJ,"assetGeometryIsText3D");var HI=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function mJ(e,t,r){ua(e,t,r.visible);let n=e.components[1],o=Oo(r,HI);"margin"in r&&j.warn("update to margin is not supported atm"),"content"in r&&j.warn("content update is not supported atm");try{WK.parse(o)}catch(i){j.error(i);return}Object.keys(o).length>0&&(Object.assign(n,o),n.dirty=!0)}s(mJ,"handleText3DUpdate");var eTe=["color","material","opacity","verticalOffset","rotation","position","scale"];function hJ(e,t){let r=Oo(t,eTe),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(hJ,"handleModelStyleUpdate");var Yp,pa,WI,Gc,yJ,_b,qI,gJ,bJ,Ab,ZI,kb,Db,XI,m6=class m6{constructor(t){O(this,Gc);O(this,Yp,null);O(this,pa);h(this,"getCurrentSceneGLTF",s(async t=>{let r={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},n=await te(this,Gc,yJ).call(this),o=u(this,WI).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"));O(this,WI,s(t=>{let{scale:r,light:n,onlyVisible:o}=t,i=new Xl,a=new Jr().setFromObject(u(this,pa).entityScene);if(u(this,_b).call(this,u(this,pa).entityScene,i,o),n){let l=new S0(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"));O(this,_b,s((t,r,n)=>{t.material&&(t instanceof v0?te(this,Gc,gJ).call(this,t).forEach(o=>r.add(o)):t instanceof _d&&r.add(te(this,Gc,bJ).call(this,t))),t.children.forEach(o=>{(!n||o.visible)&&u(this,_b).call(this,o,r,n)})},"#processObject3D"));O(this,qI,s((t,r,n)=>{let o=new y8({color:new Lt(t),metalness:0});return o.opacity=r,o.transparent=n,o},"#createStandardMaterial"));O(this,Ab,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,p=r.attributes.normal,f=r.attributes.uv;return u(this,ZI).call(this,c,p),u(this,Db).call(this,o,l,i,a),f&&u(this,XI).call(this,f),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Ta),t},"#convertGeometry"));O(this,ZI,s((t,r)=>{let n=new Pe,o=new Pe;for(let i=0;i<t.count;i++)n.fromBufferAttribute(t,i),u(this,kb).call(this,n),t.setXYZ(i,n.x,n.y,n.z),r&&(o.fromBufferAttribute(r,i),u(this,kb).call(this,o),r.setXYZ(i,o.x,o.y,o.z))},"#convertAttributes"));O(this,kb,s(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));O(this,Db,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 Ma)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"));O(this,XI,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,pa,t),u(this,pa).entityScene=t.entityScene,u(this,pa).geometry3DMap=t.geometry3DMap}destroy(){A(this,Yp,null)}};Yp=new WeakMap,pa=new WeakMap,WI=new WeakMap,Gc=new WeakSet,yJ=s(async function(){if(!u(this,Yp)){let{GLTFExporter:t}=await import("./GLTFExporter-HAEOIORD.js");A(this,Yp,new t)}return u(this,Yp)},"#getGLTFExporter"),_b=new WeakMap,qI=new WeakMap,gJ=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=>u(this,pa).geometry3DMap.get(c)),i=new Map;return o.forEach(c=>{var v;if(!c||!(c instanceof wt))return;let p=c.components[1],f=c.components[2];if(!p.visible||p instanceof Ps&&p.opacity===0||p instanceof ry||p instanceof A0)return;let m=f!=null&&f.hover?p.hoverColor||u(this,pa).hoverColor:p.color,y="".concat(m,"-").concat(p.opacity,"-").concat(Number(p.visible));i.has(y)||i.set(y,[]),(v=i.get(y))==null||v.push(c)}),i.forEach((c,p)=>{let[f,m,y]=p.split("-"),v=c.reduce((P,T)=>{if(T.type==="custom-geometry")return P;let M=T.components[0];return"geometry"in M&&M.geometry instanceof u8&&P.push(M.geometry),P},[]),x=u(this,qI).call(this,f,Number(m),t.material.transparent),S=Wo(v,!0),I=new ze(S,x);I.position.copy(t.position),I.rotation.copy(t.rotation),I.scale.copy(t.scale),I.visible=!!y,u(this,Db).call(this,I.position,I.scale,I.rotation,I.quaternion),r.push(u(this,Ab).call(this,I))}),r},"#processBatchedMesh"),bJ=s(function(t){let r=t.geometry.clone(),n=t.material,o=new $r({color:n.color,side:Ta});o.opacity=n.opacity,o.transparent=n.transparent;let i=new _d(r,o);return i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),i.visible=t.visible,u(this,Ab).call(this,i)},"#processLineSegments"),Ab=new WeakMap,ZI=new WeakMap,kb=new WeakMap,Db=new WeakMap,XI=new WeakMap,s(m6,"ExporterSystem");var Eb=m6;d();d();d();var g6=ys(OJ());function EJ(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}s(EJ,"JSClipperError");EJ.prototype=Error.prototype;g6.default.Error=function(e){throw new EJ(e)};var Xr=g6.default;var qwe="gray",Zwe=.1,Rb=100,b6=new Xr.ClipperOffset;function Xwe(e,t){b6.Clear(),t/=2;let r=e.map(o=>({X:o.x*Rb,Y:o.y*Rb}));b6.AddPath(r,Xr.JoinType.jtMiter,Xr.EndType.etClosedPolygon);let n=new Xr.Paths;return b6.Execute(n,t*Rb),n.length?n.map(i=>i.map(a=>({x:a.X/Rb,y:a.Y/Rb}))):[e]}s(Xwe,"offset");function tS(e,t,r){var y,v,x,S,I;let{color:n=qwe,opacity:o=1,altitude:i=0,height:a=Zwe}=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}},p=e.geometry.coordinates[0].map(P=>{let T=t(P[1],P[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});((v=(y=e.properties)==null?void 0:y.style)==null?void 0:v.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((x=e.properties)==null?void 0:x.image)!=null?p=Xwe(p,((I=(S=e.properties)==null?void 0:S.style)==null?void 0:I.edgeOffset)||0):p=[p];let f=[];for(let P of p){let T=new bs;T.moveTo(P[0].x,P[0].y),P.slice(1).forEach(B=>T.lineTo(B.x,B.y)),T.lineTo(P[0].x,P[0].y);let M=e.geometry.coordinates.slice(1);T.holes=M.map(B=>{let D=B.map(L=>t(L[1],L[0])),F=new Kl;return F.moveTo(D[0].x,D[0].y),D.slice(1).forEach(L=>F.lineTo(L.x,L.y)),F.lineTo(D[0].x,D[0].y),F});let w={bevelEnabled:!1,depth:a},E=new vs(T,w);E.userData={style:{color:n,opacity:o}},f.push(E)}if(f.length===1)return f[0];let m=Wo(f);return m.userData={style:{color:n,opacity:o},_split:!0},m}s(tS,"renderPolygonGeometry");d();var Ywe="gray",Kwe=.1;function rS(e,t,r){let{color:n=Ywe,opacity:o=1,altitude:i=0,height:a=Kwe}=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},p=[];e.geometry.coordinates.forEach(m=>{let y=new bs,v=m[0].map(I=>{let P=t(I[1],I[0]);return l.min.x=Math.min(l.min.x,P.x),l.min.y=Math.min(l.min.y,P.y),l.max.x=Math.max(l.max.x,P.x),l.max.y=Math.max(l.max.y,P.y),P});y.moveTo(v[0].x,v[0].y),v.slice(1).forEach(I=>y.lineTo(I.x,I.y)),y.lineTo(v[0].x,v[0].y);let x=m.slice(1);y.holes=x.map(I=>{let P=I.map(M=>t(M[1],M[0])),T=new Kl;return T.moveTo(P[0].x,P[0].y),P.slice(1).forEach(M=>T.lineTo(M.x,M.y)),T.lineTo(P[0].x,P[0].y),T});let S=new vs(y,c);p.push(S)});let f=Wo(p);return f.translate(0,0,i||0),f.userData={style:{color:n,opacity:o}},f}s(rS,"renderMultiPolygonGeometry");d();var Jwe="gray",v6=new Xr.ClipperOffset,Qn=100;function _J(e,t,r){let{color:n=Jwe,opacity:o=1,width:i=1,join:a="round",cap:l="round",height:c=.01,altitude:p=0}=r||{};Array.isArray(o)&&(o=0);let f=[];for(let S=0;S<e.geometry.coordinates.length-1;S++){let I=t(e.geometry.coordinates[S][1],e.geometry.coordinates[S][0]),P=t(e.geometry.coordinates[S+1][1],e.geometry.coordinates[S+1][0]);f.push([I,P])}v6.AddPaths(f.map(S=>S.map(I=>({X:I.x*Qn,Y:I.y*Qn}))),a==="round"?Xr.JoinType.jsRound:a==="miter"?Xr.JoinType.jsMiter:Xr.JoinType.jsSquare,l==="round"?Xr.EndType.etOpenRound:l==="butt"?Xr.EndType.etOpenButt:Xr.EndType.etOpenSquare);let m=new Xr.PolyTree;v6.Execute(m,i/2*Qn);let y=[],v={bevelEnabled:!1,depth:c};for(let S of m.m_AllPolys){let I=new bs;if(S.IsHole())continue;let P=S.m_polygon;I.moveTo(P[0].X/Qn,P[0].Y/Qn),P.slice(1).forEach(T=>I.lineTo(T.X/Qn,T.Y/Qn)),I.lineTo(P[0].X/Qn,P[0].Y/Qn),I.holes=S.m_Childs.map(T=>{let M=new Kl,w=T.m_polygon;return M.moveTo(w[0].X/Qn,w[0].Y/Qn),w.slice(1).forEach(E=>M.lineTo(E.X/Qn,E.Y/Qn)),M.lineTo(w[0].X/Qn,w[0].Y/Qn),M}),y.push(new vs(I,v))}let x=Wo(y);return x.translate(0,0,p||0),x.userData={style:{color:n,opacity:o}},v6.Clear(),x}s(_J,"renderLineStringGeometry");d();var eo=100,Qwe=.22,eMe=.01;function AJ(e,t,r={}){let{width:n=Qwe,height:o=eMe,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}},p={bevelEnabled:!1,depth:o},f=new Xr.ClipperOffset,m=e.geometry.coordinates.map(S=>S.map(I=>t(I[1],I[0])));f.AddPaths(m.map(S=>S.map(I=>({X:I.x*eo,Y:I.y*eo}))),Xr.JoinType.jsMiter,Xr.EndType.etOpenRound);let y=new Xr.PolyTree;f.Execute(y,n/2*eo);let v=[];for(let S of y.m_AllPolys){let I=new bs;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 P=S.m_polygon;I.moveTo(P[0].X/eo,P[0].Y/eo),P.slice(1).forEach(T=>I.lineTo(T.X/eo,T.Y/eo)),I.lineTo(P[0].X/eo,P[0].Y/eo),I.holes=S.m_Childs.map(T=>{let M=new Kl,w=T.m_polygon;return M.moveTo(w[0].X/eo,w[0].Y/eo),w.slice(1).forEach(E=>M.lineTo(E.X/eo,E.Y/eo)),M.lineTo(w[0].X/eo,w[0].Y/eo),M}),v.push(new vs(I,p))}let x=Wo(v);return x.translate(0,0,l||0),x.userData={style:{color:i,opacity:a}},f.Clear(),x}s(AJ,"renderMultiLineStringGeometry");d();d();var oh=$.object({type:$.enum(["Point"]),coordinates:$.array($.number()).min(2).max(3)});var tMe=$.object({rotation:$.array($.number()).length(3).optional(),altitude:$.number().optional(),scale:$.array($.number()).length(3).optional(),interactive:$.boolean().optional(),verticalOffset:$.number().optional(),id:$.union([$.number(),$.string()]).optional()}),rMe=$.object({type:$.enum(["Feature"]),geometry:oh,properties:tMe}),nMe=$.object({type:$.enum(["FeatureCollection"]),features:$.array(rMe)}),oMe=$.object({color:$.string()}),iMe=$.object({url:$.string(),color:$.string().optional(),opacity:$.number().optional(),material:$.record($.string(),oMe).optional()});function DJ(e,t,r){$.union([$.number(),$.string()]).parse(e),nMe.parse(t),iMe.parse(r)}s(DJ,"validateModelGroup");var Nb,Bb,x6=class x6{constructor(t){h(this,"mesh");h(this,"type","model");h(this,"positionDirty",!0);h(this,"outline");h(this,"geometry");h(this,"material");h(this,"feature");h(this,"instanceIndex",-1);h(this,"visible",!0);h(this,"color",new Lt);h(this,"position",new Pe);O(this,Nb,0);O(this,Bb,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return u(this,Nb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Nb,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(Ke.degToRad(t[0]),Ke.degToRad(t[1]),Ke.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 u(this,Bb)}set opacity(t){var r,n,o;if(this.mesh){if(this.mesh.children[0]instanceof Yl){for(let i of this.mesh.children)if(i instanceof Yl){((r=i.userData)==null?void 0:r.originalOpacity)===void 0&&(i.userData.originalOpacity=i.material.opacity);let a=Ts(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 ze&&i.material&&(Array.isArray(i.material)?i.material.forEach(a=>{kJ(a,t)}):kJ(i.material,t))});A(this,Bb,t)}}};Nb=new WeakMap,Bb=new WeakMap,s(x6,"ModelComponent");var zc=x6;function kJ(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}s(kJ,"updateMaterialOpacity");d();function nS(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 p=sMe(o,n);(l=t.mesh)==null||l.traverse(f=>{f instanceof ze&&f.material&&(Array.isArray(f.material)?f.material.forEach(m=>{p[m.name]?m.color.set(p[m.name].color):m.color.set(o)}):p[f.material.name]?f.material.color.set(p[f.material.name].color):f.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(nS,"applyModelGeometryStyle");function sMe(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(sMe,"consolidateColorAndMaterial");function FJ(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(FJ,"applyModelPosition");function aMe(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(aMe,"generateIndex");var lMe=1e4,I6=class I6 extends Fe{constructor(r,n){super();h(this,"state");h(this,"convertTo3DMapPosition");h(this,"loader");h(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-3AR2NA3D.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,o){var l,c;let i=new yr(n),a=new wt(i,new Ps({...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 eh(UI(o.color))),a.id=r,a}createModelFromFeature(r,n,o){let i=new zc(n),a={...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 A0(a),c=new wt(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 wi,a=new Ma,l=new Jh,c=new Pe,p=new _i,f=await this.getGLTFLoader(),m=new Promise(y=>{f.load(n,v=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?v.scene.traverse(x=>{let S=x;if("isMesh"in S&&S.isMesh===!0){let I=new Yl(S.geometry,S.material,r.size);I.userData={entities:{}},p.add(I),o.add(p)}}):(v.scene.traverse(x=>{"isMesh"in x&&x.isMesh===!0&&(x.position.set(0,0,0),x.rotation.set(0,0,0),x.scale.set(1,1,1),x.updateMatrix())}),p.add(v.scene),o.add(p),p.userData.isSingleModel=!0,p.userData.entityId=r.values().next().value,p.userData.type="model")),y()})});return this.optimizePromise.push(m.then(()=>{var x,S,I,P,T,M,w,E,B,D,F,L;let y=0,v;for(let H of r.values()){if(v=this.state.geometry3DMap.get(H),!v||(v==null?void 0:v.type)!=="model")continue;let U=v.components[0],G=v.components[1],J=v.components[0].feature;U.mesh=p,U.instanceIndex=y,nS(v),v.components[1].dirty=!1;let{x:X,y:ie}=this.convertTo3DMapPosition(J.geometry.coordinates[1],J.geometry.coordinates[0],0);U.position.set(X,ie,U.altitude),a.set(Ke.degToRad((S=(x=G.rotation)==null?void 0:x[0])!=null?S:Bd[0]),Ke.degToRad((P=(I=G.rotation)==null?void 0:I[1])!=null?P:Bd[1]),Ke.degToRad((M=(T=G.rotation)==null?void 0:T[2])!=null?M:Bd[2])),c.set((E=(w=G.scale)==null?void 0:w[0])!=null?E:Nd[0],(D=(B=G.scale)==null?void 0:B[1])!=null?D:Nd[1],(L=(F=G.scale)==null?void 0:F[2])!=null?L:Nd[2]),l.setFromEuler(a),i.compose(U.position,l,c),p.children.forEach(ee=>{!v||(v==null?void 0:v.type)!=="model"||!(ee instanceof Yl)||(ee.setMatrixAt(y,i),ee.userData.entities[y]=v.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")})),p}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=tS(o,this.convertTo3DMapPosition,i),(l=o.properties)!=null&&l.textures&&o.properties.textures.length>0&&KK(n,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,n)):o.geometry.type==="MultiPolygon"?(n=rS(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)):o.geometry.type==="LineString"?(n=_J(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)):o.geometry.type==="MultiLineString"&&(n=AJ(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,n)));return r}optimize(r){var n;if(r.visible&&(r instanceof Sn||r instanceof lt)){for(let a of r.children)this.optimize(a);if(r instanceof lt||r.userData.dirty===!1)return;let o={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(a){j.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 p=l==null?void 0:l.components[0];if((l==null?void 0:l.type)==="geometry"){let f=l.components[1];a++,a>=lMe&&(a=0,i++);let m=aMe(f)+i;o[m]===void 0&&(o[m]={style:f,entities:[]}),o[m].entities.push(l)}else p&&"mesh"in p&&p.mesh&&((n=p.mesh)==null?void 0:n.parent)!==r&&r.add(p.mesh)}for(let c in o){let p=YK(o[c].entities,o[c].style);r.add(p),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 p of l.entities2D.values())p&&(l.attach(p),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(I6,"MeshCreationAndOptimizationSystem");var oS=I6;d();var S6=class S6{constructor(t,r){h(this,"state");h(this,"dirty",!0);h(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 la&&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(S6,"DOMVisibilitySystem");var iS=S6;d();var C6=class C6{constructor(t,r){h(this,"state");h(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 wt)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(C6,"TwoDProjectionSystem");var sS=C6;d();d();var cMe=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")(),LJ=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}=cMe(n);c.font=l;let p=[],f=e.split(" "),m=0,y=0,v=0;for(;y<f.length;){let P=f[y];if(m===o&&m>0){p[m-1]+="...";break}if(p[m]==null&&(p[m]=P,y++),f.length===1){p[m]=P;break}if(f[y]==null)break;let{width:T}=c.measureText(p[m]+" "+f[y]);T<=r*n?(p[m]+=" "+f[y],y++):m++}p.forEach(P=>{let{width:T}=c.measureText(P);v=Math.max(T,v)});let x=t*n*i,S=p.length*x;return{maxWidth:v,maxHeight:S,lines:p.length,draw:s((P,T,M)=>{p.length===1?(a.strokeText&&P.strokeText(p[0],T,M),P.fillText(p[0],T,M)):(a.strokeText&&(P.strokeText(p[0],T,M-x/2),P.strokeText(p[1],T,M+x/2)),P.fillText(p[0],T,M-x/2),P.fillText(p[1],T,M+x/2))},"draw")}},"shaveText");d();function RJ(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(RJ,"createImage");var uMe=3.5,pMe=2.5,dMe=2,fMe=5,$b=2.5;var P6=class P6 extends Fe{constructor(r,n,o){super();h(this,"dirty",!1);h(this,"state");h(this,"colliderContext");h(this,"colliderCanvas");h(this,"transformRequestFunc");h(this,"transformRequest",s(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));h(this,"pinCache",{});h(this,"imageCache",{});h(this,"imagePromiseCache",{});h(this,"imageDimensionsCache",{});h(this,"textCache",{});h(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,p,f;for(let m of this.state.geometry2DIdsInScene)if(f=this.state.geometry2DMap.get(m),f!=null&&(p=f.components[0],p instanceof ca&&!f.disposed)){if(c=p.appearance.marker.iconVisibleAtZoomLevel,p.appearance.marker.icon!=null&&c&&r>=c!==p.iconVisible&&(p.iconVisible=r>=c,p.dirty=!0),(p.dirty||this.dirty)&&p.calculateMarkerSize(),i=p.appearance.marker.foregroundColor,a=p.appearance.marker.backgroundColor,l=kd(p.markerSize,2),o="".concat(i.active,"-").concat(i.inactive,"-").concat(a.active,"-").concat(a.inactive,"-").concat(l,"-").concat(p.iconVisible),p.labelCacheId=o,this.pinCache[o]||this.prepare(p,o,this.colliderContext),p.appearance.marker.icon&&(!p.imageHash||p.dirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.dirty||this.dirty){p.collisionDirty=!0,this.textCache[p.id]={};let{textDrawFn:y,width:v,height:x}=this.processText(p.text,p.appearance.text.size,p.appearance.text.maxWidth,p.appearance.text.numLines,p.appearance.text.lineHeight);["left","center","right"].forEach(I=>{this.textCache[p.id][I]=this.textToCanvas(y,p.appearance.text.size,I,v,x,p.appearance.text.foregroundColor,p.appearance.text.backgroundColor)}),p.dimensions={width:Math.ceil(v/n),height:Math.ceil(x/n)},p.currentStrategyIndex===-1&&(p.currentStrategyIndex=0);let S=p.strategies[p.currentStrategyIndex];if(S){S.onStrategySelected(p);let I=p.style;p.style=p.newStyle,p.newStyle=I}}p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,o,this.colliderContext),p.dirty=!1}this.dirty=!1},"update"));h(this,"processText",s((r,n,o,i,a)=>{let l=this.state.pixelRatio,{draw:c,maxWidth:p,maxHeight:f}=LJ({text:r,size:n,pixelRatio:l,maxWidth:o,maxLines:i,lineHeight:a});return{textDrawFn:c,width:p+$b*l*2,height:f+$b*l*2}},"processText"));h(this,"textToCanvas",s((r,n,o,i,a,l,c)=>{let p=this.state.pixelRatio,f,m=i,y=a;window.OffscreenCanvas!=null&&!$8()?f=new OffscreenCanvas(m,y):(f=document.createElement("canvas"),f.width=m,f.height=y,f.style.width=m+"px",f.style.height=y+"px");let v=f.getContext("2d",{willReadFrequently:!0});if(!v)return;v.textAlign=o,v.font="bold ".concat(n*p,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),v.textBaseline="middle",v.lineJoin="miter",v.miterLimit=2,v.strokeStyle="white",v.lineWidth=$b*p,v.fillStyle=l,v.strokeStyle=c;let x=o==="left"?0:o==="center"?m/2:m-$b*p/2;return r(v,x,(y+$b*p/2)/2),f},"textToCanvas"));h(this,"cacheImage",s(r=>{if(!r.appearance.marker.icon)return;let n=W8(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(o=>{this.transformRequest(r.appearance.marker.icon).then(i=>{let a=RJ(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"));h(this,"createPinCanvas",s((r,n,o,i)=>{let a,l=this.state.pixelRatio,c=r.totalMarkerSize*2*l;window.OffscreenCanvas!=null?a=new OffscreenCanvas(c,c):(a=document.createElement("canvas"),a.width=c,a.height=c,a.style.width=c/l+"px",a.style.height=c/l+"px");let p=a.getContext("2d");return p.shadowColor="rgba(0,0,0,0.3)",p.shadowOffsetY=dMe*l,p.shadowBlur=fMe*l,p.beginPath(),p.arc(c/2,c/2,n/2+pMe*l/2,0,2*Math.PI),p.fillStyle=o,p.fill(),p.beginPath(),p.arc(c/2,c/2,n/2,0,2*Math.PI),p.shadowColor="transparent",p.fillStyle=i,p.fill(),a},"createPinCanvas"));h(this,"prepare",s((r,n,o)=>{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),l=this.createPinCanvas(r,r.iconVisible?r.markerSize:uMe*i,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive);this.pinCache[n]=[a,l]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=o}draw(r,n,o){var p,f;if(!r.canShow||!r.visible)return;o.save(),o.globalAlpha=r.opacity;let i=this.state.pixelRatio,a=r.projection.x*i,l=r.projection.y*i,c=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(o.drawImage(c,a-r.totalMarkerSize*i,l-r.totalMarkerSize*i),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let m=this.imageCache[r.imageHash],y=(r.appearance.marker.iconSize-r.appearance.marker.iconPadding)*i,v=r.appearance.marker.iconFit,x=y,S=y,I="".concat(r.imageHash,"_").concat(v);if(this.imageDimensionsCache[I])x=this.imageDimensionsCache[I].width,S=this.imageDimensionsCache[I].height;else{let P=m.width*i,T=m.height*i;if(v==="contain"){let M=Math.sqrt(P**2+T**2),w=y/M;x=P*w,S=T*w}if(v==="cover"){let M=y/P,w=y/T,E=Math.max(M,w);x=P*E,S=T*E}}o.save(),o.beginPath(),o.arc(a,l,y/2,0,2*Math.PI),o.closePath(),((f=(p=r==null?void 0:r.appearance)==null?void 0:p.marker)==null?void 0:f.iconOverflow)!=="visible"&&o.clip(),o.drawImage(m,a-x/2,l-S/2,x,S),o.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left&&r.style.top&&o.drawImage(this.textCache[r.id][r.style.textAlign],a+r.style.left*i,l+r.style.top*i),o.restore()}};s(P6,"TwoDDrawSystem");var aS=P6;d();d();var Hc=class Hc{constructor(){h(this,"loader");this.loader=new Ad}static getInstance(){return Hc.instance||(Hc.instance=new Hc),Hc.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};s(Hc,"TextureLoaderSingleton"),h(Hc,"instance");var T6=Hc,Wc=T6.getInstance();function mMe(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(mMe,"processColor");var ed,jb,w6=class w6 extends Fe{constructor(r,n){super();O(this,ed);h(this,"state");h(this,"convertTo3DMapPosition");h(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,ed,jb).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&te(this,ed,jb).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,ed,jb).call(this,a.path,r,"topTexture"):a.face==="side"&&r.texture!==a.path&&te(this,ed,jb).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,p,f,m,y;let r,n,o;for(let v of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(v),o instanceof Sn&&o.type==="geometry-group"){let x=o.components[0];if(o.userData.shadingDirty){let S=o.userData.entities3D.values().next().value;if(S==null)continue;let I=this.state.geometry3DMap.get(S);I instanceof wt&&(I.type==="geometry"||I.type==="custom-geometry")&&(r=I.components[0],o.userData.shadingDirty&&x.shading&&this.setShading(r,x.shading));let P,T;for(let M of o.userData.entities3D.values())P=this.state.geometry3DMap.get(M),T=P.components[0],P.type==="geometry"&&T.detached&&o.userData.shadingDirty&&x.shading&&this.setShading(T,x.shading);o.userData.shadingDirty=!1}if(x.dirty){let S=o.getfirstChildEntityId();if(S){let P=this.state.geometry3DMap.get(S),T=P==null?void 0:P.components[0];T instanceof yr&&this.processTextures(T,x)}let I=x.opacity*Su(o);o.getOpacity()!==I&&o.setOpacity(I),x.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 x=o.components[0],S=o.components[1];n=o.components[2];let I=mMe(o,this.state.hoverColor);if(x.setColor(I[0],I[1]),S.visible!==x.visible&&(x.visible=S.visible,x instanceof yr&&x.textMesh)){let T=this.state.geometry3DMap.get(x.textMesh.userData.entityId);(T==null?void 0:T.type)==="text3d"&&T.components[0].polygonEntityId!=null&&(T.components[0].visible=S.visible)}S.altitude!==x.altitude&&(x.altitude=S.altitude);let P=S.opacity*Su(o);P!==x.opacity&&(x.opacity=P),S.renderOrder!==x.renderOrder&&(x.renderOrder=S.renderOrder),S.dirty=!1,x instanceof yr&&this.processTextures(x,S,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(nS(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(FJ(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 x=o.components[1];x.visible!==r.visible&&(r.visible=x.visible),x.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 x=o.components[1];x.visible!=null&&x.visible!==r.visible&&(r.visible=x.visible);let{textMesh:S}=r;if(S){Object.assign(S,x.getState());let I=(p=x.hoverColor)!=null?p:this.state.text3dHoverColor;S.color=x.hoverByPolygon?I:(f=x.color)!=null?f:Rd.color,S.outlineColor=x.hoverByPolygon?I:(m=x.outlineColor)!=null?m:Rd.outlineColor,S.strokeColor=x.hoverByPolygon?I:(y=x.strokeColor)!=null?y:Rd.strokeColor}x.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};ed=new WeakSet,jb=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)=>{Wc.getLoader().load(r,c=>{o==="topTexture"?n.topTexture=c:n.texture=c,n.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{j.error("Failed to load texture: ".concat(r)),l("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,i)}},"#loadTexture"),s(w6,"DrawSystem");var lS=w6;d();var M6=class M6 extends Fe{constructor(r){super();h(this,"state");h(this,"animating",new Map);h(this,"isAnimating",!1);h(this,"startTime",-1);h(this,"showDuration",300);h(this,"hideDuration",250);h(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 ca&&(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"));h(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=Ts(l,0,1,o,i,i===0?q8:Z8),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(M6,"TwoDVisibilitySystem");var cS=M6;d();var O6=class O6 extends Fe{constructor(r,n,o,i,a,l,c){super();h(this,"state");h(this,"renderer");h(this,"mode");h(this,"scene");h(this,"cameraObject");h(this,"viewCamera");h(this,"systems");h(this,"needs2DRecompute",!1);h(this,"twoDdirty",!0);h(this,"threeDdirty",!0);h(this,"frameId",null);h(this,"twoDFrameId",null);h(this,"animationFrameId",null);h(this,"nextFrame",null);h(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"));h(this,"animate2D",s(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));h(this,"drawEntities2D",s(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));h(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"));h(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.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),V8(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(),U8(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){j.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.cameraObject)):this.renderer.render(this.scene,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(O6,"RenderSystem");var uS=O6;d();var hMe=$.object({interactive:$.boolean().optional(),id:$.string().optional(),nearRadius:$.number().optional(),farRadius:$.number().optional(),accentColor:$.string().optional(),displayArrowsOnPath:$.boolean().optional(),animateArrowsOnPath:$.boolean().optional(),nearZoomLevel:$.number().optional(),farZoomLevel:$.number().optional()}),yMe=$.object({type:$.enum(["Feature"]),geometry:oh,properties:$.object({parentId:$.any().optional()})});function NJ(e,t){$.object({features:$.array(yMe)}).parse(e),hMe.parse(t)}s(NJ,"validatePath");var Gb,E6=class E6{constructor(t,r){h(this,"type","path");h(this,"mesh",new _i);h(this,"material");h(this,"geometry");h(this,"outline");h(this,"feature");h(this,"options");h(this,"nearRadius",.2);h(this,"farRadius",.4);h(this,"nearZoomLevel");h(this,"farZoomLevel");h(this,"nearZoomAltitude");h(this,"farZoomAltitude");h(this,"accentColor","blue");h(this,"completeFraction",1);h(this,"altitudeAdjustment",1);h(this,"displayArrowsOnPath",!1);h(this,"animateArrowsOnPath",!1);h(this,"isVertical",!1);h(this,"dirty",!0);h(this,"materialDirty",!0);h(this,"position",new Pe);O(this,Gb,0);var n,o,i,a,l;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}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return u(this,Gb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Gb,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Gb=new WeakMap,s(E6,"PathComponent");var qc=E6;d();var _6=class _6{constructor(t){h(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof lt&&t.components[0]){let n=t.components[0];if(n.dirty){for(let o of t.children)(o instanceof Sn||o instanceof lt)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));n.dirty=!1}}}};s(_6,"StackSystem");var pS=_6;d();d();d();var Ar=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-Ar.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?Ar.Bounce.In(e*2)*.5:Ar.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")}),Ub=s(function(){return performance.now()},"now"),k6=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=Ub()),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}(),ih={Linear:s(function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=ih.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=ih.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=ih.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=ih.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")}},BJ=function(){function e(){}return s(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),A6=new k6,So=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=Ar.Linear.None,this._interpolationFunction=ih.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=BJ.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=A6,A6.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=Ub()),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),p=c?"array":typeof l,f=!c&&Array.isArray(n[a]);if(!(p==="undefined"||p==="function")){if(f){var m=n[a];if(m.length===0)continue;for(var y=[l],v=0,x=m.length;v<x;v+=1){var S=this._handleRelativeValue(l,m[v]);if(isNaN(S)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(S)}f&&(n[a]=y)}if((p==="object"||c)&&l&&!f){r[a]=c?[]:{};var I=l;for(var P in I)r[a][P]=I[P];o[a]=c?[]:{};var m=n[a];if(!this._isDynamic){var T={};for(var P in m)T[P]=m[P];n[a]=m=T}this._setupProperties(I,r[a],m,o[a],i)}else(typeof r[a]>"u"||i)&&(r[a]=l),c||(r[a]*=1),f?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=Ub()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Ub()),!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=Ar.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=ih.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=Ub()),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,p=s(function(){if(n._duration===0||a>c)return 1;var S=Math.trunc(a/l),I=a-S*l,P=Math.min(I/n._duration,1);return P===0&&a===n._duration?1:P},"calculateElapsedPortion"),f=p(),m=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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 v=0,x=this._chainedTweens.length;v<x;v++)this._chainedTweens[v].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]),p=Array.isArray(l),f=!c&&p;f?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 Gvt=BJ.nextId,da=A6,Uvt=da.getAll.bind(da),Vvt=da.removeAll.bind(da),zvt=da.add.bind(da),Hvt=da.remove.bind(da),Wvt=da.update.bind(da);d();d();d();var $J=s((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),jJ=s((e,t)=>new _e(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),D6=s((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),Vb=s((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),F6=s((e,t)=>new _e((e.x+t.x)/2,(e.y+t.y)/2),"average"),L6=s(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var R6=class R6{constructor(t,r){h(this,"input1");h(this,"input2");h(this,"lastAngle");h(this,"lastDistance");h(this,"totalDistance");h(this,"first");h(this,"second");this.input1=t,this.input2=r,this.lastAngle=D6(t,r),this.lastDistance=Vb(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Vb(t,r);this.input1=t,this.input2=r;let o=D6(t,r);this.lastAngle=o,this.lastDistance=n,this.totalDistance+=(Vb(this.first,t)+Vb(this.second,r))/2,this.first=F6(this.first,t),this.second=F6(this.second,r)}};s(R6,"InputSet");var dS=R6;d();var N6=class N6{constructor(t,r,n){h(this,"touch");h(this,"camera");h(this,"cameraPlane");h(this,"viewCoordinate");h(this,"snapHolderMatrix");h(this,"snapCamera");h(this,"cameraPosition");h(this,"raycaster");h(this,"worldCoordinate");h(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 _e(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new xs,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 _e(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(N6,"TouchAnchor");var zb=N6;var Si={};Pa(Si,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>bMe,CLIPPING_RADIUS:()=>Hb,CONTROL_OPTIONS:()=>gMe,DEFAULT_ANIMATION_DURATION:()=>U6,DEFAULT_BEARING:()=>CMe,DEFAULT_MAX_ZOOM_LEVEL:()=>IMe,DEFAULT_MIN_ZOOM_LEVEL:()=>V6,DEFAULT_PITCH:()=>SMe,DEFAULT_ZOOM_LEVEL:()=>xMe,EVENTS:()=>yS,MAPLIBRE_TILE_SIZE:()=>fS,MAX_LAT:()=>$6,MAX_MERCATOR_ZOOM_LEVEL:()=>hS,MIN_LAT:()=>B6,MIN_MERCATOR_ZOOM_LEVEL:()=>mS,ROOM_MERCATOR_ZOOM_LEVEL:()=>vMe,TWO_PI:()=>j6,WHEEL_ZOOM_MULTIPLIER:()=>G6,ZRANGE:()=>sh});d();var fS=512,B6=-85.051129,$6=85.051129,Hb=1e4,gMe={chain:"chain",cancel:"cancel"},j6=Math.PI*2,sh=100,G6=1e4,mS=0,hS=24,bMe=17,vMe=20,U6=200,yS=["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"],xMe=18,V6=12,IMe=22,SMe=0,CMe=0;d();function GJ(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}s(GJ,"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){GJ(t)}):"material"in e&&typeof e.material<"u"&&GJ(e.material)}s(mr,"destroyObject3D");var gS=!1,PMe=!1;var bS,vS=class vS extends Fe{constructor(r,n,o,i,a){super();h(this,"dirty",!1);h(this,"zoomDirty",!1);h(this,"rotationDirty",!1);h(this,"panDirty",!1);O(this,bS,V6);h(this,"zoomSpeed",5);h(this,"rotateSpeed",100);h(this,"enabled",!0);h(this,"enableZoom",!0);h(this,"enablePan",!0);h(this,"enablePedestal",!1);h(this,"maxPedestal",1/0);h(this,"minPedestal",0);h(this,"enableRotate",!0);h(this,"minZoomAltitude",0);h(this,"maxZoomAltitude",1/0);h(this,"ignoreZoomLimits",!1);h(this,"zoomFactor",1);h(this,"panBounds",{min:new Pe(1/0,1/0),max:new Pe(-1/0,-1/0),center:new Pe(0,0,0),radius:1/0});h(this,"minTilt",0);h(this,"maxTilt",1.2);h(this,"MOUSE_BUTTONS",{ORBIT:y0.RIGHT,ZOOM:y0.MIDDLE,PAN:y0.LEFT});h(this,"camera");h(this,"scene");h(this,"renderer");h(this,"elevation");h(this,"orbit");h(this,"cameraPlane");h(this,"raycaster",new xs);h(this,"rendererState");h(this,"options");h(this,"state",-1);h(this,"intersection");h(this,"viewState",null);h(this,"tweens",new Map);h(this,"clock",new b8(!0));h(this,"coords",{mouse:new _e,rotateStart:new _e,rotateEnd:new _e,rotateDelta:new _e,panStart:new Pe,panCameraStart:new Pe,panEnd:new Pe,panDelta:new Pe,initialShiftPos:new _e,initialPedestal:0,floorAnchor:new Pe});h(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});h(this,"scrollTimer",null);h(this,"lastWheelTime",0);h(this,"resetZoom",!1);h(this,"zoomStart");h(this,"pedestalScaleFactor",1);h(this,"isUserZooming",!1);h(this,"stayInsideBounds",!0);h(this,"userInteracting",!1);h(this,"cameraMoving",!1);h(this,"lastCameraMoveTime",Date.now());h(this,"raycastToFloor",s(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new Pe},"raycastToFloor"));h(this,"isUserInteracting",s(()=>this.userInteracting,"isUserInteracting"));h(this,"getPosition",s(()=>new Pe(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));h(this,"getPedestal",s(()=>this.orbit.position.z,"getPedestal"));h(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"));h(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"));h(this,"isCameraMoving",s(()=>this.cameraMoving,"isCameraMoving"));h(this,"lastCameraStoppedMovingTime",s(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));h(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"));h(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"));h(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"));h(this,"zoomIn",s((r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},r,n,o)},"zoomIn"));h(this,"zoomOut",s((r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},r,n,o)},"zoomOut"));h(this,"getRotation",s(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));h(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"));h(this,"animateCamera",s((r,n,o,i,a,l)=>{let c={interruptible:!0,...l},p={},f={},m=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(p.x=m.x,f.x=r.position.x),r.position.y!==void 0&&(p.y=m.y,f.y=r.position.y),r.position.z!==void 0&&(p.z=m.z,f.z=r.position.z)),r.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.zoom=r.zoom:f.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:M,end:w}=T0(this.getRotation(),r.rotation);p.rotation=M,f.rotation=w}r.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.tilt=r.tilt:f.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let y=p.zoom!==f.zoom,v=p.rotation!==f.rotation,x=p.tilt!==f.tilt,S=new So(p).to(f,b.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:v,tilting:x}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,S.state=7,this.publish("multi-start",{zooming:y,rotating:v,tilting:x})),this.publish("change")});this.rendererState.tweenGroup.add(S);let I=Array.from(this.tweens.entries()),P=I[I.length-1],T=!1;return P!=null&&(P[1].interruptible?(typeof P[1].cancelledCallback=="function"&&P[1].cancelledCallback(),this.completeTween(P[0])):(T=!0,P[0].chain(S))),this.tweens.set(S,{cancelledCallback:a,interruptible:c.interruptible}),o?S.easing(o):S.easing(Ar.Quadratic.In),!r.doNotAutoStart&&!T&&(S.start(),this.publish("change")),S.cameraAnimation=!0,S},"animateCamera"));h(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 p=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;p!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>Hb&&(this.camera.near=n-Hb,this.camera.far=n+Hb):(this.camera.near=n/sh,this.camera.far=n*sh),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 p=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;p!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)},"setMulti"));h(this,"getZoomScaledMin",s(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));h(this,"getZoomScaledMax",s(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));h(this,"setRotation",s((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=-(r%j6);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"));h(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/sh,this.camera.far=n*sh,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));h(this,"setZoomLevel",s(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));h(this,"getZoomAltitude",s(()=>this.camera.position.z,"getZoomAltitude"));h(this,"getZoomLevel",s(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));h(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"));h(this,"getTilt",s(()=>this.elevation.rotation.x,"getTilt"));h(this,"setCameraPlaneElevation",s(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));h(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"));h(this,"getProjectionScaleFactor",s((r,n,o)=>T3(r,n,o),"getProjectionScaleFactor"));h(this,"update",s(()=>{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"));h(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"));h(this,"dispose",s(()=>{for(let r of yS)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"));h(this,"createCameraPlane",s(()=>{let r=gS?2e3:1e10,n=gS?100:1,o=new Oi(r,r,n,n),i=new $r({color:0,wireframe:gS,visible:gS}),a=new ze(o,i);return this.scene.add(a),a},"createCameraPlane"));h(this,"addEventListeners",s(()=>{let{domElement:r}=this.renderer;for(let n of yS)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"));h(this,"addMouseEventListeners",s(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));h(this,"addMouseMoveEventListeners",s(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));h(this,"removeMouseMoveEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));h(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"));h(this,"removeMouseUpEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));h(this,"onContextMenu",s(r=>{r.preventDefault()},"onContextMenu"));h(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"));h(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"));h(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 dS(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));h(this,"onTouchMove",s(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n={...this.touch.inputs.first},o={...this.touch.inputs.second},i=new _e(this.touch.touches[0].x,this.touch.touches[0].y),a=new _e(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"));h(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"));h(this,"handleTouchMovePan",s(r=>{let n=Object.hasOwn(r,"x")?new _e(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"));h(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 _e(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 zb(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new zb(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"));h(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"));h(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"));h(this,"handleTouchMovePedestal",s(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));h(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"));h(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"));h(this,"handleTouchEnd",s(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));h(this,"handleTouchStartPan",s(r=>{let n=Object.hasOwn(r,"x")?new _e(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"));h(this,"handleTouchStartPedestal",s(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));h(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"));h(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"));h(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-L6(r)*n/G6*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"));h(this,"setCameraFromTransformMatrix",s(r=>{this.orbit.updateMatrixWorld();let n=new Ma;n.setFromRotationMatrix(r,"ZYX");let o=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),i=n.z,a=new Pe(0,0,1);a.applyEuler(n),a.setLength(o);let l=new Pe;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"));h(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 p=r.viewCoordinate,f=n.viewCoordinate,m=a.x-i.x,y=a.y-i.y,v=Math.atan2(y,m),x=c.x-l.x,S=c.y-l.y,I=Math.atan2(S,x),P=$J(v,I),T=new wi;T.makeRotationZ(-P);let M=T.clone();M.multiply(r.snapHolderMatrix);let w=s((jee,Gee,Uee)=>jee.elements[(Gee-1)*4+Uee-1],"m"),E=w(o,1,1)*w(M,1,1)-p.x*w(o,3,4)*w(M,3,1),B=w(o,1,1)*w(M,1,2)-p.x*w(o,3,4)*w(M,3,2),D=w(o,1,1)*w(M,1,3)-p.x*w(o,3,4)*w(M,3,3),F=i.x*E+i.y*B+i.z*D,L=w(o,2,2)*w(M,2,1)-p.y*w(o,3,4)*w(M,3,1),H=w(o,2,2)*w(M,2,2)-p.y*w(o,3,4)*w(M,3,2),U=w(o,2,2)*w(M,2,3)-p.y*w(o,3,4)*w(M,3,3),G=i.x*L+i.y*H+i.z*U,J=w(o,1,1)*w(M,1,1)-f.x*w(o,3,4)*w(M,3,1),X=w(o,1,1)*w(M,1,2)-f.x*w(o,3,4)*w(M,3,2),ie=w(o,1,1)*w(M,1,3)-f.x*w(o,3,4)*w(M,3,3),ee=a.x*J+a.y*X+a.z*ie,ge=w(o,2,2)*w(M,2,1)-f.y*w(o,3,4)*w(M,3,1),ve=w(o,2,2)*w(M,2,2)-f.y*w(o,3,4)*w(M,3,2),pe=w(o,2,2)*w(M,2,3)-f.y*w(o,3,4)*w(M,3,3),Ae=a.x*ge+a.y*ve+a.z*pe,yt=Math.abs(J-E),it=Math.abs(X-B),Ye=Math.abs(ie-D),Ve=Math.abs(J-L),de=Math.abs(X-H),he=Math.abs(ie-U),re=Math.abs(ge-E),se=Math.abs(ve-B),k=Math.abs(pe-D),K=Math.abs(ge-L),R=Math.abs(ve-H),ce=Math.abs(pe-U),oe=Math.min(yt+it+Ye,Ve+de+he),le=Math.min(re+se+k,K+R+ce);oe<le&&(J=ge,X=ve,ie=pe,ee=Ae);let xe=L*D-E*U,ur=H*D-B*U,Gn=G*D-F*U,nn=J*U-L*ie,In=X*U-H*ie,yu=ee*U-G*ie,d3=(yu*ur-Gn*In)/(nn*ur-xe*In),f3=(yu*xe-Gn*nn)/(In*xe-ur*nn),Z9=H*E-B*L,Nee=U*E-D*L,Bee=G*E-F*L,X9=X*L-H*J,$ee=ie*L-U*J,Y9=((ee*L-G*J)*Z9-Bee*X9)/($ee*Z9-Nee*X9),h0=M.clone();return h0.elements[12]=d3,h0.elements[13]=f3,h0.elements[14]=Y9,Y9>0?h0:null},"makeTransformFromTouchAnchors"));h(this,"updateTouchOrigin",s(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));h(this,"touchToScene",s(r=>{this.touch.touches=[];for(let n=0,o=r.touches.length;n<o;n++){let i=r.touches[n],a=jJ(i,this.touch.origin);this.touch.touches.push(new _e(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"));h(this,"canScrollZoom",s(r=>{let n=L6(r),o=this.getZoomAltitude();return!(n<0&&o===this.getZoomScaledMax()||n>0&&o===this.getZoomScaledMin())},"canScrollZoom"));h(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"));h(this,"getMousePos",s(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));h(this,"handleMouseDownRotate",s(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));h(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"));h(this,"handleMouseDownPedestal",s(r=>{let n=new _e(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=T3(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));h(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"));h(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"));h(this,"publishUserZoomDebounced",Ld(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));h(this,"publishUserZoomEvent",s(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));h(this,"setCameraMoving",s(()=>{this.cameraMoving=!0},"setCameraMoving"));h(this,"unsetCameraMoving",s(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));h(this,"setUserInteracting",s(()=>{this.userInteracting=!0},"setUserInteracting"));h(this,"unsetUserInteracting",s(()=>{this.userInteracting=!1},"unsetUserInteracting"));h(this,"publishPedestalChangeEvent",s(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));h(this,"convertAltitudeToZoomLevel",s(r=>{let[,n]=this.center,i=r*2*Math.tan(Ke.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(Ke.degToRad(n))*2*Math.PI*m3/i;return Ke.clamp(Math.log2(a/512),mS,hS)},"convertAltitudeToZoomLevel"));h(this,"convertZoomLevelToAltitude",s(r=>{let[,n]=this.center,o=Ke.clamp(r,mS,hS),i=Math.pow(2,o),a=Ke.clamp(n,B6,$6),l=i*512;return Math.cos(Ke.degToRad(a))*Math.PI*2*m3/l*this.options.canvasHeight/2/Math.tan(Ke.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));h(this,"completeTween",s(r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));h(this,"debugContainer",new Oa);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 u(this,bS)}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}=O0((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,p;let{x:o,y:i}=E0((l=(a=this.rendererState.center)==null?void 0:a[1])!=null?l:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p: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(),p=this.getTilt(),f=this.getPosition();this.setRotation(n.rotation||c,!0),this.setTilt(n.tilt||p,!0);let m=UJ(r,{canvasWidth:a,canvasHeight:l,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:o,maxZoom:i,position:f,camera:this.camera,orbit:this.orbit});return this.setRotation(c,!0),this.setTilt(p,!0),{center:m.position,zoomLevel:this.convertAltitudeToZoomLevel(m.zoom)}}focusOn(r,n){if(PMe){this.debugContainer&&mr(this.debugContainer);let I=new Mi(4,4,4),P=new $r({color:65280,depthTest:!1}),T=new Yl(I,P,r.length),M=new wi;r.forEach((w,E)=>{M.setPosition(w),T.setMatrixAt(E,M)}),T.instanceMatrix.needsUpdate=!0,this.debugContainer.add(T),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,p=this.options.canvasWidth,f=this.options.canvasHeight,m;n.duration!==void 0?m=n.duration:b.env.TESTING==="true"?m=0:m=U6;let y=n.padding,v=this.getRotation(),x=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let S=UJ(r,{canvasHeight:f,paddingOption:y,canvasWidth:p,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(v),this.setTilt(x),this.animateCamera({position:S.position,tilt:n.tilt,rotation:n.rotation,zoom:S.zoom},m,o,i,a,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};bS=new WeakMap,s(vS,"CameraSystem"),h(vS,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var ah=vS;function UJ(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:o=0,canvasHeight:i,minZoom:a,maxZoom:l,camera:c,position:p}){let f={zoom:a,position:p};if(e.length===0)return f;for(let xe of ah.CAMERA_FRAME_PADDING_SIDES)typeof n[xe]!="number"&&(n[xe]=0);let m=n.type==="portion"?{top:n.top*i,bottom:n.bottom*i,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(m.left+m.right>=t||m.top+m.bottom>=i)return f;r.updateMatrixWorld();let y=c.matrixWorldInverse,v=c.fov*(Math.PI/180)/2,x=v,I=Math.atan(Math.tan(v)*(t/i)),P=new Pe(1/0,1/0,1/0),T=new Pe(-1/0,-1/0,-1/0),M=new Jr,w=new Pe;for(let xe=0,ur=e.length;xe<ur;xe++)w.copy(e[xe]),M.expandByPoint(w),w.applyMatrix4(y),P.min(w),T.max(w),w.copy(e[xe]),w.z-=o,w.applyMatrix4(y),P.min(w),T.max(w),w.copy(e[xe]),w.z+=o,w.applyMatrix4(y),P.min(w),T.max(w);let E=T.x-P.x,B=T.y-P.y,D=t-m.left-m.right,F=i-m.top-m.bottom,L=(T.x+P.x)/2,H=(T.y+P.y)/2,U=E/D,G=B/F,J=a,X=l,ie=J*Math.tan(I)*2,ee=X*Math.tan(I)*2,ge=ie/t,ve=ee/t,pe=Math.max(U,G);pe=Ke.clamp(pe,ge,ve);let Ae=D*pe,yt=F*pe,it={min:{x:L-Ae/2-m.left*pe,y:H-yt/2-m.bottom*pe},max:{x:L+Ae/2+m.right*pe,y:H+yt/2+m.top*pe}},Ye=(it.min.x+it.max.x)/2,Ve=(it.min.y+it.max.y)/2,de=M.getCenter(new Pe),he=Math.abs(Ye-it.min.x),re=Math.abs(Ve-it.min.y),se=he/Math.tan(I),k=re/Math.tan(x),K=new Pe;K.set(Ye,Ve,T.z+Math.max(se,k)),K.applyMatrix4(c.matrixWorld);let R=new Pe;R.set(Ye,Ve,T.z),R.applyMatrix4(c.matrixWorld);let ce=new Pe().subVectors(R,K),oe=(de.z-K.z)/ce.z,le=new Pe().copy(K).add(ce.clone().multiplyScalar(oe));return R.set(le.x,le.y,le.z),K.sub(R),{position:le,zoom:K.length()}}s(UJ,"getCameraFrameForPoints");d();var TMe=300,Wb,qb,z6=class z6{constructor(t){h(this,"state");O(this,Wb,new Pe);O(this,qb,new Pe);this.state=t}update(t){var o;let r,n;this.state.cameraObject.getWorldPosition(u(this,qb));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(u(this,Wb));let a=u(this,qb).distanceTo(u(this,Wb));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:TMe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Wb=new WeakMap,qb=new WeakMap,s(z6,"DOMDrawSystem");var xS=z6;d();var H6=class H6{constructor(){h(this,"percentExpanded",0);h(this,"activeId","");h(this,"gap",20);h(this,"dirty",!0)}};s(H6,"StackComponent");var IS=H6;d();var W6=class W6 extends Fe{constructor(r,n){super();h(this,"state");h(this,"dirty",!0);h(this,"domTree");h(this,"observers",new Map);h(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 la&&(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(W6,"DOMResizeSystem");var SS=W6;d();var wMe=0,MMe=90,OMe=(b.env.NODE_ENV==="test",!1),Ol={linear:Ar.Linear.None,"ease-in":Ar.Quadratic.In,"ease-out":Ar.Quadratic.Out,"ease-in-out":Ar.Quadratic.InOut},EMe=-50,Te,Be,Zc,Zb,Xb,Z6,X6=class X6{constructor(t,r,n){O(this,Xb);O(this,Te);O(this,Be);O(this,Zc);O(this,Zb);A(this,Te,t),A(this,Be,r),A(this,Zc,n),u(this,Be).cameraSystem.on("pedestal-change",({pedestal:o})=>{u(this,Te).map&&(u(this,Te).map.transform.elevation=o,u(this,Te).map.transform.minElevationForCurrentTile=EMe,u(this,Te).map.triggerRepaint()),u(this,Be).cameraSystem.setCameraPlaneElevation(o)})}get center(){return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?u(this,Te).map.getCenter().toArray():u(this,Be).cameraSystem.center}setCenter(t){var r;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map){(r=u(this,Te).map)==null||r.setCenter(t),u(this,Be).interactionSystem.handleHover();return}u(this,Be).cameraSystem.setCenter(t[0],t[1]),u(this,Be).interactionSystem.handleHover()}get zoomLevel(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getZoom():u(this,Be).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map&&((r=u(this,Te).map)==null||r.setZoom(t)),u(this,Be).cameraSystem.setZoomLevel(Is(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 u(this,Be).cameraSystem.isAnimating}cancelAnimation(){u(this,Be).cameraSystem.cancelAnimation()}get maxZoomLevel(){return u(this,Be).cameraSystem.maxZoomLevel}get minZoomLevel(){return u(this,Be).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){u(this,Be).panBoundsSystem.autoMinZoomLevel=t,t&&(u(this,Be).panBoundsSystem.dirty=!0,u(this,Be).panBoundsSystem.update())}get autoMinZoomLevel(){return u(this,Be).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var o;r&&this.setAutoMinZoomLevel(!1);let n=Is(t,Si.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Si.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));u(this,Be).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(o=u(this,Te).map)==null||o.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=Is(t,this.minZoomLevel,Si.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Si.MAX_MERCATOR_ZOOM_LEVEL,"."));u(this,Be).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=u(this,Te).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getMaxPitch():Ke.radToDeg(u(this,Be).cameraSystem.maxTilt)}get minPitch(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getMinPitch():Ke.radToDeg(u(this,Be).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(wMe,t);(n=u(this,Te).map)==null||n.setMinPitch(r),u(this,Be).cameraSystem.minTilt=Ke.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(MMe,t);(n=u(this,Te).map)==null||n.setMaxPitch(r),u(this,Be).cameraSystem.maxTilt=Ke.degToRad(r)}get bearing(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getBearing():Ke.radToDeg(u(this,Be).cameraSystem.getRotation())}setBearing(t){var r;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map){(r=u(this,Te).map)==null||r.setBearing(t);return}u(this,Be).cameraSystem.setRotation(Ke.degToRad(t))}get pitch(){var t;return u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(t=u(this,Te).map)==null?void 0:t.getPitch():Ke.radToDeg(u(this,Be).cameraSystem.getTilt())}setPitch(t){var r;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map){(r=u(this,Te).map)==null||r.setPitch(t);return}u(this,Be).cameraSystem.setTilt(Ke.degToRad(Is(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 u(this,Be).cameraSystem.getPedestal()}setElevation(t){u(this,Be).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return u(this,Zb)&&u(this,Zb).stop(),new Promise(n=>{var i;let o=u(this,Be).cameraSystem.getPosition();o.z=t,u(this,Be).cameraSystem.animateCamera({position:o},(r==null?void 0:r.duration)||300,Ol[(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 u(this,Zc).insetsPadding}get panMode(){return u(this,Be).cameraSystem.enablePan===!1&&u(this,Be).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(u(this,Be).cameraSystem.enablePan=!0,u(this,Be).cameraSystem.enablePedestal=!1):(u(this,Be).cameraSystem.enablePan=!1,u(this,Be).cameraSystem.enablePedestal=!0))}setInsetPadding(t){u(this,Zc).insetsPadding=Object.assign({},ey,t)}animateTo(t){var a,l,c,p,f,m;if(u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map)return(m=u(this,Te).map)==null||m.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:(p=t.pitch)!=null?p:this.pitch,duration:(f=t.duration)!=null?f:600}),Promise.resolve();let r=t.center?u(this,Te).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?u(this,Be).cameraSystem.convertZoomLevelToAltitude(Is(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?Ke.degToRad(t.bearing):void 0,i=t.pitch!==void 0?Ke.degToRad(Is(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 v;u(this,Be).cameraSystem.animateCamera({position:r,zoom:n,rotation:o,tilt:i},t.duration||0,Ol[t.easing||"ease-in-out"],()=>{u(this,Be).interactionSystem.handleHover(),y()},y,{interruptible:(v=t==null?void 0:t.interruptible)!=null?v:!0})})}getCameraFrameForCoordinates(t,r){let n=te(this,Xb,Z6).call(this,r||{},()=>Promise.resolve()),{pointCloud:o}=VJ(t,u(this,Te),u(this,Zc).geometry3DMap);if(o.length===0)return j.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:a}=u(this,Be).cameraSystem.getCameraFrameForCoordinates(o,n);return{center:u(this,Te).convert3DMapPositionToCoordinate(i),zoomLevel:a}}focusOn(t,r){var a,l,c,p;let{pointCloud:n,geoBounds:o,firstPosition:i}=VJ(t,u(this,Te),u(this,Zc).geometry3DMap);return n.length===0?(j.error("No valid coordinates found in targets:",t),Promise.resolve()):u(this,Te).mode==="outdoors-overlay"&&u(this,Te).map?(n.length===1&&i?(a=u(this,Te).map)==null||a.flyTo({center:[i[0],i[1]],duration:(r==null?void 0:r.duration)||u(this,Te).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?u(this,Te).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?u(this,Te).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||u(this,Te).map.getMaxZoom()}):(OMe&&_Me(u(this,Te),o),(p=u(this,Te).map)==null||p.fitBounds(o,{duration:(l=r==null?void 0:r.duration)!=null?l:Si.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?u(this,Te).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?u(this,Te).map.getPitch():r==null?void 0:r.pitch,maxZoom:(c=r==null?void 0:r.maxZoomLevel)!=null?c:u(this,Te).map.getMaxZoom()})),u(this,Be).interactionSystem.handleHover(),Promise.resolve()):new Promise(f=>{u(this,Be).cameraSystem.focusOn(n,te(this,Xb,Z6).call(this,r||{},f))})}};Te=new WeakMap,Be=new WeakMap,Zc=new WeakMap,Zb=new WeakMap,Xb=new WeakSet,Z6=s(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:u(this,Be).cameraSystem.convertZoomLevelToAltitude(Is(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:u(this,Be).cameraSystem.convertZoomLevelToAltitude(Is(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({},ey,t==null?void 0:t.padding):this.insetsPadding,curve:Ol[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Ke.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Ke.degToRad(Is(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(()=>{u(this,Be).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(X6,"Camera");var CS=X6;function q6(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(q6,"updateBounds");function VJ(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 p=r.get(c);if(!p){j.error("Entity not found with id:",c);continue}let f=new Jr;B8(t,"userData"in p&&(l=p.userData.entityId)!=null?l:p.id,n,f,p instanceof lt?p.position.z:void 0);let m=t.convert3DMapPositionToCoordinate(f.min),y=t.convert3DMapPositionToCoordinate(f.max);q6(o,m),q6(o,y),i||(i=t.convert3DMapPositionToCoordinate(f.getCenter(new Pe)))}else n.push(t.convertTo3DMapPosition(c[1],c[0],c[2]||0)),q6(o,c),i||(i=c);return{pointCloud:n,geoBounds:o,firstPosition:i}}s(VJ,"processTargets");function _Me(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(_Me,"drawBounds");d();var zJ="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}";var HJ="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}";d();var WJ=4.291666666666667,qJ=15,ZJ=25,XJ=43/60;d();var YJ=["horizontal","icon"],DMe=new Map([[YJ[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>'],[YJ[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>']]),FMe=/<svg([^>]*)>/g;function KJ(e,t,r,n){let o=DMe.get(e);return o?o.replace(FMe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}s(KJ,"getLogoIcon");var JJ=!1,Ht,El,lh,Nn,to,td,is,fa,Y6=class Y6 extends Fe{constructor(r,n,o){super();O(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});O(this,El);O(this,lh);O(this,Nn);O(this,to);O(this,td);O(this,is,0);O(this,fa,0);h(this,"dirty",!0);h(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}})[u(this,Ht).position],"getPositionAlignedCanvasCoordinates"));h(this,"getPositionAlignedPadding",s(()=>{var o,i,a,l;let r=u(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}}[u(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&&(u(this,Ht)[i]=a)}),A(this,lh,r),A(this,El,n)}get color(){return u(this,Ht).color==="light"?"white":"#293136"}get iconName(){return u(this,Ht).iconOnly?"icon":"horizontal"}get minWidth(){return u(this,Ht).iconOnly?qJ:75}get defaultWidth(){return u(this,Ht).iconOnly?ZJ:150}get aspectRatio(){return u(this,Ht).iconOnly?XJ:WJ}get options(){return{...u(this,Ht)}}set options(r){var n;A(this,Ht,{padding:r.padding||u(this,Ht).padding,position:r.position||u(this,Ht).position,iconOnly:r.iconOnly||u(this,Ht).iconOnly,color:r.color||u(this,Ht).color,scale:r.scale||u(this,Ht).scale,onClick:u(this,Ht).onClick,interactive:(n=r.interactive)!=null?n:u(this,Ht).interactive,visible:r.visible||u(this,Ht).visible})}get icon(){return KJ(this.iconName,this.color,u(this,is)*u(this,El).pixelRatio,u(this,fa)*u(this,El).pixelRatio)}setSize(r,n){u(this,to)&&(u(this,to).uniforms.uSize.value.x=r,u(this,to).uniforms.uSize.value.y=n)}setXY(r,n){u(this,to)&&(u(this,to).uniforms.uSize.value.w=r,u(this,to).uniforms.uSize.value.z=n)}get width(){return u(this,is)}get height(){return u(this,fa)}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)}}[u(this,Ht).position]}insertIntoQuadTree(r){u(this,td)!=null&&typeof u(this,Ht).onClick=="function"&&u(this,Ht).interactive&&r.insert(u(this,td))}resize(r,n){if(u(this,Ht).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(r,n),i=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(u(this,is),u(this,fa)),l=Math.min(r-u(this,is),Math.max(0,o.x+i.x+a.x)),c=Math.min(n-u(this,fa),Math.max(0,o.y+i.y+a.y));this.setSize(u(this,is)/r,u(this,fa)/n),this.setXY(l/r,c/n),A(this,td,new qr(l,c,u(this,is),u(this,fa),{entityId:"watermark"}))}update(){this.dirty&&u(this,Ht).visible===!0&&(A(this,is,Math.min(u(this,El).canvasWidth,Math.max(this.minWidth,this.defaultWidth*u(this,Ht).scale))),A(this,fa,u(this,is)/this.aspectRatio),Wc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(A(this,to,new gu({uniforms:{uTexture:{value:r},uSize:{value:new a8(0,0,0,0)},uOpacity:{value:.7}},vertexShader:zJ,fragmentShader:HJ,depthWrite:!1,depthTest:!1,defines:{debug:JJ},wireframe:JJ,transparent:!0,visible:!0})),u(this,Nn))u(this,Nn).material=u(this,to),u(this,Nn).material.needsUpdate=!0;else{let n=new Oi(2,2,1,1);A(this,Nn,new ze(n,u(this,to))),u(this,Nn).position.set(0,0,-1),u(this,Nn).frustumCulled=!1,u(this,Nn).renderOrder=999;let o=new Mi(1,1,1),i=new ze(o,new $r({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),u(this,Nn).add(i),u(this,lh).add(u(this,Nn))}this.resize(u(this,El).canvasWidth,u(this,El).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){u(this,Nn)&&(u(this,lh).remove(u(this,Nn)),mr(u(this,Nn))),A(this,Nn,void 0),u(this,to)&&u(this,to).dispose(),A(this,to,void 0),A(this,td,void 0)}};Ht=new WeakMap,El=new WeakMap,lh=new WeakMap,Nn=new WeakMap,to=new WeakMap,td=new WeakMap,is=new WeakMap,fa=new WeakMap,s(Y6,"WatermarkSystem");var PS=Y6;d();var TS=100,NMe=!1,K6=class K6 extends Fe{constructor(r,n){super();h(this,"currentTotalBoundingBox");h(this,"state");h(this,"cameraSystem");h(this,"debugMesh",null);h(this,"dirty",!0);h(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 Pe(0,0,0),new Pe(TS*2,TS*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(TS)));let r=new Jr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new Pe),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=wS.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,TS)).getBoundingSphere(BMe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new Pe),min:wS.min,max:wS.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,NMe&&this.state.entityScene.parent instanceof Xl){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Oa,this.debugMesh.add(new ze(new I0(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 Pe;wS.getSize(a);let l=new Mi(a.x,a.y,a.z),c=new $r({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new ze(l,c);p.position.copy(this.currentTotalBoundingBox.getCenter(new Pe)),this.debugMesh.add(p)}}}};s(K6,"PanBoundsSystem");var MS=K6,wS=new Jr,BMe=new c8;d();var QJ="\xA9 Mappedin",$Me="https://info.mappedin.com/feedback",Q6=["top-left","top-right","bottom-left","bottom-right"],jMe=640,GMe=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"),J6={custom:[],position:"bottom-right",feedback:!0},eE=class eE{constructor(t){h(this,"controlContainerEl");h(this,"controlPositions");h(this,"compact");h(this,"attribContainerEl");h(this,"attribInnerEl");h(this,"attribButtonEl");h(this,"feedbackLinkEl");h(this,"attribHTML",QJ);h(this,"customAttributions",[]);h(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=Q6.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=J6){var o;let r=t.position&&Q6.includes(t.position)?t.position:J6.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=GMe(),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:J6.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=$Me,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=[QJ],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<=jMe||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(eE,"HTMLControlsSystem");var OS=eE;d();var Yb,tE=class tE{constructor(t,r){h(this,"mesh");h(this,"type","custom-geometry");h(this,"dirty",!0);h(this,"feature");h(this,"builder");h(this,"outline");h(this,"color",new Lt);O(this,Yb,0);this.mesh=new _i,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){j.warn("TODO: implement custom geometry opacity")}get opacity(){return j.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return u(this,Yb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,A(this,Yb,t))}get renderOrder(){return j.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){j.warn("TODO: implement custom geometry render order")}};Yb=new WeakMap,s(tE,"CustomGeometryComponent");var ch=tE;d();var rE=class rE{constructor(t,r){h(this,"state");h(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(rE,"CustomGeometrySystem");var ES=rE;d();d();function eQ(e){return e.children.some(t=>t.userData.isOutline)}s(eQ,"hasOutline");var zMe=80,rd,uh,AS,kS,nE=class nE{constructor(t){h(this,"rendererState");h(this,"outlineOpacitiesDirty",!0);O(this,rd,!0);O(this,uh,-1/0);O(this,AS,new Map);O(this,kS,new y3({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:g0}));this.rendererState=t}get geometries3DDirty(){return u(this,rd)}set geometries3DDirty(t){A(this,rd,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),n instanceof Sn&&n.components[0].outline&&n.visible&&!eQ(n)&&n.userData.entities3D.size>0)for(let a of n.userData.entities3D.values()){let l=this.rendererState.geometry3DMap.get(a),c=[];if(l instanceof wt&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].geometry!=null&&l.components[0].material!=null){let S=l.components[0].geometry;if(!S)return null;c.push([l.components[3],new g3(S,zMe)])}let p=Wo(c.map(S=>S[1]),!1);if(p==null)continue;let f=p.getAttribute("position"),m=new Float32Array(f.count*4),y=new Ea(m,4);p.setAttribute("color",y);let v=0;for(let S=0;S<c.length;S++){let[I,P]=c[S],T=P.getAttribute("position").count;I.edgeColors=y,I.geometry=p,I.ranges={count:T,start:v},v+=T,P.dispose()}let x=new _d(p,u(this,kS));x.userData.isOutline=!0,n.add(x)}A(this,rd,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof wt&&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 p=c.edgeColors;if(!p)continue;let f=new Lt(c.color);for(let S=0;S<c.ranges.count;S++){let I=c.ranges.start+S;p.setXYZ(I,f.r,f.g,f.b)}let m=a.components[1].height,v=l.getAttribute("position").array,x=-1/0;for(let S=0;S<c.ranges.count;S++){let P=(c.ranges.start+S)*3,T=v[P+2];x=Math.max(x,T)}for(let S=0;S<c.ranges.count;S++){let P=(c.ranges.start+S)*3,T=v[P+2];Math.abs(T-x)<1e-4&&(v[P+2]=Math.max(m,2e-4))}l.attributes.color.needsUpdate=!0,l.attributes.position.needsUpdate=!0,c.dirty=!1}}let o=r?Ts(t,16,19,0,1):u(this,uh);if((o!==u(this,uh)||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*Su(n):0);if(a.currentOpacity!==c){for(let p=0;p<a.ranges.count;p++){let f=a.ranges.start+p;a.edgeColors.setW(f,c)}a.geometry.attributes.color.needsUpdate=!0}}}}A(this,uh,o),A(this,rd,!1),this.outlineOpacitiesDirty=!1}destroy(){u(this,AS).clear()}};rd=new WeakMap,uh=new WeakMap,AS=new WeakMap,kS=new WeakMap,s(nE,"OutlineInterpolationSystem");var _S=nE;d();d();var oE=class oE extends ze{constructor(){super(...arguments);h(this,"userData",{entityId:""})}};s(oE,"EntityMesh");var DS=oE,HMe=$.object({flipImageToFaceCamera:$.boolean().optional(),url:$.string()}),WMe=$.object({type:$.enum(["Feature"]),properties:$.object({width:$.number(),height:$.number(),rotation:$.number().min(0).max(360).optional(),verticalOffset:$.number().optional()}),geometry:oh});function tQ(e,t,r){$.union([$.number(),$.string()]).parse(e),WMe.parse(t),HMe.parse(r)}s(tQ,"validateImage");var iE=class iE{constructor(t){h(this,"mesh",new _i);h(this,"imageMesh");h(this,"outline");h(this,"type","image");h(this,"instanceIndex",-1);h(this,"geometry");h(this,"material");h(this,"feature");h(this,"position",new Pe);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(iE,"ImageComponent");var FS=iE;d();function sE(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(sE,"rotatePoint");function qMe(e,t){return e.map(r=>sE(r,t))}s(qMe,"rotatePoints");function ZMe(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(ZMe,"getBounds");function XMe(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(XMe,"pointInPolygon");function rQ(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(rQ,"isValidRectangle");function YMe(e,t,r){let n=e.maxX-e.minX,o=e.maxY-e.minY,i,a,l={...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(YMe,"calculateGridDimensions");function KMe(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};XMe(c,e)&&(i[a][l]=1)}return i}s(KMe,"createAndFillGrid");function JMe(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)&&rQ(e,o,n,a,a);a++)i=a;r[n][o]=i}return r}s(JMe,"calculateRectSizes");function QMe(e,t,r,n,o,i){let a=0,l=0,c=0;for(let p=0;p<n;p++)for(let f=0;f<n;f++)if(e[p][f]===1){let m=Math.pow(t[p][f],2),y=r.minX+f*o,v=r.minY+p*i;a+=m,l+=y*m,c+=v*m}return{x:l/a,y:c/a}}s(QMe,"calculatePolygonCenter");function e4e(e,t,r,n,o,i,a){let l=-1/0,c=null,p=e.length,f=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let m=0;m<p;m++)for(let y=0;y<p;y++)if(e[m][y]===1)for(let v=1;v<=p-y;v++){let x=v;if(!(x>p-m)&&rQ(e,y,m,v,x)){let S=v*x,I=t.minX+(y+v/2)*r,P=t.minY+(m+x/2)*n,T={x:I,y:P},w=Math.sqrt(Math.pow(T.x-o.x,2)+Math.pow(T.y-o.y,2))/f,E=S*(1-i)-w*i*S;E>l&&(l=E,c={center:T,width:v*r*a,height:v*n*a})}}return c}s(e4e,"findBestRectangle");function aE(e,t,r,n={}){let{scaleFactor:o=.9,centerPriority:i=.5,resolution:a=100,minimumSizeRatio:l=.5}=n,c=S8(r),p=e.width/e.height,f=qMe(t,c),m=ZMe(f),{dx:y,dy:v,gridBounds:x}=YMe(m,p,a),S=KMe(f,x,a,y,v),I=JMe(S,a),P=QMe(S,I,x,a,y,v),T=e4e(S,x,y,v,P,i,o);return!T||T.width<e.width*l||T.height<e.height*l?e:{...T,center:sE(T.center,-c),rotation:r,polygonCenter:sE(P,-c)}}s(aE,"findLargestInteriorRectangle");var Kb=Math.PI*2,t4e=Math.PI/2,r4e=Math.PI*1.5,n4e=kd(t4e,2),o4e=kd(r4e,2),i4e=.01,nQ=!1,lE=class lE extends Fe{constructor(r,n,o=0,i=0,a={}){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");h(this,"initialBearing",0);h(this,"naturalBearing",0);h(this,"imagePlacementOptions");h(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 x,S,I;let c={width:o.width,height:o.height,center:this.convertTo3DMapPosition(a),rotation:(x=o.rotation)!=null?x:0},p=(S=this.imagePlacementOptions.mode)!=null?S:"default",f=(()=>{switch(p){case"fit-nearest-90":let P=(this.initialBearing-this.naturalBearing+360)%180;return P>=45&&P<=135?aE(c,l,c.rotation+90,this.imagePlacementOptions):c;case"fit-initial-bearing":return aE(c,l,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return c}})();if(nQ&&f.polygonCenter){let P=new ze(new I0(1),new Ei({color:65280}));P.position.set(f.polygonCenter.x,f.polygonCenter.y,i),this.rendererState.entityScene.add(P)}let m=new Ei({transparent:!0,depthWrite:!1,side:Ta}),y=new Oi(f.width,f.height),v=new DS(y);if(v.visible=!1,(I=this.getOrDownloadImage(n))==null||I.then(P=>{m.map=P,m.needsUpdate=!0,m.map.colorSpace=wa,v.visible=!0,this.publish("image-loaded")}),v.userData.entityId=r,v.material=m,nQ){let P=new ze(new Oi(o.width,o.height),new Ei({color:"gray"}));v.add(P);let T=new x8;v.add(T),T.scale.set(10,10,10)}return v.position.set(f.center.x,f.center.y,i+i4e),v.rotation.z=(-Ke.degToRad(f.rotation)+Kb)%Kb,v}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=>{Wc.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=kd((i-o+Kb)%Kb,2);a>n4e&&a<o4e&&(r.imageMesh.rotation.z=(i+Math.PI)%Kb)}update(r){var a,l,c,p,f;let n,o,i;for(let m of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(m),(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),v={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,[v]),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(x=>{let S=this.convertTo3DMapPosition(x);return{x:S.x,y:S.y}}),v=this.createImageMesh(m,(c=o.feature.properties)==null?void 0:c.image.path,(p=o.feature.properties)==null?void 0:p.image,i.height,(f=o.feature.properties)==null?void 0:f.image.position,y);o.mesh.parent.add(v),o.imageMesh=v}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(lE,"ImageSystem");var LS=lE;d();var s4e=250,Xc,cE=class cE extends Fe{constructor(r,n){super();h(this,"cameraDirty",!0);h(this,"focusablesDirty",!0);h(this,"state");h(this,"camera");h(this,"debugEl",null);h(this,"raycasters",[]);h(this,"collisions",new Map);h(this,"focusableEntities",new Set);h(this,"debugRaycasters",!1);O(this,Xc);h(this,"update",s((r=!1,n=Date.now())=>{r||Date.now()-n>s4e||(u(this,Xc)&&cancelAnimationFrame(u(this,Xc)),A(this,Xc,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new _e(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new _e(r.x/1.2,r.y/1.2),o=new _e(r.x+(r.x-n.x),n.y),i=new _e(n.x,r.y+(r.y-n.y)),a=new _e(o.x,i.y),l=new _e(r.x,r.y/1.5),c=new _e(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((p,f)=>{if(this.debugRaycasters){let S=document.createElement("div");S.style.position="absolute",S.style.top=p.y+"px",S.style.left=p.x+"px",S.style.width="10px",S.style.height="10px",S.style.backgroundColor="red",this.debugEl.append(S)}let m=p.x/this.state.canvasWidth*2-1,y=-(p.y/this.state.canvasHeight)*2+1,v=new _e(m,y),x=new xs;return x.setFromCamera(v,this.camera),[x,v,f===0?10:f<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 th){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 Mi(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}),p=new ze(l,c);p.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,(a.min.z+a.max.z)/2),p.userData={entityId:n.userData.entityId},i.focusMesh=p,n.add(p),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 ze(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 p=l.object.userData.entityId,f=(c=this.collisions.get(p))!=null?c:0;this.collisions.set(p,f+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(){u(this,Xc)&&cancelAnimationFrame(u(this,Xc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Xc=new WeakMap,s(cE,"GeometryInFocusSystem");var RS=cE;d();d();d();d();function Jb(e,t){t===void 0&&(t={});var r=bm(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return a4e(r,t);case"MultiPolygon":return l4e(r,t);default:throw new Error("invalid poly")}}s(Jb,"default");function a4e(e,t){t===void 0&&(t={});var r=bm(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{};return oQ(n,o)}s(a4e,"polygonToLine");function l4e(e,t){t===void 0&&(t={});var r=bm(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{},i=[];return n.forEach(function(a){i.push(oQ(a,o))}),xu(i)}s(l4e,"multiPolygonToLine");function oQ(e,t){return e.length>1?w8(e,t):_a(e[0],t)}s(oQ,"coordsToLine");function c4e(e,t){var r=!0;return Cs(e,function(n){Cs(t,function(o){if(r===!1)return!1;r=u4e(n.geometry,o.geometry)})}),r}s(c4e,"booleanDisjoint");function u4e(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!m4e(e.coordinates,t.coordinates);case"LineString":return!iQ(t,e);case"Polygon":return!fl(e,t)}break;case"LineString":switch(t.type){case"Point":return!iQ(e,t);case"LineString":return!p4e(e,t);case"Polygon":return!sQ(t,e)}break;case"Polygon":switch(t.type){case"Point":return!fl(t,e);case"LineString":return!sQ(e,t);case"Polygon":return!d4e(t,e)}}return!1}s(u4e,"disjoint");function iQ(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(f4e(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}s(iQ,"isPointOnLine");function p4e(e,t){var r=km(e,t);return r.features.length>0}s(p4e,"isLineOnLine");function sQ(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var o=n[r];if(fl(o,e))return!0}var i=km(t,Jb(e));return i.features.length>0}s(sQ,"isLineInPoly");function d4e(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var o=n[r];if(fl(o,t))return!0}for(var i=0,a=t.coordinates[0];i<a.length;i++){var l=a[i];if(fl(l,e))return!0}var c=km(Jb(e),Jb(t));return c.features.length>0}s(d4e,"isPolyInPoly");function f4e(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(f4e,"isPointOnLineSegment");function m4e(e,t){return e[0]===t[0]&&e[1]===t[1]}s(m4e,"compareCoords");var aQ=c4e;function uE(e,t){var r=!1;return Cs(e,function(n){Cs(t,function(o){if(r===!0)return!0;r=!aQ(n.geometry,o.geometry)})}),r}s(uE,"booleanIntersects");var lQ=20,Yc,nd,od,BS,Qb,pE=class pE{constructor(t){h(this,"dirty",!0);h(this,"map");h(this,"stylesheetId","");h(this,"userHiddenLayers",new Set);h(this,"hiddenLayersInStyle",new Set);h(this,"centerPoint");h(this,"bbox");h(this,"polygons");h(this,"handleRender",s(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(u(this,Yc)&&(u(this,BS).call(this),A(this,Yc,!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,Yc,!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,Yc,!0);for(let r=0;r<t.length;r+=lQ){let n=t.slice(r,r+lQ);u(this,nd).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=w0(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(i=M8(o.geometry.coordinates)),!i)continue;for(let a of this.polygons)if(uE(a,i)){this.expr.push(["!=",["id"],o.id]);continue}}})}u(this,Qb).call(this)}}}},"handleRender"));h(this,"expr",[]);O(this,Yc,!1);O(this,nd,[]);O(this,od,null);O(this,BS,s(()=>{u(this,od)&&(globalThis.cancelAnimationFrame(u(this,od)),A(this,od,null)),A(this,nd,[])},"#cancelJobs"));O(this,Qb,s(()=>{let t=u(this,nd).pop();typeof t=="function"&&(t(),u(this,nd).length>0&&A(this,od,globalThis.requestAnimationFrame(u(this,Qb)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],A(this,Yc,!1)},"#runJobs"));h(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=w0(i.geometry.coordinates);o.push(a)}else i.geometry.type==="MultiPolygon"&&o.push(...i.geometry.coordinates.map(a=>w0(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))}};Yc=new WeakMap,nd=new WeakMap,od=new WeakMap,BS=new WeakMap,Qb=new WeakMap,s(pE,"OutdoorLayers");var NS=pE;d();d();d();var dE="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";var fE='#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 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 (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}';var cQ="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 b4e=new Ad;function uQ(e,t,r){let{nearRadius:n,farRadius:o,accentColor:i,completeFraction:a,isVertical:l}=t,{color:c}=r,p=!0,f=0,m=1/0,y=t.displayArrowsOnPath,v=!l,x=!0,S=y,I=n/2+v4e,P=0;e[0].z+=I;for(let re=1;re<e.length;++re){e[re].z+=I;let se=e[re].x-e[re-1].x,k=e[re].z-e[re-1].z;if(l)P+=Math.sqrt(se*se+k*k);else{let K=e[re].y-e[re-1].y;P+=Math.sqrt(se*se+K*K+k*k)}}if(!l){let re=e[0],se=e[e.length-1];e.push(se.clone().setZ(se.z-.01)),e.unshift(re.clone().setZ(re.z-.01))}let T=new s8;S&&(T=b4e.load(cQ),T.colorSpace=wa);let M=new Lt(c),w=new Lt(i),E={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new _e(1,1)},cameraParameters:{type:"v2",value:new _e(f,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:M},pathLength:{type:"f",value:P},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:f},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:T},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:x},opacityMultiplier:{type:"f",value:1}},B=new m8(e);B.curveType="catmullrom",B.tension=0;let D=30,F=8,L=D*e.length,H=new h8(B,L,n,F,!1),U=new Float32Array(H.attributes.position.count);for(let re=e.length;re<U.length;re++)U[re]=re;H.setAttribute("vertexIndex",new Ea(U,1));let G=new Float32Array(H.attributes.position.count),J=new Ea(G,1);for(let re=0;re<=L;re++)for(let se=0;se<=F;++se)J.setX(re*(F+1)+se,re/L);H.setAttribute("pathDistance",J);let X=new Float32Array(H.attributes.normal.count*3),ie=new Ea(X,3);for(let re=0;re<L;re++){let se=H.tangents[re];for(let k=0;k<=F;++k)ie.setXYZ(re*(F+1)+k,se.x,se.y,se.z)}H.setAttribute("pathTangent",ie);let ee=new Float32Array(H.attributes.normal.count*3),ge=new Ea(ee,3);for(let re=0;re<L;re++){let se=H.tangents[re];var ve,pe,Ae;l?(ve=se.x*se.y,pe=-1+se.y*se.y,Ae=se.z*se.y):(ve=-se.x*se.z,pe=-se.y*se.z,Ae=1-se.z*se.z);let k=Math.sqrt(ve*ve+pe*pe+Ae*Ae);k===0&&(k=1);let K=ve/k,R=pe/k,ce=Ae/k;for(let oe=0;oe<=F;++oe)ge.setXYZ(re*(F+1)+oe,K,R,ce)}H.setAttribute("pathNormal",ge);let yt=new gu({uniforms:E,vertexShader:dE,fragmentShader:fE});yt.transparent=!0,yt.alphaTest=.5,E.resolution.value.x=1,E.resolution.value.y=1,E.vertexes.value=U.length,E.arrowTexture.value.wrapS=gs,E.arrowTexture.value.wrapT=gs,E.arrowTexture.value.anisotropy=16,E.complete.value=a;let it=new ze(H,yt),Ye=it.clone(),Ve={...E,opacityMultiplier:{type:"f",value:.25}};Ve.complete.value=1,Ye.material=new gu({uniforms:Ve,vertexShader:dE,fragmentShader:fE}),Ye.material.transparent=!0,Ye.material.alphaTest=.5,Ye.material.depthWrite=!1,Ye.material.depthTest=!1,Ye.renderOrder=1,Ve.resolution.value.x=1,Ve.resolution.value.y=1,Ve.vertexes.value=U.length,Ve.arrowTexture.value.wrapS=gs,Ve.arrowTexture.value.wrapT=gs,Ve.arrowTexture.value.anisotropy=16,Ve.complete.value=a,it.userData=Ye.userData=t.mesh.userData;let de=t.mesh;de.add(it),de.add(Ye),H.computeBoundingBox();let he=new Pe;return H.boundingBox.getCenter(he),{mesh:de,material:yt,center:he}}s(uQ,"buildPath");var v4e=.15;var mE=class mE extends Fe{constructor(r,n,o,i){super();h(this,"rendererState");h(this,"altitudeDirty",!0);h(this,"convertTo3DMapPosition");h(this,"getParentContainer");h(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],p=i.components[1],f=c.isVertical&&this.altitudeDirty;if(!(c instanceof qc))continue;if(c.dirty||f){if(c.mesh.parent!=null)for(let y=c.mesh.children.length-1;y>=0;y--)mr(c.mesh.children[0]);let m=[];if(c.feature.features.forEach(y=>{let v=y.geometry.coordinates[2]||0,x;if(y.properties.parentId&&(x=this.getParentContainer(y.properties.parentId,!0),x!=null&&x.altitude!=null&&(v+=x.altitude,c.isVertical=!0)),!y.properties.parentId||x!=null&&x.visible){let S=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],v);m.push(S)}}),m.length>1){let{mesh:y,material:v,center:x}=uQ(m,c,{color:p.color});c.mesh=y,c.material=v,c.position=x}c.dirty&&(c.nearZoomLevel!=null&&(c.nearZoomAltitude=this.convertZoomLevelToAltitude(c.nearZoomLevel)),c.farZoomLevel!=null&&(c.farZoomAltitude=this.convertZoomLevelToAltitude(c.farZoomLevel))),c.dirty=!1}p.dirty&&(c.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(p.color),m.material.needsUpdate=!0}),c.mesh.position.z=p.altitude,p.dirty=!1),c.material&&(c.mesh.children.forEach(m=>{var v,x;let y=m.material.uniforms;y.nearZoom.value=(v=c.nearZoomAltitude)!=null?v:r,y.farZoom.value=(x=c.farZoomAltitude)!=null?x: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),m.material.needsUpdate=!0}),c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.mesh.children.forEach(m=>{m.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,m.material.needsUpdate=!0}),a=!0),c.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};s(mE,"PathSystem");var e1=mE;d();var Yr,ph,_l,hE=class hE{constructor(t){h(this,"rendererState");h(this,"dirty",!1);O(this,Yr);O(this,ph);O(this,_l);this.rendererState=t}updateOne(t){if(t instanceof wt&&t.components[0]instanceof yr&&t.components[1]instanceof Ps&&t.parentObject3D instanceof Sn&&(A(this,Yr,t.components[0]),A(this,_l,t.components[1]),u(this,Yr).detached&&u(this,Yr).dirty&&u(this,Yr).geometry!=null&&u(this,Yr).material!=null)){A(this,ph,t.parentObject3D),u(this,Yr).visible=!1;let r=new Lt(u(this,_l).color),n=u(this,_l).opacity*Su(t),o=new Xp({color:r,side:Ta,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,u(this,Yr).material.repeatYFactor),i=new M0(1,u(this,Yr).geometry.attributes.position.count||0,0,o),a=i.addGeometry(u(this,Yr).geometry);i.addInstance(a),i.userData={entities:{0:t.id},detached:!0},u(this,Yr).instanceIndex=a,u(this,Yr).material.setColor(u(this,Yr).instanceIndex,r,u(this,_l).topColor?new Lt(u(this,_l).topColor):r),u(this,Yr).mesh=i,u(this,Yr).material=o,u(this,ph).add(i),u(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,ph,void 0),A(this,_l,void 0)}};Yr=new WeakMap,ph=new WeakMap,_l=new WeakMap,s(hE,"MeshDetachmentSystem");var $S=hE;d();d();function pQ(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(pQ,"updateHeight");var id,Kc,yE=class yE{constructor(t){h(this,"rendererState");h(this,"dirty",!1);O(this,id);O(this,Kc);this.rendererState=t}updateOne(t){var r;t instanceof wt&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(A(this,id,t.components[0]),A(this,Kc,t.components[1]),t.type==="geometry"&&u(this,Kc).height!==u(this,id).currentHeight&&pQ(u(this,id),u(this,Kc).height,u(this,Kc).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,id,void 0),A(this,Kc,void 0)}};id=new WeakMap,Kc=new WeakMap,s(yE,"MeshModificationSystem");var jS=yE;d();var x4e={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},gE=class gE{constructor(t){h(this,"state",x4e);h(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(gE,"Debug");var GS=gE;d();var t1=9,I4e=!1,dQ=.1;function S4e(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(S4e,"fillArrayWithColor");var bE=class bE{constructor(t,r,n){h(this,"state");h(this,"renderer");h(this,"renderService");h(this,"pickingTexture");h(this,"pickingMaterial");h(this,"pixelBuffer");h(this,"width",0);h(this,"height",0);h(this,"scale",1/2);h(this,"color",1);h(this,"convertTo3DMapPosition");h(this,"destroyed",!1);h(this,"enabled",!1);h(this,"backgroundId",16777215);h(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 l8(this.width,this.height,{format:b0,type:r8,internalFormat:"RGBA"})},"resize"));h(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"));h(this,"activeOccluders",new Set);h(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 lt&&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=tS(t,this.convertTo3DMapPosition,{color:"white",height:dQ});r=this.createOccluderMesh(a,i.userData.occluderId),i.add(r)}else if(t.geometry.type==="MultiPolygon"){let a=rS(t,this.convertTo3DMapPosition,{color:"white",height:dQ});r=this.createOccluderMesh(a,i.userData.occluderId),i==null||i.add(r)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Lt(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(t1),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(t1),I4e?this.renderService.enabledLayers.add(t1):this.renderService.enabledLayers.delete(t1),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),p=this.shouldShowByXY(l,c,i.occluderId);i.components[0].isOccluded=!p}}})},"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 gu({glslVersion:i8,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);S4e(o,n.count,r),t.setAttribute("color",new Ea(o,3))}createOccluderMesh(t,r){let n=new ze(t,this.pickingMaterial);return n.layers.set(t1),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(bE,"Occlusion2DSystem");var US=bE;var fQ=new xs;var{DEFAULT_PITCH:CE,DEFAULT_BEARING:PE,DEFAULT_ZOOM_LEVEL:TE,DEFAULT_MIN_ZOOM_LEVEL:C4e,DEFAULT_MAX_ZOOM_LEVEL:P4e}=Si,T4e=Ke.radToDeg(.6435011087932844),wr,Ir,sd,r1,dh,Jc,ad,fh,bn,xE,z,Gt,ss,Sr,ma,rn,V,n1,Nr,Wt,mQ,hQ,yQ,Qc,o1,i1,s1,a1,VS,l1,c1,u1,mh,IE,ld,p1,ro,no,SE,hh,d1,wE=class wE extends Fe{constructor(r,n={}){var y,v,x,S,I,P,T,M,w,E,B;super();O(this,bn);h(this,"options");h(this,"container");h(this,"Debug");O(this,wr);O(this,Ir);O(this,sd);O(this,r1);O(this,dh);O(this,Jc);O(this,ad);O(this,fh);h(this,"rendererDomElement");O(this,z,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new lt("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:ey,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new k6,cameraObject:new h3,naturalBearing:0,containerOffset:[0,0]});h(this,"camera");O(this,Gt);O(this,ss);O(this,Sr);O(this,ma);O(this,rn);O(this,V,{});O(this,n1,window.matchMedia("screen and (min-resolution: 2dppx)"));h(this,"map");O(this,Nr,s(()=>{u(this,V).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));O(this,Wt,s(()=>{u(this,V).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));O(this,Qc,"standalone");O(this,o1,s(r=>Math.trunc(r*10)/10,"#round10"));O(this,i1,s(()=>{u(this,V).twoDDrawSystem.dirty=!0,te(this,bn,xE).call(this,Fd()),u(this,V).watermarkSystem.dirty=!0,u(this,V).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));O(this,s1,s(()=>{u(this,a1).call(this)},"#handleWindowResizeWithEvent"));O(this,a1,s((r,n)=>{let o=r!=null?r:this.rendererDomElement.clientWidth,i=n!=null?n:this.rendererDomElement.clientHeight;if(o===0||i===0)return;u(this,z).canvasWidth=o,u(this,z).canvasHeight=i,te(this,bn,xE).call(this,Fd()),u(this,mh).call(this),te(this,bn,yQ).call(this),u(this,V).cameraSystem.resize(this.canvasWidth,this.canvasHeight),u(this,V).cameraSystem.dirty=!0,u(this,V).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),u(this,V).htmlControlsSystem.resize(this.canvasWidth),u(this,V).geometryInFocusSystem.resize(),u(this,V).occlusion2DSystem.resize();let{top:a,left:l}=this.container.getBoundingClientRect();u(this,z).containerOffset=[a,l],this.publish("resize"),this.render()},"#handleWindowResize"));O(this,VS,s(()=>{this.renderSync()},"#renderFull"));O(this,l1,new Pe);O(this,c1,s((r,n)=>{let o=this.mode==="standalone"?u(this,Ir):this.viewCamera;if(u(this,Ir).position.z+this.camera.elevation>n.z){u(this,l1).copy(n);let i=u(this,l1).project(o),a=(i.x+1)/2*this.canvasWidth-0/2,l=(-i.y+1)/2*this.canvasHeight-0/2,c=u(this,o1).call(this,a),p=u(this,o1).call(this,l);r.x=c,r.y=p}else r.x=-1e3,r.y=-1e3},"#project"));O(this,u1,s((r,n)=>{u(this,rn).setBufferSize(r,n),u(this,Ir).aspect=r/n,u(this,Ir).updateProjectionMatrix(),u(this,Ir).updateMatrixWorld(!0),u(this,dh).x=r,u(this,dh).y=n},"#setBufferSize"));O(this,mh,s(()=>{var a;let r=u(this,z).canvasWidth=this.rendererDomElement.clientWidth,n=u(this,z).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(r*this.resolutionScale),i=Math.floor(n*this.resolutionScale);u(this,u1).call(this,o,i),(a=this.map)==null||a.resize(),u(this,z).shouldMeasureCanvas=!1},"#measureCanvas"));h(this,"getParentContainer",s((r,n=!0)=>{if(!r)return n?u(this,z).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let o=u(this,z).geometry3DMap.get(r);return o instanceof lt?o:(j.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?u(this,z).entityScene:void 0)}else if(r.type==="group-container"){let o=u(this,z).geometry3DMap.get(r.id);if(o instanceof lt)return o}return n?u(this,z).entityScene:void 0},"getParentContainer"));h(this,"showCollisionBoxes",s(()=>{u(this,V).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{u(this,V).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));h(this,"projectScreenXYToCoordinate",s((r,n,o=!1)=>{var y,v;let i=u(this,z).containerOffset[0],a=u(this,z).containerOffset[1],l=(r-a)/u(this,z).canvasWidth*2-1,c=-((n-i)/u(this,z).canvasHeight)*2+1,p=new _e(l,c),f,m;if(o)fQ.setFromCamera(p,u(this,Ir)),f=(y=fQ.intersectObject(u(this,Jc),!1)[0])==null?void 0:y.point;else{let x=u(this,V).interactionSystem.getThreeDIntersectsFromXY(p);f=(v=x==null?void 0:x[0])==null?void 0:v.point,m=u(this,V).interactionSystem.getGroupContainerIntersectsFromXY(p)}if(f)return{coordinate:this.convert3DMapPositionToCoordinate(f),groupContainers:m}},"projectScreenXYToCoordinate"));h(this,"projectCoordinateToScreenXY",s(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),o=new _e;return u(this,c1).call(this,o,n),{x:o.x,y:o.y}},"projectCoordinateToScreenXY"));h(this,"convert3DMapPositionToCoordinate",s(r=>{var i,a,l,c;let{lat:n,lon:o}=O0((a=(i=u(this,z).center)==null?void 0:i[1])!=null?a:0,(c=(l=u(this,z).center)==null?void 0:l[0])!=null?c:0,r.x,r.y);return[o,n,r.z]},"convert3DMapPositionToCoordinate"));h(this,"setBackgroundColor",s((r,n)=>{u(this,rn).setBackgroundColor(r,n)},"setBackgroundColor"));h(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:P0(o.coordinate,i.coordinate)/r},"getMetresPerPixel"));h(this,"hideOutdoorLayersUnderPoint",s((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(u(this,V).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));h(this,"hideOutdoorLayersIntersectingPolygons",s((r,n,o)=>{u(this,V).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,o),this.render()},"hideOutdoorLayersIntersectingPolygons"));O(this,ld,new f8);O(this,p1,new wi);h(this,"render",s(()=>{var r;if(((r=u(this,V))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return u(this,V).renderSystem.update()},"render"));h(this,"renderSync",s(()=>u(this,V).renderSystem.update(!0),"renderSync"));O(this,ro,Ld(()=>{this.publish("user-interaction-start",void 0)},0,!0));O(this,no,Ld(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));h(this,"on",s((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&b.env.NODE_ENV!=="test"&&(j.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"));h(this,"off",s((r,n)=>{super.off(r,n)},"off"));h(this,"getCursor",s(()=>u(this,V).interactionSystem.getCursor(),"getCursor"));h(this,"destroy",s(()=>{var r;u(this,V)&&(u(this,V).cameraSystem.off("user-dolly-start",u(this,ro)),u(this,V).cameraSystem.off("user-pan-start",u(this,ro)),u(this,V).cameraSystem.off("user-rotate-start",u(this,ro)),u(this,V).cameraSystem.off("user-zoom-start",u(this,ro)),u(this,V).cameraSystem.off("user-tilt-start",u(this,ro)),u(this,V).cameraSystem.off("user-pedestal-start",u(this,ro)),u(this,V).cameraSystem.off("user-dolly-end",u(this,no)),u(this,V).cameraSystem.off("user-pan-end",u(this,no)),u(this,V).cameraSystem.off("user-rotate-end",u(this,no)),u(this,V).cameraSystem.off("user-zoom-end",u(this,no)),u(this,V).cameraSystem.off("user-tilt-end",u(this,no)),u(this,V).cameraSystem.off("user-pedestal-end",u(this,no)),u(this,V).renderSystem.off("measure-canvas",u(this,mh)),u(this,V).meshOptimizationSystem.off("geometry-2d-added",this.render),u(this,V).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),u(this,Nr).call(this),u(this,Wt).call(this),this.renderSync(),u(this,V).renderSystem.destroy(),u(this,V).cameraSystem.off("change",this.render),u(this,V).pathSystem.off("animate:path",this.render),u(this,V).cameraSystem.dispose(),u(this,V).exporterSystem.destroy(),u(this,V).outdoorLayersSystem.destroy(),u(this,V).drawSystem.destroy(),window.removeEventListener("resize",u(this,s1),!1),u(this,n1).removeEventListener("change",u(this,i1)),u(this,ad)&&u(this,ad).disconnect(),this._subscribers={},u(this,rn).destroy(),(r=u(this,wr))==null||r.traverse(n=>{mr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),A(this,wr,void 0),u(this,V).htmlControlsSystem.destroy(),u(this,V).collisionSystem.destroy(),u(this,V).interactionSystem.destroy(),u(this,V).domMutationSystem.destroy(),u(this,V).geometryInFocusSystem.destroy(),A(this,V,void 0),u(this,Qc)!=="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(u(this,ma)),this.container.removeChild(u(this,Gt)),A(this,rn,void 0))},"destroy"));O(this,hh,new Pe);O(this,d1,new Pe);if(u(this,z).naturalBearing=(y=n.naturalBearing)!=null?y: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,Qc,n.mode),this.map=n.map),u(this,z).entityScene.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),u(this,z).entityScene.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),u(this,z).geometry3DMap.set(u(this,z).entityScene.userData.entityId,u(this,z).entityScene),n.center&&(u(this,z).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,te(this,bn,mQ).call(this),te(this,bn,hQ).call(this),u(this,V).htmlControlsSystem=new OS(this.container),u(this,Qc)!=="outdoors-overlay"&&u(this,V).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),b.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),A(this,rn,new sI({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(v=n.gl)==null?void 0:v.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:s(D=>{var F;(F=n.onWebGLContextRestored)==null||F.call(n,D),u(this,Nr).call(this),u(this,Wt).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(x=n.backgroundAlpha)!=null?x:1})),A(this,wr,new Xl),u(this,wr).add(u(this,z).entityScene);let o=window.__THREE_DEVTOOLS__;b.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:u(this,wr)})),o.dispatchEvent(new CustomEvent("observe",{detail:u(this,rn)}))),A(this,Ir,new h3(T4e,this.aspect,50,1e5)),u(this,z).cameraObject=u(this,Ir),A(this,r1,new p8),u(this,Ir).renderOrder=999;let i=new Oa;i.add(u(this,Ir)),A(this,fh,new Oa),u(this,fh).add(i),u(this,wr).add(u(this,fh)),u(this,Ir).updateProjectionMatrix(),u(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=u(this,rn).domElement(),A(this,dh,new _e);let a=new Oi(1e6,1e6),l=new $r({color:0,visible:!1});A(this,Jc,new ze(a,l)),u(this,Jc).name="worldPlane",u(this,wr).add(u(this,Jc)),(S=n.gl)!=null&&S.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",u(this,s1),!1),u(this,n1).addEventListener("change",u(this,i1)),typeof ResizeObserver=="function"&&((I=b.env)==null?void 0:I.NODE_ENV)!=="test"&&(A(this,ad,new ResizeObserver(L8(D=>{u(this,a1).call(this,D[0].contentRect.width,D[0].contentRect.height)},50))),(P=u(this,ad))==null||P.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(T=globalThis.MappedinDebug)!=null&&T.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1920px":"100%",b.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),u(this,z).canvasWidth=this.rendererDomElement.clientWidth,u(this,z).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,p=this.canvasHeight;u(this,V).watermarkSystem=new PS(u(this,Ir),u(this,z),n==null?void 0:n.watermark),u(this,V).watermarkSystem.on("texture-loaded",this.render),u(this,z).shouldMeasureCanvas=!0,u(this,z).pixelRatio=this.resolutionScale,u(this,u1).call(this,Math.floor(c*this.resolutionScale),Math.floor(p*this.resolutionScale));let f=new S0(16777215,.3*Math.PI);f.position.set(-150,-150,350),u(this,wr).add(f);let m=new g8(16777215,.741*Math.PI);u(this,wr).add(m),u(this,V).cameraSystem=new ah(u(this,Ir),u(this,wr),u(this,rn).renderer,u(this,z),{mode:this.mode,canvasHeight:p,canvasWidth:c}),u(this,V).cameraSystem.on("user-dolly-start",u(this,ro)),u(this,V).cameraSystem.on("user-pan-start",u(this,ro)),u(this,V).cameraSystem.on("user-rotate-start",u(this,ro)),u(this,V).cameraSystem.on("user-zoom-start",u(this,ro)),u(this,V).cameraSystem.on("user-tilt-start",u(this,ro)),u(this,V).cameraSystem.on("user-pedestal-start",u(this,ro)),u(this,V).cameraSystem.on("user-dolly-end",u(this,no)),u(this,V).cameraSystem.on("user-pan-end",u(this,no)),u(this,V).cameraSystem.on("user-rotate-end",u(this,no)),u(this,V).cameraSystem.on("user-zoom-end",u(this,no)),u(this,V).cameraSystem.on("user-tilt-end",u(this,no)),u(this,V).cameraSystem.on("user-pedestal-end",u(this,no)),u(this,V).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),u(this,V).geometryInFocusSystem&&(u(this,V).geometryInFocusSystem.cameraDirty=!0),this.render()}),u(this,V).pathSystem=new e1(u(this,z),this.convertTo3DMapPosition,this.getParentContainer,u(this,V).cameraSystem.convertZoomLevelToAltitude),u(this,V).pathSystem.on("animate:path",this.render),u(this,V).panBoundsSystem=new MS(u(this,z),u(this,V).cameraSystem),u(this,V).panBoundsSystem.on("update",()=>{let{panBounds:D,fov:F,convertAltitudeToZoomLevel:L}=u(this,V).cameraSystem;if(u(this,V).panBoundsSystem.autoMinZoomLevel){if(D.radius<=0)return;let H=Math.min(u(this,z).canvasWidth/u(this,z).canvasHeight,1),U=F*Math.PI/180*H,G=Math.tan(U/2),{radius:J,center:X}=u(this,V).cameraSystem.panBounds,ie=J/G,ee=this.getThreeCamera().getWorldPosition(new Pe),ge=X.distanceTo(ee),ve=Math.abs(ee.z-X.z),pe=ie*ve/ge,Ae=L(pe);Y8(Ae,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Ae)}}),this.camera=new CS(this,u(this,V),u(this,z)),this.camera.setZoomLevel((w=n.zoomLevel)!=null?w:TE),this.camera.setBearing((E=n.bearing)!=null?E:PE),this.camera.setPitch((B=n.pitch)!=null?B:CE),this.camera.setMaxZoomLevel(P4e),this.camera.setMinZoomLevel(C4e),u(this,V).domVisiblitySystem=new iS(u(this,z),u(this,ma)),u(this,V).domMutationSystem=new SS(u(this,z),u(this,ma)),u(this,V).domMutationSystem.on("dimensions-update",()=>{u(this,V).collisionSystem.collidersDirty=!0,this.render()}),u(this,V).domDrawSystem=new xS(u(this,z)),u(this,V).collisionSystem=new aI(u(this,ss),u(this,z)),u(this,V).twoDDrawSystem=new aS(u(this,z),u(this,Sr),n.transformImageRequest),u(this,V).twoDDrawSystem.on("img:loaded",this.render),u(this,V).interactionSystem=new ob(this.rendererDomElement,u(this,z),u(this,Ir),u(this,Jc),u(this,V).cameraSystem.isUserInteracting),u(this,V).interactionSystem.on("doubletap-with-onefinger",D=>{var F;this.camera.animateTo({center:(F=this.projectScreenXYToCoordinate(D.clientX,D.clientY))==null?void 0:F.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:C3,easing:"ease-out"})}),u(this,V).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:C3,easing:"ease-out"})}),u(this,V).interactionSystem.on("hover",this.render),u(this,V).interactionSystem.on("click",D=>{var F,L,H,U,G,J;if(((F=D.entity2D)==null?void 0:F.id)==="watermark"&&typeof u(this,V).watermarkSystem.options.onClick=="function"&&u(this,V).watermarkSystem.options.interactive){u(this,V).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(L=D.entity3D)==null?void 0:L.id]:[],paths:((H=D.entity3D)==null?void 0:H.components[0])instanceof qc?[D.entity3D.id]:[],markers:((U=D.entity2D)==null?void 0:U.components[0])instanceof la?[D.entity2D.id]:[],models:((G=D.entity3D)==null?void 0:G.components[0])instanceof zc?[D.entity3D.id]:[],labels:((J=D.entity2D)==null?void 0:J.components[0])instanceof ca?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(X=>X.userData.entityId):[],pointerEvent:D.pointerEvent})}),u(this,V).interactionSystem.on("hover",D=>{var F,L,H,U,G,J;D.position&&((F=D.entity2D)==null?void 0:F.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(L=D.entity3D)==null?void 0:L.id]:[],paths:((H=D.entity3D)==null?void 0:H.components[0])instanceof qc?[D.entity3D.id]:[],markers:((U=D.entity2D)==null?void 0:U.components[0])instanceof la?[D.entity2D.id]:[],models:((G=D.entity3D)==null?void 0:G.components[0])instanceof zc?[D.entity3D.id]:[],labels:((J=D.entity2D)==null?void 0:J.components[0])instanceof ca?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(X=>X.userData.entityId):[]})}),u(this,V).geometryInFocusSystem=new RS(u(this,z),u(this,Ir)),u(this,V).geometryInFocusSystem.on("geometry-in-focus",D=>{this.publish("geometry-in-focus",D)}),u(this,V).twoDVisiblitySystem=new cS(u(this,z)),u(this,V).drawSystem=new lS(u(this,z),this.convertTo3DMapPosition),u(this,V).drawSystem.on("texture-loaded",this.render),u(this,V).stackSystem=new pS(u(this,z)),u(this,V).twoDProjectionSystem=new sS(u(this,z),u(this,c1)),u(this,V).exporterSystem=new Eb(u(this,z)),u(this,V).meshOptimizationSystem=new oS(u(this,z),this.convertTo3DMapPosition),u(this,V).meshOptimizationSystem.on("model-loaded",this.render),u(this,V).meshOptimizationSystem.on("geometry-2d-added",this.render),u(this,V).meshDetachmentSystem=new $S(u(this,z)),u(this,V).meshModificationSystem=new jS(u(this,z)),u(this,V).customGeometrySystem=new ES(u(this,z),this.convertTo3DMapPosition),u(this,V).outlineInterpolationSystem=new _S(u(this,z)),u(this,V).renderSystem=new uS(u(this,rn),u(this,z),this.mode,u(this,wr),u(this,Ir),this.viewCamera,u(this,V)),u(this,V).imageSystem=new LS(u(this,z),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),u(this,V).text3DSystem=new jI(u(this,z),this.convertTo3DMapPosition),u(this,V).text3DSystem.on("render",this.render),u(this,V).imageSystem.on("image-loaded",this.render),u(this,V).renderSystem.on("pre-render",()=>this.publish("pre-render")),u(this,V).renderSystem.on("post-render",()=>this.publish("post-render")),u(this,V).renderSystem.on("measure-canvas",u(this,mh)),u(this,V).outdoorLayersSystem=new NS(this.map),u(this,V).occlusion2DSystem=new US(u(this,z),this.convertTo3DMapPosition,u(this,rn)),n.occlusionEnabled&&u(this,V).occlusion2DSystem.enable(),this.Debug=new GS(this),n.environment!==!1&&A(this,sd,te(this,bn,SE).call(this)),u(this,VS).call(this)}get viewCamera(){return u(this,r1)}get canvasWidth(){return u(this,z).canvasWidth}get canvasHeight(){return u(this,z).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:Fd()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return u(this,Qc)}addGroupContainer(r,n,o){if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let i=new lt(r);i.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),i.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(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,u(this,z)),(n==null?void 0:n.focusable)!==void 0&&d6(i,n.focusable),u(this,z).geometry3DMap.set(r,i);let a=this.getParentContainer(o);a instanceof lt&&a.addEntity(i),u(this,Wt).call(this),this.render()}else j.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(u(this,z).geometry3DMap.has(r))j.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let i=new lt(r);i.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),i.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),i.components[0]=new IS,(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),u(this,z).geometry3DMap.set(r,i);let a=this.getParentContainer(o);a instanceof lt&&a.addEntity(i)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,o,i,a){if(u(this,z).geometry3DMap.has(r))j.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let l=new ch(n,o),c=new wt(l,new Ps(i));(i==null?void 0:i.interactive)!==void 0&&gn(c,i.interactive,u(this,z)),c.id=r,l.mesh.userData={entityId:r,type:"custom-geometry"},u(this,z).geometry3DMap.set(c.id,c);let p=this.getParentContainer(a);p instanceof lt&&p.addEntity(c),u(this,Wt).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,o,i){var a,l;if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let c=new Sn(r,new I3(o));c.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),c.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),c.userData.dirty=!0,u(this,z).geometry3DMap.set(r,c);for(let f of n.features){if(f.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(f.geometry.type))continue;let m=(f==null?void 0:f.id)||((a=f==null?void 0:f.properties)==null?void 0:a.id)||_t(),{visible:y,...v}=o||{color:k8},x=u(this,V).meshOptimizationSystem.createEntityFromFeature(m,f,{...v,outline:!0});u(this,z).geometry3DMap.set(m,x),c.userData.entities3D.add(m)}c.setVisible((l=o==null?void 0:o.visible)!=null?l:!0),(o==null?void 0:o.altitude)!=null&&c.setAltitude(o.altitude);let p=this.getParentContainer(i);p instanceof lt&&p.addEntity(c),u(this,Wt).call(this),this.render()}else j.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return u(this,V).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let o=this.getParentContainer(n),i=u(this,V).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(r,i),i}addImage(r,n,o,i){try{tQ(r,n,o)}catch(a){j.error(a);return}if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let a=new FS(n),l=new wt(a,new Ps(o));l.id=r||_t(),a.mesh.userData={entityId:l.id,type:"path"},u(this,z).geometry3DMap.set(l.id,l);let c=this.getParentContainer(i);c instanceof lt&&c.addEntity(l),u(this,Wt).call(this),this.render()}else j.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{DJ(r,n,o)}catch(p){j.error(p);return}if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let p=new Sn(r,new I3({...o,outline:!1}));p.addEventListener("childadded",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),p.addEventListener("childremoved",()=>{u(this,Wt).call(this),u(this,Nr).call(this)}),u(this,z).geometry3DMap.set(r,p),p.userData.dirty=!0,p.userData.modelURL=o.url;for(let m of n.features){let y=m.id||m.properties.id||_t(),v=u(this,V).meshOptimizationSystem.createModelFromFeature(y,m,o);(m.properties.interactive!==void 0||o.interactive!=null)&&gn(v,(l=m.properties.interactive)!=null?l:o.interactive,u(this,z)),u(this,z).geometry3DMap.set(y,v),p.userData.entities3D.add(y)}let f=this.getParentContainer(i);f instanceof lt&&f.addEntity(p),u(this,Wt).call(this),(c=this.render())==null||c.then(a)}else j.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{tK(r,n,o||{})}catch(c){j.error(c);return}if(a===void 0||!u(this,z).geometry2DMap.has(a)&&!u(this,z).geometry3DMap.has(a)){let c=te(this,bn,IE).call(this,r,new la(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,u(this,z));let p=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?u(this,z).geometry3DMap.get(o.attachTo):void 0;p instanceof wt&&p.attach(c),(l=this.getParentContainer(i))==null||l.addEntity(c),this.render()}else j.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addText3D(r,n,o,i){if(!u(this,z).geometry3DMap.has(r)&&!u(this,z).geometry2DMap.has(r)){let a=new jc({...n,properties:{...n.properties,id:r,content:n.properties.text}}),l=new wt(a,new ry(o==null?void 0:o.appearance));l.id=r,a.mesh.userData.entityId=r.toString(),a.mesh.userData.type="text3d",u(this,z).geometry3DMap.set(r,l);let c=this.getParentContainer(i);c instanceof lt&&c.addEntity(l),u(this,Wt).call(this),this.render()}else j.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,o={}){var p,f;try{if(!n||!r)throw new Error("content and meshGeometryId are required");qK.parse(o)}catch(m){j.error(m);return}let i=u(this,z).geometry3DMap.get(r);if((i==null?void 0:i.type)!=="geometry"){j.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 m=u(this,z).geometry3DMap.get(a.textEntityId);if((m==null?void 0:m.type)!=="text3d"){j.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let l=new jc({type:"Feature",geometry:{coordinates:(p=a.feature.properties.textArea)==null?void 0:p.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:n,id:_t()}});l.polygonEntityId=r;let c=new wt(l,new ry(o==null?void 0:o.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",u(this,z).geometry3DMap.set(c.id.toString(),c),o.parentId&&((f=this.getParentContainer(o.parentId))==null||f.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{VK(r,n,o||{})}catch(c){j.error(c);return}if(a===void 0||!u(this,z).geometry2DMap.has(a)&&!u(this,z).geometry3DMap.has(a)){let c=te(this,bn,IE).call(this,r,new ca(n,o||{},u(this,z)),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,u(this,z));let p=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?u(this,z).geometry3DMap.get(o.attachTo):void 0;p instanceof wt&&p.attach(c),(l=this.getParentContainer(i))==null||l.addEntity(c),u(this,Nr).call(this),this.render()}else j.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{NJ(r,n||{})}catch(p){j.error(p);return}let i=new qc(r,f6(n)),a=new wt(i,new Ps({color:(c=n==null?void 0:n.color)!=null?c:"#ff834c"}));a.id=(n==null?void 0:n.id)||_t(),i.mesh.userData={entityId:a.id,type:"path"},u(this,z).geometry3DMap.set(a.id,a),(n==null?void 0:n.interactive)!=null&&gn(a,n==null?void 0:n.interactive,u(this,z));let l=this.getParentContainer(o);return l instanceof lt&&l.addEntity(a),u(this,Wt).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(r){u(this,V).watermarkSystem.options=r,u(this,V).watermarkSystem.dirty=!0,u(this,V).collisionSystem.collidersDirty=!0,this.render()}remove(r){var o;let n;if(typeof r=="string"||typeof r=="number"?(n=u(this,z).geometry2DMap.get(r),n==null&&(n=u(this,z).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=u(this,z).geometry2DMap.get(r.id),n==null&&(n=u(this,z).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")u(this,z).geometry3DMap.delete(n.id),n.object3d&&mr(n.object3d);else if(n.type==="group-container"){u(this,z).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"){u(this,z).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),u(this,z).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let i=n.attachedTo;if(i){let a=u(this,z).geometry3DMap.get(i);a instanceof wt&&a.detach(n)}n.object3d&&mr(n.object3d),n.type==="label"&&delete u(this,V).twoDDrawSystem.textCache[n.id],u(this,z).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&mr(n.object3d),u(this,z).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){u(this,V).text3DSystem.remove(l);let c=u(this,z).geometry3DMap.get(l);(c==null?void 0:c.type)==="geometry"&&(c.components[0].textMesh=void 0,c.components[0].textEntityId=void 0)}u(this,z).geometry3DMap.delete(n.id)}u(this,Wt).call(this),u(this,Nr).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return u(this,wr)}getThreeCamera(){return u(this,Ir)}async setEnvironment(r){if(u(this,wr))if(r==="basic"){u(this,sd)||A(this,sd,te(this,bn,SE).call(this));let n=await u(this,sd);u(this,wr).environment=n}else u(this,wr).environment=null}getEnvironment(){var r;return(r=u(this,wr))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return u(this,V).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(u(this,V).renderSystem.threeDdirty||u(this,V).renderSystem.twoDdirty)&&this.renderSync();let n=new Jr;if(r==null)n.setFromObject(u(this,z).entityScene);else{let o=ty(u(this,z),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 v0&&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(bu(n))return N8(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var o,i,a,l,c,p,f,m,y,v;if(r==null)return{type:"map-view",hoverColor:u(this,z).hoverColor,text3dHoverColor:u(this,z).text3dHoverColor};let n=ty(u(this,z),r);if((n==null?void 0:n.type)==="custom-geometry"){let x=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(x.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let x=[];for(let I of n.userData.entities3D.values()){let P=this.getState(I);((P==null?void 0:P.type)==="geometry"||(P==null?void 0:P.type)==="model")&&x.push(P)}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(I=>u(this,z).geometry3DMap.get(I)).every(I=>I&&I.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(I=>this.getState(I)).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(x=>this.getState(x)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let x=n.components[0],S=n.object3d.parent,I=S==null?void 0:S.userData.entityId;return{id:n.id,type:"label",text:x.text||"",parent:{id:I,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:x.enabled,visible:x.visible,initialRank:rb(x.initialRank),options:{rank:rb(x.rank),appearance:x.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let x=n.components[0],S=n.object3d.parent,I=S==null?void 0:S.userData.entityId;return{id:n.id,type:"marker",enabled:x.enabled,visible:x.visible,anchor:x.options.anchor,dynamicResize:x.options.dynamicResize,parent:{id:I,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(n.position),element:x.containerEl,initialRank:rb(x.initialRank),options:{rank:rb(x.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:x.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:x,hoverColor:S,initialColor:I,initialTopColor:P,topColor:T}=n.components[1],M=n.components[0],w=n.components[1],E=n.components[2],B=n.components[3],D=n.parentObject3D;return{id:n.id,type:"geometry",opacity:w.opacity,initialColor:I,color:x,focusable:M.focusable,initialTopColor:P,topColor:T,hoverColor:S,hovered:!!(E!=null&&E.hover),height:w.height,visible:w.visible,outline:B==null?void 0:B.visible,showImage:w.showImage,texture:w.texture,topTexture:w.topTexture,flipImageToFaceCamera:w.flipImageToFaceCamera,parent:{id:D==null?void 0:D.userData.entityId,type:D==null?void 0:D.type},position:this.convert3DMapPositionToCoordinate(M.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let x=n.components[0],S=n.components[1],I=n.components[2];return{id:n.id,type:"model",position:x.mesh?this.convert3DMapPositionToCoordinate((i=x.mesh)==null?void 0:i.getWorldPosition(new Pe)):this.convert3DMapPositionToCoordinate(x.position),interactive:I!=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:Bd,scale:(c=S.scale)!=null?c:Nd}}else if((n==null?void 0:n.type)==="path"){let x=n.components[0],S=n.components[2],I=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(x.position),visible:I.visible,interactive:S!=null,completeFraction:x.completeFraction,color:I.color,accentColor:x.accentColor,nearRadius:x.nearRadius,farRadius:x.farRadius,animateArrowsOnPath:x.animateArrowsOnPath,displayArrowsOnPath:x.displayArrowsOnPath,nearZoomLevel:x.nearZoomLevel,farZoomLevel:x.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let x=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(x.position),visible:n.components[1].visible,verticalOffset:(p=x.feature.properties.verticalOffset)!=null?p:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof jc&&"textArea"in n.components[0].feature.properties){fJ(n);let x=n.components[0],S=n.components[1],{textMesh:I}=x,P=(f=x.mesh)==null?void 0:f.parent;P instanceof lt&&((m=P.children.find(w=>w.type==="batchedtext"))==null||m.getWorldPosition(u(this,d1))),u(this,hh).set(0,0,0);let T=I?I.getWorldPosition(u(this,hh)):u(this,hh);return Object.assign({},Rd,S.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(T.add(u(this,d1))),visible:(y=x.visible)!=null?y:!1,content:(v=x.feature.properties.content)!=null?v:""})}else return}}setState(r,n){var i,a;if(typeof r=="object"&&n==null){"hoverColor"in r&&(u(this,z).hoverColor=(i=r.hoverColor)!=null?i:u(this,z).hoverColor),"text3dHoverColor"in r&&(u(this,z).text3dHoverColor=(a=r.text3dHoverColor)!=null?a:u(this,z).text3dHoverColor);return}let o=ty(u(this,z),r);if(o!=null){if(o.type==="custom-geometry"){let l=u(this,z).geometry3DMap.get(o.id);if(l instanceof wt&&l.components[0]instanceof ch){let c=n;ua(o,u(this,z),c.visible),VI(o,c.altitude),l6(o,c.position,this.convertTo3DMapPosition),c6(o,this.getParentContainer(c.parent,!1))}}else if(o.type==="path"){let l=n;gn(o,l.interactive,u(this,z))&&u(this,Wt).call(this),VI(o,l.altitude),dJ(o,u(this,z),l)}else if(o.type==="model"){let l=n;gn(o,l.interactive,u(this,z))&&u(this,Wt).call(this),ua(o,u(this,z),l.visible),hJ(o,l)}else if(o.type==="group-container"){let l=n;ua(o,u(this,z),l.visible)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0,u(this,V).pathSystem.altitudeDirty=!0),VI(o,l.altitude)&&(u(this,V).pathSystem.altitudeDirty=!0),gn(o,l.interactive,u(this,z))&&u(this,Wt).call(this),p6(o,u(this,z),l.opacity)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0)}else if(o.type==="geometry-group"){let l=n;ua(o,u(this,z),l.visible)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),JK(o,u(this,z),l),zI(o,u(this,z),l.outline),l.height!=null&&s6(o,u(this,z),l.height),l.altitude!=null&&o.setAltitude(l.altitude),lJ(o,l),QK(o,l.shading),p6(o,u(this,z),l.opacity)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),gn(o,l.interactive,u(this,z))&&(u(this,Wt).call(this),u(this,Nr).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof yr){let l=n;ua(o,u(this,z),l.visible)&&(u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),zI(o,u(this,z),l.outline),eJ(o,l),d6(o,l.focusable)&&(u(this,V).geometryInFocusSystem.focusablesDirty=!0),pJ(o,l.renderOrder)&&(u(this,V).meshDetachmentSystem.dirty=!0),uJ(o,l.opacity)&&(u(this,V).meshDetachmentSystem.dirty=!0,u(this,V).outlineInterpolationSystem.outlineOpacitiesDirty=!0),u6(o,l.flipImageToFaceCamera),l.height!=null&&s6(o,u(this,z),l.height),cJ(o,l)&&(u(this,V).meshDetachmentSystem.dirty=!0),a6(o,l),iJ(o,l.hoverColor),gn(o,l.interactive,u(this,z)),sJ(o,l.hovered)}u(this,Wt).call(this)}else if(o.type==="label"||o.type==="marker"){let l=n;oJ(o,n,u(this,z)),rJ(o,n,u(this,z))&&(u(this,Nr).call(this),u(this,V).domMutationSystem.dirty=!0),l6(o,l.position,this.convertTo3DMapPosition),c6(o,this.getParentContainer(l.parent,!1))&&(u(this,Nr).call(this),u(this,V).panBoundsSystem.dirty=!0),tJ(o,l.enabled),ua(o,u(this,z),l.visible)}else if(o.type==="image"){let l=n;ua(o,u(this,z),l.visible),u6(o,l.flipImageToFaceCamera)}else if(o.type==="text3d"){let l=n;mJ(o,u(this,z),l)}this.render()}}convertTo3DMapPosition(r,n,o=0,i){var c,p,f,m,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}=E0((f=(p=u(this,z).center)==null?void 0:p[1])!=null?f:0,(y=(m=u(this,z).center)==null?void 0:m[0])!=null?y:0,r,n);return i?(i.set(a,l,o),i):new Pe(a,l,o)}get backgroundColor(){return typeof u(this,rn).backgroundColor=="string"?u(this,rn).backgroundColor:"#".concat(u(this,rn).backgroundColor.getHexString())}get backgroundAlpha(){return u(this,rn).backgroundAlpha}getThreeRenderer(){return u(this,rn)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?X8(n):void 0}isInView(r){let n=ty(u(this,z),r);if(u(this,p1).identity().multiply(u(this,Ir).projectionMatrix).multiply(u(this,Ir).matrixWorldInverse),u(this,ld).setFromProjectionMatrix(u(this,p1)),n instanceof Iu)return u(this,ld).containsPoint(n.position);if(n instanceof wt){let o=n==null?void 0:n.components[0];if(o instanceof ch||o instanceof zc)return u(this,ld).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 u(this,ld).intersectsBox(i)}}return!1}getSystems(){return u(this,V)}getInternalState(){return u(this,z)}getTweenGroup(){return u(this,z).tweenGroup}};wr=new WeakMap,Ir=new WeakMap,sd=new WeakMap,r1=new WeakMap,dh=new WeakMap,Jc=new WeakMap,ad=new WeakMap,fh=new WeakMap,bn=new WeakSet,xE=s(function(r){var n;u(this,Qc)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),u(this,z).pixelRatio=this.resolutionScale},"#setResolutionScale"),z=new WeakMap,Gt=new WeakMap,ss=new WeakMap,Sr=new WeakMap,ma=new WeakMap,rn=new WeakMap,V=new WeakMap,n1=new WeakMap,Nr=new WeakMap,Wt=new WeakMap,mQ=s(function(){A(this,Gt,document.createElement("div")),u(this,Gt).classList.add("mappedin__smart-collision-engine__container"),A(this,ss,document.createElement("canvas")),u(this,ss).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(u(this,Gt)),A(this,Sr,document.createElement("canvas")),u(this,Sr).classList.add("mappedin__smart-collision-engine__container"),u(this,Sr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Sr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Sr).style.width=u(this,Gt).clientWidth+"px",u(this,Sr).style.height=u(this,Gt).clientHeight+"px",u(this,Gt).appendChild(u(this,ss)),u(this,Gt).appendChild(u(this,Sr)),u(this,ss).width=u(this,Gt).clientWidth,u(this,ss).height=u(this,Gt).clientHeight,u(this,Sr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Sr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Sr).style.width=u(this,Gt).clientWidth+"px",u(this,Sr).style.height=u(this,Gt).clientHeight+"px"},"#renderEntity2DContainer"),hQ=s(function(){A(this,ma,document.createElement("div")),u(this,ma).classList.add("mappedin-2d-entities"),Object.assign(u(this,ma).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(u(this,ma))},"#renderEntityDOMContainer"),yQ=s(function(){u(this,Sr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Sr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Sr).style.width=u(this,Gt).clientWidth+"px",u(this,Sr).style.height=u(this,Gt).clientHeight+"px",u(this,ss).width=u(this,Gt).clientWidth,u(this,ss).height=u(this,Gt).clientHeight,u(this,Sr).width=u(this,Gt).clientWidth*this.resolutionScale,u(this,Sr).height=u(this,Gt).clientHeight*this.resolutionScale,u(this,Sr).style.width=u(this,Gt).clientWidth+"px",u(this,Sr).style.height=u(this,Gt).clientHeight+"px",u(this,V).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Qc=new WeakMap,o1=new WeakMap,i1=new WeakMap,s1=new WeakMap,a1=new WeakMap,VS=new WeakMap,l1=new WeakMap,c1=new WeakMap,u1=new WeakMap,mh=new WeakMap,IE=s(function(r,n,o,i){let a=new Iu(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i);return a.occluderId=o!=null?o:u(this,V).occlusion2DSystem.backgroundId,u(this,z).geometry2DMap.set(a.id,a),a},"#createEntity2D"),ld=new WeakMap,p1=new WeakMap,ro=new WeakMap,no=new WeakMap,SE=s(async function(){return Wc.load(QX).then(r=>{var n;return u(this,wr)&&((n=u(this,wr).environment)==null||n.dispose(),r.mapping=t8,u(this,wr).environment=r,this.render()),r})},"#loadEnvMap"),hh=new WeakMap,d1=new WeakMap,s(wE,"Core");var vE=wE,f1=vE;d();function w4e(e,t){M4e(e,t)(e.getScene(),t),O4e(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 p=window.URL.createObjectURL(l);c.href=p,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(p)},"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(w4e,"mountSceneGraphVisualizer");function M4e(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 p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(o,{height:c})},set flipImageToFaceCamera(c){let p=e.getState(o.id);(p==null?void 0:p.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 p=e.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.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 p=e.getState(o.id);(p==null?void 0:p.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 p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(p,{opacity:c})},get color(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry"&&c.color?Ce(c.color).toHexString():"#ffffff"},set color(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(p,{color:c})},set interactive(c){let p=e.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(e.setState(o,{interactive:c}),r.controllersRecursive().forEach(f=>f.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 p=e.getState(o.id);(p==null?void 0:p.type)==="path"&&e.setState(p,{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 p;let c=e.getState(o.id);return(c==null?void 0:c.type)==="marker"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="marker"&&(e.setState(p,{options:{interactive:c}}),r.controllersRecursive().forEach(f=>f.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 p;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(p=c.options)==null?void 0:p.interactive:!1},set interactive(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&(e.setState(p,{options:{interactive:c}}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},get text(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:c})},get"Text Color"(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:f.foregroundColor:"#000000"},set"Text Color"(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(o.id,{text:l.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.text)==null?void 0:f.size:10},set"Text Size"(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.iconSize:10},set"Icon Size"(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{foregroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var p,f,m;let c=e.getState(o.id);return(c==null?void 0:c.type)==="label"?(m=(f=(p=c.options.appearance)==null?void 0:p.marker)==null?void 0:f.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(c){var f,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l.text,options:{appearance:{marker:{backgroundColor:{...(m=(f=p.options.appearance)==null?void 0:f.marker)==null?void 0:m.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 p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{opacity:c})},set visible(c){let p=e.getState(o.id);(p==null?void 0:p.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 p=e.getState(o.id);(p==null?void 0:p.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 p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&(e.setState(o,{interactive:c}),r.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.start)!=null?f:0},set shadingStart(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{start:c}})},get shadingEnd(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.end)!=null?f:0},set shadingEnd(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{end:c}})},get shadingIntensity(){var p,f;let c=e.getState(o.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(p=c.shading)==null?void 0:p.intensity)!=null?f:0},set shadingIntensity(c){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{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 p=e.getState(o.id);(p==null?void 0:p.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 p=e.getState(o.id);(p==null?void 0:p.type)==="group-container"&&(e.setState(p,{interactive:c}),r.controllersRecursive().forEach(f=>f.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(M4e,"createParseChild");function O4e(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(O4e,"createWatermarkChild");var gQ="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",E4e="https://auth.mappedin.com/oauth2/token";async function bQ(e,t){var r,n,o,i,a;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:l,MercatorCoordinate:c}=await import("./outdoor-context-v4-NRZ3P73G.js"),p=t.outdoorView.headers;p==null&&(p=await H8(E4e));let f=t.center||[0,0],m=new l({container:e,style:t.outdoorView.style||gQ,center:f,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:TE,pitch:(o=t.pitch)!=null?o:CE,bearing:(i=t.bearing)!=null?i:PE,transformRequest:G8(p),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Fd(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),y=m.painter.context.gl,v=new f1(e,{center:f,zoomLevel:m.getZoom(),pitch:m.getPitch(),bearing:m.getBearing(),gl:y,map:m,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}),x={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(v.camera.minZoomLevel),m.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",w=>{x.center=w.center,x.zoom=w.zoomLevel,x.bearing=w.bearing,x.pitch=w.pitch,m.jumpTo(x)});let S=c.fromLngLat(f,0),I=_0(S,v.viewCamera,v.camera,()=>{v.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(I),v.renderSync())});let P=!1,T=!1;m.on("idle",()=>{m&&(P||(v.publish("outdoor-view-loaded"),P=!0),T||(T=!0,v.publish("outdoor-style-loaded")))});let M=s(w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(m)},"updateData");return m.on("styledata",w=>{m&&w&&w.dataType==="style"&&w.type==="styledata"&&(T=!1),M(w)}),m.on("sourcedata",M),m.on("terrain",M),m.on("error",w=>{var E;if(((E=w.error)==null?void 0:E.url)===gQ){j.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}j.warn(w)}),v}else return new f1(e,t)}s(bQ,"createRenderer");d();d();d();var m1=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(m1||{}),h1=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(h1||{});d();d();var yh=class yh{constructor(t,r,n){h(this,"id");h(this,"text");h(this,"target");h(this,"__type",yh.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===yh.__type}get focusTarget(){return this.target.anchorTarget}};s(yh,"Label"),h(yh,"__type","Label");var eu=yh;d();var cd,gh=class gh{constructor(t,r,n){h(this,"id");O(this,cd);h(this,"__type",gh.__type);h(this,"contentEl");this.id=t,this.contentEl=r,A(this,cd,n)}get target(){return u(this,cd)}get coordinate(){return u(this,cd).anchorTarget}static is(t){return t.__type===gh.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){A(this,cd,t)}};cd=new WeakMap,s(gh,"Marker"),h(gh,"__type","Marker");var Al=gh;d();var g1,b1,bh=class bh{constructor(t,r,n){O(this,g1);O(this,b1);h(this,"target");h(this,"__type",bh.__type);A(this,g1,t),A(this,b1,r),this.target=n}static is(t){return t.__type===bh.__type}get id(){return u(this,g1)}get url(){return u(this,b1)}};g1=new WeakMap,b1=new WeakMap,s(bh,"Image"),h(bh,"__type","Image");var y1=bh;d();var xh,vh=class vh{constructor(t,r,n){h(this,"id");h(this,"groupId");h(this,"__type",vh.__type);O(this,xh);this.id=t,this.groupId=r,A(this,xh,n)}get target(){return u(this,xh)}static is(t){return t.__type===vh.__type}updateTarget(t){A(this,xh,t)}};xh=new WeakMap,s(vh,"Model"),h(vh,"__type","Model");var ud=vh;d();var Ih=class Ih{constructor(t,r){h(this,"id");h(this,"coordinates");h(this,"__type",Ih.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===Ih.__type}get focusTarget(){return this.coordinates}};s(Ih,"PathSegment"),h(Ih,"__type","PathSegment");var Ch=Ih,Sh=class Sh{constructor(t,r,n,o){h(this,"id");h(this,"animation");h(this,"coordinates");h(this,"segments");h(this,"__type",Sh.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=o.map(({id:i,coordinates:a})=>new Ch(i.toString(),a))}static is(t){return t.__type===Sh.__type}get focusTarget(){return this.coordinates}};s(Sh,"Path"),h(Sh,"__type","Path");var as=Sh;d();var tu,ME=class ME{constructor(t){O(this,tu);A(this,tu,t)}get center(){return u(this,tu).center}get bearing(){return u(this,tu).bearing}get pitch(){return u(this,tu).pitch}get zoomLevel(){return u(this,tu).zoomLevel}};tu=new WeakMap,s(ME,"CameraTransform");var v1=ME;d();var Ph=class Ph{constructor(t){h(this,"id");h(this,"__type",Ph.__type);this.id=t}static is(t){return t.__type===Ph.__type}get focusTarget(){return this}};s(Ph,"Shape"),h(Ph,"__type","Shape");var ru=Ph;d();var x1=class x1{constructor(t,r){h(this,"id");h(this,"target");h(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===x1.__type}};s(x1,"Text3D"),h(x1,"__type","Text3D");var nu=x1;d();d();d();var _4e=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>']]),A4e=/<svg([^>]*)>/g;function vQ(e,t,r){let n=_4e.get(e);return n?n.replace(A4e,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}s(vQ,"getStyledIcon");var k4e=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"),D4e=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"),OE="#722ED1",EE="#1890FF",xQ=s(({type:e="departure",color:t=EE})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?k4e(t):D4e(t),"\n </div>"),"DroppedPin"),F4e=s(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),IQ=s(({type:e="stairs",color:t=OE,direction:r="up"})=>{let n=F4e("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(vQ("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");d();var SQ=s(async e=>new Promise(t=>setTimeout(t,e)),"ms");var L4e={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},R4e={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},ou={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:L4e,inactivePathOptions:R4e,markerOptions:{departureColor:EE,destinationColor:OE},animatePathDrawing:!0},kl,ls,Dl,at,S1,Fl,pd,Br,cs,Co,us,iu,Mr,CQ,PQ,_E,zS,Th,AE,wh,kE=class kE{constructor(t,r,n){O(this,Mr);O(this,kl,new Map);O(this,ls);O(this,Dl);O(this,at,ou);O(this,S1);O(this,Fl);O(this,pd);O(this,Br,[]);O(this,cs);O(this,Co,new Map);O(this,us,new Map);O(this,iu,new Map);O(this,wh,s(t=>{var r;if((r=u(this,at).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=u(this,kl).get(t.markers[0]);n!=null&&n.action.toFloor&&(u(this,at).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,ls,t),A(this,S1,n),A(this,Dl,r)}get currentMap(){return u(this,S1).call(this)}get isMultiFloor(){if(!u(this,Br).length)return!1;let t=new Set;for(let r of u(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 u(this,Co).get(t)}getMarkerById(t){return u(this,kl).get(t)}get paths(){let t=new Set;return u(this,Co).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return u(this,iu).get(u(this,cs))}get activePath(){var t;if(u(this,cs))return(t=u(this,Co).get(u(this,cs).id))==null?void 0:t.path}get floorStacks(){let t=u(this,Dl).getMapData();if(!u(this,Br).length||!t)return[];let r=new Set;for(let n of u(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=u(this,Dl).getMapData();if(!u(this,Br).length||!t)return[];let r=new Set;for(let n of u(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=u(this,Br)[t];if(!u(this,Br).length){j.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!u(this,Br)[t]){j.warn("Direction #".concat(t," does not exist"));return}let n=u(this,us).get(r);if(!n){j.warn("The direction is not a part of muli-direcional path");return}te(this,Mr,zS).call(this,n)}setActivePath(t){if(!u(this,Br).length){j.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!u(this,iu).get(t)){j.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}te(this,Mr,zS).call(this,t)}setActivePathByDirections(t){if(!u(this,Br).length){j.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=u(this,us).get(t);if(!r){j.warn("The direction is not a part of muli-direcional path");return}te(this,Mr,zS).call(this,r)}drawSync(t,r={}){var l,c,p;u(this,pd)&&this.clear(),A(this,pd,!0),te(this,Mr,_E).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&&u(this,at).setMapToDeparture&&this.currentMap.setFloor(a.floorId),(l=u(this,at).createMarkers)!=null&&l.departure&&te(this,Mr,Th).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let f=0;f<n.length;f++){let m=n[f],y=f?{...u(this,at).inactivePathOptions}:{...u(this,at).pathOptions};if(m.coordinates.length<2){j.warn("Directions must have at least 2 coordinates");return}let v=this.currentMap.Paths.add(m.coordinates,{...y,animateDrawing:u(this,at).animatePathDrawing}),x=v.paths.map(I=>I.id.toString()),S=new as(_t(),v.animation,m.coordinates,v.paths);for(let I of x){u(this,Co).set(I,{path:S,entityIds:x});let P=f?{...u(this,at).inactivePathOptions,altitude:0}:{...u(this,at).pathOptions,altitude:.05};u(this,ls).setState(I,P)}u(this,Co).set(S.id,{path:S,entityIds:x}),u(this,us).set(m,S),u(this,iu).set(S,m),(c=u(this,at).createMarkers)!=null&&c.connection&&te(this,Mr,AE).call(this,m.instructions,"connection"),f===0&&(A(this,cs,u(this,us).get(u(this,Br)[0])),u(this,ls).on("click",u(this,wh)))}(p=u(this,at).createMarkers)!=null&&p.destination&&te(this,Mr,Th).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),u(this,Dl).mapObjects.forEach(f=>{f.processFloorChange(f.currentFloorId)})}async draw(t,r={}){u(this,Fl)&&this.clear(),te(this,Mr,_E).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0].coordinates[0];return A(this,Br,n),i.floorId&&u(this,at).setMapToDeparture&&this.currentMap.setFloor(i.floorId),te(this,Mr,PQ).call(this,n)}clear(){u(this,kl).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),u(this,kl).clear(),u(this,Co).forEach(({path:t,entityIds:r})=>{u(this,Co).delete(t.id),r.forEach(n=>u(this,Co).delete(n)),this.currentMap.Paths.remove(r)}),u(this,Fl)&&(u(this,Fl).cancel(),A(this,Fl,void 0)),u(this,pd)&&A(this,pd,!1),A(this,Br,[]),u(this,us).clear(),u(this,iu).clear(),A(this,cs,void 0),u(this,ls).off("click",u(this,wh)),u(this,Dl).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};kl=new WeakMap,ls=new WeakMap,Dl=new WeakMap,at=new WeakMap,S1=new WeakMap,Fl=new WeakMap,pd=new WeakMap,Br=new WeakMap,cs=new WeakMap,Co=new WeakMap,us=new WeakMap,iu=new WeakMap,Mr=new WeakSet,CQ=s(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),PQ=s(function(t){let r=t[0],n=t[t.length-1],o=!1;return A(this,Fl,{promise:new Promise(async i=>{var a,l,c;if(b.env.NODE_ENV!=="test"&&await SQ(500),o||!t.length){i();return}(a=u(this,at).createMarkers)!=null&&a.departure&&te(this,Mr,Th).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let p=0;p<t.length;p++){let f=t[p],m=p?{...u(this,at).inactivePathOptions}:{...u(this,at).pathOptions};if(f.coordinates.length<2){j.warn("Directions must have at least 2 coordinates"),i();return}let y=this.currentMap.Paths.add(f.coordinates,{...m,animateDrawing:u(this,at).animatePathDrawing}),v=y.paths.map(S=>S.id.toString()),x=new as(_t(),y.animation,f.coordinates,y.paths);for(let S of v){u(this,Co).set(S,{path:x,entityIds:v});let I=p?{...u(this,at).inactivePathOptions,altitude:0}:{...u(this,at).pathOptions,altitude:.05};u(this,ls).setState(S,I)}if(u(this,Co).set(x.id,{path:x,entityIds:v}),u(this,us).set(f,x),u(this,iu).set(x,f),b.env.NODE_ENV!=="test"&&await y.animation,o){i();return}(l=u(this,at).createMarkers)!=null&&l.connection&&te(this,Mr,AE).call(this,f.instructions,"connection"),p===0&&(A(this,cs,u(this,us).get(u(this,Br)[0])),u(this,ls).on("click",u(this,wh)))}if((c=u(this,at).createMarkers)!=null&&c.destination&&te(this,Mr,Th).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),o){i();return}u(this,Dl).mapObjects.forEach(p=>{p.processFloorChange(p.currentFloorId)}),i()}),cancel:s(()=>{o=!0},"cancel")}),u(this,Fl).promise},"#drawAsync"),_E=s(function(t){var r,n,o;A(this,at,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:ou.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:ou.setMapToDeparture,pathOptions:{...ou.pathOptions,...t.pathOptions},inactivePathOptions:{...ou.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...ou.createMarkers,...t.createMarkers},markerOptions:{...ou.markerOptions,...t.markerOptions},animatePathDrawing:(o=t.animatePathDrawing)!=null?o:ou.animatePathDrawing})},"#setupOptions"),zS=s(function(t){A(this,cs,t),u(this,Br).forEach(r=>{let n=u(this,us).get(r);if(n){let o=u(this,Co).get(n.id),i=o.path.id===u(this,cs).id?{...u(this,at).pathOptions,altitude:.05}:{...u(this,at).inactivePathOptions,altitude:0};o.entityIds.forEach(a=>{u(this,ls).setState(a,i)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),Th=s(function(t,r,n){var o,i,a,l,c;if(r==="connection"&&n){let p=n.action.type==="ExitConnection"?u(this,at).markerOptions.departureColor:u(this,at).markerOptions.destinationColor,f;if(typeof((o=u(this,at).createMarkers)==null?void 0:o.connection)=="function"){let y=u(this,at).createMarkers.connection(n);u(this,ls).setState(y.id.toString(),{options:{interactive:!0}}),f={id:y.id,type:"marker"}}else f=this.currentMap.Markers.add(n.coordinate,IQ({type:(a=(i=n.action.connection)==null?void 0:i.type)!=null?a:n.action.connectionType,color:p,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(f.id.toString());if(!m)throw new Error("marker component should exist");u(this,kl).set(f.id,{instruction:n,marker:new Al(f.id.toString(),m,n.coordinate)})}else{let p=r==="departure"?u(this,at).markerOptions.departureColor:u(this,at).markerOptions.destinationColor,f;typeof((l=u(this,at).createMarkers)==null?void 0:l.departure)=="function"&&r==="departure"?f={id:u(this,at).createMarkers.departure(n).id,type:"marker"}:typeof((c=u(this,at).createMarkers)==null?void 0:c.destination)=="function"&&r==="destination"?f={id:u(this,at).createMarkers.destination(n).id,type:"marker"}:f=this.currentMap.Markers.add(t,xQ({type:r,color:p}),{anchor:"top",rank:"always-visible"}),u(this,kl).set(f.id,void 0)}},"#addMarker"),AE=s(function(t,r){t.filter(o=>te(this,Mr,CQ).call(this,o.action)).forEach(o=>{te(this,Mr,Th).call(this,o.coordinate,r,o)})},"#addMarkers"),wh=new WeakMap,s(kE,"Navigation");var I1=kE;d();d();d();var N4e=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>']]),B4e=/<svg([^>]*)>/g;function TQ(e,t,r){let n=N4e.get(e);return n?n.replace(B4e,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}s(TQ,"getStyledIcon");var dd,Mh,Po,DE,wQ,MQ,FE,OQ,LE=class LE{constructor(t,r){O(this,Po);O(this,dd);O(this,Mh);h(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});A(this,dd,t),A(this,Mh,r)}auto(){let t=[],r=u(this,Mh)[Object.keys(u(this,Mh))[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=u(this,dd).Labels.add(o,i,te(this,Po,DE).call(this,n));t.push(a)}});else{n.__type==="space"&&n.name!==""&&u(this,dd).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let o=n.name;if(o){let i=u(this,dd).Labels.add(n,o,te(this,Po,DE).call(this,n));t.push(i)}}}),{labels:t}}};dd=new WeakMap,Mh=new WeakMap,Po=new WeakSet,DE=s(function(t){let r=TQ(te(this,Po,wQ).call(this,t),"white",12);return{appearance:{text:{foregroundColor:te(this,Po,FE).call(this,t)},marker:{foregroundColor:{active:te(this,Po,FE).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:te(this,Po,OQ).call(this,t)}},"#generatLabelAppearance"),wQ=s(function(t){return t.__type==="connection"?te(this,Po,MQ).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),MQ=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"),FE=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"),OQ=s(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),s(LE,"Labels");var HS=LE;var RE=class RE{constructor(t,r){h(this,"Labels");h(this,"auto",s(()=>this.Labels.auto(),"auto"));this.Labels=new HS(t,r)}};s(RE,"DefaultTheme");var WS=RE;d();var je,P1,Ll,qS,NE,BE=class BE{constructor(t){O(this,Ll);O(this,je);O(this,P1);h(this,"interactions",{set:s(t=>{(t==null?void 0:t.pan)!=null&&(u(this,je).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(u(this,je).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(u(this,je).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:s(()=>{u(this,je).getSystems().cameraSystem.enablePan=!0,u(this,je).getSystems().cameraSystem.enableZoom=!0,u(this,je).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:s(()=>{u(this,je).getSystems().cameraSystem.enablePan=!1,u(this,je).getSystems().cameraSystem.enableZoom=!1,u(this,je).getSystems().cameraSystem.enableRotate=!1},"disable")});h(this,"setMinPitch",s(t=>{u(this,je).camera.setMinPitch(t)},"setMinPitch"));h(this,"setMaxPitch",s(t=>{u(this,je).camera.setMaxPitch(t)},"setMaxPitch"));h(this,"setMinZoomLevel",s(t=>{u(this,je).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));h(this,"setMaxZoomLevel",s(t=>{u(this,je).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));A(this,P1,t),A(this,je,t.core)}setScreenOffsets(t){u(this,je).camera.setInsetPadding(t)}get screenOffsets(){return u(this,je).camera.insetsPadding}get panMode(){return u(this,je).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&u(this,je).camera.setPanMode(t)}getFocusOnTransform(t,r){var o;let n=u(this,je).camera.getCameraFrameForCoordinates(te(this,Ll,NE).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 Le(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return u(this,je).camera.focusOn(te(this,Ll,NE).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 u(this,je).camera.animateTo({center:n!=null?[l.longitude,l.latitude,u(this,je).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];u(this,je).camera.setCenter(a),u(this,je).camera.setZoomLevel(n),u(this,je).camera.setBearing(o),u(this,je).camera.setPitch(i)}get center(){let t=u(this,je).camera.center;return new Le(t[1],t[0],void 0)}setAutoMinZoomLevel(t){u(this,je).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return u(this,je).camera.autoMinZoomLevel}get zoomLevel(){return u(this,je).camera.zoomLevel}get pitch(){return u(this,je).camera.pitch}get minPitch(){return u(this,je).camera.minPitch}get maxPitch(){return u(this,je).camera.maxPitch}get bearing(){let t=u(this,je).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return u(this,je).camera.minZoomLevel}get maxZoomLevel(){return u(this,je).camera.maxZoomLevel}setElevation(t){u(this,je).camera.setElevation(t)}get elevation(){return u(this,je).camera.elevation}animateElevation(t,r){return u(this,je).camera.animateElevation(t,r)}updateFacadesInView(){u(this,je).getSystems().geometryInFocusSystem.raycast()}};je=new WeakMap,P1=new WeakMap,Ll=new WeakSet,qS=s(function(t){var n,o,i,a,l,c;let r=u(this,je).camera.elevation;return Le.is(t)&&t.floorId!=null?(o=(n=u(this,je).getState(t.floorId))==null?void 0:n.altitude)!=null?o:r:ao.is(t)?(a=(i=u(this,je).getState(t.id))==null?void 0:i.altitude)!=null?a:r:"floor"in t&&ao.is(t.floor)&&(c=(l=u(this,je).getState(t.floor.id))==null?void 0:l.altitude)!=null?c:r},"#getFloorAltitude"),NE=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(Le.is(a)){let l=te(this,Ll,qS).call(this,a);r.push([a.longitude,a.latitude,l])}else if((a==null?void 0:a.id)!=null){let l=te(this,Ll,qS).call(this,a);if(ao.is(a)&&((i=u(this,P1).getMapDataInternal())!=null&&i.enterpriseMode)){r.push(a.id);continue}else if("geoJSON"in a&&a.geoJSON.geometry.coordinates.length>0){_8(a.geoJSON,p=>{r.push([p[0],p[1],l])});continue}let c=u(this,je).getBoundingArea(a.id);if(c)r.push(...c.map(p=>[p[0],p[1],l]));else if("geoJSONBoundingBox"in a){let p=te(this,Ll,qS).call(this,a);if(a.geoJSONBoundingBox!=null){let f=[[a.geoJSONBoundingBox[0],a.geoJSONBoundingBox[1],p],[a.geoJSONBoundingBox[2],a.geoJSONBoundingBox[3],p]];r.push(...f)}}}else F3(a)&&r.push(a);return r},"#computeCoordinateCloud"),s(BE,"Camera");var C1=BE;d();var Oh,$E=class $E{constructor({currentMapGetter:t}){O(this,Oh);A(this,Oh,t)}get currentMap(){return u(this,Oh).call(this)}async getCurrentSceneGLTF(t){let r=u(this,Oh).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(j.error("There is no map to export. Please load a map first."),new Blob)}};Oh=new WeakMap,s($E,"Exporter");var T1=$E;d();var ha,M1,jE=class jE{constructor({currentMapGetter:t}){O(this,ha,new Map);O(this,M1);A(this,M1,t)}get currentMap(){return u(this,M1).call(this)}getById(t){return u(this,ha).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,{...n,attachTo:Eh(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank}),l=new eu(a.id.toString(),r,t);return u(this,ha).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 eu(o.toString(),i,a);u(this,ha).set(l.id,{label:l,entityId:l.id}),r.push(l)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=u(this,ha).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),u(this,ha).delete(t.id.toString()))}removeAll(){let t=[];return u(this,ha).forEach(({label:r})=>{this.remove(r),t.push(r),u(this,ha).delete(r.id.toString())}),t}};ha=new WeakMap,M1=new WeakMap,s(jE,"Labels");var w1=jE;d();d();var GE={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},EQ={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},_Q=.5,zE=class zE{constructor(t,r,n=new Map){h(this,"containerId");h(this,"layers");h(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(zE,"Layer");var Rl=zE,fd,HE=class HE{constructor(t,r,n,o,i,a,l,c){h(this,"id");h(this,"name");h(this,"elevation");h(this,"containerId");h(this,"externalId");h(this,"metadata");h(this,"shortName");h(this,"subtitle");h(this,"occluderId");h(this,"loaded",!1);h(this,"styleMap",{});h(this,"obstructions");h(this,"entrances");h(this,"spaces");h(this,"floorImages");h(this,"floorText");h(this,"renderer");h(this,"options");h(this,"layers",new Map);h(this,"footprint");h(this,"floorStackId");h(this,"multiFloorView");h(this,"mapDataInternal");h(this,"facadesByStyleId",new Map);O(this,fd);h(this,"load",s(()=>{var o,i,a,l,c,p,f,m,y,v,x,S,I,P;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Ba,"-").concat(this.id),{},this.id);this.layers.set(Ba,new Rl(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(As,"-").concat(this.id),{},this.id);this.layers.set(As,new Rl(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Or,"-").concat(this.id),{},this.id);if(this.layers.set(Or,new Rl(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 T=GE;if(this.obstructions!=null&&this.obstructions.features.length>0){let E=this.obstructions.features.filter(B=>B.geometry.type==="LineString"&&B.properties.kind==="Wall"&&B.properties.footprintComponent===!0);E!=null&&E.length>0&&(T=this.styleMap[(a=E[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)}}]},{...T,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":T.color,renderOrder:2},this.id);this.layers.set(my,new Rl(this.renderer,M.id.toString()));let w=this.renderer.addGroupContainer("".concat(Qd,"-").concat(this.id),{},this.id);this.layers.set(Qd,new Rl(this.renderer,w.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,w.id)}if(this.spaces!=null&&this.spaces.features.length>0){let T=[],M=new Map;this.spaces.features.filter(D=>{var F;return D.geometry.type==="Polygon"&&((F=D.properties.kind)==null?void 0:F.toLowerCase())!=="void"}).forEach(D=>{var L;let F=(L=this.mapDataInternal)==null?void 0:L.facadesBySpaceId[D.properties.id];if(F){let H=M.get(F.id)||[];M.set(F.id,[...H,D])}else T.push(D)});let w=ZS(T,this.styleMap),E=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),B=0;for(let[D,F]of w){let L=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(B),{features:F},_h(D,this.options),E);B++;let H=E.id.toString();this.layers.get(Or).layers.set(D.id||H,L.id.toString())}if(M.size>0){let D=this.renderer.addGroupContainer("".concat(Au,"-").concat(this.id),{},this.id);this.layers.set(Au,new Rl(this.renderer,D.id.toString()));for(let[F,L]of M){let H=this.renderer.addGroupContainer(F,{focusable:!0},D),U=this.renderer.addGroupContainer("".concat(F,"-geometry"),{},H),G=ZS(L,this.styleMap),J=0;for(let[X,ie]of G){let ee=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(F,"-").concat(J),{features:ie},{..._h(X,this.options),renderOrder:3},U);J++;let ge=X.id||ee.id.toString();this.layers.get(Au).layers.set("".concat(F,"-").concat(ge),ee.id.toString()),this.facadesByStyleId.has(ge)?(p=this.facadesByStyleId.get(ge))==null||p.push(F):this.facadesByStyleId.set(ge,[F])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let T=this.obstructions.features.filter(U=>U.geometry.type==="Polygon"&&U.properties.kind==="object"),M=ZS(T,this.styleMap),w=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),E=0;for(let[U,G]of M){let J=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(E),{features:G},_h(U,this.options),w);E++;let X=w.id.toString();this.layers.get(Or).layers.set(U.id||X,J.id.toString())}let B=this.obstructions.features.filter(U=>U.geometry.type==="LineString"&&U.properties.kind==="Wall"&&U.properties.footprintComponent===!1),D=this.obstructions.features.filter(U=>U.geometry.type==="LineString"&&U.properties.kind==="Wall"&&U.properties.footprintComponent===!0),F=this.entrances,L=GE,H=GE;if(B!=null&&B.length>0){let U=this.styleMap[(f=B[0].properties)==null?void 0:f.id];U!=null&&(L={...U}),H=L;let{walls:G,entrances:J}=UE(B,(F==null?void 0:F.features)||[]),X=Math.max(L.height-.11,_Q),ie={...EQ,height:X},ee=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),J,ie,n);this.layers.get(Or).layers.set(Kd,ee.id.toString());let ge=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[G]},_h(L,this.options),n);this.layers.get(Or).layers.set(oc,ge.id.toString())}if(D!=null&&D.length>0){let U=this.styleMap[(m=D[0].properties)==null?void 0:m.id];U!=null&&(H={...U,id:_s});let{walls:G,entrances:J}=UE(D,(F==null?void 0:F.features)||[]),X=Math.max(H.height-.11,_Q),ie={...EQ,height:X},ee=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),J,ie,n);this.layers.get(Or).layers.set(Jd,ee.id.toString());let ge=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[G]},_h(H,this.options),n);this.layers.get(Or).layers.set(_s,ge.id.toString())}}if(this.floorImages!=null){let T=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(_t(),M,{url:M.properties.path,flipImageToFaceCamera:(v=this.options.flipImagesToFaceCamera)!=null?v:!0},T);this.layers.set(J8,new Rl(this.renderer,T.id.toString()))}if(this.floorText!=null)for(let T of this.floorText.features||[]){let M=0;"geometryId"in T.properties?M=(S=(x=this.renderer.getState(T.properties.geometryId))==null?void 0:x.height)!=null?S:0:M=(I=T.properties.verticalOffset)!=null?I:0,this.renderer.addText3D(_t(),{...T,properties:{...T.properties,verticalOffset:M}},{},this.id)}return(P=this.multiFloorView)!=null&&P.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var f,m,y,v;this.id=r.id,this.options=i;let p=n.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=p.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=(f=a.floorImages)==null?void 0:f[this.id],this.floorText=(y=(m=a.enterprise)==null?void 0:m.floorText)==null?void 0:y[this.id],this.footprint=(v=a["floor.geojson"])==null?void 0:v.features.find(x=>x.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=o,this.mapDataInternal=c}get geoJSONBoundingBox(){if(u(this,fd))return u(this,fd);if(!this.footprint){j.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return A(this,fd,XS(this.footprint)),u(this,fd)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};fd=new WeakMap,s(HE,"FloorObject");var O1=HE;d();var WE=50,qE=!1,$4e=1e3,hr,Ah,ya,ps,vn,_1,au,kh,md,To,XE,hd,A1,k1,D1,F1,Nl,FQ,L1,lu,YE,LQ,RQ,yd,KE=class KE extends Fe{constructor({currentMapGetter:r}){super();O(this,To);O(this,hr);O(this,Ah,0);O(this,ya);O(this,ps,!1);O(this,vn,[]);O(this,_1,0);O(this,au,WE);O(this,kh,!1);O(this,md,"collapsed");h(this,"expandedFactor",0);O(this,hd,"all-floors");O(this,A1,s(()=>{let r=u(this,hr).call(this);if(u(this,_1)===this.expandedFactor||r==null||!u(this,ps))return;A(this,_1,this.expandedFactor);let n=Ts(this.expandedFactor,0,1,0,this.distanceBetweenFloors),i=Ts(this.expandedFactor,0,.1,0,1)===0;u(this,vn).forEach((a,l)=>{r.api.updateState(a.containerId,{visible:i?a.id===r.currentFloorId:!0,altitude:n*l})}),this.expandedFactor===0?(A(this,ps,!1),r.renderer.camera.setPanMode("default"),u(this,lu)&&u(this,lu).call(this)):this.expandedFactor===1&&(A(this,ps,!1),u(this,lu)&&u(this,lu).call(this))},"#handlePreRender"));O(this,k1,s(()=>{var r,n,o;this.expanded&&A(this,Ah,(n=(r=u(this,hr).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(o=u(this,hr).call(this))==null||o.renderer.on("user-interaction-end",u(this,F1))},"#handleUserInteractionStart"));O(this,D1,s(()=>{var n;let r=u(this,hr).call(this);if(r!=null&&this.expanded&&u(this,kh)&&!u(this,ps)){let o=r.currentFloorId,i=[1/0,r.currentFloorId];for(let a=0;a<u(this,vn).length;a++){let l=u(this,vn)[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],u(this,vn).forEach(a=>{r.api.updateState(a.containerId,{visible:u(this,hd)==="all-floors"?!0:r.currentFloor.id===a.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:o}))}},"#determineCurrentMapBasedOnElevation"));O(this,F1,s(()=>{var n,o;let r=u(this,hr).call(this);if(this.expanded&&r&&u(this,Ah)!==((n=r.renderer.camera.elevation)!=null?n:0)){let i=[1/0,r.currentFloorId,0];for(let a=0;a<u(this,vn).length;a++){let l=u(this,vn)[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)}u(this,kh)&&te(this,To,FQ).call(this,i[2]),A(this,Ah,0),r.renderer.off("user-interaction-end",u(this,F1))}},"#handleUserInteractionEnd"));O(this,Nl,null);O(this,L1,null);O(this,lu);O(this,yd);A(this,hr,r);let n=u(this,hr).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",u(this,k1)),n.renderer.on("camera-change",u(this,D1)),n.renderer.on("pre-render",u(this,A1)))}get state(){return u(this,md)}get expanded(){return u(this,md)!=="collapsed"}get distanceBetweenFloors(){if(u(this,au)==="auto"){if(u(this,yd)!=null)return u(this,yd);let r=te(this,To,RQ).call(this);if(r)return A(this,yd,r),r}return typeof u(this,au)=="number"?u(this,au):WE}clearCachedFloorSeparationDistance(){A(this,yd,void 0)}get includedFloors(){var r;return(r=u(this,To,XE))!=null&&r.api.mapData?u(this,vn).map(n=>{var o,i;return(i=(o=u(this,To,XE))==null?void 0:o.api.mapData)==null?void 0:i.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return u(this,hd)}setFloorVisiblityMode(r){A(this,hd,r);let n=u(this,hr).call(this);n!=null&&u(this,vn).forEach(o=>{n.api.updateState(o.containerId,{visible:u(this,hd)==="all-floors"?!0:n.currentFloor.id===o.id})})}changeFloorOnElevationChanges(r){A(this,kh,r)}async expand(r){var o,i,a;let n=u(this,hr).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?A(this,au,"auto"):A(this,au,(o=r==null?void 0:r.distanceBetweenFloors)!=null?o:WE),A(this,vn,(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),u(this,vn).sort((l,c)=>l.elevation-c.elevation),u(this,vn).length<=1||this.expanded===!0?Promise.resolve():(A(this,ps,!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,To,YE).call(this,"expand",r).then(()=>{A(this,md,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{A(this,ps,!1)}))}async collapse(r){let n=u(this,hr).call(this);if(n!=null)return this.expanded===!0?(A(this,ps,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),te(this,To,YE).call(this,"collapse",r).then(()=>{A(this,md,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{A(this,ps,!1)})):Promise.resolve()}destroy(){let r=u(this,hr).call(this);r!=null&&(r.renderer.off("user-interaction-start",u(this,k1)),r.renderer.off("camera-change",u(this,D1)),r.renderer.off("pre-render",u(this,A1)))}};hr=new WeakMap,Ah=new WeakMap,ya=new WeakMap,ps=new WeakMap,vn=new WeakMap,_1=new WeakMap,au=new WeakMap,kh=new WeakMap,md=new WeakMap,To=new WeakSet,XE=s(function(){return u(this,hr).call(this)},"#currentMap"),hd=new WeakMap,A1=new WeakMap,k1=new WeakMap,D1=new WeakMap,F1=new WeakMap,Nl=new WeakMap,FQ=s(function(r){var o,i,a;u(this,Nl)&&u(this,Nl).stop();let n=u(this,hr).call(this);n!=null&&(A(this,Nl,new So({elevation:(o=n.renderer.camera.elevation)!=null?o:0}).to({elevation:r},150).easing(Ar.Quadratic.Out).onComplete(()=>{var l;u(this,Nl)&&((l=u(this,hr).call(this))==null||l.renderer.getTweenGroup().remove(u(this,Nl)))}).onUpdate(({elevation:l})=>{n.renderer.camera.setElevation(l)}).start()),(i=u(this,hr).call(this))==null||i.renderer.getTweenGroup().add(u(this,Nl)),(a=u(this,hr).call(this))==null||a.renderer.render())},"#animateElevationTo"),L1=new WeakMap,lu=new WeakMap,YE=s(function(r,n){var l,c,p,f;u(this,ya)&&u(this,ya).stop();let o=u(this,hr).call(this);if(o==null)return Promise.reject(new Error("No current map"));let i=u(this,vn).indexOf(o.currentFloor),a=(l=o.renderer.camera.elevation)!=null?l:0;return A(this,L1,new Promise(m=>{A(this,lu,m)})),A(this,ya,new So({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(c=n==null?void 0:n.duration)!=null?c:$4e).easing(Ol[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m;let y=i*this.distanceBetweenFloors;o.renderer.camera.setElevation(r==="expand"?y*m:a*m)}).onComplete(()=>{var m;u(this,ya)&&((m=u(this,hr).call(this))==null||m.renderer.getTweenGroup().remove(u(this,ya)))}).start()),u(this,ya).cameraAnimation=!0,(p=u(this,hr).call(this))==null||p.renderer.getTweenGroup().add(u(this,ya)),(f=u(this,hr).call(this))==null||f.renderer.render(),u(this,L1)},"#animate"),LQ=s(function(r,n,o,i){let a=ZE(r,o),l=n.clone(),c=ZE(l,o);if(!bu(a)||!bu(c))return-1;let p=0,f;qE&&i.querySelectorAll(".debug-box").forEach(y=>y.remove());do{if(p>1e4)return-1;if(p+=20,l.position.z=p,l.updateMatrixWorld(),c.makeEmpty(),ZE(l,o,c),f=a.intersectsBox(c),qE){let m=DQ(a,"blue",i),y=DQ(c,f?"red":"green",i);m.classList.add("debug-box"),y.classList.add("debug-box")}}while(f);return p},"#computeMinZOffsetToSeparateFirstTwoFloors"),RQ=s(function(){let r=u(this,hr).call(this);if(!r)return;let n=r.renderer,o=n.getThreeScene();if(!r.api.mapData||!o)return;let a=u(this,vn).length>0?u(this,vn):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(b3(l,"group-container"),b3(c,"group-container"),qE){let f=new Jr;f.setFromObject(l);let m=new Jr;if(m.setFromObject(c),l.children.forEach(T=>{T instanceof ze&&T.userData.debugBox&&mr(T)}),c.children.forEach(T=>{T instanceof ze&&T.userData.debugBox&&mr(T)}),!bu(f)||!bu(m))return;let y=new Mi(f.max.x-f.min.x,f.max.y-f.min.y,f.max.z-f.min.z),v=new $r({color:255,transparent:!0,opacity:.5}),x=new ze(y,v);x.position.set((f.min.x+f.max.x)/2,(f.min.y+f.max.y)/2,(f.min.z+f.max.z)/2),x.userData.debugBox=!0;let S=new Mi(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),I=new $r({color:"cyan",transparent:!0,opacity:.5}),P=new ze(S,I);P.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),P.userData.debugBox=!0,l.add(x),c.add(P)}let p=te(this,To,LQ).call(this,l,c,n.getThreeCamera(),n.container);if(p!==-1)return p},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),yd=new WeakMap,s(KE,"StackedMaps");var E1=KE,su=new Pe,AQ=new _e;function ZE(e,t,r=new v8){return e.traverse(n=>{if(n instanceof ze){let i=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let l=0;l<i.count;l++)su.fromBufferAttribute(i,l),su.applyMatrix4(n.matrixWorld),su.applyMatrix4(t.matrixWorldInverse),su.applyMatrix4(t.projectionMatrix),su.z<1&&su.z>0&&(AQ.set(su.x,su.y),r.expandByPoint(AQ))}}),r}s(ZE,"projectToBox2D");function kQ(e,t){let r=t.clientWidth,n=t.clientHeight;return new _e((e.x+1)*r/2,(1-e.y)*n/2)}s(kQ,"ndcToScreen");function DQ(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=kQ(new _e(e.min.x,e.min.y),r),i=kQ(new _e(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(DQ,"drawProjectedBox");d();d();function j4e(e,t){return"".concat(t," ").concat(e)}s(j4e,"formatMessage");var JE=class JE extends Error{constructor(t,r=K9){super(j4e(t,r)),this.name="MappedinError"}};s(JE,"MappedinError");var Bn=JE;var Dh,QE=class QE{constructor(t,r,n,o){h(this,"id");h(this,"externalId");h(this,"name");h(this,"type");h(this,"floorIds");h(this,"defaultFloorId");h(this,"floorObjects",[]);h(this,"floorObjectsByElevation",new Map);h(this,"metadata");h(this,"containerId");h(this,"facade");h(this,"renderer");O(this,Dh);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(u(this,Dh)==null){if(this.floorObjects.length===0)throw new Bn("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,Dh,t)}return u(this,Dh)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){j.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})})}};Dh=new WeakMap,s(QE,"FloorStackObject");var R1=QE;d();function NQ(e,t,r,n){let o={outdoorOpacity:1,floorStates:[]},i=e.sort((f,m)=>f.elevation-m.elevation),a=Math.min(0,i[0].elevation),l=i[i.length-1].elevation,c,p;for(let f=a;f<=l;f++){let m=i.find(I=>I.elevation===f);if(m==null){f>=0&&(c==null?c=f:p=f);continue}let y=0,v=f<0?Math.abs(m.elevation)*r:r,x=!1;if(c===0&&p!=null){let I=r*p;y=-I,v=I,x=!0}else if(c!=null&&p!=null){let I=c,P=e.find(M=>M.elevation===I-1),T=o.floorStates.find(M=>M.floor===P);if(T){let M=r*(p-c+2);T.state.footprint={...T.state.footprint,altitude:0,height:M,visible:!0}}}c=void 0,p=void 0;let S={floor:m,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};o.floorStates.push(S),m.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,(m.elevation<0||x)&&(m.elevation<0&&(o.outdoorOpacity=.2),S.state.footprint.height=v,S.state.footprint.altitude=y,S.state.footprint.visible=!0)):n.includes(m.id)&&m.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,m.elevation<0?(S.state.footprint.height=v,S.state.footprint.altitude=y,o.outdoorOpacity=.2):(S.state.footprint.height=v,S.state.footprint.altitude=y)):t.elevation>0&&m.elevation<t.elevation&&m.elevation>=0&&(S.state.visible=!0,S.state.footprint.visible=!0,S.state.footprint.height=r,S.state.footprint.altitude=y)}return o}s(NQ,"getVisiblityState");var G4e={linear:Ar.Linear.None,easeIn:Ar.Quadratic.In,easeOut:Ar.Quadratic.Out,easeInOut:Ar.Quadratic.InOut},ga,r9=class r9 extends Fe{constructor(r,n,o,i){var p,f,m,y;super();h(this,"floorStacksById",new Map);h(this,"floorsById",new Map);h(this,"currentFloorId","");h(this,"currentFloorStackId","");h(this,"outdoorFloorStacks",new Set);h(this,"id");h(this,"renderer");h(this,"api");h(this,"mvf");h(this,"options",{});h(this,"styleMap");h(this,"StackedMaps");h(this,"animations",new Map);h(this,"Models",{add:s((r,n,o)=>{let{floorId:i,scale:a,...l}=o,c=i?this.floorsById.get(i):this.currentFloor,p={...l};a!=null&&(p.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let f=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(m=>{var y;return{type:"Feature",properties:{id:_t(),rotation:o.rotation,scale:p.scale,interactive:o.interactive,verticalOffset:m.verticalOffset+((y=o.verticalOffset)!=null?y:0)},geometry:{type:"Point",coordinates:Ci(m)}}})},p,{parent:c.id});if(f==null)throw new Bn("error creating model");return this.renderer.getState(f).children},"add"),remove:s((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});h(this,"Images",{add:s((r,n,o)=>{let{floorId:i,flipImageToFaceCamera:a,...l}=o,c=i?this.floorsById.get(i):this.currentFloor,p={type:"Feature",properties:l,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(_t(),p,{url:n,flipImageToFaceCamera:a!=null?a:!1},c.id)},"add"),remove:s(r=>{this.renderer.remove(r)},"remove"),removeAll:s(()=>{},"removeAll")});h(this,"Markers",{add:s((r,n,o)=>{let i=t9(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:a,...l}=o,c=l;l.rank==="initial"&&(c.rank="medium");let p=i.layers.get(As),f=this.renderer.addMarker2D(Ci(r),n,{...c,occluderId:i==null?void 0:i.occluderId,attachTo:a},p==null?void 0:p.containerId);if(!f)throw new Bn("Failed to create Marker");return f},"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){j.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(i.type!=="marker"){j.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(As))==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 j.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(a.type!=="marker")return j.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...i};this.cancelAnimation(r);let p=new So({lon:a.position[0],lat:a.position[1]}).to({lon:n[0],lat:n[1]},c.duration).easing(G4e[c.easing]).onUpdate(({lon:f,lat:m})=>{var v;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let x=(v=l==null?void 0:l.layers.get(As))==null?void 0:v.containerId;x&&this.Markers.setPosition(r,[f,m],x)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(r,p),e9(p).then(()=>{this.animations.delete(r)})},"animateTo")});h(this,"Exporter",{getCurrentSceneGLTF:s(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});h(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=_t();return this.renderer.addGeometryGroup(a,r,n,i.id),a},"add"),remove:s(r=>(this.renderer.remove(r.id),r.id),"remove")});h(this,"Text3D",{label:s((r,n,o)=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode)){j.warn("Enterprise mode is not enabled, skipping label creation");return}let i=BQ(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 j.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 p=BQ(this.renderer,a,(c=(l=a.locations[0])==null?void 0:l.name)!=null?c:a.name,r);p&&o.push({textInfo:p,target:a})}}),o},"labelAll"),remove:s(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){j.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});h(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,I,P,T,M;let c=(S=this.api.getMapData())==null?void 0:S.getById("space",l.properties.id);if(!c)return;let p=(I=this.styleMap[l.properties.id])==null?void 0:I.showImage,f=(P=l.properties.details)==null?void 0:P.images,y={marker:{...p&&((T=f==null?void 0:f[0])!=null&&T.url)?{icon:f[0].url}:{},...(M=n.appearance)==null?void 0:M.marker},...n.appearance},x=(i?this.floorsById.get(i):this.currentFloor).layers.get(Ba);if(l.properties.center&&c.name!==""){let w=this.renderer.addLabel2D(l.properties.center,c.name,{id:l.properties.id+"-label",...n,appearance:y,rank:n.rank,attachTo:Eh(c)},Gr.is(c)?c.id:x==null?void 0:x.containerId);w&&r(w.id,c.name,c)}})}},"all"),add:s((r,n,o={})=>{let{attachTo:i,...a}=o,l=t9(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=l.layers.get(Ba),p=this.renderer.addLabel2D(Ci(r),n,{...a,occluderId:l.occluderId,attachTo:i},c==null?void 0:c.containerId);if(!p)throw new Bn("label creating failed");return p},"add"),remove:s(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:s(()=>{},"removeAll")});h(this,"Paths",{add:s((r,n)=>{var p;let o=(p=n==null?void 0:n.animateDrawing)!=null?p:!0,i=[],a=r[0].floorId||"root",l=0;for(let f of r){let{floorId:m="root",latitude:y,longitude:v}=f;m!==a&&(l++,a=m),i[l]==null&&i.push({floorId:m,coordinates:[]});let x=m===f.floorId?f:new Le({longitude:v,latitude:y,floorId:m});i[l].coordinates.push(x)}let c=i.reduce((f,{floorId:m,coordinates:y},v)=>{if(v!==0){let S=i[v-1],I=S.coordinates[S.coordinates.length-1],P=y[0],T=Ci(I),M=Ci(P),w=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:S.floorId},geometry:{type:"Point",coordinates:T}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:M}}]},n,this.id);w&&(n!=null&&n.animateDrawing&&this.renderer.setState(w.id,{completeFraction:0}),f.push({...w,coordinates:[I,P]}))}let x=this.renderer.addPath({type:"FeatureCollection",features:y.map(S=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:Ci(S)}}))},n,m);return x&&(n!=null&&n.animateDrawing&&this.renderer.setState(x.id,{completeFraction:0}),f.push({...x,coordinates:y})),f},[]);if(o){let f=[],m=this.api.getMapData();return c.forEach(y=>{var x;let v=jQ(y,m,this.api);f.push(new So({fraction:0}).to({fraction:1},v===!1?0:(x=n==null?void 0:n.drawDuration)!=null?x:1500).onUpdate(S=>{this.renderer.setState(y.id,{completeFraction:S.fraction})}))}),f.forEach((y,v)=>{v<f.length-1&&y.chain(f[v+1]),this.renderer.getTweenGroup().add(y)}),f[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),f[0]),{paths:c,animation:e9(f[f.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")});O(this,ga,{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 E1({currentMapGetter:s(()=>this,"currentMapGetter")}),this.mvf=(p=n==null?void 0:n.mvf)!=null?p:{};let a=$Q(this.mvf["styles.json"]||{});if(this.styleMap=a,A(this,ga,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!n){this.id!=="outdoors-container"&&j.warn("Map (".concat(this.id,") created with no data."));let v=new R1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(v.id,v),this.currentFloorStackId=v.id;let x=new O1(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,u(this,ga),o!=null?o:{});v.addFloor(x),this.floorsById.set(x.id,x),this.setFloor(x.id);return}let l=n.getMVFFeatureByType("floor-stack");if(l==null||l.length===0)throw new Bn("MVF does not contain any Floor Stacks.");for(let v of l){let x=new R1(v,this.id,this.renderer,(f=this.mvf.facade)==null?void 0:f[v.id]);if(x.floorIds.length!==0){for(let S of x.floorIds){let I=n.getMVFFeatureById("floor",S);if(I!=null){let P=this.mvf.space[I.id],T=this.mvf.obstruction[I.id];if((P==null||P.features.length===0)&&(T==null||T.features.length===0))continue;let M=new O1(x.id,I,this.renderer,u(this,ga),o!=null?o:{},this.mvf,a,n);x.addFloor(M),this.floorsById.set(M.id,M)}}this.floorStacksById.set(v.id,x),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(n.facadesBySpaceId)){let x=n.getById("space",v);x&&(this.outdoorFloorStacks.add(x.floor.floorStack.id),(m=this.floorsById.get(x.floor.id))==null||m.setVisible(!0))}let c=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(o!=null&&o.initialFloor){let v=ay(o.initialFloor);v&&this.floorsById.has(v)?c=v:j.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 Bn('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){j.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){j.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 Bn('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,p;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=u(this,ga))!=null&&i.enabled)||n.floorStackId!==(o==null?void 0:o.id))for(let f of this.floorStacksById.values())f.floorObjects.forEach(m=>{m.id!==r&&m.setVisible(!1)});else{let f=NQ(this.currentFloorStack.floorObjects,n,u(this,ga).floorHeight,((l=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:l.map(m=>m.id))||[]);(p=(c=this.api)==null?void 0:c.Outdoor)==null||p.setOpacity(f.outdoorOpacity),f.floorStates.forEach(m=>{m.floor&&this.api.updateState(m.floor.id,m.state)}),u(this,ga).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*u(this,ga).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){j.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))}};ga=new WeakMap,s(r9,"GeojsonApiMapObject");var N1=r9;function BQ(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,{...n,parentId:t.floor.id})}s(BQ,"labelSpace");d();var ds,$1,n9=class n9{constructor({currentMapGetter:t}){O(this,ds,new Map);O(this,$1);A(this,$1,t)}get currentMap(){return u(this,$1).call(this)}getById(t){return u(this,ds).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,{...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 Al(a.id.toString(),l,t);return u(this,ds).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var n;let r=u(this,ds).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),u(this,ds).delete(t.id.toString()))}removeAll(){let t=[];return u(this,ds).forEach(({marker:r})=>{this.remove(r),t.push(r),u(this,ds).delete(r.id.toString())}),t}setPosition(t,r){var a;let n=r.anchorTarget;if(!n){j.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){j.error("Cannot determine the current map.");return}let i=u(this,ds).get(t.id);if(!i){j.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(i.entityId,Ci(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 j.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return j.error("Cannot determine the current map."),Promise.resolve();let a=u(this,ds).get(t.id);return a?(a.marker.updateTarget(r),i.Markers.animateTo(a.entityId,Ci(o),(l=o.floorId)!=null?l:i.currentFloorId,n)):(j.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};ds=new WeakMap,$1=new WeakMap,s(n9,"Markers");var B1=n9;d();var Bl,G1,o9=class o9{constructor({currentMapGetter:t}){O(this,Bl,new Map);O(this,G1);A(this,G1,t)}get currentMap(){return u(this,G1).call(this)}getById(t){return u(this,Bl).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(Ci(o),r,{...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 y1(a.id.toString(),r,t);return u(this,Bl).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(t){var n;let r=u(this,Bl).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),u(this,Bl).delete(t.id.toString()))}removeAll(){let t=[];return u(this,Bl).forEach(({image:r})=>{this.remove(r),t.push(r),u(this,Bl).delete(r.id.toString())}),t}};Bl=new WeakMap,G1=new WeakMap,s(o9,"Images");var j1=o9;d();var ba,V1,i9=class i9{constructor({currentMapGetter:t}){O(this,ba,new Map);O(this,V1);A(this,V1,t)}get currentMap(){return u(this,V1).call(this)}getById(t){return u(this,ba).get(t)}add(t,r,n){let o=[t],i=o.reduce((c,p)=>{var f;return p?(c.has(p.floorId)||c.set(p.floorId,[]),(f=c.get(p.floorId))==null||f.push(p),c):(j.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,p)=>{let f=_t();a.Models.add(f,c,{...n,url:r,floorId:p}).forEach(({id:y})=>{let v=new ud(y.toString(),f,c[0]);u(this,ba).set(v.id,{model:v,entityId:y.toString(),groupId:f}),l.push(v)})}),l[0]}remove(t){var n;let r=u(this,ba).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),u(this,ba).delete(t.id.toString()))}removeAll(){let t=[];return u(this,ba).forEach(({model:r})=>{var o;let n=u(this,ba).get(r.id);n&&(t.push(r),(o=this.currentMap)==null||o.Models.remove(n.entityId,n.groupId),u(this,ba).delete(r.id.toString()))}),t}};ba=new WeakMap,V1=new WeakMap,s(i9,"Models");var U1=i9;d();var va,H1,s9=class s9{constructor({currentMapGetter:t}){O(this,va,new Map);O(this,H1);A(this,H1,t)}get currentMap(){return u(this,H1).call(this)}getById(t){return u(this,va).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 as(_t(),o.animation,t,o.paths);for(let l of i)u(this,va).set(l,{path:a,entityIds:i});return u(this,va).set(a.id,{path:a,entityIds:i}),a}remove(t){var n;let r=u(this,va).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),u(this,va).delete(t.id),r.entityIds.forEach(o=>u(this,va).delete(o)))}removeAll(){let t=[];return u(this,va).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};va=new WeakMap,H1=new WeakMap,s(s9,"Paths");var z1=s9;d();var JQ=ys(z7(),1);d();var a9="#2266ff",U4e="#808080",GQ="#f5f5f5";var UQ={radius:10,color:a9,inactiveColor:U4e,heading:{color:a9,opacity:.7},accuracyRing:{color:a9,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};d();var VQ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";d();var zQ=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 bs;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 vs(l,{depth:.1,bevelEnabled:!1,UVGenerator:z4e(t)})},"createSectorGeometry"),l9=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 _e(0,o)},"generateRadialUV"),z4e=s(e=>({generateTopUV:s((t,r,n,o,i)=>{let a=r[n*3],l=r[n*3+1],c=r[o*3],p=r[o*3+1],f=r[i*3],m=r[i*3+1];return[l9(a,l,e),l9(c,p,e),l9(f,m,e)]},"generateTopUV"),generateSideWallUV:s(()=>[new _e(0,1),new _e(0,1),new _e(0,1),new _e(0,1)],"generateSideWallUV")}),"radialUVGenerator");function HQ(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(HQ,"getPositionWithOverrides");function H4e([e,t],[r,n],[o,i]){let a=r-e,l=n-t,c=a**2+l**2;if(c===0)return;let p=((o-e)*a+(i-t)*l)/c,f;p<=0?f=[e,t]:p>=1?f=[r,n]:f=[e+p*a,t+p*l];let m=P0([o,i],f);return{proportion:Math.max(0,Math.min(1,p)),intersection:f,distance:m}}s(H4e,"getPointLineIntersection");function WQ(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],p=H4e(l,c,t);p!=null&&p.distance<r&&(r=p.distance,n=p.intersection,o=a,i=p.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:o,proportion:i}}s(WQ,"findBlueDotOnPath");function qQ(e,t){let r=new Ei({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,o=.35*4,i=zQ(Math.PI/6,o,n);new Ad().load(VQ,l=>{r.alphaMap=l,r.needsUpdate=!0});let a=new ze(i,r);return a.position.z=-.05,a.renderOrder=0,a}s(qQ,"createHeadingCone");function ZQ(e,t){let r=new x0(1,1,.05,32),n=new Ei({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),o=new ze(r,n);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}s(ZQ,"createAccuracyRing");function XQ(e){let t=new x0(.35,.35,.07,32),r=new Ei({transparent:!0,color:GQ,depthTest:!1,depthWrite:!1}),n=new ze(t,r);n.renderOrder=2;let o=new x0(.35*.8,.35*.8,.01,32),i=new Ei({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),a=new ze(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(XQ,"createBlueDot");var QQ=ys(YQ(),1);var QS="blue-dot",gd,$l,Vo,zo,jl,bd,vd,xd,kr,wo,W1,Gl,q1,Z1,X1,Y1,KS,xa,Ul,JS,Id,K1,Ia,c9=class c9 extends Fe{constructor(r,n){super();this.core=r;this.geoJSONApi=n;O(this,gd,null);h(this,"geometry");O(this,$l);O(this,Vo);O(this,zo);O(this,jl);O(this,bd);O(this,vd);O(this,xd);O(this,kr,UQ);O(this,wo,1);O(this,W1);O(this,Gl);h(this,"state","disabled");h(this,"following",!1);O(this,q1,s(r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));O(this,Z1,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?u(this,q1).call(this,i.id):void 0}return n},"#getFloorByFloorLevel"));O(this,X1,s(r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,o,i,a]=r.children;if(u(this,KS).call(this),o.scale.set(u(this,wo),u(this,wo),u(this,wo)),o.position.z=.07/2*u(this,wo),i.scale.set(u(this,wo),u(this,wo),u(this,wo)),i.position.z=.07*u(this,wo),this.state==="active"){i.material.color.set(u(this,kr).color);let l=this.accuracy;l!=null?(n.visible=!0,u(this,vd)&&u(this,vd).stop(),A(this,vd,new So({scale:n.scale.x}).to({scale:l/2},150).onUpdate(({scale:p})=>{n.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(u(this,vd))):n.visible=!1;let c=this.heading;if(c!=null){a.visible=!0,u(this,xd)&&u(this,xd).stop();let{start:p,end:f}=T0(a.rotation.z,-Ke.degToRad(c));A(this,xd,new So({rotation:p}).to({rotation:f},150).onUpdate(({rotation:m})=>{a.rotation.z=m}).start()),this.core.getTweenGroup().add(u(this,xd)),a.scale.set(u(this,wo),u(this,wo),1)}else a.visible=!1}else this.state==="inactive"&&(i.material.color.set(u(this,kr).inactiveColor),a.visible=!1,n.visible=!1)},"#updateGeometryPerFrame"));O(this,Y1,s(r=>{var a,l;let n;try{n=Y4e.parse(HQ(r,u(this,Vo)))}catch(c){u(this,xa).call(this,"error"),j.error("BlueDot: Position parse failed",c instanceof $.ZodError?c.message:String(c)),this.publish("error");return}u(this,kr).debug&&j.log("BlueDot: Parsed position",n),A(this,zo,n),u(this,xa).call(this,"position-update"),u(this,jl)&&clearTimeout(u(this,jl)),typeof u(this,kr).timeout=="number"&&u(this,kr).timeout<1/0&&A(this,jl,setTimeout(()=>{u(this,kr).debug&&j.log("BlueDot: Position timed out after ".concat(u(this,kr).timeout,"ms")),u(this,xa).call(this,"timeout"),this.core.render()},u(this,kr).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:"outdoors-container",i=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(QS,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}},{setup:s(c=>{let p=ZQ(u(this,kr).accuracyRing.color,u(this,kr).accuracyRing.opacity),{outerMesh:f,innerMesh:m}=XQ(u(this,kr).color),y=qQ(u(this,kr).heading.color,u(this,kr).heading.opacity);c.add(p),p.visible=!1,c.add(f),c.add(m),c.add(y),y.visible=!1,u(this,X1).call(this,c)},"setup"),update:u(this,X1)},{visible:!0,interactive:!0},o);else{let c=this.core.getState(this.geometry);i=[c.position[0],c.position[1]]}u(this,bd)&&u(this,bd).stop(),A(this,bd,new So(i).to([n.longitude,n.latitude],1e3).easing(Ar.Cubic.Out).onUpdate(c=>{if(this.geometry){let p={position:[c[0],c[1]]};p.parent=o,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(u(this,bd)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));h(this,"onPositionUpdate",s(r=>{var n,o,i,a,l;if(this.state!=="disabled"){try{X4e.parse(r)}catch(c){u(this,xa).call(this,"error"),j.error("BlueDot: Browser sent invalid position",c instanceof $.ZodError?c.message:String(c)),this.publish("error");return}A(this,$l,{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:u(this,Z1).call(this,(l=r.coords)==null?void 0:l.floorLevel)}),u(this,Y1).call(this,u(this,$l))}},"onPositionUpdate"));h(this,"onPositionError",s(r=>{var n;switch(u(this,xa).call(this,"error"),r.code){case r.PERMISSION_DENIED:j.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:j.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:j.error("Geolocation request timed out.",r);break;default:j.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)},"onPositionError"));O(this,KS,s(()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==u(this,W1)){A(this,W1,r);let o=(n=this.core.getMetresPerPixel())!=null?n:1;A(this,wo,Math.max(u(this,kr).radius/(.35/o),1))}},"#updateScale"));O(this,xa,s(r=>{let n=Z4e[this.state].actions[r];if(n){switch(u(this,kr).debug&&j.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 j.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));O(this,Ul);O(this,JS,s(()=>{if(u(this,Ul)==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,Ul,(0,QQ.default)(n.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return u(this,Ul)},"#getSimplifiedDirections"));O(this,Id,s(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),u(this,Ia)&&(this.off("position-update",u(this,Ia)),A(this,Ia,void 0)),this.following=!1,A(this,Ul,void 0),this.core.off("user-interaction-start",u(this,Id)),this.geoJSONApi.currentMap.off("navigation-active-path-change",u(this,K1)),this.publish("follow-change",{following:!1})},"#cancelFollow"));O(this,K1,s(()=>{A(this,Ul,void 0)},"#pathChangeHandler"));O(this,Ia);h(this,"follow",s((r,n)=>{var i,a,l,c;if(r===!1){u(this,Id).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&j.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?u(this,Ia)&&this.off("position-update",u(this,Ia)):(this.following=!0,this.core.on("user-interaction-start",u(this,Id)),this.geoJSONApi.currentMap.on("navigation-active-path-change",u(this,K1))),A(this,Ia,p=>{let{coordinate:f,heading:m,floor:y}=p;if(o.center=[f.longitude,f.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),A(this,Ul,void 0)),r==="position-and-heading")o.bearing=m!=null?m:void 0;else if(r==="position-and-path-direction"){let v=u(this,JS).call(this);if(v!=null){let x=WQ(v,[f.longitude,f.latitude]);if(x!=null){let S=v[x.segmentIndex],I=v[x.segmentIndex+1];o.bearing=C8(S,I)}}}this.core.camera.animateTo(o)}),this.on("position-update",u(this,Ia)),this.publish("follow-change",{following:!0,mode:r})},"follow"))}get heading(){var r;return(r=u(this,zo))==null?void 0:r.heading}get accuracy(){var r;return(r=u(this,zo))==null?void 0:r.accuracy}get coordinate(){var r,n;if(u(this,zo)!=null)return(u(this,Gl)==null||((r=this.floor)==null?void 0:r.id)!==u(this,Gl).floorId||u(this,zo).latitude!==u(this,Gl).latitude||u(this,zo).longitude!==u(this,Gl).longitude)&&A(this,Gl,new Le(u(this,zo).latitude,u(this,zo).longitude,(n=this.floor)==null?void 0:n.id)),u(this,Gl)}get floor(){var r;return(r=u(this,zo))==null?void 0:r.floor}enable(r){A(this,kr,(0,JQ.default)({},r,u(this,kr))),u(this,xa).call(this,"enable"),this.watchDevicePosition(u(this,kr).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),u(this,jl)&&(clearTimeout(u(this,jl)),A(this,jl,void 0)),this.following&&u(this,Id).call(this),this.watchDevicePosition(!1),A(this,zo,void 0),A(this,Vo,void 0),u(this,xa).call(this,"disable")}watchDevicePosition(r){if(u(this,gd)&&(navigator.geolocation.clearWatch(u(this,gd)),A(this,gd,null)),u(this,$l)&&A(this,$l,void 0),r){if(this.state==="disabled"){j.warn("BlueDot must be enabled before watching browser position.");return}A(this,gd,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var o,i;r==null?A(this,Vo,void 0):"coords"in r?A(this,Vo,Object.assign({},u(this,Vo),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:u(this,Z1).call(this,r.coords.floorLevel)})):(A(this,Vo,Object.assign({},u(this,Vo),r)),"floorOrFloorId"in r&&(u(this,Vo).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?u(this,q1).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((o=u(this,Vo))==null?void 0:o.latitude)!=null&&((i=u(this,Vo))==null?void 0:i.longitude)!=null||u(this,$l)!=null)&&u(this,Y1).call(this,u(this,$l))}};gd=new WeakMap,$l=new WeakMap,Vo=new WeakMap,zo=new WeakMap,jl=new WeakMap,bd=new WeakMap,vd=new WeakMap,xd=new WeakMap,kr=new WeakMap,wo=new WeakMap,W1=new WeakMap,Gl=new WeakMap,q1=new WeakMap,Z1=new WeakMap,X1=new WeakMap,Y1=new WeakMap,KS=new WeakMap,xa=new WeakMap,Ul=new WeakMap,JS=new WeakMap,Id=new WeakMap,K1=new WeakMap,Ia=new WeakMap,s(c9,"BlueDot");var Lh=c9,Z4e={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"}}},X4e=$.object({coords:$.object({latitude:$.number(),longitude:$.number(),accuracy:$.number(),altitude:$.number().optional().nullable(),altitudeAccuracy:$.number().optional().nullable(),heading:$.number().optional().nullable(),speed:$.number().optional().nullable(),floorLevel:$.number().optional().nullable()}),timestamp:$.number()}),Y4e=$.object({latitude:$.number(),longitude:$.number(),floor:$.custom().optional(),accuracy:$.number().optional(),heading:$.number().optional().nullable()});d();var Vl,Q1,u9=class u9{constructor({currentMapGetter:t}){O(this,Vl,new Map);O(this,Q1);A(this,Q1,t)}get currentMap(){return u(this,Q1).call(this)}getById(t){return u(this,Vl).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 ru(i);return u(this,Vl).set(a.id,a),a}remove(t){var n;u(this,Vl).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),u(this,Vl).delete(t.id.toString()))}removeAll(){let t=[];return u(this,Vl).forEach(r=>{this.remove(r),t.push(r.id),u(this,Vl).delete(r.id.toString())}),t}};Vl=new WeakMap,Q1=new WeakMap,s(u9,"Shapes");var J1=u9;d();var t0,p9=class p9{constructor({currentMapGetter:t}){O(this,t0);A(this,t0,t)}get currentMap(){return u(this,t0).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 m=c.layers.get(a);m&&((n=this.currentMap)==null||n.renderer.setState(m,{color:t[a].color}))}if(c&&a===oc&&!(_s in t)){let m=c.layers.get(_s);m&&"color"in t[a]&&((o=this.currentMap)==null||o.renderer.setState(m,{color:t[a].color}))}if(!l.layers.has(Au))continue;let p=l.layers.get(Au),f=l.facadesByStyleId.get(a);if(f&&f.length>0)for(let m of f){let y=p.layers.get("".concat(m,"-").concat(a));y&&"color"in t[a]&&((i=this.currentMap)==null||i.renderer.setState(y,{color:t[a].color}))}}}};t0=new WeakMap,s(p9,"Style");var e0=p9;d();var d9={opacity:1},$n,r0,n0,uu,zl,Sd,f9,eee,m9=class m9{constructor(t,r){O(this,Sd);O(this,$n);O(this,r0,[]);O(this,n0,{opacity:"initial"});O(this,uu,{opacity:new Map});O(this,zl,new Set);A(this,$n,t),A(this,r0,r||[]);let n=u(this,$n).map;n&&n.on("idle",()=>{u(this,uu).opacity.size||te(this,Sd,f9).call(this,n)})}setStyle(t){var r,n;if(u(this,$n).map){(r=u(this,$n).map)==null||r.setStyle(t),u(this,zl).size&&(u(this,zl).clear(),this.hide()),te(this,Sd,eee).call(this),te(this,Sd,f9).call(this,u(this,$n).map),this.setOpacity(u(this,n0).opacity),(n=u(this,$n).map)==null||n.moveLayer(S3);for(let[o,i,a]of u(this,r0)||[])u(this,$n).hideOutdoorLayersIntersectingPolygons(o,i,a)}}get map(){return u(this,$n).map}get enabled(){return!!u(this,$n).map}get visible(){return u(this,zl).size===0}show(){let t=u(this,$n).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{u(this,zl).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),u(this,zl).clear())}hide(t=[]){let r=u(this,$n).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"),u(this,zl).add(o.id))})}setOpacity(t,r=[]){var i,a;let n=u(this,$n).map;if(!n)return;let o=(a=(i=u(this,$n).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 p=u(this,uu).opacity.get(l.id);p!==void 0&&(l.id==="background"||(l.type==="symbol"?(n.setPaintProperty(l.id,"icon-opacity",t==="initial"?p[0]:t),n.setPaintProperty(l.id,"text-opacity",t==="initial"?p[1]:t)):n.setPaintProperty(l.id,"".concat(l.type,"-opacity"),t==="initial"?p[0]:t)),u(this,n0).opacity=t)}catch(p){j.warn("Error setting opacity:",p)}})})}};$n=new WeakMap,r0=new WeakMap,n0=new WeakMap,uu=new WeakMap,zl=new WeakMap,Sd=new WeakSet,f9=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"?u(this,uu).opacity.set(n.id,[(i=t.getPaintProperty(n.id,"icon-opacity"))!=null?i:d9.opacity,(a=t.getPaintProperty(n.id,"text-opacity"))!=null?a:d9.opacity]):u(this,uu).opacity.set(n.id,[(l=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?l:d9.opacity,void 0])))})},"#setInitialStyle"),eee=s(function(){Object.values(u(this,uu)).forEach(t=>t.clear())},"#clearInitialStyle"),s(m9,"Outdoor");var Rh=m9;d();function tee(){Y7(!1)}s(tee,"disableText3DWorker");var Hl,Wl,pu,h9=class h9{constructor({currentMapGetter:t}){O(this,Hl);O(this,Wl,new Map);O(this,pu,new Map);A(this,Hl,t)}labelAll(t={}){var o,i;let r=[],n=new Set;return(i=(o=u(this,Hl).call(this))==null?void 0:o.Text3D.labelAll(t))==null||i.forEach(({textInfo:a,target:l})=>{let c=a.id.toString(),p=u(this,pu).get(c);if(p){n.has(c)||r.push(p.text3DView),n.add(c);return}n.add(c);let f=new nu(c,l);u(this,Wl).set(f.id,{targetId:l.id,text3d:c,text3DView:f}),u(this,pu).set(c,{text3DView:f}),r.push(f)}),r}label(t,r,n={}){var i;if(u(this,Hl).call(this))if(Gr.is(t)){let a=(i=u(this,Hl).call(this))==null?void 0:i.Text3D.label(t,r,n);if(!a)return;let l=a.textInfo.id.toString(),c=u(this,pu).get(l);if(c)return c.text3DView;let p=new nu(l,a.target);return u(this,Wl).set(p.id,{targetId:a.target.id,text3d:l,text3DView:p}),u(this,pu).set(l,{text3DView:p}),p}else throw new Error("Non-space target is not supported")}remove(t){var o;let r=typeof t=="string"?t:t.id,n=u(this,Wl).get(r);n&&((o=u(this,Hl).call(this))==null||o.Text3D.remove(n.text3d),u(this,Wl).delete(r),u(this,pu).delete(n.text3d))}removeAll(){u(this,Wl).forEach(t=>{var r;(r=u(this,Hl).call(this))==null||r.Text3D.remove(t.text3d)}),u(this,Wl).clear()}};Hl=new WeakMap,Wl=new WeakMap,pu=new WeakMap,s(h9,"Text3D");var e3=h9;var t3=.05,g9=class g9{constructor(t,r){h(this,"core");h(this,"mapObjects",[]);h(this,"id");h(this,"mapDataExternal",{});h(this,"mapsByFloorId",{});h(this,"mapData");h(this,"currentMap");h(this,"hiddenOutdoorGeometries",[]);h(this,"lastFacadeIntersected");h(this,"manualFloorVisibility",!1);h(this,"mapView");h(this,"Camera");h(this,"Labels");h(this,"Text3D");h(this,"Markers");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"Outdoor");h(this,"BlueDot");h(this,"Shapes");h(this,"Style");h(this,"Images");h(this,"update",s(()=>{this.core.render()},"update"));this.core=t,this.mapView=r,this.Camera=new C1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new N1("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(p=>{var f;return(f=this.getMapDataInternal())==null?void 0:f.facadesById[p]}).filter(p=>p!=null)})});let o=new v1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let i=s(c=>p=>{var B,D,F;let f=[],m=[],y=[],v=[];p.labels.forEach(L=>{let H=this.Labels.getById(L.toString());H&&f.push(H.label)}),p.markers.forEach(L=>{let H=this.Markers.getById(L.toString())||this.Navigation.getMarkerById(L.toString());H&&m.push(H.marker)}),p.models.forEach(L=>{let H=this.Models.getById(L.toString());H&&y.push(H.model)}),p.paths.forEach(L=>{let H=this.Paths.getById(L.toString())||this.Navigation.getPathById(L.toString());H&&v.push(H.path)});let x=p.geometry.includes(QS),S=p.geometry.filter(L=>L!==QS)[0],I;S&&(I=(B=this.getMapDataInternal())==null?void 0:B.getById("space",S)),I||(I=(D=this.getMapDataInternal())==null?void 0:D.getById("object",S));let P=p.containers.reduce((L,H)=>{var G;let U=(G=this.getMapDataInternal())==null?void 0:G.getById("floor",H);return U&&ao.is(U)&&L.push(U),L},[]),T,M=0;if(P.length>0){T=P[0].id;let L=this.core.getState(T);M=p.coordinate[2]?p.coordinate[2]-L.altitude:M}let w;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(L=>{this.core.setState(L.id,{hovered:!1})}),I&&Gr.is(I)&&(w=(F=this.getMapDataInternal())==null?void 0:F.facadesBySpaceId[S],w&&w.spaces.forEach(L=>{this.core.setState(L.id,{hovered:!0})})),this.lastFacadeIntersected=w;let E={coordinate:new Le({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:T,verticalOffset:M}),spaces:I&&Gr.is(I)?[I]:[],objects:I&&lo.is(I)?[I]:[],markers:m,labels:f,models:y,paths:v,blueDot:x,floors:P,facades:w?[w]:[]};"pointerEvent"in p&&(E.pointerEvent=p.pointerEvent),this.mapView.publish(c,E)},"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 B1(a),this.Models=new U1(a),this.Labels=new w1(a),this.Text3D=new e3(a),this.Exporter=new T1(a),this.Paths=new z1(a),this.Navigation=new I1(this.core,this,a.currentMapGetter),this.BlueDot=new Lh(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 Rh(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 j1(a),this.Shapes=new J1(a),this.Style=new e0(a);let l=new WS(r,this.mapDataExternal);this.auto=l.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(oc);a&&this.core.setState(a,y9(r,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(_s);a&&this.core.setState(a,y9(r,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(Kd);a&&this.core.setState(a,r3(r,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Or);if(i){let a=i.layers.get(Jd);a&&this.core.setState(a,r3(r,this.core.getState(a)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(eu.is(n))return this.core.setState(n.id,ree({...r,type:"label"},this.core.getState(n.id)));if(Al.is(n))return this.core.setState(n.id,nee({...r,type:"marker"},this.core.getState(n.id)));if((Gr.is(n)||lo.is(n))&&this.core.setState(n.id,oee({...r,type:"geometry"},this.core.getState(n.id))),Fi.is(n)&&this.core.setState(n.id,r3({...r,type:"doors"},this.core.getState(n.id))),ru.is(n)&&this.core.setState(n.id,Oo(r,["altitude","color","opacity"])),ud.is(n)){let{position:o,scale:i,...a}=r,l=a;o&&(l.position=[o.longitude,o.latitude,o.verticalOffset]),i!=null&&(Array.isArray(i)?l.scale=i:l.scale=[i,i,i]),o&&n.updateTarget(o),this.core.setState(n.id,l)}if(ao.is(n)){let o=this.currentMap.floorsById.get(n.id);if(o==null)return;this.core.setState(n.id,Oo(r,["visible","altitude"]));let i=o.layers.get(Or);i!=null&&"geometry"in r&&this.core.setState(i.containerId,Oo(r.geometry,["opacity","visible"]));let a=o.layers.get(Ba);a!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&a.setVisible(r.labels.enabled);let l=o.layers.get(As);l!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&l.setVisible(r.markers.enabled);let c=o.layers.get(my);c!=null&&"footprint"in r&&this.core.setState(c.containerId,Oo(r.footprint,["visible","height","opacity","side","color","altitude"]));let p=o.layers.get(Qd);p!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&p.setVisible(r.occlusion.enabled)}if(Yo.is(n)){let o=this.core.getState(n.id);for(let i of o.children)i.type==="group-container"&&this.core.setState(i.id,Oo(r,["opacity","visible"]))}if(nu.is(n)&&this.core.setState(n.id,Oo(r,HI)),as.is(n))for(let o of n.segments)this.core.setState(o.id,Oo(r,["color","nearRadius","farRadius","visible","completeFraction"]));Ch.is(n)&&this.core.setState(n.id,Oo(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Bg(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var m,y,v,x;let o;try{o=Bg(t)}catch(S){j.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 Le(a[1],a[0])});let l=i["manifest.geojson"].features[0].properties.name,c=new N1("mapObject-".concat(l),o,r,this),p=this.core.getBoundingArea(c.currentFloor.id);p==null&&j.error("Could not determine bounding box for map:",c.currentFloor.id);let f=(y=(m=r==null?void 0:r.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?y:[];if(f.length>0){let S,I=[];for(let P of c.floorStacksById.values())if(P.defaultFloor.footprint&&P.defaultFloor.footprint.geometry!=null&&((v=P.defaultFloor.footprint.geometry)==null?void 0:v.coordinates.length)>0){let T=P.defaultFloor.footprint,M=XS(T);S==null?S=M:see(S,M),I.push(T)}I.length>0&&S!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(S,I,f),this.hiddenOutdoorGeometries.push([S,I,f]))}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 I,P,T,M;this.mapView.publish("floor-change-start",{reason:S.reason,floor:(P=(I=this.getMapDataInternal())==null?void 0:I.getById("floor",S.floorId))!=null?P:this.currentFloor,previousFloor:(M=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",S.previousFloorId))!=null?M:this.currentFloor})}),c.on("floor-change",S=>{var I,P;this.mapView.publish("floor-change",{reason:S.reason,floor:this.currentFloor,previousFloor:(P=(I=this.getMapDataInternal())==null?void 0:I.getById("floor",S.previousFloorId))!=null?P: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"&&p){let S=(x=r==null?void 0:r.screenOffsets)!=null?x:{top:t3*this.core.canvasHeight,left:t3*this.core.canvasWidth,right:t3*this.core.canvasWidth,bottom:t3*this.core.canvasHeight};this.core.camera.focusOn(p,{duration:K8,padding:S}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(ay(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(ay(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Bn("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Bn("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Bn("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Bn("Missing currentFloor");return r}getState(t){var o,i,a,l,c,p,f,m,y,v,x,S,I,P,T,M,w,E,B,D;typeof t=="object"&&as.is(t)&&j.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=iee(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:F,topColor:L,texture:H,topTexture:U,visible:G,height:J,opacity:X}=n;return{type:"walls",visible:G,color:F,topColor:L,texture:H?{url:H}:void 0,topTexture:U?{url:U}:void 0,height:J,opacity:X}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:F,topColor:L,texture:H,topTexture:U,visible:G,opacity:J}=n;return{type:"doors",visible:G,color:F,topColor:L,opacity:J,texture:H?{url:H}: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()),H=L!=null&&L.marker.target?L==null?void 0:L.marker.target.anchorTarget:void 0;return H==null&&(H=new Le(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,{...n,position:new Le({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"&&ru.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"&&ao.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,H=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Ba),U=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(As),G=(f=this.currentMap.floorsById.get(t.id))==null?void 0:f.layers.get(my),J=G?this.core.getState(G.containerId):void 0,X=(m=this.currentMap.floorsById.get(t.id))==null?void 0:m.layers.get(Qd),ie=X?this.core.getState(X.containerId):void 0;return{type:"floor",geometry:{opacity:(y=L==null?void 0:L.opacity)!=null?y:0,visible:(v=L==null?void 0:L.visible)!=null?v:!0},labels:{enabled:(x=H==null?void 0:H.visible)!=null?x:!1},markers:{enabled:(S=U==null?void 0:U.visible)!=null?S:!1},footprint:{altitude:(I=J==null?void 0:J.altitude)!=null?I:0,visible:(P=J==null?void 0:J.visible)!=null?P:!1,height:(T=J==null?void 0:J.height)!=null?T:0,opacity:(M=J==null?void 0:J.opacity)!=null?M:0,side:(w=J==null?void 0:J.side)!=null?w:"double",color:(E=J==null?void 0:J.color)!=null?E:"white"},occlusion:{enabled:(B=ie==null?void 0:ie.visible)!=null?B:!1},visible:n.visible,altitude:(D=n.altitude)!=null?D:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Yo.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 p=this.core.projectScreenXYToCoordinate(t,r,!0);return p?new Le(p.coordinate[1],p.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(p=>{let f=p.userData.entityId.toString();return f.includes("f_")||f.includes("m_")}))==null?void 0:c.userData.entityId.toString();return new Le(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 So(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(g9,"GeoJsonApi");var o0=g9;function aee(e){R8("".concat(e,"/maplibre-worker.csp.js")),NO("".concat(e,"/collision-worker.csp.js"))}s(aee,"setWorkersUrl");d();d();var b9=class b9{constructor(t){h(this,"state");h(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};s(b9,"Debug");var o3=b9;d();var lee=$.object({environment:$.union([$.literal("basic"),$.literal(!1)]).optional(),text3d:$.object({hoverColor:$.string().optional()}).optional(),geometry:$.object({hoverColor:$.string().optional()}).optional(),backgroundColor:$.string().optional(),backgroundAlpha:$.number().optional()}).strict();d();var i3=ys(E7(),1);var cee=s(e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||v9(e).some(r=>r<1)?!0:(console.warn=t,!1)},"isProbablyColor"),v9=s(e=>{let t=new Lt(e);return[t.r,t.g,t.b]},"stringToRgbArray"),K4e=s(e=>{let t=new Lt;return t.setRGB(e[0],e[1],e[2],wa),"#"+t.getHexString()},"rgbArrayToString"),uee=s((e,t)=>{let r=(0,i3.default)({},e),n=(0,i3.default)({},e,t),o=s((i,a,l)=>{for(let c in a){let p=i[c],f=a[c];if(typeof f=="number"&&typeof p=="number")i[c]=p+(f-p)*l;else if(typeof f=="string"&&typeof p=="string"){if(cee(p)&&cee(f)){let m=v9(p),y=v9(f);m&&y?i[c]=K4e([m[0]+(y[0]-m[0])*l,m[1]+(y[1]-m[1])*l,m[2]+(y[2]-m[2])*l]):j.warn('Color "'.concat(c,'" could not be animated!'))}}else typeof f=="object"&&f!==null&&typeof p=="object"&&p!==null?o(p,f,l):j.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,i3.default)({},r);return o(a,t,i),a}},"animationFactory");var i0,Ie,ql,x9=class x9 extends Fe{constructor(r){super();O(this,i0,{});O(this,Ie);O(this,ql);h(this,"Camera");h(this,"Labels");h(this,"Text3D");h(this,"Markers");h(this,"Images");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"BlueDot");h(this,"Style");h(this,"Shapes");h(this,"Outdoor");h(this,"update",s(()=>{u(this,Ie).core.render()},"update"));h(this,"getDirections",s((r,n,o)=>{var i;return(i=u(this,Ie).getMapData())==null?void 0:i.getDirections(r,n,o)},"getDirections"));h(this,"getDirectionsMultiDestination",s((r,n,o)=>{var i;return(i=u(this,Ie).getMapData())==null?void 0:i.getDirectionsMultiDestination(r,n,o)},"getDirectionsMultiDestination"));h(this,"on",s((r,n)=>{super.on(r,n)},"on"));h(this,"off",s((r,n)=>{super.off(r,n)},"off"));h(this,"Debug");A(this,ql,r);let n=new o0(r,this);A(this,Ie,n),this.Camera=u(this,Ie).Camera,A(this,i0,u(this,Ie).mapDataExternal),this.Markers=u(this,Ie).Markers,this.Models=u(this,Ie).Models,this.Labels=u(this,Ie).Labels,this.Text3D=u(this,Ie).Text3D,this.Exporter=u(this,Ie).Exporter,this.Paths=u(this,Ie).Paths,this.Navigation=u(this,Ie).Navigation,this.BlueDot=u(this,Ie).BlueDot,this.Shapes=u(this,Ie).Shapes,this.Style=u(this,Ie).Style,this.auto=u(this,Ie).auto,this.Outdoor=u(this,Ie).Outdoor,this.Images=u(this,Ie).Images,u(this,ql).container.dataset.version=b.env.npm_package_version,this.Debug=new o3(u(this,Ie).core)}get StackedMaps(){return u(this,Ie).currentMap.StackedMaps}updateState(r,n){return u(this,Ie).updateState(r,n)}animateState(r,n,o){var p;let i=u(this,Ie).getState(r);if(i==null)return j.warn("Cannot animate state of ".concat(r,".")),new Promise(m=>m());let a=uee(i,n),l=u(this,Ie).tween({percent:0}).to({percent:1},(p=o==null?void 0:o.duration)!=null?p:1e3).onUpdate(({percent:f})=>{u(this,Ie).updateState(r,a(f))});o!=null&&o.easing&&o.easing in Ol&&l.easing(Ol[o.easing]);let c=new Promise(f=>{l.onComplete(()=>{u(this,Ie).removeTween(l),f()}).onStop(()=>{u(this,Ie).removeTween(l),f()}),l.start()});return c.cancel=()=>{l.stop(),u(this,Ie).updateState(r,a(0))},c}updateGlobalState(r){var n,o,i,a;try{lee.parse(r)}catch(l){j.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:u(this,Ie).core.backgroundColor,p=(a=r.backgroundAlpha)!=null?a:u(this,Ie).core.backgroundAlpha;u(this,Ie).core.setBackgroundColor(c,p)}r.environment!=null&&u(this,Ie).core.setEnvironment(r.environment),u(this,Ie).core.setState(l)}}getGlobalState(){let r=u(this,Ie).core.getState();return{backgroundColor:u(this,Ie).core.backgroundColor,backgroundAlpha:u(this,Ie).core.backgroundAlpha,environment:u(this,Ie).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return u(this,i0)}getDimensions(){return{width:u(this,ql).canvasWidth,height:u(this,ql).canvasHeight}}expand(r){var n;return(n=u(this,Ie).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=u(this,Ie).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return u(this,Ie).addMap(r,n)}setFloor(r,n){return u(this,Ie).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return u(this,Ie).setFloorStack(r,n==null?void 0:n.context)}tween(r){return u(this,Ie).tween(r)}removeTween(r){u(this,Ie).removeTween(r)}get currentFloorStack(){return u(this,Ie).currentFloorStack}get currentFloor(){return u(this,Ie).currentFloor}updateWatermark(r){u(this,Ie).updateWatermark(r)}getState(r){return u(this,Ie).getState(r)}setHoverColor(r){u(this,Ie).setHoverColor(r)}getHoverColor(){return u(this,Ie).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return u(this,Ie).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return u(this,Ie).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return u(this,Ie).isInView(r)}getDistance(r,n){var o;return(o=u(this,Ie).getMapData())==null?void 0:o.getDistance(r,n)}createCoordinate(r,n,o){return typeof r=="object"?new Le(r):new Le(r,n,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(r,n,o){return u(this,Ie).createCoordinateFromScreenCoordinate(r,n,o)}getScreenCoordinateFromCoordinate(r){return u(this,Ie).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(b.env.INTERNAL==="true")return u(this,Ie).core;throw new Error("__core is not available.")}clear(){u(this,Ie).clear()}destroy(){u(this,Ie).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-6WW7AUZN.js");await new n(this,u(this,Ie)).enable(r)}async takeScreenshot(){return await u(this,ql).renderSync(),u(this,ql).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return u(this,Ie).manualFloorVisibility}set manualFloorVisibility(r){u(this,Ie).manualFloorVisibility=r}};i0=new WeakMap,Ie=new WeakMap,ql=new WeakMap,s(x9,"MapView");var Nh=x9;d();d();var I9=class I9 extends Fe{constructor(r){super();h(this,"gl");h(this,"el",document.createElement("div"));h(this,"core");h(this,"origin");h(this,"map");h(this,"layer");h(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"));h(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(Ke.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Ke.degToRad(this.map.getPitch()))},"handleMove"));h(this,"handleError",s(r=>{j.warn(r)},"handleError"));this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new f1(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=F8.fromLngLat(this.origin,0);return this.layer=_0(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(I9,"MapLibreOverlay");var s3=I9;var Cd,Bh,du,Pd,s0=class s0 extends Fe{constructor(r,n,o){super();O(this,Cd);O(this,Bh);O(this,du);O(this,Pd);h(this,"on",s((r,n)=>{super.on(r,n)},"on"));h(this,"off",s((r,n)=>{super.off(r,n)},"off"));A(this,Pd,new s3(r)),A(this,Cd,n),A(this,Bh,o)}onAdd(r){var i,a;let n=u(this,Pd).onAdd(r),o={..._u,...(i=u(this,Bh))!=null?i:{},outdoorView:{token:u(this,Cd).outdoorViewToken,...(a=u(this,Bh))==null?void 0:a.outdoorView}};return A(this,du,new Nh(u(this,Pd).core)),u(this,du).addMap(u(this,Cd),o).then(()=>{this.publish("loaded",{mapView:u(this,du),mapData:u(this,Cd)})}),n}onRemove(){u(this,du)&&u(this,du).clear(),s0.instance=null,u(this,Pd).onRemove()}};Cd=new WeakMap,Bh=new WeakMap,du=new WeakMap,Pd=new WeakMap,s(s0,"MappedinMapLibreOverlay"),h(s0,"instance");var $h=s0;d();var J4e=1e3*60*60*2,fu,Gh,er,fs,ms,Pi,hs,Uh,Vh,l0,cr,pee,dee,jh,a3,S9,C9,P9,T9=class T9{constructor(t,r){O(this,cr);O(this,fu,new Fe);O(this,Gh);O(this,er);O(this,fs);O(this,ms);O(this,Pi);O(this,hs);O(this,Uh);O(this,Vh);O(this,l0,s(()=>{"key"in u(this,er)&&"secret"in u(this,er)&&te(this,cr,jh).call(this),te(this,cr,a3).call(this)},"#handleWindowFocus"));h(this,"on",s((t,r)=>u(this,fu).on(t,r),"on"));h(this,"off",s((t,r)=>u(this,fu).off(t,r),"off"));A(this,Gh,t),A(this,er,r)}setMapIds(t){A(this,Gh,t)}setEnterprise(t){u(this,er).enterprise=t}async readySync(){if((!("key"in u(this,er))||!("secret"in u(this,er)))&&!("accessToken"in u(this,er))){j.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[te(this,cr,jh).call(this),null];u(this,er).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);te(this,cr,P9).call(this),te(this,cr,S9).call(this,r),n!=null&&te(this,cr,C9).call(this,n),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",u(this,l0))}async refreshing(){let t=[];return u(this,fs)!=null&&t.push(u(this,fs)),u(this,ms)!=null&&t.push(u(this,ms)),Promise.all(t)}getAccessTokenAsync(){return te(this,cr,jh).call(this)}getSasTokensAsync(){return te(this,cr,a3).call(this)}getAccessToken(){return u(this,Pi)==null?(j.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):u(this,Pi)}getSasToken(t){return this.isEnterpriseMode()?(j.error("SAS tokens are not available in the enterprise mode!"),{token:""}):u(this,hs)==null?(j.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in u(this,hs).tokens?u(this,hs).tokens[t]:(j.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=u(this,er).enterprise)!=null?t:!1}destroy(){te(this,cr,P9).call(this),u(this,fu).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",u(this,l0))}};fu=new WeakMap,Gh=new WeakMap,er=new WeakMap,fs=new WeakMap,ms=new WeakMap,Pi=new WeakMap,hs=new WeakMap,Uh=new WeakMap,Vh=new WeakMap,l0=new WeakMap,cr=new WeakSet,pee=s(function(t){var n;let r=t.token!==((n=u(this,Pi))==null?void 0:n.token);A(this,Pi,t),r&&u(this,fu).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),dee=s(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=u(this,hs))==null?void 0:n.tokens);A(this,hs,t),r&&u(this,fu).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),jh=s(async function(t=!1){var r;if("accessToken"in u(this,er)&&typeof u(this,er).accessToken=="string"){let n={token:u(this,er).accessToken,expires:Date.now()+72e5};return A(this,Pi,n),n}if(!("key"in u(this,er))||!("secret"in u(this,er))||typeof u(this,er).key!="string"||typeof u(this,er).secret!="string")throw new Error("No API keys or access token provided!");return u(this,fs)!=null?u(this,fs):u(this,Pi)!=null&&u(this,Pi).expires!=null&&u(this,Pi).expires>Date.now()&&!t?u(this,Pi):(A(this,fs,kg({...u(this,er),key:u(this,er).key,secret:u(this,er).secret},(r=u(this,er).enterprise)!=null?r:!1).then(n=>{let o={token:n.accessToken,expires:n.expiresTimestamp*1e3};return te(this,cr,pee).call(this,o),o})),u(this,fs).finally(()=>{A(this,fs,void 0)}),u(this,fs))},"#refreshAccessToken"),a3=s(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:u(this,ms)!=null?u(this,ms):u(this,hs)!=null&&u(this,hs).expires>Date.now()&&!t?u(this,hs):(A(this,ms,new Promise((r,n)=>{te(this,cr,jh).call(this).then(o=>{let i={},a=u(this,Gh).map(l=>w4({...u(this,er),mapId:l},o.token).then(c=>{i[l]={token:c.token,expires:c.expires}}).catch(c=>{j.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 p;return(p=c.expires)!=null?p:1/0}))};te(this,cr,dee).call(this,l),r(l)})}).catch(o=>{n(o)})})),u(this,ms).catch(r=>{throw r}).finally(()=>{A(this,ms,void 0)}),u(this,ms))},"#refreshSasTokens"),S9=s(function(t){if(!("key"in u(this,er))||!("secret"in u(this,er)))return;let r=t.expires!=null?t.expires-Date.now():J4e;isFinite(r)&&A(this,Uh,setTimeout(()=>{te(this,cr,jh).call(this,!0).then(n=>{te(this,cr,S9).call(this,n)})},r-vz))},"#setAccessTokenRefresh"),C9=s(function(t){let r=t.expires-Date.now();isFinite(r)&&A(this,Vh,setTimeout(()=>{te(this,cr,a3).call(this,!0).then(n=>{te(this,cr,C9).call(this,n)})},r-Sz))},"#setSasTokensRefresh"),P9=s(function(){u(this,Uh)!=null&&clearTimeout(u(this,Uh)),u(this,Vh)!=null&&clearTimeout(u(this,Vh))},"#stopRefreshing"),s(T9,"TokenManager");var a0=T9;d();var fee=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 mee=":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 hee='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\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 yee=".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 gee=".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 bee=".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 vee='.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 i5e=[mee,hee,yee,gee,bee,vee],xee;function s5e(e){xee=e}s(s5e,"__setWatermarkOnClickFn");var a5e=s(async(e,t)=>{let r,n=gp();t&&n.updateByUserOption(t);try{t&&(r=(await kg({...t,baseAuthUri:n.getBaseAuthUri()})).accessToken)}catch(a){j.warn("Getting access token failed. Outdoor map disabled.",a)}let o=new zh(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new s2(o)},"hydrateMapDataFromMVF"),Iee=!1;function l5e(e){Iee=e}s(l5e,"setUseEnterpriseAPI");var c5e=s(async(e,t)=>{var v,x,S,I,P,T,M;let r=(S="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?S:"options"in e&&"version"in((v=e.options)!=null?v:{})?(x=e.options)==null?void 0:x.version:void 0,n={...t||{},mvfVersion:r},o,i=gp();i.updateByUserOption(n);let a={};if("type"in e&&typeof e.type=="string"){if(a.enterprise=(I=e.options)==null?void 0:I.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){o=await k4(e.main,n.mvfVersion),a.languagePacks=[];for(let w of(P=e.languagePacks)!=null?P:[])w.localePack instanceof Uint8Array&&a.languagePacks.push({language:w.language,localePack:await gm(w.localePack)})}else if(e.type==="json")o=e.main,a.languagePacks=(T=e.languagePacks)!=null?T:[];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=A4(o),c=l.length>0?l:[n.mapId],p=new a0(c,{...n,enterprise:a.enterprise}),f;if("accessToken"in n)f=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=i.getBaseAuthUri(a.enterprise);let w=await p.getAccessTokenAsync();f=(w==null?void 0:w.token)||""}a.outdoorViewToken=f,a.env=i,a.getMapDataOptions=n;try{await p.readySync()}catch(w){j.error("Failed to ready token manager!",w)}let m=new zh(o,a);f&&m.Analytics.init({accessToken:f,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 s2(m);if("language"in n)try{await y.changeLanguage(n.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(o),y},"hydrateMapData"),See=s(async e=>{var S;let t=Iee,r,n=gp();n.updateByUserOption(e);let o={...e},i=new a0([o.mapId],o);if("accessToken"in o){r=o.accessToken;let{aud:I,sub:P}=C0(r);(Q8.some(T=>I.includes(T))||P&&P.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"&&j.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):j.warn("layoutId is currently unsupported!")),o.baseUri=n.getBaseUri(t);let a=performance.now(),l,c;if(t){let I={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},P=await E4(I);l=P.compressed,c=P.localePacks}else l=await _4(o,r);let p=performance.now(),f=await k4(l,o.mvfVersion),m=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(f);let y=A4(f);y.length>0?i.setMapIds(y):i.setMapIds([o.mapId]);try{await i.readySync()}catch(I){j.error("Failed to ready token manager!",I)}let v=new zh(f,{env:n,outdoorViewToken:r,tokenManager:i,enterprise:t,localePacksUrls:c,binaryBundle:l,getMapDataOptions:o}),x=new s2(v,{search:e.search});if(v.Analytics.init({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}),v.Analytics.sendGetMapDataEvent({parseDuration:m-p,downloadDuration:p-a,viewId:o.viewId}),"language"in o)try{await x.changeLanguage(o.language)}catch{}return x},"getMapData"),u5e=See,p5e=s((e,t)=>{$h.instance!=null&&j.warn("Only a single map venue is supported at this time.");let r=new $h([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return $h.instance=r,r},"createMapLibreOverlay"),Cee=s(async(e,t,r)=>{var p,f,m,y,v,x,S,I,P,T,M,w,E;let n=performance.now(),o=V3(r,t);o&&U3(o),((p=o.injectStyles)==null||p)&&fee(i5e,{id:"mappedin__styles"});let i=t_((f=t.outdoorViewToken)!=null?f:""),a=Bg(t);(m=o.outdoorView)!=null&&m.style&&a.envControl.updateTileServerBaseUrl((y=o.outdoorView)==null?void 0:y.style);let l=await bQ(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(v=o.style)==null?void 0:v.backgroundAlpha,backgroundColor:(x=o.style)==null?void 0:x.backgroundColor,outdoorView:(S=o.outdoorView)!=null&&S.token?{headers:{"x-mappedin-tiles-key":(I=o.outdoorView)==null?void 0:I.token},style:t.getEnv().tileServerUri,enabled:!!((P=o.outdoorView)!=null&&P.enabled),lowDpi:(T=o.outdoorView)==null?void 0:T.lowDpi}:void 0,watermark:{...o.watermark,visible:((M=o.watermark)==null?void 0:M.visible)||!a.enterpriseMode&&!i.remove_watermark,onClick:xee||void 0},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((w=o.antialiasing)!=null&&w.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(E=o.occlusion)==null?void 0:E.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}),c=new Nh(l);return await c.addMap(t,o),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:c.getDimensions()}),c},"show3dMap"),d5e=Cee;function Ci(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}s(Ci,"convertCoordinateToPosition");function m5e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}s(m5e,"getEntranceMap");var UE=s((e,t)=>{let r=m5e(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}=kO(o,a);i=c.map(p=>p.geometry.coordinates),n.entrances.features.push(...l)}n.walls.geometry.coordinates.push(...i)}return n},"cutEntrancesFromLineStrings");function ree(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(ree,"translateLabelStateToGeojsonCore");function nee(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(nee,"translateMarkerStateToGeojsonCore");function r3(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(r3,"translateDoorsStateToGeojsonCore");function y9(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(y9,"translateWallsStateToGeojsonCore");function oee(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(oee,"translateSpaceStateToGeojsonCore");function Pee(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}s(Pee,"differenceBetweenAngles");function Tee(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(Tee,"getRelativeBearing");function $Q(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($Q,"extractStyleMap");function ZS(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={...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(ZS,"groupGeometryByStyle");function _h(e,t={}){var o,i,a,l,c,p,f;let r={...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 m=(f=(p=t==null?void 0:t.style)==null?void 0:p.wallTopColor)!=null?f:t==null?void 0:t.wallTopColor;m!=null&&(r.topColor=m)}return r}s(_h,"translateToCoreStyle");var iee=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(oc);case"exterior-walls":return n==null?void 0:n.layers.get(_s);case"interior-doors":return n==null?void 0:n.layers.get(Kd);case"exterior-doors":return n==null?void 0:n.layers.get(Jd);default:return typeof e=="string"?e:e.id}},"getTargetID");function e9(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}s(e9,"tweenToPromise");function XS(e){return e.bbox?e.bbox:Dd(e)}s(XS,"getBoundingBox");function see(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(see,"expandBbox");function wee(e){return[...new Set(e)]}s(wee,"unique");function t9(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}s(t9,"getTargetFloorObject");function Eh(e){if(Gr.is(e)||lo.is(e))return e.id}s(Eh,"getAttachableGeometryId");function jQ(e,t,r){var i,a,l,c,p,f;let n=e.coordinates.length===2,o=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let m=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),y=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);m&&y&&(o=((a=(i=r.getState(m))==null?void 0:i.visible)!=null?a:!0)&&((c=(l=r.getState(y))==null?void 0:l.visible)!=null?c:!0))}else{let m=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;o=m&&(f=(p=r.getState(m))==null?void 0:p.visible)!=null?f:!0}return o}s(jQ,"determineFloorVisibleBasedOnPath");var Mee=Math.PI*.1,Dr,jn,oo,Td,wd,Zl,Md,Wh,Ti,Oee,Hh,Eee,w9=class w9{constructor(t,r,n,o){O(this,Ti);O(this,Dr,{});O(this,jn);O(this,oo);O(this,Td);O(this,wd);O(this,Zl);O(this,Md);O(this,Wh);A(this,jn,r),A(this,oo,t.features),A(this,Td,n),A(this,wd,o)}get path(){return u(this,oo).map(t=>u(this,jn).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(u(this,Dr).departure)return u(this,Dr).departure;let t=u(this,oo)[0].properties.id,r=u(this,Td)[0];if(u(this,Td).length>1){for(let n of u(this,Td))if(c0(n,u(this,jn)).includes(t)){r=n;break}}return u(this,Dr).departure=r,r}get destination(){if(u(this,Dr).destination)return u(this,Dr).destination;let t=u(this,oo)[u(this,oo).length-1].properties.id,r=u(this,wd)[0];if(u(this,wd).length>1){for(let n of u(this,wd))if(c0(n,u(this,jn)).includes(t)){r=n;break}}return u(this,Dr).destination=r,r}get coordinates(){return u(this,Dr).coordinates?u(this,Dr).coordinates:(u(this,Dr).coordinates=u(this,oo).map(t=>new Le(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),u(this,Dr).coordinates)}get distance(){return u(this,Dr).distance?u(this,Dr).distance:(u(this,Dr).distance=u(this,oo).reduce((t,r)=>t+(r.properties.distance||0),0),u(this,Dr).distance)}get instructions(){if(u(this,oo).length<2)return[];if(u(this,Dr).instructions)return u(this,Dr).instructions;let t=[],r=0;for(let n=0;n<u(this,oo).length;n++){let o=u(this,oo)[n],i=u(this,oo)[n-1],a=u(this,oo)[n+1],l=new Le(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),c=te(this,Ti,Oee).call(this,{prevDirection:i,direction:o,nextDirection:a});r+=(i==null?void 0:i.properties.distance)||0;for(let p of c)p&&(t.push({action:p,distance:r,coordinate:l,node:u(this,jn).getById("node",o.properties.id)}),r=0)}return u(this,Dr).instructions=t,u(this,Dr).instructions}};Dr=new WeakMap,jn=new WeakMap,oo=new WeakMap,Td=new WeakMap,wd=new WeakMap,Zl=new WeakMap,Md=new WeakMap,Wh=new WeakMap,Ti=new WeakSet,Oee=s(function(t){var x,S;let{prevDirection:r,direction:n,nextDirection:o}=t,i=r&&u(this,jn).getById("floor",r.properties.groupBy),a=u(this,jn).getById("floor",n.properties.groupBy),l=o&&u(this,jn).getById("floor",o.properties.groupBy),c=[];r||c.push({type:"Departure"});let p=u(this,jn).getMVFFeatureByNodeId("connection",n.properties.id),f=p?u(this,jn).getById("connection",p.id):void 0,m=p&&p.nodes.length>1,y=u(this,jn).enterpriseMode&&(!n.properties.destination||!(p!=null&&p.nodes.includes(n.properties.destination))||!(p!=null&&p.nodes.includes(n.properties.id)));if(p&&!(!m||y))if(!u(this,Zl)||u(this,Zl)==="exit")c.push(te(this,Ti,Hh).call(this,"TakeConnection",a,l,f,p)),A(this,Zl,"take"),A(this,Md,f),A(this,Wh,p);else{let I=u(this,jn).getMVFFeatureByNodeId("connection",(x=r==null?void 0:r.properties.id)!=null?x:""),P=u(this,jn).getById("connection",(S=I==null?void 0:I.id)!=null?S:"");c.push(te(this,Ti,Hh).call(this,"ExitConnection",a,i,P,I)),A(this,Zl,"exit"),A(this,Md,f),A(this,Wh,p)}else u(this,Zl)==="take"?(c.push(te(this,Ti,Hh).call(this,"ExitConnection",a,i,u(this,Md),u(this,Wh))),A(this,Zl,"exit"),A(this,Md,f)):l&&a.id!==l.id?c.push(te(this,Ti,Hh).call(this,"TakeConnection",a,l,f)):i&&i.id!==a.id?c.push(te(this,Ti,Hh).call(this,"ExitConnection",a,i,f)):c.push(te(this,Ti,Eee).call(this,r,n));return o||c.push({type:"Arrival"}),c},"#getActions"),Hh=s(function(t,r,n,o,i){var c,p;let a="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let f=r.elevation-n.elevation;f>0?a="down":f<0&&(a="up")}let l=(p=(c=o==null?void 0:o.type)!=null?c:i==null?void 0:i.type)!=null?p:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:a,connection:o,connectionType:l}},"#createConnectionAction"),Eee=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?-Pee(t.properties.angle,r.properties.angle):0;return Math.abs(i)>=Mee?{type:"Turn",bearing:Tee(i,Mee),referencePosition:"At"}:null},"#createTurnAction"),s(w9,"Directions");var n3=w9,M9=class M9{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:o,multiplicativeDistanceWeightScaling:i}){h(this,"navigator");h(this,"connections");h(this,"getDirections",s((t,r,n,o)=>{let{accessible:i,smoothing:{enabled:a,radius:l}}=n,c=t.flatMap(x=>c0(x,o)),p=r.flatMap(x=>c0(x,o)),f=this.getExcludedNodeIds(n.excludedConnections).filter(x=>!c.includes(x)&&!p.includes(x)),m=this.getDisabledConnectionNodeIds(i).filter(x=>!c.includes(x)&&!p.includes(x)),y=this.navigator.getDirections({zones:n.zones.map(x=>{var S;return{geometry:x.geometry,cost:x.cost,map:(S=x.floor)==null?void 0:S.id}}),originIds:c,destinationNodeIds:p,excludedNodeIds:f,disabledConnectionNodeIds:m,simplify:{enabled:a,bufferRadius:l},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(y,t,r);let v=new n3(y,o,t,r);if(!(v.distance===0&&new Set([...c,...p]).size===c.length+p.length))return v},"getDirections"));h(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"));h(this,"getDisabledConnectionNodeIds",s(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));h(this,"addCoordinateDirections",s((t,[r],[n])=>{if(t.features.length){if(Le.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(Le.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"));h(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 vm({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(M9,"DirectionsInternal");var l3=M9;function c0(e,t){var r,n,o,i;if(Nu.is(e))return e.navigationTarget.flatMap(a=>c0(a,t));if(Na.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(Le.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(Ra.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(Fi.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(Fa.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(sc.is(e))return e.coordinates.reduce((a,l)=>{var p;let c=t.Query.nearest(l,{types:["node"]});return(p=c==null?void 0:c[0])!=null&&p.feature.id&&a.push(c[0].feature.id),a},[]);if(lo.is(e)){let a=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return a!=null?a:[]}else return Yo.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"):Es.is(e)?e.nodes.map(a=>a.id):Aa.is(e)?[e.id]:[]}}s(c0,"getNodesFromTarget");d();d();d();d();d();d();function O9(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return _ee(this.cover(t,r),t,r,e)}s(O9,"default");function _ee(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,p=e._x1,f=e._y1,m,y,v,x,S,I,P,T;if(!i)return e._root=a,e;for(;i.length;)if((S=t>=(m=(l+p)/2))?l=m:p=m,(I=r>=(y=(c+f)/2))?c=y:f=y,o=i,!(i=i[P=I<<1|S]))return o[P]=a,e;if(v=+e._x.call(null,i.data),x=+e._y.call(null,i.data),t===v&&r===x)return a.next=i,o?o[P]=a:e._root=a,e;do o=o?o[P]=new Array(4):e._root=new Array(4),(S=t>=(m=(l+p)/2))?l=m:p=m,(I=r>=(y=(c+f)/2))?c=y:f=y;while((P=I<<1|S)===(T=(x>=y)<<1|v>=m));return o[T]=i,o[P]=a,e}s(_ee,"add");function Aee(e){var t,r,n=e.length,o,i,a=new Array(n),l=new Array(n),c=1/0,p=1/0,f=-1/0,m=-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>f&&(f=o),i<p&&(p=i),i>m&&(m=i));if(c>f||p>m)return this;for(this.cover(c,p).cover(f,m),r=0;r<n;++r)_ee(this,a[r],l[r],e[r]);return this}s(Aee,"addAll");d();function E9(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,p;r>e||e>=o||n>t||t>=i;)switch(p=(t<n)<<1|e<r,c=new Array(4),c[p]=l,l=c,a*=2,p){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(E9,"default");d();function _9(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}s(_9,"default");d();function A9(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(A9,"default");d();d();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 k9(e,t,r){var n,o=this._x0,i=this._y0,a,l,c,p,f=this._x1,m=this._y1,y=[],v=this._root,x,S;for(v&&y.push(new Kr(v,o,i,f,m)),r==null?r=1/0:(o=e-r,i=t-r,f=e+r,m=t+r,r*=r);x=y.pop();)if(!(!(v=x.node)||(a=x.x0)>f||(l=x.y0)>m||(c=x.x1)<o||(p=x.y1)<i))if(v.length){var I=(a+c)/2,P=(l+p)/2;y.push(new Kr(v[3],I,P,c,p),new Kr(v[2],a,P,I,p),new Kr(v[1],I,l,c,P),new Kr(v[0],a,l,I,P)),(S=(t>=P)<<1|e>=I)&&(x=y[y.length-1],y[y.length-1]=y[y.length-1-S],y[y.length-1-S]=x)}else{var T=e-+this._x.call(null,v.data),M=t-+this._y.call(null,v.data),w=T*T+M*M;if(w<r){var E=Math.sqrt(r=w);o=e-E,i=t-E,f=e+E,m=t+E,n=v.data}}return n}s(k9,"default");d();function D9(e){if(isNaN(f=+this._x.call(null,e))||isNaN(m=+this._y.call(null,e)))return this;var t,r=this._root,n,o,i,a=this._x0,l=this._y0,c=this._x1,p=this._y1,f,m,y,v,x,S,I,P;if(!r)return this;if(r.length)for(;;){if((x=f>=(y=(a+c)/2))?a=y:c=y,(S=m>=(v=(l+p)/2))?l=v:p=v,t=r,!(r=r[I=S<<1|x]))return this;if(!r.length)break;(t[I+1&3]||t[I+2&3]||t[I+3&3])&&(n=t,P=I)}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[I]=i:delete t[I],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[P]=r:this._root=r),this):(this._root=i,this)}s(D9,"default");function kee(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}s(kee,"removeAll");d();function F9(){return this._root}s(F9,"default");d();function L9(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}s(L9,"default");d();function R9(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 p=(i+l)/2,f=(a+c)/2;(o=n[3])&&t.push(new Kr(o,p,f,l,c)),(o=n[2])&&t.push(new Kr(o,i,f,p,c)),(o=n[1])&&t.push(new Kr(o,p,a,l,f)),(o=n[0])&&t.push(new Kr(o,i,a,p,f))}return this}s(R9,"default");d();function N9(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,p=n.y1,f=(a+c)/2,m=(l+p)/2;(i=o[0])&&t.push(new Kr(i,a,l,f,m)),(i=o[1])&&t.push(new Kr(i,f,l,c,m)),(i=o[2])&&t.push(new Kr(i,a,m,f,p)),(i=o[3])&&t.push(new Kr(i,f,m,c,p))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}s(N9,"default");d();function Dee(e){return e[0]}s(Dee,"defaultX");function B9(e){return arguments.length?(this._x=e,this):this._x}s(B9,"default");d();function Fee(e){return e[1]}s(Fee,"defaultY");function $9(e){return arguments.length?(this._y=e,this):this._y}s($9,"default");function u0(e,t,r){var n=new j9(t==null?Dee:t,r==null?Fee:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}s(u0,"quadtree");function j9(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(j9,"Quadtree");function Lee(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}s(Lee,"leaf_copy");var io=u0.prototype=j9.prototype;io.copy=function(){var e=new j9(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=Lee(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]=Lee(n));return e};io.add=O9;io.addAll=Aee;io.cover=E9;io.data=_9;io.extent=A9;io.find=k9;io.remove=D9;io.removeAll=kee;io.root=F9;io.size=L9;io.visit=R9;io.visitAfter=N9;io.x=B9;io.y=$9;var Ho,mu,G9=class G9{constructor(t){O(this,Ho,{});O(this,mu);A(this,mu,t)}getTreeByType(t,r,n){var a;if(u(this,Ho)[t]||(u(this,Ho)[t]={}),u(this,Ho)[t][r]&&u(this,Ho)[t][r][n])return u(this,Ho)[t][r][n];u(this,Ho)[t][r]||(u(this,Ho)[t][r]={}),u(this,Ho)[t][r][n]||(u(this,Ho)[t][r][n]=u0());let o=u(this,Ho)[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=u(this,mu).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:a.filter(l=>l.properties.neighbors.length>0))||[];break;case"point-of-interest":i=u(this,mu).mvfPoisByFloorId[n]||[];break;case"door":i=u(this,mu).mvfEntrancesByFloorId[n]||[];break;case"annotation":i=u(this,mu).mvfAnnotationsByFloorId[n]||[];break}return(i==null?void 0:i.length)>0&&o.addAll(i),o}};Ho=new WeakMap,mu=new WeakMap,s(G9,"QueryCache");var c3=G9;var h5e=$.object({limit:$.enum(["same-floor","same-elevation"]).optional(),radius:$.number().optional(),types:$.array($.enum(["node","point-of-interest"])).min(1)}),Sa,d0,U9=class U9{constructor(t){O(this,Sa);O(this,d0);A(this,Sa,t),A(this,d0,new c3(u(this,Sa)))}nearest(t,r){try{h5e.parse(r)}catch(a){j.error(a);return}let n=fy(t);if(!n)return;let o=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let a of u(this,Sa).getByType("floor-stack")){let l=a.defaultFloor;l&&o.push(l.id)}else if(r.limit==="same-elevation"){let a=u(this,Sa).floorsById[n.floorId];if(a){let l=a==null?void 0:a.elevation;l&&(o=u(this,Sa).getByType("floor-stack").map(c=>{var p;return(p=c.floors.find(f=>f.elevation===l))==null?void 0:p.id}).filter(Boolean))}}let i=[];for(let a of wee(r.types))for(let l of o){let c=u(this,d0).getTreeByType(a,u(this,Sa).mapName,l).find(n.latitude,n.longitude,r.radius);if(c){let p=u(this,Sa).getById(a,c==null?void 0:c.properties.id);p&&i.push({distance:Qi([n.longitude,n.latitude],c.geometry.coordinates),feature:p})}}return i.sort((a,l)=>a.distance-l.distance)}};Sa=new WeakMap,d0=new WeakMap,s(U9,"Query");var p0=U9;d();d();var f0,V9=class V9{constructor(t){O(this,f0);A(this,f0,t||[])}get raw(){return u(this,f0)}};f0=new WeakMap,s(V9,"OpeningHours");var u3=V9;var xn,Se,Xt,qh=class qh extends jr{constructor(r,n){super(n.mvfData.id);h(this,"__type",qh.__type);h(this,"id","loc_");h(this,"name","");h(this,"externalId");h(this,"description");h(this,"logo");h(this,"phone");h(this,"social",[]);h(this,"images",[]);h(this,"links",[]);h(this,"website");h(this,"icon");O(this,xn);O(this,Se,{});O(this,Xt);A(this,xn,r),A(this,Xt,n.mvfData);for(let o in n.mvfData)o==="links"?this.links=n.mvfData.links.map(i=>new ec({mvfData:i})):o==="pictures"?this.images=n.mvfData.pictures.map(i=>{var a;return i.url?new rc({mvfData:{...i,url:(a=i.url)!=null?a:""},mapData:u(this,xn)}):void 0}).filter(i=>i!=null):o==="website"?n.mvfData.website&&(this.website=new ec({mvfData:n.mvfData.website})):o==="icon"?n.mvfData.icon&&(this.icon=new rc({mvfData:{url:n.mvfData.icon},mapData:u(this,xn)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return u(this,Xt)[o]}})}static is(r){return r.__type===qh.__type}get spaces(){if(u(this,Se).spaces)return u(this,Se).spaces;if(u(this,Xt).spaces==null)return u(this,Se).spaces=[],u(this,Se).spaces;u(this,Se).spaces=[];for(let r=0;r<u(this,Xt).spaces.length;r++){let n=u(this,xn).getById("space",u(this,Xt).spaces[r].id);n&&u(this,Se).spaces.push(n)}return u(this,Se).spaces}get points(){if(u(this,Se).points)return u(this,Se).points;if(u(this,Xt).spaces==null)return u(this,Se).points=[],u(this,Se).points;u(this,Se).points=[];for(let r=0;r<u(this,Xt).spaces.length;r++){let n=u(this,xn).getById("point-of-interest",u(this,Xt).spaces[r].id);n&&u(this,Se).points.push(n)}return u(this,Se).points}get doors(){if(u(this,Se).doors)return u(this,Se).doors;if(u(this,Xt).entrances==null)return u(this,Se).doors=[],u(this,Se).doors;u(this,Se).doors=[];for(let r=0;r<u(this,Xt).entrances.length;r++){let n=u(this,xn).getById("door",u(this,Xt).entrances[r].id);n&&u(this,Se).doors.push(n)}return u(this,Se).doors}get connections(){var n;if(u(this,Se).connections)return u(this,Se).connections;if(u(this,Xt).connections==null)return u(this,Se).connections=[],u(this,Se).connections;let r=new Set;for(let o=0;o<u(this,Xt).connections.length;o++){let i=u(this,Xt).connections[o],a=u(this,xn).mvfConnectionsById[i],c=(a==null?[]:a.nodes).map(p=>u(this,xn).getById("node",p)).filter(Boolean);for(let p of c){if(p==null)continue;let f=Ms([p.coordinate.longitude,p.coordinate.latitude]),y=((n=u(this,xn).connectionSpaceIdsByLatLon[f])!=null?n:[]).map(v=>u(this,xn).connectionsById[v]).filter(v=>v!=null);for(let v of y)r.add(v)}}return u(this,Se).connections=Array.from(r),u(this,Se).connections}get annotations(){if(u(this,Se).annotations)return u(this,Se).annotations;if(u(this,Xt).annotations==null)return u(this,Se).annotations=[],u(this,Se).annotations;u(this,Se).annotations=[];for(let r=0;r<u(this,Xt).annotations.length;r++){let n=u(this,xn).getById("annotation",u(this,Xt).annotations[r].id);n&&u(this,Se).annotations.push(n)}return u(this,Se).annotations}get categories(){return u(this,Se).categories?u(this,Se).categories:u(this,Xt).categories==null?(u(this,Se).categories=[],u(this,Se).categories):(u(this,Se).categories=u(this,Xt).categories.map(r=>u(this,xn).getById("location-category",r)).filter(r=>r!=null),u(this,Se).categories)}get mapObjects(){return u(this,Se).mapObjects?u(this,Se).mapObjects:u(this,Xt).obstructions==null?(u(this,Se).mapObjects=[],u(this,Se).mapObjects):(u(this,Se).mapObjects=u(this,Xt).obstructions.map(r=>u(this,xn).getById("object",r.id)).filter(r=>r!=null),u(this,Se).mapObjects)}get areas(){return u(this,Se).areas?u(this,Se).areas:u(this,Xt).areas==null?(u(this,Se).areas=[],u(this,Se).areas):(u(this,Se).areas=u(this,Xt).areas.map(r=>u(this,xn).getById("area",r.id)).filter(r=>r!=null),u(this,Se).areas)}get focusTarget(){if(u(this,Se).focusTarget)return u(this,Se).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 u(this,Se).focusTarget=r,r}get openingHours(){var r;return u(this,Se).openingHours?u(this,Se).openingHours:(u(this,Se).openingHours=new u3((r=u(this,Xt).openingHoursSpecification)!=null?r:[]),u(this,Se).openingHours)}get navigationTarget(){if(u(this,Se).navigationTarget)return u(this,Se).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 u(this,Se).navigationTarget=r,r}toJSON(){return{id:this.id,name:this.name}}};xn=new WeakMap,Se=new WeakMap,Xt=new WeakMap,s(qh,"LocationProfile"),h(qh,"__type","location-profile");var z9=qh,Nu=z9;d();var hu,Mo,Od,Zh=class Zh extends jr{constructor(r,n){super(n.mvfData.id);h(this,"__type",Zh.__type);h(this,"id","cat_");h(this,"name","");h(this,"icon","");O(this,hu);O(this,Mo,{});O(this,Od);A(this,hu,r),A(this,Od,n.mvfData);for(let o in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return u(this,Od)[o]}})}static is(r){return r.__type===Zh.__type}get parent(){return u(this,Mo).parent?u(this,Mo).parent:(u(this,Mo).parent=u(this,Od).parent?u(this,hu).getById("location-category",u(this,Od).parent):void 0,u(this,Mo).parent)}get children(){return u(this,Mo).children?u(this,Mo).children:(u(this,Mo).children=u(this,hu).locationCategoriesByParentId[this.id]||[],u(this,Mo).children)}get locationProfiles(){if(u(this,Mo).locationProfiles)return u(this,Mo).locationProfiles;let r=[];for(let n of u(this,hu).locationProfilesByCategoryId[this.id]||[]){let o=u(this,hu).getById("location-profile",n.id);o&&r.push(o)}return u(this,Mo).locationProfiles=r,r}toJSON(){return{id:this.id,name:this.name}}};hu=new WeakMap,Mo=new WeakMap,Od=new WeakMap,s(Zh,"LocationCategory"),h(Zh,"__type","location-category");var H9=Zh,xy=H9;var Ee,p3,Ree,Xh,W9=class W9 extends Fe{constructor(r,n){var l,c,p,f,m;super();O(this,p3);h(this,"Analytics");O(this,Ee,{});h(this,"Query");h(this,"mvf");h(this,"outdoorViewToken");h(this,"spaceIdsByDestinationNodeId");h(this,"objectEntranceNodeIdsByObstructionId");h(this,"obstructionIdByEntranceId");h(this,"venue");h(this,"tokenManager");h(this,"directions");h(this,"enterpriseMode",!1);h(this,"nodesById");h(this,"spacesById");h(this,"floorsById");h(this,"floorStacksById");h(this,"facadesById");h(this,"facadesBySpaceId");h(this,"connectionsById");h(this,"objectsById");h(this,"doorsById");h(this,"pointsOfInterestById");h(this,"annotationsById");h(this,"areasById");h(this,"locationProfilesById");h(this,"locationCategoriesById");h(this,"locationProfilesByExternalId");h(this,"locationsById");h(this,"locationProfilesByCategoryId");h(this,"locationCategoriesByParentId");h(this,"categoriesById");h(this,"doorsByNodeId");h(this,"mvfLocationsBySpaceId");h(this,"locationIdsByNodeId");h(this,"spaceIdsByNodeId");h(this,"mvfAnnotationsById");h(this,"mvfConnectionsById");h(this,"mvfConnectionsByNodeId");h(this,"mvfConnectionIdsByLatLon");h(this,"mvfEntrancesById");h(this,"mvfNodesById");h(this,"mvfObstructionById");h(this,"mvfSpacesById");h(this,"mvfFloorsById");h(this,"mvfFloorStacksById");h(this,"mvfAreasById");h(this,"connectionSpaceIdsByLatLon");h(this,"locationProfilesByAttachedFeatureId");h(this,"spacesByExternalId");h(this,"nodesByExternalId");h(this,"objectsByExternalId");h(this,"poisByExternalId");h(this,"floorsByExternalId");h(this,"floorStacksByExternalId");h(this,"doorsByExternalId");h(this,"areasByExternalId");h(this,"connectionsByExternalId");h(this,"locationsByExternalId");h(this,"categoriesByExternalId");h(this,"mvfNodesByFloorId");h(this,"mvfSpacesByFloorId");h(this,"mvfPoisByFloorId");h(this,"mvfEntrancesByFloorId");h(this,"mvfAnnotationsByFloorId");h(this,"localePacksUrls");h(this,"currentLanguage");h(this,"languagePacks",{});h(this,"tilesets",{});h(this,"binaryBundle");h(this,"envControl");h(this,"getMapDataOptions");O(this,Xh);h(this,"getDirectionsMultiDestination",s((r,n,o)=>this.getDirections(r,n,{...o,multiDestination:!0}),"getDirectionsMultiDestination"));h(this,"getDirections",s((r,n,o)=>{let{accessible:i=!1,smoothing:a=!0,multiDestination:l=!1}=o||{},c=typeof a=="object"?a.enabled:a,p=typeof a=="object"?a.radius:void 0,f=(o==null?void 0:o.zones)||[],m={accessible:i,zones:f,smoothing:{enabled:c!=null?c:!0,radius:p!=null?p:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(l&&Array.isArray(n)){let y=Array.isArray(r)?r:[r],v=[];for(let x of n){let S=Array.isArray(x)?x:[x],I=this.directions.getDirections(y,S,m,this);if(!I){j.error("getDirections failed due to missing directions for one of the segments");return}y=S,v.push(I)}return v}else{let y=Array.isArray(r)?r:[r],v=Array.isArray(n)?n:[n];if(Array.isArray(v[0])){j.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,v[0].id),this.directions.getDirections(y,v,m,this)}},"getDirections"));h(this,"transformImageRequest",s(async r=>{var o;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!_z(r))return{url:r};if(Az(r))return{url:r};let n=k0(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 j.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:gp();if(this.envControl=o,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new af,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,((p=r["tileset.json"])==null?void 0:p.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=(f=n==null?void 0:n.enterprise)!=null?f:!1,this.tokenManager=n==null?void 0:n.tokenManager;let i=n_(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=r_(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 F0(this,{mvfData:a.venue});let y={};for(let v in a.mvfLocationsById)y[v]=a.mvfLocationsById[v];for(let v in a.locationInstancesById)y[v]=a.locationInstancesById[v];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":y,"enterprise-category":a.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},(m=n==null?void 0:n.languagePacks)==null||m.forEach(({language:v,localePack:x})=>{this.languagePacks[v.code]=D4(x)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new p0(this),this.directions=new l3({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 Le(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 u(this,Ee).spaces==null&&(u(this,Ee).spaces=globalThis.Object.values(this.spacesById)),u(this,Ee).spaces}get objects(){return u(this,Ee).objects==null&&(u(this,Ee).objects=globalThis.Object.values(this.objectsById)),u(this,Ee).objects}get connections(){return u(this,Ee).connections==null&&(u(this,Ee).connections=globalThis.Object.values(this.connectionsById)),u(this,Ee).connections}get floors(){return u(this,Ee).floors==null&&(u(this,Ee).floors=globalThis.Object.values(this.floorsById)),u(this,Ee).floors}get floorStacks(){return u(this,Ee).floorStacks==null&&(u(this,Ee).floorStacks=globalThis.Object.values(this.floorStacksById)),u(this,Ee).floorStacks}get facades(){return u(this,Ee).facades==null&&(u(this,Ee).facades=globalThis.Object.values(this.facadesById)),u(this,Ee).facades}get doors(){return u(this,Ee).doors==null&&(u(this,Ee).doors=globalThis.Object.values(this.doorsById)),u(this,Ee).doors}get pointsOfInterest(){return u(this,Ee).pointsOfInterest==null&&(u(this,Ee).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),u(this,Ee).pointsOfInterest}get annotations(){return u(this,Ee).annotations==null&&(u(this,Ee).annotations=globalThis.Object.values(this.annotationsById)),u(this,Ee).annotations}get areas(){return u(this,Ee).areas==null&&(u(this,Ee).areas=globalThis.Object.values(this.areasById)),u(this,Ee).areas}get nodes(){return u(this,Ee).nodes==null&&(u(this,Ee).nodes=globalThis.Object.values(this.nodesById)),u(this,Ee).nodes}get locations(){return u(this,Ee).locations==null&&(u(this,Ee).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return u(this,Ee).categories==null&&(u(this,Ee).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return u(this,Ee).locationProfiles==null&&(u(this,Ee).locationProfiles=globalThis.Object.values(this.locationProfilesById)),u(this,Ee).locationProfiles}get locationCategories(){return u(this,Ee).locationCategories==null&&(u(this,Ee).locationCategories=globalThis.Object.values(this.locationCategoriesById)),u(this,Ee).locationCategories}get mvfFloors(){return u(this,Ee).mvfFloors==null&&(u(this,Ee).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),u(this,Ee).mvfFloors}get mvfFloorStacks(){return u(this,Ee).mvfFloorStacks==null&&(u(this,Ee).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),u(this,Ee).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,p3,Ree).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,p,f,m,y,v,x,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(p=this.doorsByExternalId[n])!=null?p:[];case"connection":return(f=this.connectionsByExternalId[n])!=null?f:[];case"object":return(m=this.objectsByExternalId[n])!=null?m:[];case"point-of-interest":return(y=this.poisByExternalId[n])!=null?y:[];case"area":return(v=this.areasByExternalId[n])!=null?v:[];case"enterprise-location":return(x=this.locationsByExternalId[n])!=null?x:[];case"enterprise-category":return(S=this.categoriesByExternalId[n])!=null?S:[];default:return[]}}getMapDataById(r){var n,o,i,a,l,c,p,f,m,y;return(y=(m=(f=(p=(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?p:this.objectsById[r])!=null?f:this.pointsOfInterestById[r])!=null?m: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,p;if(!this.currentLanguage)return i;let{code:a}=this.currentLanguage,l=(p=(c=this.languagePacks[a])==null?void 0:c.optimized)==null?void 0:p[r];if(l){let f=l[o];if(f!=null&&f[n]!==void 0)return f[n]}return i}async changeLanguage(r){var l;let n=r.toLowerCase();if(!n){j.error("language code must be defined");return}if(!this.currentLanguage){j.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){j.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){j.error("locale packs url not found for ".concat(i.code));return}u(this,Xh)&&u(this,Xh).abort();let p=new AbortController;A(this,Xh,p);let f;try{f=await Oz(c,{signal:p.signal})}catch(m){j.error("failed downloading language pack",m);return}if(!f||p.signal.aborted)return;a=D4(f),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=fy(r),i=fy(n);return Qi([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 O4(this.localePacksUrls[a.code],{signal:i.signal}),c=await gm(l);c&&n.push({language:{code:a.code,name:a.name},localePack:c})}}catch(l){j.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){j.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 O4(this.localePacksUrls[a.code],{signal:i.signal});l&&n.push({language:{code:a.code,name:a.name},localePack:l})}}catch(l){j.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(u(this,Ee)))u(this,Ee)[r]=null}};Ee=new WeakMap,p3=new WeakSet,Ree=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=Ms([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"),Xh=new WeakMap,s(W9,"MapDataInternal");var zh=W9;var Kh,Ed,m0,Ca,Yh=class Yh extends Ai{constructor(r,n){super(n.mvfData.id,r);h(this,"__type",Yh.__type);O(this,Kh);O(this,Ed);O(this,m0);O(this,Ca,{});A(this,Kh,n.mvfData),A(this,Ed,r),A(this,m0,n.floorStackId)}static is(r){return r.__type===Yh.__type}get floorStack(){return u(this,Ed).getById("floor-stack",u(this,m0))}get spaces(){if(!u(this,Ca).spaces){u(this,Ca).spaces=[];for(let r of u(this,Kh).spaces){let n=u(this,Ed).getById("space",r.spaceId);n&&u(this,Ca).spaces.push(n)}}return u(this,Ca).spaces}get center(){if(!u(this,Ca).center){let r={type:"FeatureCollection",features:[]};for(let o of this.spaces){let i=u(this,Ed).mvfSpacesById[o.id];i&&r.features.push(i)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=a2(r);u(this,Ca).center=new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],u(this,Kh).spaces[0].floorId)}return u(this,Ca).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};Kh=new WeakMap,Ed=new WeakMap,m0=new WeakMap,Ca=new WeakMap,s(Yh,"Facade"),h(Yh,"__type","facade");var q9=Yh,Yo=q9;export{Le as a,Aa as b,Gr as c,oy as d,Yo as e,Es as f,vy as g,$ as h,z7 as i,w4e as j,See as k,Cee as l,f5e as m};