@mappedin/mappedin-js 6.0.1-beta.45 → 6.0.1-beta.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +2169 -27784
- package/lib/esm/GLTFExporter-TZEIALSW.js +1 -0
- package/lib/esm/GLTFLoader-YCEKYYW3.js +1 -0
- package/lib/esm/{browser-IE62BVYL.js → browser-6R2QCUOI.js} +1 -1
- package/lib/esm/chunk-DNBHISVY.js +1 -0
- package/lib/esm/{chunk-7QYC6UYU.js → chunk-KR33DBLD.js} +1 -1
- package/lib/esm/chunk-KVKD4E33.js +1 -0
- package/lib/esm/chunk-MENDLOSO.js +1 -0
- package/lib/esm/chunk-QRWMPXER.js +1 -0
- package/lib/esm/chunk-TVALVOG4.js +1 -0
- package/lib/esm/chunk-UIDBSU4C.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +338 -129
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-CV34C4XG.js +1 -0
- package/lib/esm/inspector-WWR77OPX.css +1 -0
- package/lib/esm/internal-M7DPGYMI.css +1 -0
- package/lib/esm/internal-YXEVD377.js +1 -0
- package/lib/esm/outdoor-context-v4-IEFB4X2Q.js +1 -0
- package/lib/esm/{roboto-regular-E2V4PXOH.js → roboto-regular-JRVF4TIR.js} +1 -1
- package/lib/esm/text3d-RZEC5VQO.js +1 -0
- package/lib/esm/workers/maplibre-worker.csp.js +1 -1
- package/lib/index.css +1 -1
- package/package.json +12 -12
- package/lib/esm/GLTFExporter-33O74ZRA.js +0 -1
- package/lib/esm/GLTFLoader-TFEUICFY.js +0 -1
- package/lib/esm/chunk-AGPZKMLJ.js +0 -1
- package/lib/esm/chunk-HALSTKAB.js +0 -1
- package/lib/esm/chunk-HTXG2WUL.js +0 -1
- package/lib/esm/chunk-L5IJY45Y.js +0 -1
- package/lib/esm/chunk-N5U7Y27D.js +0 -1
- package/lib/esm/chunk-O57EU3PO.js +0 -1
- package/lib/esm/inspector-CC3UZQDZ.js +0 -1
- package/lib/esm/inspector-GOK26VAV.css +0 -1
- package/lib/esm/internal-7A3UJNAV.css +0 -1
- package/lib/esm/internal-MEGLEQC5.js +0 -1
- package/lib/esm/outdoor-context-v4-5DHMHSDP.js +0 -1
- package/lib/esm/text3d-3PC3DCSJ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as pd,A as dM,B as fM,C as Zm,D as ro,E as mM,F as gI,G as fs,H as hM,I as cd,J as yM,K as ms,L as bb,M as hr,N as bI,O as In,P as gM,Q as Qc,R as Si,S as Mt,T as st,U as qm,V as xI,W as xb,X as vI,Y as IM,Z as Xm,_ as SM,a as L4,aa as ud,ba as CM,ca as Co,d as V,da as TM,e as uI,ea as PM,f as mb,fa as II,g as sM,ga as vb,h as ld,ha as Ib,i as hb,ia as wM,j as aM,ja as MM,k as yb,ka as OM,l as Yc,la as Sb,m as us,ma as EM,n as lM,na as _M,o as cM,oa as kM,p as hI,pa as AM,q as kt,qa as Bo,r as Ne,ra as SI,s as Kc,sa as DM,t as yI,ta as FM,u as ds,ua as ep,v as gb,va as Ym,w as ba,wa as dd,x as Jc,xa as Cb,y as pM,ya as fd,z as uM,za as md}from"./chunk-KVKD4E33.js";import{a as qU,ca as vM,k as bM,v as xM}from"./chunk-TVALVOG4.js";import{a as $o}from"./chunk-KR33DBLD.js";import{$ as He,A as j4,Aa as ub,B as lb,Ba as mI,C as cb,Ca as ls,D as G4,Da as cs,E as U4,Ea as vi,Fa as db,G as V4,Ga as Q4,H as Qe,Ha as eM,I as Ae,Ja as Ii,M as z4,N as H4,O as W4,P as Wm,Q as we,R as Xr,S as Z4,T as bi,Ta as ad,U as ha,V as ya,W as Lt,Xa as fb,Y as Br,Ya as tM,Z as ga,_ as q4,aa as xi,ab as rM,b as ib,c as sb,ca as Al,cb as ps,d as R4,da as X4,db as nM,e as fa,ea as dI,eb as oM,f as N4,g as as,ga as Dl,gb as iM,la as Y4,oa as Fl,p as B4,pa as K4,q as $4,qa as pb,r as ab,ra as fI,ta as sd,ya as J4,z as ma,za as Ll}from"./chunk-DNBHISVY.js";import{a as d,b as x}from"./chunk-MENDLOSO.js";import{a as T,b as L,c as ob,d as Bn,f as pe,g as da,h as ss,i as f,j as c,k as O,l as k,m as ee,n as _,o as F4,p as oe}from"./chunk-QRWMPXER.js";var sh=pe(Ot=>{"use strict";d();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.regexpCode=Ot.getEsmExportName=Ot.getProperty=Ot.safeStringify=Ot.stringify=Ot.strConcat=Ot.addCodeArg=Ot.str=Ot._=Ot.nil=Ot._Code=Ot.Name=Ot.IDENTIFIER=Ot._CodeOrName=void 0;var oh=class{};Ot._CodeOrName=oh;Ot.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var tp=class extends oh{constructor(t){if(super(),!Ot.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}}};Ot.Name=tp;var jo=class extends oh{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 tp&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ot._Code=jo;Ot.nil=new jo("");function XM(e,...t){let r=[e[0]],n=0;for(;n<t.length;)wI(r,t[n]),r.push(e[++n]);return new jo(r)}Ot._=XM;var PI=new jo("+");function YM(e,...t){let r=[ih(e[0])],n=0;for(;n<t.length;)r.push(PI),wI(r,t[n]),r.push(PI,ih(e[++n]));return eV(r),new jo(r)}Ot.str=YM;function wI(e,t){t instanceof jo?e.push(...t._items):t instanceof tp?e.push(t):e.push(nV(t))}Ot.addCodeArg=wI;function eV(e){let t=1;for(;t<e.length-1;){if(e[t]===PI){let r=tV(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function tV(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof tp||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 tp))return'"'.concat(e).concat(t.slice(1))}var ZM;function rV(e,t){return t.emptyStr()?e:e.emptyStr()?t:YM(ZM||(ZM=_(["","",""])),e,t)}Ot.strConcat=rV;function nV(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ih(Array.isArray(e)?e.join(","):e)}function oV(e){return new jo(ih(e))}Ot.stringify=oV;function ih(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ot.safeStringify=ih;var qM;function iV(e){return typeof e=="string"&&Ot.IDENTIFIER.test(e)?new jo(".".concat(e)):XM(qM||(qM=_(["[","]"])),e)}Ot.getProperty=iV;function sV(e){if(typeof e=="string"&&Ot.IDENTIFIER.test(e))return new jo("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}Ot.getEsmExportName=sV;function aV(e){return new jo(e.toString())}Ot.regexpCode=aV});var EI=pe(oo=>{"use strict";d();Object.defineProperty(oo,"__esModule",{value:!0});oo.ValueScope=oo.ValueScopeName=oo.Scope=oo.varKinds=oo.UsedValueState=void 0;var no=sh(),MI=class extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}},wb;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(wb||(oo.UsedValueState=wb={}));oo.varKinds={const:new no.Name("const"),let:new no.Name("let"),var:new no.Name("var")};var Mb=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof no.Name?t:this.name(t)}name(t){return new no.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}}};oo.Scope=Mb;var KM,Ob=class extends no.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,no._)(KM||(KM=_([".","[","]"])),new no.Name(r),n)}};oo.ValueScopeName=Ob;var JM,lV=(0,no._)(JM||(JM=_(["\n"],["\\n"]))),QM,e5,t5,OI=class extends Mb{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=L(T({},t),{_n:t.lines?lV:no.nil})}get(){return this._scope}name(t){return new Ob(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,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let u=a.get(s);if(u)return u}else a=this._values[i]=new Map;a.set(s,o);let l=this._scope[i]||(this._scope[i]=[]),p=l.length;return l[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,no._)(QM||(QM=_(["","",""])),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=no.nil;for(let s in t){let a=t[s];if(!a)continue;let l=n[s]=n[s]||new Map;a.forEach(p=>{if(l.has(p))return;l.set(p,wb.Started);let u=r(p);if(u){let m=this.opts.es5?oo.varKinds.var:oo.varKinds.const;i=(0,no._)(e5||(e5=_(["",""," "," = ",";",""])),i,m,p,u,this.opts._n)}else if(u=o==null?void 0:o(p))i=(0,no._)(t5||(t5=_(["","","",""])),i,u,this.opts._n);else throw new MI(p);l.set(p,wb.Completed)})}return i}};oo.ValueScope=OI});var Ke=pe(et=>{"use strict";d();Object.defineProperty(et,"__esModule",{value:!0});et.or=et.and=et.not=et.CodeGen=et.operators=et.varKinds=et.ValueScopeName=et.ValueScope=et.Scope=et.Name=et.regexpCode=et.stringify=et.getProperty=et.nil=et.strConcat=et.str=et._=void 0;var dt=sh(),Ti=EI(),Rl=sh();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return Rl._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return Rl.str}});Object.defineProperty(et,"strConcat",{enumerable:!0,get:function(){return Rl.strConcat}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return Rl.nil}});Object.defineProperty(et,"getProperty",{enumerable:!0,get:function(){return Rl.getProperty}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return Rl.stringify}});Object.defineProperty(et,"regexpCode",{enumerable:!0,get:function(){return Rl.regexpCode}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return Rl.Name}});var Ab=EI();Object.defineProperty(et,"Scope",{enumerable:!0,get:function(){return Ab.Scope}});Object.defineProperty(et,"ValueScope",{enumerable:!0,get:function(){return Ab.ValueScope}});Object.defineProperty(et,"ValueScopeName",{enumerable:!0,get:function(){return Ab.ValueScopeName}});Object.defineProperty(et,"varKinds",{enumerable:!0,get:function(){return Ab.varKinds}});et.operators={GT:new dt._Code(">"),GTE:new dt._Code(">="),LT:new dt._Code("<"),LTE:new dt._Code("<="),EQ:new dt._Code("==="),NEQ:new dt._Code("!=="),NOT:new dt._Code("!"),OR:new dt._Code("||"),AND:new dt._Code("&&"),ADD:new dt._Code("+")};var Ia=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},_I=class extends Ia{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ti.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=bd(this.rhs,t,r)),this}get names(){return this.rhs instanceof dt._CodeOrName?this.rhs.names:{}}},Eb=class extends Ia{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 dt.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=bd(this.rhs,t,r),this}get names(){let t=this.lhs instanceof dt.Name?{}:T({},this.lhs.names);return kb(t,this.rhs)}},kI=class extends Eb{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}},AI=class extends Ia{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}},DI=class extends Ia{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}},FI=class extends Ia{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}},LI=class extends Ia{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=bd(this.code,t,r),this}get names(){return this.code instanceof dt._CodeOrName?this.code.names:{}}},ah=class extends Ia{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)||(cV(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>op(t,r.names),{})}},Sa=class extends ah{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},RI=class extends ah{},gd=class extends Sa{};gd.kind="else";var rp=class e extends Sa{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 gd(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(l5(t),r instanceof e?[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=bd(this.condition,t,r),this}get names(){let t=super.names;return kb(t,this.condition),this.else&&op(t,this.else.names),t}};rp.kind="if";var np=class extends Sa{};np.kind="for";var NI=class extends np{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=bd(this.iteration,t,r),this}get names(){return op(super.names,this.iteration.names)}},BI=class extends np{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ti.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=kb(super.names,this.from);return kb(t,this.to)}},_b=class extends np{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=bd(this.iterable,t,r),this}get names(){return op(super.names,this.iterable.names)}},lh=class extends Sa{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)}};lh.kind="func";var ch=class extends ah{render(t){return"return "+super.render(t)}};ch.kind="return";var $I=class extends Sa{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&&op(t,this.catch.names),this.finally&&op(t,this.finally.names),t}},ph=class extends Sa{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};ph.kind="catch";var uh=class extends Sa{render(t){return"finally"+super.render(t)}};uh.kind="finally";var r5,n5,o5,jI=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=L(T({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new Ti.Scope({parent:t}),this._nodes=[new RI]}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 _I(t,i,n)),i}const(t,r,n){return this._def(Ti.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ti.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ti.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Eb(t,r,n))}add(t,r){return this._leafNode(new kI(t,et.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==dt.nil&&this._leafNode(new LI(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,dt.addCodeArg)(r,o));return r.push("}"),new dt._Code(r)}if(t,r,n){if(this._blockNode(new rp(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 rp(t))}else(){return this._elseNode(new gd)}endIf(){return this._endBlockNode(rp,gd)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new NI(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ti.varKinds.var:Ti.varKinds.let){let s=this._scope.toName(t);return this._for(new BI(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Ti.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof dt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,dt._)(r5||(r5=_(["",".length"])),s),a=>{this.var(i,(0,dt._)(n5||(n5=_(["","[","]"])),s,a)),n(i)})}return this._for(new _b("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ti.varKinds.var:Ti.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,dt._)(o5||(o5=_(["Object.keys(",")"])),r),n);let i=this._scope.toName(t);return this._for(new _b("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(np)}label(t){return this._leafNode(new AI(t))}break(t){return this._leafNode(new DI(t))}return(t){let r=new ch;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ch)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new $I;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new ph(i),r(i)}return n&&(this._currNode=o.finally=new uh,this.code(n)),this._endBlockNode(ph,uh)}throw(t){return this._leafNode(new FI(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=dt.nil,n,o){return this._blockNode(new lh(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(lh)}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 rp))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}};et.CodeGen=jI;function op(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function kb(e,t){return t instanceof dt._CodeOrName?op(e,t.names):e}function bd(e,t,r){if(e instanceof dt.Name)return n(e);if(!o(e))return e;return new dt._Code(e._items.reduce((i,s)=>(s instanceof dt.Name&&(s=n(s)),s instanceof dt._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof dt._Code&&i._items.some(s=>s instanceof dt.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function cV(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}var i5;function l5(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,dt._)(i5||(i5=_(["!",""])),GI(e))}et.not=l5;var pV=c5(et.operators.AND);function uV(...e){return e.reduce(pV)}et.and=uV;var dV=c5(et.operators.OR);function fV(...e){return e.reduce(dV)}et.or=fV;var s5;function c5(e){return(t,r)=>t===dt.nil?r:r===dt.nil?t:(0,dt._)(s5||(s5=_([""," "," ",""])),GI(t),e,GI(r))}var a5;function GI(e){return e instanceof dt.Name?e:(0,dt._)(a5||(a5=_(["(",")"])),e)}});var Et=pe(nt=>{"use strict";d();Object.defineProperty(nt,"__esModule",{value:!0});nt.checkStrictMode=nt.getErrorPath=nt.Type=nt.useFunc=nt.setEvaluated=nt.evaluatedPropsToName=nt.mergeEvaluated=nt.eachItem=nt.unescapeJsonPointer=nt.escapeJsonPointer=nt.escapeFragment=nt.unescapeFragment=nt.schemaRefOrVal=nt.schemaHasRulesButRef=nt.schemaHasRules=nt.checkUnknownRules=nt.alwaysValidSchema=nt.toHash=void 0;var Wt=Ke(),mV=sh();function hV(e){let t={};for(let r of e)t[r]=!0;return t}nt.toHash=hV;function yV(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(_5(e,t),!k5(t,e.self.RULES.all))}nt.alwaysValidSchema=yV;function _5(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]||F5(e,'unknown keyword: "'.concat(i,'"'))}nt.checkUnknownRules=_5;function k5(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}nt.schemaHasRules=k5;function gV(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}nt.schemaHasRulesButRef=gV;var d5,f5;function bV({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Wt._)(d5||(d5=_(["",""])),r)}return(0,Wt._)(f5||(f5=_(["","","",""])),e,t,(0,Wt.getProperty)(n))}nt.schemaRefOrVal=bV;function xV(e){return A5(decodeURIComponent(e))}nt.unescapeFragment=xV;function vV(e){return encodeURIComponent(VI(e))}nt.escapeFragment=vV;function VI(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}nt.escapeJsonPointer=VI;function A5(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}nt.unescapeJsonPointer=A5;function IV(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}nt.eachItem=IV;function p5({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let l=s===void 0?i:s instanceof Wt.Name?(i instanceof Wt.Name?e(o,i,s):t(o,i,s),s):i instanceof Wt.Name?(t(o,s,i),i):r(i,s);return a===Wt.Name&&!(l instanceof Wt.Name)?n(o,l):l}}var m5,h5,y5,g5,b5,x5,v5,I5,S5,C5;nt.mergeEvaluated={props:p5({mergeNames:(e,t,r)=>e.if((0,Wt._)(m5||(m5=_([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,Wt._)(h5||(h5=_([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,Wt._)(y5||(y5=_([""," || {}"])),r)).code((0,Wt._)(g5||(g5=_(["Object.assign(",", ",")"])),r,t)))}),mergeToName:(e,t,r)=>e.if((0,Wt._)(b5||(b5=_([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Wt._)(x5||(x5=_([""," || {}"])),r)),zI(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:T(T({},e),t),resultToName:D5}),items:p5({mergeNames:(e,t,r)=>e.if((0,Wt._)(v5||(v5=_([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,Wt._)(I5||(I5=_([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),mergeToName:(e,t,r)=>e.if((0,Wt._)(S5||(S5=_([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,Wt._)(C5||(C5=_([""," > "," ? "," : ",""])),r,t,r,t))),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};var T5;function D5(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Wt._)(T5||(T5=_(["{}"]))));return t!==void 0&&zI(e,r,t),r}nt.evaluatedPropsToName=D5;var P5;function zI(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Wt._)(P5||(P5=_(["","",""])),t,(0,Wt.getProperty)(n)),!0))}nt.setEvaluated=zI;var u5={};function SV(e,t){return e.scopeValue("func",{ref:t,code:u5[t.code]||(u5[t.code]=new mV._Code(t.code))})}nt.useFunc=SV;var UI;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(UI||(nt.Type=UI={}));var w5,M5,O5,E5;function CV(e,t,r){if(e instanceof Wt.Name){let n=t===UI.Num;return r?n?(0,Wt._)(w5||(w5=_(['"[" + ',' + "]"'])),e):(0,Wt._)(M5||(M5=_(['"[\'" + ',' + "\']"'])),e):n?(0,Wt._)(O5||(O5=_(['"/" + ',""])),e):(0,Wt._)(E5||(E5=_(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,Wt.getProperty)(e).toString():"/"+VI(e)}nt.getErrorPath=CV;function F5(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)}}nt.checkStrictMode=F5});var Ca=pe(HI=>{"use strict";d();Object.defineProperty(HI,"__esModule",{value:!0});var Sn=Ke(),TV={data:new Sn.Name("data"),valCxt:new Sn.Name("valCxt"),instancePath:new Sn.Name("instancePath"),parentData:new Sn.Name("parentData"),parentDataProperty:new Sn.Name("parentDataProperty"),rootData:new Sn.Name("rootData"),dynamicAnchors:new Sn.Name("dynamicAnchors"),vErrors:new Sn.Name("vErrors"),errors:new Sn.Name("errors"),this:new Sn.Name("this"),self:new Sn.Name("self"),scope:new Sn.Name("scope"),json:new Sn.Name("json"),jsonPos:new Sn.Name("jsonPos"),jsonLen:new Sn.Name("jsonLen"),jsonPart:new Sn.Name("jsonPart")};HI.default=TV});var dh=pe(Cn=>{"use strict";d();Object.defineProperty(Cn,"__esModule",{value:!0});Cn.extendErrors=Cn.resetErrorsCount=Cn.reportExtraError=Cn.reportError=Cn.keyword$DataError=Cn.keywordError=void 0;var xt=Ke(),Db=Et(),$n=Ca(),L5;Cn.keywordError={message:({keyword:e})=>(0,xt.str)(L5||(L5=_(['must pass "','" keyword validation'])),e)};var R5,N5;Cn.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,xt.str)(R5||(R5=_(['"','" keyword must be '," ($data)"])),e,t):(0,xt.str)(N5||(N5=_(['"','" keyword is invalid ($data)'])),e)};var B5;function PV(e,t=Cn.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,l=l7(e,t,r);(n!=null?n:s||a)?s7(i,l):a7(o,(0,xt._)(B5||(B5=_(["[","]"])),l))}Cn.reportError=PV;function wV(e,t=Cn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=l7(e,t,r);s7(o,a),i||s||a7(n,$n.default.vErrors)}Cn.reportExtraError=wV;var $5,j5;function MV(e,t){e.assign($n.default.errors,t),e.if((0,xt._)($5||($5=_([""," !== null"])),$n.default.vErrors),()=>e.if(t,()=>e.assign((0,xt._)(j5||(j5=_(["",".length"])),$n.default.vErrors),t),()=>e.assign($n.default.vErrors,null)))}Cn.resetErrorsCount=MV;var G5,U5,V5,z5,H5,W5,Z5;function OV({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,$n.default.errors,a=>{e.const(s,(0,xt._)(G5||(G5=_(["","[","]"])),$n.default.vErrors,a)),e.if((0,xt._)(U5||(U5=_(["",".instancePath === undefined"])),s),()=>e.assign((0,xt._)(V5||(V5=_(["",".instancePath"])),s),(0,xt.strConcat)($n.default.instancePath,i.errorPath))),e.assign((0,xt._)(z5||(z5=_(["",".schemaPath"])),s),(0,xt.str)(H5||(H5=_(["","/",""])),i.errSchemaPath,t)),i.opts.verbose&&(e.assign((0,xt._)(W5||(W5=_(["",".schema"])),s),r),e.assign((0,xt._)(Z5||(Z5=_(["",".data"])),s),n))})}Cn.extendErrors=OV;var q5,X5,Y5,K5;function s7(e,t){let r=e.const("err",t);e.if((0,xt._)(q5||(q5=_([""," === null"])),$n.default.vErrors),()=>e.assign($n.default.vErrors,(0,xt._)(X5||(X5=_(["[","]"])),r)),(0,xt._)(Y5||(Y5=_(["",".push(",")"])),$n.default.vErrors,r)),e.code((0,xt._)(K5||(K5=_(["","++"])),$n.default.errors))}var J5,Q5;function a7(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,xt._)(J5||(J5=_(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,xt._)(Q5||(Q5=_(["",".errors"])),n),t),r.return(!1))}var ip={keyword:new xt.Name("keyword"),schemaPath:new xt.Name("schemaPath"),params:new xt.Name("params"),propertyName:new xt.Name("propertyName"),message:new xt.Name("message"),schema:new xt.Name("schema"),parentSchema:new xt.Name("parentSchema")},e7;function l7(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,xt._)(e7||(e7=_(["{}"]))):EV(e,t,r)}function EV(e,t,r={}){let{gen:n,it:o}=e,i=[_V(o,r),kV(e,r)];return AV(e,t,i),n.object(...i)}var t7;function _V({errorPath:e},{instancePath:t}){let r=t?(0,xt.str)(t7||(t7=_(["","",""])),e,(0,Db.getErrorPath)(t,Db.Type.Str)):e;return[$n.default.instancePath,(0,xt.strConcat)($n.default.instancePath,r)]}var r7,n7;function kV({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,xt.str)(r7||(r7=_(["","/",""])),t,e);return r&&(o=(0,xt.str)(n7||(n7=_(["","",""])),o,(0,Db.getErrorPath)(r,Db.Type.Str))),[ip.schemaPath,o]}var o7,i7;function AV(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:l,propertyName:p,topSchemaRef:u,schemaPath:m}=a;n.push([ip.keyword,o],[ip.params,typeof t=="function"?t(e):t||(0,xt._)(o7||(o7=_(["{}"])))]),l.messages&&n.push([ip.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([ip.schema,s],[ip.parentSchema,(0,xt._)(i7||(i7=_(["","",""])),u,m)],[$n.default.data,i]),p&&n.push([ip.propertyName,p])}});var u7=pe(xd=>{"use strict";d();Object.defineProperty(xd,"__esModule",{value:!0});xd.boolOrEmptySchema=xd.topBoolOrEmptySchema=void 0;var DV=dh(),FV=Ke(),LV=Ca(),RV={message:"boolean schema is false"},c7;function NV(e){let{gen:t,schema:r,validateName:n}=e;r===!1?p7(e,!1):typeof r=="object"&&r.$async===!0?t.return(LV.default.data):(t.assign((0,FV._)(c7||(c7=_(["",".errors"])),n),null),t.return(!0))}xd.topBoolOrEmptySchema=NV;function BV(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),p7(e)):r.var(t,!0)}xd.boolOrEmptySchema=BV;function p7(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,DV.reportError)(o,RV,void 0,t)}});var WI=pe(vd=>{"use strict";d();Object.defineProperty(vd,"__esModule",{value:!0});vd.getRules=vd.isJSONType=void 0;var $V=["string","number","integer","boolean","null","object","array"],jV=new Set($V);function GV(e){return typeof e=="string"&&jV.has(e)}vd.isJSONType=GV;function UV(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:L(T({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}vd.getRules=UV});var ZI=pe(Nl=>{"use strict";d();Object.defineProperty(Nl,"__esModule",{value:!0});Nl.shouldUseRule=Nl.shouldUseGroup=Nl.schemaHasRulesForType=void 0;function VV({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&d7(e,n)}Nl.schemaHasRulesForType=VV;function d7(e,t){return t.rules.some(r=>f7(e,r))}Nl.shouldUseGroup=d7;function f7(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))}Nl.shouldUseRule=f7});var fh=pe(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 zV=WI(),HV=ZI(),WV=dh(),Ye=Ke(),Z7=Et(),Id;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Id||(Tn.DataType=Id={}));function ZV(e){let t=q7(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}Tn.getSchemaTypes=ZV;function q7(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(zV.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Tn.getJSONTypes=q7;function qV(e,t){let{gen:r,data:n,opts:o}=e,i=XV(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,HV.schemaHasRulesForType)(e,t[0]));if(s){let a=XI(t,n,o.strictNumbers,Id.Wrong);r.if(a,()=>{i.length?YV(e,t,i):YI(e)})}return s}Tn.coerceAndCheckDataType=qV;var X7=new Set(["string","number","integer","boolean","null"]);function XV(e,t){return t?e.filter(r=>X7.has(r)||t==="array"&&r==="array"):[]}var m7,h7,y7,g7,b7,x7,v7,I7,S7,C7,T7,P7,w7,M7,O7,E7,_7,k7,A7,D7;function YV(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,Ye._)(m7||(m7=_(["typeof ",""])),o)),a=n.let("coerced",(0,Ye._)(h7||(h7=_(["undefined"]))));i.coerceTypes==="array"&&n.if((0,Ye._)(y7||(y7=_([""," == 'object' && Array.isArray(",") && ",".length == 1"])),s,o,o),()=>n.assign(o,(0,Ye._)(g7||(g7=_(["","[0]"])),o)).assign(s,(0,Ye._)(b7||(b7=_(["typeof ",""])),o)).if(XI(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,Ye._)(x7||(x7=_([""," !== undefined"])),a));for(let p of r)(X7.has(p)||p==="array"&&i.coerceTypes==="array")&&l(p);n.else(),YI(e),n.endIf(),n.if((0,Ye._)(v7||(v7=_([""," !== undefined"])),a),()=>{n.assign(o,a),KV(e,a)});function l(p){switch(p){case"string":n.elseIf((0,Ye._)(I7||(I7=_(["",' == "number" || ',' == "boolean"'])),s,s)).assign(a,(0,Ye._)(S7||(S7=_(['"" + ',""])),o)).elseIf((0,Ye._)(C7||(C7=_([""," === null"])),o)).assign(a,(0,Ye._)(T7||(T7=_(['""']))));return;case"number":n.elseIf((0,Ye._)(P7||(P7=_(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),s,o,s,o,o,o)).assign(a,(0,Ye._)(w7||(w7=_(["+",""])),o));return;case"integer":n.elseIf((0,Ye._)(M7||(M7=_(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),s,o,s,o,o,o,o)).assign(a,(0,Ye._)(O7||(O7=_(["+",""])),o));return;case"boolean":n.elseIf((0,Ye._)(E7||(E7=_(["",' === "false" || '," === 0 || "," === null"])),o,o,o)).assign(a,!1).elseIf((0,Ye._)(_7||(_7=_(["",' === "true" || '," === 1"])),o,o)).assign(a,!0);return;case"null":n.elseIf((0,Ye._)(k7||(k7=_(["",' === "" || '," === 0 || "," === false"])),o,o,o)),n.assign(a,null);return;case"array":n.elseIf((0,Ye._)(A7||(A7=_(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),s,s,s,o)).assign(a,(0,Ye._)(D7||(D7=_(["[","]"])),o))}}}var F7,L7;function KV({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ye._)(F7||(F7=_([""," !== undefined"])),t),()=>e.assign((0,Ye._)(L7||(L7=_(["","[","]"])),t,r),n))}var R7,N7,B7,$7,j7,G7,U7;function qI(e,t,r,n=Id.Correct){let o=n===Id.Correct?Ye.operators.EQ:Ye.operators.NEQ,i;switch(e){case"null":return(0,Ye._)(R7||(R7=_([""," "," null"])),t,o);case"array":i=(0,Ye._)(N7||(N7=_(["Array.isArray(",")"])),t);break;case"object":i=(0,Ye._)(B7||(B7=_([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":i=s((0,Ye._)($7||($7=_(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":i=s();break;default:return(0,Ye._)(j7||(j7=_(["typeof "," "," ",""])),t,o,e)}return n===Id.Correct?i:(0,Ye.not)(i);function s(a=Ye.nil){return(0,Ye.and)((0,Ye._)(G7||(G7=_(["typeof ",' == "number"'])),t),a,r?(0,Ye._)(U7||(U7=_(["isFinite(",")"])),t):Ye.nil)}}Tn.checkDataType=qI;var V7,z7;function XI(e,t,r,n){if(e.length===1)return qI(e[0],t,r,n);let o,i=(0,Z7.toHash)(e);if(i.array&&i.object){let s=(0,Ye._)(V7||(V7=_(["typeof ",' != "object"'])),t);o=i.null?s:(0,Ye._)(z7||(z7=_(["!"," || ",""])),t,s),delete i.null,delete i.array,delete i.object}else o=Ye.nil;i.number&&delete i.integer;for(let s in i)o=(0,Ye.and)(o,qI(s,t,r,n));return o}Tn.checkDataTypes=XI;var H7,W7,JV={message:({schema:e})=>"must be ".concat(e),params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ye._)(H7||(H7=_(["{type: ","}"])),e):(0,Ye._)(W7||(W7=_(["{type: ","}"])),t)};function YI(e){let t=QV(e);(0,WV.reportError)(t,JV)}Tn.reportTypeError=YI;function QV(e){let{gen:t,data:r,schema:n}=e,o=(0,Z7.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var tO=pe(Fb=>{"use strict";d();Object.defineProperty(Fb,"__esModule",{value:!0});Fb.assignDefaults=void 0;var Sd=Ke(),ez=Et();function tz(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)Y7(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>Y7(e,i,o.default))}Fb.assignDefaults=tz;var K7,J7,Q7,eO;function Y7(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Sd._)(K7||(K7=_(["","",""])),i,(0,Sd.getProperty)(t));if(o){(0,ez.checkStrictMode)(e,"default is ignored for: ".concat(a));return}let l=(0,Sd._)(J7||(J7=_([""," === undefined"])),a);s.useDefaults==="empty"&&(l=(0,Sd._)(Q7||(Q7=_([""," || "," === null || ",' === ""'])),l,a,a)),n.if(l,(0,Sd._)(eO||(eO=_([""," = ",""])),a,(0,Sd.stringify)(r)))}});var Go=pe(Gt=>{"use strict";d();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.validateUnion=Gt.validateArray=Gt.usePattern=Gt.callValidateCode=Gt.schemaProperties=Gt.allSchemaProperties=Gt.noPropertyInData=Gt.propertyInData=Gt.isOwnProperty=Gt.hasPropFunc=Gt.reportMissingProp=Gt.checkMissingProp=Gt.checkReportMissingProp=void 0;var er=Ke(),KI=Et(),Bl=Ca(),rz=Et(),rO;function nz(e,t){let{gen:r,data:n,it:o}=e;r.if(QI(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,er._)(rO||(rO=_(["",""])),t)},!0),e.error()})}Gt.checkReportMissingProp=nz;var nO;function oz({gen:e,data:t,it:{opts:r}},n,o){return(0,er.or)(...n.map(i=>(0,er.and)(QI(e,t,i,r.ownProperties),(0,er._)(nO||(nO=_([""," = ",""])),o,i))))}Gt.checkMissingProp=oz;function iz(e,t){e.setParams({missingProperty:t},!0),e.error()}Gt.reportMissingProp=iz;var oO;function gO(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,er._)(oO||(oO=_(["Object.prototype.hasOwnProperty"])))})}Gt.hasPropFunc=gO;var iO;function JI(e,t,r){return(0,er._)(iO||(iO=_(["",".call(",", ",")"])),gO(e),t,r)}Gt.isOwnProperty=JI;var sO,aO;function sz(e,t,r,n){let o=(0,er._)(sO||(sO=_(["",""," !== undefined"])),t,(0,er.getProperty)(r));return n?(0,er._)(aO||(aO=_([""," && ",""])),o,JI(e,t,r)):o}Gt.propertyInData=sz;var lO;function QI(e,t,r,n){let o=(0,er._)(lO||(lO=_(["",""," === undefined"])),t,(0,er.getProperty)(r));return n?(0,er.or)(o,(0,er.not)(JI(e,t,r))):o}Gt.noPropertyInData=QI;function bO(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Gt.allSchemaProperties=bO;function az(e,t){return bO(t).filter(r=>!(0,KI.alwaysValidSchema)(e,t[r]))}Gt.schemaProperties=az;var cO,pO,uO,dO;function lz({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,l,p){let u=p?(0,er._)(cO||(cO=_(["",", ",", ","",""])),e,t,n,o):t,m=[[Bl.default.instancePath,(0,er.strConcat)(Bl.default.instancePath,i)],[Bl.default.parentData,s.parentData],[Bl.default.parentDataProperty,s.parentDataProperty],[Bl.default.rootData,Bl.default.rootData]];s.opts.dynamicRef&&m.push([Bl.default.dynamicAnchors,Bl.default.dynamicAnchors]);let h=(0,er._)(pO||(pO=_(["",", ",""])),u,r.object(...m));return l!==er.nil?(0,er._)(uO||(uO=_(["",".call(",", ",")"])),a,l,h):(0,er._)(dO||(dO=_(["","(",")"])),a,h)}Gt.callValidateCode=lz;var fO,cz=(0,er._)(fO||(fO=_(["new RegExp"]))),mO;function pz({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,er._)(mO||(mO=_(["","(",", ",")"])),o.code==="new RegExp"?cz:(0,rz.useFunc)(e,o),r,n)})}Gt.usePattern=pz;var hO;function uz(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let l=t.const("len",(0,er._)(hO||(hO=_(["",".length"])),r));t.forRange("i",0,l,p=>{e.subschema({keyword:n,dataProp:p,dataPropType:KI.Type.Num},i),t.if((0,er.not)(i),a)})}}Gt.validateArray=uz;var yO;function dz(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,KI.alwaysValidSchema)(o,l))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((l,p)=>{let u=e.subschema({keyword:n,schemaProp:p,compositeRule:!0},a);t.assign(s,(0,er._)(yO||(yO=_([""," || ",""])),s,a)),e.mergeValidEvaluated(u,a)||t.if((0,er.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}Gt.validateUnion=dz});var kO=pe(hs=>{"use strict";d();Object.defineProperty(hs,"__esModule",{value:!0});hs.validateKeywordUsage=hs.validSchemaType=hs.funcKeywordCode=hs.macroKeywordCode=void 0;var jn=Ke(),sp=Ca(),fz=Go(),mz=dh();function hz(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),l=_O(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let p=r.name("valid");e.subschema({schema:a,schemaPath:jn.nil,errSchemaPath:"".concat(s.errSchemaPath,"/").concat(n),topSchemaRef:l,compositeRule:!0},p),e.pass(p,()=>e.error(!0))}hs.macroKeywordCode=hz;var vO,IO,SO,CO,TO,PO;function yz(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:l}=e;bz(l,t);let p=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,u=_O(n,o,p),m=n.let("valid");e.block$data(m,h),e.ok((r=t.valid)!==null&&r!==void 0?r:m);function h(){if(t.errors===!1)I(),t.modifying&&xO(e),b(()=>e.error());else{let C=t.async?g():v();t.modifying&&xO(e),b(()=>gz(e,C))}}function g(){let C=n.let("ruleErrs",null);return n.try(()=>I((0,jn._)(vO||(vO=_(["await "])))),P=>n.assign(m,!1).if((0,jn._)(IO||(IO=_([""," instanceof ",""])),P,l.ValidationError),()=>n.assign(C,(0,jn._)(SO||(SO=_(["",".errors"])),P)),()=>n.throw(P))),C}function v(){let C=(0,jn._)(CO||(CO=_(["",".errors"])),u);return n.assign(C,null),I(jn.nil),C}function I(C=t.async?(0,jn._)(TO||(TO=_(["await "]))):jn.nil){let P=l.opts.passContext?sp.default.this:sp.default.self,w=!("compile"in t&&!a||t.schema===!1);n.assign(m,(0,jn._)(PO||(PO=_(["","",""])),C,(0,fz.callValidateCode)(e,u,P,w)),t.modifying)}function b(C){var P;n.if((0,jn.not)((P=t.valid)!==null&&P!==void 0?P:m),C)}}hs.funcKeywordCode=yz;var wO;function xO(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,jn._)(wO||(wO=_(["","[","]"])),n.parentData,n.parentDataProperty)))}var MO,OO,EO;function gz(e,t){let{gen:r}=e;r.if((0,jn._)(MO||(MO=_(["Array.isArray(",")"])),t),()=>{r.assign(sp.default.vErrors,(0,jn._)(OO||(OO=_([""," === null ? "," : ",".concat(",")"])),sp.default.vErrors,t,sp.default.vErrors,t)).assign(sp.default.errors,(0,jn._)(EO||(EO=_(["",".length"])),sp.default.vErrors)),(0,mz.extendErrors)(e)},()=>e.error())}function bz({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function _O(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,jn.stringify)(r)})}function xz(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")}hs.validSchemaType=xz;function vz({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 s=o.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error("parent schema must have dependencies of ".concat(i,": ").concat(s.join(",")));if(o.validateSchema&&!o.validateSchema(e[i])){let l='keyword "'.concat(i,'" value is invalid at path "').concat(n,'": ')+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}hs.validateKeywordUsage=vz});var BO=pe($l=>{"use strict";d();Object.defineProperty($l,"__esModule",{value:!0});$l.extendSubschemaMode=$l.extendSubschemaData=$l.getSubschema=void 0;var ys=Ke(),NO=Et(),AO,DO;function Iz(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,ys._)(AO||(AO=_(["","",""])),e.schemaPath,(0,ys.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:a[r],schemaPath:(0,ys._)(DO||(DO=_(["","","",""])),e.schemaPath,(0,ys.getProperty)(t),(0,ys.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,NO.escapeFragment)(r))}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}$l.getSubschema=Iz;var FO,LO,RO;function Sz(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:p,dataPathArr:u,opts:m}=t,h=a.let("data",(0,ys._)(FO||(FO=_(["","",""])),t.data,(0,ys.getProperty)(r)),!0);l(h),e.errorPath=(0,ys.str)(LO||(LO=_(["","",""])),p,(0,NO.getErrorPath)(r,n,m.jsPropertySyntax)),e.parentDataProperty=(0,ys._)(RO||(RO=_(["",""])),r),e.dataPathArr=[...u,e.parentDataProperty]}if(o!==void 0){let p=o instanceof ys.Name?o:a.let("data",o,!0);l(p),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(p){e.data=p,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,p]}}$l.extendSubschemaData=Sz;function Cz(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}$l.extendSubschemaMode=Cz});var eS=pe((Dbe,$O)=>{"use strict";d();$O.exports=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 s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var GO=pe((Lbe,jO)=>{"use strict";d();var jl=jO.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(){};Lb(t,n,o,e,"",e)};jl.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jl.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jl.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jl.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 Lb(e,t,r,n,o,i,s,a,l,p){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,l,p);for(var u in n){var m=n[u];if(Array.isArray(m)){if(u in jl.arrayKeywords)for(var h=0;h<m.length;h++)Lb(e,t,r,m[h],o+"/"+u+"/"+h,i,o,u,n,h)}else if(u in jl.propsKeywords){if(m&&typeof m=="object")for(var g in m)Lb(e,t,r,m[g],o+"/"+u+"/"+Tz(g),i,o,u,n,g)}else(u in jl.keywords||e.allKeys&&!(u in jl.skipKeywords))&&Lb(e,t,r,m,o+"/"+u,i,o,u,n)}r(n,o,i,s,a,l,p)}}function Tz(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var mh=pe(io=>{"use strict";d();Object.defineProperty(io,"__esModule",{value:!0});io.getSchemaRefs=io.resolveUrl=io.normalizeId=io._getFullPath=io.getFullPath=io.inlineRef=void 0;var Pz=Et(),wz=eS(),Mz=GO(),Oz=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ez(e,t=!0){return typeof e=="boolean"?!0:t===!0?!tS(e):t?UO(e)<=t:!1}io.inlineRef=Ez;var _z=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function tS(e){for(let t in e){if(_z.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(tS)||typeof r=="object"&&tS(r))return!0}return!1}function UO(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Oz.has(r)&&(typeof e[r]=="object"&&(0,Pz.eachItem)(e[r],n=>t+=UO(n)),t===1/0))return 1/0}return t}function VO(e,t="",r){r!==!1&&(t=Cd(t));let n=e.parse(t);return zO(e,n)}io.getFullPath=VO;function zO(e,t){return e.serialize(t).split("#")[0]+"#"}io._getFullPath=zO;var kz=/#\/?$/;function Cd(e){return e?e.replace(kz,""):""}io.normalizeId=Cd;function Az(e,t,r){return r=Cd(r),e.resolve(t,r)}io.resolveUrl=Az;var Dz=/^[a-z_][-a-z0-9._]*$/i;function Fz(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Cd(e[r]||t),i={"":o},s=VO(n,o,!1),a={},l=new Set;return Mz(e,{allKeys:!0},(m,h,g,v)=>{if(v===void 0)return;let I=s+h,b=i[v];typeof m[r]=="string"&&(b=C.call(this,m[r])),P.call(this,m.$anchor),P.call(this,m.$dynamicAnchor),i[h]=b;function C(w){let M=this.opts.uriResolver.resolve;if(w=Cd(b?M(b,w):w),l.has(w))throw u(w);l.add(w);let E=this.refs[w];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?p(m,E.schema,w):w!==Cd(I)&&(w[0]==="#"?(p(m,a[w],w),a[w]=m):this.refs[w]=I),w}function P(w){if(typeof w=="string"){if(!Dz.test(w))throw new Error('invalid anchor "'.concat(w,'"'));C.call(this,"#".concat(w))}}}),a;function p(m,h,g){if(h!==void 0&&!wz(m,h))throw u(g)}function u(m){return new Error('reference "'.concat(m,'" resolves to more than one schema'))}}io.getSchemaRefs=Fz});var gh=pe(Gl=>{"use strict";d();Object.defineProperty(Gl,"__esModule",{value:!0});Gl.getData=Gl.KeywordCxt=Gl.validateFunctionCode=void 0;var F6=u7(),HO=fh(),nS=ZI(),Rb=fh(),Lz=tO(),yh=kO(),rS=BO(),Ee=Ke(),Ve=Ca(),Rz=mh(),Ta=Et(),hh=dh();function Nz(e){if(N6(e)&&(B6(e),R6(e))){jz(e);return}L6(e,()=>(0,F6.topBoolOrEmptySchema)(e))}Gl.validateFunctionCode=Nz;var XO,YO,KO;function L6({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,Ee._)(XO||(XO=_(["",", ",""])),Ve.default.data,Ve.default.valCxt),n.$async,()=>{e.code((0,Ee._)(YO||(YO=_(['"use strict"; ',""])),WO(r,o))),$z(e,o),e.code(i)}):e.func(t,(0,Ee._)(KO||(KO=_(["",", ",""])),Ve.default.data,Bz(o)),n.$async,()=>e.code(WO(r,o)).code(i))}var JO,QO;function Bz(e){return(0,Ee._)(QO||(QO=_(["{",'="", ',", ",", ","=","","}={}"])),Ve.default.instancePath,Ve.default.parentData,Ve.default.parentDataProperty,Ve.default.rootData,Ve.default.data,e.dynamicRef?(0,Ee._)(JO||(JO=_([", ","={}"])),Ve.default.dynamicAnchors):Ee.nil)}var e6,t6,r6,n6,o6,i6,s6,a6,l6;function $z(e,t){e.if(Ve.default.valCxt,()=>{e.var(Ve.default.instancePath,(0,Ee._)(e6||(e6=_(["",".",""])),Ve.default.valCxt,Ve.default.instancePath)),e.var(Ve.default.parentData,(0,Ee._)(t6||(t6=_(["",".",""])),Ve.default.valCxt,Ve.default.parentData)),e.var(Ve.default.parentDataProperty,(0,Ee._)(r6||(r6=_(["",".",""])),Ve.default.valCxt,Ve.default.parentDataProperty)),e.var(Ve.default.rootData,(0,Ee._)(n6||(n6=_(["",".",""])),Ve.default.valCxt,Ve.default.rootData)),t.dynamicRef&&e.var(Ve.default.dynamicAnchors,(0,Ee._)(o6||(o6=_(["",".",""])),Ve.default.valCxt,Ve.default.dynamicAnchors))},()=>{e.var(Ve.default.instancePath,(0,Ee._)(i6||(i6=_(['""'])))),e.var(Ve.default.parentData,(0,Ee._)(s6||(s6=_(["undefined"])))),e.var(Ve.default.parentDataProperty,(0,Ee._)(a6||(a6=_(["undefined"])))),e.var(Ve.default.rootData,Ve.default.data),t.dynamicRef&&e.var(Ve.default.dynamicAnchors,(0,Ee._)(l6||(l6=_(["{}"]))))})}function jz(e){let{schema:t,opts:r,gen:n}=e;L6(e,()=>{r.$comment&&t.$comment&&j6(e),Hz(e),n.let(Ve.default.vErrors,null),n.let(Ve.default.errors,0),r.unevaluated&&Gz(e),$6(e),qz(e)})}var c6,p6,u6,d6,f6,m6,h6;function Gz(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Ee._)(c6||(c6=_(["",".evaluated"])),r)),t.if((0,Ee._)(p6||(p6=_(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,Ee._)(u6||(u6=_(["",".props"])),e.evaluated),(0,Ee._)(d6||(d6=_(["undefined"]))))),t.if((0,Ee._)(f6||(f6=_(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,Ee._)(m6||(m6=_(["",".items"])),e.evaluated),(0,Ee._)(h6||(h6=_(["undefined"])))))}var y6;function WO(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Ee._)(y6||(y6=_(["/*# sourceURL="," */"])),r):Ee.nil}function Uz(e,t){if(N6(e)&&(B6(e),R6(e))){Vz(e,t);return}(0,F6.boolOrEmptySchema)(e,t)}function R6({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function N6(e){return typeof e.schema!="boolean"}var g6;function Vz(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&j6(e),Wz(e),Zz(e);let i=n.const("_errs",Ve.default.errors);$6(e,i),n.var(t,(0,Ee._)(g6||(g6=_([""," === ",""])),i,Ve.default.errors))}function B6(e){(0,Ta.checkUnknownRules)(e),zz(e)}function $6(e,t){if(e.opts.jtd)return ZO(e,[],!1,t);let r=(0,HO.getSchemaTypes)(e.schema),n=(0,HO.coerceAndCheckDataType)(e,r);ZO(e,r,!n,t)}function zz(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ta.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}function Hz(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ta.checkStrictMode)(e,"default is ignored in the schema root")}function Wz(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Rz.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Zz(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}var b6,x6,v6;function j6({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,Ee._)(b6||(b6=_(["",".logger.log(",")"])),Ve.default.self,i));else if(typeof o.$comment=="function"){let s=(0,Ee.str)(x6||(x6=_(["","/$comment"])),n),a=e.scopeValue("root",{ref:t.root});e.code((0,Ee._)(v6||(v6=_(["",".opts.$comment(",", ",", ",".schema)"])),Ve.default.self,i,s,a))}}var I6,S6,C6,T6;function qz(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,Ee._)(I6||(I6=_([""," === 0"])),Ve.default.errors),()=>t.return(Ve.default.data),()=>t.throw((0,Ee._)(S6||(S6=_(["new ","(",")"])),o,Ve.default.vErrors))):(t.assign((0,Ee._)(C6||(C6=_(["",".errors"])),n),Ve.default.vErrors),i.unevaluated&&Xz(e),t.return((0,Ee._)(T6||(T6=_([""," === 0"])),Ve.default.errors)))}var P6,w6;function Xz({gen:e,evaluated:t,props:r,items:n}){r instanceof Ee.Name&&e.assign((0,Ee._)(P6||(P6=_(["",".props"])),t),r),n instanceof Ee.Name&&e.assign((0,Ee._)(w6||(w6=_(["",".items"])),t),n)}var M6;function ZO(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:l,self:p}=e,{RULES:u}=p;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,Ta.schemaHasRulesButRef)(i,u))){o.block(()=>U6(e,"$ref",u.all.$ref.definition));return}l.jtd||Yz(e,t),o.block(()=>{for(let h of u.rules)m(h);m(u.post)});function m(h){(0,nS.shouldUseGroup)(i,h)&&(h.type?(o.if((0,Rb.checkDataType)(h.type,s,l.strictNumbers)),qO(e,h),t.length===1&&t[0]===h.type&&r&&(o.else(),(0,Rb.reportTypeError)(e)),o.endIf()):qO(e,h),a||o.if((0,Ee._)(M6||(M6=_([""," === ",""])),Ve.default.errors,n||0)))}}function qO(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,Lz.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,nS.shouldUseRule)(n,i)&&U6(e,i.keyword,i.definition,t.type)})}function Yz(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Kz(e,t),e.opts.allowUnionTypes||Jz(e,t),Qz(e,e.dataTypes))}function Kz(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{G6(e.dataTypes,r)||oS(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),tH(e,t)}}function Jz(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&oS(e,"use allowUnionTypes to allow union type keyword")}function Qz(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,nS.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>eH(t,s))&&oS(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(n,'"'))}}}function eH(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function G6(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function tH(e,t){let r=[];for(let n of e.dataTypes)G6(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function oS(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,Ta.checkStrictMode)(e,t,e.opts.strictTypes)}var O6,E6,_6,k6,Nb=class{constructor(t,r,n){if((0,yh.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,Ta.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",V6(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,yh.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",Ve.default.errors))}result(t,r,n){this.failResult((0,Ee.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,Ee.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,Ee._)(O6||(O6=_([""," !== undefined && (",")"])),r,(0,Ee.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?hh.reportExtraError:hh.reportError)(this,this.def.error,r)}$dataError(){(0,hh.reportError)(this,this.def.$dataError||hh.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,hh.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=Ee.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Ee.nil,r=Ee.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,Ee.or)((0,Ee._)(E6||(E6=_([""," === undefined"])),o),r)),t!==Ee.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Ee.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,Ee.or)(s(),a());function s(){if(n.length){if(!(r instanceof Ee.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,Ee._)(_6||(_6=_(["",""])),(0,Rb.checkDataTypes)(l,r,i.opts.strictNumbers,Rb.DataType.Wrong))}return Ee.nil}function a(){if(o.validateSchema){let l=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,Ee._)(k6||(k6=_(["!","(",")"])),l,r)}return Ee.nil}}subschema(t,r){let n=(0,rS.getSubschema)(this.it,t);(0,rS.extendSubschemaData)(n,this.it,t),(0,rS.extendSubschemaMode)(n,t);let o=L(T(T({},this.it),n),{items:void 0,props:void 0});return Uz(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ta.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ta.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,Ee.Name)),!0}};Gl.KeywordCxt=Nb;function U6(e,t,r,n){let o=new Nb(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,yh.funcKeywordCode)(o,r):"macro"in r?(0,yh.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,yh.funcKeywordCode)(o,r)}var rH=/^\/(?:[^~]|~0|~1)*$/,nH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,A6,D6;function V6(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return Ve.default.rootData;if(e[0]==="/"){if(!rH.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));o=e,i=Ve.default.rootData}else{let p=nH.exec(e);if(!p)throw new Error("Invalid JSON-pointer: ".concat(e));let u=+p[1];if(o=p[2],o==="#"){if(u>=t)throw new Error(l("property/index",u));return n[t-u]}if(u>t)throw new Error(l("data",u));if(i=r[t-u],!o)return i}let s=i,a=o.split("/");for(let p of a)p&&(i=(0,Ee._)(A6||(A6=_(["","",""])),i,(0,Ee.getProperty)((0,Ta.unescapeJsonPointer)(p))),s=(0,Ee._)(D6||(D6=_([""," && ",""])),s,i));return s;function l(p,u){return"Cannot access ".concat(p," ").concat(u," levels up, current level is ").concat(t)}}Gl.getData=V6});var Bb=pe(sS=>{"use strict";d();Object.defineProperty(sS,"__esModule",{value:!0});var iS=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};sS.default=iS});var bh=pe(cS=>{"use strict";d();Object.defineProperty(cS,"__esModule",{value:!0});var aS=mh(),lS=class extends Error{constructor(t,r,n,o){super(o||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,aS.resolveUrl)(t,r,n),this.missingSchema=(0,aS.normalizeId)((0,aS.getFullPath)(t,this.missingRef))}};cS.default=lS});var jb=pe(Uo=>{"use strict";d();Object.defineProperty(Uo,"__esModule",{value:!0});Uo.resolveSchema=Uo.getCompilingSchema=Uo.resolveRef=Uo.compileSchema=Uo.SchemaEnv=void 0;var Pi=Ke(),oH=Bb(),ap=Ca(),wi=mh(),z6=Et(),iH=gh(),Td=class{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,wi.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={}}};Uo.SchemaEnv=Td;var H6,W6;function uS(e){let t=Z6.call(this,e);if(t)return t;let r=(0,wi.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Pi.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:oH.default,code:(0,Pi._)(H6||(H6=_(['require("ajv/dist/runtime/validation_error").default'])))}));let l=s.scopeName("validate");e.validateName=l;let p={gen:s,allErrors:this.opts.allErrors,data:ap.default.data,parentData:ap.default.parentData,parentDataProperty:ap.default.parentDataProperty,dataNames:[ap.default.data],dataPathArr:[Pi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Pi.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Pi.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Pi._)(W6||(W6=_(['""']))),opts:this.opts,self:this},u;try{this._compilations.add(e),(0,iH.validateFunctionCode)(p),s.optimize(this.opts.code.optimize);let m=s.toString();u="".concat(s.scopeRefs(ap.default.scope),"return ").concat(m),this.opts.code.process&&(u=this.opts.code.process(u,e));let g=new Function("".concat(ap.default.self),"".concat(ap.default.scope),u)(this,this.scope.get());if(this.scope.value(l,{ref:g}),g.errors=null,g.schema=e.schema,g.schemaEnv=e,e.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:l,validateCode:m,scopeValues:s._values}),this.opts.unevaluated){let{props:v,items:I}=p;g.evaluated={props:v instanceof Pi.Name?void 0:v,items:I instanceof Pi.Name?void 0:I,dynamicProps:v instanceof Pi.Name,dynamicItems:I instanceof Pi.Name},g.source&&(g.source.evaluated=(0,Pi.stringify)(g.evaluated))}return e.validate=g,e}catch(m){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),m}finally{this._compilations.delete(e)}}Uo.compileSchema=uS;function sH(e,t,r){var n;r=(0,wi.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=cH.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Td({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=aH.call(this,i)}Uo.resolveRef=sH;function aH(e){return(0,wi.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:uS.call(this,e)}function Z6(e){for(let t of this._compilations)if(lH(t,e))return t}Uo.getCompilingSchema=Z6;function lH(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function cH(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$b.call(this,e,t)}function $b(e,t){let r=this.opts.uriResolver.parse(t),n=(0,wi._getFullPath)(this.opts.uriResolver,r),o=(0,wi.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return pS.call(this,r,e);let i=(0,wi.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=$b.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:pS.call(this,r,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||uS.call(this,s),i===(0,wi.normalizeId)(t)){let{schema:a}=s,{schemaId:l}=this.opts,p=a[l];return p&&(o=(0,wi.resolveUrl)(this.opts.uriResolver,o,p)),new Td({schema:a,schemaId:l,root:e,baseId:o})}return pS.call(this,r,s)}}Uo.resolveSchema=$b;var pH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function pS(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,z6.unescapeFragment)(a)];if(l===void 0)return;r=l;let p=typeof r=="object"&&r[this.opts.schemaId];!pH.has(a)&&p&&(t=(0,wi.resolveUrl)(this.opts.uriResolver,t,p))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,z6.schemaHasRulesButRef)(r,this.RULES)){let a=(0,wi.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=$b.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Td({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var q6=pe((Xbe,uH)=>{uH.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 Y6=pe((Ybe,X6)=>{"use strict";d();var dH={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};X6.exports={HEX:dH}});var o9=pe((Jbe,n9)=>{"use strict";d();var{HEX:fH}=Y6(),mH=new RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u");function e9(e){if(r9(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(mH)||[],[r]=t;return r?{host:yH(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function dS(e,t=!1){let r="",n=!0;for(let o of e){if(fH[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}function hH(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=!1;function l(){if(o.length){if(i===!1){let p=dS(o);if(p!==void 0)n.push(p);else return r.error=!0,!1}o.length=0}return!0}for(let p=0;p<e.length;p++){let u=e[p];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(a=!0),!l())break;if(t++,n.push(":"),t>7){r.error=!0;break}p-1>=0&&e[p-1]===":"&&(s=!0);continue}else if(u==="%"){if(!l())break;i=!0}else{o.push(u);continue}}return o.length&&(i?r.zone=o.join(""):a?n.push(o.join("")):n.push(dS(o))),r.address=n.join(""),r}function t9(e){if(r9(e,":")<2)return{host:e,isIPV6:!1};let t=hH(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}}}function yH(e,t){let r="",n=!0,o=e.length;for(let i=0;i<o;i++){let s=e[i];s==="0"&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(s===t?n=!0:n=!1,r+=s)}return r}function r9(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var K6=new RegExp("^\\.\\.?\\/","u"),J6=new RegExp("^\\/\\.(?:\\/|$)","u"),Q6=new RegExp("^\\/\\.\\.(?:\\/|$)","u"),gH=new RegExp("^\\/?(?:.|\\n)*?(?=\\/|$)","u");function bH(e){let t=[];for(;e.length;)if(e.match(K6))e=e.replace(K6,"");else if(e.match(J6))e=e.replace(J6,"/");else if(e.match(Q6))e=e.replace(Q6,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(gH);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("")}function xH(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}function vH(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=e9(r);if(n.isIPV4)r=n.host;else{let o=t9(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}n9.exports={recomposeAuthority:vH,normalizeComponentEncoding:xH,removeDotSegments:bH,normalizeIPv4:e9,normalizeIPv6:t9,stringArrayToHexStripped:dS}});var p9=pe((e0e,c9)=>{"use strict";d();var IH=new RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu"),SH=new RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu");function i9(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function s9(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function a9(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}function CH(e){return e.secure=i9(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function TH(e){if((e.port===(i9(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}function PH(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(SH);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=fS[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function wH(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o="".concat(r,":").concat(t.nid||n),i=fS[o];i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path="".concat(n||t.nid,":").concat(a),t.skipEscape=!0,s}function MH(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!IH.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function OH(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var l9={scheme:"http",domainHost:!0,parse:s9,serialize:a9},EH={scheme:"https",domainHost:l9.domainHost,parse:s9,serialize:a9},Gb={scheme:"ws",domainHost:!0,parse:CH,serialize:TH},_H={scheme:"wss",domainHost:Gb.domainHost,parse:Gb.parse,serialize:Gb.serialize},kH={scheme:"urn",parse:PH,serialize:wH,skipNormalize:!0},AH={scheme:"urn:uuid",parse:MH,serialize:OH,skipNormalize:!0},fS={http:l9,https:EH,ws:Gb,wss:_H,urn:kH,"urn:uuid":AH};c9.exports=fS});var d9=pe((r0e,Vb)=>{"use strict";d();var{normalizeIPv6:DH,normalizeIPv4:FH,removeDotSegments:xh,recomposeAuthority:LH,normalizeComponentEncoding:Ub}=o9(),mS=p9();function RH(e,t){return typeof e=="string"?e=gs(Pa(e,t),t):typeof e=="object"&&(e=Pa(gs(e,t),t)),e}function NH(e,t,r){let n=Object.assign({scheme:"null"},r),o=u9(Pa(e,n),Pa(t,n),n,!0);return gs(o,L(T({},n),{skipEscape:!0}))}function u9(e,t,r,n){let o={};return n||(e=Pa(gs(e,r),r),t=Pa(gs(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=xh(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=xh(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=xh(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=xh(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}function BH(e,t,r){return typeof e=="string"?(e=unescape(e),e=gs(Ub(Pa(e,r),!0),L(T({},r),{skipEscape:!0}))):typeof e=="object"&&(e=gs(Ub(e,!0),L(T({},r),{skipEscape:!0}))),typeof t=="string"?(t=unescape(t),t=gs(Ub(Pa(t,r),!0),L(T({},r),{skipEscape:!0}))):typeof t=="object"&&(t=gs(Ub(t,!0),L(T({},r),{skipEscape:!0}))),e.toLowerCase()===t.toLowerCase()}function gs(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=mS[(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 s=LH(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path.charAt(0)!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=xh(a)),s===void 0&&(a=a.replace(new RegExp("^\\/\\/","u"),"/%2F")),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var $H=Array.from({length:127},(e,t)=>new RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u").test(String.fromCharCode(t)));function jH(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||$H[t])return!0;return!1}var GH=new RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u");function Pa(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 s=e.match(GH);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host){let l=FH(n.host);if(l.isIPV4===!1){let p=DH(l.host);n.host=p.host.toLowerCase(),i=p.isIPV6}else n.host=l.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 a=mS[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&jH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}(!a||a&&!a.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)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var hS={SCHEMES:mS,normalize:RH,resolve:NH,resolveComponents:u9,equal:BH,serialize:gs,parse:Pa};Vb.exports=hS;Vb.exports.default=hS;Vb.exports.fastUri=hS});var m9=pe(yS=>{"use strict";d();Object.defineProperty(yS,"__esModule",{value:!0});var f9=d9();f9.code='require("ajv/dist/runtime/uri").default';yS.default=f9});var S9=pe(rn=>{"use strict";d();Object.defineProperty(rn,"__esModule",{value:!0});rn.CodeGen=rn.Name=rn.nil=rn.stringify=rn.str=rn._=rn.KeywordCxt=void 0;var UH=gh();Object.defineProperty(rn,"KeywordCxt",{enumerable:!0,get:function(){return UH.KeywordCxt}});var Pd=Ke();Object.defineProperty(rn,"_",{enumerable:!0,get:function(){return Pd._}});Object.defineProperty(rn,"str",{enumerable:!0,get:function(){return Pd.str}});Object.defineProperty(rn,"stringify",{enumerable:!0,get:function(){return Pd.stringify}});Object.defineProperty(rn,"nil",{enumerable:!0,get:function(){return Pd.nil}});Object.defineProperty(rn,"Name",{enumerable:!0,get:function(){return Pd.Name}});Object.defineProperty(rn,"CodeGen",{enumerable:!0,get:function(){return Pd.CodeGen}});var VH=Bb(),x9=bh(),zH=WI(),vh=jb(),HH=Ke(),Ih=mh(),zb=fh(),bS=Et(),h9=q6(),WH=m9(),v9=(e,t)=>new RegExp(e,t);v9.code="new RegExp";var ZH=["removeAdditional","useDefaults","coerceTypes"],qH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XH={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."},YH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y9=200;function KH(e){var t,r,n,o,i,s,a,l,p,u,m,h,g,v,I,b,C,P,w,M,E,B,$,D,F;let W=e.strict,G=(t=e.code)===null||t===void 0?void 0:t.optimize,U=G===!0||G===void 0?1:G||0,J=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:v9,X=(o=e.uriResolver)!==null&&o!==void 0?o:WH.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:W)!==null&&s!==void 0?s:!0,strictNumbers:(l=(a=e.strictNumbers)!==null&&a!==void 0?a:W)!==null&&l!==void 0?l:!0,strictTypes:(u=(p=e.strictTypes)!==null&&p!==void 0?p:W)!==null&&u!==void 0?u:"log",strictTuples:(h=(m=e.strictTuples)!==null&&m!==void 0?m:W)!==null&&h!==void 0?h:"log",strictRequired:(v=(g=e.strictRequired)!==null&&g!==void 0?g:W)!==null&&v!==void 0?v:!1,code:e.code?L(T({},e.code),{optimize:U,regExp:J}):{optimize:U,regExp:J},loopRequired:(I=e.loopRequired)!==null&&I!==void 0?I:y9,loopEnum:(b=e.loopEnum)!==null&&b!==void 0?b:y9,meta:(C=e.meta)!==null&&C!==void 0?C:!0,messages:(P=e.messages)!==null&&P!==void 0?P:!0,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(B=e.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:($=e.validateFormats)!==null&&$!==void 0?$:!0,unicodeRegExp:(D=e.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(F=e.int32range)!==null&&F!==void 0?F:!0,uriResolver:X}}var Sh=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=T(T({},t),KH(t));let{es5:r,lines:n}=this.opts.code;this.scope=new HH.ValueScope({scope:{},prefixes:qH,es5:r,lines:n}),this.logger=nW(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,zH.getRules)(),g9.call(this,XH,t,"NOT SUPPORTED"),g9.call(this,YH,t,"DEPRECATED","warn"),this._metaOpts=tW.call(this),t.formats&&QH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&eW.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),JH.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=h9;n==="id"&&(o=T({},h9),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(u,m){await i.call(this,u.$schema);let h=this._addSchema(u,m);return h.validate||s.call(this,h)}async function i(u){u&&!this.getSchema(u)&&await o.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(m){if(!(m instanceof x9.default))throw m;return a.call(this,m),await l.call(this,m.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:m}){if(this.refs[u])throw new Error("AnySchema ".concat(u," is loaded but ").concat(m," cannot be resolved"))}async function l(u){let m=await p.call(this,u);this.refs[u]||await i.call(this,m.$schema),this.refs[u]||this.addSchema(m,u,r)}async function p(u){let m=this._loading[u];if(m)return m;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error("schema ".concat(s," must be string"))}return r=(0,Ih.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=b9.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new vh.SchemaEnv({schema:{},schemaId:n});if(r=vh.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=b9.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,Ih.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(iW.call(this,n,r),!r)return(0,bS.eachItem)(n,i=>gS.call(this,i)),this;aW.call(this,r);let o=L(T({},r),{type:(0,zb.getJSONTypes)(r.type),schemaType:(0,zb.getJSONTypes)(r.schemaType)});return(0,bS.eachItem)(n,o.type.length===0?i=>gS.call(this,i,o):i=>o.type.forEach(s=>gS.call(this,i,o,s))),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),s=t;for(let a of i)s=s[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:p}=l.definition,u=s[a];p&&u&&(s[a]=I9(u))}}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 s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];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 l=this._cache.get(t);if(l!==void 0)return l;n=(0,Ih.normalizeId)(s||n);let p=Ih.getSchemaRefs.call(this,t,n);return l=new vh.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:p}),this._cache.set(l.schema,l),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),o&&this.validateSchema(t,!0),l}_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):vh.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{vh.compileSchema.call(this,t)}finally{this.opts=r}}};Sh.ValidationError=VH.default;Sh.MissingRefError=x9.default;rn.default=Sh;function g9(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]))}}function b9(e){return e=(0,Ih.normalizeId)(e),this.schemas[e]||this.refs[e]}function JH(){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)}function QH(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function eW(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)}}function tW(){let e=T({},this.opts);for(let t of ZH)delete e[t];return e}var rW={log(){},warn(){},error(){}};function nW(e){if(e===!1)return rW;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")}var oW=/^[a-z_$][a-z0-9_$:-]*$/i;function iW(e,t){let{RULES:r}=this;if((0,bS.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!oW.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')}function gS(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,s=o?i.post:i.rules.find(({type:l})=>l===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:L(T({},t),{type:(0,zb.getJSONTypes)(t.type),schemaType:(0,zb.getJSONTypes)(t.schemaType)})};t.before?sW.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function sW(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")))}function aW(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=I9(t)),e.validateSchema=this.compile(t,!0))}var lW={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function I9(e){return{anyOf:[e,lW]}}});var C9=pe(xS=>{"use strict";d();Object.defineProperty(xS,"__esModule",{value:!0});var cW={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};xS.default=cW});var R9=pe(lp=>{"use strict";d();Object.defineProperty(lp,"__esModule",{value:!0});lp.callRef=lp.getValidate=void 0;var pW=bh(),T9=Go(),so=Ke(),wd=Ca(),P9=jb(),Hb=Et(),w9,uW={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:l}=n,{root:p}=i;if((r==="#"||r==="#/")&&o===p.baseId)return m();let u=P9.resolveRef.call(l,p,o,r);if(u===void 0)throw new pW.default(n.opts.uriResolver,o,r);if(u instanceof P9.SchemaEnv)return h(u);return g(u);function m(){if(i===p)return Wb(e,s,i,i.$async);let v=t.scopeValue("root",{ref:p});return Wb(e,(0,so._)(w9||(w9=_(["",".validate"])),v),p,p.$async)}function h(v){let I=L9(e,v);Wb(e,I,v,v.$async)}function g(v){let I=t.scopeValue("schema",a.code.source===!0?{ref:v,code:(0,so.stringify)(v)}:{ref:v}),b=t.name("valid"),C=e.subschema({schema:v,dataTypes:[],schemaPath:so.nil,topSchemaRef:I,errSchemaPath:r},b);e.mergeEvaluated(C),e.ok(b)}}},M9;function L9(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,so._)(M9||(M9=_(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}lp.getValidate=L9;var O9,E9,_9,k9,A9,D9,F9;function Wb(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,p=l.passContext?wd.default.this:so.nil;n?u():m();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let v=o.let("valid");o.try(()=>{o.code((0,so._)(O9||(O9=_(["await ",""])),(0,T9.callValidateCode)(e,t,p))),g(t),s||o.assign(v,!0)},I=>{o.if((0,so._)(E9||(E9=_(["!("," instanceof ",")"])),I,i.ValidationError),()=>o.throw(I)),h(I),s||o.assign(v,!1)}),e.ok(v)}function m(){e.result((0,T9.callValidateCode)(e,t,p),()=>g(t),()=>h(t))}function h(v){let I=(0,so._)(_9||(_9=_(["",".errors"])),v);o.assign(wd.default.vErrors,(0,so._)(k9||(k9=_([""," === null ? "," : ",".concat(",")"])),wd.default.vErrors,I,wd.default.vErrors,I)),o.assign(wd.default.errors,(0,so._)(A9||(A9=_(["",".length"])),wd.default.vErrors))}function g(v){var I;if(!i.opts.unevaluated)return;let b=(I=r==null?void 0:r.validate)===null||I===void 0?void 0:I.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=Hb.mergeEvaluated.props(o,b.props,i.props));else{let C=o.var("props",(0,so._)(D9||(D9=_(["",".evaluated.props"])),v));i.props=Hb.mergeEvaluated.props(o,C,i.props,so.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=Hb.mergeEvaluated.items(o,b.items,i.items));else{let C=o.var("items",(0,so._)(F9||(F9=_(["",".evaluated.items"])),v));i.items=Hb.mergeEvaluated.items(o,C,i.items,so.Name)}}}lp.callRef=Wb;lp.default=uW});var N9=pe(vS=>{"use strict";d();Object.defineProperty(vS,"__esModule",{value:!0});var dW=C9(),fW=R9(),mW=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",dW.default,fW.default];vS.default=mW});var G9=pe(IS=>{"use strict";d();Object.defineProperty(IS,"__esModule",{value:!0});var Zb=Ke(),Ul=Zb.operators,qb={maximum:{okStr:"<=",ok:Ul.LTE,fail:Ul.GT},minimum:{okStr:">=",ok:Ul.GTE,fail:Ul.LT},exclusiveMaximum:{okStr:"<",ok:Ul.LT,fail:Ul.GTE},exclusiveMinimum:{okStr:">",ok:Ul.GT,fail:Ul.LTE}},B9,$9,hW={message:({keyword:e,schemaCode:t})=>(0,Zb.str)(B9||(B9=_(["must be "," ",""])),qb[e].okStr,t),params:({keyword:e,schemaCode:t})=>(0,Zb._)($9||($9=_(["{comparison: ",", limit: ","}"])),qb[e].okStr,t)},j9,yW={keyword:Object.keys(qb),type:"number",schemaType:"number",$data:!0,error:hW,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Zb._)(j9||(j9=_([""," "," "," || isNaN(",")"])),r,qb[t].fail,n,r))}};IS.default=yW});var Z9=pe(SS=>{"use strict";d();Object.defineProperty(SS,"__esModule",{value:!0});var Ch=Ke(),U9,V9,gW={message:({schemaCode:e})=>(0,Ch.str)(U9||(U9=_(["must be multiple of ",""])),e),params:({schemaCode:e})=>(0,Ch._)(V9||(V9=_(["{multipleOf: ","}"])),e)},z9,H9,W9,bW={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gW,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Ch._)(z9||(z9=_(["Math.abs(Math.round(",") - ",") > 1e-",""])),s,s,i):(0,Ch._)(H9||(H9=_([""," !== parseInt(",")"])),s,s);e.fail$data((0,Ch._)(W9||(W9=_(["("," === 0 || ("," = ","/",", ","))"])),n,s,r,n,a))}};SS.default=bW});var X9=pe(CS=>{"use strict";d();Object.defineProperty(CS,"__esModule",{value:!0});function q9(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}CS.default=q9;q9.code='require("ajv/dist/runtime/ucs2length").default'});var tE=pe(TS=>{"use strict";d();Object.defineProperty(TS,"__esModule",{value:!0});var cp=Ke(),xW=Et(),vW=X9(),Y9,K9,IW={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,cp.str)(Y9||(Y9=_(["must NOT have "," than "," characters"])),r,t)},params:({schemaCode:e})=>(0,cp._)(K9||(K9=_(["{limit: ","}"])),e)},J9,Q9,eE,SW={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:IW,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?cp.operators.GT:cp.operators.LT,s=o.opts.unicode===!1?(0,cp._)(J9||(J9=_(["",".length"])),r):(0,cp._)(Q9||(Q9=_(["","(",")"])),(0,xW.useFunc)(e.gen,vW.default),r);e.fail$data((0,cp._)(eE||(eE=_([""," "," ",""])),s,i,n))}};TS.default=SW});var sE=pe(PS=>{"use strict";d();Object.defineProperty(PS,"__esModule",{value:!0});var CW=Go(),Xb=Ke(),rE,nE,TW={message:({schemaCode:e})=>(0,Xb.str)(rE||(rE=_(['must match pattern "','"'])),e),params:({schemaCode:e})=>(0,Xb._)(nE||(nE=_(["{pattern: ","}"])),e)},oE,iE,PW={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:TW,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,Xb._)(oE||(oE=_(["(new RegExp(",", ","))"])),o,s):(0,CW.usePattern)(e,n);e.fail$data((0,Xb._)(iE||(iE=_(["!",".test(",")"])),a,t))}};PS.default=PW});var pE=pe(wS=>{"use strict";d();Object.defineProperty(wS,"__esModule",{value:!0});var Th=Ke(),aE,lE,wW={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Th.str)(aE||(aE=_(["must NOT have "," than "," properties"])),r,t)},params:({schemaCode:e})=>(0,Th._)(lE||(lE=_(["{limit: ","}"])),e)},cE,MW={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:wW,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Th.operators.GT:Th.operators.LT;e.fail$data((0,Th._)(cE||(cE=_(["Object.keys(",").length "," ",""])),r,o,n))}};wS.default=MW});var fE=pe(MS=>{"use strict";d();Object.defineProperty(MS,"__esModule",{value:!0});var Ph=Go(),wh=Ke(),OW=Et(),uE,dE,EW={message:({params:{missingProperty:e}})=>(0,wh.str)(uE||(uE=_(["must have required property '","'"])),e),params:({params:{missingProperty:e}})=>(0,wh._)(dE||(dE=_(["{missingProperty: ","}"])),e)},_W={keyword:"required",type:"object",schemaType:"array",$data:!0,error:EW,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(s.allErrors?p():u(),a.strictRequired){let g=e.parentSchema.properties,{definedProperties:v}=e.it;for(let I of r)if((g==null?void 0:g[I])===void 0&&!v.has(I)){let b=s.schemaEnv.baseId+s.errSchemaPath,C='required property "'.concat(I,'" is not defined at "').concat(b,'" (strictRequired)');(0,OW.checkStrictMode)(s,C,s.opts.strictRequired)}}function p(){if(l||i)e.block$data(wh.nil,m);else for(let g of r)(0,Ph.checkReportMissingProp)(e,g)}function u(){let g=t.let("missing");if(l||i){let v=t.let("valid",!0);e.block$data(v,()=>h(g,v)),e.ok(v)}else t.if((0,Ph.checkMissingProp)(e,r,g)),(0,Ph.reportMissingProp)(e,g),t.else()}function m(){t.forOf("prop",n,g=>{e.setParams({missingProperty:g}),t.if((0,Ph.noPropertyInData)(t,o,g,a.ownProperties),()=>e.error())})}function h(g,v){e.setParams({missingProperty:g}),t.forOf(g,n,()=>{t.assign(v,(0,Ph.propertyInData)(t,o,g,a.ownProperties)),t.if((0,wh.not)(v),()=>{e.error(),t.break()})},wh.nil)}}};MS.default=_W});var gE=pe(OS=>{"use strict";d();Object.defineProperty(OS,"__esModule",{value:!0});var Mh=Ke(),mE,hE,kW={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Mh.str)(mE||(mE=_(["must NOT have "," than "," items"])),r,t)},params:({schemaCode:e})=>(0,Mh._)(hE||(hE=_(["{limit: ","}"])),e)},yE,AW={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:kW,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Mh.operators.GT:Mh.operators.LT;e.fail$data((0,Mh._)(yE||(yE=_(["",".length "," ",""])),r,o,n))}};OS.default=AW});var Yb=pe(ES=>{"use strict";d();Object.defineProperty(ES,"__esModule",{value:!0});var bE=eS();bE.code='require("ajv/dist/runtime/equal").default';ES.default=bE});var RE=pe(kS=>{"use strict";d();Object.defineProperty(kS,"__esModule",{value:!0});var _S=fh(),nn=Ke(),DW=Et(),FW=Yb(),xE,vE,LW={message:({params:{i:e,j:t}})=>(0,nn.str)(xE||(xE=_(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),params:({params:{i:e,j:t}})=>(0,nn._)(vE||(vE=_(["{i: ",", j: ","}"])),e,t)},IE,SE,CE,TE,PE,wE,ME,OE,EE,_E,kE,AE,DE,FE,LE,RW={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:LW,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let l=t.let("valid"),p=i.items?(0,_S.getSchemaTypes)(i.items):[];e.block$data(l,u,(0,nn._)(IE||(IE=_([""," === false"])),s)),e.ok(l);function u(){let v=t.let("i",(0,nn._)(SE||(SE=_(["",".length"])),r)),I=t.let("j");e.setParams({i:v,j:I}),t.assign(l,!0),t.if((0,nn._)(CE||(CE=_([""," > 1"])),v),()=>(m()?h:g)(v,I))}function m(){return p.length>0&&!p.some(v=>v==="object"||v==="array")}function h(v,I){let b=t.name("item"),C=(0,_S.checkDataTypes)(p,b,a.opts.strictNumbers,_S.DataType.Wrong),P=t.const("indices",(0,nn._)(TE||(TE=_(["{}"]))));t.for((0,nn._)(PE||(PE=_([";","--;"])),v),()=>{t.let(b,(0,nn._)(wE||(wE=_(["","[","]"])),r,v)),t.if(C,(0,nn._)(ME||(ME=_(["continue"])))),p.length>1&&t.if((0,nn._)(OE||(OE=_(["typeof ",' == "string"'])),b),(0,nn._)(EE||(EE=_(["",' += "_"'])),b)),t.if((0,nn._)(_E||(_E=_(["typeof ","[",'] == "number"'])),P,b),()=>{t.assign(I,(0,nn._)(kE||(kE=_(["","[","]"])),P,b)),e.error(),t.assign(l,!1).break()}).code((0,nn._)(AE||(AE=_(["","[","] = ",""])),P,b,v))})}function g(v,I){let b=(0,DW.useFunc)(t,FW.default),C=t.name("outer");t.label(C).for((0,nn._)(DE||(DE=_([";","--;"])),v),()=>t.for((0,nn._)(FE||(FE=_([""," = ","; ","--;"])),I,v,I),()=>t.if((0,nn._)(LE||(LE=_(["","(","[","], ","[","])"])),b,r,v,r,I),()=>{e.error(),t.assign(l,!1).break(C)})))}}};kS.default=RW});var jE=pe(DS=>{"use strict";d();Object.defineProperty(DS,"__esModule",{value:!0});var AS=Ke(),NW=Et(),BW=Yb(),NE,$W={message:"must be equal to constant",params:({schemaCode:e})=>(0,AS._)(NE||(NE=_(["{allowedValue: ","}"])),e)},BE,$E,jW={keyword:"const",$data:!0,error:$W,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,AS._)(BE||(BE=_(["!","(",", ",")"])),(0,NW.useFunc)(t,BW.default),r,o)):e.fail((0,AS._)($E||($E=_([""," !== ",""])),i,r))}};DS.default=jW});var HE=pe(FS=>{"use strict";d();Object.defineProperty(FS,"__esModule",{value:!0});var Oh=Ke(),GW=Et(),UW=Yb(),GE,VW={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Oh._)(GE||(GE=_(["{allowedValues: ","}"])),e)},UE,VE,zE,zW={keyword:"enum",schemaType:"array",$data:!0,error:VW,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,l,p=()=>l!=null?l:l=(0,GW.useFunc)(t,UW.default),u;if(a||n)u=t.let("valid"),e.block$data(u,m);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=t.const("vSchema",i);u=(0,Oh.or)(...o.map((v,I)=>h(g,I)))}e.pass(u);function m(){t.assign(u,!1),t.forOf("v",i,g=>t.if((0,Oh._)(UE||(UE=_(["","(",", ",")"])),p(),r,g),()=>t.assign(u,!0).break()))}function h(g,v){let I=o[v];return typeof I=="object"&&I!==null?(0,Oh._)(VE||(VE=_(["","(",", ","[","])"])),p(),r,g,v):(0,Oh._)(zE||(zE=_([""," === ",""])),r,I)}}};FS.default=zW});var WE=pe(LS=>{"use strict";d();Object.defineProperty(LS,"__esModule",{value:!0});var HW=G9(),WW=Z9(),ZW=tE(),qW=sE(),XW=pE(),YW=fE(),KW=gE(),JW=RE(),QW=jE(),eZ=HE(),tZ=[HW.default,WW.default,ZW.default,qW.default,XW.default,YW.default,KW.default,JW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},QW.default,eZ.default];LS.default=tZ});var NS=pe(Eh=>{"use strict";d();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.validateAdditionalItems=void 0;var pp=Ke(),RS=Et(),ZE,qE,rZ={message:({params:{len:e}})=>(0,pp.str)(ZE||(ZE=_(["must NOT have more than "," items"])),e),params:({params:{len:e}})=>(0,pp._)(qE||(qE=_(["{limit: ","}"])),e)},nZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:rZ,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,RS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}JE(e,n)}},XE,YE,KE;function JE(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,pp._)(XE||(XE=_(["",".length"])),o));if(n===!1)e.setParams({len:t.length}),e.pass((0,pp._)(YE||(YE=_([""," <= ",""])),a,t.length));else if(typeof n=="object"&&!(0,RS.alwaysValidSchema)(s,n)){let p=r.var("valid",(0,pp._)(KE||(KE=_([""," <= ",""])),a,t.length));r.if((0,pp.not)(p),()=>l(p)),e.ok(p)}function l(p){r.forRange("i",t.length,a,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:RS.Type.Num},p),s.allErrors||r.if((0,pp.not)(p),()=>r.break())})}}Eh.validateAdditionalItems=JE;Eh.default=nZ});var BS=pe(_h=>{"use strict";d();Object.defineProperty(_h,"__esModule",{value:!0});_h.validateTuple=void 0;var QE=Ke(),Kb=Et(),oZ=Go(),iZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return r8(e,"additionalItems",t);r.items=!0,!(0,Kb.alwaysValidSchema)(r,t)&&e.ok((0,oZ.validateArray)(e))}},e8,t8;function r8(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;u(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Kb.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),p=n.const("len",(0,QE._)(e8||(e8=_(["",".length"])),i));r.forEach((m,h)=>{(0,Kb.alwaysValidSchema)(a,m)||(n.if((0,QE._)(t8||(t8=_([""," > ",""])),p,h),()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function u(m){let{opts:h,errSchemaPath:g}=a,v=r.length,I=v===m.minItems&&(v===m.maxItems||m[t]===!1);if(h.strictTuples&&!I){let b='"'.concat(s,'" is ').concat(v,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(g,'"');(0,Kb.checkStrictMode)(a,b,h.strictTuples)}}}_h.validateTuple=r8;_h.default=iZ});var n8=pe($S=>{"use strict";d();Object.defineProperty($S,"__esModule",{value:!0});var sZ=BS(),aZ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,sZ.validateTuple)(e,"items")};$S.default=aZ});var a8=pe(jS=>{"use strict";d();Object.defineProperty(jS,"__esModule",{value:!0});var o8=Ke(),lZ=Et(),cZ=Go(),pZ=NS(),i8,s8,uZ={message:({params:{len:e}})=>(0,o8.str)(i8||(i8=_(["must NOT have more than "," items"])),e),params:({params:{len:e}})=>(0,o8._)(s8||(s8=_(["{limit: ","}"])),e)},dZ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:uZ,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,lZ.alwaysValidSchema)(n,t)&&(o?(0,pZ.validateAdditionalItems)(e,o):e.ok((0,cZ.validateArray)(e)))}};jS.default=dZ});var v8=pe(GS=>{"use strict";d();Object.defineProperty(GS,"__esModule",{value:!0});var Vo=Ke(),Jb=Et(),l8,c8,p8,u8,fZ={message:({params:{min:e,max:t}})=>t===void 0?(0,Vo.str)(l8||(l8=_(["must contain at least "," valid item(s)"])),e):(0,Vo.str)(c8||(c8=_(["must contain at least "," and no more than "," valid item(s)"])),e,t),params:({params:{min:e,max:t}})=>t===void 0?(0,Vo._)(p8||(p8=_(["{minContains: ","}"])),e):(0,Vo._)(u8||(u8=_(["{minContains: ",", maxContains: ","}"])),e,t)},d8,f8,m8,h8,y8,g8,b8,x8,mZ={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:fZ,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:l,maxContains:p}=n;i.opts.next?(s=l===void 0?1:l,a=p):s=1;let u=t.const("len",(0,Vo._)(d8||(d8=_(["",".length"])),o));if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Jb.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Jb.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Jb.alwaysValidSchema)(i,r)){let I=(0,Vo._)(f8||(f8=_([""," >= ",""])),u,s);a!==void 0&&(I=(0,Vo._)(m8||(m8=_([""," && "," <= ",""])),I,u,a)),e.pass(I);return}i.items=!0;let m=t.name("valid");a===void 0&&s===1?g(m,()=>t.if(m,()=>t.break())):s===0?(t.let(m,!0),a!==void 0&&t.if((0,Vo._)(h8||(h8=_(["",".length > 0"])),o),h)):(t.let(m,!1),h()),e.result(m,()=>e.reset());function h(){let I=t.name("_valid"),b=t.let("count",0);g(I,()=>t.if(I,()=>v(b)))}function g(I,b){t.forRange("i",0,u,C=>{e.subschema({keyword:"contains",dataProp:C,dataPropType:Jb.Type.Num,compositeRule:!0},I),b()})}function v(I){t.code((0,Vo._)(y8||(y8=_(["","++"])),I)),a===void 0?t.if((0,Vo._)(g8||(g8=_([""," >= ",""])),I,s),()=>t.assign(m,!0).break()):(t.if((0,Vo._)(b8||(b8=_([""," > ",""])),I,a),()=>t.assign(m,!1).break()),s===1?t.assign(m,!0):t.if((0,Vo._)(x8||(x8=_([""," >= ",""])),I,s),()=>t.assign(m,!0)))}}};GS.default=mZ});var w8=pe(bs=>{"use strict";d();Object.defineProperty(bs,"__esModule",{value:!0});bs.validateSchemaDeps=bs.validatePropertyDeps=bs.error=void 0;var US=Ke(),hZ=Et(),kh=Go(),I8,S8;bs.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,US.str)(I8||(I8=_(["must have "," "," when property "," is present"])),n,r,e)},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,US._)(S8||(S8=_(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r)};var yZ={keyword:"dependencies",type:"object",schemaType:"object",error:bs.error,code(e){let[t,r]=gZ(e);T8(e,t),P8(e,r)}};function gZ({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]}var C8;function T8(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 s in t){let a=t[s];if(a.length===0)continue;let l=(0,kh.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(l,()=>{for(let p of a)(0,kh.checkReportMissingProp)(e,p)}):(r.if((0,US._)(C8||(C8=_([""," && (",")"])),l,(0,kh.checkMissingProp)(e,a,i))),(0,kh.reportMissingProp)(e,i),r.else())}}bs.validatePropertyDeps=T8;function P8(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,hZ.alwaysValidSchema)(i,t[a])||(r.if((0,kh.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let l=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(l,s)},()=>r.var(s,!0)),e.ok(s))}bs.validateSchemaDeps=P8;bs.default=yZ});var E8=pe(VS=>{"use strict";d();Object.defineProperty(VS,"__esModule",{value:!0});var O8=Ke(),bZ=Et(),M8,xZ={message:"property name must be valid",params:({params:e})=>(0,O8._)(M8||(M8=_(["{propertyName: ","}"])),e.propertyName)},vZ={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xZ,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,bZ.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,O8.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};VS.default=vZ});var HS=pe(zS=>{"use strict";d();Object.defineProperty(zS,"__esModule",{value:!0});var Qb=Go(),Mi=Ke(),IZ=Ca(),e0=Et(),_8,SZ={message:"must NOT have additional properties",params:({params:e})=>(0,Mi._)(_8||(_8=_(["{additionalProperty: ","}"])),e.additionalProperty)},k8,A8,D8,F8,CZ={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:SZ,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,e0.alwaysValidSchema)(s,r))return;let p=(0,Qb.allSchemaProperties)(n.properties),u=(0,Qb.allSchemaProperties)(n.patternProperties);m(),e.ok((0,Mi._)(k8||(k8=_([""," === ",""])),i,IZ.default.errors));function m(){t.forIn("key",o,b=>{!p.length&&!u.length?v(b):t.if(h(b),()=>v(b))})}function h(b){let C;if(p.length>8){let P=(0,e0.schemaRefOrVal)(s,n.properties,"properties");C=(0,Qb.isOwnProperty)(t,P,b)}else p.length?C=(0,Mi.or)(...p.map(P=>(0,Mi._)(A8||(A8=_([""," === ",""])),b,P))):C=Mi.nil;return u.length&&(C=(0,Mi.or)(C,...u.map(P=>(0,Mi._)(D8||(D8=_(["",".test(",")"])),(0,Qb.usePattern)(e,P),b)))),(0,Mi.not)(C)}function g(b){t.code((0,Mi._)(F8||(F8=_(["delete ","[","]"])),o,b))}function v(b){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){g(b);return}if(r===!1){e.setParams({additionalProperty:b}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,e0.alwaysValidSchema)(s,r)){let C=t.name("valid");l.removeAdditional==="failing"?(I(b,C,!1),t.if((0,Mi.not)(C),()=>{e.reset(),g(b)})):(I(b,C),a||t.if((0,Mi.not)(C),()=>t.break()))}}function I(b,C,P){let w={keyword:"additionalProperties",dataProp:b,dataPropType:e0.Type.Str};P===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,C)}}};zS.default=CZ});var N8=pe(ZS=>{"use strict";d();Object.defineProperty(ZS,"__esModule",{value:!0});var TZ=gh(),L8=Go(),WS=Et(),R8=HS(),PZ={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&&R8.default.code(new TZ.KeywordCxt(i,R8.default,"additionalProperties"));let s=(0,L8.allSchemaProperties)(r);for(let m of s)i.definedProperties.add(m);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=WS.mergeEvaluated.props(t,(0,WS.toHash)(s),i.props));let a=s.filter(m=>!(0,WS.alwaysValidSchema)(i,r[m]));if(a.length===0)return;let l=t.name("valid");for(let m of a)p(m)?u(m):(t.if((0,L8.propertyInData)(t,o,m,i.opts.ownProperties)),u(m),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(m),e.ok(l);function p(m){return i.opts.useDefaults&&!i.compositeRule&&r[m].default!==void 0}function u(m){e.subschema({keyword:"properties",schemaProp:m,dataProp:m},l)}}};ZS.default=PZ});var V8=pe(qS=>{"use strict";d();Object.defineProperty(qS,"__esModule",{value:!0});var B8=Go(),t0=Ke(),$8=Et(),j8=Et(),G8,U8,wZ={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,B8.allSchemaProperties)(r),l=a.filter(I=>(0,$8.alwaysValidSchema)(i,r[I]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let p=s.strictSchema&&!s.allowMatchingProperties&&o.properties,u=t.name("valid");i.props!==!0&&!(i.props instanceof t0.Name)&&(i.props=(0,j8.evaluatedPropsToName)(t,i.props));let{props:m}=i;h();function h(){for(let I of a)p&&g(I),i.allErrors?v(I):(t.var(u,!0),v(I),t.if(u))}function g(I){for(let b in p)new RegExp(I).test(b)&&(0,$8.checkStrictMode)(i,"property ".concat(b," matches pattern ").concat(I," (use allowMatchingProperties)"))}function v(I){t.forIn("key",n,b=>{t.if((0,t0._)(G8||(G8=_(["",".test(",")"])),(0,B8.usePattern)(e,I),b),()=>{let C=l.includes(I);C||e.subschema({keyword:"patternProperties",schemaProp:I,dataProp:b,dataPropType:j8.Type.Str},u),i.opts.unevaluated&&m!==!0?t.assign((0,t0._)(U8||(U8=_(["","[","]"])),m,b),!0):!C&&!i.allErrors&&t.if((0,t0.not)(u),()=>t.break())})})}}};qS.default=wZ});var z8=pe(XS=>{"use strict";d();Object.defineProperty(XS,"__esModule",{value:!0});var MZ=Et(),OZ={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,MZ.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"}};XS.default=OZ});var H8=pe(YS=>{"use strict";d();Object.defineProperty(YS,"__esModule",{value:!0});var EZ=Go(),_Z={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:EZ.validateUnion,error:{message:"must match a schema in anyOf"}};YS.default=_Z});var X8=pe(KS=>{"use strict";d();Object.defineProperty(KS,"__esModule",{value:!0});var r0=Ke(),kZ=Et(),W8,AZ={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,r0._)(W8||(W8=_(["{passingSchemas: ","}"])),e.passing)},Z8,q8,DZ={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:AZ,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,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(p),e.result(s,()=>e.reset(),()=>e.error(!0));function p(){i.forEach((u,m)=>{let h;(0,kZ.alwaysValidSchema)(o,u)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},l),m>0&&t.if((0,r0._)(Z8||(Z8=_([""," && ",""])),l,s)).assign(s,!1).assign(a,(0,r0._)(q8||(q8=_(["[",", ","]"])),a,m)).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,m),h&&e.mergeEvaluated(h,r0.Name)})})}}};KS.default=DZ});var Y8=pe(JS=>{"use strict";d();Object.defineProperty(JS,"__esModule",{value:!0});var FZ=Et(),LZ={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,s)=>{if((0,FZ.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};JS.default=LZ});var r_=pe(QS=>{"use strict";d();Object.defineProperty(QS,"__esModule",{value:!0});var n0=Ke(),t_=Et(),J8,Q8,RZ={message:({params:e})=>(0,n0.str)(J8||(J8=_(['must match "','" schema'])),e.ifClause),params:({params:e})=>(0,n0._)(Q8||(Q8=_(["{failingKeyword: ","}"])),e.ifClause)},e_,NZ={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:RZ,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,t_.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=K8(n,"then"),i=K8(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&i){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,p("then",u),p("else",u))}else o?t.if(a,p("then")):t.if((0,n0.not)(a),p("else"));e.pass(s,()=>e.error(!0));function l(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function p(u,m){return()=>{let h=e.subschema({keyword:u},a);t.assign(s,a),e.mergeValidEvaluated(h,s),m?t.assign(m,(0,n0._)(e_||(e_=_(["",""])),u)):e.setParams({ifClause:u})}}}};function K8(e,t){let r=e.schema[t];return r!==void 0&&!(0,t_.alwaysValidSchema)(e,r)}QS.default=NZ});var n_=pe(e3=>{"use strict";d();Object.defineProperty(e3,"__esModule",{value:!0});var BZ=Et(),$Z={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,BZ.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};e3.default=$Z});var o_=pe(t3=>{"use strict";d();Object.defineProperty(t3,"__esModule",{value:!0});var jZ=NS(),GZ=n8(),UZ=BS(),VZ=a8(),zZ=v8(),HZ=w8(),WZ=E8(),ZZ=HS(),qZ=N8(),XZ=V8(),YZ=z8(),KZ=H8(),JZ=X8(),QZ=Y8(),eq=r_(),tq=n_();function rq(e=!1){let t=[YZ.default,KZ.default,JZ.default,QZ.default,eq.default,tq.default,WZ.default,ZZ.default,HZ.default,qZ.default,XZ.default];return e?t.push(GZ.default,VZ.default):t.push(jZ.default,UZ.default),t.push(zZ.default),t}t3.default=rq});var S_=pe(r3=>{"use strict";d();Object.defineProperty(r3,"__esModule",{value:!0});var Mr=Ke(),i_,s_,nq={message:({schemaCode:e})=>(0,Mr.str)(i_||(i_=_(['must match format "','"'])),e),params:({schemaCode:e})=>(0,Mr._)(s_||(s_=_(["{format: ","}"])),e)},a_,l_,c_,p_,u_,d_,f_,m_,h_,y_,g_,b_,x_,v_,I_,oq={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:nq,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:p,schemaEnv:u,self:m}=a;if(!l.validateFormats)return;o?h():g();function h(){let v=r.scopeValue("formats",{ref:m.formats,code:l.code.formats}),I=r.const("fDef",(0,Mr._)(a_||(a_=_(["","[","]"])),v,s)),b=r.let("fType"),C=r.let("format");r.if((0,Mr._)(l_||(l_=_(["typeof ",' == "object" && !('," instanceof RegExp)"])),I,I),()=>r.assign(b,(0,Mr._)(c_||(c_=_(["",'.type || "string"'])),I)).assign(C,(0,Mr._)(p_||(p_=_(["",".validate"])),I)),()=>r.assign(b,(0,Mr._)(u_||(u_=_(['"string"'])))).assign(C,I)),e.fail$data((0,Mr.or)(P(),w()));function P(){return l.strictSchema===!1?Mr.nil:(0,Mr._)(d_||(d_=_([""," && !",""])),s,C)}function w(){let M=u.$async?(0,Mr._)(f_||(f_=_(["(",".async ? await ","(",") : ","(","))"])),I,C,n,C,n):(0,Mr._)(m_||(m_=_(["","(",")"])),C,n),E=(0,Mr._)(h_||(h_=_(["(typeof ",' == "function" ? '," : ",".test(","))"])),C,M,C,n);return(0,Mr._)(y_||(y_=_([""," && "," !== true && "," === "," && !",""])),C,C,b,t,E)}}function g(){let v=m.formats[i];if(!v){P();return}if(v===!0)return;let[I,b,C]=w(v);I===t&&e.pass(M());function P(){if(l.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,'"')}}function w(E){let B=E instanceof RegExp?(0,Mr.regexpCode)(E):l.code.formats?(0,Mr._)(g_||(g_=_(["","",""])),l.code.formats,(0,Mr.getProperty)(i)):void 0,$=r.scopeValue("formats",{key:i,ref:E,code:B});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Mr._)(b_||(b_=_(["",".validate"])),$)]:["string",E,$]}function M(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Mr._)(x_||(x_=_(["await ","(",")"])),C,n)}return typeof b=="function"?(0,Mr._)(v_||(v_=_(["","(",")"])),C,n):(0,Mr._)(I_||(I_=_(["",".test(",")"])),C,n)}}}};r3.default=oq});var C_=pe(n3=>{"use strict";d();Object.defineProperty(n3,"__esModule",{value:!0});var iq=S_(),sq=[iq.default];n3.default=sq});var T_=pe(Md=>{"use strict";d();Object.defineProperty(Md,"__esModule",{value:!0});Md.contentVocabulary=Md.metadataVocabulary=void 0;Md.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Md.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var w_=pe(o3=>{"use strict";d();Object.defineProperty(o3,"__esModule",{value:!0});var aq=N9(),lq=WE(),cq=o_(),pq=C_(),P_=T_(),uq=[aq.default,lq.default,(0,cq.default)(),pq.default,P_.metadataVocabulary,P_.contentVocabulary];o3.default=uq});var O_=pe(o0=>{"use strict";d();Object.defineProperty(o0,"__esModule",{value:!0});o0.DiscrError=void 0;var M_;(function(e){e.Tag="tag",e.Mapping="mapping"})(M_||(o0.DiscrError=M_={}))});var F_=pe(s3=>{"use strict";d();Object.defineProperty(s3,"__esModule",{value:!0});var Od=Ke(),i3=O_(),E_=jb(),dq=bh(),fq=Et(),__,mq={message:({params:{discrError:e,tagName:t}})=>e===i3.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Od._)(__||(__=_(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t)},k_,A_,D_,hq={keyword:"discriminator",type:"object",schemaType:"object",error:mq,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let l=t.let("valid",!1),p=t.const("tag",(0,Od._)(k_||(k_=_(["","",""])),r,(0,Od.getProperty)(a)));t.if((0,Od._)(A_||(A_=_(["typeof ",' == "string"'])),p),()=>u(),()=>e.error(!1,{discrError:i3.DiscrError.Tag,tag:p,tagName:a})),e.ok(l);function u(){let g=h();t.if(!1);for(let v in g)t.elseIf((0,Od._)(D_||(D_=_([""," === ",""])),p,v)),t.assign(l,m(g[v]));t.else(),e.error(!1,{discrError:i3.DiscrError.Mapping,tag:p,tagName:a}),t.endIf()}function m(g){let v=t.name("valid"),I=e.subschema({keyword:"oneOf",schemaProp:g},v);return e.mergeEvaluated(I,Od.Name),v}function h(){var g;let v={},I=C(o),b=!0;for(let M=0;M<s.length;M++){let E=s[M];if(E!=null&&E.$ref&&!(0,fq.schemaHasRulesButRef)(E,i.self.RULES)){let $=E.$ref;if(E=E_.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,$),E instanceof E_.SchemaEnv&&(E=E.schema),E===void 0)throw new dq.default(i.opts.uriResolver,i.baseId,$)}let B=(g=E==null?void 0:E.properties)===null||g===void 0?void 0:g[a];if(typeof B!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(a,'"'));b=b&&(I||C(E)),P(B,M)}if(!b)throw new Error('discriminator: "'.concat(a,'" must be required'));return v;function C({required:M}){return Array.isArray(M)&&M.includes(a)}function P(M,E){if(M.const)w(M.const,E);else if(M.enum)for(let B of M.enum)w(B,E);else throw new Error('discriminator: "properties/'.concat(a,'" must have "const" or "enum"'))}function w(M,E){if(typeof M!="string"||M in v)throw new Error('discriminator: "'.concat(a,'" values must be unique strings'));v[M]=E}}}};s3.default=hq});var L_=pe((nve,yq)=>{yq.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 l3=pe((tr,a3)=>{"use strict";d();Object.defineProperty(tr,"__esModule",{value:!0});tr.MissingRefError=tr.ValidationError=tr.CodeGen=tr.Name=tr.nil=tr.stringify=tr.str=tr._=tr.KeywordCxt=tr.Ajv=void 0;var gq=S9(),bq=w_(),xq=F_(),R_=L_(),vq=["/properties"],i0="http://json-schema.org/draft-07/schema",Ed=class extends gq.default{_addVocabularies(){super._addVocabularies(),bq.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(xq.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(R_,vq):R_;this.addMetaSchema(t,i0,!1),this.refs["http://json-schema.org/schema"]=i0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i0)?i0:void 0)}};tr.Ajv=Ed;a3.exports=tr=Ed;a3.exports.Ajv=Ed;Object.defineProperty(tr,"__esModule",{value:!0});tr.default=Ed;var Iq=gh();Object.defineProperty(tr,"KeywordCxt",{enumerable:!0,get:function(){return Iq.KeywordCxt}});var _d=Ke();Object.defineProperty(tr,"_",{enumerable:!0,get:function(){return _d._}});Object.defineProperty(tr,"str",{enumerable:!0,get:function(){return _d.str}});Object.defineProperty(tr,"stringify",{enumerable:!0,get:function(){return _d.stringify}});Object.defineProperty(tr,"nil",{enumerable:!0,get:function(){return _d.nil}});Object.defineProperty(tr,"Name",{enumerable:!0,get:function(){return _d.Name}});Object.defineProperty(tr,"CodeGen",{enumerable:!0,get:function(){return _d.CodeGen}});var Sq=Bb();Object.defineProperty(tr,"ValidationError",{enumerable:!0,get:function(){return Sq.default}});var Cq=bh();Object.defineProperty(tr,"MissingRefError",{enumerable:!0,get:function(){return Cq.default}})});var U_=pe(xs=>{"use strict";d();Object.defineProperty(xs,"__esModule",{value:!0});xs.formatNames=xs.fastFormats=xs.fullFormats=void 0;function kd(e,t){return{validate:e,compare:t}}xs.fullFormats={date:kd($_,u3),time:kd(j_,d3),"date-time":kd(Mq,G_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_q,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:new RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Nq,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:kq,int32:{type:"number",validate:Fq},int64:{type:"number",validate:Lq},float:{type:"number",validate:B_},double:{type:"number",validate:B_},password:!0,binary:!0};xs.fastFormats=L(T({},xs.fullFormats),{date:kd(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,u3),time:kd(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d3),"date-time":kd(/^\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,G_),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});xs.formatNames=Object.keys(xs.fullFormats);function Tq(e){return e%4===0&&(e%100!==0||e%400===0)}var Pq=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,wq=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $_(e){let t=Pq.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&&Tq(r)?29:wq[n])}function u3(e,t){if(e&&t)return e>t?1:e<t?-1:0}var c3=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function j_(e,t){let r=c3.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3],s=r[5];return(n<=23&&o<=59&&i<=59||n===23&&o===59&&i===60)&&(!t||s!=="")}function d3(e,t){if(!(e&&t))return;let r=c3.exec(e),n=c3.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}var p3=/t|\s/i;function Mq(e){let t=e.split(p3);return t.length===2&&$_(t[0])&&j_(t[1],!0)}function G_(e,t){if(!(e&&t))return;let[r,n]=e.split(p3),[o,i]=t.split(p3),s=u3(r,o);if(s!==void 0)return s||d3(n,i)}var Oq=/\/|:/,Eq=/^(?:[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 _q(e){return Oq.test(e)&&Eq.test(e)}var N_=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function kq(e){return N_.lastIndex=0,N_.test(e)}var Aq=-(2**31),Dq=2**31-1;function Fq(e){return Number.isInteger(e)&&e<=Dq&&e>=Aq}function Lq(e){return Number.isInteger(e)}function B_(){return!0}var Rq=/[^\\]\\Z/;function Nq(e){if(Rq.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var K_=pe(Ad=>{"use strict";d();Object.defineProperty(Ad,"__esModule",{value:!0});Ad.formatLimitDefinition=void 0;var Bq=l3(),Oi=Ke(),Vl=Oi.operators,s0={formatMaximum:{okStr:"<=",ok:Vl.LTE,fail:Vl.GT},formatMinimum:{okStr:">=",ok:Vl.GTE,fail:Vl.LT},formatExclusiveMaximum:{okStr:"<",ok:Vl.LT,fail:Vl.GTE},formatExclusiveMinimum:{okStr:">",ok:Vl.GT,fail:Vl.LTE}},V_,z_,$q={message:({keyword:e,schemaCode:t})=>Oi.str(V_||(V_=_(["should be "," ",""])),s0[e].okStr,t),params:({keyword:e,schemaCode:t})=>Oi._(z_||(z_=_(["{comparison: ",", limit: ","}"])),s0[e].okStr,t)},H_,W_,Z_,q_,X_,Y_;Ad.formatLimitDefinition={keyword:Object.keys(s0),type:"string",schemaType:"string",$data:!0,error:$q,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let l=new Bq.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?p():u();function p(){let h=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),g=t.const("fmt",Oi._(H_||(H_=_(["","[","]"])),h,l.schemaCode));e.fail$data(Oi.or(Oi._(W_||(W_=_(["typeof ",' != "object"'])),g),Oi._(Z_||(Z_=_([""," instanceof RegExp"])),g),Oi._(q_||(q_=_(["typeof ",'.compare != "function"'])),g),m(g)))}function u(){let h=l.schema,g=a.formats[h];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error('"'.concat(o,'": format "').concat(h,'" does not define "compare" function'));let v=t.scopeValue("formats",{key:h,ref:g,code:s.code.formats?Oi._(X_||(X_=_(["","",""])),s.code.formats,Oi.getProperty(h)):void 0});e.fail$data(m(v))}function m(h){return Oi._(Y_||(Y_=_(["",".compare(",", ",") "," 0"])),h,r,n,s0[o].fail)}},dependencies:["format"]};var jq=e=>(e.addKeyword(Ad.formatLimitDefinition),e);Ad.default=jq});var rk=pe((Ah,tk)=>{"use strict";d();Object.defineProperty(Ah,"__esModule",{value:!0});var Dd=U_(),Gq=K_(),f3=Ke(),J_=new f3.Name("fullFormats"),Uq=new f3.Name("fastFormats"),m3=(e,t={keywords:!0})=>{if(Array.isArray(t))return Q_(e,t,Dd.fullFormats,J_),e;let[r,n]=t.mode==="fast"?[Dd.fastFormats,Uq]:[Dd.fullFormats,J_],o=t.formats||Dd.formatNames;return Q_(e,o,r,n),t.keywords&&Gq.default(e),e};m3.get=(e,t="full")=>{let n=(t==="fast"?Dd.fastFormats:Dd.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var ek;function Q_(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=f3._(ek||(ek=_(['require("ajv-formats/dist/formats").',""])),n));for(let s of t)e.addFormat(s,r[s])}tk.exports=Ah=m3;Object.defineProperty(Ah,"__esModule",{value:!0});Ah.default=m3});var GR=pe((T$e,OT)=>{"use strict";d();var Gx=qU();Gx.default&&(Gx=Gx.default);OT.exports=jR;OT.exports.default=jR;function jR(e,t,r){t=t||1;for(var n,o,i,s,a=0;a<e[0].length;a++){var l=e[0][a];(!a||l[0]<n)&&(n=l[0]),(!a||l[1]<o)&&(o=l[1]),(!a||l[0]>i)&&(i=l[0]),(!a||l[1]>s)&&(s=l[1])}var p=i-n,u=s-o,m=Math.min(p,u),h=m/2;if(m===0){var g=[n,o];return g.distance=0,g}for(var v=new Gx(void 0,Bie),I=n;I<i;I+=m)for(var b=o;b<s;b+=m)v.push(new ec(I+h,b+h,h,e));var C=jie(e),P=new ec(n+p/2,o+u/2,0,e);P.d>C.d&&(C=P);for(var w=v.length;v.length;){var M=v.pop();M.d>C.d&&(C=M,r&&console.log("found best %d after %d probes",Math.round(1e4*M.d)/1e4,w)),!(M.max-C.d<=t)&&(h=M.h/2,v.push(new ec(M.x-h,M.y-h,h,e)),v.push(new ec(M.x+h,M.y-h,h,e)),v.push(new ec(M.x-h,M.y+h,h,e)),v.push(new ec(M.x+h,M.y+h,h,e)),w+=4)}r&&(console.log("num probes: "+w),console.log("best distance: "+C.d));var E=[C.x,C.y];return E.distance=C.d,E}function Bie(e,t){return t.max-e.max}function ec(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=$ie(e,t,n),this.max=this.d+this.h*Math.SQRT2}function $ie(e,t,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var s=r[i],a=0,l=s.length,p=l-1;a<l;p=a++){var u=s[a],m=s[p];u[1]>t!=m[1]>t&&e<(m[0]-u[0])*(t-u[1])/(m[1]-u[1])+u[0]&&(n=!n),o=Math.min(o,Gie(e,t,u,m))}return o===0?0:(n?1:-1)*Math.sqrt(o)}function jie(e){for(var t=0,r=0,n=0,o=e[0],i=0,s=o.length,a=s-1;i<s;a=i++){var l=o[i],p=o[a],u=l[0]*p[1]-p[0]*l[1];r+=(l[0]+p[0])*u,n+=(l[1]+p[1])*u,t+=u*3}return t===0?new ec(o[0][0],o[0][1],0,e):new ec(r/t,n/t,0,e)}function Gie(e,t,r,n){var o=r[0],i=r[1],s=n[0]-o,a=n[1]-i;if(s!==0||a!==0){var l=((e-o)*s+(t-i)*a)/(s*s+a*a);l>1?(o=n[0],i=n[1]):l>0&&(o+=s*l,i+=a*l)}return s=e-o,a=t-i,s*s+a*a}});var pN=pe((GT,UT)=>{d();(function(e,t){typeof GT=="object"&&typeof UT<"u"?UT.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(GT,function(){"use strict";function e(b,C,P,w,M){(function E(B,$,D,F,W){for(;F>D;){if(F-D>600){var G=F-D+1,U=$-D+1,J=Math.log(G),X=.5*Math.exp(2*J/3),ie=.5*Math.sqrt(J*X*(G-X)/G)*(U-G/2<0?-1:1),te=Math.max(D,Math.floor($-U*X/G+ie)),xe=Math.min(F,Math.floor($+(G-U)*X/G+ie));E(B,$,te,xe,W)}var Pe=B[$],he=D,Re=F;for(t(B,D,$),W(B[F],Pe)>0&&t(B,D,F);he<Re;){for(t(B,he,Re),he++,Re--;W(B[he],Pe)<0;)he++;for(;W(B[Re],Pe)>0;)Re--}W(B[D],Pe)===0?t(B,D,Re):t(B,++Re,F),Re<=$&&(D=Re+1),$<=Re&&(F=Re-1)}})(b,C,P||0,w||b.length-1,M||r)}function t(b,C,P){var w=b[C];b[C]=b[P],b[P]=w}function r(b,C){return b<C?-1:b>C?1:0}var n=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,C,P){if(!P)return C.indexOf(b);for(var w=0;w<C.length;w++)if(P(b,C[w]))return w;return-1}function i(b,C){s(b,0,b.children.length,C,b)}function s(b,C,P,w,M){M||(M=v(null)),M.minX=1/0,M.minY=1/0,M.maxX=-1/0,M.maxY=-1/0;for(var E=C;E<P;E++){var B=b.children[E];a(M,b.leaf?w(B):B)}return M}function a(b,C){return b.minX=Math.min(b.minX,C.minX),b.minY=Math.min(b.minY,C.minY),b.maxX=Math.max(b.maxX,C.maxX),b.maxY=Math.max(b.maxY,C.maxY),b}function l(b,C){return b.minX-C.minX}function p(b,C){return b.minY-C.minY}function u(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function m(b){return b.maxX-b.minX+(b.maxY-b.minY)}function h(b,C){return b.minX<=C.minX&&b.minY<=C.minY&&C.maxX<=b.maxX&&C.maxY<=b.maxY}function g(b,C){return C.minX<=b.maxX&&C.minY<=b.maxY&&C.maxX>=b.minX&&C.maxY>=b.minY}function v(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(b,C,P,w,M){for(var E=[C,P];E.length;)if(!((P=E.pop())-(C=E.pop())<=w)){var B=C+Math.ceil((P-C)/w/2)*w;e(b,B,C,P,M),E.push(C,B,B,P)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(b){var C=this.data,P=[];if(!g(b,C))return P;for(var w=this.toBBox,M=[];C;){for(var E=0;E<C.children.length;E++){var B=C.children[E],$=C.leaf?w(B):B;g(b,$)&&(C.leaf?P.push(B):h(b,$)?this._all(B,P):M.push(B))}C=M.pop()}return P},n.prototype.collides=function(b){var C=this.data;if(!g(b,C))return!1;for(var P=[];C;){for(var w=0;w<C.children.length;w++){var M=C.children[w],E=C.leaf?this.toBBox(M):M;if(g(b,E)){if(C.leaf||h(b,E))return!0;P.push(M)}}C=P.pop()}return!1},n.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var C=0;C<b.length;C++)this.insert(b[C]);return this}var P=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===P.height)this._splitRoot(this.data,P);else{if(this.data.height<P.height){var w=this.data;this.data=P,P=w}this._insert(P,this.data.height-P.height-1,!0)}else this.data=P;return this},n.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},n.prototype.clear=function(){return this.data=v([]),this},n.prototype.remove=function(b,C){if(!b)return this;for(var P,w,M,E=this.data,B=this.toBBox(b),$=[],D=[];E||$.length;){if(E||(E=$.pop(),w=$[$.length-1],P=D.pop(),M=!0),E.leaf){var F=o(b,E.children,C);if(F!==-1)return E.children.splice(F,1),$.push(E),this._condense($),this}M||E.leaf||!h(E,B)?w?(P++,E=w.children[P],M=!1):E=null:($.push(E),D.push(P),P=0,w=E,E=E.children[0])}return this},n.prototype.toBBox=function(b){return b},n.prototype.compareMinX=function(b,C){return b.minX-C.minX},n.prototype.compareMinY=function(b,C){return b.minY-C.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(b){return this.data=b,this},n.prototype._all=function(b,C){for(var P=[];b;)b.leaf?C.push.apply(C,b.children):P.push.apply(P,b.children),b=P.pop();return C},n.prototype._build=function(b,C,P,w){var M,E=P-C+1,B=this._maxEntries;if(E<=B)return i(M=v(b.slice(C,P+1)),this.toBBox),M;w||(w=Math.ceil(Math.log(E)/Math.log(B)),B=Math.ceil(E/Math.pow(B,w-1))),(M=v([])).leaf=!1,M.height=w;var $=Math.ceil(E/B),D=$*Math.ceil(Math.sqrt(B));I(b,C,P,D,this.compareMinX);for(var F=C;F<=P;F+=D){var W=Math.min(F+D-1,P);I(b,F,W,$,this.compareMinY);for(var G=F;G<=W;G+=$){var U=Math.min(G+$-1,W);M.children.push(this._build(b,G,U,w-1))}}return i(M,this.toBBox),M},n.prototype._chooseSubtree=function(b,C,P,w){for(;w.push(C),!C.leaf&&w.length-1!==P;){for(var M=1/0,E=1/0,B=void 0,$=0;$<C.children.length;$++){var D=C.children[$],F=u(D),W=(G=b,U=D,(Math.max(U.maxX,G.maxX)-Math.min(U.minX,G.minX))*(Math.max(U.maxY,G.maxY)-Math.min(U.minY,G.minY))-F);W<E?(E=W,M=F<M?F:M,B=D):W===E&&F<M&&(M=F,B=D)}C=B||C.children[0]}var G,U;return C},n.prototype._insert=function(b,C,P){var w=P?b:this.toBBox(b),M=[],E=this._chooseSubtree(w,this.data,C,M);for(E.children.push(b),a(E,w);C>=0&&M[C].children.length>this._maxEntries;)this._split(M,C),C--;this._adjustParentBBoxes(w,M,C)},n.prototype._split=function(b,C){var P=b[C],w=P.children.length,M=this._minEntries;this._chooseSplitAxis(P,M,w);var E=this._chooseSplitIndex(P,M,w),B=v(P.children.splice(E,P.children.length-E));B.height=P.height,B.leaf=P.leaf,i(P,this.toBBox),i(B,this.toBBox),C?b[C-1].children.push(B):this._splitRoot(P,B)},n.prototype._splitRoot=function(b,C){this.data=v([b,C]),this.data.height=b.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(b,C,P){for(var w,M,E,B,$,D,F,W=1/0,G=1/0,U=C;U<=P-C;U++){var J=s(b,0,U,this.toBBox),X=s(b,U,P,this.toBBox),ie=(M=J,E=X,B=void 0,$=void 0,D=void 0,F=void 0,B=Math.max(M.minX,E.minX),$=Math.max(M.minY,E.minY),D=Math.min(M.maxX,E.maxX),F=Math.min(M.maxY,E.maxY),Math.max(0,D-B)*Math.max(0,F-$)),te=u(J)+u(X);ie<W?(W=ie,w=U,G=te<G?te:G):ie===W&&te<G&&(G=te,w=U)}return w||P-C},n.prototype._chooseSplitAxis=function(b,C,P){var w=b.leaf?this.compareMinX:l,M=b.leaf?this.compareMinY:p;this._allDistMargin(b,C,P,w)<this._allDistMargin(b,C,P,M)&&b.children.sort(w)},n.prototype._allDistMargin=function(b,C,P,w){b.children.sort(w);for(var M=this.toBBox,E=s(b,0,C,M),B=s(b,P-C,P,M),$=m(E)+m(B),D=C;D<P-C;D++){var F=b.children[D];a(E,b.leaf?M(F):F),$+=m(E)}for(var W=P-C-1;W>=C;W--){var G=b.children[W];a(B,b.leaf?M(G):G),$+=m(B)}return $},n.prototype._adjustParentBBoxes=function(b,C,P){for(var w=P;w>=0;w--)a(C[w],b)},n.prototype._condense=function(b){for(var C=b.length-1,P=void 0;C>=0;C--)b[C].children.length===0?C>0?(P=b[C-1].children).splice(P.indexOf(b[C]),1):this.clear():i(b[C],this.toBBox)},n})});var ZT=pe(Fe=>{"use strict";d();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.earthRadius=63710088e-1;Fe.factors={centimeters:Fe.earthRadius*100,centimetres:Fe.earthRadius*100,degrees:Fe.earthRadius/111325,feet:Fe.earthRadius*3.28084,inches:Fe.earthRadius*39.37,kilometers:Fe.earthRadius/1e3,kilometres:Fe.earthRadius/1e3,meters:Fe.earthRadius,metres:Fe.earthRadius,miles:Fe.earthRadius/1609.344,millimeters:Fe.earthRadius*1e3,millimetres:Fe.earthRadius*1e3,nauticalmiles:Fe.earthRadius/1852,radians:1,yards:Fe.earthRadius*1.0936};Fe.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/Fe.earthRadius,yards:1.0936133};Fe.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 rc(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}Fe.feature=rc;function Mse(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return VT(t).geometry;case"LineString":return HT(t).geometry;case"Polygon":return zT(t).geometry;case"MultiPoint":return dN(t).geometry;case"MultiLineString":return uN(t).geometry;case"MultiPolygon":return fN(t).geometry;default:throw new Error(e+" is invalid")}}Fe.geometry=Mse;function VT(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(!Zx(e[0])||!Zx(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return rc(n,t,r)}Fe.point=VT;function Ose(e,t,r){return r===void 0&&(r={}),qx(e.map(function(n){return VT(n,t)}),r)}Fe.points=Ose;function zT(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 s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:e};return rc(a,t,r)}Fe.polygon=zT;function Ese(e,t,r){return r===void 0&&(r={}),qx(e.map(function(n){return zT(n,t)}),r)}Fe.polygons=Ese;function HT(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 rc(n,t,r)}Fe.lineString=HT;function _se(e,t,r){return r===void 0&&(r={}),qx(e.map(function(n){return HT(n,t)}),r)}Fe.lineStrings=_se;function qx(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}Fe.featureCollection=qx;function uN(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return rc(n,t,r)}Fe.multiLineString=uN;function dN(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return rc(n,t,r)}Fe.multiPoint=dN;function fN(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return rc(n,t,r)}Fe.multiPolygon=fN;function kse(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return rc(n,t,r)}Fe.geometryCollection=kse;function Ase(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}Fe.round=Ase;function mN(e,t){t===void 0&&(t="kilometers");var r=Fe.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}Fe.radiansToLength=mN;function WT(e,t){t===void 0&&(t="kilometers");var r=Fe.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}Fe.lengthToRadians=WT;function Dse(e,t){return hN(WT(e,t))}Fe.lengthToDegrees=Dse;function Fse(e){var t=e%360;return t<0&&(t+=360),t}Fe.bearingToAzimuth=Fse;function hN(e){var t=e%(2*Math.PI);return t*180/Math.PI}Fe.radiansToDegrees=hN;function Lse(e){var t=e%360;return t*Math.PI/180}Fe.degreesToRadians=Lse;function Rse(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 mN(WT(e,t),r)}Fe.convertLength=Rse;function Nse(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=Fe.areaFactors[t];if(!n)throw new Error("invalid original units");var o=Fe.areaFactors[r];if(!o)throw new Error("invalid final units");return e/n*o}Fe.convertArea=Nse;function Zx(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}Fe.isNumber=Zx;function Bse(e){return!!e&&e.constructor===Object}Fe.isObject=Bse;function $se(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(!Zx(t))throw new Error("bbox must only contain numbers")})}Fe.validateBBox=$se;function jse(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")}Fe.validateId=jse});var XT=pe(Ur=>{"use strict";d();Object.defineProperty(Ur,"__esModule",{value:!0});var An=ZT();function fy(e,t,r){if(e!==null)for(var n,o,i,s,a,l,p,u=0,m=0,h,g=e.type,v=g==="FeatureCollection",I=g==="Feature",b=v?e.features.length:1,C=0;C<b;C++){p=v?e.features[C].geometry:I?e.geometry:e,h=p?p.type==="GeometryCollection":!1,a=h?p.geometries.length:1;for(var P=0;P<a;P++){var w=0,M=0;if(s=h?p.geometries[P]:p,s!==null){l=s.coordinates;var E=s.type;switch(u=r&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(l,m,C,w,M)===!1)return!1;m++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],m,C,w,M)===!1)return!1;m++,E==="MultiPoint"&&w++}E==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-u;o++){if(t(l[n][o],m,C,w,M)===!1)return!1;m++}E==="MultiLineString"&&w++,E==="Polygon"&&M++}E==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(M=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-u;i++){if(t(l[n][o][i],m,C,w,M)===!1)return!1;m++}M++}w++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(fy(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Gse(e,t,r,n){var o=r;return fy(e,function(i,s,a,l,p){s===0&&r===void 0?o=i:o=t(o,i,s,a,l,p)},n),o}function yN(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}}function Use(e,t,r){var n=r;return yN(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}function gN(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++);}function Vse(e,t,r){var n=r;return gN(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}function zse(e){var t=[];return fy(e,function(r){t.push(r)}),t}function qT(e,t){var r,n,o,i,s,a,l,p,u,m,h=0,g=e.type==="FeatureCollection",v=e.type==="Feature",I=g?e.features.length:1;for(r=0;r<I;r++){for(a=g?e.features[r].geometry:v?e.geometry:e,p=g?e.features[r].properties:v?e.properties:{},u=g?e.features[r].bbox:v?e.bbox:void 0,m=g?e.features[r].id:v?e.id:void 0,l=a?a.type==="GeometryCollection":!1,s=l?a.geometries.length:1,o=0;o<s;o++){if(i=l?a.geometries[o]:a,i===null){if(t(null,h,p,u,m)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,h,p,u,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],h,p,u,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Hse(e,t,r){var n=r;return qT(e,function(o,i,s,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,s,a,l)}),n}function Xx(e,t){qT(e,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(An.feature(r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<r.coordinates.length;p++){var u=r.coordinates[p],m={type:l,coordinates:u};if(t(An.feature(m,o),n,p)===!1)return!1}})}function Wse(e,t,r){var n=r;return Xx(e,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=t(n,o,i,s)}),n}function bN(e,t){Xx(e,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,l=0,p=0,u=0;if(fy(r,function(m,h,g,v,I){if(a===void 0||n>l||v>p||I>u){a=m,l=n,p=v,u=I,i=0;return}var b=An.lineString([a,m],r.properties);if(t(b,n,o,I,i)===!1)return!1;i++,a=m})===!1)return!1}}})}function Zse(e,t,r){var n=r,o=!1;return bN(e,function(i,s,a,l,p){o===!1&&r===void 0?n=i:n=t(n,i,s,a,l,p),o=!0}),n}function xN(e,t){if(!e)throw new Error("geojson is required");Xx(e,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(t(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(t(An.lineString(s[a],r.properties),n,o,a)===!1)return!1;break}}})}function qse(e,t,r){var n=r;return xN(e,function(o,i,s,a){i===0&&r===void 0?n=o:n=t(n,o,i,s,a)}),n}function Xse(e,t){if(t=t||{},!An.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,s=t.properties,a;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,a=e.features[r].geometry;break;case"Feature":s=s||e.properties,a=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=e;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var l=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=l.length+i-1),An.lineString([l[i],l[i+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i-1),An.lineString([l[o][i],l[o][i+1]],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i-1),An.lineString([l[n][i],l[n][i+1]],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),i<0&&(i=l[n][o].length-i-1),An.lineString([l[n][o][i],l[n][o][i+1]],s,t)}throw new Error("geojson is invalid")}function Yse(e,t){if(t=t||{},!An.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,s=t.properties,a;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,a=e.features[r].geometry;break;case"Feature":s=s||e.properties,a=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=e;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var l=a.coordinates;switch(a.type){case"Point":return An.point(l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),An.point(l[n],s,t);case"LineString":return i<0&&(i=l.length+i),An.point(l[i],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i),An.point(l[o][i],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i),An.point(l[n][i],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),i<0&&(i=l[n][o].length-i),An.point(l[n][o][i],s,t)}throw new Error("geojson is invalid")}Ur.coordAll=zse;Ur.coordEach=fy;Ur.coordReduce=Gse;Ur.featureEach=gN;Ur.featureReduce=Vse;Ur.findPoint=Yse;Ur.findSegment=Xse;Ur.flattenEach=Xx;Ur.flattenReduce=Wse;Ur.geomEach=qT;Ur.geomReduce=Hse;Ur.lineEach=xN;Ur.lineReduce=qse;Ur.propEach=yN;Ur.propReduce=Use;Ur.segmentEach=bN;Ur.segmentReduce=Zse});var vN=pe(KT=>{"use strict";d();Object.defineProperty(KT,"__esModule",{value:!0});var Kse=XT();function YT(e){var t=[1/0,1/0,-1/0,-1/0];return Kse.coordEach(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}YT.default=YT;KT.default=YT});var PN=pe((nUe,JT)=>{d();var Ns=pN(),SN=ZT(),CN=XT(),Pf=vN().default,Jse=CN.featureEach,tUe=CN.coordEach,rUe=SN.polygon,IN=SN.featureCollection;function TN(e){var t=new Ns(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Pf(r),Ns.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:Pf(o),n.push(o)}):Jse(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Pf(o),n.push(o)}),Ns.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:Pf(r),Ns.prototype.remove.call(this,r,n)},t.clear=function(){return Ns.prototype.clear.call(this)},t.search=function(r){var n=Ns.prototype.search.call(this,this.toBBox(r));return IN(n)},t.collides=function(r){return Ns.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=Ns.prototype.all.call(this);return IN(r)},t.toJSON=function(){return Ns.prototype.toJSON.call(this)},t.fromJSON=function(r){return Ns.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=Pf(r);else if(r.type==="FeatureCollection")n=Pf(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}JT.exports=TN;JT.exports.default=TN});var ew=pe((ig,tm)=>{d();var qle=200,i$="__lodash_hash_undefined__",Xle=800,Yle=16,s$=9007199254740991,a$="[object Arguments]",Kle="[object Array]",Jle="[object AsyncFunction]",Qle="[object Boolean]",ece="[object Date]",tce="[object Error]",l$="[object Function]",rce="[object GeneratorFunction]",nce="[object Map]",oce="[object Number]",ice="[object Null]",c$="[object Object]",sce="[object Proxy]",ace="[object RegExp]",lce="[object Set]",cce="[object String]",pce="[object Undefined]",uce="[object WeakMap]",dce="[object ArrayBuffer]",fce="[object DataView]",mce="[object Float32Array]",hce="[object Float64Array]",yce="[object Int8Array]",gce="[object Int16Array]",bce="[object Int32Array]",xce="[object Uint8Array]",vce="[object Uint8ClampedArray]",Ice="[object Uint16Array]",Sce="[object Uint32Array]",Cce=/[\\^$.*+?()[\]{}|]/g,Tce=/^\[object .+?Constructor\]$/,Pce=/^(?:0|[1-9]\d*)$/,sr={};sr[mce]=sr[hce]=sr[yce]=sr[gce]=sr[bce]=sr[xce]=sr[vce]=sr[Ice]=sr[Sce]=!0;sr[a$]=sr[Kle]=sr[dce]=sr[Qle]=sr[fce]=sr[ece]=sr[tce]=sr[l$]=sr[nce]=sr[oce]=sr[c$]=sr[ace]=sr[lce]=sr[cce]=sr[uce]=!1;var p$=typeof global=="object"&&global&&global.Object===Object&&global,wce=typeof self=="object"&&self&&self.Object===Object&&self,lg=p$||wce||Function("return this")(),u$=typeof ig=="object"&&ig&&!ig.nodeType&&ig,sg=u$&&typeof tm=="object"&&tm&&!tm.nodeType&&tm,d$=sg&&sg.exports===u$,zP=d$&&p$.process,YB=function(){try{var e=sg&&sg.require&&sg.require("util").types;return e||zP&&zP.binding&&zP.binding("util")}catch(t){}}(),KB=YB&&YB.isTypedArray;function Mce(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)}function Oce(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ece(e){return function(t){return e(t)}}function _ce(e,t){return e==null?void 0:e[t]}function kce(e,t){return function(r){return e(t(r))}}var Ace=Array.prototype,Dce=Function.prototype,wv=Object.prototype,HP=lg["__core-js_shared__"],Mv=Dce.toString,sl=wv.hasOwnProperty,JB=function(){var e=/[^.]+$/.exec(HP&&HP.keys&&HP.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),f$=wv.toString,Fce=Mv.call(Object),Lce=RegExp("^"+Mv.call(sl).replace(Cce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tv=d$?lg.Buffer:void 0,QB=lg.Symbol,e$=lg.Uint8Array,t$=Tv?Tv.allocUnsafe:void 0,m$=kce(Object.getPrototypeOf,Object),r$=Object.create,Rce=wv.propertyIsEnumerable,Nce=Ace.splice,Cu=QB?QB.toStringTag:void 0,Pv=function(){try{var e=KP(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Bce=Tv?Tv.isBuffer:void 0,n$=Math.max,$ce=Date.now,h$=KP(lg,"Map"),ag=KP(Object,"create"),jce=function(){function e(){}return function(t){if(!Pu(t))return{};if(r$)return r$(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Tu(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])}}function Gce(){this.__data__=ag?ag(null):{},this.size=0}function Uce(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Vce(e){var t=this.__data__;if(ag){var r=t[e];return r===i$?void 0:r}return sl.call(t,e)?t[e]:void 0}function zce(e){var t=this.__data__;return ag?t[e]!==void 0:sl.call(t,e)}function Hce(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ag&&t===void 0?i$:t,this}Tu.prototype.clear=Gce;Tu.prototype.delete=Uce;Tu.prototype.get=Vce;Tu.prototype.has=zce;Tu.prototype.set=Hce;function al(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])}}function Wce(){this.__data__=[],this.size=0}function Zce(e){var t=this.__data__,r=Ov(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Nce.call(t,r,1),--this.size,!0}function qce(e){var t=this.__data__,r=Ov(t,e);return r<0?void 0:t[r][1]}function Xce(e){return Ov(this.__data__,e)>-1}function Yce(e,t){var r=this.__data__,n=Ov(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}al.prototype.clear=Wce;al.prototype.delete=Zce;al.prototype.get=qce;al.prototype.has=Xce;al.prototype.set=Yce;function rm(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])}}function Kce(){this.size=0,this.__data__={hash:new Tu,map:new(h$||al),string:new Tu}}function Jce(e){var t=_v(this,e).delete(e);return this.size-=t?1:0,t}function Qce(e){return _v(this,e).get(e)}function epe(e){return _v(this,e).has(e)}function tpe(e,t){var r=_v(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}rm.prototype.clear=Kce;rm.prototype.delete=Jce;rm.prototype.get=Qce;rm.prototype.has=epe;rm.prototype.set=tpe;function nm(e){var t=this.__data__=new al(e);this.size=t.size}function rpe(){this.__data__=new al,this.size=0}function npe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function ope(e){return this.__data__.get(e)}function ipe(e){return this.__data__.has(e)}function spe(e,t){var r=this.__data__;if(r instanceof al){var n=r.__data__;if(!h$||n.length<qle-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new rm(n)}return r.set(e,t),this.size=r.size,this}nm.prototype.clear=rpe;nm.prototype.delete=npe;nm.prototype.get=ope;nm.prototype.has=ipe;nm.prototype.set=spe;function ape(e,t){var r=XP(e),n=!r&&qP(e),o=!r&&!n&&x$(e),i=!r&&!n&&!o&&I$(e),s=r||n||o||i,a=s?Oce(e.length,String):[],l=a.length;for(var p in e)(t||sl.call(e,p))&&!(s&&(p=="length"||o&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||g$(p,l)))&&a.push(p);return a}function WP(e,t,r){(r!==void 0&&!kv(e[t],r)||r===void 0&&!(t in e))&&YP(e,t,r)}function lpe(e,t,r){var n=e[t];(!(sl.call(e,t)&&kv(n,r))||r===void 0&&!(t in e))&&YP(e,t,r)}function Ov(e,t){for(var r=e.length;r--;)if(kv(e[r][0],t))return r;return-1}function YP(e,t,r){t=="__proto__"&&Pv?Pv(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var cpe=Spe();function Ev(e){return e==null?e===void 0?pce:ice:Cu&&Cu in Object(e)?Cpe(e):Epe(e)}function o$(e){return cg(e)&&Ev(e)==a$}function ppe(e){if(!Pu(e)||Mpe(e))return!1;var t=QP(e)?Lce:Tce;return t.test(Dpe(e))}function upe(e){return cg(e)&&v$(e.length)&&!!sr[Ev(e)]}function dpe(e){if(!Pu(e))return Ope(e);var t=b$(e),r=[];for(var n in e)n=="constructor"&&(t||!sl.call(e,n))||r.push(n);return r}function y$(e,t,r,n,o){e!==t&&cpe(t,function(i,s){if(o||(o=new nm),Pu(i))fpe(e,t,s,r,y$,n,o);else{var a=n?n(ZP(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),WP(e,s,a)}},S$)}function fpe(e,t,r,n,o,i,s){var a=ZP(e,r),l=ZP(t,r),p=s.get(l);if(p){WP(e,r,p);return}var u=i?i(a,l,r+"",e,t,s):void 0,m=u===void 0;if(m){var h=XP(l),g=!h&&x$(l),v=!h&&!g&&I$(l);u=l,h||g||v?XP(a)?u=a:Fpe(a)?u=xpe(a):g?(m=!1,u=ype(l,!0)):v?(m=!1,u=bpe(l,!0)):u=[]:Lpe(l)||qP(l)?(u=a,qP(a)?u=Rpe(a):(!Pu(a)||QP(a))&&(u=Tpe(l))):m=!1}m&&(s.set(l,u),o(u,l,n,i,s),s.delete(l)),WP(e,r,u)}function mpe(e,t){return kpe(_pe(e,t,C$),e+"")}var hpe=Pv?function(e,t){return Pv(e,"toString",{configurable:!0,enumerable:!1,value:Bpe(t),writable:!0})}:C$;function ype(e,t){if(t)return e.slice();var r=e.length,n=t$?t$(r):new e.constructor(r);return e.copy(n),n}function gpe(e){var t=new e.constructor(e.byteLength);return new e$(t).set(new e$(e)),t}function bpe(e,t){var r=t?gpe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function xpe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function vpe(e,t,r,n){var o=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var a=t[i],l=n?n(r[a],e[a],a,r,e):void 0;l===void 0&&(l=e[a]),o?YP(r,a,l):lpe(r,a,l)}return r}function Ipe(e){return mpe(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&Ppe(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=r[n];a&&e(t,a,n,i)}return t})}function Spe(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(r(i[l],l,i)===!1)break}return t}}function _v(e,t){var r=e.__data__;return wpe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function KP(e,t){var r=_ce(e,t);return ppe(r)?r:void 0}function Cpe(e){var t=sl.call(e,Cu),r=e[Cu];try{e[Cu]=void 0;var n=!0}catch(i){}var o=f$.call(e);return n&&(t?e[Cu]=r:delete e[Cu]),o}function Tpe(e){return typeof e.constructor=="function"&&!b$(e)?jce(m$(e)):{}}function g$(e,t){var r=typeof e;return t=t==null?s$:t,!!t&&(r=="number"||r!="symbol"&&Pce.test(e))&&e>-1&&e%1==0&&e<t}function Ppe(e,t,r){if(!Pu(r))return!1;var n=typeof t;return(n=="number"?JP(r)&&g$(t,r.length):n=="string"&&t in r)?kv(r[t],e):!1}function wpe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Mpe(e){return!!JB&&JB in e}function b$(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||wv;return e===r}function Ope(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function Epe(e){return f$.call(e)}function _pe(e,t,r){return t=n$(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=n$(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=r(s),Mce(e,this,a)}}function ZP(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var kpe=Ape(hpe);function Ape(e){var t=0,r=0;return function(){var n=$ce(),o=Yle-(n-r);if(r=n,o>0){if(++t>=Xle)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Dpe(e){if(e!=null){try{return Mv.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function kv(e,t){return e===t||e!==e&&t!==t}var qP=o$(function(){return arguments}())?o$:function(e){return cg(e)&&sl.call(e,"callee")&&!Rce.call(e,"callee")},XP=Array.isArray;function JP(e){return e!=null&&v$(e.length)&&!QP(e)}function Fpe(e){return cg(e)&&JP(e)}var x$=Bce||$pe;function QP(e){if(!Pu(e))return!1;var t=Ev(e);return t==l$||t==rce||t==Jle||t==sce}function v$(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s$}function Pu(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function cg(e){return e!=null&&typeof e=="object"}function Lpe(e){if(!cg(e)||Ev(e)!=c$)return!1;var t=m$(e);if(t===null)return!0;var r=sl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Mv.call(r)==Fce}var I$=KB?Ece(KB):upe;function Rpe(e){return vpe(e,S$(e))}function S$(e){return JP(e)?ape(e,!0):dpe(e)}var Npe=Ipe(function(e,t,r){y$(e,t,r)});function Bpe(e){return function(){return e}}function C$(e){return e}function $pe(){return!1}tm.exports=Npe});var mw=pe((dg,sm)=>{d();var fue=200,z$="__lodash_hash_undefined__",mue=800,hue=16,H$=9007199254740991,W$="[object Arguments]",yue="[object Array]",gue="[object AsyncFunction]",bue="[object Boolean]",xue="[object Date]",vue="[object Error]",Z$="[object Function]",Iue="[object GeneratorFunction]",Sue="[object Map]",Cue="[object Number]",Tue="[object Null]",q$="[object Object]",Pue="[object Proxy]",wue="[object RegExp]",Mue="[object Set]",Oue="[object String]",Eue="[object Undefined]",_ue="[object WeakMap]",kue="[object ArrayBuffer]",Aue="[object DataView]",Due="[object Float32Array]",Fue="[object Float64Array]",Lue="[object Int8Array]",Rue="[object Int16Array]",Nue="[object Int32Array]",Bue="[object Uint8Array]",$ue="[object Uint8ClampedArray]",jue="[object Uint16Array]",Gue="[object Uint32Array]",Uue=/[\\^$.*+?()[\]{}|]/g,Vue=/^\[object .+?Constructor\]$/,zue=/^(?:0|[1-9]\d*)$/,ar={};ar[Due]=ar[Fue]=ar[Lue]=ar[Rue]=ar[Nue]=ar[Bue]=ar[$ue]=ar[jue]=ar[Gue]=!0;ar[W$]=ar[yue]=ar[kue]=ar[bue]=ar[Aue]=ar[xue]=ar[vue]=ar[Z$]=ar[Sue]=ar[Cue]=ar[q$]=ar[wue]=ar[Mue]=ar[Oue]=ar[_ue]=!1;var X$=typeof global=="object"&&global&&global.Object===Object&&global,Hue=typeof self=="object"&&self&&self.Object===Object&&self,hg=X$||Hue||Function("return this")(),Y$=typeof dg=="object"&&dg&&!dg.nodeType&&dg,fg=Y$&&typeof sm=="object"&&sm&&!sm.nodeType&&sm,K$=fg&&fg.exports===Y$,nw=K$&&X$.process,L$=function(){try{var e=fg&&fg.require&&fg.require("util").types;return e||nw&&nw.binding&&nw.binding("util")}catch(t){}}(),R$=L$&&L$.isTypedArray;function J$(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)}function Wue(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Zue(e){return function(t){return e(t)}}function que(e,t){return e==null?void 0:e[t]}function Xue(e,t){return function(r){return e(t(r))}}var Yue=Array.prototype,Kue=Function.prototype,Rv=Object.prototype,ow=hg["__core-js_shared__"],Nv=Kue.toString,pl=Rv.hasOwnProperty,N$=function(){var e=/[^.]+$/.exec(ow&&ow.keys&&ow.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Q$=Rv.toString,Jue=Nv.call(Object),Que=RegExp("^"+Nv.call(pl).replace(Uue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fv=K$?hg.Buffer:void 0,B$=hg.Symbol,$$=hg.Uint8Array,j$=Fv?Fv.allocUnsafe:void 0,ej=Xue(Object.getPrototypeOf,Object),G$=Object.create,ede=Rv.propertyIsEnumerable,tde=Yue.splice,wu=B$?B$.toStringTag:void 0,Lv=function(){try{var e=uw(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),rde=Fv?Fv.isBuffer:void 0,U$=Math.max,nde=Date.now,tj=uw(hg,"Map"),mg=uw(Object,"create"),ode=function(){function e(){}return function(t){if(!cl(t))return{};if(G$)return G$(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Mu(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])}}function ide(){this.__data__=mg?mg(null):{},this.size=0}function sde(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function ade(e){var t=this.__data__;if(mg){var r=t[e];return r===z$?void 0:r}return pl.call(t,e)?t[e]:void 0}function lde(e){var t=this.__data__;return mg?t[e]!==void 0:pl.call(t,e)}function cde(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=mg&&t===void 0?z$:t,this}Mu.prototype.clear=ide;Mu.prototype.delete=sde;Mu.prototype.get=ade;Mu.prototype.has=lde;Mu.prototype.set=cde;function ul(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])}}function pde(){this.__data__=[],this.size=0}function ude(e){var t=this.__data__,r=Bv(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():tde.call(t,r,1),--this.size,!0}function dde(e){var t=this.__data__,r=Bv(t,e);return r<0?void 0:t[r][1]}function fde(e){return Bv(this.__data__,e)>-1}function mde(e,t){var r=this.__data__,n=Bv(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}ul.prototype.clear=pde;ul.prototype.delete=ude;ul.prototype.get=dde;ul.prototype.has=fde;ul.prototype.set=mde;function am(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])}}function hde(){this.size=0,this.__data__={hash:new Mu,map:new(tj||ul),string:new Mu}}function yde(e){var t=jv(this,e).delete(e);return this.size-=t?1:0,t}function gde(e){return jv(this,e).get(e)}function bde(e){return jv(this,e).has(e)}function xde(e,t){var r=jv(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}am.prototype.clear=hde;am.prototype.delete=yde;am.prototype.get=gde;am.prototype.has=bde;am.prototype.set=xde;function lm(e){var t=this.__data__=new ul(e);this.size=t.size}function vde(){this.__data__=new ul,this.size=0}function Ide(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Sde(e){return this.__data__.get(e)}function Cde(e){return this.__data__.has(e)}function Tde(e,t){var r=this.__data__;if(r instanceof ul){var n=r.__data__;if(!tj||n.length<fue-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new am(n)}return r.set(e,t),this.size=r.size,this}lm.prototype.clear=vde;lm.prototype.delete=Ide;lm.prototype.get=Sde;lm.prototype.has=Cde;lm.prototype.set=Tde;function Pde(e,t){var r=lw(e),n=!r&&aw(e),o=!r&&!n&&sj(e),i=!r&&!n&&!o&&lj(e),s=r||n||o||i,a=s?Wue(e.length,String):[],l=a.length;for(var p in e)(t||pl.call(e,p))&&!(s&&(p=="length"||o&&(p=="offset"||p=="parent")||i&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||oj(p,l)))&&a.push(p);return a}function iw(e,t,r){(r!==void 0&&!Gv(e[t],r)||r===void 0&&!(t in e))&&cw(e,t,r)}function wde(e,t,r){var n=e[t];(!(pl.call(e,t)&&Gv(n,r))||r===void 0&&!(t in e))&&cw(e,t,r)}function Bv(e,t){for(var r=e.length;r--;)if(Gv(e[r][0],t))return r;return-1}function cw(e,t,r){t=="__proto__"&&Lv?Lv(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Mde=$de();function $v(e){return e==null?e===void 0?Eue:Tue:wu&&wu in Object(e)?jde(e):Wde(e)}function V$(e){return yg(e)&&$v(e)==W$}function Ode(e){if(!cl(e)||zde(e))return!1;var t=fw(e)?Que:Vue;return t.test(Yde(e))}function Ede(e){return yg(e)&&aj(e.length)&&!!ar[$v(e)]}function _de(e){if(!cl(e))return Hde(e);var t=ij(e),r=[];for(var n in e)n=="constructor"&&(t||!pl.call(e,n))||r.push(n);return r}function pw(e,t,r,n,o){e!==t&&Mde(t,function(i,s){if(o||(o=new lm),cl(i))kde(e,t,s,r,pw,n,o);else{var a=n?n(sw(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),iw(e,s,a)}},cj)}function kde(e,t,r,n,o,i,s){var a=sw(e,r),l=sw(t,r),p=s.get(l);if(p){iw(e,r,p);return}var u=i?i(a,l,r+"",e,t,s):void 0,m=u===void 0;if(m){var h=lw(l),g=!h&&sj(l),v=!h&&!g&&lj(l);u=l,h||g||v?lw(a)?u=a:Kde(a)?u=Rde(a):g?(m=!1,u=Dde(l,!0)):v?(m=!1,u=Lde(l,!0)):u=[]:Jde(l)||aw(l)?(u=a,aw(a)?u=Qde(a):(!cl(a)||fw(a))&&(u=Gde(l))):m=!1}m&&(s.set(l,u),o(u,l,n,i,s),s.delete(l)),iw(e,r,u)}function rj(e,t){return qde(Zde(e,t,pj),e+"")}var Ade=Lv?function(e,t){return Lv(e,"toString",{configurable:!0,enumerable:!1,value:rfe(t),writable:!0})}:pj;function Dde(e,t){if(t)return e.slice();var r=e.length,n=j$?j$(r):new e.constructor(r);return e.copy(n),n}function Fde(e){var t=new e.constructor(e.byteLength);return new $$(t).set(new $$(e)),t}function Lde(e,t){var r=t?Fde(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Rde(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Nde(e,t,r,n){var o=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var a=t[i],l=n?n(r[a],e[a],a,r,e):void 0;l===void 0&&(l=e[a]),o?cw(r,a,l):wde(r,a,l)}return r}function Bde(e){return rj(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&Ude(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=r[n];a&&e(t,a,n,i)}return t})}function $de(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(r(i[l],l,i)===!1)break}return t}}function nj(e,t,r,n,o,i){return cl(e)&&cl(t)&&(i.set(t,e),pw(e,t,void 0,nj,i),i.delete(t)),e}function jv(e,t){var r=e.__data__;return Vde(t)?r[typeof t=="string"?"string":"hash"]:r.map}function uw(e,t){var r=que(e,t);return Ode(r)?r:void 0}function jde(e){var t=pl.call(e,wu),r=e[wu];try{e[wu]=void 0;var n=!0}catch(i){}var o=Q$.call(e);return n&&(t?e[wu]=r:delete e[wu]),o}function Gde(e){return typeof e.constructor=="function"&&!ij(e)?ode(ej(e)):{}}function oj(e,t){var r=typeof e;return t=t==null?H$:t,!!t&&(r=="number"||r!="symbol"&&zue.test(e))&&e>-1&&e%1==0&&e<t}function Ude(e,t,r){if(!cl(r))return!1;var n=typeof t;return(n=="number"?dw(r)&&oj(t,r.length):n=="string"&&t in r)?Gv(r[t],e):!1}function Vde(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zde(e){return!!N$&&N$ in e}function ij(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Rv;return e===r}function Hde(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function Wde(e){return Q$.call(e)}function Zde(e,t,r){return t=U$(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=U$(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=r(s),J$(e,this,a)}}function sw(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var qde=Xde(Ade);function Xde(e){var t=0,r=0;return function(){var n=nde(),o=hue-(n-r);if(r=n,o>0){if(++t>=mue)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Yde(e){if(e!=null){try{return Nv.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Gv(e,t){return e===t||e!==e&&t!==t}var aw=V$(function(){return arguments}())?V$:function(e){return yg(e)&&pl.call(e,"callee")&&!ede.call(e,"callee")},lw=Array.isArray;function dw(e){return e!=null&&aj(e.length)&&!fw(e)}function Kde(e){return yg(e)&&dw(e)}var sj=rde||nfe;function fw(e){if(!cl(e))return!1;var t=$v(e);return t==Z$||t==Iue||t==gue||t==Pue}function aj(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=H$}function cl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function yg(e){return e!=null&&typeof e=="object"}function Jde(e){if(!yg(e)||$v(e)!=q$)return!1;var t=ej(e);if(t===null)return!0;var r=pl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Nv.call(r)==Jue}var lj=R$?Zue(R$):Ede;function Qde(e){return Nde(e,cj(e))}var efe=rj(function(e){return e.push(void 0,nj),J$(tfe,void 0,e)});function cj(e){return dw(e)?Pde(e,!0):_de(e)}var tfe=Bde(function(e,t,r,n){pw(e,t,r,n)});function rfe(e){return function(){return e}}function pj(e){return e}function nfe(){return!1}sm.exports=efe});var rG=pe((GJe,Pg)=>{"use strict";d();var xfe=!1,_u=!1,Xj=!0,Yj=!1,y={},Kj=!1;typeof Pg<"u"&&Pg.exports?(Pg.exports=y,Kj=!0):typeof document<"u"?window.ClipperLib=y:self.ClipperLib=y;var Qv;Kj?(Hr="chrome",Qv="Netscape"):(Hr=navigator.userAgent.toString().toLowerCase(),Qv=navigator.appName);var Hr,pt={};Hr.indexOf("chrome")!=-1&&Hr.indexOf("chromium")==-1?pt.chrome=1:pt.chrome=0;Hr.indexOf("chromium")!=-1?pt.chromium=1:pt.chromium=0;Hr.indexOf("safari")!=-1&&Hr.indexOf("chrome")==-1&&Hr.indexOf("chromium")==-1?pt.safari=1:pt.safari=0;Hr.indexOf("firefox")!=-1?pt.firefox=1:pt.firefox=0;Hr.indexOf("firefox/17")!=-1?pt.firefox17=1:pt.firefox17=0;Hr.indexOf("firefox/15")!=-1?pt.firefox15=1:pt.firefox15=0;Hr.indexOf("firefox/3")!=-1?pt.firefox3=1:pt.firefox3=0;Hr.indexOf("opera")!=-1?pt.opera=1:pt.opera=0;Hr.indexOf("msie 10")!=-1?pt.msie10=1:pt.msie10=0;Hr.indexOf("msie 9")!=-1?pt.msie9=1:pt.msie9=0;Hr.indexOf("msie 8")!=-1?pt.msie8=1:pt.msie8=0;Hr.indexOf("msie 7")!=-1?pt.msie7=1:pt.msie7=0;Hr.indexOf("msie ")!=-1?pt.msie=1:pt.msie=0;y.biginteger_used=null;var Pc,vfe=0xdeadbeefcafe,Zj=(vfe&16777215)==15715070;function re(e,t,r){y.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))}function bt(){return new re(null)}function Ife(e,t,r,n,o,i){for(;--i>=0;){var s=t*this[e++]+r[n]+o;o=Math.floor(s/67108864),r[n++]=s&67108863}return o}function Sfe(e,t,r,n,o,i){for(var s=t&32767,a=t>>15;--i>=0;){var l=this[e]&32767,p=this[e++]>>15,u=a*l+p*s;l=s*l+((u&32767)<<15)+r[n]+(o&1073741823),o=(l>>>30)+(u>>>15)+a*p+(o>>>30),r[n++]=l&1073741823}return o}function Cfe(e,t,r,n,o,i){for(var s=t&16383,a=t>>14;--i>=0;){var l=this[e]&16383,p=this[e++]>>14,u=a*l+p*s;l=s*l+((u&16383)<<14)+r[n]+o,o=(l>>28)+(u>>14)+a*p,r[n++]=l&268435455}return o}Zj&&Qv=="Microsoft Internet Explorer"?(re.prototype.am=Sfe,Pc=30):Zj&&Qv!="Netscape"?(re.prototype.am=Ife,Pc=26):(re.prototype.am=Cfe,Pc=28);re.prototype.DB=Pc;re.prototype.DM=(1<<Pc)-1;re.prototype.DV=1<<Pc;var kw=52;re.prototype.FV=Math.pow(2,kw);re.prototype.F1=kw-Pc;re.prototype.F2=2*Pc-kw;var Tfe="0123456789abcdefghijklmnopqrstuvwxyz",t2=new Array,mm,hi;mm=48;for(hi=0;hi<=9;++hi)t2[mm++]=hi;mm=97;for(hi=10;hi<36;++hi)t2[mm++]=hi;mm=65;for(hi=10;hi<36;++hi)t2[mm++]=hi;function qj(e){return Tfe.charAt(e)}function Jj(e,t){var r=t2[e.charCodeAt(t)];return r==null?-1:r}function Pfe(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function wfe(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}function Tc(e){var t=bt();return t.fromInt(e),t}function Mfe(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 s=r==8?e[n]&255:Jj(e,n);if(s<0){e.charAt(n)=="-"&&(o=!0);continue}o=!1,i==0?this[this.t++]=s:i+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-i)-1)<<i,this[this.t++]=s>>this.DB-i):this[this.t-1]|=s<<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&&re.ZERO.subTo(this,this)}function Ofe(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function Efe(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="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(o=!0,i=qj(n));s>=0;)a<t?(n=(this[s]&(1<<a)-1)<<t-a,n|=this[--s]>>(a+=this.DB-t)):(n=this[s]>>(a-=t)&r,a<=0&&(a+=this.DB,--s)),n>0&&(o=!0),o&&(i+=qj(n));return o?i:"0"}function _fe(){var e=bt();return re.ZERO.subTo(this,e),e}function kfe(){return this.s<0?this.negate():this}function Afe(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}function r2(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}function Dfe(){return this.t<=0?0:this.DB*(this.t-1)+r2(this[this.t-1]^this.s&this.DM)}function Ffe(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}function Lfe(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}function Rfe(e,t){var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),s=this.s<<r&this.DM,a;for(a=this.t-1;a>=0;--a)t[a+i+1]=this[a]>>n|s,s=(this[a]&o)<<r;for(a=i-1;a>=0;--a)t[a]=0;t[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()}function Nfe(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 s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&i)<<o,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}function Bfe(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()}function $fe(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&&re.ZERO.subTo(t,t)}function jfe(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()}function Gfe(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=bt());var i=bt(),s=this.s,a=e.s,l=this.DB-r2(n[n.t-1]);l>0?(n.lShiftTo(l,i),o.lShiftTo(l,r)):(n.copyTo(i),o.copyTo(r));var p=i.t,u=i[p-1];if(u!=0){var m=u*(1<<this.F1)+(p>1?i[p-2]>>this.F2:0),h=this.FV/m,g=(1<<this.F1)/m,v=1<<this.F2,I=r.t,b=I-p,C=t==null?bt():t;for(i.dlShiftTo(b,C),r.compareTo(C)>=0&&(r[r.t++]=1,r.subTo(C,r)),re.ONE.dlShiftTo(p,C),C.subTo(i,i);i.t<p;)i[i.t++]=0;for(;--b>=0;){var P=r[--I]==u?this.DM:Math.floor(r[I]*h+(r[I-1]+v)*g);if((r[I]+=i.am(0,P,r,b,0,p))<P)for(i.dlShiftTo(b,C),r.subTo(C,r);r[I]<--P;)r.subTo(C,r)}t!=null&&(r.drShiftTo(p,t),s!=a&&re.ZERO.subTo(t,t)),r.t=p,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&re.ZERO.subTo(r,r)}}}function Ufe(e){var t=bt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(re.ZERO)>0&&e.subTo(t,t),t}function ku(e){this.m=e}function Vfe(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function zfe(e){return e}function Hfe(e){e.divRemTo(this.m,null,e)}function Wfe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Zfe(e,t){e.squareTo(t),this.reduce(t)}ku.prototype.convert=Vfe;ku.prototype.revert=zfe;ku.prototype.reduce=Hfe;ku.prototype.mulTo=Wfe;ku.prototype.sqrTo=Zfe;function qfe(){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}function Au(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}function Xfe(e){var t=bt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(re.ZERO)>0&&this.m.subTo(t,t),t}function Yfe(e){var t=bt();return e.copyTo(t),this.reduce(t),t}function Kfe(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)}function Jfe(e,t){e.squareTo(t),this.reduce(t)}function Qfe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Au.prototype.convert=Xfe;Au.prototype.revert=Yfe;Au.prototype.reduce=Kfe;Au.prototype.mulTo=Qfe;Au.prototype.sqrTo=Jfe;function eme(){return(this.t>0?this[0]&1:this.s)==0}function tme(e,t){if(e>4294967295||e<1)return re.ONE;var r=bt(),n=bt(),o=t.convert(this),i=r2(e)-1;for(o.copyTo(r);--i>=0;)if(t.sqrTo(r,n),(e&1<<i)>0)t.mulTo(n,o,r);else{var s=r;r=n,n=s}return t.revert(r)}function rme(e,t){var r;return e<256||t.isEven()?r=new ku(t):r=new Au(t),this.exp(e,r)}re.prototype.copyTo=Pfe;re.prototype.fromInt=wfe;re.prototype.fromString=Mfe;re.prototype.clamp=Ofe;re.prototype.dlShiftTo=Ffe;re.prototype.drShiftTo=Lfe;re.prototype.lShiftTo=Rfe;re.prototype.rShiftTo=Nfe;re.prototype.subTo=Bfe;re.prototype.multiplyTo=$fe;re.prototype.squareTo=jfe;re.prototype.divRemTo=Gfe;re.prototype.invDigit=qfe;re.prototype.isEven=eme;re.prototype.exp=tme;re.prototype.toString=Efe;re.prototype.negate=_fe;re.prototype.abs=kfe;re.prototype.compareTo=Afe;re.prototype.bitLength=Dfe;re.prototype.mod=Ufe;re.prototype.modPowInt=rme;re.ZERO=Tc(0);re.ONE=Tc(1);function nme(){var e=bt();return this.copyTo(e),e}function ome(){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]}function ime(){return this.t==0?this.s:this[0]<<24>>24}function sme(){return this.t==0?this.s:this[0]<<16>>16}function ame(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function lme(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function cme(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=Tc(r),o=bt(),i=bt(),s="";for(this.divRemTo(n,o,i);o.signum()>0;)s=(r+i.intValue()).toString(e).substr(1)+s,o.divRemTo(n,o,i);return i.intValue().toString(e)+s}function pme(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,i=0,s=0,a=0;a<e.length;++a){var l=Jj(e,a);if(l<0){e.charAt(a)=="-"&&this.signum()==0&&(o=!0);continue}s=t*s+l,++i>=r&&(this.dMultiply(n),this.dAddOffset(s,0),i=0,s=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(s,0)),o&&re.ZERO.subTo(this,this)}function ume(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(re.ONE.shiftLeft(e-1),Aw,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(re.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)}}function dme(){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}function fme(e){return this.compareTo(e)==0}function mme(e){return this.compareTo(e)<0?this:e}function hme(e){return this.compareTo(e)>0?this:e}function yme(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()}function gme(e,t){return e&t}function bme(e){var t=bt();return this.bitwiseTo(e,gme,t),t}function Aw(e,t){return e|t}function xme(e){var t=bt();return this.bitwiseTo(e,Aw,t),t}function Qj(e,t){return e^t}function vme(e){var t=bt();return this.bitwiseTo(e,Qj,t),t}function eG(e,t){return e&~t}function Ime(e){var t=bt();return this.bitwiseTo(e,eG,t),t}function Sme(){for(var e=bt(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function Cme(e){var t=bt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function Tme(e){var t=bt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Pme(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}function wme(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+Pme(this[e]);return this.s<0?this.t*this.DB:-1}function Mme(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function Ome(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Mme(this[r]^t);return e}function Eme(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function _me(e,t){var r=re.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function kme(e){return this.changeBit(e,Aw)}function Ame(e){return this.changeBit(e,eG)}function Dme(e){return this.changeBit(e,Qj)}function Fme(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()}function Lme(e){var t=bt();return this.addTo(e,t),t}function Rme(e){var t=bt();return this.subTo(e,t),t}function Nme(e){var t=bt();return this.multiplyTo(e,t),t}function Bme(){var e=bt();return this.squareTo(e),e}function $me(e){var t=bt();return this.divRemTo(e,t,null),t}function jme(e){var t=bt();return this.divRemTo(e,null,t),t}function Gme(e){var t=bt(),r=bt();return this.divRemTo(e,t,r),new Array(t,r)}function Ume(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function Vme(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]}}function wg(){}function tG(e){return e}function zme(e,t,r){e.multiplyTo(t,r)}function Hme(e,t){e.squareTo(t)}wg.prototype.convert=tG;wg.prototype.revert=tG;wg.prototype.mulTo=zme;wg.prototype.sqrTo=Hme;function Wme(e){return this.exp(e,new wg)}function Zme(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()}function qme(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)}function hm(e){this.r2=bt(),this.q3=bt(),re.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Xme(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=bt();return e.copyTo(t),this.reduce(t),t}function Yme(e){return e}function Kme(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)}function Jme(e,t){e.squareTo(t),this.reduce(t)}function Qme(e,t,r){e.multiplyTo(t,r),this.reduce(r)}hm.prototype.convert=Xme;hm.prototype.revert=Yme;hm.prototype.reduce=Kme;hm.prototype.mulTo=Qme;hm.prototype.sqrTo=Jme;function ehe(e,t){var r=e.bitLength(),n,o=Tc(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 ku(t):t.isEven()?i=new hm(t):i=new Au(t);var s=new Array,a=3,l=n-1,p=(1<<n)-1;if(s[1]=i.convert(this),n>1){var u=bt();for(i.sqrTo(s[1],u);a<=p;)s[a]=bt(),i.mulTo(u,s[a-2],s[a]),a+=2}var m=e.t-1,h,g=!0,v=bt(),I;for(r=r2(e[m])-1;m>=0;){for(r>=l?h=e[m]>>r-l&p:(h=(e[m]&(1<<r+1)-1)<<l-r,m>0&&(h|=e[m-1]>>this.DB+r-l)),a=n;(h&1)==0;)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--m),g)s[h].copyTo(o),g=!1;else{for(;a>1;)i.sqrTo(o,v),i.sqrTo(v,o),a-=2;a>0?i.sqrTo(o,v):(I=o,o=v,v=I),i.mulTo(v,s[h],o)}for(;m>=0&&(e[m]&1<<r)==0;)i.sqrTo(o,v),I=o,o=v,v=I,--r<0&&(r=this.DB-1,--m)}return i.revert(o)}function the(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}function rhe(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}function nhe(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return re.ZERO;for(var r=e.clone(),n=this.clone(),o=Tc(1),i=Tc(0),s=Tc(0),a=Tc(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?((!s.isEven()||!a.isEven())&&(s.addTo(this,s),a.subTo(e,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(s,o),i.subTo(a,i)):(n.subTo(r,n),t&&s.subTo(o,s),a.subTo(i,a))}if(n.compareTo(re.ONE)!=0)return re.ZERO;if(a.compareTo(e)>=0)return a.subtract(e);if(a.signum()<0)a.addTo(e,a);else return a;return a.signum()<0?a.add(e):a}var Yn=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ohe=(1<<26)/Yn[Yn.length-1];function ihe(e){var t,r=this.abs();if(r.t==1&&r[0]<=Yn[Yn.length-1]){for(t=0;t<Yn.length;++t)if(r[0]==Yn[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Yn.length;){for(var n=Yn[t],o=t+1;o<Yn.length&&n<ohe;)n*=Yn[o++];for(n=r.modInt(n);t<o;)if(n%Yn[t++]==0)return!1}return r.millerRabin(e)}function she(e){var t=this.subtract(re.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Yn.length&&(e=Yn.length);for(var o=bt(),i=0;i<e;++i){o.fromInt(Yn[Math.floor(Math.random()*Yn.length)]);var s=o.modPow(n,this);if(s.compareTo(re.ONE)!=0&&s.compareTo(t)!=0){for(var a=1;a++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(re.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}re.prototype.chunkSize=ame;re.prototype.toRadix=cme;re.prototype.fromRadix=pme;re.prototype.fromNumber=ume;re.prototype.bitwiseTo=yme;re.prototype.changeBit=_me;re.prototype.addTo=Fme;re.prototype.dMultiply=Ume;re.prototype.dAddOffset=Vme;re.prototype.multiplyLowerTo=Zme;re.prototype.multiplyUpperTo=qme;re.prototype.modInt=rhe;re.prototype.millerRabin=she;re.prototype.clone=nme;re.prototype.intValue=ome;re.prototype.byteValue=ime;re.prototype.shortValue=sme;re.prototype.signum=lme;re.prototype.toByteArray=dme;re.prototype.equals=fme;re.prototype.min=mme;re.prototype.max=hme;re.prototype.and=bme;re.prototype.or=xme;re.prototype.xor=vme;re.prototype.andNot=Ime;re.prototype.not=Sme;re.prototype.shiftLeft=Cme;re.prototype.shiftRight=Tme;re.prototype.getLowestSetBit=wme;re.prototype.bitCount=Ome;re.prototype.testBit=Eme;re.prototype.setBit=kme;re.prototype.clearBit=Ame;re.prototype.flipBit=Dme;re.prototype.add=Lme;re.prototype.subtract=Rme;re.prototype.multiply=Nme;re.prototype.divide=$me;re.prototype.remainder=jme;re.prototype.divideAndRemainder=Gme;re.prototype.modPow=ehe;re.prototype.modInverse=nhe;re.prototype.pow=Wme;re.prototype.gcd=the;re.prototype.isProbablePrime=ihe;re.prototype.square=Bme;var ot=re;ot.prototype.IsNegative=function(){return this.compareTo(ot.ZERO)==-1};ot.op_Equality=function(e,t){return e.compareTo(t)==0};ot.op_Inequality=function(e,t){return e.compareTo(t)!=0};ot.op_GreaterThan=function(e,t){return e.compareTo(t)>0};ot.op_LessThan=function(e,t){return e.compareTo(t)<0};ot.op_Addition=function(e,t){return new ot(e).add(new ot(t))};ot.op_Subtraction=function(e,t){return new ot(e).subtract(new ot(t))};ot.Int128Mul=function(e,t){return new ot(e).multiply(new ot(t))};ot.op_Division=function(e,t){return e.divide(t)};ot.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof e2>"u"&&(e2=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}});var e2;y.Path=function(){return[]};y.Paths=function(){return[]};y.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])};y.DoublePoint0=function(){this.X=0,this.Y=0};y.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};y.DoublePoint2=function(e,t){this.X=e,this.Y=t};y.PolyNode=function(){this.m_Parent=null,this.m_polygon=new y.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};y.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};y.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};y.PolyNode.prototype.Contour=function(){return this.m_polygon};y.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};y.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};y.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]};y.PolyNode.prototype.Childs=function(){return this.m_Childs};y.PolyNode.prototype.Parent=function(){return this.m_Parent};y.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};y.PolyTree=function(){this.m_AllPolys=[],y.PolyNode.call(this)};y.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};y.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};y.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};e2(y.PolyTree,y.PolyNode);y.Math_Abs_Int64=y.Math_Abs_Int32=y.Math_Abs_Double=function(e){return Math.abs(e)};y.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};pt.msie||pt.opera||pt.safari?y.Cast_Int32=function(e){return e|0}:y.Cast_Int32=function(e){return~~e};pt.chrome?y.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:pt.firefox&&typeof Number.toInteger=="function"?y.Cast_Int64=function(e){return Number.toInteger(e)}:pt.msie7||pt.msie8?y.Cast_Int64=function(e){return parseInt(e,10)}:pt.msie?y.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:y.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};y.Clear=function(e){e.length=0};y.PI=3.141592653589793;y.PI2=2*3.141592653589793;y.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,_u)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 y.DoublePoint){var r=e[0];this.X=y.Clipper.Round(r.X),this.Y=y.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 y.DoublePoint){var r=e[0];this.X=y.Clipper.Round(r.X),this.Y=y.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};y.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};y.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};_u?(y.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},y.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},y.IntPoint1dp=function(e){this.X=y.Clipper.Round(e.X),this.Y=y.Clipper.Round(e.Y),this.Z=0},y.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},y.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(y.IntPoint0=function(){this.X=0,this.Y=0},y.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},y.IntPoint1dp=function(e){this.X=y.Clipper.Round(e.X),this.Y=y.Clipper.Round(e.Y)},y.IntPoint2=function(e,t){this.X=e,this.Y=t});y.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)};y.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};y.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};y.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};y.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};y.PolyType={ptSubject:0,ptClip:1};y.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};y.JoinType={jtSquare:0,jtRound:1,jtMiter:2};y.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};Yj&&(y.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});y.EdgeSide={esLeft:0,esRight:1};y.Direction={dRightToLeft:0,dLeftToRight:1};y.TEdge=function(){this.Bot=new y.IntPoint,this.Curr=new y.IntPoint,this.Top=new y.IntPoint,this.Delta=new y.IntPoint,this.Dx=0,this.PolyTyp=y.PolyType.ptSubject,this.Side=y.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};y.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new y.IntPoint};y.MyIntersectNodeSort=function(){};y.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};y.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};y.Scanbeam=function(){this.Y=0,this.Next=null};y.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};y.OutPt=function(){this.Idx=0,this.Pt=new y.IntPoint,this.Next=null,this.Prev=null};y.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new y.IntPoint};y.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};y.ClipperBase.horizontal=-9007199254740992;y.ClipperBase.Skip=-2;y.ClipperBase.Unassigned=-1;y.ClipperBase.tolerance=1e-20;xfe?(y.ClipperBase.loRange=46340,y.ClipperBase.hiRange=46340):(y.ClipperBase.loRange=47453132,y.ClipperBase.hiRange=0xfffffffffffff);y.ClipperBase.near_zero=function(e){return e>-y.ClipperBase.tolerance&&e<y.ClipperBase.tolerance};y.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};y.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(y.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};y.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&&ot.op_Equality(ot.Int128Mul(e.X-t.X,r.Y-t.Y),ot.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)};y.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};y.ClipperBase.prototype.SlopesEqual=y.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,o,i,s,a,l;return t==3?(r=e[0],n=e[1],l=e[2],l?ot.op_Equality(ot.Int128Mul(r.Delta.Y,n.Delta.X),ot.Int128Mul(r.Delta.X,n.Delta.Y)):y.Cast_Int64(r.Delta.Y*n.Delta.X)==y.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(o=e[0],i=e[1],s=e[2],l=e[3],l?ot.op_Equality(ot.Int128Mul(o.Y-i.Y,i.X-s.X),ot.Int128Mul(o.X-i.X,i.Y-s.Y)):y.Cast_Int64((o.Y-i.Y)*(i.X-s.X))-y.Cast_Int64((o.X-i.X)*(i.Y-s.Y))===0):(o=e[0],i=e[1],s=e[2],a=e[3],l=e[4],l?ot.op_Equality(ot.Int128Mul(o.Y-i.Y,s.X-a.X),ot.Int128Mul(o.X-i.X,s.Y-a.Y)):y.Cast_Int64((o.Y-i.Y)*(s.X-a.X))-y.Cast_Int64((o.X-i.X)*(s.Y-a.Y))===0)};y.ClipperBase.SlopesEqual3=function(e,t,r){return r?ot.op_Equality(ot.Int128Mul(e.Delta.Y,t.Delta.X),ot.Int128Mul(e.Delta.X,t.Delta.Y)):y.Cast_Int64(e.Delta.Y*t.Delta.X)==y.Cast_Int64(e.Delta.X*t.Delta.Y)};y.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?ot.op_Equality(ot.Int128Mul(e.Y-t.Y,t.X-r.X),ot.Int128Mul(e.X-t.X,t.Y-r.Y)):y.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-y.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};y.ClipperBase.SlopesEqual5=function(e,t,r,n,o){return o?ot.op_Equality(ot.Int128Mul(e.Y-t.Y,r.X-n.X),ot.Int128Mul(e.X-t.X,r.Y-n.Y)):y.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-y.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};y.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;y.Clear(this.m_edges[e])}y.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};y.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};y.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>y.ClipperBase.hiRange||e.Y>y.ClipperBase.hiRange||-e.X>y.ClipperBase.hiRange||-e.Y>y.ClipperBase.hiRange)&&y.Error("Coordinate outside allowed range in RangeTest()."):(e.X>y.ClipperBase.loRange||e.Y>y.ClipperBase.loRange||-e.X>y.ClipperBase.loRange||-e.Y>y.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};y.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};y.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};y.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;y.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||y.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=y.ClipperBase.horizontal&&e.Prev.Dx!=y.ClipperBase.horizontal)break;for(;e.Prev.Dx==y.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==y.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};y.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,o,i;if(e.Dx==y.ClipperBase.horizontal&&(t?i=e.Prev.Bot.X:i=e.Next.Bot.X,e.Bot.X!=i&&this.ReverseHorizontal(e)),n.OutIdx!=y.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=y.ClipperBase.Skip;)n=n.Next;if(n.Dx==y.ClipperBase.horizontal&&n.Next.OutIdx!=y.ClipperBase.Skip){for(o=n;o.Prev.Dx==y.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==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==y.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!=y.ClipperBase.Skip;)n=n.Prev;if(n.Dx==y.ClipperBase.horizontal&&n.Prev.OutIdx!=y.ClipperBase.Skip){for(o=n;o.Next.Dx==y.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==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==y.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==y.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==y.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var s=new y.LocalMinima;s.Next=null,s.Y=e.Bot.Y,s.LeftBound=null,s.RightBound=e,s.RightBound.WindDelta=0,n=this.ProcessBound(s.RightBound,t),this.InsertLocalMinima(s)}}return n};y.ClipperBase.prototype.AddPath=function(e,t,r){Xj?!r&&t==y.PolyType.ptClip&&y.Error("AddPath: Open paths must be subject."):r||y.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&y.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&y.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 y.TEdge);var s=!0;o[1].Curr.X=e[1].X,o[1].Curr.Y=e[1].Y;var a={Value:this.m_UseFullRange};this.RangeTest(e[0],a),this.m_UseFullRange=a.Value,a.Value=this.m_UseFullRange,this.RangeTest(e[n],a),this.m_UseFullRange=a.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)a.Value=this.m_UseFullRange,this.RangeTest(e[i],a),this.m_UseFullRange=a.Value,this.InitEdge(o[i],o[i+1],o[i-1],e[i]);for(var l=o[0],p=l,u=l;;){if(y.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==l&&(l=p.Next),p=this.RemoveEdge(p),u=p;continue}if(p.Prev==p.Next)break;if(r&&y.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==l&&(l=p.Next),p=this.RemoveEdge(p),p=p.Prev,u=p;continue}if(p=p.Next,p==u)break}if(!r&&p==p.Next||r&&p.Prev==p.Next)return!1;r||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=y.ClipperBase.Skip);var m=l;p=l;do this.InitEdge2(p,t),p=p.Next,s&&p.Curr.Y!=l.Curr.Y&&(s=!1);while(p!=l);if(s){if(r)return!1;p.Prev.OutIdx=y.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var h=new y.LocalMinima;for(h.Next=null,h.Y=p.Bot.Y,h.LeftBound=null,h.RightBound=p,h.RightBound.Side=y.EdgeSide.esRight,h.RightBound.WindDelta=0;p.Next.OutIdx!=y.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(h),this.m_edges.push(o),!0}this.m_edges.push(o);for(var g,v=null;p=this.FindNextLocMin(p),p!=v;){v==null&&(v=p);var h=new y.LocalMinima;h.Next=null,h.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(h.LeftBound=p.Prev,h.RightBound=p,g=!1):(h.LeftBound=p,h.RightBound=p.Prev,g=!0),h.LeftBound.Side=y.EdgeSide.esLeft,h.RightBound.Side=y.EdgeSide.esRight,r?h.LeftBound.Next==h.RightBound?h.LeftBound.WindDelta=-1:h.LeftBound.WindDelta=1:h.LeftBound.WindDelta=0,h.RightBound.WindDelta=-h.LeftBound.WindDelta,p=this.ProcessBound(h.LeftBound,g);var I=this.ProcessBound(h.RightBound,!g);h.LeftBound.OutIdx==y.ClipperBase.Skip?h.LeftBound=null:h.RightBound.OutIdx==y.ClipperBase.Skip&&(h.RightBound=null),this.InsertLocalMinima(h),g||(p=I)}return!0};y.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};y.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return y.IntPoint.op_Equality(e,r)||y.IntPoint.op_Equality(e,t)||y.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};y.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};y.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=y.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};y.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}};y.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};y.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,_u&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};y.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=y.EdgeSide.esLeft,t.OutIdx=y.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=y.EdgeSide.esRight,t.OutIdx=y.ClipperBase.Unassigned),e=e.Next}};y.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=y.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=y.PolyFillType.pftEvenOdd,this.m_SubjFillType=y.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,y.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=y.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,_u&&(this.ZFillFunction=null)};y.Clipper.ioReverseSolution=1;y.Clipper.ioStrictlySimple=2;y.Clipper.ioPreserveCollinear=4;y.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),y.ClipperBase.prototype.Clear.call(this))};y.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};y.Clipper.prototype.Reset=function(){y.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};y.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new y.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new y.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 y.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};y.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof y.PolyTree;if(t==4&&!r){var n=e[0],o=e[1],i=e[2],s=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&y.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,y.Clear(o),this.m_SubjFillType=i,this.m_ClipFillType=s,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var a=this.ExecuteInternal();a&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return a}else if(t==4&&r){var n=e[0],l=e[1],i=e[2],s=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=i,this.m_ClipFillType=s,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var a=this.ExecuteInternal();a&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return a}else if(t==2&&!r){var n=e[0],o=e[1];return this.Execute(n,o,y.PolyFillType.pftEvenOdd,y.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],l=e[1];return this.Execute(n,l,y.PolyFillType.pftEvenOdd,y.PolyFillType.pftEvenOdd)}};y.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}};y.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),y.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{y.Clear(this.m_Joins),y.Clear(this.m_GhostJoins)}};y.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};y.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);y.Clear(this.m_PolyOuts)};y.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};y.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}};y.Clipper.prototype.AddJoin=function(e,t,r){var n=new y.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};y.Clipper.prototype.AddGhostJoin=function(e,t){var r=new y.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};_u&&(y.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))});y.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&&(y.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&y.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var o=0,i=this.m_GhostJoins.length;o<i;o++){var s=this.m_GhostJoins[o];this.HorzSegmentsOverlap(s.OutPt1.Pt,s.OffPt,r.Bot,r.Top)&&this.AddJoin(s.OutPt1,n,s.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&y.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var a=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,a,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&y.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var a=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,a,r.Top)}var l=t.NextInAEL;if(l!==null)for(;l!=r;)this.IntersectEdges(r,l,t.Curr,!1),l=l.NextInAEL}}}};y.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}};y.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<y.Clipper.TopX(e,t.Top.Y):e.Top.X>y.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};y.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==y.PolyType.ptSubject?this.m_SubjFillType==y.PolyFillType.pftEvenOdd:this.m_ClipFillType==y.PolyFillType.pftEvenOdd};y.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==y.PolyType.ptSubject?this.m_ClipFillType==y.PolyFillType.pftEvenOdd:this.m_SubjFillType==y.PolyFillType.pftEvenOdd};y.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==y.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case y.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case y.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case y.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case y.ClipType.ctIntersection:switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2!==0;case y.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case y.ClipType.ctUnion:switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2===0;case y.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case y.ClipType.ctDifference:if(e.PolyTyp==y.PolyType.ptSubject)switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2===0;case y.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2!==0;case y.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case y.ClipType.ctXor:if(e.WindDelta===0)switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2===0;case y.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};y.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!=y.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};y.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)};y.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};y.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)}};y.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)}};y.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)};y.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,o,i;if(y.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=y.EdgeSide.esLeft,t.Side=y.EdgeSide.esRight,o=e,o.PrevInAEL==t?i=t.PrevInAEL:i=o.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=y.EdgeSide.esRight,t.Side=y.EdgeSide.esLeft,o=t,o.PrevInAEL==e?i=e.PrevInAEL:i=o.PrevInAEL),i!==null&&i.OutIdx>=0&&y.Clipper.TopX(i,r.Y)==y.Clipper.TopX(o,r.Y)&&y.ClipperBase.SlopesEqual(o,i,this.m_UseFullRange)&&o.WindDelta!==0&&i.WindDelta!==0){var s=this.AddOutPt(i,r);this.AddJoin(n,s,o.Top)}return n};y.Clipper.prototype.CreateOutRec=function(){var e=new y.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};y.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==y.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var o=new y.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),_u&&(y.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):y.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&&y.IntPoint.op_Equality(t,i.Pt))return i;if(!r&&y.IntPoint.op_Equality(t,i.Prev.Pt))return i.Prev;var o=new y.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),_u&&(y.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):y.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}};y.Clipper.prototype.SwapPoints=function(e,t){var r=new y.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};y.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};y.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new y.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};y.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)};y.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?y.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};y.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;y.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;y.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;y.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;y.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var s=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=i&&n>=s||o>=i&&o>=s};y.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;y.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};y.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};y.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};y.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};y.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,s=i.Prev,a=n.Pts,l=a.Prev,p;e.Side==y.EdgeSide.esLeft?(t.Side==y.EdgeSide.esLeft?(this.ReversePolyPtLinks(a),a.Next=i,i.Prev=a,s.Next=l,l.Prev=s,r.Pts=l):(l.Next=i,i.Prev=l,a.Prev=s,s.Next=a,r.Pts=a),p=y.EdgeSide.esLeft):(t.Side==y.EdgeSide.esRight?(this.ReversePolyPtLinks(a),s.Next=l,l.Prev=s,a.Next=i,i.Prev=a):(s.Next=a,a.Prev=s,i.Prev=l,l.Next=i),p=y.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 u=e.OutIdx,m=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var h=this.m_ActiveEdges;h!==null;){if(h.OutIdx==m){h.OutIdx=u,h.Side=p;break}h=h.NextInAEL}n.Idx=r.Idx};y.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)}};y.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};y.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};y.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,s=e.OutIdx>=0,a=t.OutIdx>=0;if(Xj&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(o||i)&&s&&a&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==y.ClipType.ctUnion?e.WindDelta===0?a&&(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):s&&(this.AddOutPt(t,r),a&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=y.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=y.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),a&&(t.OutIdx=-1))),o&&(e.OutIdx<0?this.DeleteFromAEL(e):y.Error("Error intersecting polylines")),i&&(t.OutIdx<0?this.DeleteFromAEL(t):y.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var l=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=l}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,u,m,h;e.PolyTyp==y.PolyType.ptSubject?(p=this.m_SubjFillType,m=this.m_ClipFillType):(p=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==y.PolyType.ptSubject?(u=this.m_SubjFillType,h=this.m_ClipFillType):(u=this.m_ClipFillType,h=this.m_SubjFillType);var g,v;switch(p){case y.PolyFillType.pftPositive:g=e.WindCnt;break;case y.PolyFillType.pftNegative:g=-e.WindCnt;break;default:g=Math.abs(e.WindCnt);break}switch(u){case y.PolyFillType.pftPositive:v=t.WindCnt;break;case y.PolyFillType.pftNegative:v=-t.WindCnt;break;default:v=Math.abs(t.WindCnt);break}if(s&&a)o||i||g!==0&&g!=1||v!==0&&v!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=y.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if(s)(v===0||v==1)&&(this.AddOutPt(e,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if(a)(g===0||g==1)&&(this.AddOutPt(t,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if((g===0||g==1)&&(v===0||v==1)&&!o&&!i){var I,b;switch(m){case y.PolyFillType.pftPositive:I=e.WindCnt2;break;case y.PolyFillType.pftNegative:I=-e.WindCnt2;break;default:I=Math.abs(e.WindCnt2);break}switch(h){case y.PolyFillType.pftPositive:b=t.WindCnt2;break;case y.PolyFillType.pftNegative:b=-t.WindCnt2;break;default:b=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(g==1&&v==1)switch(this.m_ClipType){case y.ClipType.ctIntersection:I>0&&b>0&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctUnion:I<=0&&b<=0&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctDifference:(e.PolyTyp==y.PolyType.ptClip&&I>0&&b>0||e.PolyTyp==y.PolyType.ptSubject&&I<=0&&b<=0)&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else y.Clipper.SwapSides(e,t)}o!=i&&(o&&e.OutIdx>=0||i&&t.OutIdx>=0)&&(y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t)),o&&this.DeleteFromAEL(e),i&&this.DeleteFromAEL(t)};y.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)};y.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)};y.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&y.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,y.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};y.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};y.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=y.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=y.Direction.dRightToLeft)};y.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=y.EdgeSide.esLeft&&(r=r.Prev),t&&(y.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};y.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,s=e,a=null;s.NextInLML!==null&&y.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(a=this.GetMaximaPair(s));;){for(var l=e==s,p=this.GetNextInAEL(e,n);p!==null&&!(p.Curr.X==e.Top.X&&e.NextInLML!==null&&p.Dx<e.NextInLML.Dx);){var u=this.GetNextInAEL(p,n);if(n==y.Direction.dLeftToRight&&p.Curr.X<=i||n==y.Direction.dRightToLeft&&p.Curr.X>=o){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),p==a&&l){n==y.Direction.dLeftToRight?this.IntersectEdges(e,p,p.Top,!1):this.IntersectEdges(p,e,p.Top,!1),a.OutIdx>=0&&y.Error("ProcessHorizontal error");return}else if(n==y.Direction.dLeftToRight){var m=new y.IntPoint(p.Curr.X,e.Curr.Y);this.IntersectEdges(e,p,m,!0)}else{var m=new y.IntPoint(p.Curr.X,e.Curr.Y);this.IntersectEdges(p,e,m,!0)}this.SwapPositionsInAEL(e,p)}else if(n==y.Direction.dLeftToRight&&p.Curr.X>=i||n==y.Direction.dRightToLeft&&p.Curr.X<=o)break;p=u}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&y.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 h=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var g=e.PrevInAEL,u=e.NextInAEL;if(g!==null&&g.Curr.X==e.Bot.X&&g.Curr.Y==e.Bot.Y&&g.WindDelta!==0&&g.OutIdx>=0&&g.Curr.Y>g.Top.Y&&y.ClipperBase.SlopesEqual(e,g,this.m_UseFullRange)){var v=this.AddOutPt(g,e.Bot);this.AddJoin(h,v,e.Top)}else if(u!==null&&u.Curr.X==e.Bot.X&&u.Curr.Y==e.Bot.Y&&u.WindDelta!==0&&u.OutIdx>=0&&u.Curr.Y>u.Top.Y&&y.ClipperBase.SlopesEqual(e,u,this.m_UseFullRange)){var v=this.AddOutPt(u,e.Bot);this.AddJoin(h,v,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else a!==null?a.OutIdx>=0?(n==y.Direction.dLeftToRight?this.IntersectEdges(e,a,e.Top,!1):this.IntersectEdges(a,e,e.Top,!1),a.OutIdx>=0&&y.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(a)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};y.Clipper.prototype.GetNextInAEL=function(e,t){return t==y.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};y.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};y.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};y.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};y.Clipper.prototype.GetMaximaPair=function(e){var t=null;return y.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:y.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!y.ClipperBase.IsHorizontal(t))?null:t};y.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,y.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};y.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=y.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 y.IntPoint;if(r.Curr.X>o.Curr.X){!this.IntersectPoint(r,o,i)&&r.Curr.X>o.Curr.X+1&&y.Error("Intersection error"),i.Y>e&&(i.Y=e,Math.abs(r.Dx)>Math.abs(o.Dx)?i.X=y.Clipper.TopX(o,e):i.X=y.Clipper.TopX(r,e));var s=new y.IntersectNode;s.Edge1=r,s.Edge2=o,s.Pt.X=i.X,s.Pt.Y=i.Y,this.m_IntersectList.push(s),this.SwapPositionsInSEL(r,o),n=!0}else r=o}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};y.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};y.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};y.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};y.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 ahe=function(e){return e<0?Math.ceil(e-.5):Math.round(e)},lhe=function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},che=function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},phe=function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)};pt.msie?y.Clipper.Round=ahe:pt.chromium?y.Clipper.Round=che:pt.safari?y.Clipper.Round=phe:y.Clipper.Round=lhe;y.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+y.Clipper.Round(e.Dx*(t-e.Bot.Y))};y.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,o;if(y.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,y.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,r.Y=y.Clipper.Round(r.X/t.Dx+o));else if(t.Delta.X===0)r.X=t.Bot.X,y.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=y.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=y.Clipper.Round(i),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=y.Clipper.Round(e.Dx*i+n):r.X=y.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=y.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=y.Clipper.TopX(e,r.Y):r.X=y.Clipper.TopX(t,r.Y)}return!0};y.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||!y.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)&&y.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=y.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),s=this.AddOutPt(t,t.Curr);this.AddJoin(i,s,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,a=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&&y.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var s=this.AddOutPt(o,t.Bot);this.AddJoin(i,s,t.Top)}else if(a!==null&&a.Curr.X==t.Bot.X&&a.Curr.Y==t.Bot.Y&&i!==null&&a.OutIdx>=0&&a.Curr.Y>a.Top.Y&&y.ClipperBase.SlopesEqual(t,a,this.m_UseFullRange)&&t.WindDelta!==0&&a.WindDelta!==0){var s=this.AddOutPt(a,t.Bot);this.AddJoin(i,s,t.Top)}}t=t.NextInAEL}};y.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)):y.Error("DoMaxima error")};y.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};y.Clipper.Orientation=function(e){return y.Clipper.Area(e)>=0};y.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};y.Clipper.prototype.BuildResult=function(e){y.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 s=new Array(i),a=0;a<i;a++)s[a]=o.Pt,o=o.Prev;e.push(s)}}}};y.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 y.PolyNode;e.m_AllPolys.push(i),n.PolyNode=i,i.m_polygon.length=o;for(var s=n.Pts.Prev,a=0;a<o;a++)i.m_polygon[a]=s.Pt,s=s.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))}};y.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(y.IntPoint.op_Equality(r.Pt,r.Next.Pt)||y.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||y.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};y.Clipper.prototype.DupOutPt=function(e,t){var r=new y.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};y.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};y.Clipper.prototype.JoinHorz=function(e,t,r,n,o,i){var s=e.Pt.X>t.Pt.X?y.Direction.dRightToLeft:y.Direction.dLeftToRight,a=r.Pt.X>n.Pt.X?y.Direction.dRightToLeft:y.Direction.dLeftToRight;if(s==a)return!1;if(s==y.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),y.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),y.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,i))}if(a==y.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),y.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),y.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,i))}return s==y.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};y.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,o=new y.OutPt,i=e.OutPt2,s=new y.OutPt,a=e.OutPt1.Pt.Y==e.OffPt.Y;if(a&&y.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&y.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(o=e.OutPt1.Next;o!=n&&y.IntPoint.op_Equality(o.Pt,e.OffPt);)o=o.Next;var l=o.Pt.Y>e.OffPt.Y;for(s=e.OutPt2.Next;s!=i&&y.IntPoint.op_Equality(s.Pt,e.OffPt);)s=s.Next;var p=s.Pt.Y>e.OffPt.Y;return l==p?!1:l?(o=this.DupOutPt(n,!1),s=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=s,s.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),s=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=s,s.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}else if(a){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(s=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=s&&i.Prev!=o;)i=i.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=i&&s.Next!=n;)s=s.Next;if(s.Next==i||s.Next==n)return!1;var u={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,o.Pt.X,i.Pt.X,s.Pt.X,u))return!1;var m=u.Left,h=u.Right,g=new y.IntPoint,v;return n.Pt.X>=m&&n.Pt.X<=h?(g.X=n.Pt.X,g.Y=n.Pt.Y,v=n.Pt.X>o.Pt.X):i.Pt.X>=m&&i.Pt.X<=h?(g.X=i.Pt.X,g.Y=i.Pt.Y,v=i.Pt.X>s.Pt.X):o.Pt.X>=m&&o.Pt.X<=h?(g.X=o.Pt.X,g.Y=o.Pt.Y,v=o.Pt.X>n.Pt.X):(g.X=s.Pt.X,g.Y=s.Pt.Y,v=s.Pt.X>i.Pt.X),e.OutPt1=n,e.OutPt2=i,this.JoinHorz(n,o,i,s,g,v)}else{for(o=n.Next;y.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Next;var I=o.Pt.Y>n.Pt.Y||!y.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange);if(I){for(o=n.Prev;y.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Prev;if(o.Pt.Y>n.Pt.Y||!y.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange))return!1}for(s=i.Next;y.IntPoint.op_Equality(s.Pt,i.Pt)&&s!=i;)s=s.Next;var b=s.Pt.Y>i.Pt.Y||!y.ClipperBase.SlopesEqual(i.Pt,s.Pt,e.OffPt,this.m_UseFullRange);if(b){for(s=i.Prev;y.IntPoint.op_Equality(s.Pt,i.Pt)&&s!=i;)s=s.Prev;if(s.Pt.Y>i.Pt.Y||!y.ClipperBase.SlopesEqual(i.Pt,s.Pt,e.OffPt,this.m_UseFullRange))return!1}return o==n||s==i||o==s||t==r&&I==b?!1:I?(o=this.DupOutPt(n,!1),s=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=s,s.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),s=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=s,s.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}};y.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new y.IntRect(0,0,0,0);var n=new y.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};y.Clipper.prototype.GetBounds2=function(e){var t=e,r=new y.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};y.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 s=i==n?t[0]:t[i];if(s.Y==e.Y&&(s.X==e.X||o.Y==e.Y&&s.X>e.X==o.X<e.X))return-1;if(o.Y<e.Y!=s.Y<e.Y){if(o.X>=e.X)if(s.X>e.X)r=1-r;else{var a=(o.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(o.Y-e.Y);if(a==0)return-1;a>0==s.Y>o.Y&&(r=1-r)}else if(s.X>e.X){var a=(o.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(o.Y-e.Y);if(a==0)return-1;a>0==s.Y>o.Y&&(r=1-r)}}o=s}return r};y.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var o=t.Pt.X,i=t.Pt.Y,s=t.Next.Pt.X,a=t.Next.Pt.Y;if(a==e.Y&&(s==e.X||i==e.Y&&s>e.X==o<e.X))return-1;if(i<e.Y!=a<e.Y){if(o>=e.X)if(s>e.X)r=1-r;else{var l=(o-e.X)*(a-e.Y)-(s-e.X)*(i-e.Y);if(l==0)return-1;l>0==a>i&&(r=1-r)}else if(s>e.X){var l=(o-e.X)*(a-e.Y)-(s-e.X)*(i-e.Y);if(l==0)return-1;l>0==a>i&&(r=1-r)}}if(t=t.Next,n==t)break}return r};y.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};y.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)}};y.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)};y.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};y.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 s=0,a=this.m_PolyOuts.length;s<a-1;s++){var l=this.m_PolyOuts[s];l.Pts==null||y.Clipper.ParseFirstLeft(l.FirstLeft)!=n||l.IsHole==n.IsHole||this.Poly2ContainsPoly1(l.Pts,r.OutPt2)&&(l.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)}}};y.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};y.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(y.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 s=this.CreateOutRec();s.Pts=n,this.UpdateOutPtIdxs(s),this.Poly2ContainsPoly1(s.Pts,t.Pts)?(s.IsHole=!t.IsHole,s.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,s.Pts)?(s.IsHole=t.IsHole,t.IsHole=!s.IsHole,s.FirstLeft=t.FirstLeft,t.FirstLeft=s):(s.IsHole=t.IsHole,s.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};y.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};y.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};Yj&&(y.Clipper.OffsetPaths=function(e,t,r,n,o){var i=new y.Paths,s=new y.ClipperOffset(o,o);return s.AddPaths(e,r,n),s.Execute(i,t),i});y.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new y.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,y.PolyType.ptSubject,!0),n.Execute(y.ClipType.ctUnion,r,t,t),r};y.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=y.PolyFillType.pftEvenOdd);var r=new Array,n=new y.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,y.PolyType.ptSubject,!0),n.Execute(y.ClipType.ctUnion,r,t,t),r};y.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};y.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)};y.Clipper.SlopesNearCollinear=function(e,t,r,n){return y.Clipper.DistanceFromLineSqrd(t,e,r)<n};y.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,o=e.Y-t.Y;return n*n+o*o<=r};y.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};y.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 y.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,s=n[0];s.Idx==0&&s.Next!=s.Prev;)y.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,i)?(s=y.Clipper.ExcludeOp(s),r--):y.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,i)?(y.Clipper.ExcludeOp(s.Next),s=y.Clipper.ExcludeOp(s),r-=2):y.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,i)?(s=y.Clipper.ExcludeOp(s),r--):(s.Idx=1,s=s.Next);r<3&&(r=0);for(var a=new Array(r),o=0;o<r;++o)a[o]=new y.IntPoint(s.Pt),s=s.Next;return n=null,a};y.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,o=e.length;n<o;n++)r[n]=y.Clipper.CleanPolygon(e[n],t);return r};y.Clipper.Minkowski=function(e,t,r,n){var o=n?1:0,i=e.length,s=t.length,a=new Array;if(r)for(var l=0;l<s;l++){for(var p=new Array(i),u=0,m=e.length,h=e[u];u<m;u++,h=e[u])p[u]=new y.IntPoint(t[l].X+h.X,t[l].Y+h.Y);a.push(p)}else for(var l=0;l<s;l++){for(var p=new Array(i),u=0,m=e.length,h=e[u];u<m;u++,h=e[u])p[u]=new y.IntPoint(t[l].X-h.X,t[l].Y-h.Y);a.push(p)}for(var g=new Array,l=0;l<s-1+o;l++)for(var u=0;u<i;u++){var v=new Array;v.push(a[l%s][u%i]),v.push(a[(l+1)%s][u%i]),v.push(a[(l+1)%s][(u+1)%i]),v.push(a[l%s][(u+1)%i]),y.Clipper.Orientation(v)||v.reverse(),g.push(v)}var I=new y.Clipper(0);return I.AddPaths(g,y.PolyType.ptSubject,!0),I.Execute(y.ClipType.ctUnion,a,y.PolyFillType.pftNonZero,y.PolyFillType.pftNonZero),a};y.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],o=e[2];return y.Clipper.Minkowski(r,n,!0,o)}else if(t==4){for(var r=e[0],i=e[1],s=e[2],o=e[3],a=new y.Clipper,l,p=0,u=i.length;p<u;++p){var l=y.Clipper.Minkowski(r,i[p],!0,o);a.AddPaths(l,y.PolyType.ptSubject,!0)}o&&a.AddPaths(i,y.PolyType.ptClip,!0);var m=new y.Paths;return a.Execute(y.ClipType.ctUnion,m,s,s),m}};y.Clipper.MinkowskiDiff=function(e,t,r){return y.Clipper.Minkowski(e,t,!1,r)};y.Clipper.PolyTreeToPaths=function(e){var t=new Array;return y.Clipper.AddPolyNodeToPaths(e,y.Clipper.NodeType.ntAny,t),t};y.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case y.Clipper.NodeType.ntOpen:return;case y.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(),s=i.length,a=i[o];o<s;o++,a=i[o])y.Clipper.AddPolyNodeToPaths(a,t,r)};y.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new y.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};y.Clipper.ClosedPathsFromPolyTree=function(e){var t=new y.Paths;return y.Clipper.AddPolyNodeToPaths(e,y.Clipper.NodeType.ntClosed,t),t};e2(y.Clipper,y.ClipperBase);y.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};y.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=y.ClipperOffset.def_arc_tolerance),this.m_destPolys=new y.Paths,this.m_srcPoly=new y.Path,this.m_destPoly=new y.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 y.IntPoint,this.m_polyNodes=new y.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};y.ClipperOffset.two_pi=6.28318530717959;y.ClipperOffset.def_arc_tolerance=.25;y.ClipperOffset.prototype.Clear=function(){y.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};y.ClipperOffset.Round=y.Clipper.Round;y.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var o=new y.PolyNode;if(o.m_jointype=t,o.m_endtype=r,r==y.EndType.etClosedLine||r==y.EndType.etClosedPolygon)for(;n>0&&y.IntPoint.op_Equality(e[0],e[n]);)n--;o.m_polygon.push(e[0]);for(var i=0,s=0,a=1;a<=n;a++)y.IntPoint.op_Inequality(o.m_polygon[i],e[a])&&(i++,o.m_polygon.push(e[a]),(e[a].Y>o.m_polygon[s].Y||e[a].Y==o.m_polygon[s].Y&&e[a].X<o.m_polygon[s].X)&&(s=i));if(!(r==y.EndType.etClosedPolygon&&i<2||r!=y.EndType.etClosedPolygon&&i<0)&&(this.m_polyNodes.AddChild(o),r==y.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new y.IntPoint(0,s);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(o.m_polygon[s].Y>l.Y||o.m_polygon[s].Y==l.Y&&o.m_polygon[s].X<l.X)&&(this.m_lowest=new y.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};y.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,o=e.length;n<o;n++)this.AddPath(e[n],t,r)};y.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!y.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==y.EndType.etClosedPolygon||t.m_endtype==y.EndType.etClosedLine&&y.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==y.EndType.etClosedLine&&!y.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};y.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new y.DoublePoint(0,0);var o=1/Math.sqrt(r*r+n*n);return r*=o,n*=o,new y.DoublePoint(n,-r)};y.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,y.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==y.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=y.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*y.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*y.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(y.ClipperOffset.two_pi/o),this.m_cos=Math.cos(y.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/y.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!=y.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,i==1){if(r.m_jointype==y.JoinType.jtRound)for(var s=1,a=0,l=1;l<=o;l++){this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X+s*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y+a*e)));var p=s;s=s*this.m_cos-this.m_sin*a,a=p*this.m_sin+a*this.m_cos}else for(var s=-1,a=-1,l=0;l<4;++l)this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X+s*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y+a*e))),s<0?s=1:a<0?a=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<i-1;l++)this.m_normals.push(y.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(r.m_endtype==y.EndType.etClosedLine||r.m_endtype==y.EndType.etClosedPolygon?this.m_normals.push(y.ClipperOffset.GetUnitNormal(this.m_srcPoly[i-1],this.m_srcPoly[0])):this.m_normals.push(new y.DoublePoint(this.m_normals[i-2])),r.m_endtype==y.EndType.etClosedPolygon){for(var u=i-1,l=0;l<i;l++)u=this.OffsetPoint(l,u,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==y.EndType.etClosedLine){for(var u=i-1,l=0;l<i;l++)u=this.OffsetPoint(l,u,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=this.m_normals[i-1],l=i-1;l>0;l--)this.m_normals[l]=new y.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new y.DoublePoint(-m.X,-m.Y),u=0;for(var l=i-1;l>=0;l--)u=this.OffsetPoint(l,u,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var u=0,l=1;l<i-1;++l)u=this.OffsetPoint(l,u,r.m_jointype);var h;if(r.m_endtype==y.EndType.etOpenButt){var l=i-1;h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*e),y.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*e)),this.m_destPoly.push(h),h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*e),y.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*e)),this.m_destPoly.push(h)}else{var l=i-1;u=i-2,this.m_sinA=0,this.m_normals[l]=new y.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),r.m_endtype==y.EndType.etOpenSquare?this.DoSquare(l,u):this.DoRound(l,u)}for(var l=i-1;l>0;l--)this.m_normals[l]=new y.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new y.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),u=i-1;for(var l=u-1;l>0;--l)u=this.OffsetPoint(l,u,r.m_jointype);r.m_endtype==y.EndType.etOpenButt?(h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(h),h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(h)):(u=1,this.m_sinA=0,r.m_endtype==y.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};y.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof y.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var o=new y.Clipper(0);if(o.AddPaths(this.m_destPolys,y.PolyType.ptSubject,!0),n>0)o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftPositive,y.PolyFillType.pftPositive);else{var i=y.Clipper.GetBounds(this.m_destPolys),s=new y.Path;if(s.push(new y.IntPoint(i.left-10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.top-10)),s.push(new y.IntPoint(i.left-10,i.top-10)),o.AddPath(s,y.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftNegative,y.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var a=r.Childs()[0];r.Childs()[0]=a.Childs()[0];for(var l=1;l<a.ChildCount();l++)r.AddChild(a.Childs()[l])}else r.Clear()}}else{var r=e[0],n=e[1];y.Clear(r),this.FixOrientations(),this.DoOffset(n);var o=new y.Clipper(0);if(o.AddPaths(this.m_destPolys,y.PolyType.ptSubject,!0),n>0)o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftPositive,y.PolyFillType.pftPositive);else{var i=y.Clipper.GetBounds(this.m_destPolys),s=new y.Path;s.push(new y.IntPoint(i.left-10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.top-10)),s.push(new y.IntPoint(i.left-10,i.top-10)),o.AddPath(s,y.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftNegative,y.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};y.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 y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new y.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case y.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 y.JoinType.jtSquare:this.DoSquare(e,t);break;case y.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};y.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 y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),y.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 y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};y.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),y.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};y.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=y.Cast_Int32(y.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),o=this.m_normals[t].X,i=this.m_normals[t].Y,s,a=0;a<n;++a)this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+o*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+i*this.m_delta))),s=o,o=o*this.m_cos-this.m_sin*i,i=s*this.m_sin+i*this.m_cos;this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};y.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};y.JS={};y.JS.AreaOfPolygon=function(e,t){return t||(t=1),y.Clipper.Area(e)/(t*t)};y.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=y.Clipper.Area(e[n]);return r/(t*t)};y.JS.BoundsOfPath=function(e,t){return y.JS.BoundsOfPaths([e],t)};y.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=y.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};y.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=y.JS.Clone(n);if(typeof t!="number"||t===null)return y.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,s,a,l,p,u,m,h=[],g=0;g<o;g++)if(s=n[g],i=s.length,i!==0){if(i<3){a=s,h.push(a);continue}for(a=s,l=t*t,p=s[0],u=1,m=1;m<i;m++)(s[m].X-p.X)*(s[m].X-p.X)+(s[m].Y-p.Y)*(s[m].Y-p.Y)<=l||(a[u]=s[m],p=s[m],u++);p=s[u-1],(s[0].X-p.X)*(s[0].X-p.X)+(s[0].Y-p.Y)*(s[0].Y-p.Y)<=l&&u--,u<i&&a.splice(u,i-u),a.length&&h.push(a)}return!r&&h.length?h=h[0]:!r&&h.length===0?h=[]:r&&h.length===0&&(h=[[]]),h};y.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,s,a=new Array(r);for(o=0;o<r;o++){for(n=e[o].length,s=new Array(n),i=0;i<n;i++)s[i]={X:e[o][i].X,Y:e[o][i].Y};a[o]=s}return t||(a=a[0]),a};y.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return y.Error("Tolerance is not a number in Lighten()."),y.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return y.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,o,i,s,a,l,p,u,m,h,g,v,I,b,C,P,w=e.length,M=t*t,E=[];for(r=0;r<w;r++)if(o=e[r],a=o.length,a!=0){for(i=0;i<1e6;i++){for(s=[],a=o.length,o[a-1].X!=o[0].X||o[a-1].Y!=o[0].Y?(g=1,o.push({X:o[0].X,Y:o[0].Y}),a=o.length):g=0,h=[],n=0;n<a-2;n++)l=o[n],u=o[n+1],p=o[n+2],C=l.X,P=l.Y,v=p.X-C,I=p.Y-P,(v!==0||I!==0)&&(b=((u.X-C)*v+(u.Y-P)*I)/(v*v+I*I),b>1?(C=p.X,P=p.Y):b>0&&(C+=v*b,P+=I*b)),v=u.X-C,I=u.Y-P,m=v*v+I*I,m<=M&&(h[n+1]=1,n++);for(s.push({X:o[0].X,Y:o[0].Y}),n=1;n<a-1;n++)h[n]||s.push({X:o[n].X,Y:o[n].Y});if(s.push({X:o[a-1].X,Y:o[a-1].Y}),g&&o.pop(),h.length)o=s;else break}a=s.length,s[a-1].X==s[0].X&&s[a-1].Y==s[0].Y&&s.pop(),s.length>2&&E.push(s)}return!e[0]instanceof Array&&(E=E[0]),typeof E>"u"&&(E=[[]]),E};y.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,o=0,i,s,a=0,l=0,p=0,u=0,m=e.length;if(m<2)return 0;for(t&&(e[m]=e[0],m++);--m;)i=e[m],a=i.X,l=i.Y,s=e[m-1],p=s.X,u=s.Y,o+=n((a-p)*(a-p)+(l-u)*(l-u));return t&&e.pop(),o/r};y.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,o=0;o<e.length;o++)n+=y.JS.PerimeterOfPath(e[o],t,r);return n};y.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};y.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};y.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)};y.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)};y.ExPolygons=function(){return[]};y.ExPolygon=function(){this.outer=null,this.holes=null};y.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new y.ExPolygon;r.outer=e.Contour();var n=e.Childs(),o=n.length;r.holes=new Array(o);var i,s,a,l,p,u;for(a=0;a<o;a++)for(i=n[a],r.holes[a]=i.Contour(),l=0,p=i.Childs(),u=p.length;l<u;l++)s=p[l],y.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(r)};y.JS.ExPolygonsToPaths=function(e){var t,r,n,o,i=new y.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};y.JS.PolyTreeToExPolygons=function(e){var t=new y.ExPolygons,r,n,o,i;for(n=0,o=e.Childs(),i=o.length;n<i;n++)r=o[n],y.JS.AddOuterPolyNodeToExPolygons(r,t);return t};Pg.exports=y});var CU=pe((_ct,J2)=>{d();(function(){"use strict";function e(s,a){var l=s.x-a.x,p=s.y-a.y;return l*l+p*p}function t(s,a,l){var p=a.x,u=a.y,m=l.x-p,h=l.y-u;if(m!==0||h!==0){var g=((s.x-p)*m+(s.y-u)*h)/(m*m+h*h);g>1?(p=l.x,u=l.y):g>0&&(p+=m*g,u+=h*g)}return m=s.x-p,h=s.y-u,m*m+h*h}function r(s,a){for(var l=s[0],p=[l],u,m=1,h=s.length;m<h;m++)u=s[m],e(u,l)>a&&(p.push(u),l=u);return l!==u&&p.push(u),p}function n(s,a,l,p,u){for(var m=p,h,g=a+1;g<l;g++){var v=t(s[g],s[a],s[l]);v>m&&(h=g,m=v)}m>p&&(h-a>1&&n(s,a,h,p,u),u.push(s[h]),l-h>1&&n(s,h,l,p,u))}function o(s,a){var l=s.length-1,p=[s[0]];return n(s,0,l,a,p),p.push(s[l]),p}function i(s,a,l){if(s.length<=2)return s;var p=a!==void 0?a*a:1;return s=l?s:r(s,p),s=o(s,p),s}typeof define=="function"&&define.amd?define(function(){return i}):typeof J2<"u"?(J2.exports=i,J2.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});d();d();d();d();d();d();var Km=e=>e!=null;var XU=function(){let t=globalThis.fetch;return{fetch(...r){if(!Km(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}}}(),LM=XU.fetch;var $M=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],RM=$M[0],jM="https://api-gateway.mappedin.com/track-analytics/a/",GM="deny-watchposition",UM="load-mapview",VM="load-mapdata",zM="change-language",HM="query-directions";var xa,Ci,hd,Tb,yd=class{constructor(){O(this,hd);O(this,xa,Object.freeze({}));O(this,Ci);f(this,"oneTimeEventsSent",new Set);f(this,"sendGetDirectionsEvent",cM((t,r)=>this.sendAnalyticEvent(HM,{start:t,end:r,type:"location_to_location"}),2500));k(this,Ci,ee(this,hd,Tb).call(this,c(this,xa)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){k(this,xa,{}),k(this,Ci,ee(this,hd,Tb).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return k(this,xa,Object.freeze(Object.assign({},c(this,xa),t))),k(this,Ci,ee(this,hd,Tb).call(this,t)),c(this,Ci)}updateState(t){let r=T({},t);r.mapId&&(r.analyticsBaseUrl=CI(L(T({},c(this,Ci)),{mapId:r.mapId}))),r.context&&(r.context=BM(r.context)),r.baseUri&&(r.analyticsBaseUrl=CI({baseUri:r.baseUri,mapId:c(this,Ci).mapId})),Object.assign(c(this,Ci),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 c(this,Ci)}getContext(){return this.getState().context||c(this,xa).context||RM}getSessionId(){return this.getState().sessionId||c(this,xa).sessionId||NM()}sendAnalyticEvent(t,r={}){let n=this.getState(),o=KU(n.analyticsBaseUrl,t),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":n.deviceId};if(n.logEvents&&V.log("Analytics.track",o,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return V.warn("Auth needs to be ready to send analytics.");let s=L(T({},r),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(s,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)),LM(o,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(s)})}capture(t,r){if(QU.includes(t))return V.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=JU.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(VM,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(zM,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(GM)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(UM,{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)}};xa=new WeakMap,Ci=new WeakMap,hd=new WeakSet,Tb=function(t){var n,o,i,s;let r=(n=t.baseUri)!=null?n:jM;return{baseUri:r,analyticsBaseUrl:CI(L(T({},t),{baseUri:r})),version:((o=x==null?void 0:x.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||YU(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||NM(),platformString:t.platformString||"",context:BM(t.context)||RM,geolocationMode:!1,sendEvents:(i=t.sendEvents)!=null?i:!0,logEvents:(s=t.logEvents)!=null?s:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}};function CI({mapId:e,baseUri:t=jM}){return"".concat(t).concat(e,"/")}function YU(){return Kc.getInstance().loadLocalData("deviceId")}function NM(){return Kc.getInstance().loadSessionData("id")}function KU(e,t){return e+t}function BM(e){return $M.find(t=>t===e)}var JU=["$select-location","$select-category","$query-suggest","$query-search"],QU=[UM,VM,HM,GM,zM],Dge=new yd,va,Jm=class{constructor(t){O(this,va);f(this,"capture");f(this,"updateState");k(this,va,t),this.capture=c(this,va).capture.bind(c(this,va)),this.updateState=c(this,va).updateState.bind(c(this,va))}getState(){return Object.assign({},c(this,va).getState())}};va=new WeakMap;d();d();var eh,th,rh,Qm=class{constructor(t,r,{enabled:n=!1}={}){O(this,eh);f(this,"searchInstance");O(this,th);O(this,rh);f(this,"enabled",!1);k(this,eh,t),k(this,th,r),k(this,rh,()=>{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 V.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return V.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return V.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return V.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-YXEVD377.js").then(({InternalSearch:t})=>new t(c(this,eh)))),c(this,th).on("language-change",c(this,rh)),await this.searchInstance)}};eh=new WeakMap,th=new WeakMap,rh=new WeakMap;var WM=new WeakMap,Sr,TI=class extends Ne{constructor(r,{search:n}={}){super();O(this,Sr);f(this,"Analytics");f(this,"Search");f(this,"Query");f(this,"getDirections",(r,n,o)=>c(this,Sr).getDirections(r,n,o));f(this,"getDirectionsMultiDestination",(r,n,o)=>c(this,Sr).getDirectionsMultiDestination(r,n,o));k(this,Sr,r),WM.set(this,r),this.Analytics=new Jm(r.Analytics),this.Query=r.Query,this.Search=new Qm(this,r,{enabled:n==null?void 0:n.enabled}),c(this,Sr).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return c(this,Sr).getEnv()}getAccessToken(){var r;return(r=c(this,Sr).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return c(this,Sr).mapName}get mapCenter(){return c(this,Sr).mapCenter}get organizationId(){return c(this,Sr).organizationId}get outdoorViewToken(){return c(this,Sr).outdoorViewToken}getByType(r){return c(this,Sr).getByType(r)}getById(r,n){return c(this,Sr).getById(r,n)}getByExternalId(r,n){return c(this,Sr).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return c(this,Sr).changeLanguage(r)}get currentLanguage(){return c(this,Sr).currentLanguage}get naturalBearing(){var r;return(r=c(this,Sr).naturalBearing)!=null?r:0}getDistance(r,n){return c(this,Sr).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return c(this,Sr).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return c(this,Sr).toJSONBundle({downloadLanguagePacks:r})}};Sr=new WeakMap;var Pb=TI;function nh(e){let t=WM.get(e);if(!t)throw new Error("MapDataInternal not found");return t}d();d();d();d();d();d();d();d();d();var ok=ss(l3(),1),ik=ss(rk(),1);d();var Vq=e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2};function a0(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(a0);let t=T({},e);for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let o=a0(n);if(Vq(o)){let i=o.allOf.findIndex(a=>a.type==="array"),s=o.allOf.findIndex(a=>a.type==="object");if(i!==-1&&s!==-1){t[r]=L(T({},o),{allOf:[o.allOf[i]]});continue}}t[r]=o}return t}var nk={$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 xve=ik.default.default(new ok.default.default).compile(a0(nk));d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();var ft={};da(ft,{HasPropertyKey:()=>Hq,IsArray:()=>Pn,IsAsyncIterator:()=>h3,IsBigInt:()=>Dh,IsBoolean:()=>zl,IsDate:()=>up,IsFunction:()=>y3,IsIterator:()=>g3,IsNull:()=>b3,IsNumber:()=>Ei,IsObject:()=>Ut,IsRegExp:()=>Fh,IsString:()=>Xt,IsSymbol:()=>x3,IsUint8Array:()=>wa,IsUndefined:()=>yr});d();function Hq(e,t){return t in e}function h3(e){return Ut(e)&&!Pn(e)&&!wa(e)&&Symbol.asyncIterator in e}function Pn(e){return Array.isArray(e)}function Dh(e){return typeof e=="bigint"}function zl(e){return typeof e=="boolean"}function up(e){return e instanceof globalThis.Date}function y3(e){return typeof e=="function"}function g3(e){return Ut(e)&&!Pn(e)&&!wa(e)&&Symbol.iterator in e}function b3(e){return e===null}function Ei(e){return typeof e=="number"}function Ut(e){return typeof e=="object"&&e!==null}function Fh(e){return e instanceof globalThis.RegExp}function Xt(e){return typeof e=="string"}function x3(e){return typeof e=="symbol"}function wa(e){return e instanceof globalThis.Uint8Array}function yr(e){return e===void 0}function Wq(e){return e.map(t=>l0(t))}function Zq(e){return new Date(e.getTime())}function qq(e){return new Uint8Array(e)}function Xq(e){return new RegExp(e.source,e.flags)}function Yq(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=l0(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=l0(e[r]);return t}function l0(e){return Pn(e)?Wq(e):up(e)?Zq(e):wa(e)?qq(e):Fh(e)?Xq(e):Ut(e)?Yq(e):e}function rr(e){return l0(e)}function sk(e){return e.map(t=>Lh(t))}function Lh(e,t){return t===void 0?rr(e):rr(T(T({},t),e))}d();d();d();function c0(e){return Ze(e)&&Symbol.asyncIterator in e}function p0(e){return Ze(e)&&Symbol.iterator in e}function v3(e){return Ze(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function u0(e){return e instanceof Promise}function Gn(e){return e instanceof Date&&Number.isFinite(e.getTime())}function ak(e){return e instanceof globalThis.Map}function lk(e){return e instanceof globalThis.Set}function zo(e){return ArrayBuffer.isView(e)}function Fd(e){return e instanceof globalThis.Uint8Array}function Be(e,t){return t in e}function Ze(e){return e!==null&&typeof e=="object"}function ze(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}function gr(e){return e===void 0}function Ma(e){return e===null}function vs(e){return typeof e=="boolean"}function _e(e){return typeof e=="number"}function d0(e){return Number.isInteger(e)}function on(e){return typeof e=="bigint"}function mt(e){return typeof e=="string"}function Hl(e){return typeof e=="function"}function Oa(e){return typeof e=="symbol"}function sn(e){return on(e)||vs(e)||Ma(e)||_e(e)||mt(e)||Oa(e)||gr(e)}var Ft;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(s,a){return e.ExactOptionalPropertyTypes?a in s:s[a]!==void 0}e.IsExactOptionalProperty=t;function r(s){let a=Ze(s);return e.AllowArrayObject?a:a&&!ze(s)}e.IsObjectLike=r;function n(s){return r(s)&&!(s instanceof Date)&&!(s instanceof Uint8Array)}e.IsRecordLike=n;function o(s){return e.AllowNaN?_e(s):Number.isFinite(s)}e.IsNumberLike=o;function i(s){let a=gr(s);return e.AllowNullVoid?a||s===null:a}e.IsVoidLike=i})(Ft||(Ft={}));d();function Kq(e){return globalThis.Object.freeze(e).map(t=>Rh(t))}function Jq(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Rh(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Rh(e[r]);return globalThis.Object.freeze(t)}function Rh(e){return Pn(e)?Kq(e):up(e)?e:wa(e)?e:Fh(e)?e:Ut(e)?Jq(e):e}function Q(e,t){let r=t!==void 0?T(T({},t),e):e;switch(Ft.InstanceMode){case"freeze":return Rh(r);case"clone":return rr(r);default:return r}}d();var De=class extends Error{constructor(t){super(t)}};d();d();d();var nr=Symbol.for("TypeBox.Transform"),Ea=Symbol.for("TypeBox.Readonly"),Un=Symbol.for("TypeBox.Optional"),Ho=Symbol.for("TypeBox.Hint"),Z=Symbol.for("TypeBox.Kind");function ck(e){return Ut(e)&&e[Ea]==="Readonly"}function Is(e){return Ut(e)&&e[Un]==="Optional"}function I3(e){return vt(e,"Any")}function _a(e){return vt(e,"Array")}function Nh(e){return vt(e,"AsyncIterator")}function S3(e){return vt(e,"BigInt")}function C3(e){return vt(e,"Boolean")}function Bh(e){return vt(e,"Constructor")}function Qq(e){return vt(e,"Date")}function $h(e){return vt(e,"Function")}function dp(e){return vt(e,"Integer")}function Or(e){return vt(e,"Intersect")}function jh(e){return vt(e,"Iterator")}function vt(e,t){return Ut(e)&&Z in e&&e[Z]===t}function ka(e){return vt(e,"Literal")}function To(e){return vt(e,"MappedKey")}function or(e){return vt(e,"MappedResult")}function Wl(e){return vt(e,"Never")}function eX(e){return vt(e,"Not")}function tX(e){return vt(e,"Null")}function fp(e){return vt(e,"Number")}function $r(e){return vt(e,"Object")}function mp(e){return vt(e,"Promise")}function T3(e){return vt(e,"Record")}function P3(e){return vt(e,"Ref")}function w3(e){return vt(e,"RegExp")}function Gh(e){return vt(e,"String")}function rX(e){return vt(e,"Symbol")}function Po(e){return vt(e,"TemplateLiteral")}function nX(e){return vt(e,"This")}function Ld(e){return Ut(e)&&nr in e}function _i(e){return vt(e,"Tuple")}function oX(e){return vt(e,"Undefined")}function _t(e){return vt(e,"Union")}function iX(e){return vt(e,"Uint8Array")}function sX(e){return vt(e,"Unknown")}function aX(e){return vt(e,"Unsafe")}function lX(e){return vt(e,"Void")}function Zl(e){return Ut(e)&&Z in e&&Xt(e[Z])}function ki(e){return I3(e)||_a(e)||C3(e)||S3(e)||Nh(e)||Bh(e)||Qq(e)||$h(e)||dp(e)||Or(e)||jh(e)||ka(e)||To(e)||or(e)||Wl(e)||eX(e)||tX(e)||fp(e)||$r(e)||mp(e)||T3(e)||P3(e)||w3(e)||Gh(e)||rX(e)||Po(e)||nX(e)||_i(e)||oX(e)||_t(e)||iX(e)||sX(e)||aX(e)||lX(e)||Zl(e)}var N={};da(N,{IsAny:()=>fk,IsArray:()=>mk,IsAsyncIterator:()=>hk,IsBigInt:()=>yk,IsBoolean:()=>gk,IsConstructor:()=>bk,IsDate:()=>xk,IsFunction:()=>vk,IsInteger:()=>Ik,IsIntersect:()=>Sk,IsIterator:()=>Ck,IsKind:()=>Zk,IsKindOf:()=>yt,IsLiteral:()=>Vh,IsLiteralBoolean:()=>mX,IsLiteralNumber:()=>Pk,IsLiteralString:()=>Tk,IsLiteralValue:()=>wk,IsMappedKey:()=>Mk,IsMappedResult:()=>Ok,IsNever:()=>Ek,IsNot:()=>_k,IsNull:()=>kk,IsNumber:()=>Ak,IsObject:()=>Dk,IsOptional:()=>fX,IsPromise:()=>Fk,IsProperties:()=>_3,IsReadonly:()=>dX,IsRecord:()=>Lk,IsRecursive:()=>hX,IsRef:()=>Rk,IsRegExp:()=>Nk,IsSchema:()=>ht,IsString:()=>Bk,IsSymbol:()=>$k,IsTemplateLiteral:()=>jk,IsThis:()=>Gk,IsTransform:()=>Yt,IsTuple:()=>Uk,IsUint8Array:()=>Vk,IsUndefined:()=>Rd,IsUnion:()=>k3,IsUnionLiteral:()=>yX,IsUnknown:()=>zk,IsUnsafe:()=>Hk,IsVoid:()=>Wk,TypeGuardUnknownTypeError:()=>M3});d();var M3=class extends De{},cX=["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 pk(e){try{return new RegExp(e),!0}catch(t){return!1}}function O3(e){if(!Xt(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}function uk(e){return E3(e)||ht(e)}function Uh(e){return yr(e)||Dh(e)}function Zt(e){return yr(e)||Ei(e)}function E3(e){return yr(e)||zl(e)}function Rt(e){return yr(e)||Xt(e)}function pX(e){return yr(e)||Xt(e)&&O3(e)&&pk(e)}function uX(e){return yr(e)||Xt(e)&&O3(e)}function dk(e){return yr(e)||ht(e)}function dX(e){return Ut(e)&&e[Ea]==="Readonly"}function fX(e){return Ut(e)&&e[Un]==="Optional"}function fk(e){return yt(e,"Any")&&Rt(e.$id)}function mk(e){return yt(e,"Array")&&e.type==="array"&&Rt(e.$id)&&ht(e.items)&&Zt(e.minItems)&&Zt(e.maxItems)&&E3(e.uniqueItems)&&dk(e.contains)&&Zt(e.minContains)&&Zt(e.maxContains)}function hk(e){return yt(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Rt(e.$id)&&ht(e.items)}function yk(e){return yt(e,"BigInt")&&e.type==="bigint"&&Rt(e.$id)&&Uh(e.exclusiveMaximum)&&Uh(e.exclusiveMinimum)&&Uh(e.maximum)&&Uh(e.minimum)&&Uh(e.multipleOf)}function gk(e){return yt(e,"Boolean")&&e.type==="boolean"&&Rt(e.$id)}function bk(e){return yt(e,"Constructor")&&e.type==="Constructor"&&Rt(e.$id)&&Pn(e.parameters)&&e.parameters.every(t=>ht(t))&&ht(e.returns)}function xk(e){return yt(e,"Date")&&e.type==="Date"&&Rt(e.$id)&&Zt(e.exclusiveMaximumTimestamp)&&Zt(e.exclusiveMinimumTimestamp)&&Zt(e.maximumTimestamp)&&Zt(e.minimumTimestamp)&&Zt(e.multipleOfTimestamp)}function vk(e){return yt(e,"Function")&&e.type==="Function"&&Rt(e.$id)&&Pn(e.parameters)&&e.parameters.every(t=>ht(t))&&ht(e.returns)}function Ik(e){return yt(e,"Integer")&&e.type==="integer"&&Rt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}function _3(e){return Ut(e)&&Object.entries(e).every(([t,r])=>O3(t)&&ht(r))}function Sk(e){return yt(e,"Intersect")&&!(Xt(e.type)&&e.type!=="object")&&Pn(e.allOf)&&e.allOf.every(t=>ht(t)&&!Yt(t))&&Rt(e.type)&&(E3(e.unevaluatedProperties)||dk(e.unevaluatedProperties))&&Rt(e.$id)}function Ck(e){return yt(e,"Iterator")&&e.type==="Iterator"&&Rt(e.$id)&&ht(e.items)}function yt(e,t){return Ut(e)&&Z in e&&e[Z]===t}function Tk(e){return Vh(e)&&Xt(e.const)}function Pk(e){return Vh(e)&&Ei(e.const)}function mX(e){return Vh(e)&&zl(e.const)}function Vh(e){return yt(e,"Literal")&&Rt(e.$id)&&wk(e.const)}function wk(e){return zl(e)||Ei(e)||Xt(e)}function Mk(e){return yt(e,"MappedKey")&&Pn(e.keys)&&e.keys.every(t=>Ei(t)||Xt(t))}function Ok(e){return yt(e,"MappedResult")&&_3(e.properties)}function Ek(e){return yt(e,"Never")&&Ut(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function _k(e){return yt(e,"Not")&&ht(e.not)}function kk(e){return yt(e,"Null")&&e.type==="null"&&Rt(e.$id)}function Ak(e){return yt(e,"Number")&&e.type==="number"&&Rt(e.$id)&&Zt(e.exclusiveMaximum)&&Zt(e.exclusiveMinimum)&&Zt(e.maximum)&&Zt(e.minimum)&&Zt(e.multipleOf)}function Dk(e){return yt(e,"Object")&&e.type==="object"&&Rt(e.$id)&&_3(e.properties)&&uk(e.additionalProperties)&&Zt(e.minProperties)&&Zt(e.maxProperties)}function Fk(e){return yt(e,"Promise")&&e.type==="Promise"&&Rt(e.$id)&&ht(e.item)}function Lk(e){return yt(e,"Record")&&e.type==="object"&&Rt(e.$id)&&uk(e.additionalProperties)&&Ut(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&pk(r[0])&&Ut(t.patternProperties)&&ht(t.patternProperties[r[0]])})(e)}function hX(e){return Ut(e)&&Ho in e&&e[Ho]==="Recursive"}function Rk(e){return yt(e,"Ref")&&Rt(e.$id)&&Xt(e.$ref)}function Nk(e){return yt(e,"RegExp")&&Rt(e.$id)&&Xt(e.source)&&Xt(e.flags)&&Zt(e.maxLength)&&Zt(e.minLength)}function Bk(e){return yt(e,"String")&&e.type==="string"&&Rt(e.$id)&&Zt(e.minLength)&&Zt(e.maxLength)&&pX(e.pattern)&&uX(e.format)}function $k(e){return yt(e,"Symbol")&&e.type==="symbol"&&Rt(e.$id)}function jk(e){return yt(e,"TemplateLiteral")&&e.type==="string"&&Xt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function Gk(e){return yt(e,"This")&&Rt(e.$id)&&Xt(e.$ref)}function Yt(e){return Ut(e)&&nr in e}function Uk(e){return yt(e,"Tuple")&&e.type==="array"&&Rt(e.$id)&&Ei(e.minItems)&&Ei(e.maxItems)&&e.minItems===e.maxItems&&(yr(e.items)&&yr(e.additionalItems)&&e.minItems===0||Pn(e.items)&&e.items.every(t=>ht(t)))}function Rd(e){return yt(e,"Undefined")&&e.type==="undefined"&&Rt(e.$id)}function yX(e){return k3(e)&&e.anyOf.every(t=>Tk(t)||Pk(t))}function k3(e){return yt(e,"Union")&&Rt(e.$id)&&Ut(e)&&Pn(e.anyOf)&&e.anyOf.every(t=>ht(t))}function Vk(e){return yt(e,"Uint8Array")&&e.type==="Uint8Array"&&Rt(e.$id)&&Zt(e.minByteLength)&&Zt(e.maxByteLength)}function zk(e){return yt(e,"Unknown")&&Rt(e.$id)}function Hk(e){return yt(e,"Unsafe")}function Wk(e){return yt(e,"Void")&&e.type==="void"&&Rt(e.$id)}function Zk(e){return Ut(e)&&Z in e&&Xt(e[Z])&&!cX.includes(e[Z])}function ht(e){return Ut(e)&&(fk(e)||mk(e)||gk(e)||yk(e)||hk(e)||bk(e)||xk(e)||vk(e)||Ik(e)||Sk(e)||Ck(e)||Vh(e)||Mk(e)||Ok(e)||Ek(e)||_k(e)||kk(e)||Ak(e)||Dk(e)||Fk(e)||Lk(e)||Rk(e)||Nk(e)||Bk(e)||$k(e)||jk(e)||Gk(e)||Uk(e)||Rd(e)||k3(e)||Vk(e)||zk(e)||Hk(e)||Wk(e)||Zk(e))}d();var A3="(true|false)",zh="(0|[1-9][0-9]*)",D3="(.*)",gX="(?!.*)",A2e="^".concat(A3,"$"),Aa="^".concat(zh,"$"),Da="^".concat(D3,"$"),qk="^".concat(gX,"$");d();var Vn={};da(Vn,{Clear:()=>xX,Delete:()=>vX,Entries:()=>bX,Get:()=>CX,Has:()=>IX,Set:()=>SX});d();var Nd=new Map;function bX(){return new Map(Nd)}function xX(){return Nd.clear()}function vX(e){return Nd.delete(e)}function IX(e){return Nd.has(e)}function SX(e,t){Nd.set(e,t)}function CX(e){return Nd.get(e)}var jr={};da(jr,{Clear:()=>PX,Delete:()=>wX,Entries:()=>TX,Get:()=>EX,Has:()=>MX,Set:()=>OX});d();var Bd=new Map;function TX(){return new Map(Bd)}function PX(){return Bd.clear()}function wX(e){return Bd.delete(e)}function MX(e){return Bd.has(e)}function OX(e,t){Bd.set(e,t)}function EX(e){return Bd.get(e)}d();function Xk(e,t){return e.includes(t)}function Yk(e){return[...new Set(e)]}function _X(e,t){return e.filter(r=>t.includes(r))}function kX(e,t){return e.reduce((r,n)=>_X(r,n),t)}function Kk(e){return e.length===1?e[0]:e.length>1?kX(e.slice(1),e[0]):[]}function Jk(e){let t=[];for(let r of e)t.push(...r);return t}d();function ql(e){return Q({[Z]:"Any"},e)}d();function f0(e,t){return Q({[Z]:"Array",type:"array",items:e},t)}d();function m0(e,t){return Q({[Z]:"AsyncIterator",type:"AsyncIterator",items:e},t)}d();d();d();function AX(e,t){let o=e,{[t]:r}=o;return Bn(o,[ob(t)])}function Cr(e,t){return t.reduce((r,n)=>AX(r,n),e)}d();function Nt(e){return Q({[Z]:"Never",not:{}},e)}d();d();function It(e){return Q({[Z]:"MappedResult",properties:e})}d();d();function h0(e,t,r){return Q({[Z]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}d();function Xl(e,t,r){return Q({[Z]:"Function",type:"Function",parameters:e,returns:t},r)}d();d();d();d();function Hh(e,t){return Q({[Z]:"Union",anyOf:e},t)}function DX(e){return e.some(t=>Is(t))}function Qk(e){return e.map(t=>Is(t)?FX(t):t)}function FX(e){return Cr(e,[Un])}function LX(e,t){return DX(e)?ao(Hh(Qk(e),t)):Hh(Qk(e),t)}function Ss(e,t){return e.length===0?Nt(t):e.length===1?Q(e[0],t):LX(e,t)}d();function Bt(e,t){return e.length===0?Nt(t):e.length===1?Q(e[0],t):Hh(e,t)}d();d();d();var y0=class extends De{};function RX(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function F3(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Fa(e,t){return F3(e,t,"(")}function Wh(e,t){return F3(e,t,")")}function eA(e,t){return F3(e,t,"|")}function NX(e){if(!(Fa(e,0)&&Wh(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Fa(e,r)&&(t+=1),Wh(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function BX(e){return e.slice(1,e.length-1)}function $X(e){let t=0;for(let r=0;r<e.length;r++)if(Fa(e,r)&&(t+=1),Wh(e,r)&&(t-=1),eA(e,r)&&t===0)return!0;return!1}function jX(e){for(let t=0;t<e.length;t++)if(Fa(e,t))return!0;return!1}function GX(e){let[t,r]=[0,0],n=[];for(let i=0;i<e.length;i++)if(Fa(e,i)&&(t+=1),Wh(e,i)&&(t-=1),eA(e,i)&&t===0){let s=e.slice(r,i);s.length>0&&n.push($d(s)),r=i+1}let o=e.slice(r);return o.length>0&&n.push($d(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}function UX(e){function t(o,i){if(!Fa(o,i))throw new y0("TemplateLiteralParser: Index must point to open parens");let s=0;for(let a=i;a<o.length;a++)if(Fa(o,a)&&(s+=1),Wh(o,a)&&(s-=1),s===0)return[i,a];throw new y0("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,i){for(let s=i;s<o.length;s++)if(Fa(o,s))return[i,s];return[i,o.length]}let n=[];for(let o=0;o<e.length;o++)if(Fa(e,o)){let[i,s]=t(e,o),a=e.slice(i,s+1);n.push($d(a)),o=s}else{let[i,s]=r(e,o),a=e.slice(i,s);a.length>0&&n.push($d(a)),o=s-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}function $d(e){return NX(e)?$d(BX(e)):$X(e)?GX(e):jX(e)?UX(e):{type:"const",const:RX(e)}}function jd(e){return $d(e.slice(1,e.length-1))}var L3=class extends De{};function VX(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]*"}function zX(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"}function HX(e){return e.type==="const"&&e.const===".*"}function hp(e){return VX(e)||HX(e)?!1:zX(e)?!0:e.type==="and"?e.expr.every(t=>hp(t)):e.type==="or"?e.expr.every(t=>hp(t)):e.type==="const"?!0:(()=>{throw new L3("Unknown expression type")})()}function g0(e){let t=jd(e.pattern);return hp(t)}d();var R3=class extends De{};function*tA(e){if(e.length===1)return yield*oe(e[0]);for(let t of e[0])for(let r of tA(e.slice(1)))yield"".concat(t).concat(r)}function*WX(e){return yield*oe(tA(e.expr.map(t=>[...Zh(t)])))}function*ZX(e){for(let t of e.expr)yield*oe(Zh(t))}function*qX(e){return yield e.const}function*Zh(e){return e.type==="and"?yield*oe(WX(e)):e.type==="or"?yield*oe(ZX(e)):e.type==="const"?yield*oe(qX(e)):(()=>{throw new R3("Unknown expression")})()}function Gd(e){let t=jd(e.pattern);return hp(t)?[...Zh(t)]:[]}d();d();function At(e,t){return Q({[Z]:"Literal",const:e,type:typeof e},t)}d();function b0(e){return Q({[Z]:"Boolean",type:"boolean"},e)}d();function Ud(e){return Q({[Z]:"BigInt",type:"bigint"},e)}d();function Cs(e){return Q({[Z]:"Number",type:"number"},e)}d();function Wo(e){return Q({[Z]:"String",type:"string"},e)}function*XX(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield b0():t==="number"?yield Cs():t==="bigint"?yield Ud():t==="string"?yield Wo():yield(()=>{let r=t.split("|").map(n=>At(n.trim()));return r.length===0?Nt():r.length===1?r[0]:Ss(r)})()}function*YX(e){if(e[1]!=="{"){let t=At("$"),r=N3(e.slice(1));return yield*oe([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=XX(e.slice(2,t)),n=N3(e.slice(t+1));return yield*oe([...r,...n])}yield At(e)}function*N3(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=At(e.slice(0,t)),n=YX(e.slice(t));return yield*oe([r,...n])}yield At(e)}function rA(e){return[...N3(e)]}d();var B3=class extends De{};function KX(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nA(e,t){return Po(e)?e.pattern.slice(1,e.pattern.length-1):_t(e)?"(".concat(e.anyOf.map(r=>nA(r,t)).join("|"),")"):fp(e)?"".concat(t).concat(zh):dp(e)?"".concat(t).concat(zh):S3(e)?"".concat(t).concat(zh):Gh(e)?"".concat(t).concat(D3):ka(e)?"".concat(t).concat(KX(e.const.toString())):C3(e)?"".concat(t).concat(A3):(()=>{throw new B3("Unexpected Kind '".concat(e[Z],"'"))})()}function $3(e){return"^".concat(e.map(t=>nA(t,"")).join(""),"$")}d();function yp(e){let r=Gd(e).map(n=>At(n));return Ss(r)}d();function x0(e,t){let r=Xt(e)?$3(rA(e)):$3(e);return Q({[Z]:"TemplateLiteral",type:"string",pattern:r},t)}function JX(e){return Gd(e).map(r=>r.toString())}function QX(e){let t=[];for(let r of e)t.push(...lo(r));return t}function eY(e){return[e.toString()]}function lo(e){return[...new Set(Po(e)?JX(e):_t(e)?QX(e.anyOf):ka(e)?eY(e.const):fp(e)?["[number]"]:dp(e)?["[number]"]:[])]}d();function tY(e,t,r){let n={};for(let o of Object.getOwnPropertyNames(t))n[o]=Vd(e,lo(t[o]),r);return n}function rY(e,t,r){return tY(e,t.properties,r)}function oA(e,t,r){let n=rY(e,t,r);return It(n)}function sA(e,t){return e.map(r=>aA(r,t))}function nY(e){return e.filter(t=>!Wl(t))}function oY(e,t){return v0(nY(sA(e,t)))}function iY(e){return e.some(t=>Wl(t))?[]:e}function sY(e,t){return Ss(iY(sA(e,t)))}function aY(e,t){return t in e?e[t]:t==="[number]"?Ss(e):Nt()}function lY(e,t){return t==="[number]"?e:Nt()}function cY(e,t){return t in e?e[t]:Nt()}function aA(e,t){var r;return Or(e)?oY(e.allOf,t):_t(e)?sY(e.anyOf,t):_i(e)?aY((r=e.items)!=null?r:[],t):_a(e)?lY(e.items,t):$r(e)?cY(e.properties,t):Nt()}function qh(e,t){return t.map(r=>aA(e,r))}function iA(e,t){return Ss(qh(e,t))}function Vd(e,t,r){return or(t)?oA(e,t,r):To(t)?lA(e,t,r):Q(ki(t)?iA(e,lo(t)):iA(e,t),r)}function pY(e,t,r){return{[t]:Vd(e,[t],rr(r))}}function uY(e,t,r){return t.reduce((n,o)=>T(T({},n),pY(e,o,r)),{})}function dY(e,t,r){return uY(e,t.keys,r)}function lA(e,t,r){let n=dY(e,t,r);return It(n)}d();function I0(e,t){return Q({[Z]:"Iterator",type:"Iterator",items:e},t)}d();function fY(e){let t=[];for(let r in e)Is(e[r])||t.push(r);return t}function mY(e,t){let r=fY(e),n=r.length>0?{[Z]:"Object",type:"object",properties:e,required:r}:{[Z]:"Object",type:"object",properties:e};return Q(n,t)}var Vt=mY;d();function S0(e,t){return Q({[Z]:"Promise",type:"Promise",item:e},t)}d();d();function hY(e){return Q(Cr(e,[Ea]))}function yY(e){return Q(L(T({},e),{[Ea]:"Readonly"}))}function gY(e,t){return t===!1?hY(e):yY(e)}function Zo(e,t){let r=t!=null?t:!0;return or(e)?cA(e,r):gY(e,r)}function bY(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Zo(e[n],t);return r}function xY(e,t){return bY(e.properties,t)}function cA(e,t){let r=xY(e,t);return It(r)}d();function Ts(e,t){return Q(e.length>0?{[Z]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Z]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function pA(e,t){return e in t?qo(e,t[e]):It(t)}function vY(e){return{[e]:At(e)}}function IY(e){let t={};for(let r of e)t[r]=At(r);return t}function SY(e,t){return Xk(t,e)?vY(e):IY(t)}function CY(e,t){let r=SY(e,t);return pA(e,r)}function Xh(e,t){return t.map(r=>qo(e,r))}function TY(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=qo(e,t[n]);return r}function qo(e,t){var n;let r=T({},t);return Is(t)?ao(qo(e,Cr(t,[Un]))):ck(t)?Zo(qo(e,Cr(t,[Ea]))):or(t)?pA(e,t.properties):To(t)?CY(e,t.keys):Bh(t)?h0(Xh(e,t.parameters),qo(e,t.returns),r):$h(t)?Xl(Xh(e,t.parameters),qo(e,t.returns),r):Nh(t)?m0(qo(e,t.items),r):jh(t)?I0(qo(e,t.items),r):Or(t)?co(Xh(e,t.allOf),r):_t(t)?Bt(Xh(e,t.anyOf),r):_i(t)?Ts(Xh(e,(n=t.items)!=null?n:[]),r):$r(t)?Vt(TY(e,t.properties),r):_a(t)?f0(qo(e,t.items),r):mp(t)?S0(qo(e,t.item),r):t}function PY(e,t){let r={};for(let n of e)r[n]=qo(n,t);return r}function uA(e,t,r){let n=ki(e)?lo(e):e,o=t({[Z]:"MappedKey",keys:n}),i=PY(n,o);return Vt(i,r)}d();function wY(e){return Q(Cr(e,[Un]))}function MY(e){return Q(L(T({},e),{[Un]:"Optional"}))}function OY(e,t){return t===!1?wY(e):MY(e)}function ao(e,t){let r=t!=null?t:!0;return or(e)?dA(e,r):OY(e,r)}function EY(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ao(e[n],t);return r}function _Y(e,t){return EY(e.properties,t)}function dA(e,t){let r=_Y(e,t);return It(r)}d();function Yh(e,t={}){let r=e.every(o=>$r(o)),n=ki(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Q(t.unevaluatedProperties===!1||ki(t.unevaluatedProperties)||r?L(T({},n),{[Z]:"Intersect",type:"object",allOf:e}):L(T({},n),{[Z]:"Intersect",allOf:e}),t)}function kY(e){return e.every(t=>Is(t))}function AY(e){return Cr(e,[Un])}function fA(e){return e.map(t=>Is(t)?AY(t):t)}function DY(e,t){return kY(e)?ao(Yh(fA(e),t)):Yh(fA(e),t)}function v0(e,t={}){if(e.length===0)return Nt(t);if(e.length===1)return Q(e[0],t);if(e.some(r=>Ld(r)))throw new Error("Cannot intersect transform types");return DY(e,t)}d();function co(e,t){if(e.length===0)return Nt(t);if(e.length===1)return Q(e[0],t);if(e.some(r=>Ld(r)))throw new Error("Cannot intersect transform types");return Yh(e,t)}function mA(e){return e.map(t=>j3(t))}function FY(e){return co(mA(e))}function LY(e){return Bt(mA(e))}function RY(e){return j3(e)}function j3(e){return Or(e)?FY(e.allOf):_t(e)?LY(e.anyOf):mp(e)?RY(e.item):e}function hA(e,t){return Q(j3(e),t)}d();d();d();d();function yA(e){let t=[];for(let r of e)t.push(Yr(r));return t}function NY(e){let t=yA(e);return Jk(t)}function BY(e){let t=yA(e);return Kk(t)}function $Y(e){return e.map((t,r)=>r.toString())}function jY(e){return["[number]"]}function GY(e){return globalThis.Object.getOwnPropertyNames(e)}function UY(e){return G3?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function Yr(e){var t;return Or(e)?NY(e.allOf):_t(e)?BY(e.anyOf):_i(e)?$Y((t=e.items)!=null?t:[]):_a(e)?jY(e.items):$r(e)?GY(e.properties):T3(e)?UY(e.patternProperties):[]}var G3=!1;function La(e){G3=!0;let t=Yr(e);G3=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}function VY(e){return e.map(t=>t==="[number]"?Cs():At(t))}function C0(e,t){if(or(e))return gA(e,t);{let r=Yr(e),n=VY(r),o=Ss(n);return Q(o,t)}}function zY(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=C0(e[n],rr(t));return r}function HY(e,t){return zY(e.properties,t)}function gA(e,t){let r=HY(e,t);return It(r)}d();function Yl(e){let t=Yr(e),r=qh(e,t);return t.map((n,o)=>[t[o],r[o]])}function WY(e){let t=[];for(let r of e)t.push(...Yr(r));return Yk(t)}function ZY(e){return e.filter(t=>!Wl(t))}function qY(e,t){let r=[];for(let n of e)r.push(...qh(n,[t]));return ZY(r)}function XY(e,t){let r={};for(let n of t)r[n]=v0(qY(e,n));return r}function bA(e,t){let r=WY(e),n=XY(e,r);return Vt(n,t)}d();d();function T0(e){return Q({[Z]:"Date",type:"Date"},e)}d();function P0(e){return Q({[Z]:"Null",type:"null"},e)}d();function w0(e){return Q({[Z]:"Symbol",type:"symbol"},e)}d();function M0(e){return Q({[Z]:"Undefined",type:"undefined"},e)}d();function O0(e){return Q({[Z]:"Uint8Array",type:"Uint8Array"},e)}d();function Ra(e){return Q({[Z]:"Unknown"},e)}function YY(e){return e.map(t=>U3(t,!1))}function KY(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Zo(U3(e[r],!1));return t}function E0(e,t){return t===!0?e:Zo(e)}function U3(e,t){return h3(e)?E0(ql(),t):g3(e)?E0(ql(),t):Pn(e)?Zo(Ts(YY(e))):wa(e)?O0():up(e)?T0():Ut(e)?E0(Vt(KY(e)),t):y3(e)?E0(Xl([],Ra()),t):yr(e)?M0():b3(e)?P0():x3(e)?w0():Dh(e)?Ud():Ei(e)?At(e):zl(e)?At(e):Xt(e)?At(e):Vt({})}function xA(e,t){return Q(U3(e,!0),t)}d();function vA(e,t){return Ts(e.parameters,t)}d();function Kh(e,t){return e.map(r=>Ai(r,t))}function JY(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Ai(e[n],t);return r}function QY(e,t){return e.parameters=Kh(e.parameters,t),e.returns=Ai(e.returns,t),e}function eK(e,t){return e.parameters=Kh(e.parameters,t),e.returns=Ai(e.returns,t),e}function tK(e,t){return e.allOf=Kh(e.allOf,t),e}function rK(e,t){return e.anyOf=Kh(e.anyOf,t),e}function nK(e,t){return yr(e.items)||(e.items=Kh(e.items,t)),e}function oK(e,t){return e.items=Ai(e.items,t),e}function iK(e,t){return e.properties=JY(e.properties,t),e}function sK(e,t){return e.item=Ai(e.item,t),e}function aK(e,t){return e.items=Ai(e.items,t),e}function lK(e,t){return e.items=Ai(e.items,t),e}function cK(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 Ai(n,t)}function pK(e,t){return Bh(e)?QY(e,t):$h(e)?eK(e,t):Or(e)?tK(e,t):_t(e)?rK(e,t):_i(e)?nK(e,t):_a(e)?oK(e,t):$r(e)?iK(e,t):mp(e)?sK(e,t):Nh(e)?aK(e,t):jh(e)?lK(e,t):P3(e)?cK(e,t):e}function Ai(e,t){return pK(Lh(e),sk(t))}d();function IA(e,t){if(yr(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,L(T({},t),{[Ho]:"Enum"}))}d();d();d();var z3=class extends De{},K;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(K||(K={}));function Xo(e){return e===K.False?e:K.True}function zd(e){throw new z3(e)}function Dr(e){return N.IsNever(e)||N.IsIntersect(e)||N.IsUnion(e)||N.IsUnknown(e)||N.IsAny(e)}function Fr(e,t){return N.IsNever(t)?OA(e,t):N.IsIntersect(t)?_0(e,t):N.IsUnion(t)?q3(e,t):N.IsUnknown(t)?AA(e,t):N.IsAny(t)?Z3(e,t):zd("StructuralRight")}function Z3(e,t){return K.True}function uK(e,t){return N.IsIntersect(t)?_0(e,t):N.IsUnion(t)&&t.anyOf.some(r=>N.IsAny(r)||N.IsUnknown(r))?K.True:N.IsUnion(t)?K.Union:N.IsUnknown(t)||N.IsAny(t)?K.True:K.Union}function dK(e,t){return N.IsUnknown(e)?K.False:N.IsAny(e)?K.Union:N.IsNever(e)?K.True:K.False}function fK(e,t){return N.IsObject(t)&&k0(t)?K.True:Dr(t)?Fr(e,t):N.IsArray(t)?Xo($t(e.items,t.items)):K.False}function mK(e,t){return Dr(t)?Fr(e,t):N.IsAsyncIterator(t)?Xo($t(e.items,t.items)):K.False}function hK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsBigInt(t)?K.True:K.False}function wA(e,t){return N.IsLiteralBoolean(e)||N.IsBoolean(e)?K.True:K.False}function yK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsBoolean(t)?K.True:K.False}function gK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsConstructor(t)?e.parameters.length>t.parameters.length?K.False:e.parameters.every((r,n)=>Xo($t(t.parameters[n],r))===K.True)?Xo($t(e.returns,t.returns)):K.False:K.False}function bK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsDate(t)?K.True:K.False}function xK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsFunction(t)?e.parameters.length>t.parameters.length?K.False:e.parameters.every((r,n)=>Xo($t(t.parameters[n],r))===K.True)?Xo($t(e.returns,t.returns)):K.False:K.False}function MA(e,t){return N.IsLiteral(e)&&ft.IsNumber(e.const)||N.IsNumber(e)||N.IsInteger(e)?K.True:K.False}function vK(e,t){return N.IsInteger(t)||N.IsNumber(t)?K.True:Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):K.False}function _0(e,t){return t.allOf.every(r=>$t(e,r)===K.True)?K.True:K.False}function IK(e,t){return e.allOf.some(r=>$t(r,t)===K.True)?K.True:K.False}function SK(e,t){return Dr(t)?Fr(e,t):N.IsIterator(t)?Xo($t(e.items,t.items)):K.False}function CK(e,t){return N.IsLiteral(t)&&t.const===e.const?K.True:Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsString(t)?kA(e,t):N.IsNumber(t)?EA(e,t):N.IsInteger(t)?MA(e,t):N.IsBoolean(t)?wA(e,t):K.False}function OA(e,t){return K.False}function TK(e,t){return K.True}function SA(e){let[t,r]=[e,0];for(;N.IsNot(t);)t=t.not,r+=1;return r%2===0?t:Ra()}function PK(e,t){return N.IsNot(e)?$t(SA(e),t):N.IsNot(t)?$t(e,SA(t)):zd("Invalid fallthrough for Not")}function wK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsNull(t)?K.True:K.False}function EA(e,t){return N.IsLiteralNumber(e)||N.IsNumber(e)||N.IsInteger(e)?K.True:K.False}function MK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsInteger(t)||N.IsNumber(t)?K.True:K.False}function po(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function CA(e){return k0(e)}function TA(e){return po(e,0)||po(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]))}function V3(e){return po(e,0)}function PA(e){return po(e,0)}function OK(e){return po(e,0)}function EK(e){return po(e,0)}function _K(e){return k0(e)}function kK(e){let t=Cs();return po(e,0)||po(e,1)&&"length"in e.properties&&Xo($t(e.properties.length,t))===K.True}function AK(e){return po(e,0)}function k0(e){let t=Cs();return po(e,0)||po(e,1)&&"length"in e.properties&&Xo($t(e.properties.length,t))===K.True}function DK(e){let t=Xl([ql()],ql());return po(e,0)||po(e,1)&&"then"in e.properties&&Xo($t(e.properties.then,t))===K.True}function _A(e,t){return $t(e,t)===K.False||N.IsOptional(e)&&!N.IsOptional(t)?K.False:K.True}function wn(e,t){return N.IsUnknown(e)?K.False:N.IsAny(e)?K.Union:N.IsNever(e)||N.IsLiteralString(e)&&CA(t)||N.IsLiteralNumber(e)&&V3(t)||N.IsLiteralBoolean(e)&&PA(t)||N.IsSymbol(e)&&TA(t)||N.IsBigInt(e)&&OK(t)||N.IsString(e)&&CA(t)||N.IsSymbol(e)&&TA(t)||N.IsNumber(e)&&V3(t)||N.IsInteger(e)&&V3(t)||N.IsBoolean(e)&&PA(t)||N.IsUint8Array(e)&&_K(t)||N.IsDate(e)&&EK(t)||N.IsConstructor(e)&&AK(t)||N.IsFunction(e)&&kK(t)?K.True:N.IsRecord(e)&&N.IsString(H3(e))?t[Ho]==="Record"?K.True:K.False:N.IsRecord(e)&&N.IsNumber(H3(e))?po(t,0)?K.True:K.False:K.False}function FK(e,t){return Dr(t)?Fr(e,t):N.IsRecord(t)?Yo(e,t):N.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!N.IsOptional(t.properties[r]))return K.False;if(N.IsOptional(t.properties[r]))return K.True;if(_A(e.properties[r],t.properties[r])===K.False)return K.False}return K.True})():K.False}function LK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)&&DK(t)?K.True:N.IsPromise(t)?Xo($t(e.item,t.item)):K.False}function H3(e){return Aa in e.patternProperties?Cs():Da in e.patternProperties?Wo():zd("Unknown record key pattern")}function W3(e){return Aa in e.patternProperties?e.patternProperties[Aa]:Da in e.patternProperties?e.patternProperties[Da]:zd("Unable to get record value schema")}function Yo(e,t){let[r,n]=[H3(t),W3(t)];return N.IsLiteralString(e)&&N.IsNumber(r)&&Xo($t(e,n))===K.True?K.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(_A(n,e.properties[o])===K.False)return K.False;return K.True})():K.False}function RK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?$t(W3(e),W3(t)):K.False}function NK(e,t){let r=N.IsRegExp(e)?Wo():e,n=N.IsRegExp(t)?Wo():t;return $t(r,n)}function kA(e,t){return N.IsLiteral(e)&&ft.IsString(e.const)||N.IsString(e)?K.True:K.False}function BK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsString(t)?K.True:K.False}function $K(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsSymbol(t)?K.True:K.False}function jK(e,t){return N.IsTemplateLiteral(e)?$t(yp(e),t):N.IsTemplateLiteral(t)?$t(e,yp(t)):zd("Invalid fallthrough for TemplateLiteral")}function GK(e,t){return N.IsArray(t)&&e.items!==void 0&&e.items.every(r=>$t(r,t.items)===K.True)}function UK(e,t){return N.IsNever(e)?K.True:N.IsUnknown(e)?K.False:N.IsAny(e)?K.Union:K.False}function VK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)&&k0(t)||N.IsArray(t)&&GK(e,t)?K.True:N.IsTuple(t)?ft.IsUndefined(e.items)&&!ft.IsUndefined(t.items)||!ft.IsUndefined(e.items)&&ft.IsUndefined(t.items)?K.False:ft.IsUndefined(e.items)&&!ft.IsUndefined(t.items)||e.items.every((r,n)=>$t(r,t.items[n])===K.True)?K.True:K.False:K.False}function zK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsUint8Array(t)?K.True:K.False}function HK(e,t){return Dr(t)?Fr(e,t):N.IsObject(t)?wn(e,t):N.IsRecord(t)?Yo(e,t):N.IsVoid(t)?qK(e,t):N.IsUndefined(t)?K.True:K.False}function q3(e,t){return t.anyOf.some(r=>$t(e,r)===K.True)?K.True:K.False}function WK(e,t){return e.anyOf.every(r=>$t(r,t)===K.True)?K.True:K.False}function AA(e,t){return K.True}function ZK(e,t){return N.IsNever(t)?OA(e,t):N.IsIntersect(t)?_0(e,t):N.IsUnion(t)?q3(e,t):N.IsAny(t)?Z3(e,t):N.IsString(t)?kA(e,t):N.IsNumber(t)?EA(e,t):N.IsInteger(t)?MA(e,t):N.IsBoolean(t)?wA(e,t):N.IsArray(t)?dK(e,t):N.IsTuple(t)?UK(e,t):N.IsObject(t)?wn(e,t):N.IsUnknown(t)?K.True:K.False}function qK(e,t){return N.IsUndefined(e)||N.IsUndefined(e)?K.True:K.False}function XK(e,t){return N.IsIntersect(t)?_0(e,t):N.IsUnion(t)?q3(e,t):N.IsUnknown(t)?AA(e,t):N.IsAny(t)?Z3(e,t):N.IsObject(t)?wn(e,t):N.IsVoid(t)?K.True:K.False}function $t(e,t){return N.IsTemplateLiteral(e)||N.IsTemplateLiteral(t)?jK(e,t):N.IsRegExp(e)||N.IsRegExp(t)?NK(e,t):N.IsNot(e)||N.IsNot(t)?PK(e,t):N.IsAny(e)?uK(e,t):N.IsArray(e)?fK(e,t):N.IsBigInt(e)?hK(e,t):N.IsBoolean(e)?yK(e,t):N.IsAsyncIterator(e)?mK(e,t):N.IsConstructor(e)?gK(e,t):N.IsDate(e)?bK(e,t):N.IsFunction(e)?xK(e,t):N.IsInteger(e)?vK(e,t):N.IsIntersect(e)?IK(e,t):N.IsIterator(e)?SK(e,t):N.IsLiteral(e)?CK(e,t):N.IsNever(e)?TK(e,t):N.IsNull(e)?wK(e,t):N.IsNumber(e)?MK(e,t):N.IsObject(e)?FK(e,t):N.IsRecord(e)?RK(e,t):N.IsString(e)?BK(e,t):N.IsSymbol(e)?$K(e,t):N.IsTuple(e)?VK(e,t):N.IsPromise(e)?LK(e,t):N.IsUint8Array(e)?zK(e,t):N.IsUndefined(e)?HK(e,t):N.IsUnion(e)?WK(e,t):N.IsUnknown(e)?ZK(e,t):N.IsVoid(e)?XK(e,t):zd("Unknown left type operand '".concat(e[Z],"'"))}function Kl(e,t){return $t(e,t)}d();d();d();function YK(e,t,r,n,o){let i={};for(let s of globalThis.Object.getOwnPropertyNames(e))i[s]=Hd(e[s],t,r,n,rr(o));return i}function KK(e,t,r,n,o){return YK(e.properties,t,r,n,o)}function DA(e,t,r,n,o){let i=KK(e,t,r,n,o);return It(i)}function JK(e,t,r,n){let o=Kl(e,t);return o===K.Union?Bt([r,n]):o===K.True?r:n}function Hd(e,t,r,n,o){return or(e)?DA(e,t,r,n,o):To(e)?Q(FA(e,t,r,n,o)):Q(JK(e,t,r,n),o)}function QK(e,t,r,n,o){return{[e]:Hd(At(e),t,r,n,rr(o))}}function eJ(e,t,r,n,o){return e.reduce((i,s)=>T(T({},i),QK(s,t,r,n,o)),{})}function tJ(e,t,r,n,o){return eJ(e.keys,t,r,n,o)}function FA(e,t,r,n,o){let i=tJ(e,t,r,n,o);return It(i)}d();function rJ(e){return e.allOf.every(t=>Na(t))}function nJ(e){return e.anyOf.some(t=>Na(t))}function oJ(e){return!Na(e.not)}function Na(e){return e[Z]==="Intersect"?rJ(e):e[Z]==="Union"?nJ(e):e[Z]==="Not"?oJ(e):e[Z]==="Undefined"}d();function LA(e,t){return Wd(yp(e),t)}function iJ(e,t){let r=e.filter(n=>Kl(n,t)===K.False);return r.length===1?r[0]:Bt(r)}function Wd(e,t,r={}){return Po(e)?Q(LA(e,t),r):or(e)?Q(RA(e,t),r):Q(_t(e)?iJ(e.anyOf,t):Kl(e,t)!==K.False?Nt():e,r)}function sJ(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Wd(e[n],t);return r}function aJ(e,t){return sJ(e.properties,t)}function RA(e,t){let r=aJ(e,t);return It(r)}d();d();d();function NA(e,t){return Zd(yp(e),t)}function lJ(e,t){let r=e.filter(n=>Kl(n,t)!==K.False);return r.length===1?r[0]:Bt(r)}function Zd(e,t,r){return Po(e)?Q(NA(e,t),r):or(e)?Q(BA(e,t),r):Q(_t(e)?lJ(e.anyOf,t):Kl(e,t)!==K.False?e:Nt(),r)}function cJ(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Zd(e[n],t);return r}function pJ(e,t){return cJ(e.properties,t)}function BA(e,t){let r=pJ(e,t);return It(r)}d();function $A(e,t){return Q(e.returns,t)}d();function jA(e){return Q({[Z]:"Integer",type:"integer"},e)}d();d();d();function uJ(e,t,r){return{[e]:Di(At(e),t,rr(r))}}function dJ(e,t,r){return e.reduce((o,i)=>T(T({},o),uJ(i,t,r)),{})}function fJ(e,t,r){return dJ(e.keys,t,r)}function GA(e,t,r){let n=fJ(e,t,r);return It(n)}function mJ(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function hJ(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function yJ(e){return e.toUpperCase()}function gJ(e){return e.toLowerCase()}function bJ(e,t,r){let n=jd(e.pattern);if(!hp(n))return L(T({},e),{pattern:UA(e.pattern,t)});let s=[...Zh(n)].map(p=>At(p)),a=VA(s,t),l=Bt(a);return x0([l],r)}function UA(e,t){return typeof e=="string"?t==="Uncapitalize"?mJ(e):t==="Capitalize"?hJ(e):t==="Uppercase"?yJ(e):t==="Lowercase"?gJ(e):e:e.toString()}function VA(e,t){return e.map(r=>Di(r,t))}function Di(e,t,r={}){return To(e)?GA(e,t,r):Po(e)?bJ(e,t,r):_t(e)?Bt(VA(e.anyOf,t),r):ka(e)?At(UA(e.const,t),r):Q(e,r)}function zA(e,t={}){return Di(e,"Capitalize",t)}d();function HA(e,t={}){return Di(e,"Lowercase",t)}d();function WA(e,t={}){return Di(e,"Uncapitalize",t)}d();function ZA(e,t={}){return Di(e,"Uppercase",t)}d();function qA(e,t){return Q({[Z]:"Not",not:e},t)}d();d();d();function xJ(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=qd(e[o],t,rr(r));return n}function vJ(e,t,r){return xJ(e.properties,t,r)}function XA(e,t,r){let n=vJ(e,t,r);return It(n)}function IJ(e,t){return e.map(r=>X3(r,t))}function SJ(e,t){return e.map(r=>X3(r,t))}function CJ(e,t){let o=e,{[t]:r}=o;return Bn(o,[ob(t)])}function TJ(e,t){return t.reduce((r,n)=>CJ(r,n),e)}function PJ(e,t){let r=Cr(e,[nr,"$id","required","properties"]),n=TJ(e.properties,t);return Vt(n,r)}function X3(e,t){return Or(e)?co(IJ(e.allOf,t)):_t(e)?Bt(SJ(e.anyOf,t)):$r(e)?PJ(e,t):Vt({})}function qd(e,t,r){if(To(t))return YA(e,t,r);if(or(e))return XA(e,t,r);let n=ki(t)?lo(t):t;return Q(T(T({},X3(e,n)),r))}function wJ(e,t,r){return{[t]:qd(e,[t],rr(r))}}function MJ(e,t,r){return t.reduce((n,o)=>T(T({},n),wJ(e,o,r)),{})}function OJ(e,t,r){return MJ(e,t.keys,r)}function YA(e,t,r){let n=OJ(e,t,r);return It(n)}d();function KA(e,t){return Ts(e.parameters,t)}d();d();function JA(e){return e.map(t=>QA(t))}function EJ(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ao(e[r]);return t}function _J(e){let t=Cr(e,[nr,"$id","required","properties"]),r=EJ(e.properties);return Vt(r,t)}function QA(e){return Or(e)?co(JA(e.allOf)):_t(e)?Bt(JA(e.anyOf)):$r(e)?_J(e):Vt({})}function A0(e,t){return or(e)?eD(e,t):Q(T(T({},QA(e)),t))}function kJ(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=A0(e[n],rr(t));return r}function AJ(e,t){return kJ(e.properties,t)}function eD(e,t){let r=AJ(e,t);return It(r)}d();d();d();function DJ(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Xd(e[o],t,rr(r));return n}function FJ(e,t,r){return DJ(e.properties,t,r)}function tD(e,t,r){let n=FJ(e,t,r);return It(n)}function LJ(e,t){return e.map(r=>Y3(r,t))}function RJ(e,t){return e.map(r=>Y3(r,t))}function NJ(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}function BJ(e,t){let r=Cr(e,[nr,"$id","required","properties"]),n=NJ(e.properties,t);return Vt(n,r)}function Y3(e,t){return Or(e)?co(LJ(e.allOf,t)):_t(e)?Bt(RJ(e.anyOf,t)):$r(e)?BJ(e,t):Vt({})}function Xd(e,t,r){if(To(t))return rD(e,t,r);if(or(e))return tD(e,t,r);let n=ki(t)?lo(t):t;return Q(T(T({},Y3(e,n)),r))}function $J(e,t,r){return{[t]:Xd(e,[t],rr(r))}}function jJ(e,t,r){return t.reduce((n,o)=>T(T({},n),$J(e,o,r)),{})}function GJ(e,t,r){return jJ(e,t.keys,r)}function rD(e,t,r){let n=GJ(e,t,r);return It(n)}d();function nD(e){return Zo(ao(e))}d();function gp(e,t,r){return Q({[Z]:"Record",type:"object",patternProperties:{[e]:t}},r)}function K3(e,t,r){let n={};for(let o of e)n[o]=t;return Vt(n,L(T({},r),{[Ho]:"Record"}))}function UJ(e,t,r){return g0(e)?K3(lo(e),t,r):gp(e.pattern,t,r)}function VJ(e,t,r){return K3(lo(Bt(e)),t,r)}function zJ(e,t,r){return K3([e.toString()],t,r)}function HJ(e,t,r){return gp(e.source,t,r)}function WJ(e,t,r){let n=yr(e.pattern)?Da:e.pattern;return gp(n,t,r)}function ZJ(e,t,r){return gp(Da,t,r)}function qJ(e,t,r){return gp(qk,t,r)}function XJ(e,t,r){return gp(Aa,t,r)}function YJ(e,t,r){return gp(Aa,t,r)}function oD(e,t,r={}){return _t(e)?VJ(e.anyOf,t,r):Po(e)?UJ(e,t,r):ka(e)?zJ(e.const,t,r):dp(e)?XJ(e,t,r):fp(e)?YJ(e,t,r):w3(e)?HJ(e,t,r):Gh(e)?WJ(e,t,r):I3(e)?ZJ(e,t,r):Wl(e)?qJ(e,t,r):Nt(r)}d();var KJ=0;function iD(e,t={}){yr(t.$id)&&(t.$id="T".concat(KJ++));let r=Lh(e({[Z]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Q(T({[Ho]:"Recursive"},r),t)}d();function sD(e,t){if(Xt(e))return Q({[Z]:"Ref",$ref:e},t);if(yr(e.$id))throw new Error("Reference target type must specify an $id");return Q({[Z]:"Ref",$ref:e.$id},t)}d();function aD(e,t){let r=Xt(e)?new globalThis.RegExp(e):e;return Q({[Z]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}d();d();function lD(e){return e.map(t=>cD(t))}function JJ(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Cr(e[r],[Un]);return t}function QJ(e){let t=Cr(e,[nr,"$id","required","properties"]),r=JJ(e.properties);return Vt(r,t)}function cD(e){return Or(e)?co(lD(e.allOf)):_t(e)?Bt(lD(e.anyOf)):$r(e)?QJ(e):Vt({})}function D0(e,t){return or(e)?pD(e,t):Q(T(T({},cD(e)),t))}function eQ(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=D0(e[n],t);return r}function tQ(e,t){return eQ(e.properties,t)}function pD(e,t){let r=tQ(e,t);return It(r)}d();function rQ(e){var t;return Or(e)?e.allOf:_t(e)?e.anyOf:_i(e)?(t=e.items)!=null?t:[]:[]}function uD(e){return rQ(e)}d();function dD(e,t){return Q(e.returns,t)}d();function fD(e){return JSON.parse(JSON.stringify(e))}d();var J3=class{constructor(t){this.schema=t}Decode(t){return new Q3(this.schema,t)}},Q3=class{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let i={Encode:s=>r[nr].Encode(t(s)),Decode:s=>this.decode(r[nr].Decode(s))};return L(T({},r),{[nr]:i})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return L(T({},r),{[nr]:n})}Encode(t){return Ld(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function mD(e){return new J3(e)}d();function F0(e={}){var t;return Q({[Z]:(t=e[Z])!=null?t:"Unsafe"},e)}d();function hD(e){return Q({[Z]:"Void",type:"void"},e)}d();var eC={};da(eC,{Any:()=>ql,Array:()=>f0,AsyncIterator:()=>m0,Awaited:()=>hA,BigInt:()=>Ud,Boolean:()=>b0,Capitalize:()=>zA,Composite:()=>bA,Const:()=>xA,Constructor:()=>h0,ConstructorParameters:()=>vA,Date:()=>T0,Deref:()=>Ai,Enum:()=>IA,Exclude:()=>Wd,Extends:()=>Hd,Extract:()=>Zd,Function:()=>Xl,Index:()=>Vd,InstanceType:()=>$A,Integer:()=>jA,Intersect:()=>co,Iterator:()=>I0,KeyOf:()=>C0,Literal:()=>At,Lowercase:()=>HA,Mapped:()=>uA,Never:()=>Nt,Not:()=>qA,Null:()=>P0,Number:()=>Cs,Object:()=>Vt,Omit:()=>qd,Optional:()=>ao,Parameters:()=>KA,Partial:()=>A0,Pick:()=>Xd,Promise:()=>S0,Readonly:()=>Zo,ReadonlyOptional:()=>nD,Record:()=>oD,Recursive:()=>iD,Ref:()=>sD,RegExp:()=>aD,Required:()=>D0,Rest:()=>uD,ReturnType:()=>dD,Strict:()=>fD,String:()=>Wo,Symbol:()=>w0,TemplateLiteral:()=>x0,Transform:()=>mD,Tuple:()=>Ts,Uint8Array:()=>O0,Uncapitalize:()=>WA,Undefined:()=>M0,Union:()=>Bt,Unknown:()=>Ra,Unsafe:()=>F0,Uppercase:()=>ZA,Void:()=>hD});d();var S=eC;var pr=(e,t)=>S.Unsafe(S.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),Mn=pr("g","GeometryId"),St=pr("f","FloorId"),tC=[Mn,St];d();d();var Jh=S.Object({externalId:S.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:S.String({description:"The name of the entity."}),shortName:S.String({description:"A short name for the entity."}),description:S.String({description:"A description of the entity."}),icon:S.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),rC=S.Partial(Jh,{$id:"Details",description:"Additional information about a given entity."}),Fi=S.Object({details:S.Optional(S.Ref(rC))},{$id:"WithDetails"}),bp=e=>{let t=[...e].sort(),r=S.Pick(Jh,e),n=S.Omit(Jh,e);return S.Object({details:S.Intersect([r,S.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},nC=[Jh,rC];d();d();var oC=S.Record(S.String(),S.Unknown(),{$id:"Extra"}),Li=S.Object({extra:S.Optional(S.Ref(oC))}),iC=[oC];d();d();var Yd=S.Object({geometryId:S.Ref(Mn),floorId:S.Ref(St)},{$id:"GeometryAnchor"}),nQ=S.Object({geometryAnchor:S.Ref(Yd)}),xp=(e,t)=>S.Object({geometryAnchors:S.Array(S.Ref(Yd),e)},t),sC=[Yd];d();d();d();d();d();var Kd=S.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),Jd=S.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),vp=S.Tuple([S.Ref(Kd),S.Ref(Jd)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),On=S.Object({type:S.Literal("Point"),coordinates:S.Ref(vp)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),L0=S.Object({type:S.Literal("MultiPoint"),coordinates:S.Array(S.Ref(vp))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),R0=S.Object({type:S.Literal("LineString"),coordinates:S.Array(S.Ref(vp),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),N0=S.Object({type:S.Literal("MultiLineString"),coordinates:S.Array(S.Array(S.Ref(vp),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),yD=S.Array(S.Ref(vp),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),aC=S.Array(S.Ref(yD),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Qd=S.Object({type:S.Literal("Polygon"),coordinates:S.Ref(aC)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),ef=S.Object({type:S.Literal("MultiPolygon"),coordinates:S.Array(S.Ref(aC))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),an=(e,t,r)=>S.Object({type:S.Literal("Feature"),geometry:e,properties:t},r),zn=(e,t,r)=>S.Object({type:S.Literal("FeatureCollection"),features:S.Array(e,r)},t),lC=[Kd,Jd,vp,On,L0,R0,N0,yD,aC,Qd,ef];var gD=S.Intersect([S.Object({id:S.Ref(St),elevation:S.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:S.Optional(S.String({description:"The subtitle of the floor."}))}),Fi],{$id:"FloorProperties"}),bD=an(S.Union([S.Ref(Qd),S.Ref(ef),S.Null()]),S.Ref(gD),{$id:"FloorFeature"}),xD=zn(S.Ref(bD),{$id:"FloorCollection"}),oQ=S.Object({floors:S.Ref(xD)}),vD={name:"core:floors",intoBundle:function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},fromBundle:(e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},schema:oQ,references:[gD,bD,xD]};d();d();d();var B0=class{constructor(t){f(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}}},$0=class{constructor(t){f(this,"_tag","Some");f(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 ID(t(this.value))}mapAsync(t){return t(this.value).then(r=>ID(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:Jl()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?Jl():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return ge(this.value)}okOrElse(t){return ge(this.value)}iter(){return new B0(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?tf([this.value,t.value]):Jl()}zipWith(t,r){return t.isSome()?tf(r(this.value,t.value)):Jl()}get[Symbol.toStringTag](){return"Some"}},j0=class{constructor(){f(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 ve(t)}okOrElse(t){return ve(t())}iter(){return new B0(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}},tf=e=>new $0(e),Jl=()=>new j0,ID=e=>e instanceof $0||e instanceof j0?e:e==null?Jl():tf(e);var G0=class{constructor(t){f(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}}},cC=class{constructor(t){f(this,"_tag","Ok");f(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 tf(this.value)}err(){return Jl()}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 ge(t(this.value))}async mapAsync(t){return t(this.value).then(ge)}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 G0(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"}},pC=class e{constructor(t){f(this,"_tag","Err");f(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 Jl()}err(){return tf(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 G0(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 e(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"}},ge=e=>new cC(e),ve=e=>new pC(e);d();var Ps;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Ps||(Ps={}));var iQ=e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},Ba=e=>{let t=iQ(e);return n=>{let o=t.get(n);return o==null?ve({kind:Ps.UnknownFloorError,properties:{floorId:n}}):ge(o)}};d();d();d();d();var Tr=e=>S.Unsafe(e);d();var gt=e=>Object.keys(e);d();var SD=e=>{if(e.floors==null)return ve({kind:Ps.FloorMissingError,properties:null});if(e.geometry==null)return ve({kind:Ps.GeometryMissingError,properties:null});let t=Ba(e);for(let r of gt(e.geometry)){let n=t(r);if(n.isErr())return n}return ge(!0)};var CD=S.Intersect([S.Object({id:S.Ref(Mn)}),Fi],{$id:"GeometryProperties"}),TD=an(S.Union([S.Ref(On),S.Ref(L0),S.Ref(R0),S.Ref(N0),S.Ref(Qd),S.Ref(ef)]),S.Ref(CD),{$id:"GeometryFeature"}),PD=zn(S.Ref(TD),{$id:"GeometryCollection"}),sQ=S.Object({geometry:Tr(S.Record(St,S.Ref(PD),{additionalProperties:!1}))},{$id:"GeometrySchema"}),aQ=/^geometry\/(.*)\.geojson$/,wD={name:"core:geometry",schema:sQ,intoBundle:function*(e){if(e.geometry!=null)for(let t of gt(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(aQ))==null?void 0:o[1];if(n)return{geometry:{[n]:r(t)}}},references:[CD,TD,PD],integrityCheck:SD};d();d();var Ct=e=>Object.entries(e);var lQ=e=>{var r;let t=new Map;for(let[n,o]of Ct((r=e.geometry)!=null?r:{}))t.set(n,new Map(o==null?void 0:o.features.map(i=>[i.properties.id,i])));return t},Gr=e=>{let t=lQ(e);return(n,o)=>{let i=t.get(n);if(i==null)return ve({kind:Ps.UnknownFloorError,properties:{floorId:n}});let s=i.get(o);return s==null?ve({kind:Ps.UnknownGeometryError,properties:{floorId:n,geometryId:o}}):ge(s)}};d();var uC=S.Object({type:S.Literal("file"),name:S.String({description:"The name of the file."})},{$id:"ManifestFile"}),MD=S.Recursive(e=>S.Object({type:S.Literal("folder"),name:S.String({description:"The name of the folder."}),children:S.Array(S.Union([e,S.Ref(uC)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),OD=S.Object({name:S.String({description:"The name of the map."}),version:S.Literal("3.0.0",{description:"The version of the manifest."}),orgId:S.Optional(S.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:S.Optional(S.String({description:"The identifier of the map that this MVF is for."})),contents:S.Array(S.Union([S.Ref(MD),S.Ref(uC)]),{minItems:1,description:"The contents of the MVF bundle."}),time:S.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:S.Optional(S.Unsafe(S.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:S.Optional(S.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:S.Optional(S.Ref(St,{description:"The default floor ID of the map."})),language:S.Optional(S.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),ED=zn(an(On,S.Ref(OD)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),cQ=S.Object({manifest:S.Ref(ED)}),_D={name:"core:manifest",intoBundle:function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},fromBundle:(e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},schema:cQ,references:[uC,MD,OD,ED]};var Ko=S.Object({geometryId:S.Ref(Mn)},{$id:"WithGeometryId"}),U0=S.Object({geometryIds:S.Array(S.Ref(Mn))},{$id:"WithGeometryIds"}),dC=[Ko,U0];d();d();var kD=(e,t)=>S.Unsafe(S.Transform(S.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),uo=(e,t)=>{let r=kD(e,t),n=[...e,"unknown"],o=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:r,values:n,record:o}};d();d();d();var Qh;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(Qh||(Qh={}));var AD=e=>{var n;if(e.annotations==null)return ge(!0);let t=Gr(e),r=new Set(gt((n=e.annotationSymbols)!=null?n:{}));for(let o of gt(e.annotations)){let i=e.annotations[o];if(i!=null)for(let s of i){if(!r.has(s.symbolKey))return ve({kind:Qh.AnnotationUnknownSymbolError,properties:{annotationId:s.id,symbolKey:s.symbolKey}});let a=t(o,s.geometryId);if(a.isErr())return a;if(a.value.geometry.type!=="Point")return ve({kind:Qh.AnnotationNonPointGeometryError,properties:{annotationId:s.id,floorId:o,geometryId:s.geometryId}})}}return ge(!0)};var DD=pr("a","AnnotationId"),fC=S.Intersect([Ko,S.Object({id:S.Ref(DD,{description:"The unique identifier for the annotation."}),externalId:S.Optional(S.String({description:"The external identifier for the annotation."})),symbolKey:S.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),FD=S.Object({url:S.String({format:"uri",description:"The URL for the symbol."}),name:S.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),pQ=S.Object({annotations:Tr(S.Record(St,S.Array(S.Ref(fC)),{additionalProperties:!1})),annotationSymbols:Tr(S.Record(S.Index(fC,["symbolKey"]),S.Ref(FD)))},{$id:"AnnotationsSchema"}),uQ=/^annotations\/(.*)\.json$/,LD={name:"ext:mvf-annotations",schema:pQ,intoBundle:function*(e){if(e.annotations!=null)for(let t of gt(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},fromBundle:(e,t,r)=>{var o;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(o=e.match(uQ))==null?void 0:o[1];if(n)return{annotations:{[n]:r(t)}}},references:[DD,fC,FD],integrityCheck:AD};d();d();d();d();d();d();d();d();var mC=class extends De{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}},ey=class extends De{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}},V0;(function(e){function t(n,o){if(jr.Has(n))throw new mC(n);return jr.Set(n,o),(i={})=>F0(L(T({},i),{[Z]:n}))}e.Type=t;function r(n,o){if(Vn.Has(n))throw new ey(n);return Vn.Set(n,o),n}e.Format=r})(V0||(V0={}));d();d();d();function dQ(e){switch(e.errorType){case q.ArrayContains:return"Expected array to contain at least one matching value";case q.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case q.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case q.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case q.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case q.ArrayUniqueItems:return"Expected array elements to be unique";case q.Array:return"Expected array";case q.AsyncIterator:return"Expected AsyncIterator";case q.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case q.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case q.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case q.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case q.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case q.BigInt:return"Expected bigint";case q.Boolean:return"Expected boolean";case q.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case q.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case q.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case q.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case q.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case q.Date:return"Expected Date";case q.Function:return"Expected function";case q.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case q.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case q.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case q.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case q.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case q.Integer:return"Expected integer";case q.IntersectUnevaluatedProperties:return"Unexpected property";case q.Intersect:return"Expected all values to match";case q.Iterator:return"Expected Iterator";case q.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case q.Never:return"Never";case q.Not:return"Value should not match";case q.Null:return"Expected null";case q.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case q.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case q.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case q.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case q.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case q.Number:return"Expected number";case q.Object:return"Expected object";case q.ObjectAdditionalProperties:return"Unexpected property";case q.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case q.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case q.ObjectRequiredProperty:return"Expected required property";case q.Promise:return"Expected Promise";case q.RegExp:return"Expected string to match regular expression";case q.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case q.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case q.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case q.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case q.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case q.String:return"Expected string";case q.Symbol:return"Expected symbol";case q.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case q.Tuple:return"Expected tuple";case q.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case q.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case q.Uint8Array:return"Expected Uint8Array";case q.Undefined:return"Expected undefined";case q.Union:return"Expected union value";case q.Void:return"Expected void";case q.Kind:return"Expected kind '".concat(e.schema[Z],"'");default:return"Unknown error type"}}var fQ=dQ;function RD(){return fQ}d();var hC=class extends De{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};function mQ(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new hC(e);return Tt(r,t)}function Jo(e,t){return!mt(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function Tt(e,t){return e[Z]==="This"||e[Z]==="Ref"?mQ(e,t):e}d();var yC=class extends De{constructor(t){super("Unable to hash value"),this.value=t}},wo;(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"})(wo||(wo={}));var rf=BigInt("14695981039346656037"),[hQ,yQ]=[BigInt("1099511628211"),BigInt("18446744073709551616")],gQ=Array.from({length:256}).map((e,t)=>BigInt(t)),ND=new Float64Array(1),BD=new DataView(ND.buffer),$D=new Uint8Array(ND.buffer);function*bQ(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}function xQ(e){En(wo.Array);for(let t of e)nf(t)}function vQ(e){En(wo.Boolean),En(e?1:0)}function IQ(e){En(wo.BigInt),BD.setBigInt64(0,e);for(let t of $D)En(t)}function SQ(e){En(wo.Date),nf(e.getTime())}function CQ(e){En(wo.Null)}function TQ(e){En(wo.Number),BD.setFloat64(0,e);for(let t of $D)En(t)}function PQ(e){En(wo.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())nf(t),nf(e[t])}function wQ(e){En(wo.String);for(let t=0;t<e.length;t++)for(let r of bQ(e.charCodeAt(t)))En(r)}function MQ(e){En(wo.Symbol),nf(e.description)}function OQ(e){En(wo.Uint8Array);for(let t=0;t<e.length;t++)En(e[t])}function EQ(e){return En(wo.Undefined)}function nf(e){if(ze(e))return xQ(e);if(vs(e))return vQ(e);if(on(e))return IQ(e);if(Gn(e))return SQ(e);if(Ma(e))return CQ(e);if(_e(e))return TQ(e);if(Ze(e))return PQ(e);if(mt(e))return wQ(e);if(Oa(e))return MQ(e);if(Fd(e))return OQ(e);if(gr(e))return EQ(e);throw new yC(e)}function En(e){rf=rf^gQ[e],rf=rf*hQ%yQ}function Ql(e){return rf=BigInt("14695981039346656037"),nf(e),rf}d();var gC=class extends De{constructor(t){super("Unknown type"),this.schema=t}};function _Q(e){return e[Z]==="Any"||e[Z]==="Unknown"}function at(e){return e!==void 0}function kQ(e,t,r){return!0}function AQ(e,t,r){if(!ze(r)||at(e.minItems)&&!(r.length>=e.minItems)||at(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>ln(e.items,t,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let s of r){let a=Ql(s);if(i.has(a))return!1;i.add(a)}return!0}())return!1;if(!(at(e.contains)||_e(e.minContains)||_e(e.maxContains)))return!0;let n=at(e.contains)?e.contains:Nt(),o=r.reduce((i,s)=>ln(n,t,s)?i+1:i,0);return!(o===0||_e(e.minContains)&&o<e.minContains||_e(e.maxContains)&&o>e.maxContains)}function DQ(e,t,r){return c0(r)}function FQ(e,t,r){return!(!on(r)||at(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||at(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||at(e.maximum)&&!(r<=e.maximum)||at(e.minimum)&&!(r>=e.minimum)||at(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function LQ(e,t,r){return vs(r)}function RQ(e,t,r){return ln(e.returns,t,r.prototype)}function NQ(e,t,r){return!(!Gn(r)||at(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||at(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||at(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||at(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||at(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function BQ(e,t,r){return Hl(r)}function $Q(e,t,r){return!(!d0(r)||at(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||at(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||at(e.maximum)&&!(r<=e.maximum)||at(e.minimum)&&!(r>=e.minimum)||at(e.multipleOf)&&r%e.multipleOf!==0)}function jQ(e,t,r){let n=e.allOf.every(o=>ln(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(La(e)),i=Object.getOwnPropertyNames(r).every(s=>o.test(s));return n&&i}else if(ht(e.unevaluatedProperties)){let o=new RegExp(La(e)),i=Object.getOwnPropertyNames(r).every(s=>o.test(s)||ln(e.unevaluatedProperties,t,r[s]));return n&&i}else return n}function GQ(e,t,r){return p0(r)}function UQ(e,t,r){return r===e.const}function VQ(e,t,r){return!1}function zQ(e,t,r){return!ln(e.not,t,r)}function HQ(e,t,r){return Ma(r)}function WQ(e,t,r){return!(!Ft.IsNumberLike(r)||at(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||at(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||at(e.minimum)&&!(r>=e.minimum)||at(e.maximum)&&!(r<=e.maximum)||at(e.multipleOf)&&r%e.multipleOf!==0)}function ZQ(e,t,r){if(!Ft.IsObjectLike(r)||at(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||at(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(!ln(i,t,r[o])||(Na(i)||_Q(i))&&!(o in r))return!1}else if(Ft.IsExactOptionalProperty(r,o)&&!ln(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)||ln(e.additionalProperties,t,r[i])):!0}function qQ(e,t,r){return u0(r)}function XQ(e,t,r){if(!Ft.IsRecordLike(r)||at(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||at(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),s=Object.entries(r).every(([p,u])=>i.test(p)?ln(o,t,u):!0),a=typeof e.additionalProperties=="object"?Object.entries(r).every(([p,u])=>i.test(p)?!0:ln(e.additionalProperties,t,u)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(p=>i.test(p)):!0;return s&&a&&l}function YQ(e,t,r){return ln(Tt(e,t),t,r)}function KQ(e,t,r){let n=new RegExp(e.source,e.flags);return at(e.minLength)&&!(r.length>=e.minLength)||at(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}function JQ(e,t,r){return!mt(r)||at(e.minLength)&&!(r.length>=e.minLength)||at(e.maxLength)&&!(r.length<=e.maxLength)||at(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:at(e.format)?Vn.Has(e.format)?Vn.Get(e.format)(r):!1:!0}function QQ(e,t,r){return Oa(r)}function eee(e,t,r){return mt(r)&&new RegExp(e.pattern).test(r)}function tee(e,t,r){return ln(Tt(e,t),t,r)}function ree(e,t,r){if(!ze(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(!ln(e.items[n],t,r[n]))return!1;return!0}function nee(e,t,r){return gr(r)}function oee(e,t,r){return e.anyOf.some(n=>ln(n,t,r))}function iee(e,t,r){return!(!Fd(r)||at(e.maxByteLength)&&!(r.length<=e.maxByteLength)||at(e.minByteLength)&&!(r.length>=e.minByteLength))}function see(e,t,r){return!0}function aee(e,t,r){return Ft.IsVoidLike(r)}function lee(e,t,r){return jr.Has(e[Z])?jr.Get(e[Z])(e,r):!1}function ln(e,t,r){let n=at(e.$id)?[...t,e]:t,o=e;switch(o[Z]){case"Any":return kQ(o,n,r);case"Array":return AQ(o,n,r);case"AsyncIterator":return DQ(o,n,r);case"BigInt":return FQ(o,n,r);case"Boolean":return LQ(o,n,r);case"Constructor":return RQ(o,n,r);case"Date":return NQ(o,n,r);case"Function":return BQ(o,n,r);case"Integer":return $Q(o,n,r);case"Intersect":return jQ(o,n,r);case"Iterator":return GQ(o,n,r);case"Literal":return UQ(o,n,r);case"Never":return VQ(o,n,r);case"Not":return zQ(o,n,r);case"Null":return HQ(o,n,r);case"Number":return WQ(o,n,r);case"Object":return ZQ(o,n,r);case"Promise":return qQ(o,n,r);case"Record":return XQ(o,n,r);case"Ref":return YQ(o,n,r);case"RegExp":return KQ(o,n,r);case"String":return JQ(o,n,r);case"Symbol":return QQ(o,n,r);case"TemplateLiteral":return eee(o,n,r);case"This":return tee(o,n,r);case"Tuple":return ree(o,n,r);case"Undefined":return nee(o,n,r);case"Union":return oee(o,n,r);case"Uint8Array":return iee(o,n,r);case"Unknown":return see(o,n,r);case"Void":return aee(o,n,r);default:if(!jr.Has(o[Z]))throw new gC(o);return lee(o,n,r)}}function tt(...e){return e.length===3?ln(e[0],e[1],e[2]):ln(e[0],[],e[1])}var q;(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"})(q||(q={}));var bC=class extends De{constructor(t){super("Unknown type"),this.schema=t}};function $a(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function lt(e){return e!==void 0}var Qo=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};function me(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:RD()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}function*cee(e,t,r,n){}function*pee(e,t,r,n){if(!ze(n))return yield me(q.Array,e,r,n);lt(e.minItems)&&!(n.length>=e.minItems)&&(yield me(q.ArrayMinItems,e,r,n)),lt(e.maxItems)&&!(n.length<=e.maxItems)&&(yield me(q.ArrayMaxItems,e,r,n));for(let s=0;s<n.length;s++)yield*oe(cn(e.items,t,"".concat(r,"/").concat(s),n[s]));if(e.uniqueItems===!0&&!function(){let s=new Set;for(let a of n){let l=Ql(a);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield me(q.ArrayUniqueItems,e,r,n)),!(lt(e.contains)||lt(e.minContains)||lt(e.maxContains)))return;let o=lt(e.contains)?e.contains:Nt(),i=n.reduce((s,a,l)=>cn(o,t,"".concat(r).concat(l),a).next().done===!0?s+1:s,0);i===0&&(yield me(q.ArrayContains,e,r,n)),_e(e.minContains)&&i<e.minContains&&(yield me(q.ArrayMinContains,e,r,n)),_e(e.maxContains)&&i>e.maxContains&&(yield me(q.ArrayMaxContains,e,r,n))}function*uee(e,t,r,n){c0(n)||(yield me(q.AsyncIterator,e,r,n))}function*dee(e,t,r,n){if(!on(n))return yield me(q.BigInt,e,r,n);lt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield me(q.BigIntExclusiveMaximum,e,r,n)),lt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield me(q.BigIntExclusiveMinimum,e,r,n)),lt(e.maximum)&&!(n<=e.maximum)&&(yield me(q.BigIntMaximum,e,r,n)),lt(e.minimum)&&!(n>=e.minimum)&&(yield me(q.BigIntMinimum,e,r,n)),lt(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield me(q.BigIntMultipleOf,e,r,n))}function*fee(e,t,r,n){vs(n)||(yield me(q.Boolean,e,r,n))}function*mee(e,t,r,n){yield*oe(cn(e.returns,t,r,n.prototype))}function*hee(e,t,r,n){if(!Gn(n))return yield me(q.Date,e,r,n);lt(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield me(q.DateExclusiveMaximumTimestamp,e,r,n)),lt(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield me(q.DateExclusiveMinimumTimestamp,e,r,n)),lt(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield me(q.DateMaximumTimestamp,e,r,n)),lt(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield me(q.DateMinimumTimestamp,e,r,n)),lt(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield me(q.DateMultipleOfTimestamp,e,r,n))}function*yee(e,t,r,n){Hl(n)||(yield me(q.Function,e,r,n))}function*gee(e,t,r,n){if(!d0(n))return yield me(q.Integer,e,r,n);lt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield me(q.IntegerExclusiveMaximum,e,r,n)),lt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield me(q.IntegerExclusiveMinimum,e,r,n)),lt(e.maximum)&&!(n<=e.maximum)&&(yield me(q.IntegerMaximum,e,r,n)),lt(e.minimum)&&!(n>=e.minimum)&&(yield me(q.IntegerMinimum,e,r,n)),lt(e.multipleOf)&&n%e.multipleOf!==0&&(yield me(q.IntegerMultipleOf,e,r,n))}function*bee(e,t,r,n){let o=!1;for(let i of e.allOf)for(let s of cn(i,t,r,n))o=!0,yield s;if(o)return yield me(q.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let i=new RegExp(La(e));for(let s of Object.getOwnPropertyNames(n))i.test(s)||(yield me(q.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(s),n))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(La(e));for(let s of Object.getOwnPropertyNames(n))if(!i.test(s)){let a=cn(e.unevaluatedProperties,t,"".concat(r,"/").concat(s),n[s]).next();a.done||(yield a.value)}}}function*xee(e,t,r,n){p0(n)||(yield me(q.Iterator,e,r,n))}function*vee(e,t,r,n){n!==e.const&&(yield me(q.Literal,e,r,n))}function*Iee(e,t,r,n){yield me(q.Never,e,r,n)}function*See(e,t,r,n){cn(e.not,t,r,n).next().done===!0&&(yield me(q.Not,e,r,n))}function*Cee(e,t,r,n){Ma(n)||(yield me(q.Null,e,r,n))}function*Tee(e,t,r,n){if(!Ft.IsNumberLike(n))return yield me(q.Number,e,r,n);lt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield me(q.NumberExclusiveMaximum,e,r,n)),lt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield me(q.NumberExclusiveMinimum,e,r,n)),lt(e.maximum)&&!(n<=e.maximum)&&(yield me(q.NumberMaximum,e,r,n)),lt(e.minimum)&&!(n>=e.minimum)&&(yield me(q.NumberMinimum,e,r,n)),lt(e.multipleOf)&&n%e.multipleOf!==0&&(yield me(q.NumberMultipleOf,e,r,n))}function*Pee(e,t,r,n){if(!Ft.IsObjectLike(n))return yield me(q.Object,e,r,n);lt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield me(q.ObjectMinProperties,e,r,n)),lt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield me(q.ObjectMaxProperties,e,r,n));let o=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(n);for(let a of o)s.includes(a)||(yield me(q.ObjectRequiredProperty,e.properties[a],"".concat(r,"/").concat($a(a)),void 0));if(e.additionalProperties===!1)for(let a of s)i.includes(a)||(yield me(q.ObjectAdditionalProperties,e,"".concat(r,"/").concat($a(a)),n[a]));if(typeof e.additionalProperties=="object")for(let a of s)i.includes(a)||(yield*oe(cn(e.additionalProperties,t,"".concat(r,"/").concat($a(a)),n[a])));for(let a of i){let l=e.properties[a];e.required&&e.required.includes(a)?(yield*oe(cn(l,t,"".concat(r,"/").concat($a(a)),n[a])),Na(e)&&!(a in n)&&(yield me(q.ObjectRequiredProperty,l,"".concat(r,"/").concat($a(a)),void 0))):Ft.IsExactOptionalProperty(n,a)&&(yield*oe(cn(l,t,"".concat(r,"/").concat($a(a)),n[a])))}}function*wee(e,t,r,n){u0(n)||(yield me(q.Promise,e,r,n))}function*Mee(e,t,r,n){if(!Ft.IsRecordLike(n))return yield me(q.Object,e,r,n);lt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield me(q.ObjectMinProperties,e,r,n)),lt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield me(q.ObjectMaxProperties,e,r,n));let[o,i]=Object.entries(e.patternProperties)[0],s=new RegExp(o);for(let[a,l]of Object.entries(n))s.test(a)&&(yield*oe(cn(i,t,"".concat(r,"/").concat($a(a)),l)));if(typeof e.additionalProperties=="object")for(let[a,l]of Object.entries(n))s.test(a)||(yield*oe(cn(e.additionalProperties,t,"".concat(r,"/").concat($a(a)),l)));if(e.additionalProperties===!1){for(let[a,l]of Object.entries(n))if(!s.test(a))return yield me(q.ObjectAdditionalProperties,e,"".concat(r,"/").concat($a(a)),l)}}function*Oee(e,t,r,n){yield*oe(cn(Tt(e,t),t,r,n))}function*Eee(e,t,r,n){if(!mt(n))return yield me(q.String,e,r,n);if(lt(e.minLength)&&!(n.length>=e.minLength)&&(yield me(q.StringMinLength,e,r,n)),lt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield me(q.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield me(q.RegExp,e,r,n)}function*_ee(e,t,r,n){if(!mt(n))return yield me(q.String,e,r,n);lt(e.minLength)&&!(n.length>=e.minLength)&&(yield me(q.StringMinLength,e,r,n)),lt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield me(q.StringMaxLength,e,r,n)),mt(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield me(q.StringPattern,e,r,n))),mt(e.format)&&(Vn.Has(e.format)?Vn.Get(e.format)(n)||(yield me(q.StringFormat,e,r,n)):yield me(q.StringFormatUnknown,e,r,n))}function*kee(e,t,r,n){Oa(n)||(yield me(q.Symbol,e,r,n))}function*Aee(e,t,r,n){if(!mt(n))return yield me(q.String,e,r,n);new RegExp(e.pattern).test(n)||(yield me(q.StringPattern,e,r,n))}function*Dee(e,t,r,n){yield*oe(cn(Tt(e,t),t,r,n))}function*Fee(e,t,r,n){if(!ze(n))return yield me(q.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield me(q.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield me(q.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*oe(cn(e.items[o],t,"".concat(r,"/").concat(o),n[o]))}function*Lee(e,t,r,n){gr(n)||(yield me(q.Undefined,e,r,n))}function*Ree(e,t,r,n){if(tt(e,t,n))return;let o=e.anyOf.map(i=>new Qo(cn(i,t,r,n)));yield me(q.Union,e,r,n,o)}function*Nee(e,t,r,n){if(!Fd(n))return yield me(q.Uint8Array,e,r,n);lt(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield me(q.Uint8ArrayMaxByteLength,e,r,n)),lt(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield me(q.Uint8ArrayMinByteLength,e,r,n))}function*Bee(e,t,r,n){}function*$ee(e,t,r,n){Ft.IsVoidLike(n)||(yield me(q.Void,e,r,n))}function*jee(e,t,r,n){jr.Get(e[Z])(e,n)||(yield me(q.Kind,e,r,n))}function*cn(e,t,r,n){let o=lt(e.$id)?[...t,e]:t,i=e;switch(i[Z]){case"Any":return yield*oe(cee(i,o,r,n));case"Array":return yield*oe(pee(i,o,r,n));case"AsyncIterator":return yield*oe(uee(i,o,r,n));case"BigInt":return yield*oe(dee(i,o,r,n));case"Boolean":return yield*oe(fee(i,o,r,n));case"Constructor":return yield*oe(mee(i,o,r,n));case"Date":return yield*oe(hee(i,o,r,n));case"Function":return yield*oe(yee(i,o,r,n));case"Integer":return yield*oe(gee(i,o,r,n));case"Intersect":return yield*oe(bee(i,o,r,n));case"Iterator":return yield*oe(xee(i,o,r,n));case"Literal":return yield*oe(vee(i,o,r,n));case"Never":return yield*oe(Iee(i,o,r,n));case"Not":return yield*oe(See(i,o,r,n));case"Null":return yield*oe(Cee(i,o,r,n));case"Number":return yield*oe(Tee(i,o,r,n));case"Object":return yield*oe(Pee(i,o,r,n));case"Promise":return yield*oe(wee(i,o,r,n));case"Record":return yield*oe(Mee(i,o,r,n));case"Ref":return yield*oe(Oee(i,o,r,n));case"RegExp":return yield*oe(Eee(i,o,r,n));case"String":return yield*oe(_ee(i,o,r,n));case"Symbol":return yield*oe(kee(i,o,r,n));case"TemplateLiteral":return yield*oe(Aee(i,o,r,n));case"This":return yield*oe(Dee(i,o,r,n));case"Tuple":return yield*oe(Fee(i,o,r,n));case"Undefined":return yield*oe(Lee(i,o,r,n));case"Union":return yield*oe(Ree(i,o,r,n));case"Uint8Array":return yield*oe(Nee(i,o,r,n));case"Unknown":return yield*oe(Bee(i,o,r,n));case"Void":return yield*oe($ee(i,o,r,n));default:if(!jr.Has(i[Z]))throw new bC(e);return yield*oe(jee(i,o,r,n))}}function ws(...e){let t=e.length===3?cn(e[0],e[1],"",e[2]):cn(e[0],[],"",e[1]);return new Qo(t)}d();var Gee=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},GD=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)},xC,z0,UD,vC=class extends De{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),xC.add(this),z0.set(this,void 0),Gee(this,z0,t,"f"),this.error=r}Errors(){return new Qo(GD(this,xC,"m",UD).call(this))}};z0=new WeakMap,xC=new WeakSet,UD=function*(){this.error&&(yield this.error),yield*oe(GD(this,z0,"f"))};function jD(e,t,r){if(!tt(e,t,r))throw new vC(ws(e,t,r))}function H0(...e){return e.length===3?jD(e[0],e[1],e[2]):jD(e[0],[],e[1])}d();d();d();function Uee(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Pt(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Pt(e[r]);return t}function Vee(e){return e.map(t=>Pt(t))}function zee(e){return e.slice()}function Hee(e){return new Map(Pt([...e.entries()]))}function Wee(e){return new Set(Pt([...e.entries()]))}function Zee(e){return new Date(e.toISOString())}function Pt(e){if(ze(e))return Vee(e);if(Gn(e))return Zee(e);if(zo(e))return zee(e);if(ak(e))return Hee(e);if(lk(e))return Wee(e);if(Ze(e))return Uee(e);if(sn(e))return e;throw new Error("ValueClone: Unable to clone value")}var Mo=class extends De{constructor(t,r){super(r),this.schema=t}};function wt(e){return Hl(e)?e():Pt(e)}function qee(e,t){return Be(e,"default")?wt(e.default):{}}function Xee(e,t){if(e.uniqueItems===!0&&!Be(e,"default"))throw new Mo(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!Be(e,"default"))throw new Mo(e,"Array with the contains constraint requires a default value");return"default"in e?wt(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>Oo(e.items,t)):[]}function Yee(e,t){return Be(e,"default")?wt(e.default):function(){return F4(this,null,function*(){})}()}function Kee(e,t){return Be(e,"default")?wt(e.default):BigInt(0)}function Jee(e,t){return Be(e,"default")?wt(e.default):!1}function Qee(e,t){if(Be(e,"default"))return wt(e.default);{let r=Oo(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{}}}function ete(e,t){return Be(e,"default")?wt(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function tte(e,t){return Be(e,"default")?wt(e.default):()=>Oo(e.returns,t)}function rte(e,t){return Be(e,"default")?wt(e.default):e.minimum!==void 0?e.minimum:0}function nte(e,t){if(Be(e,"default"))return wt(e.default);{let r=e.allOf.reduce((n,o)=>{let i=Oo(o,t);return typeof i=="object"?T(T({},n),i):i},{});if(!tt(e,t,r))throw new Mo(e,"Intersect produced invalid value. Consider using a default value.");return r}}function ote(e,t){return Be(e,"default")?wt(e.default):function*(){}()}function ite(e,t){return Be(e,"default")?wt(e.default):e.const}function ste(e,t){if(Be(e,"default"))return wt(e.default);throw new Mo(e,"Never types cannot be created. Consider using a default value.")}function ate(e,t){if(Be(e,"default"))return wt(e.default);throw new Mo(e,"Not types must have a default value")}function lte(e,t){return Be(e,"default")?wt(e.default):null}function cte(e,t){return Be(e,"default")?wt(e.default):e.minimum!==void 0?e.minimum:0}function pte(e,t){if(Be(e,"default"))return wt(e.default);{let r=new Set(e.required),n={};for(let[o,i]of Object.entries(e.properties))r.has(o)&&(n[o]=Oo(i,t));return n}}function ute(e,t){return Be(e,"default")?wt(e.default):Promise.resolve(Oo(e.item,t))}function dte(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(Be(e,"default"))return wt(e.default);if(r===Da||r===Aa)return{};{let o=r.slice(1,r.length-1).split("|"),i={};for(let s of o)i[s]=Oo(n,t);return i}}function fte(e,t){return Be(e,"default")?wt(e.default):Oo(Tt(e,t),t)}function mte(e,t){if(Be(e,"default"))return wt(e.default);throw new Mo(e,"RegExp types cannot be created. Consider using a default value.")}function hte(e,t){if(e.pattern!==void 0){if(Be(e,"default"))return wt(e.default);throw new Mo(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(Be(e,"default"))return wt(e.default);throw new Mo(e,"String types with formats must specify a default value")}else return Be(e,"default")?wt(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function yte(e,t){return Be(e,"default")?wt(e.default):"value"in e?Symbol.for(e.value):Symbol()}function gte(e,t){if(Be(e,"default"))return wt(e.default);if(!g0(e))throw new Mo(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Gd(e)[0]}function bte(e,t){if(VD++>wte)throw new Mo(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Be(e,"default")?wt(e.default):Oo(Tt(e,t),t)}function xte(e,t){return Be(e,"default")?wt(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>Oo(e.items[n],t))}function vte(e,t){if(Be(e,"default"))return wt(e.default)}function Ite(e,t){if(Be(e,"default"))return wt(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return Oo(e.anyOf[0],t)}function Ste(e,t){return Be(e,"default")?wt(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function Cte(e,t){return Be(e,"default")?wt(e.default):{}}function Tte(e,t){if(Be(e,"default"))return wt(e.default)}function Pte(e,t){if(Be(e,"default"))return wt(e.default);throw new Error("User defined types must specify a default value")}function Oo(e,t){let r=Jo(e,t),n=e;switch(n[Z]){case"Any":return qee(n,r);case"Array":return Xee(n,r);case"AsyncIterator":return Yee(n,r);case"BigInt":return Kee(n,r);case"Boolean":return Jee(n,r);case"Constructor":return Qee(n,r);case"Date":return ete(n,r);case"Function":return tte(n,r);case"Integer":return rte(n,r);case"Intersect":return nte(n,r);case"Iterator":return ote(n,r);case"Literal":return ite(n,r);case"Never":return ste(n,r);case"Not":return ate(n,r);case"Null":return lte(n,r);case"Number":return cte(n,r);case"Object":return pte(n,r);case"Promise":return ute(n,r);case"Record":return dte(n,r);case"Ref":return fte(n,r);case"RegExp":return mte(n,r);case"String":return hte(n,r);case"Symbol":return yte(n,r);case"TemplateLiteral":return gte(n,r);case"This":return bte(n,r);case"Tuple":return xte(n,r);case"Undefined":return vte(n,r);case"Union":return Ite(n,r);case"Uint8Array":return Ste(n,r);case"Unknown":return Cte(n,r);case"Void":return Tte(n,r);default:if(!jr.Has(n[Z]))throw new Mo(n,"Unknown type");return Pte(n,r)}}var wte=512,VD=0;function ei(...e){return VD=0,e.length===2?Oo(e[0],e[1]):Oo(e[0],[])}var W0=class extends De{constructor(t,r){super(r),this.schema=t}};function Mte(e,t,r){if(e[Z]==="Object"&&typeof r=="object"&&!Ma(r)){let n=e,o=Object.getOwnPropertyNames(r),i=Object.entries(n.properties),[s,a]=[1/i.length,i.length];return i.reduce((l,[p,u])=>{let m=u[Z]==="Literal"&&u.const===r[p]?a:0,h=tt(u,t,r[p])?s:0,g=o.includes(p)?s:0;return l+(m+h+g)},0)}else return tt(e,t,r)?1:0}function Ote(e,t,r){let n=e.anyOf.map(s=>Tt(s,t)),[o,i]=[n[0],0];for(let s of n){let a=Mte(s,t,r);a>i&&(o=s,i=a)}return o}function Ete(e,t,r){if("default"in e)return typeof r=="function"?e.default:Pt(e.default);{let n=Ote(e,t,r);return IC(n,t,r)}}function _te(e,t,r){return tt(e,t,r)?Pt(r):ei(e,t)}function kte(e,t,r){return tt(e,t,r)?r:ei(e,t)}function Ate(e,t,r){if(tt(e,t,r))return Pt(r);let n=ze(r)?Pt(r):ei(e,t),o=_e(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,s=(_e(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(l=>Ms(e.items,t,l));if(e.uniqueItems!==!0)return s;let a=[...new Set(s)];if(!tt(e,t,a))throw new W0(e,"Array cast produced invalid data due to uniqueItems constraint");return a}function Dte(e,t,r){if(tt(e,t,r))return ei(e,t);let n=new Set(e.returns.required||[]),o=function(){};for(let[i,s]of Object.entries(e.returns.properties))!n.has(i)&&r.prototype[i]===void 0||(o.prototype[i]=Ms(s,t,r.prototype[i]));return o}function Fte(e,t,r){let n=ei(e,t),o=Ze(n)&&Ze(r)?T(T({},n),r):r;return tt(e,t,o)?o:ei(e,t)}function Lte(e,t,r){throw new W0(e,"Never types cannot be cast")}function Rte(e,t,r){if(tt(e,t,r))return r;if(r===null||typeof r!="object")return ei(e,t);let n=new Set(e.required||[]),o={};for(let[i,s]of Object.entries(e.properties))!n.has(i)&&r[i]===void 0||(o[i]=Ms(s,t,r[i]));if(typeof e.additionalProperties=="object"){let i=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(r))i.includes(s)||(o[s]=Ms(e.additionalProperties,t,r[s]))}return o}function Nte(e,t,r){if(tt(e,t,r))return Pt(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return ei(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n],i={};for(let[s,a]of Object.entries(r))i[s]=Ms(o,t,a);return i}function Bte(e,t,r){return Ms(Tt(e,t),t,r)}function $te(e,t,r){return Ms(Tt(e,t),t,r)}function jte(e,t,r){return tt(e,t,r)?Pt(r):ze(r)?e.items===void 0?[]:e.items.map((n,o)=>Ms(n,t,r[o])):ei(e,t)}function Gte(e,t,r){return tt(e,t,r)?Pt(r):Ete(e,t,r)}function Ms(e,t,r){let n=mt(e.$id)?[...t,e]:t,o=e;switch(e[Z]){case"Array":return Ate(o,n,r);case"Constructor":return Dte(o,n,r);case"Intersect":return Fte(o,n,r);case"Never":return Lte(o,n,r);case"Object":return Rte(o,n,r);case"Record":return Nte(o,n,r);case"Ref":return Bte(o,n,r);case"This":return $te(o,n,r);case"Tuple":return jte(o,n,r);case"Union":return Gte(o,n,r);case"Date":case"Symbol":case"Uint8Array":return _te(e,t,r);default:return kte(o,n,r)}}function IC(...e){return e.length===3?Ms(e[0],e[1],e[2]):Ms(e[0],[],e[1])}d();function Ute(e){return Zl(e)&&e[Z]!=="Unsafe"}function Vte(e,t,r){return ze(r)?r.map(n=>Eo(e.items,t,n)):r}function zte(e,t,r){let n=e.unevaluatedProperties,i=e.allOf.map(a=>Eo(a,t,Pt(r))).reduce((a,l)=>Ze(l)?T(T({},a),l):l,{});if(!Ze(r)||!Ze(i)||!Zl(n))return i;let s=Yr(e);for(let a of Object.getOwnPropertyNames(r))s.includes(a)||tt(n,t,r[a])&&(i[a]=Eo(n,t,r[a]));return i}function Hte(e,t,r){if(!Ze(r)||ze(r))return r;let n=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Be(e.properties,o)){r[o]=Eo(e.properties[o],t,r[o]);continue}if(Zl(n)&&tt(n,t,r[o])){r[o]=Eo(n,t,r[o]);continue}delete r[o]}return r}function Wte(e,t,r){if(!Ze(r))return r;let n=e.additionalProperties,o=Object.getOwnPropertyNames(r),[i,s]=Object.entries(e.patternProperties)[0],a=new RegExp(i);for(let l of o){if(a.test(l)){r[l]=Eo(s,t,r[l]);continue}if(Zl(n)&&tt(n,t,r[l])){r[l]=Eo(n,t,r[l]);continue}delete r[l]}return r}function Zte(e,t,r){return Eo(Tt(e,t),t,r)}function qte(e,t,r){return Eo(Tt(e,t),t,r)}function Xte(e,t,r){if(!ze(r))return r;if(gr(e.items))return[];let n=Math.min(r.length,e.items.length);for(let o=0;o<n;o++)r[o]=Eo(e.items[o],t,r[o]);return r.length>n?r.slice(0,n):r}function Yte(e,t,r){for(let n of e.anyOf)if(Ute(n)&&tt(n,t,r))return Eo(n,t,r);return r}function Eo(e,t,r){let n=mt(e.$id)?[...t,e]:t,o=e;switch(o[Z]){case"Array":return Vte(o,n,r);case"Intersect":return zte(o,n,r);case"Object":return Hte(o,n,r);case"Record":return Wte(o,n,r);case"Ref":return Zte(o,n,r);case"This":return qte(o,n,r);case"Tuple":return Xte(o,n,r);case"Union":return Yte(o,n,r);default:return r}}function Z0(...e){return e.length===3?Eo(e[0],e[1],e[2]):Eo(e[0],[],e[1])}d();function q0(e){return mt(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function Kte(e){return on(e)||vs(e)||_e(e)}function ty(e){return e===!0||_e(e)&&e===1||on(e)&&e===BigInt("1")||mt(e)&&(e.toLowerCase()==="true"||e==="1")}function ry(e){return e===!1||_e(e)&&(e===0||Object.is(e,-0))||on(e)&&e===BigInt("0")||mt(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function Jte(e){return mt(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}function Qte(e){return mt(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}function ere(e){return mt(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)}function tre(e){return mt(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)}function rre(e){return mt(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}function nre(e,t){let r=HD(e);return r===t?r:e}function ore(e,t){let r=WD(e);return r===t?r:e}function ire(e,t){let r=zD(e);return r===t?r:e}function sre(e,t){return mt(e.const)?nre(t,e.const):_e(e.const)?ore(t,e.const):vs(e.const)?ire(t,e.const):t}function zD(e){return ty(e)?!0:ry(e)?!1:e}function are(e){let t=r=>r.split(".")[0];return q0(e)?BigInt(t(e)):_e(e)?BigInt(Math.trunc(e)):ry(e)?BigInt(0):ty(e)?BigInt(1):e}function HD(e){return Kte(e)?e.toString():Oa(e)&&e.description!==void 0?e.description.toString():e}function WD(e){return q0(e)?parseFloat(e):ty(e)?1:ry(e)?0:e}function lre(e){return q0(e)?parseInt(e):_e(e)?e|0:ty(e)?1:ry(e)?0:e}function cre(e){return mt(e)&&e.toLowerCase()==="null"?null:e}function pre(e){return mt(e)&&e==="undefined"?void 0:e}function ure(e){return Gn(e)?e:_e(e)?new Date(e):ty(e)?new Date(1):ry(e)?new Date(0):q0(e)?new Date(parseInt(e)):Qte(e)?new Date("1970-01-01T".concat(e,".000Z")):Jte(e)?new Date("1970-01-01T".concat(e)):tre(e)?new Date("".concat(e,".000Z")):ere(e)?new Date(e):rre(e)?new Date("".concat(e,"T00:00:00.000Z")):e}function dre(e,t,r){return(ze(r)?r:[r]).map(o=>Os(e.items,t,o))}function fre(e,t,r){return are(r)}function mre(e,t,r){return zD(r)}function hre(e,t,r){return ure(r)}function yre(e,t,r){return lre(r)}function gre(e,t,r){return e.allOf.reduce((n,o)=>Os(o,t,n),r)}function bre(e,t,r){return sre(e,r)}function xre(e,t,r){return cre(r)}function vre(e,t,r){return WD(r)}function Ire(e,t,r){if(!Ze(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))Be(r,n)&&(r[n]=Os(e.properties[n],t,r[n]));return r}function Sre(e,t,r){if(!Ze(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o];for(let[s,a]of Object.entries(r))r[s]=Os(i,t,a);return r}function Cre(e,t,r){return Os(Tt(e,t),t,r)}function Tre(e,t,r){return HD(r)}function Pre(e,t,r){return mt(r)||_e(r)?Symbol(r):r}function wre(e,t,r){return Os(Tt(e,t),t,r)}function Mre(e,t,r){return ze(r)&&!gr(e.items)?r.map((o,i)=>i<e.items.length?Os(e.items[i],t,o):o):r}function Ore(e,t,r){return pre(r)}function Ere(e,t,r){for(let n of e.anyOf){let o=Os(n,t,Pt(r));if(tt(n,t,o))return o}return r}function Os(e,t,r){let n=Jo(e,t),o=e;switch(e[Z]){case"Array":return dre(o,n,r);case"BigInt":return fre(o,n,r);case"Boolean":return mre(o,n,r);case"Date":return hre(o,n,r);case"Integer":return yre(o,n,r);case"Intersect":return gre(o,n,r);case"Literal":return bre(o,n,r);case"Null":return xre(o,n,r);case"Number":return vre(o,n,r);case"Object":return Ire(o,n,r);case"Record":return Sre(o,n,r);case"Ref":return Cre(o,n,r);case"String":return Tre(o,n,r);case"Symbol":return Pre(o,n,r);case"This":return wre(o,n,r);case"Tuple":return Mre(o,n,r);case"Undefined":return Ore(o,n,r);case"Union":return Ere(o,n,r);default:return r}}function X0(...e){return e.length===3?Os(e[0],e[1],e[2]):Os(e[0],[],e[1])}d();d();var of=class extends De{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}},Ip=class extends De{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}};function br(e,t,r){try{return Yt(e)?e[nr].Decode(r):r}catch(n){throw new Ip(e,t,r,n)}}function _re(e,t,r,n){return ze(n)?br(e,r,n.map((o,i)=>Es(e.items,t,"".concat(r,"/").concat(i),o))):br(e,r,n)}function kre(e,t,r,n){if(!Ze(n)||sn(n))return br(e,r,n);let o=Yl(e),i=o.map(u=>u[0]),s=T({},n);for(let[u,m]of o)u in s&&(s[u]=Es(m,t,"".concat(r,"/").concat(u),s[u]));if(!Yt(e.unevaluatedProperties))return br(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p=T({},s);for(let u of a)i.includes(u)||(p[u]=br(l,"".concat(r,"/").concat(u),p[u]));return br(e,r,p)}function Are(e,t,r,n){return br(e,r,Es(e.not,t,r,n))}function Dre(e,t,r,n){if(!Ze(n))return br(e,r,n);let o=Yr(e),i=T({},n);for(let p of o)Be(i,p)&&(gr(i[p])&&(!Rd(e.properties[p])||Ft.IsExactOptionalProperty(i,p))||(i[p]=Es(e.properties[p],t,"".concat(r,"/").concat(p),i[p])));if(!ht(e.additionalProperties))return br(e,r,i);let s=Object.getOwnPropertyNames(i),a=e.additionalProperties,l=T({},i);for(let p of s)o.includes(p)||(l[p]=br(a,"".concat(r,"/").concat(p),l[p]));return br(e,r,l)}function Fre(e,t,r,n){if(!Ze(n))return br(e,r,n);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),s=T({},n);for(let u of Object.getOwnPropertyNames(n))i.test(u)&&(s[u]=Es(e.patternProperties[o],t,"".concat(r,"/").concat(u),s[u]));if(!ht(e.additionalProperties))return br(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,p=T({},s);for(let u of a)i.test(u)||(p[u]=br(l,"".concat(r,"/").concat(u),p[u]));return br(e,r,p)}function Lre(e,t,r,n){let o=Tt(e,t);return br(e,r,Es(o,t,r,n))}function Rre(e,t,r,n){let o=Tt(e,t);return br(e,r,Es(o,t,r,n))}function Nre(e,t,r,n){return ze(n)&&ze(e.items)?br(e,r,e.items.map((o,i)=>Es(o,t,"".concat(r,"/").concat(i),n[i]))):br(e,r,n)}function Bre(e,t,r,n){for(let o of e.anyOf){if(!tt(o,t,n))continue;let i=Es(o,t,r,n);return br(e,r,i)}return br(e,r,n)}function Es(e,t,r,n){let o=Jo(e,t),i=e;switch(e[Z]){case"Array":return _re(i,o,r,n);case"Intersect":return kre(i,o,r,n);case"Not":return Are(i,o,r,n);case"Object":return Dre(i,o,r,n);case"Record":return Fre(i,o,r,n);case"Ref":return Lre(i,o,r,n);case"Symbol":return br(i,r,n);case"This":return Rre(i,o,r,n);case"Tuple":return Nre(i,o,r,n);case"Union":return Bre(i,o,r,n);default:return br(i,r,n)}}function sf(e,t,r){return Es(e,t,"",r)}d();var af=class extends De{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}},Sp=class extends De{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}};function _n(e,t,r){try{return Yt(e)?e[nr].Encode(r):r}catch(n){throw new Sp(e,t,r,n)}}function $re(e,t,r,n){let o=_n(e,r,n);return ze(o)?o.map((i,s)=>_s(e.items,t,"".concat(r,"/").concat(s),i)):o}function jre(e,t,r,n){let o=_n(e,r,n);if(!Ze(n)||sn(n))return o;let i=Yl(e),s=i.map(m=>m[0]),a=T({},o);for(let[m,h]of i)m in a&&(a[m]=_s(h,t,"".concat(r,"/").concat(m),a[m]));if(!Yt(e.unevaluatedProperties))return a;let l=Object.getOwnPropertyNames(a),p=e.unevaluatedProperties,u=T({},a);for(let m of l)s.includes(m)||(u[m]=_n(p,"".concat(r,"/").concat(m),u[m]));return u}function Gre(e,t,r,n){return _n(e.not,r,_n(e,r,n))}function Ure(e,t,r,n){let o=_n(e,r,n);if(!Ze(o))return o;let i=Yr(e),s=T({},o);for(let u of i)Be(s,u)&&(gr(s[u])&&(!Rd(e.properties[u])||Ft.IsExactOptionalProperty(s,u))||(s[u]=_s(e.properties[u],t,"".concat(r,"/").concat(u),s[u])));if(!ht(e.additionalProperties))return s;let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,p=T({},s);for(let u of a)i.includes(u)||(p[u]=_n(l,"".concat(r,"/").concat(u),p[u]));return p}function Vre(e,t,r,n){let o=_n(e,r,n);if(!Ze(n))return o;let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),a=T({},o);for(let m of Object.getOwnPropertyNames(n))s.test(m)&&(a[m]=_s(e.patternProperties[i],t,"".concat(r,"/").concat(m),a[m]));if(!ht(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),p=e.additionalProperties,u=T({},a);for(let m of l)s.test(m)||(u[m]=_n(p,"".concat(r,"/").concat(m),u[m]));return u}function zre(e,t,r,n){let o=Tt(e,t),i=_s(o,t,r,n);return _n(e,r,i)}function Hre(e,t,r,n){let o=Tt(e,t),i=_s(o,t,r,n);return _n(e,r,i)}function Wre(e,t,r,n){let o=_n(e,r,n);return ze(e.items)?e.items.map((i,s)=>_s(i,t,"".concat(r,"/").concat(s),o[s])):[]}function Zre(e,t,r,n){for(let o of e.anyOf){if(!tt(o,t,n))continue;let i=_s(o,t,r,n);return _n(e,r,i)}for(let o of e.anyOf){let i=_s(o,t,r,n);if(tt(e,t,i))return _n(e,r,i)}return _n(e,r,n)}function _s(e,t,r,n){let o=Jo(e,t),i=e;switch(e[Z]){case"Array":return $re(i,o,r,n);case"Intersect":return jre(i,o,r,n);case"Not":return Gre(i,o,r,n);case"Object":return Ure(i,o,r,n);case"Record":return Vre(i,o,r,n);case"Ref":return zre(i,o,r,n);case"This":return Hre(i,o,r,n);case"Tuple":return Wre(i,o,r,n);case"Union":return Zre(i,o,r,n);default:return _n(i,r,n)}}function Y0(e,t,r){return _s(e,t,"",r)}d();function qre(e,t){return Yt(e)||Kr(e.items,t)}function Xre(e,t){return Yt(e)||Kr(e.items,t)}function Yre(e,t){return Yt(e)||Kr(e.returns,t)||e.parameters.some(r=>Kr(r,t))}function Kre(e,t){return Yt(e)||Kr(e.returns,t)||e.parameters.some(r=>Kr(r,t))}function Jre(e,t){return Yt(e)||Yt(e.unevaluatedProperties)||e.allOf.some(r=>Kr(r,t))}function Qre(e,t){return Yt(e)||Kr(e.items,t)}function ene(e,t){return Yt(e)||Kr(e.not,t)}function tne(e,t){return Yt(e)||Object.values(e.properties).some(r=>Kr(r,t))||ht(e.additionalProperties)&&Kr(e.additionalProperties,t)}function rne(e,t){return Yt(e)||Kr(e.item,t)}function nne(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Yt(e)||Kr(n,t)||ht(e.additionalProperties)&&Yt(e.additionalProperties)}function one(e,t){return Yt(e)?!0:Kr(Tt(e,t),t)}function ine(e,t){return Yt(e)?!0:Kr(Tt(e,t),t)}function sne(e,t){return Yt(e)||!gr(e.items)&&e.items.some(r=>Kr(r,t))}function ane(e,t){return Yt(e)||e.anyOf.some(r=>Kr(r,t))}function Kr(e,t){let r=Jo(e,t),n=e;if(e.$id&&SC.has(e.$id))return!1;switch(e.$id&&SC.add(e.$id),e[Z]){case"Array":return qre(n,r);case"AsyncIterator":return Xre(n,r);case"Constructor":return Yre(n,r);case"Function":return Kre(n,r);case"Intersect":return Jre(n,r);case"Iterator":return Qre(n,r);case"Not":return ene(n,r);case"Object":return tne(n,r);case"Promise":return rne(n,r);case"Record":return nne(n,r);case"Ref":return one(n,r);case"This":return ine(n,r);case"Tuple":return sne(n,r);case"Union":return ane(n,r);default:return Yt(e)}}var SC=new Set;function ks(e,t){return SC.clear(),Kr(e,t)}function ZD(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!tt(t,r,n))throw new of(t,n,ws(t,r,n).First());return ks(t,r)?sf(t,r,n):n}d();function ja(e,t){let r=Be(e,"default")?e.default:void 0,n=Hl(r)?r():Pt(r);return gr(t)?n:Ze(t)&&Ze(n)?Object.assign(n,t):t}function CC(e){return Zl(e)&&"default"in e}function lne(e,t,r){let n=ja(e,r);if(!ze(n))return n;for(let o=0;o<n.length;o++)n[o]=_o(e.items,t,n[o]);return n}function cne(e,t,r){return Gn(r)?r:ja(e,r)}function pne(e,t,r){let n=ja(e,r);return e.allOf.reduce((o,i)=>{let s=_o(i,t,n);return Ze(s)?T(T({},o),s):s},{})}function une(e,t,r){let n=ja(e,r);if(!Ze(n))return n;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let s=_o(e.properties[i],t,n[i]);gr(s)||(n[i]=_o(e.properties[i],t,n[i]))}if(!CC(e.additionalProperties))return n;for(let i of Object.getOwnPropertyNames(n))o.includes(i)||(n[i]=_o(e.additionalProperties,t,n[i]));return n}function dne(e,t,r){let n=ja(e,r);if(!Ze(n))return n;let o=e.additionalProperties,[i,s]=Object.entries(e.patternProperties)[0],a=new RegExp(i);for(let l of Object.getOwnPropertyNames(n))a.test(l)&&CC(s)&&(n[l]=_o(s,t,n[l]));if(!CC(o))return n;for(let l of Object.getOwnPropertyNames(n))a.test(l)||(n[l]=_o(o,t,n[l]));return n}function fne(e,t,r){return _o(Tt(e,t),t,ja(e,r))}function mne(e,t,r){return _o(Tt(e,t),t,r)}function hne(e,t,r){let n=ja(e,r);if(!ze(n)||gr(e.items))return n;let[o,i]=[e.items,Math.max(e.items.length,n.length)];for(let s=0;s<i;s++)s<o.length&&(n[s]=_o(o[s],t,n[s]));return n}function yne(e,t,r){let n=ja(e,r);for(let o of e.anyOf){let i=_o(o,t,Pt(n));if(tt(o,t,i))return i}return n}function _o(e,t,r){let n=Jo(e,t),o=e;switch(o[Z]){case"Array":return lne(o,n,r);case"Date":return cne(o,n,r);case"Intersect":return pne(o,n,r);case"Object":return une(o,n,r);case"Record":return dne(o,n,r);case"Ref":return fne(o,n,r);case"This":return mne(o,n,r);case"Tuple":return hne(o,n,r);case"Union":return yne(o,n,r);default:return ja(o,r)}}function K0(...e){return e.length===3?_o(e[0],e[1],e[2]):_o(e[0],[],e[1])}d();d();var ti={};da(ti,{Delete:()=>bne,Format:()=>ny,Get:()=>vne,Has:()=>xne,Set:()=>gne,ValuePointerRootDeleteError:()=>Q0,ValuePointerRootSetError:()=>J0});d();var J0=class extends De{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}},Q0=class extends De{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function qD(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*ny(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 qD(e.slice(t,r))),t=n+1):r=n;yield qD(e.slice(t))}function gne(e,t,r){if(t==="")throw new J0(e,t,r);let[n,o,i]=[null,e,""];for(let s of ny(t))o[s]===void 0&&(o[s]={}),n=o,o=o[s],i=s;n[i]=r}function bne(e,t){if(t==="")throw new Q0(e,t);let[r,n,o]=[null,e,""];for(let i of ny(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]}function xne(e,t){if(t==="")return!0;let[r,n,o]=[null,e,""];for(let i of ny(t)){if(n[i]===void 0)return!1;r=n,n=n[i],o=i}return Object.getOwnPropertyNames(r).includes(o)}function vne(e,t){if(t==="")return e;let r=e;for(let n of ny(t)){if(r[n]===void 0)return;r=r[n]}return r}d();function Ine(e,t){if(!Ze(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(o=>Cp(e[o],t[o]))}function Sne(e,t){return Gn(t)&&e.getTime()===t.getTime()}function Cne(e,t){return!ze(t)||e.length!==t.length?!1:e.every((r,n)=>Cp(r,t[n]))}function Tne(e,t){return!zo(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>Cp(r,t[n]))}function Pne(e,t){return e===t}function Cp(e,t){if(Gn(e))return Sne(e,t);if(zo(e))return Tne(e,t);if(ze(e))return Cne(e,t);if(Ze(e))return Ine(e,t);if(sn(e))return Pne(e,t);throw new Error("ValueEquals: Unable to compare value")}var wne=Vt({type:At("insert"),path:Wo(),value:Ra()}),Mne=Vt({type:At("update"),path:Wo(),value:Ra()}),One=Vt({type:At("delete"),path:Wo()}),YD=Bt([wne,Mne,One]),ex=class extends De{constructor(t,r){super(r),this.value=t}};function tx(e,t){return{type:"update",path:e,value:t}}function KD(e,t){return{type:"insert",path:e,value:t}}function JD(e){return{type:"delete",path:e}}function XD(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ex(e,"Cannot diff objects with symbols")}function*Ene(e,t,r){if(XD(t),XD(r),!v3(r))return yield tx(e,r);let n=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let i of o)Be(t,i)||(yield KD("".concat(e,"/").concat(i),r[i]));for(let i of n)Be(r,i)&&(Cp(t,r)||(yield*oe(rx("".concat(e,"/").concat(i),t[i],r[i]))));for(let i of n)Be(r,i)||(yield JD("".concat(e,"/").concat(i)))}function*_ne(e,t,r){if(!ze(r))return yield tx(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*oe(rx("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield KD("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield JD("".concat(e,"/").concat(n)))}function*kne(e,t,r){if(!zo(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield tx(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*oe(rx("".concat(e,"/").concat(n),t[n],r[n]))}function*Ane(e,t,r){t!==r&&(yield tx(e,r))}function*rx(e,t,r){if(v3(t))return yield*oe(Ene(e,t,r));if(ze(t))return yield*oe(_ne(e,t,r));if(zo(t))return yield*oe(kne(e,t,r));if(sn(t))return yield*oe(Ane(e,t,r));throw new ex(t,"Unable to diff value")}function QD(e,t){return[...rx("",e,t)]}function Dne(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function Fne(e){return e.length===0}function eF(e,t){if(Dne(t))return Pt(t[0].value);if(Fne(t))return Pt(e);let r=Pt(e);for(let n of t)switch(n.type){case"insert":{ti.Set(r,n.path,n.value);break}case"update":{ti.Set(r,n.path,n.value);break}case"delete":{ti.Delete(r,n.path);break}}return r}d();function tF(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=ks(t,r)?Y0(t,r,n):n;if(!tt(t,r,o))throw new af(t,o,ws(t,r,o).First());return o}d();var nx=class extends De{constructor(t){super(t)}};function Lne(e,t,r,n){if(!Ze(r))ti.Set(e,t,Pt(n));else{let o=Object.getOwnPropertyNames(r),i=Object.getOwnPropertyNames(n);for(let s of o)i.includes(s)||delete r[s];for(let s of i)o.includes(s)||(r[s]=null);for(let s of i)TC(e,"".concat(t,"/").concat(s),r[s],n[s])}}function Rne(e,t,r,n){if(!ze(r))ti.Set(e,t,Pt(n));else{for(let o=0;o<n.length;o++)TC(e,"".concat(t,"/").concat(o),r[o],n[o]);r.splice(n.length)}}function Nne(e,t,r,n){if(zo(r)&&r.length===n.length)for(let o=0;o<r.length;o++)r[o]=n[o];else ti.Set(e,t,Pt(n))}function Bne(e,t,r,n){r!==n&&ti.Set(e,t,n)}function TC(e,t,r,n){if(ze(n))return Rne(e,t,r,n);if(zo(n))return Nne(e,t,r,n);if(Ze(n))return Lne(e,t,r,n);if(sn(n))return Bne(e,t,r,n)}function rF(e){return zo(e)||sn(e)}function $ne(e,t){return Ze(e)&&ze(t)||ze(e)&&Ze(t)}function nF(e,t){if(rF(e)||rF(t))throw new nx("Only object and array types can be mutated at the root level");if($ne(e,t))throw new nx("Cannot assign due type mismatch of assignable values");TC(e,"",e,t)}d();var jne=[(e,t,r)=>Pt(r),(e,t,r)=>K0(e,t,r),(e,t,r)=>Z0(e,t,r),(e,t,r)=>X0(e,t,r),(e,t,r)=>(H0(e,t,r),r),(e,t,r)=>ks(e,t)?sf(e,t,r):r];function oF(e,t,r){return jne.reduce((n,o)=>o(e,t,n),r)}function iF(...e){return e.length===3?oF(e[0],e[1],e[2]):oF(e[0],[],e[1])}d();var Ga={};da(Ga,{Assert:()=>H0,Cast:()=>IC,Check:()=>tt,Clean:()=>Z0,Clone:()=>Pt,Convert:()=>X0,Create:()=>ei,Decode:()=>ZD,Default:()=>K0,Diff:()=>QD,Edit:()=>YD,Encode:()=>tF,Equal:()=>Cp,Errors:()=>ws,Hash:()=>Ql,Mutate:()=>nF,Parse:()=>iF,Patch:()=>eF,ValueErrorIterator:()=>Qo});d();d();var PC=class extends De{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));f(this,"schema");this.schema=r}};function Gne(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new PC(e);return Tp(r,t)}function ox(e,t){return!ft.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function Tp(e,t){return e[Z]==="This"||e[Z]==="Ref"?Gne(e,t):e}d();function Une(e,t,r){let n=e.get(t);if(n!==void 0)return n;let o=ks(t,r);return e.set(t,o),o}function ix(){let e=new WeakMap;return{HasTransform:(t,r)=>Une(e,t,r)}}function xr(e,t,r){try{return N.IsTransform(e)?e[nr].Decode(r):r}catch(n){throw new Ip(e,t,r,n)}}function Vne(e,t,r,n,o){return ft.IsArray(n)?xr(e,r,n.map((i,s)=>As(e.items,t,"".concat(r,"/").concat(s),i,o))):xr(e,r,n)}function zne(e,t,r,n,o){if(!ft.IsObject(n)||sn(n))return xr(e,r,n);let i=Yl(e),s=i.map(m=>m[0]),a=T({},n);for(let[m,h]of i)m in a&&(a[m]=As(h,t,"".concat(r,"/").concat(m),a[m],o));if(!N.IsTransform(e.unevaluatedProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),p=e.unevaluatedProperties,u=T({},a);for(let m of l)s.includes(m)||(u[m]=xr(p,"".concat(r,"/").concat(m),u[m]));return xr(e,r,u)}function Hne(e,t,r,n,o){return xr(e,r,As(e.not,t,r,n,o))}function Wne(e,t,r,n,o){if(!ft.IsObject(n))return xr(e,r,n);let i=Yr(e),s=T({},n);for(let u of i)ft.HasPropertyKey(s,u)&&(ft.IsUndefined(s[u])&&(!N.IsUndefined(e.properties[u])||Ft.IsExactOptionalProperty(s,u))||(s[u]=As(e.properties[u],t,"".concat(r,"/").concat(u),s[u],o)));if(!N.IsSchema(e.additionalProperties))return xr(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,p=T({},s);for(let u of a)i.includes(u)||(p[u]=xr(l,"".concat(r,"/").concat(u),p[u]));return xr(e,r,p)}function Zne(e,t,r,n,o){if(!ft.IsObject(n))return xr(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),a=T({},n);for(let m of Object.getOwnPropertyNames(n))s.test(m)&&(a[m]=As(e.patternProperties[i],t,"".concat(r,"/").concat(m),a[m],o));if(!N.IsSchema(e.additionalProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),p=e.additionalProperties,u=T({},a);for(let m of l)s.test(m)||(u[m]=xr(p,"".concat(r,"/").concat(m),u[m]));return xr(e,r,u)}function qne(e,t,r,n,o){let i=Tp(e,t);return xr(e,r,As(i,t,r,n,o))}function Xne(e,t,r,n,o){let i=Tp(e,t);return xr(e,r,As(i,t,r,n,o))}function Yne(e,t,r,n,o){return ft.IsArray(n)&&ft.IsArray(e.items)?xr(e,r,e.items.map((i,s)=>As(i,t,"".concat(r,"/").concat(s),n[s],o))):xr(e,r,n)}function Kne(e,t,r,n,o){for(let i of e.anyOf){if(!Ga.Check(i,t,n))continue;let s=As(i,t,r,n,o);return xr(e,r,s)}return xr(e,r,n)}function As(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=ox(e,t),s=e;switch(e[Z]){case"Array":return Vne(s,i,r,n,o);case"Intersect":return zne(s,i,r,n,o);case"Not":return Hne(s,i,r,n,o);case"Object":return Wne(s,i,r,n,o);case"Record":return Zne(s,i,r,n,o);case"Ref":return qne(s,i,r,n,o);case"Symbol":return xr(s,r,n);case"This":return Xne(s,i,r,n,o);case"Tuple":return Yne(s,i,r,n,o);case"Union":return Kne(s,i,r,n,o);default:return xr(s,r,n)}}function sF(e,t,r){let n=ix();return As(e,t,"",r,n)}d();function kn(e,t,r){try{return N.IsTransform(e)?e[nr].Encode(r):r}catch(n){throw new Sp(e,t,r,n)}}function Jne(e,t,r,n,o){let i=kn(e,r,n);return ft.IsArray(i)?i.map((s,a)=>Ds(e.items,t,"".concat(r,"/").concat(a),s,o)):i}function Qne(e,t,r,n,o){let i=kn(e,r,n);if(!ft.IsObject(n)||sn(n))return i;let s=Yl(e),a=s.map(h=>h[0]),l=T({},i);for(let[h,g]of s)h in l&&(l[h]=Ds(g,t,"".concat(r,"/").concat(h),l[h],o));if(!N.IsTransform(e.unevaluatedProperties))return l;let p=Object.getOwnPropertyNames(l),u=e.unevaluatedProperties,m=T({},l);for(let h of p)a.includes(h)||(m[h]=kn(u,"".concat(r,"/").concat(h),m[h]));return m}function eoe(e,t,r,n){return kn(e.not,r,kn(e,r,n))}function toe(e,t,r,n,o){let i=kn(e,r,n);if(!ft.IsObject(i))return i;let s=Yr(e),a=T({},i);for(let m of s)ft.HasPropertyKey(a,m)&&(ft.IsUndefined(a[m])&&(!N.IsUndefined(e.properties[m])||Ft.IsExactOptionalProperty(a,m))||(a[m]=Ds(e.properties[m],t,"".concat(r,"/").concat(m),a[m],o)));if(!N.IsSchema(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),p=e.additionalProperties,u=T({},a);for(let m of l)s.includes(m)||(u[m]=kn(p,"".concat(r,"/").concat(m),u[m]));return u}function roe(e,t,r,n,o){let i=kn(e,r,n);if(!ft.IsObject(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(s),l=T({},i);for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(l[h]=Ds(e.patternProperties[s],t,"".concat(r,"/").concat(h),l[h],o));if(!N.IsSchema(e.additionalProperties))return l;let p=Object.getOwnPropertyNames(l),u=e.additionalProperties,m=T({},l);for(let h of p)a.test(h)||(m[h]=kn(u,"".concat(r,"/").concat(h),m[h]));return m}function noe(e,t,r,n,o){let i=Tp(e,t),s=Ds(i,t,r,n,o);return kn(e,r,s)}function ooe(e,t,r,n,o){let i=Tp(e,t),s=Ds(i,t,r,n,o);return kn(e,r,s)}function ioe(e,t,r,n,o){let i=kn(e,r,n);return ft.IsArray(e.items)?e.items.map((s,a)=>Ds(s,t,"".concat(r,"/").concat(a),i[a],o)):[]}function soe(e,t,r,n,o){for(let i of e.anyOf){if(!Ga.Check(i,t,n))continue;let s=Ds(i,t,r,n,o);return kn(e,r,s)}for(let i of e.anyOf){let s=Ds(i,t,r,n,o);if(Ga.Check(e,t,s))return kn(e,r,s)}return kn(e,r,n)}function Ds(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=ox(e,t),s=e;switch(e[Z]){case"Array":return Jne(s,i,r,n,o);case"Intersect":return Qne(s,i,r,n,o);case"Not":return eoe(s,i,r,n);case"Object":return toe(s,i,r,n,o);case"Record":return roe(s,i,r,n,o);case"Ref":return noe(s,i,r,n,o);case"This":return ooe(s,i,r,n,o);case"Tuple":return ioe(s,i,r,n,o);case"Union":return soe(s,i,r,n,o);default:return kn(s,r,n)}}function aF(e,t,r){let n=ix();return Ds(e,t,"",r,n)}d();var wC=class{constructor(t,r,n,o){this.schema=t,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=ks(t,r)}Code(){return this.code}Errors(t){return ws(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new of(this.schema,t,this.Errors(t).First());return this.hasTransform?sf(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?Y0(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new af(this.schema,t,this.Errors(t).First());return r}},Ua;(function(e){function t(i){return i===36}e.DollarSign=t;function r(i){return i===95}e.IsUnderscore=r;function n(i){return i>=65&&i<=90||i>=97&&i<=122}e.IsAlpha=n;function o(i){return i>=48&&i<=57}e.IsNumeric=o})(Ua||(Ua={}));var sx;(function(e){function t(i){return i.length===0?!1:Ua.IsNumeric(i.charCodeAt(0))}function r(i){if(t(i))return!1;for(let s=0;s<i.length;s++){let a=i.charCodeAt(s);if(!(Ua.IsAlpha(a)||Ua.IsNumeric(a)||Ua.DollarSign(a)||Ua.IsUnderscore(a)))return!1}return!0}function n(i){return i.replace(/'/g,"\\'")}function o(i,s){return r(s)?"".concat(i,".").concat(s):"".concat(i,"['").concat(n(s),"']")}e.Encode=o})(sx||(sx={}));var MC;(function(e){function t(r){let n=[];for(let o=0;o<r.length;o++){let i=r.charCodeAt(o);Ua.IsNumeric(i)||Ua.IsAlpha(i)?n.push(r.charAt(o)):n.push("_".concat(i,"_"))}return n.join("").replace(/__/g,"_")}e.Encode=t})(MC||(MC={}));var OC;(function(e){function t(r){return r.replace(/'/g,"\\'")}e.Escape=t})(OC||(OC={}));var EC=class extends De{constructor(t){super("Unknown type"),this.schema=t}},ax=class extends De{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}},Pp;(function(e){function t(s,a,l){return Ft.ExactOptionalPropertyTypes?"('".concat(a,"' in ").concat(s," ? ").concat(l," : true)"):"(".concat(sx.Encode(s,a)," !== undefined ? ").concat(l," : true)")}e.IsExactOptionalProperty=t;function r(s){return Ft.AllowArrayObject?"(typeof ".concat(s," === 'object' && ").concat(s," !== null)"):"(typeof ".concat(s," === 'object' && ").concat(s," !== null && !Array.isArray(").concat(s,"))")}e.IsObjectLike=r;function n(s){return Ft.AllowArrayObject?"(typeof ".concat(s," === 'object' && ").concat(s," !== null && !(").concat(s," instanceof Date) && !(").concat(s," instanceof Uint8Array))"):"(typeof ".concat(s," === 'object' && ").concat(s," !== null && !Array.isArray(").concat(s,") && !(").concat(s," instanceof Date) && !(").concat(s," instanceof Uint8Array))")}e.IsRecordLike=n;function o(s){return Ft.AllowNaN?"typeof ".concat(s," === 'number'"):"Number.isFinite(".concat(s,")")}e.IsNumberLike=o;function i(s){return Ft.AllowNullVoid?"(".concat(s," === undefined || ").concat(s," === null)"):"".concat(s," === undefined")}e.IsVoidLike=i})(Pp||(Pp={}));var lx;(function(e){function t(A){return A[Z]==="Any"||A[Z]==="Unknown"}function*r(A,Y,R){yield"true"}function*n(A,Y,R){yield"Array.isArray(".concat(R,")");let[ce,ae]=[Xe("value","any"),Xe("acc","number")];_e(A.maxItems)&&(yield"".concat(R,".length <= ").concat(A.maxItems)),_e(A.minItems)&&(yield"".concat(R,".length >= ").concat(A.minItems));let le=Re(A.items,Y,"value");if(yield"".concat(R,".every((").concat(ce,") => ").concat(le,")"),ht(A.contains)||_e(A.minContains)||_e(A.maxContains)){let Se=ht(A.contains)?A.contains:Nt(),cr=Re(Se,Y,"value"),Nn=_e(A.minContains)?["(count >= ".concat(A.minContains,")")]:[],tn=_e(A.maxContains)?["(count <= ".concat(A.maxContains,")")]:[],vn="const count = value.reduce((".concat(ae,", ").concat(ce,") => ").concat(cr," ? acc + 1 : acc, 0)"),Xc=["(count > 0)",...Nn,...tn].join(" && ");yield"((".concat(ce,") => { ").concat(vn,"; return ").concat(Xc,"})(").concat(R,")")}if(A.uniqueItems===!0){let cr="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(cr," )(").concat(R,")")}}function*o(A,Y,R){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(R,")")}function*i(A,Y,R){yield"(typeof ".concat(R," === 'bigint')"),on(A.exclusiveMaximum)&&(yield"".concat(R," < BigInt(").concat(A.exclusiveMaximum,")")),on(A.exclusiveMinimum)&&(yield"".concat(R," > BigInt(").concat(A.exclusiveMinimum,")")),on(A.maximum)&&(yield"".concat(R," <= BigInt(").concat(A.maximum,")")),on(A.minimum)&&(yield"".concat(R," >= BigInt(").concat(A.minimum,")")),on(A.multipleOf)&&(yield"(".concat(R," % BigInt(").concat(A.multipleOf,")) === 0"))}function*s(A,Y,R){yield"(typeof ".concat(R," === 'boolean')")}function*a(A,Y,R){yield*oe(Pe(A.returns,Y,"".concat(R,".prototype")))}function*l(A,Y,R){yield"(".concat(R," instanceof Date) && Number.isFinite(").concat(R,".getTime())"),_e(A.exclusiveMaximumTimestamp)&&(yield"".concat(R,".getTime() < ").concat(A.exclusiveMaximumTimestamp)),_e(A.exclusiveMinimumTimestamp)&&(yield"".concat(R,".getTime() > ").concat(A.exclusiveMinimumTimestamp)),_e(A.maximumTimestamp)&&(yield"".concat(R,".getTime() <= ").concat(A.maximumTimestamp)),_e(A.minimumTimestamp)&&(yield"".concat(R,".getTime() >= ").concat(A.minimumTimestamp)),_e(A.multipleOfTimestamp)&&(yield"(".concat(R,".getTime() % ").concat(A.multipleOfTimestamp,") === 0"))}function*p(A,Y,R){yield"(typeof ".concat(R," === 'function')")}function*u(A,Y,R){yield"Number.isInteger(".concat(R,")"),_e(A.exclusiveMaximum)&&(yield"".concat(R," < ").concat(A.exclusiveMaximum)),_e(A.exclusiveMinimum)&&(yield"".concat(R," > ").concat(A.exclusiveMinimum)),_e(A.maximum)&&(yield"".concat(R," <= ").concat(A.maximum)),_e(A.minimum)&&(yield"".concat(R," >= ").concat(A.minimum)),_e(A.multipleOf)&&(yield"(".concat(R," % ").concat(A.multipleOf,") === 0"))}function*m(A,Y,R){let ce=A.allOf.map(ae=>Re(ae,Y,R)).join(" && ");if(A.unevaluatedProperties===!1){let ae=it("".concat(new RegExp(La(A)),";")),le="Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(ae,".test(key))");yield"(".concat(ce," && ").concat(le,")")}else if(ht(A.unevaluatedProperties)){let ae=it("".concat(new RegExp(La(A)),";")),le="Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(ae,".test(key) || ").concat(Re(A.unevaluatedProperties,Y,"".concat(R,"[key]")),")");yield"(".concat(ce," && ").concat(le,")")}else yield"(".concat(ce,")")}function*h(A,Y,R){yield"(typeof value === 'object' && Symbol.iterator in ".concat(R,")")}function*g(A,Y,R){typeof A.const=="number"||typeof A.const=="boolean"?yield"(".concat(R," === ").concat(A.const,")"):yield"(".concat(R," === '").concat(OC.Escape(A.const),"')")}function*v(A,Y,R){yield"false"}function*I(A,Y,R){let ce=Re(A.not,Y,R);yield"(!".concat(ce,")")}function*b(A,Y,R){yield"(".concat(R," === null)")}function*C(A,Y,R){yield Pp.IsNumberLike(R),_e(A.exclusiveMaximum)&&(yield"".concat(R," < ").concat(A.exclusiveMaximum)),_e(A.exclusiveMinimum)&&(yield"".concat(R," > ").concat(A.exclusiveMinimum)),_e(A.maximum)&&(yield"".concat(R," <= ").concat(A.maximum)),_e(A.minimum)&&(yield"".concat(R," >= ").concat(A.minimum)),_e(A.multipleOf)&&(yield"(".concat(R," % ").concat(A.multipleOf,") === 0"))}function*P(A,Y,R){yield Pp.IsObjectLike(R),_e(A.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length >= ").concat(A.minProperties)),_e(A.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length <= ").concat(A.maxProperties));let ce=Object.getOwnPropertyNames(A.properties);for(let ae of ce){let le=sx.Encode(R,ae),Se=A.properties[ae];if(A.required&&A.required.includes(ae))yield*oe(Pe(Se,Y,le)),(Na(Se)||t(Se))&&(yield"('".concat(ae,"' in ").concat(R,")"));else{let cr=Re(Se,Y,le);yield Pp.IsExactOptionalProperty(R,ae,cr)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===ce.length)yield"Object.getOwnPropertyNames(".concat(R,").length === ").concat(ce.length);else{let ae="[".concat(ce.map(le=>"'".concat(le,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(ae,".includes(key))")}if(typeof A.additionalProperties=="object"){let ae=Re(A.additionalProperties,Y,"".concat(R,"[key]")),le="[".concat(ce.map(Se=>"'".concat(Se,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(R,").every(key => ").concat(le,".includes(key) || ").concat(ae,"))")}}function*w(A,Y,R){yield"(typeof value === 'object' && typeof ".concat(R,".then === 'function')")}function*M(A,Y,R){yield Pp.IsRecordLike(R),_e(A.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length >= ").concat(A.minProperties)),_e(A.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(R,").length <= ").concat(A.maxProperties));let[ce,ae]=Object.entries(A.patternProperties)[0],le=it("".concat(new RegExp(ce))),Se=Re(ae,Y,"value"),cr=ht(A.additionalProperties)?Re(A.additionalProperties,Y,R):A.additionalProperties===!1?"false":"true",Nn="(".concat(le,".test(key) ? ").concat(Se," : ").concat(cr,")");yield"(Object.entries(".concat(R,").every(([key, value]) => ").concat(Nn,"))")}function*E(A,Y,R){let ce=Tt(A,Y);if(he.functions.has(A.$ref))return yield"".concat(rt(A.$ref),"(").concat(R,")");yield*oe(Pe(ce,Y,R))}function*B(A,Y,R){let ce=it("".concat(new RegExp(A.source,A.flags),";"));yield"(typeof ".concat(R," === 'string')"),_e(A.maxLength)&&(yield"".concat(R,".length <= ").concat(A.maxLength)),_e(A.minLength)&&(yield"".concat(R,".length >= ").concat(A.minLength)),yield"".concat(ce,".test(").concat(R,")")}function*$(A,Y,R){if(yield"(typeof ".concat(R," === 'string')"),_e(A.maxLength)&&(yield"".concat(R,".length <= ").concat(A.maxLength)),_e(A.minLength)&&(yield"".concat(R,".length >= ").concat(A.minLength)),A.pattern!==void 0){let ce=it("".concat(new RegExp(A.pattern),";"));yield"".concat(ce,".test(").concat(R,")")}A.format!==void 0&&(yield"format('".concat(A.format,"', ").concat(R,")"))}function*D(A,Y,R){yield"(typeof ".concat(R," === 'symbol')")}function*F(A,Y,R){yield"(typeof ".concat(R," === 'string')");let ce=it("".concat(new RegExp(A.pattern),";"));yield"".concat(ce,".test(").concat(R,")")}function*W(A,Y,R){yield"".concat(rt(A.$ref),"(").concat(R,")")}function*G(A,Y,R){if(yield"Array.isArray(".concat(R,")"),A.items===void 0)return yield"".concat(R,".length === 0");yield"(".concat(R,".length === ").concat(A.maxItems,")");for(let ce=0;ce<A.items.length;ce++){let ae=Re(A.items[ce],Y,"".concat(R,"[").concat(ce,"]"));yield"".concat(ae)}}function*U(A,Y,R){yield"".concat(R," === undefined")}function*J(A,Y,R){let ce=A.anyOf.map(ae=>Re(ae,Y,R));yield"(".concat(ce.join(" || "),")")}function*X(A,Y,R){yield"".concat(R," instanceof Uint8Array"),_e(A.maxByteLength)&&(yield"(".concat(R,".length <= ").concat(A.maxByteLength,")")),_e(A.minByteLength)&&(yield"(".concat(R,".length >= ").concat(A.minByteLength,")"))}function*ie(A,Y,R){yield"true"}function*te(A,Y,R){yield Pp.IsVoidLike(R)}function*xe(A,Y,R){let ce=he.instances.size;he.instances.set(ce,A),yield"kind('".concat(A[Z],"', ").concat(ce,", ").concat(R,")")}function*Pe(A,Y,R,ce=!0){let ae=mt(A.$id)?[...Y,A]:Y,le=A;if(ce&&mt(A.$id)){let Se=rt(A.$id);if(he.functions.has(Se))return yield"".concat(Se,"(").concat(R,")");{let cr=We(Se,A,Y,"value",!1);return he.functions.set(Se,cr),yield"".concat(Se,"(").concat(R,")")}}switch(le[Z]){case"Any":return yield*oe(r(le,ae,R));case"Array":return yield*oe(n(le,ae,R));case"AsyncIterator":return yield*oe(o(le,ae,R));case"BigInt":return yield*oe(i(le,ae,R));case"Boolean":return yield*oe(s(le,ae,R));case"Constructor":return yield*oe(a(le,ae,R));case"Date":return yield*oe(l(le,ae,R));case"Function":return yield*oe(p(le,ae,R));case"Integer":return yield*oe(u(le,ae,R));case"Intersect":return yield*oe(m(le,ae,R));case"Iterator":return yield*oe(h(le,ae,R));case"Literal":return yield*oe(g(le,ae,R));case"Never":return yield*oe(v(le,ae,R));case"Not":return yield*oe(I(le,ae,R));case"Null":return yield*oe(b(le,ae,R));case"Number":return yield*oe(C(le,ae,R));case"Object":return yield*oe(P(le,ae,R));case"Promise":return yield*oe(w(le,ae,R));case"Record":return yield*oe(M(le,ae,R));case"Ref":return yield*oe(E(le,ae,R));case"RegExp":return yield*oe(B(le,ae,R));case"String":return yield*oe($(le,ae,R));case"Symbol":return yield*oe(D(le,ae,R));case"TemplateLiteral":return yield*oe(F(le,ae,R));case"This":return yield*oe(W(le,ae,R));case"Tuple":return yield*oe(G(le,ae,R));case"Undefined":return yield*oe(U(le,ae,R));case"Union":return yield*oe(J(le,ae,R));case"Uint8Array":return yield*oe(X(le,ae,R));case"Unknown":return yield*oe(ie(le,ae,R));case"Void":return yield*oe(te(le,ae,R));default:if(!jr.Has(le[Z]))throw new EC(A);return yield*oe(xe(le,ae,R))}}let he={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Re(A,Y,R,ce=!0){return"(".concat([...Pe(A,Y,R,ce)].join(" && "),")")}function rt(A){return"check_".concat(MC.Encode(A))}function it(A){let Y="local_".concat(he.variables.size);return he.variables.set(Y,"const ".concat(Y," = ").concat(A)),Y}function We(A,Y,R,ce,ae=!0){let[le,Se]=["\n",vn=>"".padStart(vn," ")],cr=Xe("value","any"),Nn=ue("boolean"),tn=[...Pe(Y,R,ce,ae)].map(vn=>"".concat(Se(4)).concat(vn)).join(" &&".concat(le));return"function ".concat(A,"(").concat(cr,")").concat(Nn," {").concat(le).concat(Se(2),"return (").concat(le).concat(tn).concat(le).concat(Se(2),")\n}")}function Xe(A,Y){let R=he.language==="typescript"?": ".concat(Y):"";return"".concat(A).concat(R)}function ue(A){return he.language==="typescript"?": ".concat(A):""}function ye(A,Y,R){let ce=We("check",A,Y,"value"),ae=Xe("value","any"),le=ue("boolean"),Se=[...he.functions.values()],cr=[...he.variables.values()],Nn=mt(A.$id)?"return function check(".concat(ae,")").concat(le," {\n return ").concat(rt(A.$id),"(value)\n}"):"return ".concat(ce);return[...cr,...Se,Nn].join("\n")}function fe(...A){let Y={language:"javascript"},[R,ce,ae]=A.length===2&&ze(A[1])?[A[0],A[1],Y]:A.length===2&&!ze(A[1])?[A[0],[],A[1]]:A.length===3?[A[0],A[1],A[2]]:A.length===1?[A[0],[],Y]:[null,[],Y];if(he.language=ae.language,he.variables.clear(),he.functions.clear(),he.instances.clear(),!ht(R))throw new ax(R);for(let le of ce)if(!ht(le))throw new ax(le);return ye(R,ce,ae)}e.Code=fe;function ne(A,Y=[]){let R=fe(A,Y,{language:"javascript"}),ce=globalThis.Function("kind","format","hash",R),ae=new Map(he.instances);function le(tn,vn,Xc){if(!jr.Has(tn)||!ae.has(vn))return!1;let cI=jr.Get(tn),pI=ae.get(vn);return cI(pI,Xc)}function Se(tn,vn){return Vn.Has(tn)?Vn.Get(tn)(vn):!1}function cr(tn){return Ql(tn)}let Nn=ce(le,Se,cr);return new wC(A,Y,Nn,R)}e.Compile=ne})(lx||(lx={}));d();d();var lF={},aoe=function(e,t,r,n,o){var i=new Worker(lF[t]||(lF[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(s){var a=s.data,l=a.$e$;if(l){var p=new Error(l[0]);p.code=l[1],p.stack=l[2],o(p,null)}else o(null,a)},i.postMessage(r,n),i},Kt=Uint8Array,Hn=Uint16Array,sy=Int32Array,uf=new Kt([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]),df=new Kt([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]),oy=new Kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dF=function(e,t){for(var r=new Hn(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new sy(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}},fF=dF(uf,2),RC=fF.b,fx=fF.r;RC[28]=258,fx[258]=28;var mF=dF(df,0),hF=mF.b,kC=mF.r,iy=new Hn(32768);for(Dt=0;Dt<32768;++Dt)Va=(Dt&43690)>>1|(Dt&21845)<<1,Va=(Va&52428)>>2|(Va&13107)<<2,Va=(Va&61680)>>4|(Va&3855)<<4,iy[Dt]=((Va&65280)>>8|(Va&255)<<8)>>1;var Va,Dt,ni=function(e,t,r){for(var n=e.length,o=0,i=new Hn(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new Hn(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new Hn(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var p=o<<4|e[o],u=t-e[o],m=s[e[o]-1]++<<u,h=m|(1<<u)-1;m<=h;++m)a[iy[m]>>l]=p}else for(a=new Hn(n),o=0;o<n;++o)e[o]&&(a[o]=iy[s[e[o]-1]++]>>15-e[o]);return a},za=new Kt(288);for(Dt=0;Dt<144;++Dt)za[Dt]=8;var Dt;for(Dt=144;Dt<256;++Dt)za[Dt]=9;var Dt;for(Dt=256;Dt<280;++Dt)za[Dt]=7;var Dt;for(Dt=280;Dt<288;++Dt)za[Dt]=8;var Dt,pf=new Kt(32);for(Dt=0;Dt<32;++Dt)pf[Dt]=5;var Dt,yF=ni(za,9,0),gF=ni(za,9,1),bF=ni(pf,5,0),xF=ni(pf,5,1),px=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ri=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},ux=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},ay=function(e){return(e+7)/8|0},wp=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Kt(e.subarray(t,r))},gx={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},vF=["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"],Lr=function(e,t,r){var n=new Error(t||vF[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Lr),!r)throw n;return n},IF=function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new Kt(0);var s=!r,a=s||t.i!=2,l=t.i;s&&(r=new Kt(o*3));var p=function(R){var ce=r.length;if(R>ce){var ae=new Kt(Math.max(ce*2,R));ae.set(r),r=ae}},u=t.f||0,m=t.p||0,h=t.b||0,g=t.l,v=t.d,I=t.m,b=t.n,C=o*8;do{if(!g){u=ri(e,m,1);var P=ri(e,m+1,3);if(m+=3,P)if(P==1)g=gF,v=xF,I=9,b=5;else if(P==2){var B=ri(e,m,31)+257,$=ri(e,m+10,15)+4,D=B+ri(e,m+5,31)+1;m+=14;for(var F=new Kt(D),W=new Kt(19),G=0;G<$;++G)W[oy[G]]=ri(e,m+G*3,7);m+=$*3;for(var U=px(W),J=(1<<U)-1,X=ni(W,U,1),G=0;G<D;){var ie=X[ri(e,m,J)];m+=ie&15;var w=ie>>4;if(w<16)F[G++]=w;else{var te=0,xe=0;for(w==16?(xe=3+ri(e,m,3),m+=2,te=F[G-1]):w==17?(xe=3+ri(e,m,7),m+=3):w==18&&(xe=11+ri(e,m,127),m+=7);xe--;)F[G++]=te}}var Pe=F.subarray(0,B),he=F.subarray(B);I=px(Pe),b=px(he),g=ni(Pe,I,1),v=ni(he,b,1)}else Lr(1);else{var w=ay(m)+4,M=e[w-4]|e[w-3]<<8,E=w+M;if(E>o){l&&Lr(0);break}a&&p(h+M),r.set(e.subarray(w,E),h),t.b=h+=M,t.p=m=E*8,t.f=u;continue}if(m>C){l&&Lr(0);break}}a&&p(h+131072);for(var Re=(1<<I)-1,rt=(1<<b)-1,it=m;;it=m){var te=g[ux(e,m)&Re],We=te>>4;if(m+=te&15,m>C){l&&Lr(0);break}if(te||Lr(2),We<256)r[h++]=We;else if(We==256){it=m,g=null;break}else{var Xe=We-254;if(We>264){var G=We-257,ue=uf[G];Xe=ri(e,m,(1<<ue)-1)+RC[G],m+=ue}var ye=v[ux(e,m)&rt],fe=ye>>4;ye||Lr(3),m+=ye&15;var he=hF[fe];if(fe>3){var ue=df[fe];he+=ux(e,m)&(1<<ue)-1,m+=ue}if(m>C){l&&Lr(0);break}a&&p(h+131072);var ne=h+Xe;if(h<he){var A=i-he,Y=Math.min(he,ne);for(A+h<0&&Lr(3);h<Y;++h)r[h]=n[A+h]}for(;h<ne;++h)r[h]=r[h-he]}}t.l=g,t.p=it,t.b=h,t.f=u,g&&(u=1,t.m=I,t.d=v,t.n=b)}while(!u);return h!=r.length&&s?wp(r,0,h):r.subarray(0,h)},Fs=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},lf=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},dx=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:BC,l:0};if(o==1){var s=new Kt(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(E,B){return E.f-B.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],p=0,u=1,m=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[p].f<r[m].f?p++:m++],l=r[p!=u&&r[p].f<r[m].f?p++:m++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var h=i[0].s,n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var g=new Hn(h+1),v=mx(r[u-1],g,0);if(v>t){var n=0,I=0,b=v-t,C=1<<b;for(i.sort(function(B,$){return g[$.s]-g[B.s]||B.f-$.f});n<o;++n){var P=i[n].s;if(g[P]>t)I+=C-(1<<v-g[P]),g[P]=t;else break}for(I>>=b;I>0;){var w=i[n].s;g[w]<t?I-=1<<t-g[w]++-1:++n}for(;n>=0&&I;--n){var M=i[n].s;g[M]==t&&(--g[M],++I)}v=t}return{t:new Kt(g),l:v}},mx=function(e,t,r){return e.s==-1?Math.max(mx(e.l,t,r+1),mx(e.r,t,r+1)):t[e.s]=r},AC=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Hn(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},cf=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},NC=function(e,t,r){var n=r.length,o=ay(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},DC=function(e,t,r,n,o,i,s,a,l,p,u){Fs(t,u++,r),++o[256];for(var m=dx(o,15),h=m.t,g=m.l,v=dx(i,15),I=v.t,b=v.l,C=AC(h),P=C.c,w=C.n,M=AC(I),E=M.c,B=M.n,$=new Hn(19),D=0;D<P.length;++D)++$[P[D]&31];for(var D=0;D<E.length;++D)++$[E[D]&31];for(var F=dx($,7),W=F.t,G=F.l,U=19;U>4&&!W[oy[U-1]];--U);var J=p+5<<3,X=cf(o,za)+cf(i,pf)+s,ie=cf(o,h)+cf(i,I)+s+14+3*U+cf($,W)+2*$[16]+3*$[17]+7*$[18];if(l>=0&&J<=X&&J<=ie)return NC(t,u,e.subarray(l,l+p));var te,xe,Pe,he;if(Fs(t,u,1+(ie<X)),u+=2,ie<X){te=ni(h,g,0),xe=h,Pe=ni(I,b,0),he=I;var Re=ni(W,G,0);Fs(t,u,w-257),Fs(t,u+5,B-1),Fs(t,u+10,U-4),u+=14;for(var D=0;D<U;++D)Fs(t,u+3*D,W[oy[D]]);u+=3*U;for(var rt=[P,E],it=0;it<2;++it)for(var We=rt[it],D=0;D<We.length;++D){var Xe=We[D]&31;Fs(t,u,Re[Xe]),u+=W[Xe],Xe>15&&(Fs(t,u,We[D]>>5&127),u+=We[D]>>12)}}else te=yF,xe=za,Pe=bF,he=pf;for(var D=0;D<a;++D){var ue=n[D];if(ue>255){var Xe=ue>>18&31;lf(t,u,te[Xe+257]),u+=xe[Xe+257],Xe>7&&(Fs(t,u,ue>>23&31),u+=uf[Xe]);var ye=ue&31;lf(t,u,Pe[ye]),u+=he[ye],ye>3&&(lf(t,u,ue>>5&8191),u+=df[ye])}else lf(t,u,te[ue]),u+=xe[ue]}return lf(t,u,te[256]),u+xe[256]},SF=new sy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),BC=new Kt(0),CF=function(e,t,r,n,o,i){var s=i.z||e.length,a=new Kt(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),p=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var m=SF[t-1],h=m>>13,g=m&8191,v=(1<<r)-1,I=i.p||new Hn(32768),b=i.h||new Hn(v+1),C=Math.ceil(r/3),P=2*C,w=function(le){return(e[le]^e[le+1]<<C^e[le+2]<<P)&v},M=new sy(25e3),E=new Hn(288),B=new Hn(32),$=0,D=0,F=i.i||0,W=0,G=i.w||0,U=0;F+2<s;++F){var J=w(F),X=F&32767,ie=b[J];if(I[X]=ie,b[J]=X,G<=F){var te=s-F;if(($>7e3||W>24576)&&(te>423||!p)){u=DC(e,l,0,M,E,B,D,W,U,F-U,u),W=$=D=0,U=F;for(var xe=0;xe<286;++xe)E[xe]=0;for(var xe=0;xe<30;++xe)B[xe]=0}var Pe=2,he=0,Re=g,rt=X-ie&32767;if(te>2&&J==w(F-rt))for(var it=Math.min(h,te)-1,We=Math.min(32767,F),Xe=Math.min(258,te);rt<=We&&--Re&&X!=ie;){if(e[F+Pe]==e[F+Pe-rt]){for(var ue=0;ue<Xe&&e[F+ue]==e[F+ue-rt];++ue);if(ue>Pe){if(Pe=ue,he=rt,ue>it)break;for(var ye=Math.min(rt,ue-2),fe=0,xe=0;xe<ye;++xe){var ne=F-rt+xe&32767,A=I[ne],Y=ne-A&32767;Y>fe&&(fe=Y,ie=ne)}}}X=ie,ie=I[X],rt+=X-ie&32767}if(he){M[W++]=268435456|fx[Pe]<<18|kC[he];var R=fx[Pe]&31,ce=kC[he]&31;D+=uf[R]+df[ce],++E[257+R],++B[ce],G=F+Pe,++$}else M[W++]=e[F],++E[e[F]]}}for(F=Math.max(F,G);F<s;++F)M[W++]=e[F],++E[e[F]];u=DC(e,l,p,M,E,B,D,W,U,F-U,u),p||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=b,i.p=I,i.i=F,i.w=G)}else{for(var F=i.w||0;F<s+p;F+=65535){var ae=F+65535;ae>=s&&(l[u/8|0]=p,ae=s),u=NC(l,u+1,e.subarray(F,ae))}i.i=s}return wp(a,0,n+ay(u)+o)},loe=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}(),coe=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=loe[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var TF=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new Kt(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return CF(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)},$C=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},cF=function(e,t,r){for(var n=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=i[s];if(typeof a=="function"){t+=";"+l+"=";var p=a.toString();if(a.prototype)if(p.indexOf("[native code]")!=-1){var u=p.indexOf(" ",8)+1;t+=p.slice(u,p.indexOf("(",u))}else{t+=p;for(var m in a.prototype)t+=";"+l+".prototype."+m+"="+a.prototype[m].toString()}else t+=p}else r[l]=a}return t},cx=[],poe=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},uoe=function(e,t,r,n){if(!cx[r]){for(var o="",i={},s=e.length-1,a=0;a<s;++a)o=cF(e[a],o,i);cx[r]={c:cF(e[s],o,i),e:i}}var l=$C({},cx[r].e);return aoe(cx[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,poe(l),n)},doe=function(){return[Kt,Hn,sy,uf,df,oy,RC,hF,gF,xF,iy,vF,ni,px,ri,ux,ay,wp,Lr,IF,GC,bx,PF]},foe=function(){return[Kt,Hn,sy,uf,df,oy,fx,kC,yF,za,bF,pf,iy,SF,BC,ni,Fs,lf,dx,mx,AC,cf,NC,DC,ay,wp,CF,TF,jC,bx]};var bx=function(e){return postMessage(e,[e.buffer])},PF=function(e){return e&&{out:e.size&&new Kt(e.size),dictionary:e.dictionary}},wF=function(e,t,r,n,o,i){var s=uoe(r,n,o,function(a,l){s.terminate(),i(a,l)});return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}};var Ls=function(e,t){return e[t]|e[t+1]<<8},Ri=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},_C=function(e,t){return Ri(e,t)+Ri(e,t+4)*4294967296},pn=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function moe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Lr(7),wF(e,t,[foe],function(n){return bx(jC(n.data[0],n.data[1]))},0,r)}function jC(e,t){return TF(e,t||{},0,0)}function hoe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Lr(7),wF(e,t,[doe],function(n){return bx(GC(n.data[0],PF(n.data[1])))},1,r)}function GC(e,t){return IF(e,{i:2},t&&t.out,t&&t.dictionary)}var MF=function(e,t,r,n){for(var o in e){var i=e[o],s=t+o,a=n;Array.isArray(i)&&(a=$C(n,i[1]),i=i[0]),i instanceof Kt?r[s]=[i,a]:(r[s+="/"]=[new Kt(0),a],MF(i,s,r,n))}},pF=typeof TextEncoder<"u"&&new TextEncoder,FC=typeof TextDecoder<"u"&&new TextDecoder,yoe=0;try{FC.decode(BC,{stream:!0}),yoe=1}catch(e){}var goe=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:wp(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)}};function hx(e,t){if(t){for(var r=new Kt(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(pF)return pF.encode(e);for(var o=e.length,i=new Kt(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new Kt(s+8+(o-n<<1));l.set(i),i=l}var p=e.charCodeAt(n);p<128||t?a(p):p<2048?(a(192|p>>6),a(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|e.charCodeAt(++n)&1023,a(240|p>>18),a(128|p>>12&63),a(128|p>>6&63),a(128|p&63)):(a(224|p>>12),a(128|p>>6&63),a(128|p&63))}return wp(i,0,s)}function UC(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(FC)return FC.decode(e);var o=goe(e),i=o.s,r=o.r;return r.length&&Lr(8),i}}var boe=function(e,t){return t+30+Ls(e,t+26)+Ls(e,t+28)},xoe=function(e,t,r){var n=Ls(e,t+28),o=UC(e.subarray(t+46,t+46+n),!(Ls(e,t+8)&2048)),i=t+46+n,s=Ri(e,t+20),a=r&&s==4294967295?voe(e,i):[s,Ri(e,t+24),Ri(e,t+42)],l=a[0],p=a[1],u=a[2];return[Ls(e,t+10),l,p,o,i+Ls(e,t+30)+Ls(e,t+32),u]},voe=function(e,t){for(;Ls(e,t)!=1;t+=4+Ls(e,t+2));return[_C(e,t+12),_C(e,t+4),_C(e,t+20)]},LC=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&Lr(9),t+=n+4}return t},uF=function(e,t,r,n,o,i,s,a){var l=n.length,p=r.extra,u=a&&a.length,m=LC(p);pn(e,t,s!=null?33639248:67324752),t+=4,s!=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 h=new Date(r.mtime==null?Date.now():r.mtime),g=h.getFullYear()-1980;if((g<0||g>119)&&Lr(10),pn(e,t,g<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),t+=4,i!=-1&&(pn(e,t,r.crc),pn(e,t+4,i<0?-i-2:i),pn(e,t+8,r.size)),pn(e,t+12,l),pn(e,t+14,m),t+=16,s!=null&&(pn(e,t,u),pn(e,t+6,r.attrs),pn(e,t+10,s),t+=14),e.set(n,t),t+=l,m)for(var v in p){var I=p[v],b=I.length;pn(e,t,+v),pn(e,t+2,b),e.set(I,t+4),t+=4+b}return u&&(e.set(a,t),t+=u),t},Ioe=function(e,t,r,n,o){pn(e,t,101010256),pn(e,t+8,r),pn(e,t+10,r),pn(e,t+12,n),pn(e,t+16,o)};function OF(e,t,r){r||(r=t,t={}),typeof r!="function"&&Lr(7);var n={};MF(e,"",n,t);var o=Object.keys(n),i=o.length,s=0,a=0,l=i,p=new Array(i),u=[],m=function(){for(var b=0;b<u.length;++b)u[b]()},h=function(b,C){yx(function(){r(b,C)})};yx(function(){h=r});var g=function(){var b=new Kt(a+22),C=s,P=a-s;a=0;for(var w=0;w<l;++w){var M=p[w];try{var E=M.c.length;uF(b,a,M,M.f,M.u,E);var B=30+M.f.length+LC(M.extra),$=a+B;b.set(M.c,$),uF(b,s,M,M.f,M.u,E,a,M.m),s+=16+B+(M.m?M.m.length:0),a=$+E}catch(D){return h(D,null)}}Ioe(b,s,p.length,P,C),h(null,b)};i||g();for(var v=function(b){var C=o[b],P=n[C],w=P[0],M=P[1],E=coe(),B=w.length;E.p(w);var $=hx(C),D=$.length,F=M.comment,W=F&&hx(F),G=W&&W.length,U=LC(M.extra),J=M.level==0?0:8,X=function(ie,te){if(ie)m(),h(ie,null);else{var xe=te.length;p[b]=$C(M,{size:B,crc:E.d(),c:te,f:$,m:W,u:D!=C.length||W&&F.length!=G,compression:J}),s+=30+D+U+xe,a+=76+2*(D+U)+(G||0)+xe,--i||g()}};if(D>65535&&X(Lr(11,0,1),null),!J)X(null,w);else if(B<16e4)try{X(null,jC(w,M))}catch(ie){X(ie,null)}else u.push(moe(w,M,X))},I=0;I<l;++I)v(I);return m}var yx=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function EF(e,t,r){r||(r=t,t={}),typeof r!="function"&&Lr(7);var n=[],o=function(){for(var b=0;b<n.length;++b)n[b]()},i={},s=function(b,C){yx(function(){r(b,C)})};yx(function(){s=r});for(var a=e.length-22;Ri(e,a)!=101010256;--a)if(!a||e.length-a>65558)return s(Lr(13,0,1),null),o;var l=Ls(e,a+8);if(l){var p=l,u=Ri(e,a+16),m=u==4294967295||p==65535;if(m){var h=Ri(e,a-12);m=Ri(e,h)==101075792,m&&(p=l=Ri(e,h+32),u=Ri(e,h+48))}for(var g=t&&t.filter,v=function(b){var C=xoe(e,u,m),P=C[0],w=C[1],M=C[2],E=C[3],B=C[4],$=C[5],D=boe(e,$);u=B;var F=function(G,U){G?(o(),s(G,null)):(U&&(i[E]=U),--l||s(null,i))};if(!g||g({name:E,size:w,originalSize:M,compression:P}))if(!P)F(null,wp(e,D,D+w));else if(P==8){var W=e.subarray(D,D+w);if(M<524288||w>.8*M)try{F(null,GC(W,{out:new Kt(M)}))}catch(G){F(G,null)}else n.push(hoe(W,{size:M},F))}else F(Lr(14,"unknown compression type "+P,1),null);else F(null,null)},I=0;I<p;++I)v(I)}else s(null,{});return o}d();var Soe=e=>{if(e!=null)return e.trim()===""?void 0:e},Coe=e=>e!=null,xx=(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:xx(o,t,r)}if(N.IsArray(e))return"".concat(xx(e.items,t,r+1),"[]");if(N.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let i="".concat(e.anyOf.map(s=>xx(s,t,r+1)).filter(Coe).join(" | "));return r>0?"(".concat(i,")"):i}return(n=e.$id)!=null?n:""},Toe=(e,t,r)=>{var i;let n=t.message;N.IsUnion(t.schema)&&(n="Expected one of: ".concat(xx(t.schema,r)));let o="#/definitions/".concat(e).concat((i=Soe(t.path))!=null?i:"");return"".concat(o,": ").concat(n)},vx=(e,t,r)=>{let n=t.First();if(n!=null)return Toe(e,n,r)};var ff;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(ff||(ff={}));var mf=class extends Error{constructor(r,n){super(n);f(this,"name");f(this,"kind");this.name="CompressError",this.kind=r}},Poe=e=>new mf(ff.Archive,e.message),woe=e=>{let t=Object.values(gx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},Moe=(e,t,r)=>{var n;return new mf(ff.Validate,(n=vx(e,t,r))!=null?n:"Unknown validate error")},Ooe=e=>new mf(ff.Encode,e.message),Eoe=e=>new mf(ff.Unknown,e instanceof Error?e.message:String(e)),VC=(e,t,r)=>t instanceof Sp?Ooe(t):t instanceof Qo?Moe(e,t,r):woe(t)?Poe(t):Eoe(t);d();var hf;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(hf||(hf={}));var yf=class extends Error{constructor(r,n){super(n);f(this,"name");f(this,"kind");this.name="DecompressError",this.kind=r}},_oe=e=>new yf(hf.Unarchive,e.message),koe=e=>{let t=Object.values(gx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},Aoe=(e,t,r)=>{var n;return new yf(hf.Validate,(n=vx(e,t,r))!=null?n:"Unknown validate error")},Doe=e=>new yf(hf.Decode,e.message),Foe=e=>new yf(hf.Unknown,e instanceof Error?e.message:String(e)),zC=(e,t,r)=>t instanceof Ip?Doe(t):t instanceof Qo?Aoe(e,t,r):koe(t)?_oe(t):Foe(t);d();d();d();var Loe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Roe=[0,31,28,31,30,31,30,31,31,30,31,30,31],Noe=e=>e%4===0&&(e%100!==0||e%400===0),Ix=e=>{let t=Loe.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&&Noe(r)?29:Roe[n])};d();var Boe=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,Sx=e=>{let t=Boe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3],i=t[4],s=t[5]==="-"?-1:1,a=+(t[6]||0),l=+(t[7]||0);if(a>23||l>59||!i)return!1;if(r<=23&&n<=59&&o<60)return!0;let p=n-l*s,u=r-a*s-(p<0?1:0);return(u===23||u===-1)&&(p===59||p===-1)&&o<61};var $oe=/t|\s/i,_F=e=>{let t=e.split($oe);return t.length===2&&Ix(t[0])&&Sx(t[1])};d();var joe=/\/|:/,Goe=/^(?:[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,kF=e=>joe.test(e)&&Goe.test(e);var Uoe=[["date",Ix],["time",Sx],["date-time",_F],["uri",kF]],AF=()=>{for(let[e,t]of Uoe)try{V0.Format(e,t)}catch(r){if(r instanceof ey)continue;throw r}};d();d();d();var DF=e=>e instanceof Error?e:new Error(String(e));var Cx=e=>(...t)=>{try{return ge(e(...t))}catch(r){return ve(DF(r))}};var Voe=Cx((e,t)=>{let r={};for(let n of t)for(let o of n.intoBundle(e))r[o.path]=hx(JSON.stringify(o.contents));return r}),HC=async(e,t,r)=>Voe(e,t).andThenAsync(n=>new Promise(o=>{OF(n,L(T({},r),{consume:!0}),(i,s)=>{o(i?ve(i):ge(s))})}));d();d();function Tx(e,t,r=[]){let n=T({},e);for(let[o,i]of Object.entries(t))if(i!==void 0)if(o in n){let s=o;if(Array.isArray(i)&&i.length>0){let a=zoe(i[0],r);if(a){let l=n[s];if(!Array.isArray(l))throw new Error("Expected array at ".concat(o,", got ").concat(typeof l));let p=new Map(i.map(h=>[FF(h,a),h])),m=l.map(h=>{let g=p.get(FF(h,a));return g?Tx(h,g,r):h});n[s]=m}else n[s]=i}else{let a=n[s];typeof a=="object"&&a!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?n[s]=i:n[s]=Tx(a,i,r):n[o]=i}}else n[o]=i;return n}function zoe(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 s=r(i);if(s)return[o,...s]}return null}return r(e)}function FF(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}var Hoe=e=>e,Woe=e=>JSON.parse(UC(e)),Zoe=(e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,Hoe)!==void 0),qoe=Cx((e,t)=>{let r={};for(let n of Object.keys(e)){let o=e[n];for(let i of t){let s=i.fromBundle(n,o,Woe);if(s){r=Tx(r,s,[]);break}}}return r}),WC=async(e,t)=>new Promise(r=>EF(e,{filter:n=>Zoe(n,t)},(n,o)=>{r(n?ve(n):ge(o))})).then(r=>r.andThen(n=>qoe(n,t)));d();var Xoe=e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string",Yoe=e=>{if(e.length<2)return!1;let t=e.filter(Xoe);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},Px=e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&Yoe(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Px(r)])):Array.isArray(e)?e.map(Px):e;d();var wx=e=>typeof e=="object"&&e!=null&&"$ref"in e?L(T({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,wx(r)])):Array.isArray(e)?e.map(wx):e;var gf;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(gf||(gf={}));var Koe=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}}),Joe=(...e)=>{let t=new Map;for(let r of Koe(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return ve({kind:gf.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 ge(t)},oi,Mp,Ha,Ni,ZC=class ZC{constructor(t,r,n,o){O(this,oi);O(this,Mp);O(this,Ha,[]);O(this,Ni);k(this,oi,t),k(this,Mp,r),k(this,Ha,n),k(this,Ni,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=S.Composite(t.extensions.map(i=>i.schema),{$id:r});if(!N.IsSchema(n))return ve({kind:gf.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let o=Joe(lC.values(),tC.values(),nC.values(),iC.values(),sC.values(),dC.values(),t.extensions.flatMap(i=>{var s;return(s=i.references)!=null?s:[]}).values());if(!o.isOk())return o;try{AF();let i=lx.Compile(n,[...o.value.values()]);return ge(new ZC(n,i,t.extensions,o.value))}catch(i){return i instanceof De?ve({kind:gf.TypeboxError,message:i.message,original:i}):ve({kind:gf.UnknownError,message:"An unknown error occurred while compiling the schema",original:i})}}is(t){return c(this,Mp).Check(t)}parse(t){return c(this,Mp).Check(t)?ge(t):ve(c(this,Mp).Errors(t))}decode(t){try{return ge(sF(c(this,oi),[...c(this,Ni).values()],t))}catch(r){return ve(r)}}encode(t){try{return ge(aF(c(this,oi),[...c(this,Ni).values()],t))}catch(r){return ve(r)}}verify(t){for(let r of c(this,Ha))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return ve(n.error)}return ge(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([c(this,oi),...c(this,Ni).values()])),r=Px(wx({$id:"#/definitions/".concat((n=c(this,oi).$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=>HC(r,c(this,Ha))).then(r=>r.mapErr(n=>{var o;return VC((o=c(this,oi).$id)!=null?o:"CoreMVF",n,[...c(this,Ni).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>HC(r,c(this,Ha))).then(r=>r.mapErr(n=>{var o;return VC((o=c(this,oi).$id)!=null?o:"CoreMVF",n,[...c(this,Ni).values()])}))}async decompress(t){return WC(t,c(this,Ha)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var o;return zC((o=c(this,oi).$id)!=null?o:"CoreMVF",n,[...c(this,Ni).values()])}))}async decompressUnsafe(t){return WC(t,c(this,Ha)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var o;return zC((o=c(this,oi).$id)!=null?o:"CoreMVF",n,[...c(this,Ni).values()])}))}};oi=new WeakMap,Mp=new WeakMap,Ha=new WeakMap,Ni=new WeakMap;var Mx=ZC;var bf,Ox=class{constructor(){O(this,bf,[]);this.extend=this.extend.bind(this)}extend(t){return c(this,bf).push(t),this}extendOptional(t){let r=L(T({},t),{schema:S.Partial(t.schema)});return c(this,bf).push(r),this}build(){return Mx.create(this)}get extensions(){return c(this,bf)}};bf=new WeakMap;var LF=()=>new Ox().extend(vD).extend(wD).extend(_D);var Op=pr("lcat","LocationCategoryId"),qC=S.Intersect([S.Object({id:S.Ref(Op),parent:S.Optional(S.Ref(Op))}),bp(["name"]),Li],{$id:"LocationCategory"}),RF=[Op,qC];d();d();var Ep;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Ep||(Ep={}));var NF=e=>{var o,i,s,a,l,p,u,m,h;if(e.locationCategories==null&&e.locations==null)return ge(!0);let t=new Set((i=(o=e.locationCategories)==null?void 0:o.map(g=>g.id))!=null?i:[]);for(let g of(s=e.locationCategories)!=null?s:[])if(g.parent!=null&&!t.has(g.parent))return ve({kind:Ep.UnknownParentCategoryError,properties:{categoryId:g.id,parentCategoryId:g.parent}});let r=Gr(e);for(let g of(a=e.locations)!=null?a:[]){for(let v of g.categories)if(!t.has(v))return ve({kind:Ep.UnknownCategoryError,properties:{locationId:g.id,categoryId:v}});for(let v of g.geometryAnchors){let I=r(v.floorId,v.geometryId);if(I.isErr())return I}}let n=new Set((p=(l=e.locations)==null?void 0:l.map(g=>g.id))!=null?p:[]);for(let g of(u=e.locationInstances)!=null?u:[]){if(!n.has(g.parentId))return ve({kind:Ep.UnknownParentLocationError,properties:{locationInstanceId:g.id,parentLocationId:g.parentId}});for(let v of(m=g.categories)!=null?m:[])if(!t.has(v))return ve({kind:Ep.UnknownCategoryError,properties:{locationId:g.id,categoryId:v}});for(let v of(h=g.geometryAnchors)!=null?h:[]){let I=r(v.floorId,v.geometryId);if(I.isErr())return I}}return ge(!0)};d();var _p=pr("loc","LocationId"),Ex=pr("loci","LocationInstanceId"),BF=S.Object({name:S.String(),url:S.String({format:"uri"})},{$id:"LocationSocial"}),$F=S.Object({url:S.String({format:"uri"})},{$id:"LocationImage"}),XC=S.Object({label:S.String(),url:S.String({format:"uri"})},{$id:"LocationLink"}),YC=S.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),jF=S.Union([S.Literal("Sunday"),S.Literal("Monday"),S.Literal("Tuesday"),S.Literal("Wednesday"),S.Literal("Thursday"),S.Literal("Friday"),S.Literal("Saturday")],{$id:"OpeningHoursDay"}),Qoe="PublicHolidays",KC=S.Union([jF,S.Literal(Qoe)],{$id:"OpeningHoursDayOrPublicHoliday"}),_x=S.Object({"@type":S.Optional(S.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:S.Optional(S.Ref(YC,{description:"The time the opening hours start"})),closes:S.Optional(S.Ref(YC,{description:"The time the opening hours end"})),dayOfWeek:S.Optional(S.Union([S.Ref(KC),S.Array(S.Ref(KC))],{description:"The days of the week the opening hours apply to"})),validFrom:S.Optional(S.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:S.Optional(S.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),kx=S.Intersect([S.Object({id:S.Ref(_p),categories:S.Array(S.Ref(Op)),logo:S.Optional(S.String({format:"uri"})),phone:S.Optional(S.String()),social:S.Array(S.Ref(BF)),images:S.Array(S.Ref($F)),links:S.Array(S.Ref(XC)),website:S.Optional(S.Ref(XC)),openingHours:S.Optional(S.Array(S.Ref(_x)))}),bp(["name"]),xp(),Li],{$id:"Location"}),JC=S.Intersect([S.Object({id:S.Ref(Ex),parentId:S.Ref(_p)}),S.Partial(S.Omit(kx,["id","parentId"]))],{$id:"LocationInstance"}),Ax=[_p,Ex,BF,$F,XC,YC,jF,KC,_x,kx,JC];var eie=S.Object({locations:S.Array(S.Ref(kx)),locationCategories:S.Array(S.Ref(qC)),locationInstances:S.Optional(S.Array(S.Ref(JC)))},{$id:"LocationsExtensionSchema"}),GF="locations.json",UF="location-categories.json",VF="location-instances.json",zF={name:"ext:locations",schema:eie,intoBundle:function*(e){e.locations!=null&&(yield{path:GF,contents:e.locations}),e.locationCategories!=null&&(yield{path:UF,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:VF,contents:e.locationInstances})},fromBundle:(e,t,r)=>{if(e===GF)return{locations:r(t)};if(e===UF)return{locationCategories:r(t)};if(e===VF)return{locationInstances:r(t)}},references:[...RF,...Ax],integrityCheck:NF};d();d();var Rs;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(Rs||(Rs={}));var HF=e=>{var l,p,u,m,h,g,v,I,b,C,P,w,M,E,B,$,D,F,W,G;if(e.enterprise==null)return ge(!0);let t=e.enterprise,r=new Set((p=(l=e.locationCategories)==null?void 0:l.map(U=>U.id))!=null?p:[]);for(let U of(u=t.categories)!=null?u:[])if(!r.has(U.categoryId))return ve({kind:Rs.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:U.id,locationCategoryId:U.categoryId}});let n=new Set((h=(m=e.locations)==null?void 0:m.map(U=>U.id))!=null?h:[]);for(let U of(g=t.locations)!=null?g:[]){if(!n.has(U.locationId))return ve({kind:Rs.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:U.id,locationId:U.locationId}});for(let J of(v=U.siblingGroups)!=null?v:[])for(let X of(I=J.siblings)!=null?I:[])if(!n.has(X))return ve({kind:Rs.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:U.id,siblingLocationId:X,label:J.label}})}let o=new Set((C=(b=e.enterprise.locations)==null?void 0:b.map(U=>U.id))!=null?C:[]);if(((P=t.venue)==null?void 0:P.topLocations)!=null){for(let U of t.venue.topLocations)if(!o.has(U))return ve({kind:Rs.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:U}})}let i=new Set((M=(w=e.locationInstances)==null?void 0:w.map(U=>U.id))!=null?M:[]);for(let U of(E=t.locationInstances)!=null?E:[]){if(!o.has(U.parentId))return ve({kind:Rs.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:U.id,enterpriseLocationId:U.parentId}});if(!i.has(U.locationInstanceId))return ve({kind:Rs.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:U.id,locationInstanceId:U.locationInstanceId}});for(let J of(B=U.siblingGroups)!=null?B:[])for(let X of($=J.siblings)!=null?$:[])if(!n.has(X))return ve({kind:Rs.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:U.id,siblingLocationId:X,label:J.label}})}let s=Ba(e),a=Gr(e);for(let[U,J]of Ct((D=t.floorText)!=null?D:{})){let X=s(U);if(X.isErr())return X;for(let ie of J.features){if(!("geometryId"in ie.properties))continue;let te=a(U,ie.properties.geometryId);if(te.isErr())return te}}for(let[U,J]of Ct((F=t.textures)!=null?F:{})){let X=s(U);if(X.isErr())return X;for(let ie of J){let te=a(U,ie.geometryId);if(te.isErr())return te}}for(let[U,J]of Ct((W=t.layers)!=null?W:{})){let X=s(U);if(X.isErr())return X;for(let ie of gt(J!=null?J:{})){let te=a(U,ie);if(te.isErr())return te}}for(let[U,J]of Ct((G=t.textAreas)!=null?G:{})){let X=s(U);if(X.isErr())return X;for(let ie of J.features)if("geometryId"in ie.properties){let te=a(U,ie.properties.geometryId);if(te.isErr())return te}}return ge(!0)};d();d();var kp=pr("el","EnterpriseLocationId"),QC=pr("ec","EnterpriseCategoryId"),eT=pr("eli","EnterpriseLocationInstanceId"),tT=pr("ev","EnterpriseVenueId"),rT=pr("eft","EnterpriseFloorTextId"),WF=[kp,QC,eT,tT,rT];var ZF=S.Object({id:S.Ref(QC),categoryId:S.Ref(Op),color:S.Optional(S.String()),sortOrder:S.Number(),iconFromDefaultList:S.Optional(S.Union([S.String(),S.Null()])),picture:S.Optional(S.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),nT=S.Object({categories:S.Optional(S.Array(S.Ref(ZF)))},{$id:"EnterpriseCategoriesSchema"}),qF=[ZF,nT];d();var XF=uo(["left","center","right"]),tie=XF.schema,eLe=XF.values,oT=S.Object({id:S.Ref(rT),text:S.String(),visible:S.Boolean({default:!0}),fontSize:S.Number({default:12,minimum:1}),fontFamily:S.String({default:"Droid Sans"}),color:S.String({default:"black"}),rotation:S.Number({minimum:0,maximum:360}),align:tie},{$id:"FloorTextCommonProperties"}),iT=S.Intersect([S.Ref(oT),Ko],{$id:"AnchoredFloorTextProperties"}),sT=S.Intersect([S.Ref(oT),S.Object({verticalOffset:S.Number()})],{$id:"FloatingFloorTextProperties"}),YF=S.Union([S.Ref(iT),S.Ref(sT)],{$id:"FloorTextProperties"}),KF=an(On,S.Ref(YF),{$id:"FloorTextFeature"}),rie=an(On,S.Ref(iT),{$id:"AnchoredFloorTextFeature"}),nie=an(On,S.Ref(sT),{$id:"FloatingFloorTextFeature"}),JF=zn(S.Ref(KF),{$id:"EnterpriseFloorTextFeatureCollection"}),QF=S.Record(St,S.Ref(JF),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),aT=S.Object({floorText:S.Optional(S.Ref(QF))},{$id:"EnterpriseFloorTextSchema"}),eL=[oT,iT,sT,YF,KF,rie,nie,JF,QF,aT];d();var tL=Tr(S.Record(Mn,S.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),rL=Tr(S.Record(St,S.Ref(tL),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),lT=S.Object({layers:S.Optional(S.Ref(rL))},{$id:"EnterpriseLayersSchema"}),nL=[tL,rL,lT];d();d();d();var cT=uo(["closed-temporarily","new","pop-up","coming-soon","relocated"]),oie=cT.schema,uLe=cT.values,dLe=cT.record,pT=S.Object({type:oie,start:S.Optional(S.String({format:"date",description:"The start date of the state"})),end:S.Optional(S.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),uT=S.Object({label:S.String(),siblings:S.Array(S.Ref(_p))},{$id:"SiblingGroup"}),Dx=S.Object({name:S.String(),code:S.String()},{$id:"Language"}),oL=[pT,uT,Dx];var Fx=S.Object({id:S.Ref(kp),locationId:S.Ref(_p),type:S.String(),sortOrder:S.Number(),tags:S.Optional(S.Array(S.String())),picture:S.Optional(S.String({format:"uri",description:"The picture of the location"})),states:S.Optional(S.Array(S.Ref(pT),{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:S.Optional(S.Array(S.Ref(uT))),gallery:S.Optional(S.Array(S.Object({caption:S.Optional(S.String()),image:S.String({format:"uri"}),embeddedUrl:S.Optional(S.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:S.Optional(S.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:S.Optional(S.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:S.Optional(S.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),dT=S.Object({locations:S.Optional(S.Array(S.Ref(Fx)))},{$id:"EnterpriseLocationsSchema"}),iL=[Fx,dT];var sL=S.Intersect([S.Object({id:S.Ref(eT),parentId:S.Ref(kp),locationInstanceId:S.Ref(Ex)}),S.Partial(S.Omit(Fx,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),fT=S.Object({locationInstances:S.Optional(S.Array(S.Ref(sL)))},{$id:"EnterpriseLocationInstancesSchema"}),aL=[sL,fT];d();var mT=uo(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),lL=mT.schema,kLe=mT.values,ALe=mT.record,hT=S.Object({maxWidth:S.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:S.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:S.Ref(lL),rotation:S.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),cL=S.Intersect([S.Ref(hT),Ko],{$id:"EnterpriseAnchoredTextAreaProperties"}),pL=S.Intersect([S.Ref(hT),S.Object({verticalOffset:S.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),uL=S.Union([cL,pL],{$id:"EnterpriseTextAreaProperties"}),dL=an(S.Ref(On),uL,{$id:"EnterpriseTextAreaFeature"}),fL=zn(S.Ref(dL),{$id:"EnterpriseTextAreaCollection"}),mL=S.Record(St,S.Ref(fL),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),hL=S.Object({textAreas:S.Optional(S.Ref(mL))},{$id:"EnterpriseTextAreasSchema"}),yL=[lL,hT,cL,pL,uL,dL,fL,mL];d();var yT=S.Object({u:S.Number(),v:S.Number()},{$id:"EnterpriseTextureUV"}),gT=uo(["top","side"],{$id:"EnterpriseTextureFace"}),gL=gT.schema,NLe=gT.values,BLe=gT.record,bT=uo(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),bL=bT.schema,$Le=bT.values,jLe=bT.record,xL=S.Tuple([Kd,Jd,Kd,Jd],{$id:"EnterpriseTextureBounds"}),vL=S.Intersect([S.Object({repeat:S.Ref(yT),offset:S.Ref(yT),rotation:S.Number({minimum:0,maximum:360}),path:S.String({format:"uri"}),face:S.Ref(gL),surface:S.Ref(bL),bounds:S.Ref(xL)},{$id:"EnterpriseTextureProperties"}),Ko],{$id:"EnterpriseTexture"}),IL=S.Array(S.Ref(vL),{$id:"EnterpriseTextures"}),SL=S.Record(St,S.Ref(IL),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),xT=S.Object({textures:S.Optional(S.Ref(SL))},{$id:"EnterpriseTexturesSchema"}),CL=[vL,IL,xT,yT,gL,bL,xL,SL];d();var TL=S.Intersect([S.Object({id:S.Ref(tT),slug:S.String(),defaultLanguage:S.Ref(Dx),languages:S.Array(S.Ref(Dx)),countrycode:S.Optional(S.String()),logo:S.Optional(S.String({format:"uri"})),mappedinWebUrl:S.Optional(S.String({format:"uri"})),topLocations:S.Optional(S.Array(S.Ref(kp))),operationHours:S.Optional(S.Array(S.Ref(_x))),coverImage:S.Optional(S.String({format:"uri"}))}),bp(["name"]),Li],{$id:"EnterpriseVenue"}),vT=S.Object({venue:S.Optional(S.Ref(TL))},{$id:"EnterpriseVenueSchema"}),PL=[TL,vT];var ML=S.Intersect([vT,dT,fT,nT,xT,aT,lT,hL],{$id:"EnterpriseProperties"}),wL=S.Object({enterprise:S.Optional(S.Ref(ML))},{$id:"CMSExtensionSchema"}),iie=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,OL={name:"ext:cms",schema:wL,intoBundle:function*(e){var r,n,o,i,s,a;if(e.enterprise==null)return;let t=e.enterprise;for(let l of gt(t))switch(l){case"floorText":for(let p of gt((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 gt((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 gt((s=t.textAreas)!=null?s:{}))yield{path:"enterprise/textAreas/".concat(p,".geojson"),contents:((a=t.textAreas)!=null?a:{})[p]};continue;default:yield{path:"enterprise/".concat(l,".json"),contents:t[l]};continue}},fromBundle:(e,t,r)=>{let n=e.match(iie);if(!n)return;let[,o,i]=n,s=r(t);switch(o){case"floorText":case"textures":case"textAreas":return{enterprise:{[o]:{[i]:s}}};default:return{enterprise:{[i]:s}}}},references:[ML,wL,...PL,...iL,...aL,...qF,...CL,...nL,...eL,...yL,...WF,...oL,...Ax],integrityCheck:HF};d();d();d();d();var Bi;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Bi||(Bi={}));var EL=e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return ge(!0);let r=Object.entries(t).map(([i,s])=>T({key:i},s)).sort((i,s)=>i.index!==s.index?i.index-s.index:i.bit-s.bit),n=0,o=-1;for(let i of r){if(i.bit===o)return ve({kind:Bi.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:"navigationFlags.".concat(i.key)}});if(i.index!=n){if(o!=31)return ve({kind:Bi.NavigationFlagMissingDeclaration,properties:{index:n,bit:o+1,path:"navigationFlags"}});if(i.index!=n+1||i.bit!=0)return ve({kind:Bi.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=i.index,o=0}else{if(i.bit!==o+1)return ve({kind:Bi.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:o+1,path:"navigationFlags"}});o=i.bit}}return ge(!0)};d();function xf(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}d();var _L=2**32-1,ly=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}},vf=(e,t,r)=>{if(t.index==-1&&e.length===0)return ge(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return ve({kind:Bi.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>_L)return ve({kind:Bi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:_L,path:r}});continue}else if(i>t.flag)return ve({kind:Bi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:t.flag,path:r}})}return ge(!0)};var sie=S.Object({index:S.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:S.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),kL=S.Intersect([sie,Fi],{$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.'}),IT={accessible:"accessible",outdoors:"outdoors"},AL=S.Record(S.String(),kL,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),aie=S.Object({navigationFlags:S.Ref(AL)},{$id:"NavigationFlagsSchema"}),Lx=S.Array(S.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),ST=S.Object({flags:S.Ref(Lx)},{$id:"WithFlags"}),Ap=S.Intersect([Yd,ST],{$id:"FlaggedGeometryAnchor"}),lie=S.Object({geometryAnchor:Ap},{$id:"WithFlaggedGeometryAnchor"}),cie=S.Object({geometryAnchors:S.Array(Ap)},{$id:"WithFlaggedGeometryAnchors"}),DL={name:"ext:mvf-navigation-flags",schema:aie,intoBundle:function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},fromBundle:(e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},references:[kL,AL,Lx,Ap,lie,cie],integrityCheck:EL};d();var FL=e=>{if(e.connections==null)return ge(!0);let t=Gr(e),r=ly(e);for(let[n,o]of e.connections.entries()){for(let[i,s]of o.entrances.entries()){let a=t(s.floorId,s.geometryId);if(a.isErr())return a;let l=vf(s.flags,r,"connections[".concat(n,"].entrances[").concat(i,"]"));if(l.isErr())return l}for(let[i,s]of o.exits.entries()){let a=t(s.floorId,s.geometryId);if(a.isErr())return a;let l=vf(s.flags,r,"connections[".concat(n,"].exits[").concat(i,"]"));if(l.isErr())return l}}return ge(!0)};var RL=pr("c","ConnectionId"),{schema:pie,values:URe,record:uie}=uo(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),NL=pie;var CT=uie,BL=S.Intersect([S.Object({id:S.Ref(RL,{description:"The unique identifier for the connection."}),entrances:S.Array(S.Ref(Ap)),exits:S.Array(S.Ref(Ap)),entryCost:S.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:S.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:S.Ref(NL,{description:"The type of connection."})}),Fi,Li],{$id:"ConnectionsProperties"}),$L=S.Array(S.Ref(BL),{$id:"ConnectionsCollection"}),die=S.Object({connections:S.Ref($L)},{$id:"ConnectionsExtensionSchema"}),LL="connections.json",jL={name:"ext:connections",schema:die,intoBundle:function*(e){e.connections!=null&&(yield{path:LL,contents:e.connections})},fromBundle:(e,t,r)=>{if(e===LL)return{connections:r(t)}},references:[BL,$L,NL,RL,Ap,Lx],integrityCheck:FL};d();d();var GL=e=>{if(e.defaultStyle==null)return ge(!0);let t=Gr(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 ge(!0)};var UL=S.Intersect([xp(),Li,S.Object({altitude:S.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:S.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:S.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:S.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:S.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:S.Optional(S.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),VL=S.Record(S.String(),S.Ref(UL),{$id:"DefaultStyleCollection",additionalProperties:!1}),fie=S.Object({defaultStyle:S.Ref(VL)},{$id:"DefaultStyleSchema"}),zL={name:"ext:mvf-default-style",schema:fie,intoBundle:function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},fromBundle:(e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},references:[UL,VL],integrityCheck:GL};d();d();d();d();var Rx;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Rx||(Rx={}));var HL=e=>{if(e.floorStacks==null)return ge(!0);let t=Ba(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 ve({kind:Rx.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return ge(!0)};var Nx=pr("fs","FloorStackId"),ZL=S.Intersect([S.Object({id:S.Ref(Nx,{description:"The unique identifier for the floor stack."}),floors:S.Array(S.Ref(St),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:S.Optional(S.Ref(St,{description:"The default floor for the floor stack."}))}),Fi],{$id:"FloorStacksProperties"}),qL=S.Array(S.Ref(ZL),{$id:"FloorStackCollection"}),mie=S.Object({floorStacks:S.Ref(qL)},{$id:"FloorStackExtensionSchema"}),WL="floor-stacks.json",XL={name:"ext:floor-stacks",schema:mie,intoBundle:function*(e){e.floorStacks!=null&&(yield{path:WL,contents:e.floorStacks})},fromBundle:(e,t,r)=>{if(e===WL)return{floorStacks:r(t)}},references:[Nx,ZL,qL],integrityCheck:HL};d();d();var cy;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(cy||(cy={}));var YL=e=>{if(e.facade==null)return ge(!0);if(e.floorStacks==null)return ve({kind:cy.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Gr(e);for(let[n,o]of Ct(e.facade))if(o!=null){if(!t.has(n))return ve({kind:cy.UnknownFloorStackError,properties:{floorStackId:n}});for(let i of o.geometryAnchors){let s=r(i.floorId,i.geometryId);if(s.isErr())return s}}return ge(!0)};var KL=pr("fc","FacadeId"),JL=S.Intersect([S.Object({id:S.Ref(KL)}),xp({minItems:1})],{$id:"FacadeProperties"}),hie=S.Object({facade:Tr(S.Record(Nx,S.Ref(JL),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),yie=/^facade\/(.*)\.json$/,QL={name:"ext:facade",schema:hie,intoBundle:function*(e){if(e.facade!=null)for(let t of gt(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(yie))==null?void 0:o[1];if(n)return{facade:{[n]:r(t)}}},references:[KL,JL],integrityCheck:YL};d();d();var eR=e=>{if(e.floorImages==null)return ge(!0);let t=Gr(e);for(let[r,n]of Ct(e.floorImages))if(n!=null)for(let o of n.features){if(!("geometryId"in o.properties))continue;let i=o.properties.geometryId,s=t(r,i);if(s.isErr())return s}return ge(!0)};var TT=S.Object({path:S.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:S.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:S.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:S.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),tR=S.Intersect([S.Ref(TT),Ko],{$id:"AnchoredFloorImageProperties"}),rR=S.Intersect([S.Ref(TT),S.Object({verticalOffset:S.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),nR=S.Union([tR,rR],{$id:"FloorImageProperties"}),oR=an(S.Ref(On),nR,{$id:"FloorImageFeature"}),iR=zn(S.Ref(oR),{$id:"FloorImageCollection"}),gie=S.Object({floorImages:Tr(S.Record(St,S.Ref(iR),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),bie=/^floorImages\/(.*)\.geojson$/,sR={name:"ext:floor-images",schema:gie,intoBundle:function*(e){if(e.floorImages!=null)for(let t of gt(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(bie))==null?void 0:o[1];if(n)return{floorImages:{[n]:r(t)}}},references:[TT,tR,rR,nR,oR,iR],integrityCheck:eR};d();d();var aR=e=>{if(e.kinds==null)return ge(!0);let t=Gr(e);for(let[r,n]of Ct(e.kinds))if(n!=null)for(let o of gt(n)){let i=t(r,o);if(i.isErr())return i}return ge(!0)};var{values:JNe,schema:xie,record:QNe}=uo(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),lR=xie;var cR=Tr(S.Record(Mn,S.Ref(lR),{additionalProperties:!1,$id:"GeometryKinds"})),vie=S.Object({kinds:Tr(S.Record(St,S.Ref(cR),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),Iie=/^kinds\/(.*)\.json$/,pR={name:"ext:kinds",schema:vie,intoBundle:function*(e){if(e.kinds!=null)for(let t of gt(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(Iie))==null?void 0:o[1];if(n)return{kinds:{[n]:r(t)}}},references:[lR,cR],integrityCheck:aR};d();d();d();var Bx;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(Bx||(Bx={}));var uR=e=>{if(e.nodes==null)return ge(!0);let t=Gr(e),r=ly(e);for(let[n,o]of Ct(e.nodes)){if(o==null)continue;let i=new Set(o.features.map(s=>s.properties.id));for(let[s,a]of o.features.entries()){for(let l of a.properties.geometryIds){let p=t(n,l);if(p.isErr())return p}for(let[l,p]of a.properties.neighbors.entries()){if(!i.has(p.id))return ve({kind:Bx.UnknownNeighbor,properties:{floorId:n,nodeId:a.properties.id,neighborId:p.id}});let u=vf(p.flags,r,'nodes["'.concat(n,'"].features[').concat(s,"].properties.neighbors[").concat(l,"]"));if(u.isErr())return u}}}return ge(!0)};var PT=pr("n","NodeId"),dR=S.Intersect([S.Object({id:S.Ref(PT,{description:"The unique identifier for the node."}),extraCost:S.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),ST],{$id:"NodeNeighbor"}),fR=S.Intersect([S.Object({id:S.Ref(PT,{description:"The unique identifier for the node."}),neighbors:S.Array(S.Ref(dR),{description:"The neighbors of the node."})}),U0],{$id:"NodeProperties"}),mR=an(S.Ref(On),fR,{$id:"NodeFeature"}),hR=zn(S.Ref(mR),{$id:"NodeCollection"}),Sie=S.Object({nodes:Tr(S.Record(St,S.Ref(hR),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Cie=/^nodes\/(.*)\.json$/,yR={name:"ext:nodes",schema:Sie,intoBundle:function*(e){if(e.nodes!=null)for(let t of gt(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(Cie))==null?void 0:o[1];if(n)return{nodes:{[n]:r(t)}}},references:[PT,dR,fR,mR,hR],integrityCheck:uR};d();d();d();var $x;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})($x||($x={}));var gR=e=>{if(e.outdoors==null)return ge(!0);let t=Ba(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 ve({kind:$x.FloorInFloorStackError,properties:{floorId:r,floorStackId:o.id}})}}return ge(!0)};var xR=S.Object({floors:S.Array(S.Ref(St),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),Tie=S.Object({outdoors:S.Ref(xR)},{$id:"OutdoorsExtensionSchema"}),bR="outdoors.json",vR={name:"ext:outdoors",schema:Tie,intoBundle:function*(e){e.outdoors!=null&&(yield{path:bR,contents:e.outdoors})},fromBundle:(e,t,r)=>{if(e===bR)return{outdoors:r(t)}},references:[xR],integrityCheck:gR};d();d();d();var jx;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(jx||(jx={}));var IR=e=>{if(e.tileset==null)return ge(!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 ve({kind:jx.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return ge(!0)};var wT=S.Object({key:S.String({minLength:1,description:"Unique identifier for the tileset style."}),name:S.String({minLength:1,description:"Display name of the tileset style."}),url:S.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),SR=S.Object({default:S.Ref(wT,{description:"The default tileset style, which should be used."}),others:S.Optional(S.Array(S.Ref(wT,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Pie=S.Object({tileset:S.Ref(SR)},{$id:"TilesetExtensionSchema"}),CR={name:"ext:mvf-tileset",schema:Pie,intoBundle:function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},fromBundle:(e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},references:[wT,SR],integrityCheck:IR};d();var TR=S.Object({},{$id:"WalkableProperties"}),PR=S.Object({},{$id:"NonWalkableProperties"}),wR=Tr(S.Record(Mn,S.Ref(TR),{$id:"WalkableGeometries",additionalProperties:!1})),MR=Tr(S.Record(Mn,S.Ref(PR),{$id:"NonWalkableGeometries",additionalProperties:!1})),wie=S.Object({walkable:Tr(S.Record(St,S.Ref(wR),{additionalProperties:!1})),nonwalkable:Tr(S.Record(St,S.Ref(MR),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),Mie=/^walkable\/(.*)\.json$/,Oie=/^nonwalkable\/(.*)\.json$/,OR={name:"ext:mvf-traversability",schema:wie,intoBundle:function*(e){if(e.walkable!=null)for(let t of gt(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of gt(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},fromBundle:(e,t,r)=>{var i,s;let n=(i=e.match(Mie))==null?void 0:i[1];if(n!=null)return{walkable:{[n]:r(t)}};let o=(s=e.match(Oie))==null?void 0:s[1];if(o!=null)return{nonwalkable:{[o]:r(t)}}},references:[TR,PR,wR,MR]};d();d();function ER(e){return e.replace(/^g_/,"s_")}function Eie(e){return e.replace(/^g_/,"o_")}function _ie(e){return e.replace(/^g_/,"w_")}function kie(e){return e.replace(/^g_/,"ar_")}function Aie(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 s of e.geometry.coordinates)n.push(L(T({},e),{geometry:{type:i,coordinates:s},properties:L(T({},e.properties),{id:"".concat(t,"-").concat(o++),kind:r})}));return n}default:return[L(T({},e),{properties:L(T({},e.properties),{id:t,kind:r})})]}}function py(e,t,r,n){let o=new Map;for(let{feature:i,floorId:s}of e){let a=i.properties.id,l=n.get(a);if(t.has(a)){let p=Aie(i,r(a),l),u=p.map(h=>h.properties.id),m=u.map(h=>({geometryId:h,floorId:s}));o.set(a,{ids:u,features:p,anchors:m})}}return o}function _R(e){var l,p,u;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((l=e.kinds)!=null?l:{}).filter(m=>m!==void 0).flatMap(Ct)),n=Ct(e.geometry).flatMap(([m,h])=>{var g;return((g=h==null?void 0:h.features)!=null?g:[]).map(v=>({feature:v,floorId:m}))}).flat(),o=new Set(Object.values((p=e.walkable)!=null?p:{}).filter(m=>m!==void 0).flatMap(gt)),i=new Set(Object.values((u=e.nonwalkable)!=null?u:{}).filter(m=>m!==void 0).flatMap(gt)),s=new Set(Array.from(r.entries()).filter(([m,h])=>h==="area").map(([m])=>m)),a=new Set(Array.from(r.entries()).filter(([m,h])=>h==="window").map(([m])=>m));return o.size>0&&(t.space=py(n,o,ER,r)),i.size>0&&(t.obstruction=py(n,i,Eie,r)),s.size>0&&(t.area=py(n,s,kie,r)),a.size>0&&(t.window=py(n,a,_ie,r)),o.size===0&&i.size===0&&s.size===0&&(t.space=py(n,new Set(n.map(m=>m.feature.properties.id)),ER,r)),t}function kR(e){let t=Die(e),r=_R(e),n=Fie(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}function Die(e){var r,n,o;let t=new Map;for(let i of Object.values((r=e.nodes)!=null?r:{}))for(let s of(n=i==null?void 0:i.features)!=null?n:[])if(s.properties.geometryIds.length>0)for(let a of s.properties.geometryIds){let l=(o=t.get(a))!=null?o:[];l.push(s.properties.id),t.set(a,l)}return t}function Fie(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}d();function AR(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,o]of Ct(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(a=>[a.properties.id,a])),s={type:"FeatureCollection",features:[]};for(let a of o){let l=i.get(a.geometryId);if(!l||l.geometry.type!=="Point")continue;let p={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:l.geometry,properties:p})}r[n]=s}return{annotation:r}}d();function DR(e,{nodesByGeometryId:t}){var s,a,l,p,u,m,h;let r={"connection.json":[],entrance:{}},n=(s=e.navigationFlags)==null?void 0:s[IT.accessible],o=(a=e.navigationFlags)==null?void 0:a[IT.outdoors],i=new Map(Object.values((l=e.geometry)!=null?l:{}).flatMap(g=>{var v;return(v=g==null?void 0:g.features)!=null?v:[]}).map(g=>[g.properties.id,g]));for(let g of(p=e.connections)!=null?p:[]){if(MT(g,i)){let C=Lie(g,i,t,o);for(let[P,w]of C)r.entrance[P]||(r.entrance[P]={type:"FeatureCollection",features:[]}),r.entrance[P].features.push(w);continue}let v=n!=null&&g.entrances.every(C=>xf(C,n))&&g.exits.every(C=>xf(C,n)),I=Array.from(new Set([...g.entrances.map(C=>t.get(C.geometryId)),...g.exits.map(C=>t.get(C.geometryId))].flat().filter(C=>C!=null))),b={id:g.id,externalId:(m=(u=g.details)==null?void 0:u.externalId)!=null?m:"",type:g.type,accessible:v,nodes:I};(h=g.details)!=null&&h.name&&(b.details={name:g.details.name}),g.extra&&(b.extra=g.extra),r["connection.json"].push(b)}return r}function MT(e,t){return e.type==CT.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}function Lie(e,t,r,n){var i,s;if(e.type!==CT.door)return[];let o=[];for(let a of e.entrances){let l=t.get(a.geometryId);if((l==null?void 0:l.geometry.type)==="LineString"){let p={type:"Feature",geometry:l.geometry,properties:{id:e.id,externalId:(s=(i=e.details)==null?void 0:i.externalId)!=null?s:"",isExterior:Rie(e,n)}},u=e.details;u&&(p.properties.details={name:u.name,description:u.description},u.icon&&(p.properties.details.images=[{url:u.icon,altText:"".concat(u.name," icon")}]));let m=r.get(a.geometryId);m&&m.length>0&&(p.properties.node=m[0]),o.push([a.floorId,p])}}return o}function Rie(e,t){return e.entrances.some(r=>xf(r,t))||e.exits.some(r=>xf(r,t))}d();function LR(e,{geometryMaps:t,nodesByGeometryId:r}){var P,w,M,E,B,$,D,F,W,G,U,J,X,ie,te,xe,Pe,he,Re,rt,it,We,Xe;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},o=(P=e.manifest)==null?void 0:P.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 ue=e.enterprise.venue;n.venue=L(T({},n.venue),{slug:ue.slug,name:(w=ue.details.name)!=null?w:n.venue.name,externalId:(M=ue.details.externalId)!=null?M:"",defaultLanguage:ue.defaultLanguage,languages:ue.languages,countrycode:ue.countrycode,coverImage:ue.coverImage,logo:ue.logo,icon:ue.details.icon,extra:ue.extra,mappedinWebUrl:ue.mappedinWebUrl,operationHours:ue.operationHours,topLocations:ue.topLocations})}let i=new Map,s=new Map,a=e.locations,l=e.enterprise.locations;if(a&&l){let ue=new Map(a.map(ye=>[ye.id,ye]));for(let ye of l){let fe=ue.get(ye.locationId);if(fe){let ne=fe.details,A={id:ye.id,name:ne.name,externalId:(E=ne.externalId)!=null?E:"",type:ye.type,sortOrder:ye.sortOrder,amenity:ye.amenity,description:ne.description,extra:fe.extra,links:fe.links,operationHours:fe.openingHours,gallery:ye.gallery,logo:fe.logo,shortName:ne.shortName,picture:ye.picture,showFloatingLabelWhenImagePresent:ye.showFloatingLabelWhenImagePresent,showLogo:ye.showLogo,siblingGroups:ye.siblingGroups,states:ye.states,tags:ye.tags,spaces:[],nodes:[],polygons:[]};fe.phone&&(A.phone={number:fe.phone});let Y=FR(fe.social);fe.website&&(Y.website=fe.website.url),A.social=Y;for(let R of fe.geometryAnchors){let ce=t.space.get(R.geometryId);if(ce){let le=new Set(ce.features.filter(Se=>Se.geometry.type==="Polygon").map(Se=>Se.properties.id));for(let Se of ce.anchors)A.spaces.push({floor:Se.floorId,id:Se.geometryId}),le.has(Se.geometryId)&&A.polygons.push({map:Se.floorId,id:Se.geometryId})}let ae=r.get(R.geometryId);for(let le of ae!=null?ae:[])A.nodes.push({map:R.floorId,id:le})}n.locations.push(A);for(let R of fe.categories)i.set(R,[...(B=i.get(R))!=null?B:[],ye.id]);s.set(ye.id,fe.categories)}}}let p=e.enterprise.locationInstances,u=e.locationInstances;if(p&&u){let ue=new Map(u.map(fe=>[fe.id,fe])),ye=[];for(let fe of p){let ne=ue.get(fe.locationInstanceId);if(ne){let A={id:fe.id,parent:fe.parentId,name:($=ne.details)==null?void 0:$.name,externalId:(D=ne.details)==null?void 0:D.externalId,type:fe.type,sortOrder:fe.sortOrder,amenity:fe.amenity,description:(F=ne.details)==null?void 0:F.description,extra:ne.extra,links:ne.links,operationHours:ne.openingHours,gallery:fe.gallery,picture:fe.picture,showFloatingLabelWhenImagePresent:fe.showFloatingLabelWhenImagePresent,showLogo:fe.showLogo,siblingGroups:fe.siblingGroups,states:fe.states,tags:fe.tags,logo:ne.logo,shortName:(W=ne.details)==null?void 0:W.shortName};ne.phone&&(A.phone={number:ne.phone});let Y=FR((G=ne.social)!=null?G:[]);if(ne.website&&(Y.website=ne.website.url),Object.keys(Y).length>0&&(A.social=Y),(U=ne.geometryAnchors)!=null&&U.length){let R=ne.geometryAnchors.flatMap(ce=>{var ae,le;return(le=(ae=t.space.get(ce.geometryId))==null?void 0:ae.anchors)!=null?le:[]});R.length>0&&(A.spaces=R.map(ce=>({floor:ce.floorId,id:ce.geometryId})))}if(ne.geometryAnchors){A.spaces=[],A.polygons=[],A.nodes=[];for(let R of ne.geometryAnchors){let ce=t.space.get(R.geometryId);if(ce){let le=new Set(ce.features.filter(Se=>Se.geometry.type==="Polygon").map(Se=>Se.properties.id));for(let Se of ce.anchors)A.spaces.push({floor:Se.floorId,id:Se.geometryId}),le.has(Se.geometryId)&&A.polygons.push({map:Se.floorId,id:Se.geometryId})}let ae=r.get(R.geometryId);for(let le of ae!=null?ae:[])A.nodes.push({map:R.floorId,id:le})}}ye.push(A)}}ye.length>0&&(n.locationInstances=ye)}let m=e.locationCategories,h=e.enterprise.categories;if(m&&h){let ue=[],ye=new Map(m.map(Y=>[Y.id,Y])),fe=new Map(h.map(Y=>[Y.categoryId,Y.id])),ne=new Map;for(let Y of m){let R=fe.get(Y.parent);if(R){let ce=(J=ne.get(R))!=null?J:[];ce.push(Y.id),ne.set(R,ce)}}for(let Y of h){let R=ye.get(Y.categoryId);if(R){let ae=((X=ne.get(Y.id))!=null?X:[]).map(Se=>fe.get(Se)).filter(Se=>Se!==void 0),le={id:Y.id,name:R.details.name,externalId:(ie=R.details.externalId)!=null?ie:"",sortOrder:Y.sortOrder,children:ae,locations:(te=i.get(Y.categoryId))!=null?te:[],icon:R.details.icon,picture:Y.picture,color:Y.color,extra:R.extra,iconFromDefaultList:Y.iconFromDefaultList};ue.push(le)}}n.categories=ue;let A={};for(let[Y,R]of s.entries())A[Y]=R.map(ce=>fe.get(ce)).filter(ce=>ce!==void 0);n.categoryPriorities=A}let g={};for(let[ue,ye]of Object.entries((xe=e.defaultStyle)!=null?xe:{}))if(ye.buffer>0){let fe=ye.geometryAnchors.flatMap(ne=>{var A,Y;return(Y=(A=t.space.get(ne.geometryId))==null?void 0:A.anchors)!=null?Y:[]});g[ue]={edgeOffset:ye.buffer,geometryAnchors:fe}}Object.keys(g).length>0&&(n.enterpriseStyles=g);let v=new Map;for(let ue of Object.values((Pe=e.enterprise.layers)!=null?Pe:{}))if(ue)for(let[ye,fe]of Ct(ue)){if(typeof fe!="string")continue;let ne=(he=v.get(fe))!=null?he:{name:fe,id:"ely_".concat(fe),spaces:[]};ne.spaces.push(...(rt=(Re=t.space.get(ye))==null?void 0:Re.anchors.map(A=>({floorId:A.floorId,spaceId:A.geometryId})))!=null?rt:[]),v.set(fe,ne)}v.size>0&&(n.layers=Array.from(v.values()));let I=[];for(let ue of Object.values((it=e.enterprise.textures)!=null?it:{}))for(let ye of ue){let fe=(We=t.space.get(ye.geometryId))==null?void 0:We.anchors;!fe||fe.length<1||ye.face==="unknown"||ye.surface==="unknown"||I.push({repeat:ye.repeat,offset:ye.offset,rotation:ye.rotation,path:ye.path,face:ye.face,surface:ye.surface,bounds:ye.bounds,geometryAnchors:fe})}I.length>0&&(n.textures=I);let b={};for(let[ue,ye]of Object.entries((Xe=e.enterprise.floorText)!=null?Xe:{})){let fe={type:"FeatureCollection",features:[]};for(let ne of ye.features){if(ne.properties.align==="unknown")continue;let A={align:ne.properties.align,color:ne.properties.color,fontFamily:ne.properties.fontFamily,fontSize:ne.properties.fontSize,rotation:ne.properties.rotation,text:ne.properties.text,visible:ne.properties.visible};"geometryId"in ne.properties?A.geometryId=ne.properties.geometryId:A.verticalOffset=ne.properties.verticalOffset,fe.features.push({type:"Feature",geometry:ne.geometry,properties:A})}fe.features.length>0&&(b[ue]=fe)}Object.keys(b).length>0&&(n.floorText=b);let C={enterprise:n};if(e.enterprise.textAreas){let ue={};for(let[ye,fe]of Ct(e.enterprise.textAreas)){let ne={type:"FeatureCollection",features:[]};for(let A of fe.features){if(A.properties.align==="unknown")continue;let Y={align:A.properties.align,maxWidth:A.properties.maxWidth,maxHeight:A.properties.maxHeight,rotation:A.properties.rotation};"geometryId"in A.properties?Y.anchorId=A.properties.geometryId:Y.verticalOffset=A.properties.verticalOffset;let R={type:"Feature",geometry:A.geometry,properties:Y};ne.features.push(R)}ue[ye]=ne}C.textAreas=ue}return C}var Nie=["facebook","instagram","twitter"];function FR(e){let t={};for(let{name:r,url:n}of e){let o=r.toLowerCase();Nie.includes(o)&&(t[o]=n)}return t}d();function RR(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[o,i]of Ct(e.facade))i&&(n[o]={id:i.id,spaces:i.geometryAnchors.flatMap(({floorId:s,geometryId:a})=>{var l;return(l=t.space.get(a))==null?void 0:l.ids.map(p=>({floorId:s,spaceId:p}))}).filter(s=>s!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}d();function NR(e,t={}){var o,i,s,a,l,p,u,m,h,g,v,I;let r={type:"FeatureCollection",features:[]},n=[];for(let b of e.floors.features)n.push({id:b.properties.id.replace(/^f_/,"m_"),externalId:(i=(o=b.properties.details)==null?void 0:o.externalId)!=null?i:"",elevation:b.properties.elevation,name:(a=(s=b.properties.details)==null?void 0:s.name)!=null?a:"",shortName:(p=(l=b.properties.details)==null?void 0:l.shortName)!=null?p:"",subtitle:b.properties.subtitle}),r.features.push({type:"Feature",geometry:b.geometry,properties:{id:b.properties.id,externalId:(m=(u=b.properties.details)==null?void 0:u.externalId)!=null?m:"",elevation:b.properties.elevation,name:(g=(h=b.properties.details)==null?void 0:h.name)!=null?g:"",shortName:(I=(v=b.properties.details)==null?void 0:v.shortName)!=null?I:"",subtitle:b.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}d();function BR(e,{geometryMaps:t}){var o,i,a,l,p;let r={},n={};for(let[u,m]of Ct((o=e.floorImages)!=null?o:{})){let h={features:[],type:"FeatureCollection"};for(let g of(i=m==null?void 0:m.features)!=null?i:[])if("verticalOffset"in g.properties)h.features.push(g);else{let s=g.properties,{geometryId:v}=s,I=Bn(s,["geometryId"]),b=(p=(a=t.space.get(v))==null?void 0:a.ids[0])!=null?p:(l=t.obstruction.get(v))==null?void 0:l.ids[0];if(!b)continue;let C={geometry:g.geometry,properties:L(T({},I),{anchorId:b}),type:g.type};h.features.push(C)}n[u]=h}return Object.keys(n).length>0&&(r.floorImages=n),r}d();function $R(e,t={}){var o,i,s,a,l,p,u;let r=[];for(let m of(o=e==null?void 0:e.floorStacks)!=null?o:[]){let h={id:m.id,floors:m.floors,maps:m.floors,externalId:(s=(i=m.details)==null?void 0:i.externalId)!=null?s:"",name:(l=(a=m.details)==null?void 0:a.name)!=null?l:"",shortName:(u=(p=m.details)==null?void 0:p.shortName)!=null?u:"",type:"Building"};m.defaultFloor&&(h.defaultFloor=m.defaultFloor),r.push(h)}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}}d();d();var UR=ss(GR(),1),Uie=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)},Vie=(e,t)=>{let[r,n]=e,o=t.geometry.coordinates[0],i=!1;for(let s=0,a=o.length-1;s<o.length;a=s++){let[l,p]=o[s],[u,m]=o[a];p>n!=m>n&&r<(u-l)*(n-p)/(m-p)+l&&(i=!i)}return i},zie=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)]}}},Hie=e=>{let t=Uie(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},Ux=e=>{try{let r=zie(e).geometry.coordinates;if(!Vie(r,e)){let o=(0,UR.default)(e.geometry.coordinates,Hie(e));return ge([o[0],o[1]])}return ge(r)}catch(t){return ve(new Error("Unable to calculate center of polygon"))}};function ET(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}function VR(e,{geometryMaps:t,nodesByGeometryId:r}){var p,u,m,h,g,v,I,b,C;let n=Yie(e.defaultStyle),o={},i={},s={},a={};for(let P of gt(e.geometry)){let w=e.geometry[P];if(!w)continue;let M=[],E=[],B=[],$=[];for(let D of w.features){let F=D.properties.id,W=n.has(F),G=(p=r.get(F))!=null?p:[];for(let U of(m=(u=t.space.get(F))==null?void 0:u.features)!=null?m:[])M.push(Wie(U,G));for(let U of(g=(h=t.obstruction.get(F))==null?void 0:h.features)!=null?g:[])E.push(Zie(U,W));for(let U of(I=(v=t.area.get(F))==null?void 0:v.features)!=null?I:[])B.push(qie(U,G));for(let U of(C=(b=t.window.get(F))==null?void 0:b.features)!=null?C:[])$.push(Xie(U))}M.length>0&&(o[P]={type:"FeatureCollection",features:M.filter(D=>D!==null)}),E.length>0&&(i[P]={type:"FeatureCollection",features:E.filter(D=>D!==null)}),B.length>0&&(s[P]={type:"FeatureCollection",features:B.filter(D=>D!==null)}),$.length>0&&(a[P]={type:"FeatureCollection",features:$.filter(D=>D!==null)})}let l={space:o,obstruction:i};return Object.keys(s).length>0&&(l.area=s),Object.keys(a).length>0&&(l.window=a),l}function Wie(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}),ET(r)&&(r.properties.center=Ux(r).unwrapOr(void 0)),r}function Zie(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 ET(n)&&(n.properties.center=Ux(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}function qie(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 ET(n)&&(n.properties.center=Ux(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}function Xie(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}function Yie(e){var n,o,i,s;let t=[...(o=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?o:[],...(s=(i=e==null?void 0:e.Walls)==null?void 0:i.geometryAnchors)!=null?s:[]];return new Set(t.map(a=>a.geometryId))}d();function zR(e,{geometryMaps:t,geometryFeatureById:r}){var o,i,s,a,l,p,u,m,h,g,v,I,b;if(!e.locationCategories&&!e.locations)return{};let n={};if((o=e.locationCategories)!=null&&o.length){let C=[];for(let P of e.locationCategories){let w={id:P.id,name:P.details.name,icon:(i=P.details.icon)!=null?i:""};P.parent&&(w.parent=P.parent),C.push(w)}n["category.json"]=C}if((s=e.locations)!=null&&s.length){let C=Kie(e,{geometryFeatureById:r}),P=[];for(let w of e.locations){let M={id:w.id,name:w.details.name,categories:w.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:w.links,openingHoursSpecification:(a=w.openingHours)!=null?a:[],pictures:w.images,social:w.social,description:w.details.description,externalId:w.details.externalId,icon:w.details.icon,logo:w.logo,phone:w.phone,website:w.website};P.push(M);for(let{geometryId:E,floorId:B}of w.geometryAnchors)M.spaces.push(...(p=(l=t.space.get(E))==null?void 0:l.ids.map($=>({id:$,floor:B})))!=null?p:[]),M.obstructions.push(...(m=(u=t.obstruction.get(E))==null?void 0:u.ids.map($=>({id:$,floor:B})))!=null?m:[]),M.areas.push(...(g=(h=t.area.get(E))==null?void 0:h.ids.map($=>({id:$,floor:B})))!=null?g:[]),M.entrances.push(...(v=C.entrancesByGeometryId.get(E))!=null?v:[]),M.connections.push(...(I=C.connectionsByGeometryId.get(E))!=null?I:[]),M.annotations.push(...(b=C.annotationsByGeometryId.get(E))!=null?b:[])}n["location.json"]=P}return n}function Kie(e,{geometryFeatureById:t}){var n,o,i;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[s,a]of Ct(e.annotations))for(let l of a!=null?a:[]){let p=l.geometryId,u=l.id,m=(n=r.annotationsByGeometryId.get(p))!=null?n:[];m.push({floor:s,id:u}),r.annotationsByGeometryId.set(p,m)}if(e.connections)for(let s of e.connections){let a=MT(s,t),l=Array.from(new Map([...s.entrances,...s.exits].map(p=>["".concat(p.geometryId,"_").concat(p.floorId),p])).values());for(let p of l){let u=p.geometryId;if(a){let m=(o=r.entrancesByGeometryId.get(u))!=null?o:[];m.push({floor:p.floorId,id:s.id}),r.entrancesByGeometryId.set(u,m)}else{let m=(i=r.connectionsByGeometryId.get(u))!=null?i:[];m.push(s.id),r.connectionsByGeometryId.set(u,m)}}}return r}d();function HR(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},o=e.manifest;if(o.features.length>0){let i=o.features[0],s=i.properties,a={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:s.time,name:s.name,naturalBearing:s.naturalBearing,tzid:s.tzid,map:s.mapId,org_id:s.orgId,language:s.language}};r.features.push(a)}return n}d();function WR(e,{geometryMaps:t}){var a,l,p,u,m,h,g,v,I,b,C,P,w,M,E;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,o=new Map;for(let B of(l=(a=e.floors)==null?void 0:a.features)!=null?l:[])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 $ of(u=B==null?void 0:B.features)!=null?u:[])for(let D of $.properties.geometryIds)i.set(D,[...(m=i.get(D))!=null?m:[],$.properties.id]);let s=new Map;for(let B of(h=e.connections)!=null?h:[]){let $=B.exits.map(D=>{var F;return L(T({},D),{nodes:(F=i.get(D.geometryId))!=null?F:[]})});for(let D of B.entrances){let F=(g=i.get(D.geometryId))!=null?g:[];for(let W of F)for(let G of $){let U=Math.abs(((v=o.get(D.floorId))!=null?v:0)-((I=o.get(G.floorId))!=null?I:0))*B.floorCostMultiplier,J=(b=s.get(W))!=null?b:[];J.push(...G.nodes.map(X=>({id:X,weight:U+B.entryCost}))),s.set(W,J)}}}for(let[B,$]of Ct((C=e.nodes)!=null?C:{}))for(let D of(P=$==null?void 0:$.features)!=null?P:[]){let F=(w=t.space.get(D.properties.geometryIds[0]))==null?void 0:w.features[0],W=(F==null?void 0:F.geometry.type)==="Point"&&((M=F==null?void 0:F.properties.details)!=null&&M.externalId)?F.properties.details.externalId:"",G={type:"Feature",geometry:D.geometry,properties:{id:D.properties.id,floor:B,space:D.properties.geometryIds.map(U=>{var J;return(J=t.space.get(U))==null?void 0:J.ids}).flat().filter(U=>U!==void 0),neighbors:[...D.properties.neighbors.map(U=>({id:U.id,weight:U.extraCost})),...(E=s.get(D.properties.id))!=null?E:[]],map:B,externalId:W}};n.push(G)}return r}d();function Jie(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}function ZR(e,{geometryMaps:t}){var s,a,l;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(u=>[u.properties.id,u.geometry.type])));for(let[p,u]of Ct(e.defaultStyle)){let m=Jie(u.geometryAnchors.flatMap(h=>{var g,v,I,b;return[...(v=(g=t.space.get(h.geometryId))==null?void 0:g.ids)!=null?v:[],...(b=(I=t.obstruction.get(h.geometryId))==null?void 0:I.ids)!=null?b:[]]}),i);if(m.Point&&m.Point.length>0){let h={points:Array.from(m.Point.values()),showImage:((s=u.extra)==null?void 0:s.showImage)!==void 0?((a=u.extra)==null?void 0:a.showImage)===!0:u.opacity!==0};n["".concat(p,".Point")]=h}if(m.LineString&&m.LineString.length>0){let h={lineStrings:Array.from(m.LineString.values()),altitude:u.altitude,color:u.color,height:u.height,opacity:u.opacity,width:u.buffer};n["".concat(p,".LineString")]=h}if(m.Polygon&&m.Polygon.length>0){let h={polygons:Array.from(m.Polygon.values()),altitude:u.altitude,color:u.color,height:u.height,opacity:u.opacity};((l=u.extra)==null?void 0:l.showImage)!==void 0&&(h.showImage=u.extra.showImage===!0),n["".concat(p,".Polygon")]=h}}return r}var Qie=LF().extendOptional(DL).extendOptional(yR).extendOptional(jL).extendOptional(pR).extendOptional(OR).extendOptional(zL).extendOptional(XL).extendOptional(vR).extendOptional(CR).extendOptional(sR).extendOptional(QL).extendOptional(LD).extendOptional(zF).extendOptional(OL).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function ese(e){let t=kR(e),r=NR(e,t),n=VR(e,t),o=WR(e,t),i=DR(e,t),s=ZR(e,t),a=$R(e,t),l=BR(e,t),p=RR(e,t),u=AR(e,t),m=zR(e,t),h=LR(e,t),g=HR(e,t);return T(T(T(T(T(T(L(T(T(T(T(T(T({},r),n),o),i),s),a),{"tileset.json":e.tileset}),l),p),u),m),h),g)}async function _T(e){let t=await Qie.decompress(e);return t.isOk()?ge(ese(t.value)):ve(t.error)}d();function If(e){return e.endsWith("/")?e:"".concat(e,"/")}d();var Sf="https://app.mappedin.com/",qR="https://auth.mappedin.com/";d();d();var tse=e=>{let t=Date.now();return e-t},Vx=(e,t)=>tse(e)<=t*60*1e3;var YR=60,KR=YR*60*1e3,XR="accessTokens";async function uy(e,t=!1){let r="".concat(e.key),n=Kc.getInstance(),o=(n==null?void 0:n.loadSessionData(XR))||{},i=Math.floor(Date.now()/1e3);if(o[r]&&!Vx(o[r].expiresTimestamp*1e3,YR))return o[r];let s=t?await rse(e,i):await nse(e,i),a=L(T({},o),{[r]:s});return n==null||n.saveSessionData(XR,a),s}async function rse(e,t){var i;let r="".concat((i=e.baseAuthUri)!=null?i:qR,"oauth2/token"),n=await $i()(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}}async function nse(e,t){let r="".concat(e.baseAuthUri?If(e.baseAuthUri):Sf,"api/api-key/token"),n=await $i()(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}}d();var QR=60,eN=QR*60*1e3,JR="miSasTokens";async function kT(e,t){let r="".concat(t,"__").concat(e.mapId),n=Kc.getInstance(),o=(n==null?void 0:n.loadSessionData(JR))||{};if(o[r]&&!Vx(o[r].expires,QR))return o[r];let i=await ose(e,t),s=L(T({},o),{[r]:{token:i.token,expires:new Date(i.expires).getTime()}});return n==null||n.saveSessionData(JR,s),i}async function ose(e,t){let r="".concat(e.baseUri?If(e.baseUri):Sf,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await $i()(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()}}var tN=globalThis.fetch,oN,ise=(oN=x==null?void 0:x.env)==null?void 0:oN.npm_package_version;function $i(){if(tN==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return tN}var AT={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function iN(e){var r;let t=T(T({},AT),e);return t.headers=L(T({},t.headers),{"mappedin-sdk-version":ise}),t.things=[],"platformString"in e&&(t.headers=L(T({},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}function sse(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}}async function ase(e,t,r=!1){let n=sse(e,t,r),o=await $i()(n.url,n.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}var lse=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 V.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,s="locale_packs"in o&&typeof o.locale_packs=="object"?o.locale_packs:null;if(i==null||s==null){V.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:i,locale_packs:s}}return r};async function cse(e,t="exports/mvf/1/bundle"){var p,u;let r=iN(T(T({baseUri:"https://api-gateway.mappedin.com/"},AT),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 ase(r,n),i=o.url,s=o.locale_packs,a=(u=r.perspective)!=null?u:AT.perspective,l=lse(o);if(a!=null&&a!==""&&l!=null){let m=l[a];m==null?V.warn("Perspective ".concat(a," not found in response! Loading default perspective instead.")):(V.log('Loading perspective "'.concat(a,'"')),i=m.url,s=m.locale_packs)}return{url:i,localePacks:s,updated_at:o.updated_at}}var dy=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function DT(e,{signal:t}){let r=await(await $i()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}async function Cf(e){let r=(await import("./browser-6R2QCUOI.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let o=r["enterprise/locations.json"];o&&(n.enterprise.locations=JSON.parse(dy().decode(o)));let i=r["enterprise/categories.json"];i&&(n.enterprise.categories=JSON.parse(dy().decode(i)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(dy().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(dy().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(dy().decode(r["manifest.json"]))),n}async function sN(e,{signal:t}){try{let r=await(await $i()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await Cf(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}async function FT(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 cse(e,n),s=await $i()(o).then(l=>l.arrayBuffer()),a=new Uint8Array(s);t({compressed:a,localePacks:i})}catch(n){r(n)}})}async function LT(e,t){return new Promise(async(r,n)=>{try{let{url:o}=await pse(e,t),i=await $i()(o).then(a=>a.arrayBuffer()),s=new Uint8Array(i);r(s)}catch(o){n(o)}})}async function pse(e,t){let r=new URL("".concat(e.baseUri?If(e.baseUri):Sf,"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 $i()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}function RT(e){var n,o,i,s,a,l,p,u,m,h,g,v,I,b,C,P,w,M;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((s=e.enterprise)==null?void 0:s["categories.json"]))),(a=e.enterprise)!=null&&a["venue.json"]&&(E.enterprise.venue=JSON.parse(r((l=e.enterprise)==null?void 0:l["venue.json"]))),(p=e.enterprise)!=null&&p["layers.json"]&&(E.enterprise.layers=JSON.parse(r((u=e.enterprise)==null?void 0:u["layers.json"]))),(m=e.enterprise)!=null&&m["locationInstances.json"]&&(E.enterprise.locationInstances=JSON.parse(r((h=e.enterprise)==null?void 0:h["locationInstances.json"]))),(g=e.enterprise)!=null&&g["enterpriseStyles.json"]&&(E.enterprise.enterpriseStyles=JSON.parse(r((v=e.enterprise)==null?void 0:v["enterpriseStyles.json"]))),(I=e.enterprise)!=null&&I["textures.json"]&&(E.enterprise.textures=JSON.parse(r((b=e.enterprise)==null?void 0:b["textures.json"]))),(C=e.enterprise)!=null&&C["floorText.json"]&&(E.enterprise.floorText=JSON.parse(r((P=e.enterprise)==null?void 0:P["floorText.json"]))),(w=e.enterprise)!=null&&w["categoryPriorities.json"]&&(E.enterprise.categoryPriorities=JSON.parse(r((M=e.enterprise)==null?void 0:M["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 $=Object.keys(e.annotation);for(let D of $){let F=D.replace(/\.json|\.geojson/g,"");E.annotation[F]=JSON.parse(r(e.annotation[D]))}}let B=Object.keys(e.space);for(let $ of B){let D=$.replace(/\.json|\.geojson/g,"");E.space[D]=JSON.parse(r(e.space[$]))}if(e.obstruction!=null){let $=Object.keys(e.obstruction);for(let D of $){let F=D.replace(/\.json|\.geojson/g,"");E.obstruction[F]=JSON.parse(r(e.obstruction[D]))}}else E.obstruction={};if(e.entrance!=null){let $=Object.keys(e.entrance);for(let D of $){let F=D.replace(/\.json|\.geojson/g,"");E.entrance[F]=JSON.parse(r(e.entrance[D]))}}else E.entrance={};if("floorImages"in e&&e.floorImages!=null){E.floorImages={};for(let $ of Object.keys(e.floorImages)){let D=$.replace(/\.json|\.geojson/g,"");E.floorImages[D]=JSON.parse(r(e.floorImages[$]))}}if("textAreas"in e&&e.textAreas!=null){E.textAreas={};for(let $ of Object.keys(e.textAreas)){let D=$.replace(/\.json|\.geojson/g,"");E.textAreas[D]=JSON.parse(r(e.textAreas[$]))}}if("facade"in e&&e.facade!=null){E.facade={};for(let $ of Object.keys(e.facade)){let D=$.replace(/\.json|\.geojson/g,"");E.facade[D]=JSON.parse(r(e.facade[$]))}}if("area"in e&&e.area!=null){E.area={};for(let $ of Object.keys(e.area)){let D=$.replace(/\.json|\.geojson/g,"");E.area[D]=JSON.parse(r(e.area[$]))}}return E}catch(E){throw V.error(E),new Error("MVF parsing failed! Probably encountered a bad file.")}}function use(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}async function NT(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-6R2QCUOI.js")).unzipSync(e);if(!use(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let i={},s=Object.keys(o);for(let a of s){if(o[a].length===0)continue;let l=a.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){i[l[0]]=o[a];continue}if(l[0]==="image"){V.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else i[l[0]]==null&&(i[l[0]]={}),i[l[0]][l[1]]=o[a]}t(i)}catch(n){r(n)}})}function Dp(){let e="us",t={};function r(){return hse(gse(e),t)}return{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?rN.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?rN.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}var aN=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"}),rN=Object.freeze(L(T({},aN),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),dse=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"}),fse=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"}),mse=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 hse(e,t){return T(T({},e),t)}var yse={eu:dse,us:aN,"us-staging-enterprise":fse,"us-staging-self-serve":mse};function gse(e){return yse[e]}var BT=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_",""))},nN=async e=>{let t=performance.now(),r=await _T(e);return V.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw V.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()};async function $T(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await NT(e);return RT(r)}catch(r){return nN(e)}case"3.0.0":return nN(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}d();d();d();function ii(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")}function ko(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")}function Tf(e){return e.type==="Feature"?e.geometry:e}function lN(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function bse(e,t,r){r===void 0&&(r={});for(var n=ii(e),o=ko(t),i=0;i<o.length-1;i++){var s=!1;if(r.ignoreEndVertices&&(i===0&&(s="start"),i===o.length-2&&(s="end"),i===0&&i+1===o.length-1&&(s="both")),xse(o[i],o[i+1],n,s,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function xse(e,t,r,n,o){var i=r[0],s=r[1],a=e[0],l=e[1],p=t[0],u=t[1],m=r[0]-a,h=r[1]-l,g=p-a,v=u-l,I=m*v-h*g;if(o!==null){if(Math.abs(I)>o)return!1}else if(I!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(v)?g>0?a<i&&i<=p:p<=i&&i<a:v>0?l<s&&s<=u:u<=s&&s<l;if(n==="end")return Math.abs(g)>=Math.abs(v)?g>0?a<=i&&i<p:p<i&&i<=a:v>0?l<=s&&s<u:u<s&&s<=l;if(n==="both")return Math.abs(g)>=Math.abs(v)?g>0?a<i&&i<p:p<i&&i<a:v>0?l<s&&s<u:u<s&&s<l}else return Math.abs(g)>=Math.abs(v)?g>0?a<=i&&i<=p:p<=i&&i<=a:v>0?l<=s&&s<=u:u<=s&&s<=l;return!1}var cN=bse;d();function vse(e,t){t===void 0&&(t={});var r=cd(e),n=(r[0]+r[2])/2,o=(r[1]+r[3])/2;return ds([n,o],t.properties,t)}var zx=vse;d();d();function Ise(e,t,r){r===void 0&&(r={});var n=ii(e),o=ii(t),i=ro(o[1]-n[1]),s=ro(o[0]-n[0]),a=ro(n[1]),l=ro(o[1]),p=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return dM(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),r.units)}var tc=Ise;function Hx(e,t){return t===void 0&&(t={}),hM(e,function(r,n){var o=n.geometry.coordinates;return r+tc(o[0],o[1],t)},0)}d();d();d();function Wx(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Sse(e,t);var n=ii(e),o=ii(t),i=ro(n[0]),s=ro(o[0]),a=ro(n[1]),l=ro(o[1]),p=Math.sin(s-i)*Math.cos(l),u=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-i);return Zm(Math.atan2(p,u))}function Sse(e,t){var r=Wx(t,e);return r=(r+180)%360,r}d();function Fp(e,t,r,n){n===void 0&&(n={});var o=ii(e),i=ro(o[0]),s=ro(o[1]),a=ro(r),l=fM(t,n.units),p=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a)),u=i+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(p)),m=Zm(u),h=Zm(p);return ds([m,h],n.properties)}d();d();function Cse(e){if(!e)throw new Error("geojson is required");var t=[];return fs(e,function(r){Tse(r,t)}),Jc(t)}function Tse(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=ko(n);break;case"LineString":r=[ko(n)]}r.forEach(function(o){var i=Pse(o,e.properties);i.forEach(function(s){s.id=t.length,t.push(s)})})}}function Pse(e,t){var r=[];return e.reduce(function(n,o){var i=ba([n,o],t);return i.bbox=wse(n,o),r.push(i),o}),r}function wse(e,t){var r=e[0],n=e[1],o=t[0],i=t[1],s=r<o?r:o,a=n<i?n:i,l=r>o?r:o,p=n>i?n:i;return[s,a,l,p]}var jT=Cse;var MN=ss(PN(),1);function Qse(e,t){var r={},n=[];if(e.type==="LineString"&&(e=yI(e)),t.type==="LineString"&&(t=yI(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=wN(e,t);return o&&n.push(o),Jc(n)}var i=(0,MN.default)();return i.load(jT(t)),gI(jT(e),function(s){gI(i.search(s),function(a){var l=wN(s,a);if(l){var p=ko(l).join(",");r[p]||(r[p]=!0,n.push(l))}})}),Jc(n)}function wN(e,t){var r=ko(e),n=ko(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],s=r[1][0],a=r[1][1],l=n[0][0],p=n[0][1],u=n[1][0],m=n[1][1],h=(m-p)*(s-o)-(u-l)*(a-i),g=(u-l)*(i-p)-(m-p)*(o-l),v=(s-o)*(i-p)-(a-i)*(o-l);if(h===0)return null;var I=g/h,b=v/h;if(I>=0&&I<=1&&b>=0&&b<=1){var C=o+I*(s-o),P=i+I*(a-i);return ds([C,P])}return null}var wf=Qse;function eae(e,t,r){r===void 0&&(r={});var n=ds([1/0,1/0],{dist:1/0}),o=0;return fs(e,function(i){for(var s=ko(i),a=0;a<s.length-1;a++){var l=ds(s[a]);l.properties.dist=tc(t,l,r);var p=ds(s[a+1]);p.properties.dist=tc(t,p,r);var u=tc(l,p,r),m=Math.max(l.properties.dist,p.properties.dist),h=Wx(l,p),g=Fp(t,m,h+90,r),v=Fp(t,m,h-90,r),I=wf(ba([g.geometry.coordinates,v.geometry.coordinates]),ba([l.geometry.coordinates,p.geometry.coordinates])),b=null;I.features.length>0&&(b=I.features[0],b.properties.dist=tc(t,b,r),b.properties.location=o+tc(l,b,r)),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a,n.properties.location=o),p.properties.dist<n.properties.dist&&(n=p,n.properties.index=a+1,n.properties.location=o+u),b&&b.properties.dist<n.properties.dist&&(n=b,n.properties.index=a),o+=u}}),n}var my=eae;function tae(e,t,r){var n=ko(r);if(lN(r)!=="LineString")throw new Error("line must be a LineString");var o=my(r,e),i=my(r,t),s;o.properties.index<=i.properties.index?s=[o,i]:s=[i,o];for(var a=[s[0].geometry.coordinates],l=s[0].properties.index+1;l<s[1].properties.index+1;l++)a.push(n[l]);return a.push(s[1].geometry.coordinates),ba(a,r.properties)}var QT=tae;var rae=1e-7;function eP(e){return{type:"Point",coordinates:e}}function nae(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,o=r.map(i=>my(e,eP(i)));return n.reduce((i,s)=>{let a=QT(eP(s),o[0],e),l=QT(eP(s),o[1],e),p=Hx(a)<Hx(l)?a:l;return p.properties=L(T({},e.properties),{entrances:[]}),i.concat([p])},[])}function tP(e,t){return t.reduce((r,n)=>{let o={epsilon:rae},i=r.obstructions.findIndex(a=>cN(zx(n),a,o)),s=r.obstructions[i];if(s){let[a,l]=nae(s,n);r.entrances.push(n),r.obstructions.splice(i,1,a,l)}return r},{obstructions:[e],entrances:[]})}d();d();d();var hy=class hy{constructor(t,r,n){f(this,"__type",hy.__type);f(this,"id",kt());f(this,"latitude");f(this,"longitude");f(this,"floorId");f(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===hy.__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(){}};f(hy,"__type","coordinate");var rP=hy,$e=rP;d();var Vr=class{constructor(t){f(this,"id");this.id=t}};var Bs,Wn,Lp,nc,yy=class yy extends Vr{constructor(r,n){super(n.mvfData.properties.id);f(this,"__type",yy.__type);O(this,Bs);O(this,Wn,{});O(this,Lp);O(this,nc);k(this,Bs,r),k(this,Lp,n.floorId),k(this,nc,n.mvfData)}static is(r){return r.__type===yy.__type}get locations(){return c(this,Wn).locations?c(this,Wn).locations:(c(this,Wn).locations=(c(this,Bs).locationIdsByNodeId[this.id]||[]).map(r=>c(this,Bs).getById("enterprise-location",r)).filter(Boolean),c(this,Wn).locations)}get space(){var r;return c(this,Bs).getById("space",(r=c(this,Bs).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=c(this,Bs).getById("floor",c(this,Lp));if(r==null)throw new Error("Floor ".concat(c(this,Lp)," not found!"));return r}get coordinate(){if(c(this,Wn).coordinate==null){let[r,n]=c(this,nc).geometry.coordinates;c(this,Wn).coordinate=new $e(n,r,c(this,Lp))}return c(this,Wn).coordinate}get externalId(){var r;return(r=c(this,nc).properties.externalId)!=null?r:""}get neighbors(){if(c(this,Wn).neighbours==null){let r=c(this,nc).properties.neighbors.map(n=>{let o=c(this,Bs).getById("node",n.id);if(o==null)throw new Error("Node ".concat(n.id," not found!"));return o});c(this,Wn).neighbours=r}return c(this,Wn).neighbours}get geoJSON(){return L(T({},c(this,nc)),{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(c(this,Wn)))delete c(this,Wn)[r]}};Bs=new WeakMap,Wn=new WeakMap,Lp=new WeakMap,nc=new WeakMap,f(yy,"__type","node");var nP=yy,oc=nP;d();d();d();d();var gy,Wa,Yx=class Yx extends Vr{constructor(r){super(String(kt()));O(this,gy,{});O(this,Wa);k(this,Wa,r.mvfData)}static is(r){return r.__type===Yx.__type}get url(){return c(this,Wa).url}get name(){if("displayName"in c(this,Wa))return c(this,Wa).displayName;if("label"in c(this,Wa))return c(this,Wa).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(c(this,gy)))delete c(this,gy)[r]}};gy=new WeakMap,Wa=new WeakMap,f(Yx,"__type","hyperlink");var oP=Yx,Rp=oP;d();d();function by(e){return typeof e=="string"?e:e.id}function sP(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}var iP=8,$s=e=>typeof e=="number"?e.toFixed(iP):sP(e)?e[1].toFixed(iP)+"-"+e[0].toFixed(iP):e.map(t=>$s(t)).join("-"),oae=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)},Kx=e=>{if(!oae(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}};var xy,ic,Np,Jx=class Jx extends Vr{constructor(r){super(String(kt()));O(this,xy,{});O(this,ic);O(this,Np);k(this,ic,r.mvfData),k(this,Np,r.mapData)}static is(r){return r.__type===Jx.__type}get url(){let r=c(this,ic).url;if(c(this,Np).tokenManager==null)return r;let n=Kx(c(this,ic).url);if(n==null)return r;let o=n.mapId;try{if(c(this,Np).tokenManager.isEnterpriseMode())return r;let i=c(this,Np).tokenManager.getSasToken(o).token;if(i==null||i==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(i)}catch(i){return V.error("Error getting SAS token for image",{error:i,url:r}),r}}get name(){return c(this,ic).altText}get altText(){return c(this,ic).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(c(this,xy)))delete c(this,xy)[r]}};xy=new WeakMap,ic=new WeakMap,Np=new WeakMap,f(Jx,"__type","image");var aP=Jx,Bp=aP;d();var $p,ji=class{constructor(t,r){f(this,"id");O(this,$p);this.id=t}get geoJSONBoundingBox(){return c(this,$p)?c(this,$p):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(k(this,$p,cd(this.geoJSON)),c(this,$p))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};$p=new WeakMap;var Mf,Gi,Za,un=class extends ji{constructor(r,n){super(n.properties.id,r);O(this,Mf);O(this,Gi);O(this,Za,{});k(this,Mf,r),k(this,Gi,n)}get externalId(){var r;return(r=c(this,Gi).properties.externalId)!=null?r:""}get name(){var n,o,i,s,a;let r="";return"details"in c(this,Gi).properties||(r=(n=c(this,Gi).properties.externalId)!=null?n:""),r===""&&(r=(i=(o=c(this,Gi).properties.details)==null?void 0:o.name)!=null?i:""),r===""&&(r=(a=(s=this.locationProfiles.find(l=>l.name&&l.name.length>0))==null?void 0:s.name)!=null?a:""),r}get description(){var n,o,i,s;let r=(o=(n=c(this,Gi).properties.details)==null?void 0:n.description)!=null?o:"";return r===""&&(r=(s=(i=this.locationProfiles.find(a=>a.description&&a.description.length>0))==null?void 0:i.description)!=null?s:""),r}get images(){var n,o,i,s,a;if(c(this,Za).images!=null)return c(this,Za).images;let r=(i=(o=(n=c(this,Gi).properties.details)==null?void 0:n.images)==null?void 0:o.map(l=>new Bp({mvfData:l,mapData:c(this,Mf)})))!=null?i:[];return(r==null||r.length===0)&&(r=(a=(s=this.locationProfiles.find(l=>l.images.length>0))==null?void 0:s.images)!=null?a:[]),c(this,Za).images=r,r}get links(){var n,o,i,s,a;if(c(this,Za).links!=null)return c(this,Za).links;let r=(i=(o=(n=c(this,Gi).properties.details)==null?void 0:n.links)==null?void 0:o.map(l=>new Rp({mvfData:l})))!=null?i:[];return(r==null||r.length===0)&&(r=(a=(s=this.locationProfiles.find(l=>l.links.length>0))==null?void 0:s.links)!=null?a:[]),c(this,Za).links=r,r}get locationProfiles(){var r;return(r=c(this,Mf).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};Mf=new WeakMap,Gi=new WeakMap,Za=new WeakMap;var Iy,jp,Of,Ef,vy=class vy extends un{constructor(r,n){super(r,n.mvfData);f(this,"__type",vy.__type);O(this,Iy);O(this,jp);O(this,Of,{});O(this,Ef);k(this,Iy,r),k(this,jp,n.floorId),k(this,Ef,n.mvfData)}static is(r){return r.__type===vy.__type}get center(){var r;if(c(this,Of).center==null){let[n,o]=(r=c(this,Ef).properties.center)!=null?r:[0,0];c(this,Of).center=new $e(o,n,c(this,jp))}return c(this,Of).center}get floor(){let r=c(this,Iy).getById("floor",c(this,jp));if(r==null)throw new Error("Floor ".concat(c(this,jp)," not found!"));return r}get geoJSON(){return L(T({},c(this,Ef)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Iy=new WeakMap,jp=new WeakMap,Of=new WeakMap,Ef=new WeakMap,f(vy,"__type","area");var lP=vy,sc=lP;d();var Gp,qa,Up,_f,Sy=class Sy extends un{constructor(r,n){super(r,n.mvfData);f(this,"__type",Sy.__type);O(this,Gp);O(this,qa);O(this,Up);O(this,_f);k(this,qa,{}),k(this,_f,n.mvfData),k(this,Gp,r),k(this,Up,n.floorId)}static is(r){return r.__type===Sy.__type}get floor(){let r=c(this,Gp).getById("floor",c(this,Up));if(r==null)throw new Error("Floor ".concat(c(this,Up)," not found!"));return r}get center(){if(c(this,qa).center==null){let[[r,n],[o,i]]=c(this,_f).geometry.coordinates,s=(r+o)/2,a=(n+i)/2;c(this,qa).center=new $e(a,s,c(this,Up))}return c(this,qa).center}get isExterior(){var o;let r=c(this,Gp).obstructionIdByEntranceId[this.id],n=c(this,Gp).getMVFFeatureById("obstruction",r);return(o=n==null?void 0:n.properties.footprintComponent)!=null?o:!1}get geoJSON(){return L(T({},c(this,_f)),{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(c(this,qa)))delete c(this,qa)[r]}};Gp=new WeakMap,qa=new WeakMap,Up=new WeakMap,_f=new WeakMap,f(Sy,"__type","door");var cP=Sy,js=cP;d();var ac,Vp,Ao,Gs,Cy=class Cy extends un{constructor(r,n){super(r,n.mvfData);f(this,"__type",Cy.__type);O(this,ac);O(this,Vp);O(this,Ao,{});O(this,Gs);k(this,ac,r),k(this,Vp,n.floorId),k(this,Gs,n.mvfData)}getMvfData(){return c(this,Gs)}static is(r){return r.__type===Cy.__type}get type(){return sae(c(this,Gs).properties.kind)}get locations(){if(c(this,Ao).locations)return c(this,Ao).locations;c(this,Ao).locations=[];let r=c(this,ac).mvfLocationsBySpaceId[c(this,Gs).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let o=c(this,ac).getById("enterprise-location",n.id);o&&c(this,Ao).locations.push(o)}return c(this,Ao).locations}get floor(){let r=c(this,ac).getById("floor",c(this,Vp));if(r==null)throw new Error("Floor ".concat(c(this,Vp)," not found!"));return r}get doors(){return c(this,Gs).properties.destinationNodes.reduce((r,n)=>{let o=c(this,ac).doorsByNodeId[n];return o&&r.push(o),r},[])}get center(){var r;if(c(this,Ao).center==null){let[n,o]=(r=c(this,Gs).properties.center)!=null?r:[0,0];c(this,Ao).center=new $e(o,n,c(this,Vp))}return c(this,Ao).center}get geoJSON(){return L(T({},c(this,Gs)),{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(c(this,Ao)))delete c(this,Ao)[r]}};ac=new WeakMap,Vp=new WeakMap,Ao=new WeakMap,Gs=new WeakMap,f(Cy,"__type","space");var pP=Cy,iae=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function sae(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return iae.includes(t)?t:"room"}var Jr=pP;d();var si,Jt,ai,Py,dP,Ty=class Ty extends ji{constructor(r,n){super(n.mvfData.properties.id,r);O(this,Py);f(this,"__type",Ty.__type);O(this,si);O(this,Jt,{});O(this,ai);k(this,si,r),k(this,ai,n.mvfData)}static is(r){return r.__type===Ty.__type}get focusTarget(){return this}get name(){var r,n;return"name"in c(this,ai).properties?(n=ee(this,Py,dP).call(this,"name"))!=null?n:"":(r=c(this,ai).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in c(this,ai).properties?(n=ee(this,Py,dP).call(this,"shortName"))!=null?n:"":(r=c(this,ai).properties.externalId)!=null?r:""}get externalId(){var r;return(r=c(this,ai).properties.externalId)!=null?r:""}get elevation(){return c(this,ai).properties.elevation}get spaces(){if(c(this,Jt).spaces==null){let r=c(this,si).spaces.filter(n=>n.floor.id===this.id);c(this,Jt).spaces=r}return c(this,Jt).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=c(this,ai).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(c(this,Jt).objects==null){let r=c(this,si).objects.filter(n=>n.floor.id===this.id);c(this,Jt).objects=r}return c(this,Jt).objects}get connections(){if(c(this,Jt).connections==null){let r=c(this,si).connections.filter(n=>n.floors.includes(this));c(this,Jt).connections=r}return c(this,Jt).connections}get doors(){if(c(this,Jt).doors==null){let r=c(this,si).doors.filter(n=>n.floor.id===this.id);c(this,Jt).doors=r}return c(this,Jt).doors}get annotations(){if(c(this,Jt).annotations==null){let r=c(this,si).annotations.filter(n=>n.floor.id===this.id);c(this,Jt).annotations=r}return c(this,Jt).annotations}get pois(){if(c(this,Jt).pois==null){let r=c(this,si).pointsOfInterest.filter(n=>n.floor.id===this.id);c(this,Jt).pois=r}return c(this,Jt).pois}get floorStack(){if(c(this,Jt).floorStack==null){let r=c(this,si).floorStacks.find(n=>n.floors.includes(this));c(this,Jt).floorStack=r}return c(this,Jt).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(c(this,Jt)))delete c(this,Jt)[r]}};si=new WeakMap,Jt=new WeakMap,ai=new WeakMap,Py=new WeakSet,dP=function(r){let n=c(this,ai).properties[r];return c(this,si).getPropTranslation(this.__type,r,this.id,n)},f(Ty,"__type","floor");var uP=Ty,fo=uP;d();d();d();function wy(e){let t;if(Jr.is(e)||js.is(e)||Do.is(e)||sc.is(e)||Ui.is(e))t=e.center;else if(lc.is(e)||cc.is(e))t=e.coordinate;else if($e.is(e))t=e;else if(oc.is(e))t=e.coordinate;else if(Xa.is(e))t=e.coordinates[0];else return;return t}d();d();var zp={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}},Us="ExteriorWalls",pc="Walls",ON=0,kf="InteriorDoors",Af="ExteriorDoors",Er="GeometryLayer",Ya="LabelsLayer",Vs="MarkersLayer",My="FootprintLayer",Df="OcclusionLayer",EN="ImagesLayer",Hp="FacadesLayer";var _N=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],aae={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function fP(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&V.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function mP(e,t){var o,i,s,a,l,p;let r=((o=e==null?void 0:e.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,n=L(T(T({},zp),e),{outdoorView:T({enabled:((i=e==null?void 0:e.outdoorView)==null?void 0:i.enabled)===void 0?!!r:(s=e==null?void 0:e.outdoorView)==null?void 0:s.enabled,layersHiddenByGeometry:(a=zp.outdoorView)==null?void 0:a.layersHiddenByGeometry},e==null?void 0:e.outdoorView),bearing:(p=(l=e==null?void 0:e.bearing)!=null?l:t.naturalBearing)!=null?p:0,imagePlacementOptions:T(T({},zp.imagePlacementOptions),e==null?void 0:e.imagePlacementOptions),multiFloorView:T(T({},zp.multiFloorView),e==null?void 0:e.multiFloorView)});return r&&n.outdoorView&&(n.outdoorView.token=r),n}function kN(e){let t={remove_watermark:!1};if(e)try{let r=mb(e);Object.assign(t,r.capabilities)}catch(r){V.error("Error decoding capabilities from token",r)}return t}var uc,li,Ka,Oy=class Oy extends un{constructor(r,n){let o=Object.values(n.mvfDataByFloorId)[0];super(r,o);f(this,"__type",Oy.__type);O(this,uc);O(this,li);O(this,Ka);k(this,li,{}),k(this,uc,r),k(this,Ka,n.mvfDataByFloorId)}static is(r){return r.__type===Oy.__type}get accessible(){var r;return(r=Object.values(c(this,Ka))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(c(this,Ka))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(c(this,Ka))[0].properties.extra}get coordinates(){return c(this,li).coordinates==null&&(c(this,li).coordinates=Object.entries(c(this,Ka)).map(([r,n])=>new $e(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),c(this,li).coordinates}get nodes(){return Object.values(c(this,Ka))[0].properties.nodes.map(r=>c(this,uc).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?c(this,uc).getById("floor",r.floorId):void 0).filter(Km)}get locationProfiles(){var n,o,i,s,a;if(c(this,li).locationProfiles!=null)return c(this,li).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let l=[(o=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?o:0,(s=(i=this.coordinates[0])==null?void 0:i.latitude)!=null?s:0],p=$s(l),u=(a=c(this,uc).mvfConnectionIdsByLatLon[p])!=null?a:[];for(let m of u){let h=c(this,uc).locationProfilesByAttachedFeatureId[m];if(h!=null){r=h;break}}}return c(this,li).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(c(this,li)))delete c(this,li)[r]}};uc=new WeakMap,li=new WeakMap,Ka=new WeakMap,f(Oy,"__type","connection");var hP=Oy,Wp=hP;d();var _y,Zp,dc,qp,Ey=class Ey extends un{constructor(r,n){super(r,n.mvfData);f(this,"__type",Ey.__type);O(this,_y);O(this,Zp);O(this,dc,{});O(this,qp);k(this,_y,r),k(this,Zp,n.floorId),k(this,qp,n.mvfData)}static is(r){return r.__type===Ey.__type}get type(){let r=c(this,qp).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=c(this,_y).getById("floor",c(this,Zp));if(r==null)throw new Error("Floor ".concat(c(this,Zp)," not found!"));return r}get center(){var r;if(c(this,dc).center==null){let[n,o]=(r=c(this,qp).properties.center)!=null?r:[0,0];c(this,dc).center=new $e(o,n,c(this,Zp))}return c(this,dc).center}get geoJSON(){return L(T({},c(this,qp)),{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(c(this,dc)))c(this,dc)[r]=null}};_y=new WeakMap,Zp=new WeakMap,dc=new WeakMap,qp=new WeakMap,f(Ey,"__type","object");var yP=Ey,Do=yP;d();var Ay,Xp,fc,Ff,ky=class ky extends un{constructor(r,n){super(r,n.mvfData);f(this,"__type",ky.__type);O(this,Ay);O(this,Xp);O(this,fc,{});O(this,Ff);k(this,Ay,r),k(this,Ff,n.mvfData),k(this,Xp,n.floorId)}static is(r){return r.__type===ky.__type}get floor(){let r=c(this,Ay).getById("floor",c(this,Xp));if(r==null)throw new Error("Floor ".concat(c(this,Xp)," not found!"));return r}get coordinate(){var r;if(c(this,fc).coordinate==null){let[n,o]=(r=c(this,Ff).geometry.coordinates)!=null?r:[0,0];c(this,fc).coordinate=new $e(o,n,c(this,Xp))}return c(this,fc).coordinate}get geoJSON(){return L(T({},c(this,Ff)),{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 c(this,fc))c(this,fc)[r]=null}};Ay=new WeakMap,Xp=new WeakMap,fc=new WeakMap,Ff=new WeakMap,f(ky,"__type","point-of-interest");var gP=ky,lc=gP;d();var Fy,Yp,mc,Kp,Ly,xP,Dy=class Dy extends un{constructor(r,n){super(r,n.mvfData);O(this,Ly);f(this,"__type",Dy.__type);O(this,Fy);O(this,Yp);O(this,mc,{});O(this,Kp);k(this,Fy,r),k(this,Yp,n.floorId),k(this,Kp,n.mvfData)}static is(r){return r.__type===Dy.__type}get group(){return ee(this,Ly,xP).call(this).group}get type(){return ee(this,Ly,xP).call(this).type}get coordinate(){if(c(this,mc).coordinate==null){let[r,n]=c(this,Kp).geometry.coordinates;c(this,mc).coordinate=new $e(n,r,c(this,Yp))}return c(this,mc).coordinate}get floor(){let r=c(this,Fy).getById("floor",c(this,Yp));if(r==null)throw new Error("Floor ".concat(c(this,Yp)," not found!"));return r}get geoJSON(){return L(T({},c(this,Kp)),{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(c(this,mc)))delete c(this,mc)[r]}};Fy=new WeakMap,Yp=new WeakMap,mc=new WeakMap,Kp=new WeakMap,Ly=new WeakSet,xP=function(){let[r,n]=c(this,Kp).properties.symbolId.split("--");return{group:r,type:n}},f(Dy,"__type","annotation");var bP=Dy,cc=bP;d();var hc,ci,Vi,Lf,Ny,IP,Ry=class Ry extends ji{constructor(r,n){super(n.mvfData.id,r);O(this,Ny);f(this,"__type",Ry.__type);O(this,hc);O(this,ci,{});O(this,Vi);O(this,Lf);k(this,hc,r),k(this,Vi,n.mvfData),k(this,Lf,n.facadeId)}static is(r){return r.__type===Ry.__type}get type(){return c(this,Vi).type}get name(){var r;return(r=ee(this,Ny,IP).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=ee(this,Ny,IP).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=c(this,Vi).externalId)!=null?r:""}get floors(){var r,n;if(c(this,ci).floors==null){let o=((n=(r=c(this,Vi).floors)!=null?r:c(this,Vi).maps)!=null?n:[]).reduce((i,s)=>{let a=c(this,hc).floorsById[s];return a&&i.push(a),i},[]);o.length===0&&V.error("Floor stack ".concat(this.id," has no floors")),c(this,ci).floors=o}return c(this,ci).floors}get defaultFloor(){if(c(this,ci).defaultFloor!=null)return c(this,ci).defaultFloor;let r=c(this,Vi).defaultFloor?c(this,hc).getById("floor",c(this,Vi).defaultFloor):void 0;return c(this,ci).defaultFloor=r||this.floors.reduce((n,o)=>Math.abs(o.elevation)<Math.abs(n.elevation)?o:n),c(this,ci).defaultFloor}get facade(){return c(this,Lf)?c(this,hc).facadesById[c(this,Lf)]: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(c(this,ci)))delete c(this,ci)[r]}};hc=new WeakMap,ci=new WeakMap,Vi=new WeakMap,Lf=new WeakMap,Ny=new WeakSet,IP=function(r){return c(this,hc).getPropTranslation(this.__type,r,this.id,c(this,Vi)[r])},f(Ry,"__type","floor-stack");var vP=Ry,Qx=vP;d();var Rf,Jp,$y,zs,By=class By extends ji{constructor(r,n){super(n.mvfData.id,r);f(this,"__type",By.__type);O(this,Rf);O(this,Jp);O(this,$y);O(this,zs,{});k(this,Rf,n.mvfData),k(this,Jp,r),k(this,$y,n.floorStackId)}static is(r){return r.__type===By.__type}get floorStack(){return c(this,Jp).getById("floor-stack",c(this,$y))}get spaces(){if(!c(this,zs).spaces){c(this,zs).spaces=[];for(let r of c(this,Rf).spaces){let n=c(this,Jp).getById("space",r.spaceId);n&&c(this,zs).spaces.push(n)}}return c(this,zs).spaces}get center(){if(!c(this,zs).center){let r={type:"FeatureCollection",features:[]};for(let o of this.spaces){let i=c(this,Jp).mvfSpacesById[o.id];i&&r.features.push(i)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=zx(r);c(this,zs).center=new $e(n.geometry.coordinates[1],n.geometry.coordinates[0],c(this,Rf).spaces[0].floorId)}return c(this,zs).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};Rf=new WeakMap,Jp=new WeakMap,$y=new WeakMap,zs=new WeakMap,f(By,"__type","facade");var SP=By,Ui=SP;d();var lae=(e,t)=>{var l,p,u,m,h,g,v,I,b,C,P;let r={},n={},o={},i={},s={},a={};for(let w of e["location.json"]||[]){let M=new Nf(t,{mvfData:w});if(r[w.id]=M,w.externalId&&(i[w.externalId]==null&&(i[w.externalId]=[]),i[w.externalId].push(M)),w.categories)for(let B of w.categories)s[B]==null&&(s[B]=[]),s[B].push(M);let E=[...(p=(l=w.obstructions)==null?void 0:l.map(B=>B.id))!=null?p:[],...(m=(u=w.spaces)==null?void 0:u.map(B=>B.id))!=null?m:[],...(g=(h=w.annotations)==null?void 0:h.map(B=>B.id))!=null?g:[],...(v=w.connections)!=null?v:[],...(b=(I=w.entrances)==null?void 0:I.map(B=>B.id))!=null?b:[],...(P=(C=w.areas)==null?void 0:C.map(B=>B.id))!=null?P:[]];for(let B of E)B&&(a[B]==null&&(a[B]=[]),a[B].push(M))}for(let w of e["category.json"]||[]){let M=new tv(t,{mvfData:w});n[w.id]=M,w.parent&&(o[w.parent]==null&&(o[w.parent]=[]),o[w.parent].push(M))}return{locationCategoriesByParentId:o,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:i,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:a}},cae=(e,t,r)=>{var b,C;let n={},o={},i={},s={},a={},l={},p={},u={},m={},h={},g={},v={},I=globalThis.Object.keys(e.space);for(let P of I){let w=e.space[P];if(w!=null)for(let M of w.features){v[M.properties.id]=P,p[M.properties.id]=M;for(let E of M.properties.destinationNodes)a[E]==null&&(a[E]=[]),a[E].push(M.properties.id);if(M.properties.kind==="desk-entrance"&&(l[M.properties.externalId]==null&&(l[M.properties.externalId]=[]),l[M.properties.externalId].push(...M.properties.destinationNodes)),!["void","desk-entrance"].includes((b=M.properties.kind)!=null?b:"")){if((C=M.properties.kind)!=null&&C.includes("connection")){let E=$s(M.geometry.coordinates);h[E]==null&&(h[E]=[]),h[E].push(M.properties.id);continue}if(M.properties.kind==="poi"){let E=new lc(r,{floorId:P,mvfData:M});i[M.properties.id]=E,m[P]||(m[P]=[]),m[P].push(M),M.properties.externalId&&(s[M.properties.externalId]==null&&(s[M.properties.externalId]=[]),s[M.properties.externalId].push(E))}else{let E=new Jr(r,{floorId:P,mvfData:M});n[M.properties.id]=E,M.properties.externalId&&(o[M.properties.externalId]==null&&(o[M.properties.externalId]=[]),o[M.properties.externalId].push(E)),u[P]||(u[P]=[]),u[P].push(M)}}}}for(let P in h){let w=h[P],M={};for(let B of w){let $=v[B],D=p[B],F=t==null?void 0:t["n_"+D.properties.id.split("s_")[1]];M[$]=L(T({},D),{properties:L(T({},D.properties),{accessible:(F==null?void 0:F.accessible)===!0})})}let E=new Wp(r,{mvfDataByFloorId:M});g[E.id]=E}return{spacesById:n,spacesByExternalId:o,poisById:i,poisByExternalId:s,connectionsById:g,spaceIdsByDestinationNodeId:a,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:p,connectionIdsByLatLon:h,mvfSpacesByFloorId:u,mvfPoisByFloorId:m}},pae=(e,t)=>{var s,a;let r={},n={},o={},i={};for(let l of e["node.geojson"].features){o[l.properties.id]=l;let p=new oc(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});r[l.properties.id]=p,l.properties.externalId&&(n[l.properties.externalId]==null&&(n[l.properties.externalId]=[]),n[l.properties.externalId].push(p));let u=(a=l.properties.floor)!=null?a:l.properties.map;i[u]||(i[u]=[]),i[u].push(l)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}},uae=(e,t)=>{let r={},n={},o={},i={},s=globalThis.Object.keys(e.obstruction);for(let a of s){let l=e.obstruction[a];if(l!=null)for(let p of l.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 u=new Do(t,{floorId:a,mvfData:p});r[p.properties.id]=u,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(u))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:o,obstructionIdByEntranceId:i}},dae=(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 s=new fo(t,{mvfData:i});r[i.properties.id]=s,i.properties.externalId&&(n[i.properties.externalId]==null&&(n[i.properties.externalId]=[]),n[i.properties.externalId].push(s))}else for(let i of e["map.geojson"]){o[i.id]=i;let s=new fo(t,{mvfData:{properties:i}});r[i.id]=s}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:o}},fae=(e,t)=>{var l;let r={},n={},o={},i={},s={},a=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(a!=null)for(let p of a){let u=(l=e.facade)==null?void 0:l[p.id],m=new Qx(t,{mvfData:p,facadeId:u==null?void 0:u.id});if(r[p.id]=m,p.externalId&&(n[p.externalId]==null&&(n[p.externalId]=[]),n[p.externalId].push(m)),o[p.id]=p,u){let h=new Ui(t,{mvfData:u,floorStackId:p.id});i[u.id]=h;for(let g of u.spaces)s[g.spaceId]=h}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:o,facadesById:i,facadesBySpaceId:s}},mae=(e,t)=>{let r={},n={},o=e["connection.json"].reduce((i,s)=>{s.nodes.forEach(l=>i[l]=s),r[s.id]=s;let a=t==null?void 0:t[s.nodes[0]];if(a!=null){let l=$s(a.geometry.coordinates);n[l]==null&&(n[l]=[]),n[l].push(s.id)}return i},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:n}},hae=(e,t)=>{let r={},n={},o={},i={},s={},a=globalThis.Object.keys(e.entrance);for(let l of a){let p=e.entrance[l];if(p!=null)for(let u of p.features){i[u.properties.id]=u;let m=new js(t,{floorId:l,mvfData:u});u.properties.node&&(o[u.properties.node]=m),r[u.properties.id]=m,u.properties.externalId&&(n[u.properties.externalId]==null&&(n[u.properties.externalId]=[]),n[u.properties.externalId].push(m)),s[l]||(s[l]=[]),s[l].push(u)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:o,mvfEntrancesById:i,mvfEntrancesByFloorId:s}},yae=(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 s of i)if("anchorId"in s.properties){let a=s==null?void 0:s.properties,l=t[a.anchorId]||r[a.anchorId];if(l!=null&&a!=null){let p=l.properties;p.textArea=a,p.textArea&&(p.textArea.position=s.geometry.coordinates)}}}}},gae=(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 s of i)if("anchorId"in s.properties){let a=s==null?void 0:s.properties,l=t[a.anchorId]||r[a.anchorId];if(l!=null&&a!=null){let p=l.properties;p.image=a,p.image&&(p.image.position=s.geometry.coordinates)}}}}},bae=(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 s=r[i];s.geometryAnchors.forEach(a=>{let l=t[a.geometryId];if(l!=null){let p=l.properties;p.style={styleId:i,edgeOffset:s.edgeOffset}}})}},xae=(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 s=i.properties;s.textures==null&&(s.textures=[]),s.textures.push(n)}}},vae=(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 s of i){let a=e.annotation[s];if(a!=null)for(let l of a.features){n[l.properties.id]=l;let p=new cc(t,{floorId:s,mvfData:l});r[l.properties.id]=p,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o}},Iae=(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 s of i){let a=e.area[s];if(a!=null)for(let l of a.features){o[l.properties.id]=l;let p=new sc(t,{floorId:s,mvfData:l});r[l.properties.id]=p,l.properties.externalId&&(n[l.properties.externalId]==null&&(n[l.properties.externalId]=[]),n[l.properties.externalId].push(p))}}return{areasById:r,areasByExternalId:n,mvfAreasById:o}},AN=(e,t)=>{var C,P,w,M,E,B,$,D,F,W,G,U,J;let r={},n={},o={},i={},s=((P=(C=e.enterprise)==null?void 0:C.locations)!=null?P:[]).reduce((X,ie)=>(X[ie.id]=ie,X),{}),a={},l={},p={},u={},m={},h={},g=((w=e.enterprise)==null?void 0:w.venue)||{},v={},I={};for(let X of(E=(M=e.enterprise)==null?void 0:M.categories)!=null?E:[]){let ie=new ev(t,{mvfData:X});a[X.id]=ie,X.externalId&&(l[X.externalId]==null&&(l[X.externalId]=[]),l[X.externalId].push(ie)),p[X.id]=X,X.locations.forEach(te=>{m[te]==null&&(m[te]=[]),m[te].push(X.id)})}let b={};for(let X of($=(B=e.enterprise)==null?void 0:B.locationInstances)!=null?$:[]){let ie=s[X.parent],te=Object.keys(ie),xe={};for(let he of te)xe[he]=void 0;let Pe=T(L(T({},xe),{polygons:[],nodes:[]}),X);b[Pe.parent]==null&&(b[Pe.parent]=[]),b[Pe.parent].push(new Xa(t,{mvfData:Pe,categoryIds:((F=(D=e.enterprise)==null?void 0:D.categoryPriorities)==null?void 0:F[Pe.id])||m[Pe.id],parentId:X.parent})),v[Pe.id]=X}for(let X in e.space){let ie=e.space[X];if(ie!=null)for(let te of ie.features)for(let xe of te.properties.destinationNodes)I[xe]==null&&(I[xe]=[]),I[xe].push(te.properties.id)}for(let X of(G=(W=e.enterprise)==null?void 0:W.locations)!=null?G:[]){let ie=new Xa(t,{mvfData:X,categoryIds:((J=(U=e.enterprise)==null?void 0:U.categoryPriorities)==null?void 0:J[X.id])||m[X.id],locationInstances:b[X.id]});o[X.id]=ie,X.externalId&&(i[X.externalId]==null&&(i[X.externalId]=[]),i[X.externalId].push(ie)),X.nodes.forEach(te=>{h[te.id]==null&&(h[te.id]=[]),h[te.id].push(X.id)});for(let te of X.polygons)u[te.id]==null&&(u[te.id]=[]),u[te.id].push(X)}if(t.enterpriseMode===!0){for(let X in t.mvfConnectionsById){let ie={},te=t.mvfConnectionsById[X];for(let xe of t.mvfConnectionsById[X].nodes){let Pe=t.nodesById[xe];Pe!=null&&(ie[Pe.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[Pe.coordinate.longitude,Pe.coordinate.latitude]},properties:{id:X,externalId:te.externalId,kind:"enterprise."+te.type,destinationNodes:[],flags:"",type:te.type,nodes:te.nodes,accessible:te.accessible,extra:te.extra,details:te.details}})}Object.keys(ie).length>0&&(r[X]=new Wp(t,{mvfDataByFloorId:ie}),te.externalId&&(n[te.externalId]==null&&(n[te.externalId]=[]),n[te.externalId].push(r[X])))}t.connectionsById=r}return{spaceIdsByNodeId:I,connectionsByExternalId:n,locationIdsByNodeId:h,mvfLocationsBySpaceId:u,mvfLocationsById:s,mvfCategoriesById:p,locationsById:o,locationsByExternalId:i,locationInstancesById:v,categoriesById:a,categoriesByExternalId:l,venue:g}},DN=(e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}=pae(e,t),{mvfConnectionsById:s,mvfConnectionsByNodeId:a,mvfConnectionIdsByLatLon:l}=mae(e,o),{spacesById:p,spacesByExternalId:u,spaceIdsByDestinationNodeId:m,poisById:h,poisByExternalId:g,mvfSpacesById:v,objectEntranceNodeIdsByObstructionId:I,connectionsById:b,connectionIdsByLatLon:C,mvfSpacesByFloorId:P,mvfPoisByFloorId:w}=cae(e,a,t),{objectsById:M,objectsByExternalId:E,mvfObstructionById:B,obstructionIdByEntranceId:$}=uae(e,t),{floorsById:D,floorsByExternalId:F,mvfFloorsById:W}=dae(e,t),{floorStacksById:G,floorStacksByExternalId:U,mvfFloorStacksById:J,facadesById:X,facadesBySpaceId:ie}=fae(e,t),{doorsById:te,doorsByExternalId:xe,doorsByNodeId:Pe,mvfEntrancesById:he,mvfEntrancesByFloorId:Re}=hae(e,t),{annotationsById:rt,mvfAnnotationsById:it,mvfAnnotationsByFloorId:We}=vae(e,t),{areasById:Xe,areasByExternalId:ue,mvfAreasById:ye}=Iae(e,t);gae(e,v,B),yae(e,v,B),bae(e,v),xae(e,v,B);let{locationCategoriesByParentId:fe,locationProfilesById:ne,locationCategoriesById:A,locationProfilesByExternalId:Y,locationProfilesByCategoryId:R,locationProfilesByAttachedFeatureId:ce}=lae(e,t);return{spacesById:p,spacesByExternalId:u,nodesById:r,nodesByExternalId:n,objectsById:M,objectsByExternalId:E,floorsById:D,floorsByExternalId:F,floorStacksById:G,floorStacksByExternalId:U,facadesById:X,facadesBySpaceId:ie,connectionsById:b,doorsById:te,doorsByExternalId:xe,doorsByNodeId:Pe,poisById:h,poisByExternalId:g,annotationsById:rt,areasById:Xe,areasByExternalId:ue,spaceIdsByDestinationNodeId:m,objectEntranceNodeIdsByObstructionId:I,obstructionIdByEntranceId:$,connectionIdsByLatLon:C,locationProfilesById:ne,locationCategoriesById:A,locationProfilesByExternalId:Y,locationProfilesByCategoryId:R,locationCategoriesByParentId:fe,mvfSpacesById:v,mvfNodesById:o,mvfObstructionById:B,mvfFloorsById:W,mvfFloorStacksById:J,mvfConnectionsById:s,mvfConnectionsByNodeId:a,mvfEntrancesById:he,mvfAnnotationsById:it,mvfNodesByFloorId:i,mvfSpacesByFloorId:P,mvfPoisByFloorId:w,mvfAreasById:ye,mvfEntrancesByFloorId:Re,mvfAnnotationsByFloorId:We,locationProfilesByAttachedFeatureId:ce,mvfConnectionIdsByLatLon:l}};d();var Sae=new Set(["polygons"]),zi,ur,mo,Gy,jy=class jy extends Vr{constructor(r,n){super(n.mvfData.externalId);f(this,"__type",jy.__type);f(this,"description");f(this,"name","");f(this,"amenity");f(this,"externalId","");f(this,"extra");f(this,"gallery");f(this,"instances");f(this,"logo");f(this,"operationHours");f(this,"phone");f(this,"picture");f(this,"shortName");f(this,"showFloatingLabelWhenImagePresent");f(this,"showLogo");f(this,"siblingGroups");f(this,"social");f(this,"sortOrder",-1);f(this,"states");f(this,"tags");f(this,"type","");f(this,"hidden",!1);O(this,zi);O(this,ur,{});O(this,mo);O(this,Gy);k(this,zi,r),k(this,mo,n.mvfData),k(this,Gy,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let o in n.mvfData)!Sae.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(n.parentId){let i=c(this,zi).locationsById[n.parentId];return c(this,mo)[o]!=null?c(this,zi).getPropTranslation(this.__type,o,c(this,mo).id,c(this,mo)[o]):c(this,zi).getPropTranslation(this.__type,o,c(this,mo).id,i[o])}return c(this,zi).getPropTranslation(this.__type,o,c(this,mo).id,c(this,mo)[o])}})}static is(r){return r.__type===jy.__type}get focusTarget(){return this.spaces}get categories(){return c(this,ur).categories?c(this,ur).categories:(c(this,ur).categories=(c(this,Gy).map(r=>c(this,zi).getById("enterprise-category",r))||[]).filter(Boolean),c(this,ur).categories)}get coordinates(){if(c(this,ur).coordinates)return c(this,ur).coordinates;c(this,ur).coordinates=[];for(let r=0;r<this.nodes.length;r++)c(this,ur).coordinates.push(this.nodes[r].coordinate);return c(this,ur).coordinates}get nodes(){if(c(this,ur).nodes)return c(this,ur).nodes;c(this,ur).nodes=[];for(let r=0;r<c(this,mo).nodes.length;r++){let n=c(this,zi).getById("node",c(this,mo).nodes[r].id);n&&c(this,ur).nodes.push(n)}return c(this,ur).nodes}get spaces(){if(c(this,ur).spaces)return c(this,ur).spaces;c(this,ur).spaces=[];for(let r=0;r<c(this,mo).polygons.length;r++){let n=c(this,zi).getById("space",c(this,mo).polygons[r].id);n&&c(this,ur).spaces.push(n)}return c(this,ur).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,ur)))delete c(this,ur)[r]}};zi=new WeakMap,ur=new WeakMap,mo=new WeakMap,Gy=new WeakMap,f(jy,"__type","enterprise-location");var CP=jy,Xa=CP;d();var Cae=new Set,Qp,Zn,Hs,Uy=class Uy extends Vr{constructor(r,n){super(n.mvfData.externalId);f(this,"__type",Uy.__type);f(this,"name","");f(this,"color");f(this,"externalId","");f(this,"extra");f(this,"icon");f(this,"iconFromDefaultList");f(this,"sortOrder",-1);f(this,"picture");O(this,Qp);O(this,Zn,{});O(this,Hs);k(this,Qp,r),k(this,Hs,n.mvfData);for(let o in n.mvfData)!Cae.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return c(this,Qp).getPropTranslation(this.__type,o,c(this,Hs).id,c(this,Hs)[o])}})}static is(r){return r.__type===Uy.__type}get children(){if(c(this,Zn).children)return c(this,Zn).children;c(this,Zn).children=[];for(let r=0;r<c(this,Hs).children.length;r++){let n=c(this,Qp).getById("enterprise-category",c(this,Hs).children[r]);n&&c(this,Zn).children.push(n)}return c(this,Zn).children}get locations(){if(c(this,Zn).locations)return c(this,Zn).locations;c(this,Zn).locations=[];for(let r=0;r<c(this,Hs).locations.length;r++){let n=c(this,Qp).getById("enterprise-location",c(this,Hs).locations[r]);n&&c(this,Zn).locations.push(n)}return c(this,Zn).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,Zn)))delete c(this,Zn)[r]}};Qp=new WeakMap,Zn=new WeakMap,Hs=new WeakMap,f(Uy,"__type","enterprise-category");var TP=Uy,ev=TP;d();var Tae=new Set,zy,Hy,Vy=class Vy extends Vr{constructor(r,n){super(n.mvfData.externalId);f(this,"__type",Vy.__type);f(this,"countrycode");f(this,"externalId","");f(this,"defaultLanguage",{code:"en",name:"English"});f(this,"defaultMap");f(this,"extra");f(this,"icon");f(this,"languages",[]);f(this,"links",[]);f(this,"logo");f(this,"mappedinWebUrl");f(this,"slug","");f(this,"topLocations");f(this,"tzid");O(this,zy,{});O(this,Hy);k(this,Hy,n.mvfData);for(let o in n.mvfData)!Tae.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=n.mvfData[o])}static is(r){return r.__type===Vy.__type}get name(){var r;return(r=c(this,Hy).name)!=null?r:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,zy)))delete c(this,zy)[r]}};zy=new WeakMap,Hy=new WeakMap,f(Vy,"__type","enterprise-venue");var PP=Vy,wP=PP;d();function MP(e){var o,i,s,a,l,p;let t=((i=(o=e.enterprise)==null?void 0:o.locations)==null?void 0:i.reduce((u,m)=>(u[m.id]=m,u),{}))||{};for(let u of((s=e.enterprise)==null?void 0:s.locationInstances)||[])t[u.id]=u;let r={};for(let u of e["floorstack.json"]||[])r[u.id]=u;let n={};for(let u of((a=e["floor.geojson"])==null?void 0:a.features)||[])u.properties&&u.properties.id&&(n[u.properties.id]=u.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((p=(l=e.enterprise)==null?void 0:l.categories)==null?void 0:p.reduce((u,m)=>(u[m.id]=m,u),{}))||{},"floor-stack":r,floor:n}}}function FN(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}function LN(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}d();d();d();d();d();d();d();var eu=class{constructor({origin:t,destination:r,distance:n=0,angle:o=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:s=!0}){f(this,"origin");f(this,"destination");f(this,"distance");f(this,"angle");f(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=o,this.weight=i||0,s?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.")}};d();d();d();function Ja(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=ii(e),o=Tf(t),i=o.type,s=t.bbox,a=o.coordinates;if(s&&Pae(n,s)===!1)return!1;i==="Polygon"&&(a=[a]);for(var l=!1,p=0;p<a.length&&!l;p++)if(RN(n,a[p][0],r.ignoreBoundary)){for(var u=!1,m=1;m<a[p].length&&!u;)RN(n,a[p][m],!r.ignoreBoundary)&&(u=!0),m++;u||(l=!0)}return l}function RN(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 s=t[o][0],a=t[o][1],l=t[i][0],p=t[i][1],u=e[1]*(s-l)+a*(l-e[0])+p*(e[0]-s)===0&&(s-e[0])*(l-e[0])<=0&&(a-e[1])*(p-e[1])<=0;if(u)return!r;var m=a>e[1]!=p>e[1]&&e[0]<(l-s)*(e[1]-a)/(p-a)+s;m&&(n=!n)}return n}function Pae(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}d();d();function Qa([e,t],[r,n]){let o=t-n,i=e-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}d();var wae=63710088e-1;function Hi(e,t){let[r,n]=e.map(u=>u*Math.PI/180),[o,i]=t.map(u=>u*Math.PI/180),s=i-n,a=o-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(a/2)*Math.sin(a/2),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return wae*p}d();d();function rv(e,t,r,n){let[o,i]=e,[s,a]=t,[l,p]=r,[u,m]=n;if(i===a&&o===s||p===m&&l===u)return null;let h=(u-l)*(a-i)-(m-p)*(s-o);if(h===0)return null;let g=((m-p)*(o-l)-(u-l)*(i-p))/h,v=((a-i)*(o-l)-(s-o)*(i-p))/h;if(g<0||g>1||v<0||v>1)return null;let I=i+g*(a-i);return[o+g*(s-o),I]}d();function OP(e,t,r,n){let o=Fp(e,r/1e3,n),i=Fp(t,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}d();function EP(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}var NN=111e3;function BN(e,t,r=[],n=0){let o=!0,i=e.geometry.coordinates,s=t.geometry.coordinates,a=EP(Qa(i,s)-Math.PI/2),l=EP(Qa(i,s)+Math.PI/2),p=n/NN,u=n/(NN*Math.cos(i[1]*Math.PI/180)),m=Math.min(i[1],s[1])-p,h=Math.max(i[1],s[1])+p,g=Math.min(i[0],s[0])-u,v=Math.max(i[0],s[0])+u;for(let I of r)if(!(Math.max(I[0][1],I[1][1])<m||Math.min(I[0][1],I[1][1])>h||Math.max(I[0][0],I[1][0])<g||Math.min(I[0][0],I[1][0])>v)){if(n>0){let b=OP(i,s,n,a),C=OP(i,s,n,l);if(rv(b[0],b[1],I[0],I[1])||rv(C[0],C[1],I[0],I[1])){o=!1;return}}else if(rv(i,s,I[0],I[1])){o=!1;return}}return o}var tu,dn,_P,$N,jN,GN,UN,VN,zN,ov,nv=class{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){O(this,dn);f(this,"edges",{});f(this,"nodesById");f(this,"nodesByGroup",new Map);O(this,tu);O(this,ov,(t,r)=>{let n=0;for(let o of r)(!o[c(this,tu)]||o[c(this,tu)]===t.properties[c(this,tu)])&&Ja(t.geometry.coordinates,o.geometry.geometry)&&(n+=Math.max(0,o.cost));return n});k(this,tu,r);let{features:o}=t;this.nodesById=ee(this,dn,$N).call(this,o),ee(this,dn,jN).call(this),ee(this,dn,GN).call(this,o,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,o)=>{let i=Hi(t.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:o,zones:i,overrideEdgeWeights:s}){var h;let a=ee(this,dn,_P).call(this,t),l=ee(this,dn,_P).call(this,r);if(a.length===0||l.length===0)return[];let{frontier:p,cameFrom:u,costSoFar:m}=ee(this,dn,UN).call(this,a,l);for(;p.length>0;){let g=p.shift();if(!g)break;if(ee(this,dn,VN).call(this,g.origin,l))return ee(this,dn,zN).call(this,u,g.origin.properties.id);for(let v of this.edges[g.origin.properties.id]){let I=(h=s==null?void 0:s.get(v))!=null?h:v.weight;if(o!=null&&o.has(v.origin.properties.id)&&v.destination.properties.map!==v.origin.properties.map)continue;let b=m[g.origin.properties.id]+I+c(this,ov).call(this,v.destination,i);if(!(b===1/0||n!=null&&n.has(v.destination.properties.id))&&(m[v.destination.properties.id]==null||b<m[v.destination.properties.id])){let C=b+this.getShortestEuclideanDistance(v.destination,l);m[v.destination.properties.id]=b,u[v.destination.properties.id]=v,p.push({origin:v.destination,priority:C})}}p.sort((v,I)=>v.priority-I.priority)}return[]}};tu=new WeakMap,dn=new WeakSet,_P=function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},$N=function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},jN=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]))},GN=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:s,weight:a})=>{let l=this.nodesById[s],p=Hi(o.geometry.coordinates,l.geometry.coordinates),u=Qa(o.geometry.coordinates,l.geometry.coordinates);return new eu({origin:o,destination:l,pathWeight:a,distance:p,angle:u,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},UN=function(t,r){let n=[],o={},i={};return t.forEach(s=>{let a=this.getShortestEuclideanDistance(s,r);n.push({origin:s,priority:a}),o[s.properties.id]=null,i[s.properties.id]=0}),n.sort((s,a)=>s.priority-a.priority),{frontier:n,cameFrom:o,costSoFar:i}},VN=function(t,r){return r.some(n=>n.properties.id===t.properties.id)},zN=function(t,r){let n=[],o=t[r];for(;o;)n.push(o),o=t[o.origin.properties.id];return n.reverse()},ov=new WeakMap;var Mae=.4,Bf=class{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o}){f(this,"groupBy");f(this,"graph");f(this,"geometryEdgesByMapId",new Map);f(this,"generatePath",t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let i=0;i<t.length;i++){let{origin:s,destination:a}=t[i],l={id:s.properties.id,angle:t[i].angle,distance:t[i].distance,destination:a.properties.id,edges:this.graph.edges[s.properties.id]};this.groupBy!=="default"&&(l.groupBy=s.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:l})}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});f(this,"getDistance",(t,r)=>Hi(t,r));f(this,"getAngle",(t,r)=>Qa(t,r));this.groupBy=n,this.graph=new nv({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o}),((r==null?void 0:r.features)||[]).forEach(s=>{let a=null;if(s.geometry.type==="LineString"?a=s.geometry.coordinates:s.geometry.type==="Polygon"&&(a=s.geometry.coordinates.flat()),a){let l=this.groupBy==="default"?this.groupBy:s.properties[this.groupBy];this.geometryEdgesByMapId.has(l)||this.geometryEdgesByMapId.set(l,[]),a.forEach((p,u)=>{this.geometryEdgesByMapId.get(l).push([p,a[u+1]||a[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:o,disabledConnectionNodeIds:i,simplify:s,multiplicativeDistanceWeightScaling:a,overrideEdgeWeights:l}){var h,g;let p=(h=s==null?void 0:s.enabled)!=null?h:!0,u=t!=null?t:[],m=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:u,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(i),overrideEdgeWeights:l});return m.length===0?{type:"FeatureCollection",features:[]}:(p&&(m=this.simplifyAllSteps(m,(g=s==null?void 0:s.bufferRadius)!=null?g:Mae,a)),this.generatePath(m))}simplifyAllSteps(t,r,n){var p,u;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 h=t[m-1].origin.properties[this.groupBy],g=(p=this.geometryEdgesByMapId.get(h))!=null?p:[];o.push(...this.simplifySteps(i,g,r,n)),i=[t[m]]}else i.push(t[m]);let s=t[t.length-1],a=this.groupBy==="default"?this.groupBy:s.origin.properties[this.groupBy],l=(u=this.geometryEdgesByMapId.get(a))!=null?u:[];return o.push(...this.simplifySteps(i,l,r,n)),o}simplifySteps(t,r,n,o){if(t.length<3)return t;let i=[t[0]],s=1;for(let a=s+2;a<t.length;a++)if(t[s].origin.properties.preventSmoothing||!BN(t[s].origin,t[a].origin,r,n)){let l=a-1;i.push(new eu(L(T({},t[s]),{destination:t[l].origin,distance:Hi(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:Qa(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates)}))),s=l}return i.push(new eu(L(T({},t[s]),{destination:t[t.length-1].origin,distance:Hi(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:Qa(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o})),t[t.length-1]),i}};d();function pi(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}function Oae(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}var kP=(e,t)=>{let r=Oae(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],s=(o.properties.entrances||[]).reduce((a,l)=>(r.has(l)&&a.push(r.get(l)),a),[]);if(s.length){let{entrances:a,obstructions:l}=tP(o,s);i=l.map(p=>p.geometry.coordinates),n.entrances.features.push(...a)}n.walls.geometry.coordinates.push(...i)}return n};function HN(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}function WN(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}function iv(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}function AP(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}function ZN(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}function qN(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function XN(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}function YN(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}function sv(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=L(T({},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)}function $f(e,t={}){var o,i,s,a,l,p,u;let r=L(T({},e),{flipImageToFaceCamera:(o=t==null?void 0:t.flipImagesToFaceCamera)!=null?o:!0}),n=(s=(i=t==null?void 0:t.style)==null?void 0:i.shading)!=null?s: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=(l=(a=t==null?void 0:t.style)==null?void 0:a.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let m=(u=(p=t==null?void 0:t.style)==null?void 0:p.wallTopColor)!=null?u:t==null?void 0:t.wallTopColor;m!=null&&(r.topColor=m)}return r}var KN=(e,t)=>{var o;let n=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Er);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(pc);case"exterior-walls":return n==null?void 0:n.layers.get(Us);case"interior-doors":return n==null?void 0:n.layers.get(kf);case"exterior-doors":return n==null?void 0:n.layers.get(Af);default:return typeof e=="string"?e:e.id}};function DP(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}function av(e){return e.bbox?e.bbox:cd(e)}function JN(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])]}function QN(e){return[...new Set(e)]}function FP(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}function jf(e){if(Jr.is(e)||Do.is(e))return e.id}function eB(e,t,r){var i,s,a,l,p,u;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),h=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);m&&h&&(o=((s=(i=r.getState(m))==null?void 0:i.visible)!=null?s:!0)&&((l=(a=r.getState(h))==null?void 0:a.visible)!=null?l:!0))}else{let m=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;o=m&&(u=(p=r.getState(m))==null?void 0:p.visible)!=null?u:!0}return o}var tB=Math.PI*.1,_r,Dn,qn,ru,nu,el,ou,Uf,ui,rB,Gf,nB,pv=class{constructor(t,r,n,o){O(this,ui);O(this,_r,{});O(this,Dn);O(this,qn);O(this,ru);O(this,nu);O(this,el);O(this,ou);O(this,Uf);k(this,Dn,r),k(this,qn,t.features),k(this,ru,n),k(this,nu,o)}get path(){return c(this,qn).map(t=>c(this,Dn).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(c(this,_r).departure)return c(this,_r).departure;let t=c(this,qn)[0].properties.id,r=c(this,ru)[0];if(c(this,ru).length>1){for(let n of c(this,ru))if(Wy(n,c(this,Dn)).includes(t)){r=n;break}}return c(this,_r).departure=r,r}get destination(){if(c(this,_r).destination)return c(this,_r).destination;let t=c(this,qn)[c(this,qn).length-1].properties.id,r=c(this,nu)[0];if(c(this,nu).length>1){for(let n of c(this,nu))if(Wy(n,c(this,Dn)).includes(t)){r=n;break}}return c(this,_r).destination=r,r}get coordinates(){return c(this,_r).coordinates?c(this,_r).coordinates:(c(this,_r).coordinates=c(this,qn).map(t=>new $e(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),c(this,_r).coordinates)}get distance(){return c(this,_r).distance?c(this,_r).distance:(c(this,_r).distance=c(this,qn).reduce((t,r)=>t+(r.properties.distance||0),0),c(this,_r).distance)}get instructions(){if(c(this,qn).length<2)return[];if(c(this,_r).instructions)return c(this,_r).instructions;let t=[],r=0;for(let n=0;n<c(this,qn).length;n++){let o=c(this,qn)[n],i=c(this,qn)[n-1],s=c(this,qn)[n+1],a=new $e(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=ee(this,ui,rB).call(this,{prevDirection:i,direction:o,nextDirection:s});r+=(i==null?void 0:i.properties.distance)||0;for(let p of l)p&&(t.push({action:p,distance:r,coordinate:a,node:c(this,Dn).getById("node",o.properties.id)}),r=0)}return c(this,_r).instructions=t,c(this,_r).instructions}};_r=new WeakMap,Dn=new WeakMap,qn=new WeakMap,ru=new WeakMap,nu=new WeakMap,el=new WeakMap,ou=new WeakMap,Uf=new WeakMap,ui=new WeakSet,rB=function(t){var v,I;let{prevDirection:r,direction:n,nextDirection:o}=t,i=r&&c(this,Dn).getById("floor",r.properties.groupBy),s=c(this,Dn).getById("floor",n.properties.groupBy),a=o&&c(this,Dn).getById("floor",o.properties.groupBy),l=[];r||l.push({type:"Departure"});let p=c(this,Dn).getMVFFeatureByNodeId("connection",n.properties.id),u=p?c(this,Dn).getById("connection",p.id):void 0,m=p&&p.nodes.length>1,h=c(this,Dn).enterpriseMode&&(!n.properties.destination||!(p!=null&&p.nodes.includes(n.properties.destination))||!(p!=null&&p.nodes.includes(n.properties.id)));if(p&&!(!m||h))if(!c(this,el)||c(this,el)==="exit")l.push(ee(this,ui,Gf).call(this,"TakeConnection",s,a,u,p)),k(this,el,"take"),k(this,ou,u),k(this,Uf,p);else{let b=c(this,Dn).getMVFFeatureByNodeId("connection",(v=r==null?void 0:r.properties.id)!=null?v:""),C=c(this,Dn).getById("connection",(I=b==null?void 0:b.id)!=null?I:"");l.push(ee(this,ui,Gf).call(this,"ExitConnection",s,i,C,b)),k(this,el,"exit"),k(this,ou,u),k(this,Uf,p)}else c(this,el)==="take"?(l.push(ee(this,ui,Gf).call(this,"ExitConnection",s,i,c(this,ou),c(this,Uf))),k(this,el,"exit"),k(this,ou,u)):a&&s.id!==a.id?l.push(ee(this,ui,Gf).call(this,"TakeConnection",s,a,u)):i&&i.id!==s.id?l.push(ee(this,ui,Gf).call(this,"ExitConnection",s,i,u)):l.push(ee(this,ui,nB).call(this,r,n));return o||l.push({type:"Arrival"}),l},Gf=function(t,r,n,o,i){var l,p;let s="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let u=r.elevation-n.elevation;u>0?s="down":u<0&&(s="up")}let a=(p=(l=o==null?void 0:o.type)!=null?l:i==null?void 0:i.type)!=null?p:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:s,connection:o,connectionType:a}},nB=function(t,r){let n=r.properties.edges;if(!n||n.filter(s=>s.destination.properties.id!==(t==null?void 0:t.properties.id)&&s.destination.properties.id!==r.properties.destination).length===0)return null;let i=t?-qN(t.properties.angle,r.properties.angle):0;return Math.abs(i)>=tB?{type:"Turn",bearing:XN(i,tB),referencePosition:"At"}:null};var uv=class{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:o,multiplicativeDistanceWeightScaling:i}){f(this,"navigator");f(this,"connections");f(this,"getDirections",(t,r,n,o)=>{let{accessible:i,smoothing:{enabled:s,radius:a},connectionIdWeightMap:l}=n,p=t.flatMap(b=>Wy(b,o)),u=r.flatMap(b=>Wy(b,o)),m=this.getExcludedNodeIds(n.excludedConnections).filter(b=>!p.includes(b)&&!u.includes(b)),h=this.getDisabledConnectionNodeIds(i).filter(b=>!p.includes(b)&&!u.includes(b)),g=new Map;for(let b in l){let C=o.getMVFFeatureById("connection",b);if(!C)continue;let P=this.navigator.graph.edges[C.nodes[0]];if(P){let w=P.find(M=>M.destination.properties.id===C.nodes[1]);w&&g.set(w,l[b])}}let v=this.navigator.getDirections({zones:n.zones.map(b=>{var C;return{geometry:b.geometry,cost:b.cost,map:(C=b.floor)==null?void 0:C.id}}),originIds:p,destinationNodeIds:u,excludedNodeIds:m,disabledConnectionNodeIds:h,simplify:{enabled:s,bufferRadius:a},overrideEdgeWeights:g,multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(v,t,r);let I=new pv(v,o,t,r);if(!(I.distance===0&&new Set([...p,...u]).size===p.length+u.length))return I});f(this,"getExcludedNodeIds",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,[])});f(this,"getDisabledConnectionNodeIds",t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]));f(this,"addCoordinateDirections",(t,[r],[n])=>{if(t.features.length){if($e.is(r)){let o=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if($e.is(n)){let o=this.createDirectionFeature(n,0,0),i=t.features[t.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[n.longitude,n.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(o)}}});f(this,"createDirectionFeature",(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:[]}}));this.navigator=new Bf({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))),[])}}};function Wy(e,t){var r,n,o,i;if(Nf.is(e))return e.navigationTarget.flatMap(s=>Wy(s,t));if(cc.is(e)){let s=t.Query.nearest(e,{types:["node"]});return(r=s==null?void 0:s[0])!=null&&r.feature.id?[s[0].feature.id]:[]}else if($e.is(e)){let s=t.Query.nearest(e,{types:["node"]});return(n=s==null?void 0:s[0])!=null&&n.feature.id?[s[0].feature.id]:[]}else if(lc.is(e)){let s=t.Query.nearest(e,{types:["node"]});return(o=s==null?void 0:s[0])!=null&&o.feature.id?[s[0].feature.id]:[]}else if(js.is(e)){let s=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return s!=null&&s.properties.node?[s==null?void 0:s.properties.node]:[]}else if(sc.is(e)){let s=t==null?void 0:t.getMVFFeatureById("area",e.id);return(i=s==null?void 0:s.properties.destinationNodes)!=null?i:[]}else if(Jr.is(e)){let s=t==null?void 0:t.getMVFFeatureById("space",e.id);return s==null?[]:s.properties.destinationNodes}else{if(Wp.is(e))return e.coordinates.reduce((s,a)=>{var p;let l=t.Query.nearest(a,{types:["node"]});return(p=l==null?void 0:l[0])!=null&&p.feature.id&&s.push(l[0].feature.id),s},[]);if(Do.is(e)){let s=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return s!=null?s:[]}else return Ui.is(e)?e.spaces.flatMap(s=>{var a,l;return(l=(a=t==null?void 0:t.getMVFFeatureById("space",s.id))==null?void 0:a.properties.destinationNodes)!=null?l:[]}).filter(s=>typeof s=="string"):Xa.is(e)?e.nodes.map(s=>s.id):oc.is(e)?[e.id]:[]}}d();d();d();d();d();d();function oB(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return iB(this.cover(t,r),t,r,e)}function iB(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i=e._root,s={data:n},a=e._x0,l=e._y0,p=e._x1,u=e._y1,m,h,g,v,I,b,C,P;if(!i)return e._root=s,e;for(;i.length;)if((I=t>=(m=(a+p)/2))?a=m:p=m,(b=r>=(h=(l+u)/2))?l=h:u=h,o=i,!(i=i[C=b<<1|I]))return o[C]=s,e;if(g=+e._x.call(null,i.data),v=+e._y.call(null,i.data),t===g&&r===v)return s.next=i,o?o[C]=s:e._root=s,e;do o=o?o[C]=new Array(4):e._root=new Array(4),(I=t>=(m=(a+p)/2))?a=m:p=m,(b=r>=(h=(l+u)/2))?l=h:u=h;while((C=b<<1|I)===(P=(v>=h)<<1|g>=m));return o[P]=i,o[C]=s,e}function sB(e){var t,r,n=e.length,o,i,s=new Array(n),a=new Array(n),l=1/0,p=1/0,u=-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))||(s[r]=o,a[r]=i,o<l&&(l=o),o>u&&(u=o),i<p&&(p=i),i>m&&(m=i));if(l>u||p>m)return this;for(this.cover(l,p).cover(u,m),r=0;r<n;++r)iB(this,s[r],a[r],e[r]);return this}d();function aB(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 s=o-r||1,a=this._root,l,p;r>e||e>=o||n>t||t>=i;)switch(p=(t<n)<<1|e<r,l=new Array(4),l[p]=a,a=l,s*=2,p){case 0:o=r+s,i=n+s;break;case 1:r=o-s,i=n+s;break;case 2:o=r+s,n=i-s;break;case 3:r=o-s,n=i-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this}d();function lB(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}d();function cB(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]]}d();d();function Qr(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function pB(e,t,r){var n,o=this._x0,i=this._y0,s,a,l,p,u=this._x1,m=this._y1,h=[],g=this._root,v,I;for(g&&h.push(new Qr(g,o,i,u,m)),r==null?r=1/0:(o=e-r,i=t-r,u=e+r,m=t+r,r*=r);v=h.pop();)if(!(!(g=v.node)||(s=v.x0)>u||(a=v.y0)>m||(l=v.x1)<o||(p=v.y1)<i))if(g.length){var b=(s+l)/2,C=(a+p)/2;h.push(new Qr(g[3],b,C,l,p),new Qr(g[2],s,C,b,p),new Qr(g[1],b,a,l,C),new Qr(g[0],s,a,b,C)),(I=(t>=C)<<1|e>=b)&&(v=h[h.length-1],h[h.length-1]=h[h.length-1-I],h[h.length-1-I]=v)}else{var P=e-+this._x.call(null,g.data),w=t-+this._y.call(null,g.data),M=P*P+w*w;if(M<r){var E=Math.sqrt(r=M);o=e-E,i=t-E,u=e+E,m=t+E,n=g.data}}return n}d();function uB(e){if(isNaN(u=+this._x.call(null,e))||isNaN(m=+this._y.call(null,e)))return this;var t,r=this._root,n,o,i,s=this._x0,a=this._y0,l=this._x1,p=this._y1,u,m,h,g,v,I,b,C;if(!r)return this;if(r.length)for(;;){if((v=u>=(h=(s+l)/2))?s=h:l=h,(I=m>=(g=(a+p)/2))?a=g:p=g,t=r,!(r=r[b=I<<1|v]))return this;if(!r.length)break;(t[b+1&3]||t[b+2&3]||t[b+3&3])&&(n=t,C=b)}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[b]=i:delete t[b],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[C]=r:this._root=r),this):(this._root=i,this)}function dB(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}d();function fB(){return this._root}d();function mB(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}d();function hB(e){var t=[],r,n=this._root,o,i,s,a,l;for(n&&t.push(new Qr(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,i=r.x0,s=r.y0,a=r.x1,l=r.y1)&&n.length){var p=(i+a)/2,u=(s+l)/2;(o=n[3])&&t.push(new Qr(o,p,u,a,l)),(o=n[2])&&t.push(new Qr(o,i,u,p,l)),(o=n[1])&&t.push(new Qr(o,p,s,a,u)),(o=n[0])&&t.push(new Qr(o,i,s,p,u))}return this}d();function yB(e){var t=[],r=[],n;for(this._root&&t.push(new Qr(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var o=n.node;if(o.length){var i,s=n.x0,a=n.y0,l=n.x1,p=n.y1,u=(s+l)/2,m=(a+p)/2;(i=o[0])&&t.push(new Qr(i,s,a,u,m)),(i=o[1])&&t.push(new Qr(i,u,a,l,m)),(i=o[2])&&t.push(new Qr(i,s,m,u,p)),(i=o[3])&&t.push(new Qr(i,u,m,l,p))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}d();function gB(e){return e[0]}function bB(e){return arguments.length?(this._x=e,this):this._x}d();function xB(e){return e[1]}function vB(e){return arguments.length?(this._y=e,this):this._y}function Zy(e,t,r){var n=new LP(t==null?gB:t,r==null?xB:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}function LP(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}function IB(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var Xn=Zy.prototype=LP.prototype;Xn.copy=function(){var e=new LP(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=IB(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]=IB(n));return e};Xn.add=oB;Xn.addAll=sB;Xn.cover=aB;Xn.data=lB;Xn.extent=cB;Xn.find=pB;Xn.remove=uB;Xn.removeAll=dB;Xn.root=fB;Xn.size=mB;Xn.visit=hB;Xn.visitAfter=yB;Xn.x=bB;Xn.y=vB;var Fo,yc,dv=class{constructor(t){O(this,Fo,{});O(this,yc);k(this,yc,t)}getTreeByType(t,r,n){var s;if(c(this,Fo)[t]||(c(this,Fo)[t]={}),c(this,Fo)[t][r]&&c(this,Fo)[t][r][n])return c(this,Fo)[t][r][n];c(this,Fo)[t][r]||(c(this,Fo)[t][r]={}),c(this,Fo)[t][r][n]||(c(this,Fo)[t][r][n]=Zy());let o=c(this,Fo)[t][r][n];o.x(a=>a.geometry.coordinates[1]),o.y(a=>a.geometry.coordinates[0]);let i=[];switch(t){case"node":i=((s=c(this,yc).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:s.filter(a=>a.properties.neighbors.length>0))||[];break;case"point-of-interest":i=c(this,yc).mvfPoisByFloorId[n]||[];break;case"door":i=c(this,yc).mvfEntrancesByFloorId[n]||[];break;case"annotation":i=c(this,yc).mvfAnnotationsByFloorId[n]||[];break}return(i==null?void 0:i.length)>0&&o.addAll(i),o}};Fo=new WeakMap,yc=new WeakMap;d();d();var j={};da(j,{BRAND:()=>ele,DIRTY:()=>iu,EMPTY_PATH:()=>Aae,INVALID:()=>Le,NEVER:()=>Ble,OK:()=>Fn,ParseStatus:()=>fn,Schema:()=>Je,ZodAny:()=>xc,ZodArray:()=>ol,ZodBigInt:()=>au,ZodBoolean:()=>lu,ZodBranded:()=>Xy,ZodCatch:()=>xu,ZodDate:()=>cu,ZodDefault:()=>bu,ZodDiscriminatedUnion:()=>hv,ZodEffects:()=>mi,ZodEnum:()=>yu,ZodError:()=>ho,ZodFirstPartyTypeKind:()=>je,ZodFunction:()=>gv,ZodIntersection:()=>fu,ZodIssueCode:()=>se,ZodLazy:()=>mu,ZodLiteral:()=>hu,ZodMap:()=>qf,ZodNaN:()=>Yf,ZodNativeEnum:()=>gu,ZodNever:()=>Wi,ZodNull:()=>uu,ZodNullable:()=>qs,ZodNumber:()=>su,ZodObject:()=>yo,ZodOptional:()=>di,ZodParsedType:()=>be,ZodPipeline:()=>Yy,ZodPromise:()=>vc,ZodReadonly:()=>vu,ZodRecord:()=>yv,ZodSchema:()=>Je,ZodSet:()=>Xf,ZodString:()=>bc,ZodSymbol:()=>Wf,ZodTransformer:()=>mi,ZodTuple:()=>Zs,ZodType:()=>Je,ZodUndefined:()=>pu,ZodUnion:()=>du,ZodUnknown:()=>nl,ZodVoid:()=>Zf,addIssueToContext:()=>de,any:()=>cle,array:()=>fle,bigint:()=>ole,boolean:()=>AB,coerce:()=>Nle,custom:()=>EB,date:()=>ile,datetimeRegex:()=>MB,defaultErrorMap:()=>tl,discriminatedUnion:()=>gle,effect:()=>Ele,enum:()=>wle,function:()=>Cle,getErrorMap:()=>Vf,getParsedType:()=>Ws,instanceof:()=>rle,intersection:()=>ble,isAborted:()=>fv,isAsync:()=>zf,isDirty:()=>mv,isValid:()=>gc,late:()=>tle,lazy:()=>Tle,literal:()=>Ple,makeIssue:()=>qy,map:()=>Ile,nan:()=>nle,nativeEnum:()=>Mle,never:()=>ule,null:()=>lle,nullable:()=>kle,number:()=>kB,object:()=>mle,objectUtil:()=>RP,oboolean:()=>Rle,onumber:()=>Lle,optional:()=>_le,ostring:()=>Fle,pipeline:()=>Dle,preprocess:()=>Ale,promise:()=>Ole,quotelessJson:()=>Eae,record:()=>vle,set:()=>Sle,setErrorMap:()=>kae,strictObject:()=>hle,string:()=>_B,symbol:()=>sle,transformer:()=>Ele,tuple:()=>xle,undefined:()=>ale,union:()=>yle,unknown:()=>ple,util:()=>ct,void:()=>dle});d();d();d();d();d();var ct;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},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 s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?"'".concat(s,"'"):s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(ct||(ct={}));var RP;(function(e){e.mergeShapes=(t,r)=>T(T({},t),r)})(RP||(RP={}));var be=ct.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ws=e=>{switch(typeof e){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(e)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(e)?be.array:e===null?be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?be.promise:typeof Map<"u"&&e instanceof Map?be.map:typeof Set<"u"&&e instanceof Set?be.set:typeof Date<"u"&&e instanceof Date?be.date:be.object;default:return be.unknown}};var se=ct.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"]),Eae=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ho=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,l=0;for(;l<s.path.length;){let p=s.path[l];l===s.path.length-1?(a[p]=a[p]||{_errors:[]},a[p]._errors.push(r(s))):a[p]=a[p]||{_errors:[]},a=a[p],l++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,ct.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()}};ho.create=e=>new ho(e);var _ae=(e,t)=>{let r;switch(e.code){case se.invalid_type:e.received===be.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case se.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,ct.jsonStringifyReplacer));break;case se.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(ct.joinValues(e.keys,", "));break;case se.invalid_union:r="Invalid input";break;case se.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(ct.joinValues(e.options));break;case se.invalid_enum_value:r="Invalid enum value. Expected ".concat(ct.joinValues(e.options),", received '").concat(e.received,"'");break;case se.invalid_arguments:r="Invalid function arguments";break;case se.invalid_return_type:r="Invalid function return type";break;case se.invalid_date:r="Invalid date";break;case se.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,'"'):ct.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case se.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 se.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 se.custom:r="Invalid input";break;case se.invalid_intersection_types:r="Intersection results could not be merged";break;case se.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case se.not_finite:r="Number must be finite";break;default:r=t.defaultError,ct.assertNever(e)}return{message:r}},tl=_ae;var SB=tl;function kae(e){SB=e}function Vf(){return SB}d();var qy=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s=L(T({},o),{path:i});if(o.message!==void 0)return L(T({},o),{path:i,message:o.message});let a="",l=n.filter(p=>!!p).slice().reverse();for(let p of l)a=p(s,{data:t,defaultError:a}).message;return L(T({},o),{path:i,message:a})},Aae=[];function de(e,t){let r=Vf(),n=qy({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===tl?void 0:tl].filter(o=>!!o)});e.common.issues.push(n)}var fn=class e{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 Le;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,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Le;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},Le=Object.freeze({status:"aborted"}),iu=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),fv=e=>e.status==="aborted",mv=e=>e.status==="dirty",gc=e=>e.status==="valid",zf=e=>typeof Promise<"u"&&e instanceof Promise;d();d();d();var Me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Me||(Me={}));var fi=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},CB=(e,t)=>{if(gc(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 ho(e.common.issues);return this._error=r,this._error}}};function qe(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)=>{var p,u;let{message:l}=e;return s.code==="invalid_enum_value"?{message:l!=null?l:a.defaultError}:typeof a.data>"u"?{message:(p=l!=null?l:n)!=null?p:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l!=null?l:r)!=null?u:a.defaultError}},description:o}}var Je=class{get description(){return this._def.description}_getType(t){return Ws(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ws(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new fn,ctx:{common:t.parent.common,data:t.data,parsedType:Ws(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(zf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!=null?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ws(t)},o=this._parseSync({data:t,path:n.path,parent:n});return CB(n,o)}"~validate"(t){var n,o;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ws(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:r});return gc(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>gc(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ws(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(zf(o)?o:Promise.resolve(o));return CB(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue(T({code:se.custom},n(o)));return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!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 mi({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return di.create(this,this._def)}nullable(){return qs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ol.create(this)}promise(){return vc.create(this,this._def)}or(t){return du.create([this,t],this._def)}and(t){return fu.create(this,t,this._def)}transform(t){return new mi(L(T({},qe(this._def)),{schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new bu(L(T({},qe(this._def)),{innerType:this,defaultValue:r,typeName:je.ZodDefault}))}brand(){return new Xy(T({typeName:je.ZodBranded,type:this},qe(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new xu(L(T({},qe(this._def)),{innerType:this,catchValue:r,typeName:je.ZodCatch}))}describe(t){let r=this.constructor;return new r(L(T({},this._def),{description:t}))}pipe(t){return Yy.create(this,t)}readonly(){return vu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dae=/^c[^\s-]{8,}$/i,Fae=/^[0-9a-z]+$/,Lae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Rae=/^[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,Nae=/^[a-z0-9_-]{21}$/i,Bae=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$ae=/^[-+]?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)?)??$/,jae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",NP,Uae=/^(?:(?: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])$/,Vae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,zae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Hae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Zae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,PB="((\\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])))",qae=new RegExp("^".concat(PB,"$"));function wB(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}function Xae(e){return new RegExp("^".concat(wB(e),"$"))}function MB(e){let t="".concat(PB,"T").concat(wB(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,"$"))}function Yae(e,t){return!!((t==="v4"||!t)&&Uae.test(e)||(t==="v6"||!t)&&zae.test(e))}function Kae(e,t){if(!Bae.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch(r){return!1}}function Jae(e,t){return!!((t==="v4"||!t)&&Vae.test(e)||(t==="v6"||!t)&&Hae.test(e))}var bc=class e extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==be.string){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:be.string,received:i.parsedType}),Le}let n=new fn,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),de(o,{code:se.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),de(o,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?de(o,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&de(o,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")jae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"email",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")NP||(NP=new RegExp(Gae,"u")),NP.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"emoji",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Rae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"uuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Nae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"nanoid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Dae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"cuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Fae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"cuid2",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Lae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"ulid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch(s){o=this._getOrReturnCtx(t,o),de(o,{validation:"url",code:se.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),de(o,{validation:"regex",code:se.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),de(o,{code:se.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),de(o,{code:se.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?MB(i).test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?qae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Xae(i).test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?$ae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"duration",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Yae(t.data,i.version)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"ip",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Kae(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"jwt",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Jae(t.data,i.version)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"cidr",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Wae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"base64",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?Zae.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"base64url",code:se.invalid_string,message:i.message}),n.dirty()):ct.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),T({validation:r,code:se.invalid_string},Me.errToObj(n)))}_addCheck(t){return new e(L(T({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(T({kind:"email"},Me.errToObj(t)))}url(t){return this._addCheck(T({kind:"url"},Me.errToObj(t)))}emoji(t){return this._addCheck(T({kind:"emoji"},Me.errToObj(t)))}uuid(t){return this._addCheck(T({kind:"uuid"},Me.errToObj(t)))}nanoid(t){return this._addCheck(T({kind:"nanoid"},Me.errToObj(t)))}cuid(t){return this._addCheck(T({kind:"cuid"},Me.errToObj(t)))}cuid2(t){return this._addCheck(T({kind:"cuid2"},Me.errToObj(t)))}ulid(t){return this._addCheck(T({kind:"ulid"},Me.errToObj(t)))}base64(t){return this._addCheck(T({kind:"base64"},Me.errToObj(t)))}base64url(t){return this._addCheck(T({kind:"base64url"},Me.errToObj(t)))}jwt(t){return this._addCheck(T({kind:"jwt"},Me.errToObj(t)))}ip(t){return this._addCheck(T({kind:"ip"},Me.errToObj(t)))}cidr(t){return this._addCheck(T({kind:"cidr"},Me.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(T({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},Me.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(T({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},Me.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(T({kind:"duration"},Me.errToObj(t)))}regex(t,r){return this._addCheck(T({kind:"regex",regex:t},Me.errToObj(r)))}includes(t,r){return this._addCheck(T({kind:"includes",value:t,position:r==null?void 0:r.position},Me.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(T({kind:"startsWith",value:t},Me.errToObj(r)))}endsWith(t,r){return this._addCheck(T({kind:"endsWith",value:t},Me.errToObj(r)))}min(t,r){return this._addCheck(T({kind:"min",value:t},Me.errToObj(r)))}max(t,r){return this._addCheck(T({kind:"max",value:t},Me.errToObj(r)))}length(t,r){return this._addCheck(T({kind:"length",value:t},Me.errToObj(r)))}nonempty(t){return this.min(1,Me.errToObj(t))}trim(){return new e(L(T({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new e(L(T({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new e(L(T({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};bc.create=e=>{var t;return new bc(T({checks:[],typeName:je.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},qe(e)))};function Qae(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}var su=class e extends Je{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)!==be.number){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:be.number,received:i.parsedType}),Le}let n,o=new fn;for(let i of this._def.checks)i.kind==="int"?ct.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:se.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),de(n,{code:se.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),de(n,{code:se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Qae(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:se.not_finite,message:i.message}),o.dirty()):ct.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Me.toString(r))}setLimit(t,r,n,o){return new e(L(T({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Me.toString(o)}]}))}_addCheck(t){return new e(L(T({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:Me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.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"&&ct.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)}};su.create=e=>new su(T({checks:[],typeName:je.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},qe(e)));var au=class e extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(i){return this._getInvalidInput(t)}if(this._getType(t)!==be.bigint)return this._getInvalidInput(t);let n,o=new fn;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),de(n,{code:se.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),de(n,{code:se.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),de(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):ct.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return de(r,{code:se.invalid_type,expected:be.bigint,received:r.parsedType}),Le}gte(t,r){return this.setLimit("min",t,!0,Me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Me.toString(r))}setLimit(t,r,n,o){return new e(L(T({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Me.toString(o)}]}))}_addCheck(t){return new e(L(T({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Me.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}};au.create=e=>{var t;return new au(T({checks:[],typeName:je.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},qe(e)))};var lu=class extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==be.boolean){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:be.boolean,received:n.parsedType}),Le}return Fn(t.data)}};lu.create=e=>new lu(T({typeName:je.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},qe(e)));var cu=class e extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==be.date){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:be.date,received:i.parsedType}),Le}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_date}),Le}let n=new fn,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),de(o,{code:se.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),de(o,{code:se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ct.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e(L(T({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Me.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Me.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}};cu.create=e=>new cu(T({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:je.ZodDate},qe(e)));var Wf=class extends Je{_parse(t){if(this._getType(t)!==be.symbol){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:be.symbol,received:n.parsedType}),Le}return Fn(t.data)}};Wf.create=e=>new Wf(T({typeName:je.ZodSymbol},qe(e)));var pu=class extends Je{_parse(t){if(this._getType(t)!==be.undefined){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:be.undefined,received:n.parsedType}),Le}return Fn(t.data)}};pu.create=e=>new pu(T({typeName:je.ZodUndefined},qe(e)));var uu=class extends Je{_parse(t){if(this._getType(t)!==be.null){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:be.null,received:n.parsedType}),Le}return Fn(t.data)}};uu.create=e=>new uu(T({typeName:je.ZodNull},qe(e)));var xc=class extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return Fn(t.data)}};xc.create=e=>new xc(T({typeName:je.ZodAny},qe(e)));var nl=class extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fn(t.data)}};nl.create=e=>new nl(T({typeName:je.ZodUnknown},qe(e)));var Wi=class extends Je{_parse(t){let r=this._getOrReturnCtx(t);return de(r,{code:se.invalid_type,expected:be.never,received:r.parsedType}),Le}};Wi.create=e=>new Wi(T({typeName:je.ZodNever},qe(e)));var Zf=class extends Je{_parse(t){if(this._getType(t)!==be.undefined){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:be.void,received:n.parsedType}),Le}return Fn(t.data)}};Zf.create=e=>new Zf(T({typeName:je.ZodVoid},qe(e)));var ol=class e extends Je{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==be.array)return de(r,{code:se.invalid_type,expected:be.array,received:r.parsedType}),Le;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(de(r,{code:s?se.too_big:se.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?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&&(de(r,{code:se.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&&(de(r,{code:se.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((s,a)=>o.type._parseAsync(new fi(r,s,r.path,a)))).then(s=>fn.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new fi(r,s,r.path,a)));return fn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e(L(T({},this._def),{minLength:{value:t,message:Me.toString(r)}}))}max(t,r){return new e(L(T({},this._def),{maxLength:{value:t,message:Me.toString(r)}}))}length(t,r){return new e(L(T({},this._def),{exactLength:{value:t,message:Me.toString(r)}}))}nonempty(t){return this.min(1,t)}};ol.create=(e,t)=>new ol(T({type:e,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray},qe(t)));function Hf(e){if(e instanceof yo){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=di.create(Hf(n))}return new yo(L(T({},e._def),{shape:()=>t}))}else return e instanceof ol?new ol(L(T({},e._def),{type:Hf(e.element)})):e instanceof di?di.create(Hf(e.unwrap())):e instanceof qs?qs.create(Hf(e.unwrap())):e instanceof Zs?Zs.create(e.items.map(t=>Hf(t))):e}var yo=class e extends Je{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=ct.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==be.object){let p=this._getOrReturnCtx(t);return de(p,{code:se.invalid_type,expected:be.object,received:p.parsedType}),Le}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wi&&this._def.unknownKeys==="strip"))for(let p in o.data)s.includes(p)||a.push(p);let l=[];for(let p of s){let u=i[p],m=o.data[p];l.push({key:{status:"valid",value:p},value:u._parse(new fi(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Wi){let p=this._def.unknownKeys;if(p==="passthrough")for(let u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(p==="strict")a.length>0&&(de(o,{code:se.unrecognized_keys,keys:a}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let u of a){let m=o.data[u];l.push({key:{status:"valid",value:u},value:p._parse(new fi(o,m,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let p=[];for(let u of l){let m=await u.key,h=await u.value;p.push({key:m,value:h,alwaysSet:u.alwaysSet})}return p}).then(p=>fn.mergeObjectSync(n,p)):fn.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new e(T(L(T({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:(r,n)=>{var i,s,a,l;let o=(a=(s=(i=this._def).errorMap)==null?void 0:s.call(i,r,n).message)!=null?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Me.errToObj(t).message)!=null?l:o}:{message:o}}}:{}))}strip(){return new e(L(T({},this._def),{unknownKeys:"strip"}))}passthrough(){return new e(L(T({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new e(L(T({},this._def),{shape:()=>T(T({},this._def.shape()),t)}))}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>T(T({},this._def.shape()),t._def.shape()),typeName:je.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e(L(T({},this._def),{catchall:t}))}pick(t){let r={};for(let n of ct.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e(L(T({},this._def),{shape:()=>r}))}omit(t){let r={};for(let n of ct.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e(L(T({},this._def),{shape:()=>r}))}deepPartial(){return Hf(this)}partial(t){let r={};for(let n of ct.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e(L(T({},this._def),{shape:()=>r}))}required(t){let r={};for(let n of ct.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof di;)i=i._def.innerType;r[n]=i}return new e(L(T({},this._def),{shape:()=>r}))}keyof(){return OB(ct.objectKeys(this.shape))}};yo.create=(e,t)=>new yo(T({shape:()=>e,unknownKeys:"strip",catchall:Wi.create(),typeName:je.ZodObject},qe(t)));yo.strictCreate=(e,t)=>new yo(T({shape:()=>e,unknownKeys:"strict",catchall:Wi.create(),typeName:je.ZodObject},qe(t)));yo.lazycreate=(e,t)=>new yo(T({shape:e,unknownKeys:"strip",catchall:Wi.create(),typeName:je.ZodObject},qe(t)));var du=class extends Je{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new ho(a.ctx.common.issues));return de(r,{code:se.invalid_union,unionErrors:s}),Le}if(r.common.async)return Promise.all(n.map(async i=>{let s=L(T({},r),{common:L(T({},r.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of n){let p=L(T({},r),{common:L(T({},r.common),{issues:[]}),parent:null}),u=l._parseSync({data:r.data,path:r.path,parent:p});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:p}),p.common.issues.length&&s.push(p.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new ho(l));return de(r,{code:se.invalid_union,unionErrors:a}),Le}}get options(){return this._def.options}};du.create=(e,t)=>new du(T({options:e,typeName:je.ZodUnion},qe(t)));var rl=e=>e instanceof mu?rl(e.schema):e instanceof mi?rl(e.innerType()):e instanceof hu?[e.value]:e instanceof yu?e.options:e instanceof gu?ct.objectValues(e.enum):e instanceof bu?rl(e._def.innerType):e instanceof pu?[void 0]:e instanceof uu?[null]:e instanceof di?[void 0,...rl(e.unwrap())]:e instanceof qs?[null,...rl(e.unwrap())]:e instanceof Xy||e instanceof vu?rl(e.unwrap()):e instanceof xu?rl(e._def.innerType):[],hv=class e extends Je{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==be.object)return de(r,{code:se.invalid_type,expected:be.object,received:r.parsedType}),Le;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}):(de(r,{code:se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Le)}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 s=rl(i.shape[t]);if(!s.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let a of s){if(o.has(a))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(a)));o.set(a,i)}}return new e(T({typeName:je.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o},qe(n)))}};function BP(e,t){let r=Ws(e),n=Ws(t);if(e===t)return{valid:!0,data:e};if(r===be.object&&n===be.object){let o=ct.objectKeys(t),i=ct.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s=T(T({},e),t);for(let a of i){let l=BP(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===be.array&&n===be.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],l=BP(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===be.date&&n===be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var fu=class extends Je{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(fv(i)||fv(s))return Le;let a=BP(i.value,s.value);return a.valid?((mv(i)||mv(s))&&r.dirty(),{status:r.value,value:a.data}):(de(n,{code:se.invalid_intersection_types}),Le)};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,s])=>o(i,s)):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}))}};fu.create=(e,t,r)=>new fu(T({left:e,right:t,typeName:je.ZodIntersection},qe(r)));var Zs=class e extends Je{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==be.array)return de(n,{code:se.invalid_type,expected:be.array,received:n.parsedType}),Le;if(n.data.length<this._def.items.length)return de(n,{code:se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Le;!this._def.rest&&n.data.length>this._def.items.length&&(de(n,{code:se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new fi(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>fn.mergeArray(r,s)):fn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e(L(T({},this._def),{rest:t}))}};Zs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zs(T({items:e,typeName:je.ZodTuple,rest:null},qe(t)))};var yv=class e extends Je{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!==be.object)return de(n,{code:se.invalid_type,expected:be.object,received:n.parsedType}),Le;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new fi(n,a,n.path,a)),value:s._parse(new fi(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?fn.mergeObjectAsync(r,o):fn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Je?new e(T({keyType:t,valueType:r,typeName:je.ZodRecord},qe(n))):new e(T({keyType:bc.create(),valueType:t,typeName:je.ZodRecord},qe(r)))}},qf=class extends Je{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!==be.map)return de(n,{code:se.invalid_type,expected:be.map,received:n.parsedType}),Le;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],p)=>({key:o._parse(new fi(n,a,n.path,[p,"key"])),value:i._parse(new fi(n,l,n.path,[p,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let p=await l.key,u=await l.value;if(p.status==="aborted"||u.status==="aborted")return Le;(p.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(p.value,u.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let p=l.key,u=l.value;if(p.status==="aborted"||u.status==="aborted")return Le;(p.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(p.value,u.value)}return{status:r.value,value:a}}}};qf.create=(e,t,r)=>new qf(T({valueType:t,keyType:e,typeName:je.ZodMap},qe(r)));var Xf=class e extends Je{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==be.set)return de(n,{code:se.invalid_type,expected:be.set,received:n.parsedType}),Le;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(de(n,{code:se.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&&(de(n,{code:se.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(l){let p=new Set;for(let u of l){if(u.status==="aborted")return Le;u.status==="dirty"&&r.dirty(),p.add(u.value)}return{status:r.value,value:p}}let a=[...n.data.values()].map((l,p)=>i._parse(new fi(n,l,n.path,p)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,r){return new e(L(T({},this._def),{minSize:{value:t,message:Me.toString(r)}}))}max(t,r){return new e(L(T({},this._def),{maxSize:{value:t,message:Me.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Xf.create=(e,t)=>new Xf(T({valueType:e,minSize:null,maxSize:null,typeName:je.ZodSet},qe(t)));var gv=class e extends Je{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==be.function)return de(r,{code:se.invalid_type,expected:be.function,received:r.parsedType}),Le;function n(a,l){return qy({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Vf(),tl].filter(p=>!!p),issueData:{code:se.invalid_arguments,argumentsError:l}})}function o(a,l){return qy({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Vf(),tl].filter(p=>!!p),issueData:{code:se.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof vc){let a=this;return Fn(async function(...l){let p=new ho([]),u=await a._def.args.parseAsync(l,i).catch(g=>{throw p.addIssue(n(l,g)),p}),m=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(m,i).catch(g=>{throw p.addIssue(o(m,g)),p})})}else{let a=this;return Fn(function(...l){let p=a._def.args.safeParse(l,i);if(!p.success)throw new ho([n(l,p.error)]);let u=Reflect.apply(s,this,p.data),m=a._def.returns.safeParse(u,i);if(!m.success)throw new ho([o(u,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e(L(T({},this._def),{args:Zs.create(t).rest(nl.create())}))}returns(t){return new e(L(T({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e(T({args:t||Zs.create([]).rest(nl.create()),returns:r||nl.create(),typeName:je.ZodFunction},qe(n)))}},mu=class extends Je{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})}};mu.create=(e,t)=>new mu(T({getter:e,typeName:je.ZodLazy},qe(t)));var hu=class extends Je{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return de(r,{received:r.data,code:se.invalid_literal,expected:this._def.value}),Le}return{status:"valid",value:t.data}}get value(){return this._def.value}};hu.create=(e,t)=>new hu(T({value:e,typeName:je.ZodLiteral},qe(t)));function OB(e,t){return new yu(T({values:e,typeName:je.ZodEnum},qe(t)))}var yu=class e extends Je{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{expected:ct.joinValues(n),received:r.parsedType,code:se.invalid_type}),Le}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{received:r.data,code:se.invalid_enum_value,options:n}),Le}return Fn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,T(T({},this._def),r))}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),T(T({},this._def),r))}};yu.create=OB;var gu=class extends Je{_parse(t){let r=ct.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==be.string&&n.parsedType!==be.number){let o=ct.objectValues(r);return de(n,{expected:ct.joinValues(o),received:n.parsedType,code:se.invalid_type}),Le}if(this._cache||(this._cache=new Set(ct.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=ct.objectValues(r);return de(n,{received:n.data,code:se.invalid_enum_value,options:o}),Le}return Fn(t.data)}get enum(){return this._def.values}};gu.create=(e,t)=>new gu(T({values:e,typeName:je.ZodNativeEnum},qe(t)));var vc=class extends Je{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==be.promise&&r.common.async===!1)return de(r,{code:se.invalid_type,expected:be.promise,received:r.parsedType}),Le;let n=r.parsedType===be.promise?r.data:Promise.resolve(r.data);return Fn(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};vc.create=(e,t)=>new vc(T({type:e,typeName:je.ZodPromise},qe(t)));var mi=class extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.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=>{de(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Le;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Le:l.status==="dirty"?iu(l.value):r.value==="dirty"?iu(l.value):l});{if(r.value==="aborted")return Le;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Le:a.status==="dirty"?iu(a.value):r.value==="dirty"?iu(a.value):a}}if(o.type==="refinement"){let s=a=>{let l=o.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Le:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Le:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!gc(s))return Le;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>gc(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):Le);ct.assertNever(o)}};mi.create=(e,t,r)=>new mi(T({schema:e,typeName:je.ZodEffects,effect:t},qe(r)));mi.createWithPreprocess=(e,t,r)=>new mi(T({schema:t,effect:{type:"preprocess",transform:e},typeName:je.ZodEffects},qe(r)));var di=class extends Je{_parse(t){return this._getType(t)===be.undefined?Fn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};di.create=(e,t)=>new di(T({innerType:e,typeName:je.ZodOptional},qe(t)));var qs=class extends Je{_parse(t){return this._getType(t)===be.null?Fn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};qs.create=(e,t)=>new qs(T({innerType:e,typeName:je.ZodNullable},qe(t)));var bu=class extends Je{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===be.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};bu.create=(e,t)=>new bu(T({innerType:e,typeName:je.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},qe(t)));var xu=class extends Je{_parse(t){let{ctx:r}=this._processInputParams(t),n=L(T({},r),{common:L(T({},r.common),{issues:[]})}),o=this._def.innerType._parse({data:n.data,path:n.path,parent:T({},n)});return zf(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ho(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ho(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xu.create=(e,t)=>new xu(T({innerType:e,typeName:je.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},qe(t)));var Yf=class extends Je{_parse(t){if(this._getType(t)!==be.nan){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:be.nan,received:n.parsedType}),Le}return{status:"valid",value:t.data}}};Yf.create=e=>new Yf(T({typeName:je.ZodNaN},qe(e)));var ele=Symbol("zod_brand"),Xy=class extends Je{_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}},Yy=class e extends Je{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Le:i.status==="dirty"?(r.dirty(),iu(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Le: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 e({in:t,out:r,typeName:je.ZodPipeline})}},vu=class extends Je{_parse(t){let r=this._def.innerType._parse(t),n=o=>(gc(o)&&(o.value=Object.freeze(o.value)),o);return zf(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};vu.create=(e,t)=>new vu(T({innerType:e,typeName:je.ZodReadonly},qe(t)));function TB(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function EB(e,t={},r){return e?xc.create().superRefine((n,o)=>{var s,a;let i=e(n);if(i instanceof Promise)return i.then(l=>{var p,u;if(!l){let m=TB(t,n),h=(u=(p=m.fatal)!=null?p:r)!=null?u:!0;o.addIssue(L(T({code:"custom"},m),{fatal:h}))}});if(!i){let l=TB(t,n),p=(a=(s=l.fatal)!=null?s:r)!=null?a:!0;o.addIssue(L(T({code:"custom"},l),{fatal:p}))}}):xc.create()}var tle={object:yo.lazycreate},je;(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"})(je||(je={}));var rle=(e,t={message:"Input not instance of ".concat(e.name)})=>EB(r=>r instanceof e,t),_B=bc.create,kB=su.create,nle=Yf.create,ole=au.create,AB=lu.create,ile=cu.create,sle=Wf.create,ale=pu.create,lle=uu.create,cle=xc.create,ple=nl.create,ule=Wi.create,dle=Zf.create,fle=ol.create,mle=yo.create,hle=yo.strictCreate,yle=du.create,gle=hv.create,ble=fu.create,xle=Zs.create,vle=yv.create,Ile=qf.create,Sle=Xf.create,Cle=gv.create,Tle=mu.create,Ple=hu.create,wle=yu.create,Mle=gu.create,Ole=vc.create,Ele=mi.create,_le=di.create,kle=qs.create,Ale=mi.createWithPreprocess,Dle=Yy.create,Fle=()=>_B().optional(),Lle=()=>kB().optional(),Rle=()=>AB().optional(),Nle={string:e=>bc.create(L(T({},e),{coerce:!0})),number:e=>su.create(L(T({},e),{coerce:!0})),boolean:e=>lu.create(L(T({},e),{coerce:!0})),bigint:e=>au.create(L(T({},e),{coerce:!0})),date:e=>cu.create(L(T({},e),{coerce:!0}))};var Ble=Le;var DB=j;var mn=DB;var $le=mn.object({limit:mn.enum(["same-floor","same-elevation"]).optional(),radius:mn.number().optional(),types:mn.array(mn.enum(["node","point-of-interest"])).min(1)}),Xs,Jy,Ky=class{constructor(t){O(this,Xs);O(this,Jy);k(this,Xs,t),k(this,Jy,new dv(c(this,Xs)))}nearest(t,r){try{$le.parse(r)}catch(s){V.error(s);return}let n=wy(t);if(!n)return;let o=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let s of c(this,Xs).getByType("floor-stack")){let a=s.defaultFloor;a&&o.push(a.id)}else if(r.limit==="same-elevation"){let s=c(this,Xs).floorsById[n.floorId];if(s){let a=s==null?void 0:s.elevation;a&&(o=c(this,Xs).getByType("floor-stack").map(l=>{var p;return(p=l.floors.find(u=>u.elevation===a))==null?void 0:p.id}).filter(Boolean))}}let i=[];for(let s of QN(r.types))for(let a of o){let l=c(this,Jy).getTreeByType(s,c(this,Xs).mapName,a).find(n.latitude,n.longitude,r.radius);if(l){let p=c(this,Xs).getById(s,l==null?void 0:l.properties.id);p&&i.push({distance:Hi([n.longitude,n.latitude],l.geometry.coordinates),feature:p})}}return i.sort((s,a)=>s.distance-a.distance)}};Xs=new WeakMap,Jy=new WeakMap;d();d();var Qy,bv=class{constructor(t){O(this,Qy);k(this,Qy,t||[])}get raw(){return c(this,Qy)}};Qy=new WeakMap;var hn,Ce,qt,eg=class eg extends Vr{constructor(r,n){super(n.mvfData.id);f(this,"__type",eg.__type);f(this,"id","loc_");f(this,"name","");f(this,"externalId");f(this,"description");f(this,"logo");f(this,"phone");f(this,"social",[]);f(this,"images",[]);f(this,"links",[]);f(this,"website");f(this,"icon");O(this,hn);O(this,Ce,{});O(this,qt);k(this,hn,r),k(this,qt,n.mvfData);for(let o in n.mvfData)o==="links"?this.links=n.mvfData.links.map(i=>new Rp({mvfData:i})):o==="pictures"?this.images=n.mvfData.pictures.map(i=>{var s;return i.url?new Bp({mvfData:L(T({},i),{url:(s=i.url)!=null?s:""}),mapData:c(this,hn)}):void 0}).filter(i=>i!=null):o==="website"?n.mvfData.website&&(this.website=new Rp({mvfData:n.mvfData.website})):o==="icon"?n.mvfData.icon&&(this.icon=new Bp({mvfData:{url:n.mvfData.icon},mapData:c(this,hn)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return c(this,qt)[o]}})}static is(r){return r.__type===eg.__type}get spaces(){if(c(this,Ce).spaces)return c(this,Ce).spaces;if(c(this,qt).spaces==null)return c(this,Ce).spaces=[],c(this,Ce).spaces;c(this,Ce).spaces=[];for(let r=0;r<c(this,qt).spaces.length;r++){let n=c(this,hn).getById("space",c(this,qt).spaces[r].id);n&&c(this,Ce).spaces.push(n)}return c(this,Ce).spaces}get points(){if(c(this,Ce).points)return c(this,Ce).points;if(c(this,qt).spaces==null)return c(this,Ce).points=[],c(this,Ce).points;c(this,Ce).points=[];for(let r=0;r<c(this,qt).spaces.length;r++){let n=c(this,hn).getById("point-of-interest",c(this,qt).spaces[r].id);n&&c(this,Ce).points.push(n)}return c(this,Ce).points}get doors(){if(c(this,Ce).doors)return c(this,Ce).doors;if(c(this,qt).entrances==null)return c(this,Ce).doors=[],c(this,Ce).doors;c(this,Ce).doors=[];for(let r=0;r<c(this,qt).entrances.length;r++){let n=c(this,hn).getById("door",c(this,qt).entrances[r].id);n&&c(this,Ce).doors.push(n)}return c(this,Ce).doors}get connections(){var n;if(c(this,Ce).connections)return c(this,Ce).connections;if(c(this,qt).connections==null)return c(this,Ce).connections=[],c(this,Ce).connections;let r=new Set;for(let o=0;o<c(this,qt).connections.length;o++){let i=c(this,qt).connections[o],s=c(this,hn).mvfConnectionsById[i],l=(s==null?[]:s.nodes).map(p=>c(this,hn).getById("node",p)).filter(Boolean);for(let p of l){if(p==null)continue;let u=$s([p.coordinate.longitude,p.coordinate.latitude]),h=((n=c(this,hn).connectionSpaceIdsByLatLon[u])!=null?n:[]).map(g=>c(this,hn).connectionsById[g]).filter(g=>g!=null);for(let g of h)r.add(g)}}return c(this,Ce).connections=Array.from(r),c(this,Ce).connections}get annotations(){if(c(this,Ce).annotations)return c(this,Ce).annotations;if(c(this,qt).annotations==null)return c(this,Ce).annotations=[],c(this,Ce).annotations;c(this,Ce).annotations=[];for(let r=0;r<c(this,qt).annotations.length;r++){let n=c(this,hn).getById("annotation",c(this,qt).annotations[r].id);n&&c(this,Ce).annotations.push(n)}return c(this,Ce).annotations}get categories(){return c(this,Ce).categories?c(this,Ce).categories:c(this,qt).categories==null?(c(this,Ce).categories=[],c(this,Ce).categories):(c(this,Ce).categories=c(this,qt).categories.map(r=>c(this,hn).getById("location-category",r)).filter(r=>r!=null),c(this,Ce).categories)}get mapObjects(){return c(this,Ce).mapObjects?c(this,Ce).mapObjects:c(this,qt).obstructions==null?(c(this,Ce).mapObjects=[],c(this,Ce).mapObjects):(c(this,Ce).mapObjects=c(this,qt).obstructions.map(r=>c(this,hn).getById("object",r.id)).filter(r=>r!=null),c(this,Ce).mapObjects)}get areas(){return c(this,Ce).areas?c(this,Ce).areas:c(this,qt).areas==null?(c(this,Ce).areas=[],c(this,Ce).areas):(c(this,Ce).areas=c(this,qt).areas.map(r=>c(this,hn).getById("area",r.id)).filter(r=>r!=null),c(this,Ce).areas)}get focusTarget(){if(c(this,Ce).focusTarget)return c(this,Ce).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 c(this,Ce).focusTarget=r,r}get openingHours(){var r;return c(this,Ce).openingHours?c(this,Ce).openingHours:(c(this,Ce).openingHours=new bv((r=c(this,qt).openingHoursSpecification)!=null?r:[]),c(this,Ce).openingHours)}get navigationTarget(){if(c(this,Ce).navigationTarget)return c(this,Ce).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 c(this,Ce).navigationTarget=r,r}toJSON(){return{id:this.id,name:this.name}}};hn=new WeakMap,Ce=new WeakMap,qt=new WeakMap,f(eg,"__type","location-profile");var $P=eg,Nf=$P;d();var Ic,go,Iu,tg=class tg extends Vr{constructor(r,n){super(n.mvfData.id);f(this,"__type",tg.__type);f(this,"id","cat_");f(this,"name","");f(this,"icon","");O(this,Ic);O(this,go,{});O(this,Iu);k(this,Ic,r),k(this,Iu,n.mvfData);for(let o in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return c(this,Iu)[o]}})}static is(r){return r.__type===tg.__type}get parent(){return c(this,go).parent?c(this,go).parent:(c(this,go).parent=c(this,Iu).parent?c(this,Ic).getById("location-category",c(this,Iu).parent):void 0,c(this,go).parent)}get children(){return c(this,go).children?c(this,go).children:(c(this,go).children=c(this,Ic).locationCategoriesByParentId[this.id]||[],c(this,go).children)}get locationProfiles(){if(c(this,go).locationProfiles)return c(this,go).locationProfiles;let r=[];for(let n of c(this,Ic).locationProfilesByCategoryId[this.id]||[]){let o=c(this,Ic).getById("location-profile",n.id);o&&r.push(o)}return c(this,go).locationProfiles=r,r}toJSON(){return{id:this.id,name:this.name}}};Ic=new WeakMap,go=new WeakMap,Iu=new WeakMap,f(tg,"__type","location-category");var jP=tg,tv=jP;var ke,xv,FB,Kf,Jf=class extends Ne{constructor(r,n){var a,l,p,u,m;super();O(this,xv);f(this,"Analytics");O(this,ke,{});f(this,"Query");f(this,"mvf");f(this,"outdoorViewToken");f(this,"spaceIdsByDestinationNodeId");f(this,"objectEntranceNodeIdsByObstructionId");f(this,"obstructionIdByEntranceId");f(this,"venue");f(this,"tokenManager");f(this,"directions");f(this,"enterpriseMode",!1);f(this,"nodesById");f(this,"spacesById");f(this,"floorsById");f(this,"floorStacksById");f(this,"facadesById");f(this,"facadesBySpaceId");f(this,"connectionsById");f(this,"objectsById");f(this,"doorsById");f(this,"pointsOfInterestById");f(this,"annotationsById");f(this,"areasById");f(this,"locationProfilesById");f(this,"locationCategoriesById");f(this,"locationProfilesByExternalId");f(this,"locationsById");f(this,"locationProfilesByCategoryId");f(this,"locationCategoriesByParentId");f(this,"categoriesById");f(this,"doorsByNodeId");f(this,"mvfLocationsBySpaceId");f(this,"locationIdsByNodeId");f(this,"spaceIdsByNodeId");f(this,"mvfAnnotationsById");f(this,"mvfConnectionsById");f(this,"mvfConnectionsByNodeId");f(this,"mvfConnectionIdsByLatLon");f(this,"mvfEntrancesById");f(this,"mvfNodesById");f(this,"mvfObstructionById");f(this,"mvfSpacesById");f(this,"mvfFloorsById");f(this,"mvfFloorStacksById");f(this,"mvfAreasById");f(this,"connectionSpaceIdsByLatLon");f(this,"locationProfilesByAttachedFeatureId");f(this,"spacesByExternalId");f(this,"nodesByExternalId");f(this,"objectsByExternalId");f(this,"poisByExternalId");f(this,"floorsByExternalId");f(this,"floorStacksByExternalId");f(this,"doorsByExternalId");f(this,"areasByExternalId");f(this,"connectionsByExternalId");f(this,"locationsByExternalId");f(this,"categoriesByExternalId");f(this,"mvfNodesByFloorId");f(this,"mvfSpacesByFloorId");f(this,"mvfPoisByFloorId");f(this,"mvfEntrancesByFloorId");f(this,"mvfAnnotationsByFloorId");f(this,"localePacksUrls");f(this,"currentLanguage");f(this,"languagePacks",{});f(this,"tilesets",{});f(this,"binaryBundle");f(this,"envControl");f(this,"getMapDataOptions");O(this,Kf);f(this,"getDirectionsMultiDestination",(r,n,o)=>this.getDirections(r,n,L(T({},o),{multiDestination:!0})));f(this,"getDirections",(r,n,o)=>{let{accessible:i=!1,smoothing:s=!0,multiDestination:a=!1}=o||{},l=typeof s=="object"?s.enabled:s,p=typeof s=="object"?s.radius:void 0,u=(o==null?void 0:o.zones)||[],m={accessible:i,zones:u,smoothing:{enabled:l!=null?l:!0,radius:p!=null?p:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[],connectionIdWeightMap:(o==null?void 0:o.connectionIdWeightMap)||{}};if(a&&Array.isArray(n)){let h=Array.isArray(r)?r:[r],g=[];for(let v of n){let I=Array.isArray(v)?v:[v],b=this.directions.getDirections(h,I,m,this);if(!b){V.error("getDirections failed due to missing directions for one of the segments");return}h=I,g.push(b)}return g}else{let h=Array.isArray(r)?r:[r],g=Array.isArray(n)?n:[n];if(Array.isArray(g[0])){V.error("getDirections does not support multi-destination without multisegment option");return}return h[0].id&&g[0].id&&this.Analytics.sendGetDirectionsEvent(h[0].id,g[0].id),this.directions.getDirections(h,g,m,this)}});f(this,"transformImageRequest",async r=>{var o;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!FN(r))return{url:r};if(LN(r))return{url:r};let n=Kx(r);if(!n)return{url:r};try{let i=await((o=this.tokenManager)==null?void 0:o.getSasTokensAsync()),s=i==null?void 0:i[n.mapId];if(s==null)throw new Error("SAS token not found");let[a]=r.split("?");return{url:"".concat(a,"?").concat(s.token)}}catch(i){return V.error("Failed to append SAS token to image request. Requests for private images may fail.",i),{url:r}}});let o=(a=n==null?void 0:n.env)!=null?a:Dp();if(this.envControl=o,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new yd,this.localePacksUrls=(l=n==null?void 0:n.localePacksUrls)!=null?l:{},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 h of r["tileset.json"].others)this.tilesets[h.key]=h;this.enterpriseMode=(u=n==null?void 0:n.enterprise)!=null?u:!1,this.tokenManager=n==null?void 0:n.tokenManager;let i=DN(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 s=AN(r,this);if(this.locationsById=s.locationsById,this.categoriesById=s.categoriesById,this.mvfLocationsBySpaceId=s.mvfLocationsBySpaceId,this.locationIdsByNodeId=s.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=i.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=i.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=s.spaceIdsByNodeId,this.connectionsByExternalId=s.connectionsByExternalId,this.locationsByExternalId=s.locationsByExternalId,this.categoriesByExternalId=s.categoriesByExternalId,s.venue.name!=null){this.venue=new wP(this,{mvfData:s.venue});let h={};for(let g in s.mvfLocationsById)h[g]=s.mvfLocationsById[g];for(let g in s.locationInstancesById)h[g]=s.locationInstancesById[g];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":h,"enterprise-category":s.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},(m=n==null?void 0:n.languagePacks)==null||m.forEach(({language:g,localePack:v})=>{this.languagePacks[g.code]=MP(v)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Ky(this),this.directions=new uv({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new $e(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return c(this,ke).spaces==null&&(c(this,ke).spaces=globalThis.Object.values(this.spacesById)),c(this,ke).spaces}get objects(){return c(this,ke).objects==null&&(c(this,ke).objects=globalThis.Object.values(this.objectsById)),c(this,ke).objects}get connections(){return c(this,ke).connections==null&&(c(this,ke).connections=globalThis.Object.values(this.connectionsById)),c(this,ke).connections}get floors(){return c(this,ke).floors==null&&(c(this,ke).floors=globalThis.Object.values(this.floorsById)),c(this,ke).floors}get floorStacks(){return c(this,ke).floorStacks==null&&(c(this,ke).floorStacks=globalThis.Object.values(this.floorStacksById)),c(this,ke).floorStacks}get facades(){return c(this,ke).facades==null&&(c(this,ke).facades=globalThis.Object.values(this.facadesById)),c(this,ke).facades}get doors(){return c(this,ke).doors==null&&(c(this,ke).doors=globalThis.Object.values(this.doorsById)),c(this,ke).doors}get pointsOfInterest(){return c(this,ke).pointsOfInterest==null&&(c(this,ke).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),c(this,ke).pointsOfInterest}get annotations(){return c(this,ke).annotations==null&&(c(this,ke).annotations=globalThis.Object.values(this.annotationsById)),c(this,ke).annotations}get areas(){return c(this,ke).areas==null&&(c(this,ke).areas=globalThis.Object.values(this.areasById)),c(this,ke).areas}get nodes(){return c(this,ke).nodes==null&&(c(this,ke).nodes=globalThis.Object.values(this.nodesById)),c(this,ke).nodes}get locations(){return c(this,ke).locations==null&&(c(this,ke).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return c(this,ke).categories==null&&(c(this,ke).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return c(this,ke).locationProfiles==null&&(c(this,ke).locationProfiles=globalThis.Object.values(this.locationProfilesById)),c(this,ke).locationProfiles}get locationCategories(){return c(this,ke).locationCategories==null&&(c(this,ke).locationCategories=globalThis.Object.values(this.locationCategoriesById)),c(this,ke).locationCategories}get mvfFloors(){return c(this,ke).mvfFloors==null&&(c(this,ke).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),c(this,ke).mvfFloors}get mvfFloorStacks(){return c(this,ke).mvfFloorStacks==null&&(c(this,ke).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),c(this,ke).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=ee(this,xv,FB).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,s,a,l,p,u,m,h,g,v,I;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(s=this.floorsByExternalId[n])!=null?s:[];case"floor-stack":return(a=this.floorStacksByExternalId[n])!=null?a:[];case"node":return(l=this.nodesByExternalId[n])!=null?l:[];case"door":return(p=this.doorsByExternalId[n])!=null?p:[];case"connection":return(u=this.connectionsByExternalId[n])!=null?u:[];case"object":return(m=this.objectsByExternalId[n])!=null?m:[];case"point-of-interest":return(h=this.poisByExternalId[n])!=null?h:[];case"area":return(g=this.areasByExternalId[n])!=null?g:[];case"enterprise-location":return(v=this.locationsByExternalId[n])!=null?v:[];case"enterprise-category":return(I=this.categoriesByExternalId[n])!=null?I:[];default:return[]}}getMapDataById(r){var n,o,i,s,a,l,p,u,m,h;return(h=(m=(u=(p=(l=(a=(s=(i=(o=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?o:this.floorStacksById[r])!=null?i:this.facadesById[r])!=null?s:this.nodesById[r])!=null?a:this.doorsById[r])!=null?l:this.connectionsById[r])!=null?p:this.objectsById[r])!=null?u:this.pointsOfInterestById[r])!=null?m:this.annotationsById[r])!=null?h: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 l,p;if(!this.currentLanguage)return i;let{code:s}=this.currentLanguage,a=(p=(l=this.languagePacks[s])==null?void 0:l.optimized)==null?void 0:p[r];if(a){let u=a[o];if(u!=null&&u[n]!==void 0)return u[n]}return i}async changeLanguage(r){var a;let n=r.toLowerCase();if(!n){V.error("language code must be defined");return}if(!this.currentLanguage){V.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,i=(a=this.venue)==null?void 0:a.languages.find(({code:l})=>l.toLowerCase()===n.toLowerCase());if(!i){V.warn("language not found");return}if(o===i.code)return;let s=this.languagePacks[i.code];if(!s){let l=this.localePacksUrls[i.code];if(!l){V.error("locale packs url not found for ".concat(i.code));return}c(this,Kf)&&c(this,Kf).abort();let p=new AbortController;k(this,Kf,p);let u;try{u=await sN(l,{signal:p.signal})}catch(m){V.error("failed downloading language pack",m);return}if(!u||p.signal.aborted)return;s=MP(u),this.languagePacks[i.code]=s}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=i,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let o=wy(r),i=wy(n);return Hi([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 s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let a=await DT(this.localePacksUrls[s.code],{signal:i.signal}),l=await Cf(a);l&&n.push({language:{code:s.code,name:s.name},localePack:l})}}catch(a){V.warn("failed downloading language pack",a)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var o;if(!this.binaryBundle){V.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let a=await DT(this.localePacksUrls[s.code],{signal:i.signal});a&&n.push({language:{code:s.code,name:s.name},localePack:a})}}catch(a){V.warn("failed downloading language pack",a)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(c(this,ke)))c(this,ke)[r]=null}};ke=new WeakMap,xv=new WeakSet,FB=function(r){var a;let n=(a=r==null?void 0:r.nodes)==null?void 0:a[0],o=this.getById("node",n);if(o==null)return;let i=$s([o.coordinate.longitude,o.coordinate.latitude]),s=this.connectionSpaceIdsByLatLon[i];return s==null?void 0:s.map(l=>this.connectionsById[l]).find(l=>l!=null)},Kf=new WeakMap;d();d();d();d();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var LB="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 RB=!1;function NB(){RB=!0}function BB(){return RB}var vv=class{constructor(t){f(this,"backgroundAlpha",1);f(this,"backgroundColor",new Lt);f(this,"width",0);f(this,"height",0);f(this,"options",{});f(this,"renderer");f(this,"enabledLayers",new Set([0,1]));f(this,"handleWebGLContextCreationError",t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)});f(this,"handleWebGLContextLost",t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)});f(this,"handleWebGLContextRestored",t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)});var r,n,o,i,s;try{this.options=t,BB()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Lt,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},clearStencil:()=>{},clearDepth:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new iM({canvas:t.canvas,alpha:t.alpha||!1,stencil:!0,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Lt((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(a){V.error(a),t.onWebGLRendererError&&t.onWebGLRendererError(a)}(o=this.domElement())==null||o.addEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(s=this.domElement())==null||s.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,o,i;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(i=this.domElement())==null||i.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset(),r.layers.disableAll();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.clearDepth(),r.layers.disableAll(),r.layers.enable(xb.ALWAYS_ON_TOP),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){x.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}};d();d();var $B='"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 jB(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}d();function GB(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}d();function UB(e,t){let r=t.x,n=t.y,o=t.x+t.w,i=t.y+t.h,s=e.x,a=e.y,l=e.x+e.w,p=e.y+e.h;return r<l&&s<o&&n<p&&a<i}d();function il(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}d();var zr=class{constructor(t,r,n,o,i){f(this,"x");f(this,"y");f(this,"w");f(this,"h");f(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:jB(this,t)}intersects(t){return UB(this,t)}intersectsPoint(t){return GB(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var Ys=class e{constructor(t,r){f(this,"topLeft");f(this,"topRight");f(this,"bottomLeft");f(this,"bottomRight");f(this,"divided",!1);f(this,"boundary");f(this,"capacity",16);f(this,"objects",[]);f(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 e(new zr(t,r,n/2,o/2),this),this.topRight=new e(new zr(t+n/2,r,n/2,o/2),this),this.bottomLeft=new e(new zr(t,r+o/2,n/2,o/2),this),this.bottomRight=new e(new zr(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&&(il(r,this.topLeft.queryRect(t)),il(r,this.topRight.queryRect(t)),il(r,this.bottomLeft.queryRect(t)),il(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(il(r,this.topLeft.queryPoint(t)),il(r,this.topRight.queryPoint(t)),il(r,this.bottomLeft.queryPoint(t)),il(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()}};d();d();var VB=["","","low","medium","high","always-visible"];function zB(e){return Math.min(5,Math.max(2,e))}function Qf(e){if(typeof e=="number")return zB(e);let t=VB.indexOf(e);return t===-1?3:t}function rg(e){let t=zB(e);return VB[t]}function WB(e,t,r){let n,o,i,s=null,a=0;r||(r={});let l=function(){a=r.leading===!1?0:Date.now(),s=null,i=e.apply(n,o),s||(n=o=null)};return function(){let p=Date.now();!a&&r.leading===!1&&(a=p);let u=t-(p-a);return n=globalThis,o=arguments,u<=0||u>t?(s&&(clearTimeout(s),s=null),a=p,i=e.apply(n,o),s||(n=o=null)):!s&&r.trailing!==!1&&(s=setTimeout(l,u)),i}}var Su=!1,GP="",Gle=150,Iv=class extends Ne{constructor(r,n,o=GP?new Worker(GP):new Worker(URL.createObjectURL(new Blob([$B],{type:"text/javascript"})))){super();f(this,"worker");f(this,"debugContext");f(this,"debugCanvas");f(this,"collidersDirty",!0);f(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);f(this,"visibleCollidersQTree",new Ys(new zr(0,0,0,0)));f(this,"interactiveCollidersQTree",new Ys(new zr(0,0,0,0)));f(this,"coreState");f(this,"postMessage");f(this,"showCollisionBoxes",()=>{Su=!0,this.debugCanvas.style.display="block"});f(this,"hideCollisionBoxes",()=>{Su=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});f(this,"currentMsgId","");f(this,"working",!1);f(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});f(this,"componentArray",[]);f(this,"update",(r,n,o="bottom-left",i=!1)=>{let s=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let a;for(let l of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(l);p&&(a=p.components[0],this.componentArray.push(a))}this.resize(r,n,o),this.collidersDirty=!1,s=!0}else s=this.componentArray.some(a=>a.collisionDirty===!0);s&&this.componentArray.sort((a,l)=>l.rank-a.rank);for(let a=0;a<this.componentArray.length;a++)if(this.packedMessage){let l=this.componentArray[a].toPackedMessage(i&&!s);this.packedMessage[0][a]==null&&(this.packedMessage[0][a]=[]),this.packedMessage[0][a][0]==null&&(this.packedMessage[0][a][0]=[]),this.packedMessage[0][a][0]=l.bboxes,this.packedMessage[0][a][1]=l.enabled&&this.componentArray[a].visible&&!this.componentArray[a].isOccluded?1:0,this.packedMessage[0][a][2]=l.rank===5?1:0,this.packedMessage[0][a][3]=l.x,this.packedMessage[0][a][4]=l.y,this.packedMessage[0][a][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][a][6]=l.lockedToStrategyIndex}this.working||this.postMessage()});f(this,"resolve",r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,o=-1,i,s,a;Su&&(this.visibleCollidersQTree=new Ys(new zr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Ys(new zr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let p=this.componentArray[l];n[l]!=null&&(o=n[l][0],i=n[l][2],p.offscreen=n[l][1]===1,o!==-1&&i!=null?(a=new zr(i.x,i.y,i.w,i.h,{entityId:p.id}),Su&&this.visibleCollidersQTree.insert(a),s=this.coreState.geometry2DMap.get(p.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new zr(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=a,p.onStrategySelected(o))):((p.canShow===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),o!==-1&&o!==p.currentStrategyIndex&&p.onStrategySelected(o)))}Su&&this.drawDebug(),this.publish("visibility-changed")});f(this,"drawDebug",()=>{Su&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});f(this,"destroy",()=>{this.worker.terminate()});this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=o,this.worker.onmessage=i=>this.resolve(i),this.postMessage=WB(this._postMessage,Gle,!1),Su?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,o){this.packedMessage[6]=o,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};function UP(e){GP=e}d();d();d();d();var Sv=class{constructor(t){f(this,"type");f(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},Cv=class{constructor(){f(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()}};d();function ZB(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 st&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}var em,og=class extends Ne{constructor(r,n,o,i,s){super();f(this,"raycaster",new ps);f(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});f(this,"coreState");f(this,"camera");f(this,"worldPlane");f(this,"_quadtree",new Ys(new zr(0,0,0,0)));f(this,"_container");f(this,"lastPointerEvent");f(this,"cursor","grab");f(this,"touchesCount",0);f(this,"isUserInteracting");f(this,"hasTouched",!1);O(this,em);f(this,"onPointerMoveRaf",r=>{this.lastPointerEvent=r,c(this,em)&&cancelAnimationFrame(c(this,em)),k(this,em,requestAnimationFrame(()=>{this.onPointerMove(r)}))});f(this,"onPointerMove",r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()});f(this,"tapsControl",new Cv);f(this,"onPointerDown",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 Sv(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))});f(this,"clickTimeout");f(this,"onPointerUp",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())});f(this,"dirty3D",!0);f(this,"cachedHitBoxes",{entities:[],groups:[]});f(this,"ndcPoint",new Ae);f(this,"debugPanel");this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=r,this.coreState=n,this.worldPlane=i,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(i=>{var s,a;return((s=i.object)==null?void 0:s.name)==="worldPlane"||((a=i.object)==null?void 0:a.visible)}),o=n.findIndex(i=>{var s;return((s=i.object)==null?void 0:s.name)==="worldPlane"});return o!==-1&&n.push(n.splice(o,1)[0]),n}getGroupContainerIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(i=>i.object.visible),o;return n!=null&&n.length>0&&(o=ZB(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:s,groupContainers:a}=this.intersect(n);(this.detect3DEntityHover(o)||this.detect2DEntityHover(i)||this.detect3DContainerHover(a))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=i,this.state.hovered3DContainers=a,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:s,groupContainers:a})),this.handleCursor()}handleCursor(){var s;let r=!!(this.state.hovered3DEntity&&((s=this.state.hovered3DEntity)!=null&&s.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,i=Hle(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 b,C,P,w,M;let n=[r.offsetX,r.offsetY],o=this._quadtree.queryPoint(n),[i]=o.filter(E=>E.intersectsPoint(n)),s=this.coreState.containerOffset[0],a=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-a)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-s)/this._container.clientHeight)*2+1;let l=this.getThreeDIntersectsFromXY(this.ndcPoint),p=(b=l[0])==null?void 0:b.point,u=[],m=[];for(let E of l.filter(B=>B.object.name!=="worldPlane"))E.object instanceof He&&E.object.material.depthTest===!1?u.push(E):m.push(E);let h=(P=(C=u[0])!=null?C:m[0])!=null?P:void 0,g,v;if(h!=null){if(g=Zle(h.object,this.coreState.geometry3DMap),!g){let E=(w=h==null?void 0:h.instanceId)!=null?w:h==null?void 0:h.batchId;g=E!=null&&(h!=null&&h.object.userData.entities)?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[E]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId)}g!=null&&g.components[2]&&(v=g)}let I=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((M=i==null?void 0:i.userData)==null?void 0:M.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(i==null?void 0:i.userData.entityId),entity3D:v,position:p,groupContainers:I}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&XB(this.state.lastHover,!1,this.coreState),r&&XB(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!lM(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,s;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((s=n.position)==null?void 0:s.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var o,i,s;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((s=n.position)==null?void 0:s.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}};em=new WeakMap;function XB(e,t,r){var s;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let o=(s=e.components[0].textMesh)==null?void 0:s.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)}function Hle(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}function Wle(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Dl)return;if(t.userData.isSingleModel)return t;t=t.parent}}function Zle(e,t){let r=Wle(e);return r?t.get(r.userData.entityId):void 0}d();var P$=ss(ew());var pg=4,jpe=8,Gpe="0.6",T$="low-priority-pin",tw=j.object({rank:j.union([j.enum(["low","medium","high","always-visible"]),j.number()]).optional(),interactive:j.union([j.boolean(),j.literal("pointer-events-auto")]).optional(),id:j.string().optional(),anchor:j.union([j.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),j.array(j.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:j.boolean().optional(),zIndex:j.number().optional(),lowPriorityPin:j.object({enabled:j.boolean().optional(),size:j.number().positive().optional(),color:j.string().optional()}).optional()});function w$(e,t,r){j.array(j.number()).min(2).max(3).parse(e),j.string().parse(t),tw.parse(r)}var Upe=Object.freeze({enabled:!0,size:jpe,color:"#666"}),om=class om{constructor(t,r={}){f(this,"id");f(this,"type","marker");f(this,"rank",0);f(this,"initialRank",0);f(this,"activeAnchor","center");f(this,"pointerEvents","none");f(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:T({},Upe)});f(this,"projection",new Ae);f(this,"enabled",!0);f(this,"canShow",!1);f(this,"visible",!0);f(this,"isOccluded",!1);f(this,"offscreen",!1);f(this,"strategyIndex",-1);f(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});f(this,"dimensions",{width:0,height:0});f(this,"markerContainer");f(this,"containerEl");f(this,"contentEl",null);f(this,"contentHtml","");f(this,"style",{top:"0px",left:"0px"});f(this,"dirty",!1);f(this,"attachedDirty",!0);f(this,"collisionDirty",!0);f(this,"visibilityNeedsUpdate","show");f(this,"animation",null);f(this,"currentStrategyIndex",-1);f(this,"onStrategySelected",(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",T$);let s=this.options.lowPriorityPin,a=s.size,l=s.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(a,"px")),this.markerContainer.style.setProperty("--pin-color",l),this.markerContainer.style.opacity=Gpe,this.style.top=-a/2+"px",this.style.left=-a/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:s,height:a}=this.dimensions,l=-a/2+"px",p=-s/2+"px";switch(this.style.top=l,this.style.left=p,this.activeAnchor){case"top":{this.style.top=-a+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-s+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-a+"px",this.style.left=-s+"px";break}case"top-right":{this.style.top=-a+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-s+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=l,this.style.left=p}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left});f(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)||kt(),this.options=(0,P$.default)(this.options,r),typeof r.rank=="string")this.rank=Qf(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let s=Math.trunc(x.env.NODE_ENV==="test"?om.testId:om.testId*10)/10;om.testId+=.001,this.rank=s}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(s=>({name:s,getBoundingBox:()=>{let a=r/2,l=r/2,p=t/2,u=t/2;switch(s){case"top":{a=r,l=0;break}case"bottom":{a=0,l=r;break}case"left":{p=t,u=0;break}case"right":{p=0,u=t;break}case"top-left":{a=r,p=t,l=0,u=0;break}case"top-right":{a=r,u=t,l=0,p=0;break}case"bottom-left":{l=r,p=t,a=0,u=0;break}case"bottom-right":{l=r,u=t,a=0,p=0;break}}return[a+pg,l+pg,p+pg,u+pg]}}));if((i=this.options.lowPriorityPin)!=null&&i.enabled){let s={name:T$,getBoundingBox:()=>{let a=Math.max(2,pg/2);return[this.options.lowPriorityPin.size/2+a,this.options.lowPriorityPin.size/2+a,this.options.lowPriorityPin.size/2+a,this.options.lowPriorityPin.size/2+a]}};o.push(s)}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(){}};f(om,"testId",0);var Js=om;d();d();d();d();d();var im=class{constructor(){f(this,"hover",!1);f(this,"dirty",!1)}};d();d();function Av(e){"@babel/helpers - typeof";return Av=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},Av(e)}var Vpe=/^\s+/,zpe=/\s+$/;function Te(e,t){if(e=e||"",t=t||{},e instanceof Te)return e;if(!(this instanceof Te))return new Te(e,t);var r=Hpe(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}Te.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,o,i,s,a;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?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),.2126*i+.7152*s+.0722*a},setAlpha:function(t){return this._a=D$(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=O$(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=O$(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+")"},toHsl:function(){var t=M$(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=M$(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+")"},toHex:function(t){return E$(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return Xpe(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString: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+")"},toPercentageRgb:function(){return{r:Math.round(dr(this._r,255)*100)+"%",g:Math.round(dr(this._g,255)*100)+"%",b:Math.round(dr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(dr(this._r,255)*100)+"%, "+Math.round(dr(this._g,255)*100)+"%, "+Math.round(dr(this._b,255)*100)+"%)":"rgba("+Math.round(dr(this._r,255)*100)+"%, "+Math.round(dr(this._g,255)*100)+"%, "+Math.round(dr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:aue[E$(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+_$(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Te(t);n="#"+_$(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+n+")"},toString: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())},clone:function(){return Te(this.toString())},_applyModification: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},lighten:function(){return this._applyModification(Qpe,arguments)},brighten:function(){return this._applyModification(eue,arguments)},darken:function(){return this._applyModification(tue,arguments)},desaturate:function(){return this._applyModification(Ype,arguments)},saturate:function(){return this._applyModification(Kpe,arguments)},greyscale:function(){return this._applyModification(Jpe,arguments)},spin:function(){return this._applyModification(rue,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(iue,arguments)},complement:function(){return this._applyCombination(nue,arguments)},monochromatic:function(){return this._applyCombination(sue,arguments)},splitcomplement:function(){return this._applyCombination(oue,arguments)},triad:function(){return this._applyCombination(k$,[3])},tetrad:function(){return this._applyCombination(k$,[4])}};Te.fromRatio=function(e,t){if(Av(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=ug(e[n]));e=r}return Te(e,t)};function Hpe(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,i=null,s=!1,a=!1;return typeof e=="string"&&(e=uue(e)),Av(e)=="object"&&(ll(e.r)&&ll(e.g)&&ll(e.b)?(t=Wpe(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ll(e.h)&&ll(e.s)&&ll(e.v)?(n=ug(e.s),o=ug(e.v),t=qpe(e.h,n,o),s=!0,a="hsv"):ll(e.h)&&ll(e.s)&&ll(e.l)&&(n=ug(e.s),i=ug(e.l),t=Zpe(e.h,n,i),s=!0,a="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=D$(r),{ok:s,format:e.format||a,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}}function Wpe(e,t,r){return{r:dr(e,255)*255,g:dr(t,255)*255,b:dr(r,255)*255}}function M$(e,t,r){e=dr(e,255),t=dr(t,255),r=dr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,s,a=(n+o)/2;if(n==o)i=s=0;else{var l=n-o;switch(s=a>.5?l/(2-n-o):l/(n+o),n){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4;break}i/=6}return{h:i,s,l:a}}function Zpe(e,t,r){var n,o,i;e=dr(e,360),t=dr(t,100),r=dr(r,100);function s(p,u,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(u-p)*6*m:m<1/2?u:m<2/3?p+(u-p)*(2/3-m)*6:p}if(t===0)n=o=i=r;else{var a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;n=s(l,a,e+1/3),o=s(l,a,e),i=s(l,a,e-1/3)}return{r:n*255,g:o*255,b:i*255}}function O$(e,t,r){e=dr(e,255),t=dr(t,255),r=dr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,s,a=n,l=n-o;if(s=n===0?0:l/n,n==o)i=0;else{switch(n){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4;break}i/=6}return{h:i,s,v:a}}function qpe(e,t,r){e=dr(e,360)*6,t=dr(t,100),r=dr(r,100);var n=Math.floor(e),o=e-n,i=r*(1-t),s=r*(1-o*t),a=r*(1-(1-o)*t),l=n%6,p=[r,s,i,i,a,r][l],u=[a,r,r,s,i,i][l],m=[i,i,a,r,r,s][l];return{r:p*255,g:u*255,b:m*255}}function E$(e,t,r,n){var o=[qi(Math.round(e).toString(16)),qi(Math.round(t).toString(16)),qi(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("")}function Xpe(e,t,r,n,o){var i=[qi(Math.round(e).toString(16)),qi(Math.round(t).toString(16)),qi(Math.round(r).toString(16)),qi(F$(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("")}function _$(e,t,r,n){var o=[qi(F$(n)),qi(Math.round(e).toString(16)),qi(Math.round(t).toString(16)),qi(Math.round(r).toString(16))];return o.join("")}Te.equals=function(e,t){return!e||!t?!1:Te(e).toRgbString()==Te(t).toRgbString()};Te.random=function(){return Te.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Ype(e,t){t=t===0?0:t||10;var r=Te(e).toHsl();return r.s-=t/100,r.s=Dv(r.s),Te(r)}function Kpe(e,t){t=t===0?0:t||10;var r=Te(e).toHsl();return r.s+=t/100,r.s=Dv(r.s),Te(r)}function Jpe(e){return Te(e).desaturate(100)}function Qpe(e,t){t=t===0?0:t||10;var r=Te(e).toHsl();return r.l+=t/100,r.l=Dv(r.l),Te(r)}function eue(e,t){t=t===0?0:t||10;var r=Te(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)))),Te(r)}function tue(e,t){t=t===0?0:t||10;var r=Te(e).toHsl();return r.l-=t/100,r.l=Dv(r.l),Te(r)}function rue(e,t){var r=Te(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Te(r)}function nue(e){var t=Te(e).toHsl();return t.h=(t.h+180)%360,Te(t)}function k$(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Te(e).toHsl(),n=[Te(e)],o=360/t,i=1;i<t;i++)n.push(Te({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}function oue(e){var t=Te(e).toHsl(),r=t.h;return[Te(e),Te({h:(r+72)%360,s:t.s,l:t.l}),Te({h:(r+216)%360,s:t.s,l:t.l})]}function iue(e,t,r){t=t||6,r=r||30;var n=Te(e).toHsl(),o=360/r,i=[Te(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(Te(n));return i}function sue(e,t){t=t||6;for(var r=Te(e).toHsv(),n=r.h,o=r.s,i=r.v,s=[],a=1/t;t--;)s.push(Te({h:n,s:o,v:i})),i=(i+a)%1;return s}Te.mix=function(e,t,r){r=r===0?0:r||50;var n=Te(e).toRgb(),o=Te(t).toRgb(),i=r/100,s={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 Te(s)};Te.readability=function(e,t){var r=Te(e),n=Te(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Te.isReadable=function(e,t,r){var n=Te.readability(e,t),o,i;switch(i=!1,o=due(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};Te.mostReadable=function(e,t,r){var n=null,o=0,i,s,a,l;r=r||{},s=r.includeFallbackColors,a=r.level,l=r.size;for(var p=0;p<t.length;p++)i=Te.readability(e,t[p]),i>o&&(o=i,n=Te(t[p]));return Te.isReadable(e,n,{level:a,size:l})||!s?n:(r.includeFallbackColors=!1,Te.mostReadable(e,["#fff","#000"],r))};var rw=Te.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"},aue=Te.hexNames=lue(rw);function lue(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function D$(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function dr(e,t){cue(e)&&(e="100%");var r=pue(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)}function Dv(e){return Math.min(1,Math.max(0,e))}function Lo(e){return parseInt(e,16)}function cue(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function pue(e){return typeof e=="string"&&e.indexOf("%")!=-1}function qi(e){return e.length==1?"0"+e:""+e}function ug(e){return e<=1&&(e=e*100+"%"),e}function F$(e){return Math.round(parseFloat(e)*255).toString(16)}function A$(e){return Lo(e)/255}var Zi=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 ll(e){return!!Zi.CSS_UNIT.exec(e)}function uue(e){e=e.replace(Vpe,"").replace(zpe,"").toLowerCase();var t=!1;if(rw[e])e=rw[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Zi.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Zi.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Zi.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Zi.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Zi.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Zi.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Zi.hex8.exec(e))?{r:Lo(r[1]),g:Lo(r[2]),b:Lo(r[3]),a:A$(r[4]),format:t?"name":"hex8"}:(r=Zi.hex6.exec(e))?{r:Lo(r[1]),g:Lo(r[2]),b:Lo(r[3]),format:t?"name":"hex"}:(r=Zi.hex4.exec(e))?{r:Lo(r[1]+""+r[1]),g:Lo(r[2]+""+r[2]),b:Lo(r[3]+""+r[3]),a:A$(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=Zi.hex3.exec(e))?{r:Lo(r[1]+""+r[1]),g:Lo(r[2]+""+r[2]),b:Lo(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function due(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}}var hw=ss(mw());var gw=j.object({rank:j.union([j.enum(["low","medium","high","always-visible"]),j.number()]).optional(),interactive:j.boolean().optional(),appearance:j.object({margin:j.number().min(6).optional(),text:j.object({numLines:j.number().optional(),lineHeight:j.number().optional(),size:j.number().optional(),maxWidth:j.number().optional(),foregroundColor:j.string().optional(),backgroundColor:j.string().optional()}).optional(),marker:j.object({size:j.number().optional(),foregroundColor:j.object({active:j.string().optional(),inactive:j.string().optional()}).optional(),backgroundColor:j.object({active:j.string().optional(),inactive:j.string().optional()}).optional(),iconSizeInterpolation:j.object({nearZoomLevel:j.number().optional(),farZoomLevel:j.number().optional(),nearScale:j.number().optional(),farScale:j.number().optional()}).optional()}).optional()}).optional()});function mj(e,t,r){j.array(j.number()).min(2).max(3).parse(e),j.string().parse(t),gw.parse(r||{})}var cm={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},ofe={lightOnDark:L(T({},cm),{text:L(T({},cm.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:L(T({},cm.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:L(T({},cm),{text:L(T({},cm.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:L(T({},cm.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},ife="LOW_PRIORITY",uj=4,sfe=6,afe=20,lfe=2.5,cfe=2,pfe="cover",ufe=-1/0,dj=6.5,fj={heightAbovePolygon:0,appearance:ofe.darkOnLight},hj=(e,t)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(r=>{var n,o,i;return((n=t.text)==null?void 0:n[r])!=null&&((o=e.text)==null?void 0:o[r])!==((i=t.text)==null?void 0:i[r])}),yj=(e,t)=>["foregroundColor","backgroundColor","icon"].some(r=>{var n,o,i;return((n=t.marker)==null?void 0:n[r])!=null&&((o=e.marker)==null?void 0:o[r])!==((i=t.marker)==null?void 0:i[r])});var gg,bg,pm=class pm{constructor(t,r,n){f(this,"lines",0);f(this,"id");f(this,"rank");f(this,"type","label");f(this,"initialRank");f(this,"contextConfigured",!1);f(this,"fillText");f(this,"newStyle",{});f(this,"opacity",0);f(this,"visibilityNeedsUpdate",!1);f(this,"text");f(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});f(this,"projection",new Ae);f(this,"labelCacheId");f(this,"_cache",{});f(this,"appearance");f(this,"options");f(this,"visible",!0);f(this,"enabled",!0);f(this,"isOccluded",!1);f(this,"offscreen",!1);f(this,"canShow",!1);f(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});f(this,"dimensions",{width:0,height:0});f(this,"currentStrategyIndex",-1);O(this,gg,0);f(this,"iconScale",1);O(this,bg);f(this,"dirty",!0);f(this,"textDirty",!0);f(this,"markerDirty",!0);f(this,"attachedDirty",!0);f(this,"collisionDirty",!0);f(this,"lastTextAlign");f(this,"imageHash");f(this,"markerSize",0);f(this,"iconVisible",!1);f(this,"dp");f(this,"animate",!0);f(this,"onStrategySelected",t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[this.currentStrategyIndex];if(r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}});f(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var i,s;if(this.id=(i=r.id)!=null?i:kt(),this.options=(0,hw.default)({},r,fj),this.text=t,this.dp=(a=1)=>a*n.pixelRatio,typeof r.rank=="string")this.rank=Qf(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let a=Math.trunc(x.env.NODE_ENV==="test"?pm.testId:pm.testId*10)/10;pm.testId+=.001,this.rank=a,this.initialRank=a}let o=(0,hw.default)({},this.options.appearance,fj.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||Te(o.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:o.marker.backgroundColor.active,inactive:o.marker.backgroundColor.inactive||Te(o.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:o.marker.icon,iconSize:o.marker.iconSize||afe,iconPadding:(s=o.marker.iconPadding)!=null?s:cfe,iconFit:o.marker.iconFit||pfe,iconOverflow:o.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:o.marker.iconVisibleAtZoomLevel==null?ufe:o.marker.iconVisibleAtZoomLevel,iconSizeInterpolation:o.marker.iconSizeInterpolation}},this.scaledIconPadding=this.appearance.marker.iconPadding}get totalMarkerSize(){return c(this,gg)*this.iconScale}set totalMarkerSize(t){k(this,gg,t)}get scaledIconPadding(){return(c(this,bg)||this.appearance.marker.iconPadding||0)*this.iconScale}set scaledIconPadding(t){k(this,bg,t)}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(dj),this.totalMarkerSize=Math.ceil((this.markerSize+lfe)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,o=Math.max(sfe,n),i=this.iconVisible?o/2:0,s=this.iconVisible?this.totalMarkerSize:dj/2,a=[{name:"RIGHT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+o,l/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+t+o]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+uj,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+o,l/2+o,this.totalMarkerSize/2+t+o,this.totalMarkerSize/2+o]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-uj,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let l=this.dp();return[r+this.totalMarkerSize/2/l+o,this.totalMarkerSize/2+o,t/2+o,t/2+o]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-t/2}},{name:ife,getBoundingBox:()=>[s+i,s+i,s+i,s+i],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:a}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let r=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,r){r.onStrategySelected(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};gg=new WeakMap,bg=new WeakMap,f(pm,"testId",0);var yw=pm,Qs=yw;d();d();var Uv=class extends Ne{constructor(r,n){super();f(this,"rendererState");f(this,"convertTo3DMapPosition");f(this,"textSet",new Set);f(this,"batchedTextMap",new Map);f(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var a,l,p;let n,o,i,s=[];for(let u of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(u),(n==null?void 0:n.type)==="text3d"){o=n.components[0],i=n.components[1];let m=(a=o.mesh)==null?void 0:a.parent;if(!m||!(m instanceof st)||!(o instanceof Sc))continue;if("textArea"in o.feature.properties&&o.mesh!=null&&o.polygonEntityId!=null&&o.textMesh==null&&o.mesh.parent!=null&&((p=(l=o.feature.properties)==null?void 0:l.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,um().then(({BatchedText:v})=>{let I=new v;return I.type="batchedtext",m.add(I),I}));let g=this.batchedTextMap.get(m);if(!g)throw new Error("batched text required");s.push(gj({entityId:u,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:g,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(u.toString()))continue;this.textSet.add(u.toString()),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,um().then(({BatchedText:v})=>{let I=new v;return I.type="batchedtext",m.add(I),I}));let g=this.batchedTextMap.get(m);if(!g)throw new Error("batched text required");s.push(gj({entityId:u,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:g,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let h=this.batchedTextMap.get(m);o.textMesh&&h&&o.polygonEntityId!=null&&Promise.all([h,Promise.resolve({meshComponent:o,styleComponent:i})]).then(([g,{meshComponent:v,styleComponent:I}])=>{let{textMesh:b}=v;if(g&&b){let C=Iw(g,b);v.visible&&!C?g.add(b):!v.visible&&C&&g.remove(b)}I.flipToFaceCamera&&this.flipIfNeeded(v,r)})}return Promise.all(s)}flipIfNeeded(r,n){let o=r.textMesh;if(!o)return!1;let i=o.rotation.z,s=II(i+n);s>Math.PI/2&&s<3*Math.PI/2&&(o.rotation.z=II(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 s=new vi(i.maxWidth,i.maxHeight),a=new He(s,new Br({color:"pink"})),{textMesh:l}=n;if(!l)continue;let p=this.convertTo3DMapPosition(i.position,xg);a.position.copy(p),a.position.z=l.position.z-.1,a.rotation.z=l.rotation.z,bw.identity(),bw.makeRotationAxis(new we(0,0,1),l.userData.rotationZ),xg.set(i.maxWidth/2,0,0),xg.applyMatrix4(bw),a.position.x-=xg.x,a.position.y-=xg.y,this.rendererState.entityScene.add(a),this.debugTextAreaMesh.set(o,a)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};function vw(e){um().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}var bw=new bi,xg=new we,xw;async function bj(e){let{preloadFont:t}=await um();return t(e)}function um(){return xw||(xw=import("./text3d-RZEC5VQO.js").then(e=>e)),xw}async function gj({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:o,rendererState:i,type:s="text-area"}){return Promise.all([um(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:a,createTroikaTextArea:l},p])=>s==="text-area"?l(p.entityId,p.meshComponent,p.styleComponent,n):a(p.entityId,p.meshComponent,p.styleComponent,n)).catch(a=>{V.warn("Trouble creating text: ",a)}).then(a=>{if(!(a!=null&&a.text))return;let l=[Promise.resolve(a.text),o,Promise.resolve()];if(t.polygonEntityId){let p=i.geometry3DMap.get(t.polygonEntityId);if((p==null?void 0:p.type)==="geometry"){let u=p.components[0],m=p.components[1];u.textMesh=a.text,u.mesh!=null&&(a.text.position.z=m.altitude+m.height+dfe)}}else l[2]=um().then(({syncText:p})=>p(a.text));return Promise.all(l)}).then(a=>{if(!a)return;let[l,p]=a;p.add(l),t.batchedText||(t.batchedText=p)})}function Iw(e,t){return e._members.has(t)}var dfe=.5;var ffe=j.object({visible:j.boolean(),color:j.string(),flipToFaceCamera:j.boolean(),font:j.string().optional(),fontSize:j.number(),margin:j.union([j.number(),j.tuple([j.number(),j.number(),j.number(),j.number()])]),outlineColor:j.string(),outlineOpacity:j.number(),outlineBlur:j.union([j.number(),j.string()]),outlineWidth:j.number(),outlineOffsetX:j.number(),outlineOffsetY:j.number(),strokeWidth:j.number(),maxWidth:j.number().optional(),maxHeight:j.number().optional(),strokeOpacity:j.number(),strokeColor:j.string(),fillOpacity:j.number(),hoverColor:j.string().optional(),id:j.union([j.string(),j.number()]),type:j.literal("text3d"),position:j.tuple([j.number(),j.number(),j.number()]),content:j.string()}),xj=ffe.partial().omit({id:!0,type:!0}).strict(),vj=xj.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Ij=j.object({appearance:xj.optional(),parentId:j.string().optional()}).strict(),Sc=class{constructor(t){f(this,"mesh",new Si);f(this,"textMesh");f(this,"type","text3d");f(this,"feature");f(this,"parent");f(this,"batchedText");f(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?Iw(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}};d();var dm=class{constructor(t){f(this,"color");f(this,"dirty",!0);f(this,"visible",!0);f(this,"edgeColors");f(this,"geometry");f(this,"ranges");f(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]}};d();d();d();var Vv=class extends Y4{constructor(r){let n=r,o=3,i=o*4;super(new Float32Array(r*i),o,r,ab,$4);f(this,"_width");f(this,"_height");f(this,"_propertiesLength");this._width=i,this._height=n,this._propertiesLength=o}setColor(r,n,o){let i=this.image.data,s=r*this._width;i[s]=n.r,i[s+1]=n.g,i[s+2]=n.b,i[s+3]=0,i[s+4]=o.r,i[s+5]=o.g,i[s+6]=o.b,i[s+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]),s=new Lt(n[o+4],n[o+5],n[o+6]);return{color:i,topColor:s}}setTexture(r,n,o){let i=this.image.data,s=r*this._width;i[s+8]=n?1:0,i[s+9]=o?1:0,i[s+10]=0,i[s+11]=0,this.needsUpdate=!0}};d();var Sj="#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";d();var Cj="#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 mfe=-.05,hfe=1,Ou=class extends Ii{constructor(r,n,o=1){super(r);f(this,"propertiesTexture");f(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});f(this,"colorSpace",ma);f(this,"showTextures",r=>{let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,n,o),this.needsUpdate=!0)});this.propertiesTexture=new Vv(n),this.uniforms.uRepeatYFactor.value=o,this.onBeforeCompile=i=>{let s=this.uniforms.uGradientIntensity,a=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,u=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor,h=this.uniforms.uBlendTexture;this.uniforms=i.uniforms,i.vertexShader=Sj,i.fragmentShader=Cj,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:a,uGradientStart:l,uMinSideAlpha:{value:mfe},uMaxSideAlpha:{value:hfe},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:u,uRepeatYFactor:m,uBlendTexture:h})}}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=as,r.wrapT=as,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=as,r.wrapT=as,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?j4:ma,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()}};d();function Tj(e,t){var a,l,p;let r=0;for(let u of e)r+=((l=(a=u.components[0])==null?void 0:a.geometry)==null?void 0:l.attributes.position.count)||0;let n=new Lt(t.color),o;o=new Ou({color:n,side:t.side==="back"?R4:t.side==="front"?sb:fa,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 bb(e.length,r,0,o),s;for(let u of e)s=u.components[0],!(!(s instanceof hr)||!s.geometry)&&(s.mesh=i,s.material=o,s.instanceIndex=i.addGeometry(s.geometry),i.addInstance(s.instanceIndex),i.userData.entities[s.instanceIndex]=u.id,o instanceof Ou&&o.setColor(s.instanceIndex,n,t.topColor?new Lt(t.topColor):n));return i.perObjectFrustumCulled=!0,i.matrixAutoUpdate=!1,i}function zv(e){return Te(e).darken(30).toRgbString()}function Pj(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let o=e.boundingBox,i=e.getAttribute("position"),s=e.getAttribute("normal"),a=e.getAttribute("uv"),l,p;e.index?(l=e.index.count/3,p=function(w,M){return e.index.getX(w*3+M)}):(l=i.count/3,p=function(w,M){return w*3+M});let u=new bi;u.makeRotationFromQuaternion(new Wm().setFromEuler(new ha(0,0,r/180*Math.PI)));let m=t.find(w=>w.face==="top"),h;m&&(h={min:n(m.bounds[1],m.bounds[0],0),max:n(m.bounds[3],m.bounds[2],o.max.z)});let g=t.find(w=>w.face==="side"),v;if(g&&(v={min:n(g.bounds[1],g.bounds[0],0),max:n(g.bounds[3],g.bounds[2],o.max.z)}),!(!v&&!h))for(let w=0;w<l;++w){let M=s.getX(p(w,0))+s.getX(p(w,1))+s.getX(p(w,2)),E=s.getY(p(w,0))+s.getY(p(w,1))+s.getY(p(w,2)),B=s.getZ(p(w,0))+s.getZ(p(w,1))+s.getZ(p(w,2)),$=Math.abs(M),D=Math.abs(E),F=Math.abs(B);var I,b;$<=D&&$<=F?(I="x",D<=F?b="y":b="z"):D<=$&&D<=F?(I="y",$<=F?b="x":b="z"):(I="z",$<=D?b="x":b="y"),I==="z"&&(I=b,b="z");let W,G,U,J,X,ie;if(b==="z"||I==="z"){if(!g||!v)continue;W=g.repeat.u,G=g.repeat.v,U=g.offset.u,J=g.offset.v,X=g.rotation,ie=v}else{if(!m||!h)continue;W=m.repeat.u,G=m.repeat.v,U=m.offset.u,J=m.offset.v,X=(360-r+m.rotation)%360,ie=h}let{min:te,max:xe}=ie,Pe=new ya;Pe.position.set(te.x,te.y,0),Pe.updateMatrix(),Pe.updateMatrixWorld();let he=te.clone().applyMatrix4(u),Re=xe.clone().applyMatrix4(u),rt=Math.abs(Re.x-he.x),it=Math.abs(Re.y-he.y),We=new we(rt,it,xe.z).applyMatrix4(Pe.matrixWorld),Xe=Math.abs(We[I]-te[I]),ue=Math.abs(We[b]-te[b]),ye=X*Math.PI/180||0,fe=Math.cos(ye),ne=Math.sin(ye),A=Pe.matrixWorld.clone().invert(),Y=new Wm().setFromEuler(new ha(0,0,r/180*Math.PI));for(let R=0;R<3;R++){let ae=new we(i.getX(p(w,R)),i.getY(p(w,R)),i.getZ(p(w,R))).applyMatrix4(A);ae.applyQuaternion(Y);let le=ae.applyMatrix4(Pe.matrixWorld),Se=le.x,cr=le.y,Nn=le.z;var C,P;I==="x"?C=W*(Se-te[I])/Xe+U:I==="y"?C=W*(cr-te[I])/Xe+U:C=W*(Nn-te[I])/Xe+U,b==="x"?P=G*(Se-te[b])/ue+J:b==="y"?P=G*(cr-te[b])/ue+J:P=G*(Nn-te[b])/ue+J,C-=.5,P-=.5;let tn=C*fe-P*ne+.5,vn=C*ne+P*fe+.5;a.setX(p(w,R),tn),a.setY(p(w,R),vn)}}}d();var fm=class{constructor(){f(this,"focusMesh");f(this,"dirty",!0)}};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 Qc&&e.components[1]===void 0?(e.components[1]=new im,e.components[1].dirty=!0):e instanceof Mt&&e.components[2]===void 0?(e.components[2]=new im,e.components[2].dirty=!0):e instanceof st&&e.components[1]===void 0&&(e.components[1]=new im,e.components[1].dirty=!0),!0):(e instanceof Qc?e.components[1]=void 0:e instanceof Mt?e.components[2]=void 0:e instanceof st&&(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}function wj(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 s of e.userData.entities3D.values())if(n=t.geometry3DMap.get(s),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 a=n.components[3];a&&(a.color=zv(o.color||i.color),a.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}}function Mj(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}function Oj(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))}function Cw(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),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],s.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}function Tw(e,t){if(t!==void 0){let r=!1;(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==e.components[1].initialColor&&(e.components[1].initialColor=t.initialColor,r=!0),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,r=!0,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}function Pw(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?e.updatePosition(r(t[1],t[0],t[2]||0)):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}function ww(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof st?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}function Ej(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}function _j(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{tw.parse(t.options||{})}catch(o){return V.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))),kj(e,t.options.rank),!0}}return!1}function kj(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Qf(t),!0):!1}function Aj(e,t,r){var n,o,i,s,a;if(t!==void 0&&e.type==="label"){let l=e.components[0];t.text!==void 0&&t.text!==l.text&&(l.text=t.text,l.textDirty=!0);try{gw.parse(t.options||{})}catch(p){V.error(p);return}hj(l.appearance,((n=t.options)==null?void 0:n.appearance)||{})&&(l.textDirty=!0),yj(l.appearance,((o=t.options)==null?void 0:o.appearance)||{})&&(l.markerDirty=!0),OM(l.appearance,((i=t.options)==null?void 0:i.appearance)||{}),gn(e,(s=t.options)==null?void 0:s.interactive,r),kj(e,(a=t.options)==null?void 0:a.rank)}}function Dj(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}function Fj(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}function Mw(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}function ea(e,t,r){if(r!==void 0){if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){r!==e.components[1].visible&&(e.components[1].visible=r,e.components[1].dirty=!0);let n=e.components[3];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof gM){let o=t.geometry2DMap.get(n.userData.entityId);if(o){let i=o.components[0];i instanceof Qs&&(i.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}function Ow(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),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],(!s.opacity||s.opacity===n.opacity)&&(s.opacity=r,s.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 st&&(n=e.parent.opacity),Lj(e,t,n),!0}}return!1}function Lj(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 In&&o.type==="geometry-group"||o instanceof st&&o.type==="group-container")&&Lj(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)}}function Rj(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)}}function Nj(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 hr){let o=e.components[0];return o.detached===!1&&(o.detached=!0,o.dirty=!0),e.components[1].dirty=!0,!0}}return!1}function Bj(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}function Hv(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}function Wv(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 Mt&&Wv(o,t,r)}else if(e.type==="geometry"){let n=e.components[3],o=e.components[1];!n&&r===!0?e.components[3]=new dm(o.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}function Ew(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof hr&&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 fm,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}function $j(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}function jj(e,t,r){let{visible:n,color:o}=r;if(e.type!=="path")return;let i=e.components[0];n!=null&&ea(e,t,n),o!=null&&Tw(e,{color:o}),Object.assign(i,_w(r)),TM(r)||(i.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(i.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(i.dirty=!0))}function _w(e){return Co(e,gfe)}var gfe=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function Gj(e){if(!(e instanceof Mt&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var Zv=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function Uj(e,t,r){ea(e,t,r.visible);let n=e.components[1],o=Co(r,Zv);"margin"in r&&V.warn("update to margin is not supported atm"),"content"in r&&V.warn("content update is not supported atm");try{vj.parse(o)}catch(i){V.error(i);return}Object.keys(o).length>0&&(Object.assign(n,o),n.dirty=!0)}var bfe=["color","material","opacity","verticalOffset","rotation","position","scale"];function Vj(e,t){let r=Co(t,bfe),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)}var Eu,ta,qv,Cc,zj,Ig,Xv,Hj,Wj,Sg,Yv,Cg,Tg,Kv,vg=class{constructor(t){O(this,Cc);O(this,Eu,null);O(this,ta);f(this,"getCurrentSceneGLTF",async t=>{let r=T({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await ee(this,Cc,zj).call(this),o=c(this,qv).call(this,r),i=await n.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),s;if(i instanceof ArrayBuffer)s=new Blob([i],{type:"application/octet-stream"});else{let a=JSON.stringify(i,null,2);s=new Blob([a],{type:"text/plain"})}return s});O(this,qv,t=>{let{scale:r,light:n,onlyVisible:o}=t,i=new Dl,s=new Xr().setFromObject(c(this,ta).entityScene);if(c(this,Ig).call(this,c(this,ta).entityScene,i,o),n){let a=new fb(16777215,.3*Math.PI);a.position.set(0,Math.max(s.max.x,s.max.y)*r*.5,s.max.y*r*4),a.lookAt(0,0,-1),a.target.position.set(0,0,-1),a.add(a.target),i.add(a)}return i});O(this,Ig,(t,r,n)=>{t.material&&(t instanceof pb?ee(this,Cc,Hj).call(this,t).forEach(o=>r.add(o)):t instanceof sd&&r.add(ee(this,Cc,Wj).call(this,t))),t.children.forEach(o=>{(!n||o.visible)&&c(this,Ig).call(this,o,r,n)})});O(this,Xv,(t,r,n)=>{let o=new eM({color:new Lt(t),metalness:0});return o.opacity=r,o.transparent=n,o});O(this,Sg,t=>{let{geometry:r,material:n,position:o,rotation:i,quaternion:s,scale:a}=t;if(!(r!=null&&r.isBufferGeometry))return t;let l=r.attributes.position,p=r.attributes.normal,u=r.attributes.uv;return c(this,Yv).call(this,l,p),c(this,Tg).call(this,o,a,i,s),u&&c(this,Kv).call(this,u),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=fa),t});O(this,Yv,(t,r)=>{let n=new we,o=new we;for(let i=0;i<t.count;i++)n.fromBufferAttribute(t,i),c(this,Cg).call(this,n),t.setXYZ(i,n.x,n.y,n.z),r&&(o.fromBufferAttribute(r,i),c(this,Cg).call(this,o),r.setXYZ(i,o.x,o.y,o.z))});O(this,Cg,t=>{let r=t.y;t.y=t.z,t.z=-r});O(this,Tg,(t,r,n,o)=>{let i=t.y;t.y=t.z,t.z=-i;let s=r.y;if(r.y=r.z,r.z=s,n instanceof ha)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let a=o.y;o.set(o.x,o.z,-a,o.w)}});O(this,Kv,t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),o=t.getY(r);t.setXY(r,n,o)}});k(this,ta,t),c(this,ta).entityScene=t.entityScene,c(this,ta).geometry3DMap=t.geometry3DMap}destroy(){k(this,Eu,null)}};Eu=new WeakMap,ta=new WeakMap,qv=new WeakMap,Cc=new WeakSet,zj=async function(){if(!c(this,Eu)){let{GLTFExporter:t}=await import("./GLTFExporter-TZEIALSW.js");k(this,Eu,new t)}return c(this,Eu)},Ig=new WeakMap,Xv=new WeakMap,Hj=function(t){var s,a;let r=[],o=((s=t.userData)!=null&&s.entities?Object.values((a=t.userData)==null?void 0:a.entities):[]).map(l=>c(this,ta).geometry3DMap.get(l)),i=new Map;return o.forEach(l=>{var g;if(!l||!(l instanceof Mt))return;let p=l.components[1],u=l.components[2];if(!p.visible||p instanceof ms&&p.opacity===0||p instanceof Ym||p instanceof Cb)return;let m=u!=null&&u.hover?p.hoverColor||c(this,ta).hoverColor:p.color,h="".concat(m,"-").concat(p.opacity,"-").concat(Number(p.visible));i.has(h)||i.set(h,[]),(g=i.get(h))==null||g.push(l)}),i.forEach((l,p)=>{let[u,m,h]=p.split("-"),g=l.reduce((C,P)=>{if(P.type==="custom-geometry")return C;let w=P.components[0];return"geometry"in w&&w.geometry instanceof q4&&C.push(w.geometry),C},[]),v=c(this,Xv).call(this,u,Number(m),t.material.transparent),I=$o(g,!0),b=new He(I,v);b.position.copy(t.position),b.rotation.copy(t.rotation),b.scale.copy(t.scale),b.visible=!!h,c(this,Tg).call(this,b.position,b.scale,b.rotation,b.quaternion),r.push(c(this,Sg).call(this,b))}),r},Wj=function(t){let r=t.geometry.clone(),n=t.material,o=new Br({color:n.color,side:fa});o.opacity=n.opacity,o.transparent=n.transparent;let i=new sd(r,o);return i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),i.visible=t.visible,c(this,Sg).call(this,i)},Sg=new WeakMap,Yv=new WeakMap,Cg=new WeakMap,Tg=new WeakMap,Kv=new WeakMap;d();d();d();var Dw=ss(rG());function nG(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}nG.prototype=Error.prototype;Dw.default.Error=function(e){throw new nG(e)};var Wr=Dw.default;var uhe="gray",dhe=.1,Mg=100,Fw=new Wr.ClipperOffset;function fhe(e,t){Fw.Clear(),t/=2;let r=e.map(o=>({X:o.x*Mg,Y:o.y*Mg}));Fw.AddPath(r,Wr.JoinType.jtMiter,Wr.EndType.etClosedPolygon);let n=new Wr.Paths;return Fw.Execute(n,t*Mg),n.length?n.map(i=>i.map(s=>({x:s.X/Mg,y:s.Y/Mg}))):[e]}function n2(e,t,r){var h,g,v,I,b;let{color:n=uhe,opacity:o=1,altitude:i=0,height:s=dhe}=r||{};Array.isArray(o)&&(o=1);let a={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:s+i},center:{x:0,y:0,z:(s+i)/2}},p=e.geometry.coordinates[0].map(C=>{let P=t(C[1],C[0]);return a.min.x=Math.min(a.min.x,P.x),a.min.y=Math.min(a.min.y,P.y),a.max.x=Math.max(a.max.x,P.x),a.max.y=Math.max(a.max.y,P.y),P});((g=(h=e.properties)==null?void 0:h.style)==null?void 0:g.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((v=e.properties)==null?void 0:v.image)!=null?p=fhe(p,((b=(I=e.properties)==null?void 0:I.style)==null?void 0:b.edgeOffset)||0):p=[p];let u=[];for(let C of p){let P=new ls;P.moveTo(C[0].x,C[0].y),C.slice(1).forEach(B=>P.lineTo(B.x,B.y)),P.lineTo(C[0].x,C[0].y);let w=e.geometry.coordinates.slice(1);P.holes=w.map(B=>{let $=B.map(F=>t(F[1],F[0])),D=new Ll;return D.moveTo($[0].x,$[0].y),$.slice(1).forEach(F=>D.lineTo(F.x,F.y)),D.lineTo($[0].x,$[0].y),D});let M={bevelEnabled:!1,depth:s},E=new cs(P,M);E.userData={style:{color:n,opacity:o}},u.push(E)}if(u.length===1)return u[0];let m=$o(u);return m.userData={style:{color:n,opacity:o},_split:!0},m}d();var mhe="gray",hhe=.1;function o2(e,t,r){let{color:n=mhe,opacity:o=1,altitude:i=0,height:s=hhe}=r||{};Array.isArray(o)&&(o=1);let a={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:s+i}},l={bevelEnabled:!1,depth:s},p=[];e.geometry.coordinates.forEach(m=>{let h=new ls,g=m[0].map(b=>{let C=t(b[1],b[0]);return a.min.x=Math.min(a.min.x,C.x),a.min.y=Math.min(a.min.y,C.y),a.max.x=Math.max(a.max.x,C.x),a.max.y=Math.max(a.max.y,C.y),C});h.moveTo(g[0].x,g[0].y),g.slice(1).forEach(b=>h.lineTo(b.x,b.y)),h.lineTo(g[0].x,g[0].y);let v=m.slice(1);h.holes=v.map(b=>{let C=b.map(w=>t(w[1],w[0])),P=new Ll;return P.moveTo(C[0].x,C[0].y),C.slice(1).forEach(w=>P.lineTo(w.x,w.y)),P.lineTo(C[0].x,C[0].y),P});let I=new cs(h,l);p.push(I)});let u=$o(p);return u.translate(0,0,i||0),u.userData={style:{color:n,opacity:o}},u}d();var yhe="gray",Lw=new Wr.ClipperOffset,Kn=100;function oG(e,t,r){let{color:n=yhe,opacity:o=1,width:i=1,join:s="round",cap:a="round",height:l=.01,altitude:p=0}=r||{};Array.isArray(o)&&(o=0);let u=[];for(let I=0;I<e.geometry.coordinates.length-1;I++){let b=t(e.geometry.coordinates[I][1],e.geometry.coordinates[I][0]),C=t(e.geometry.coordinates[I+1][1],e.geometry.coordinates[I+1][0]);u.push([b,C])}Lw.AddPaths(u.map(I=>I.map(b=>({X:b.x*Kn,Y:b.y*Kn}))),s==="round"?Wr.JoinType.jsRound:s==="miter"?Wr.JoinType.jsMiter:Wr.JoinType.jsSquare,a==="round"?Wr.EndType.etOpenRound:a==="butt"?Wr.EndType.etOpenButt:Wr.EndType.etOpenSquare);let m=new Wr.PolyTree;Lw.Execute(m,i/2*Kn);let h=[],g={bevelEnabled:!1,depth:l};for(let I of m.m_AllPolys){let b=new ls;if(I.IsHole())continue;let C=I.m_polygon;b.moveTo(C[0].X/Kn,C[0].Y/Kn),C.slice(1).forEach(P=>b.lineTo(P.X/Kn,P.Y/Kn)),b.lineTo(C[0].X/Kn,C[0].Y/Kn),b.holes=I.m_Childs.map(P=>{let w=new Ll,M=P.m_polygon;return w.moveTo(M[0].X/Kn,M[0].Y/Kn),M.slice(1).forEach(E=>w.lineTo(E.X/Kn,E.Y/Kn)),w.lineTo(M[0].X/Kn,M[0].Y/Kn),w}),h.push(new cs(b,g))}let v=$o(h);return v.translate(0,0,p||0),v.userData={style:{color:n,opacity:o}},Lw.Clear(),v}d();var Jn=100,ghe=.22,bhe=.01;function iG(e,t,r={}){let{width:n=ghe,height:o=bhe,color:i="gray",opacity:s=1,altitude:a=0}=r,l={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:a+o}},p={bevelEnabled:!1,depth:o},u=new Wr.ClipperOffset,m=e.geometry.coordinates.map(I=>I.map(b=>t(b[1],b[0])));u.AddPaths(m.map(I=>I.map(b=>({X:b.x*Jn,Y:b.y*Jn}))),Wr.JoinType.jsMiter,Wr.EndType.etOpenRound);let h=new Wr.PolyTree;u.Execute(h,n/2*Jn);let g=[];for(let I of h.m_AllPolys){let b=new ls;if(I.IsHole())continue;l.min.x=Math.min(l.min.x,I.m_polygon[0].X),l.min.y=Math.min(l.min.y,I.m_polygon[0].Y),l.max.x=Math.max(l.max.x,I.m_polygon[0].X),l.max.y=Math.max(l.max.y,I.m_polygon[0].Y);let C=I.m_polygon;b.moveTo(C[0].X/Jn,C[0].Y/Jn),C.slice(1).forEach(P=>b.lineTo(P.X/Jn,P.Y/Jn)),b.lineTo(C[0].X/Jn,C[0].Y/Jn),b.holes=I.m_Childs.map(P=>{let w=new Ll,M=P.m_polygon;return w.moveTo(M[0].X/Jn,M[0].Y/Jn),M.slice(1).forEach(E=>w.lineTo(E.X/Jn,E.Y/Jn)),w.lineTo(M[0].X/Jn,M[0].Y/Jn),w}),g.push(new cs(b,p))}let v=$o(g);return v.translate(0,0,a||0),v.userData={style:{color:i,opacity:s}},u.Clear(),v}d();d();var ym=j.object({type:j.enum(["Point"]),coordinates:j.array(j.number()).min(2).max(3)});var xhe=j.object({rotation:j.array(j.number()).length(3).optional(),altitude:j.number().optional(),scale:j.array(j.number()).length(3).optional(),interactive:j.boolean().optional(),verticalOffset:j.number().optional(),id:j.union([j.number(),j.string()]).optional()}),vhe=j.object({type:j.enum(["Feature"]),geometry:ym,properties:xhe}),Ihe=j.object({type:j.enum(["FeatureCollection"]),features:j.array(vhe)}),She=j.object({color:j.string()}),Che=j.object({url:j.string(),color:j.string().optional(),opacity:j.number().optional(),material:j.record(j.string(),She).optional()});function aG(e,t,r){j.union([j.number(),j.string()]).parse(e),Ihe.parse(t),Che.parse(r)}var Og,Eg,wc=class{constructor(t){f(this,"mesh");f(this,"type","model");f(this,"positionDirty",!0);f(this,"outline");f(this,"geometry");f(this,"material");f(this,"feature");f(this,"instanceIndex",-1);f(this,"visible",!0);f(this,"color",new Lt);f(this,"position",new we);O(this,Og,0);O(this,Eg,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return c(this,Og)}set altitude(t){this.mesh&&(this.mesh.position.z=t,k(this,Og,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(Qe.degToRad(t[0]),Qe.degToRad(t[1]),Qe.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 c(this,Eg)}set opacity(t){var r,n,o;if(this.mesh){if(this.mesh.children[0]instanceof Fl){for(let i of this.mesh.children)if(i instanceof Fl){((r=i.userData)==null?void 0:r.originalOpacity)===void 0&&(i.userData.originalOpacity=i.material.opacity);let s=Bo(t,0,(n=i.userData)==null?void 0:n.originalOpacity,0,1);i.material.opacity=s,i.material.transparent=s<1,i.material.needsUpdate=!0}}else(o=this.mesh)==null||o.traverse(i=>{i instanceof He&&i.material&&(Array.isArray(i.material)?i.material.forEach(s=>{sG(s,t)}):sG(i.material,t))});k(this,Eg,t)}}};Og=new WeakMap,Eg=new WeakMap;function sG(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}d();function i2(e){var a,l;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=The(o,n);(a=t.mesh)==null||a.traverse(u=>{u instanceof He&&u.material&&(Array.isArray(u.material)?u.material.forEach(m=>{p[m.name]?m.color.set(p[m.name].color):m.color.set(o)}):p[u.material.name]?u.material.color.set(p[u.material.name].color):u.material.color.set(o))})}let i=(l=t.feature.geometry.coordinates[2])!=null?l:0,s=r.verticalOffset+i;t.altitude!==s&&(t.altitude=s),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}function The(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}function lG(e,t){var s,a;let r=e.components[0],o=(s=e.components[1].verticalOffset)!=null?s:0,i=r.feature.geometry.coordinates.slice();i[2]=((a=i[2])!=null?a:0)+o,r.mesh?r.mesh.position.copy(t(i)):r.position.copy(t(i))}function Phe(e){let{color:t,opacity:r,topColor:n,texture:o,topTexture:i}=e;return"".concat(t).concat(r).concat(n||"").concat(o||"").concat(i||"")}var whe=1e4,s2=class extends Ne{constructor(r,n){super();f(this,"state");f(this,"convertTo3DMapPosition");f(this,"loader");f(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-YCEKYYW3.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,o){var a,l;let i=new hr(n),s=new Mt(i,new ms(L(T({},o),{url:(l=(a=n.properties)==null?void 0:a.image)==null?void 0:l.path})));return o!=null&&o.outline&&(s.components[3]=new dm(zv(o.color))),s.id=r,s}createModelFromFeature(r,n,o){let i=new wc(n),s=T({},o);n.properties.verticalOffset!=null&&(s.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(s.rotation=n.properties.rotation),n.properties.scale!=null&&(s.scale=n.properties.scale);let a=new Cb(s),l=new Mt(i,a);return l.id=r,l}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 bi,s=new ha,a=new Wm,l=new we,p=new Si,u=await this.getGLTFLoader(),m=new Promise(h=>{u.load(n,g=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?g.scene.traverse(v=>{let I=v;if("isMesh"in I&&I.isMesh===!0){let b=new Fl(I.geometry,I.material,r.size);b.userData={entities:{}},p.add(b),o.add(p)}}):(g.scene.traverse(v=>{"isMesh"in v&&v.isMesh===!0&&(v.position.set(0,0,0),v.rotation.set(0,0,0),v.scale.set(1,1,1),v.updateMatrix())}),p.add(g.scene),o.add(p),p.userData.isSingleModel=!0,p.userData.entityId=r.values().next().value,p.userData.type="model")),h()})});return this.optimizePromise.push(m.then(()=>{var v,I,b,C,P,w,M,E,B,$,D,F;let h=0,g;for(let W of r.values()){if(g=this.state.geometry3DMap.get(W),!g||(g==null?void 0:g.type)!=="model")continue;let G=g.components[0],U=g.components[1],J=g.components[0].feature;G.mesh=p,G.instanceIndex=h,i2(g),g.components[1].dirty=!1;let{x:X,y:ie}=this.convertTo3DMapPosition(J.geometry.coordinates[1],J.geometry.coordinates[0],0);G.position.set(X,ie,G.altitude),s.set(Qe.degToRad((I=(v=U.rotation)==null?void 0:v[0])!=null?I:md[0]),Qe.degToRad((C=(b=U.rotation)==null?void 0:b[1])!=null?C:md[1]),Qe.degToRad((w=(P=U.rotation)==null?void 0:P[2])!=null?w:md[2])),l.set((E=(M=U.scale)==null?void 0:M[0])!=null?E:fd[0],($=(B=U.scale)==null?void 0:B[1])!=null?$:fd[1],(F=(D=U.scale)==null?void 0:D[2])!=null?F:fd[2]),a.setFromEuler(s),i.compose(G.position,a,l),p.children.forEach(te=>{!g||(g==null?void 0:g.type)!=="model"||!(te instanceof Fl)||(te.setMatrixAt(h,i),te.userData.entities[h]=g.id)}),G.mesh.userData.isSingleModel&&(G.mesh.matrix.copy(i),G.mesh.matrix.decompose(G.mesh.position,G.mesh.quaternion,G.mesh.scale)),h++}this.publish("model-loaded")})),p}populateEntityGroup(r){var a;let n,o,i,s;for(let l of r.values())s=this.state.geometry3DMap.get(l),s.components[0]instanceof hr&&(o=s.components[0].feature,i=s.components[1],o.geometry.type==="Polygon"?(n=n2(o,this.convertTo3DMapPosition,i),(a=o.properties)!=null&&a.textures&&o.properties.textures.length>0&&Pj(n,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(s,n)):o.geometry.type==="MultiPolygon"?(n=o2(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)):o.geometry.type==="LineString"?(n=oG(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)):o.geometry.type==="MultiLineString"&&(n=iG(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)));return r}optimize(r){var n;if((r.visible||r.userData.preloadGeometry)&&(r instanceof In||r instanceof st)){for(let s of r.children)this.optimize(s);if(r instanceof st||r.userData.dirty===!1)return;let o={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(s){V.warn(s)}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 s=0,a;for(let l of r.userData.entities3D.values()){a=this.state.geometry3DMap.get(l);let p=a==null?void 0:a.components[0];if((a==null?void 0:a.type)==="geometry"){let u=a.components[1];s++,s>=whe&&(s=0,i++);let m=Phe(u)+i;o[m]===void 0&&(o[m]={style:u,entities:[]}),o[m].entities.push(a)}else p&&"mesh"in p&&p.mesh&&((n=p.mesh)==null?void 0:n.parent)!==r&&r.add(p.mesh)}for(let l in o){let p=Tj(o[l].entities,o[l].style);r.add(p),r.userData.dirty=!1}for(let l of r.userData.entities3D.values())if(a=this.state.geometry3DMap.get(l),a!=null&&a.entities2D.size>0)for(let p of a.entities2D.values())p&&(a.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}};d();var a2=class{constructor(t,r){f(this,"state");f(this,"dirty",!0);f(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 Js&&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}}};d();var l2=class{constructor(t,r){f(this,"state");f(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 s=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(s instanceof Mt)if(this.state.geometry3DIdsInScene.has(s.id)){n=s.components[1],o=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let a=n.visible&&n.opacity>0;o.visible!==a&&(o.visible=a)}else o.visible===!0&&(o.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};d();d();var Mhe=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}}}(),cG=({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:o=2,lineHeight:i=1.2,options:s={strokeText:!0}})=>{let a="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=Mhe(n);l.font=a;let p=[],u=e.split(" "),m=0,h=0,g=0;for(;h<u.length;){let C=u[h];if(m===o&&m>0){p[m-1]+="...";break}if(p[m]==null&&(p[m]=C,h++),u.length===1){p[m]=C;break}if(u[h]==null)break;let{width:P}=l.measureText(p[m]+" "+u[h]);P<=r*n?(p[m]+=" "+u[h],h++):m++}p.forEach(C=>{let{width:P}=l.measureText(C);g=Math.max(P,g)});let v=t*n*i,I=p.length*v;return{maxWidth:g,maxHeight:I,lines:p.length,draw:(C,P,w)=>{p.length===1?(s.strokeText&&C.strokeText(p[0],P,w),C.fillText(p[0],P,w)):(s.strokeText&&(C.strokeText(p[0],P,w-v/2),C.strokeText(p[1],P,w+v/2)),C.fillText(p[0],P,w-v/2),C.fillText(p[1],P,w+v/2))}}};d();function pG(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}var Ohe=3.5,Ehe=2.5,_he=2,khe=5,_g=2.5;var c2=class extends Ne{constructor(r,n,o){super();f(this,"dirty",!1);f(this,"state");f(this,"colliderContext");f(this,"colliderCanvas");f(this,"transformRequestFunc");f(this,"transformRequest",async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r});f(this,"pinCache",{});f(this,"imageCache",{});f(this,"imagePromiseCache",{});f(this,"imageDimensionsCache",{});f(this,"textCache",{});f(this,"update",r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let o,i,s,a,l,p,u;for(let m of this.state.geometry2DIdsInScene)if(u=this.state.geometry2DMap.get(m),u!=null&&(p=u.components[0],p instanceof Qs&&!u.disposed)){if(l=p.appearance.marker.iconVisibleAtZoomLevel,p.appearance.marker.icon!=null&&l&&r>=l!==p.iconVisible&&(p.iconVisible=r>=l,p.dirty=!0),(p.dirty||this.dirty)&&p.calculateMarkerSize(),i=p.appearance.marker.foregroundColor,s=p.appearance.marker.backgroundColor,a=ld(p.markerSize,2),o="".concat(i.active,"-").concat(i.inactive,"-").concat(s.active,"-").concat(s.inactive,"-").concat(a,"-").concat(p.iconVisible),p.labelCacheId=o,this.pinCache[o]||this.prepare(p,o,this.colliderContext),p.appearance.marker.icon&&(!p.imageHash||p.markerDirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.textDirty||this.dirty){p.collisionDirty=!0,this.textCache[p.id]={};let{textDrawFn:h,width:g,height:v}=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(h,p.appearance.text.size,I,g,v,p.appearance.text.foregroundColor,p.appearance.text.backgroundColor)}),p.dimensions={width:Math.ceil(g/n),height:Math.ceil(v/n)}}p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,o,this.colliderContext,r),p.dirty=!1,p.textDirty=!1,p.markerDirty=!1}this.dirty=!1});f(this,"processText",(r,n,o,i,s)=>{let a=this.state.pixelRatio,{draw:l,maxWidth:p,maxHeight:u}=cG({text:r,size:n,pixelRatio:a,maxWidth:o,maxLines:i,lineHeight:s});return{textDrawFn:l,width:p+_g*a*2,height:u+_g*a*2}});f(this,"textToCanvas",(r,n,o,i,s,a,l)=>{let p=this.state.pixelRatio,u,m=i,h=s;window.OffscreenCanvas!=null&&!CM()?u=new OffscreenCanvas(m,h):(u=document.createElement("canvas"),u.width=m,u.height=h,u.style.width=m+"px",u.style.height=h+"px");let g=u.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=o,g.font="bold ".concat(n*p,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=_g*p,g.fillStyle=a,g.strokeStyle=l;let v=o==="left"?0:o==="center"?m/2:m-_g*p/2;return r(g,v,(h+_g*p/2)/2),u});f(this,"cacheImage",r=>{if(!r.appearance.marker.icon)return;let n=_M(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(o=>{this.transformRequest(r.appearance.marker.icon).then(i=>{let s=pG(i.url);s.onload=()=>{this.imageCache[n]=s,this.publish("img:loaded"),o(s)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))});f(this,"createPinCanvas",(r,n,o,i,s=1)=>{let a,l=this.state.pixelRatio,p=r.totalMarkerSize*2*l*s;window.OffscreenCanvas!=null?a=new OffscreenCanvas(p,p):(a=document.createElement("canvas"),a.width=p,a.height=p,a.style.width=p/l+"px",a.style.height=p/l+"px");let u=a.getContext("2d");return u.shadowColor="rgba(0,0,0,0.3)",u.shadowOffsetY=_he*l,u.shadowBlur=khe*l,u.beginPath(),u.arc(p/2,p/2,(n/2+Ehe*l/2)*s,0,2*Math.PI),u.fillStyle=o,u.fill(),u.beginPath(),u.arc(p/2,p/2,n/2*s,0,2*Math.PI),u.shadowColor="transparent",u.fillStyle=i,u.fill(),a});f(this,"prepare",(r,n,o)=>{var l,p;let i=this.state.pixelRatio;o.lineWidth=4*i;let s=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active,(l=r.appearance.marker.iconSizeInterpolation)==null?void 0:l.maxScale),a=this.createPinCanvas(r,r.iconVisible?r.markerSize:Ohe*i,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive,(p=r.appearance.marker.iconSizeInterpolation)==null?void 0:p.maxScale);this.pinCache[n]=[s,a]});this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=o}draw(r,n,o,i){var m,h;if(!r.canShow||!r.visible)return;o.save(),o.globalAlpha=r.opacity;let s=this.state.pixelRatio,a=r.projection.x*s,l=r.projection.y*s,p=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1],u=1;if(r.appearance.marker.iconSizeInterpolation&&r.appearance.marker.iconSize){let{minZoomLevel:g,maxZoomLevel:v,minScale:I,maxScale:b}=r.appearance.marker.iconSizeInterpolation;u=Bo(i,g,v,I,b)}if(r.recomputeCurrentStrategy(r.iconVisible?u:1),o.drawImage(p,a-r.totalMarkerSize*s,l-r.totalMarkerSize*s,r.totalMarkerSize*2*s,r.totalMarkerSize*2*s),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let g=this.imageCache[r.imageHash],v=(r.totalMarkerSize-r.scaledIconPadding)*s,I=r.appearance.marker.iconFit,b=v,C=v,P="".concat(r.imageHash,"_").concat(I);if(this.imageDimensionsCache[P])b=this.imageDimensionsCache[P].width,C=this.imageDimensionsCache[P].height;else{let w=g.width*s,M=g.height*s;if(I==="contain"){let E=Math.sqrt(w**2+M**2),B=v/E;b=w*B,C=M*B}if(I==="cover"){let E=v/w,B=v/M,$=Math.max(E,B);b=w*$,C=M*$}}o.save(),o.beginPath(),o.arc(a,l,v/2,0,2*Math.PI),o.closePath(),((h=(m=r==null?void 0:r.appearance)==null?void 0:m.marker)==null?void 0:h.iconOverflow)!=="visible"&&o.clip(),o.drawImage(g,a-b/2,l-C/2,b,C),o.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left!=null&&r.style.top!=null&&o.drawImage(this.textCache[r.id][r.style.textAlign],a+r.style.left*s,l+r.style.top*s),o.restore()}};d();d();var Du=class Du{constructor(){f(this,"loader");this.loader=new ad}static getInstance(){return Du.instance||(Du.instance=new Du),Du.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};f(Du,"instance");var Rw=Du,Mc=Rw.getInstance();function Ahe(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]}var Fu,kg,p2=class extends Ne{constructor(r,n){super();O(this,Fu);f(this,"state");f(this,"convertTo3DMapPosition");f(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!==""&&ee(this,Fu,kg).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&ee(this,Fu,kg).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 s of r.feature.properties.textures)s.face==="top"&&r.topTexture!==s.path?ee(this,Fu,kg).call(this,s.path,r,"topTexture"):s.face==="side"&&r.texture!==s.path&&ee(this,Fu,kg).call(this,s.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,s,a,l,p,u,m,h;let r,n,o;for(let g of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(g),o instanceof In&&o.type==="geometry-group"){let v=o.components[0];if(o.userData.shadingDirty){let I=o.userData.entities3D.values().next().value;if(I==null)continue;let b=this.state.geometry3DMap.get(I);b instanceof Mt&&(b.type==="geometry"||b.type==="custom-geometry")&&(r=b.components[0],o.userData.shadingDirty&&v.shading&&this.setShading(r,v.shading));let C,P;for(let w of o.userData.entities3D.values())C=this.state.geometry3DMap.get(w),P=C.components[0],C.type==="geometry"&&P.detached&&o.userData.shadingDirty&&v.shading&&this.setShading(P,v.shading);o.userData.shadingDirty=!1}if(v.dirty){let I=o.getfirstChildEntityId();if(I){let C=this.state.geometry3DMap.get(I),P=C==null?void 0:C.components[0];P instanceof hr&&this.processTextures(P,v)}let b=v.opacity*ep(o);o.getOpacity()!==b&&o.setOpacity(b),v.dirty=!1}}else if(o&&(o.type==="geometry"||o.type==="custom-geometry")&&((i=o.components[1])!=null&&i.dirty||(s=o.components[2])!=null&&s.dirty)){let v=o.components[0],I=o.components[1];n=o.components[2];let b=Ahe(o,this.state.hoverColor);if(v.setColor(b[0],b[1]),I.visible!==v.visible&&(v.visible=I.visible,v instanceof hr&&v.textMesh)){let P=this.state.geometry3DMap.get(v.textMesh.userData.entityId);(P==null?void 0:P.type)==="text3d"&&P.components[0].polygonEntityId!=null&&(P.components[0].visible=I.visible)}I.altitude!==v.altitude&&(v.altitude=I.altitude);let C=I.opacity*ep(o);C!==v.opacity&&(v.opacity=C),I.renderOrder!==v.renderOrder&&(v.renderOrder=I.renderOrder),I.dirty=!1,v instanceof hr&&this.processTextures(v,I,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(i2(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(lG(o,this.convertTo3DMapPosition),o.components[0].positionDirty=!1);else if((o==null?void 0:o.type)==="image"&&((a=o.components[1])!=null&&a.dirty)){r=o.components[0];let v=o.components[1];v.visible!==r.visible&&(r.visible=v.visible),v.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((l=o.components[1])!=null&&l.dirty)&&o.components[0].polygonEntityId!=null){r=o.components[0];let v=o.components[1];v.visible!=null&&v.visible!==r.visible&&(r.visible=v.visible);let{textMesh:I}=r;if(I){Object.assign(I,v.getState());let b=(p=v.hoverColor)!=null?p:this.state.text3dHoverColor;I.color=v.hoverByPolygon?b:(u=v.color)!=null?u:dd.color,I.outlineColor=v.hoverByPolygon?b:(m=v.outlineColor)!=null?m:dd.outlineColor,I.strokeColor=v.hoverByPolygon?b:(h=v.strokeColor)!=null?h:dd.strokeColor}v.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};Fu=new WeakSet,kg=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((s,a)=>{Mc.getLoader().load(r,l=>{o==="topTexture"?n.topTexture=l:n.texture=l,n.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{V.error("Failed to load texture: ".concat(r)),a("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,i)}};d();var u2=class extends Ne{constructor(r){super();f(this,"state");f(this,"animating",new Map);f(this,"isAnimating",!1);f(this,"startTime",-1);f(this,"showDuration",300);f(this,"hideDuration",250);f(this,"update",()=>{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 Qs&&(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")});f(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[o,i]]of this.animating.entries()){let s=i===1?this.showDuration:this.hideDuration,a=(r-this.startTime)/s;n.opacity=Bo(a,0,1,o,i,i===0?kM:AM),r-this.startTime>=s&&(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")}};d();var d2=class extends Ne{constructor(r,n,o,i,s,a,l){super();f(this,"state");f(this,"renderer");f(this,"mode");f(this,"scene");f(this,"cameraObject");f(this,"viewCamera");f(this,"systems");f(this,"needs2DRecompute",!1);f(this,"twoDdirty",!0);f(this,"threeDdirty",!0);f(this,"frameId",null);f(this,"twoDFrameId",null);f(this,"animationFrameId",null);f(this,"nextFrame",null);f(this,"update",(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,s;return((i=this.renderer)==null?void 0:i.renderer)==null?o():this.mode==="standalone"?(s=this.commitRenderState())==null?void 0:s.then(()=>{this.paint(),o()}):o()})})});f(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});f(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});f(this,"updateEntities2D",()=>{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())})});f(this,"commitRenderState",()=>{try{let r=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),MM(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(),wM(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){V.error("Render failed: ",r)}});this.renderer=r,this.state=n,this.mode=o,this.scene=i,this.cameraObject=s,this.viewCamera=a,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var r;(r=this.renderer)!=null&&r.renderer&&(this.mode==="standalone"&&this.renderer.clear(),this.renderer.render(this.scene,this.state.useStandaloneCamera||this.mode==="standalone"?this.cameraObject:this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};d();var Dhe=j.object({interactive:j.boolean().optional(),id:j.string().optional(),nearRadius:j.number().optional(),farRadius:j.number().optional(),accentColor:j.string().optional(),displayArrowsOnPath:j.boolean().optional(),animateArrowsOnPath:j.boolean().optional(),nearZoomLevel:j.number().optional(),farZoomLevel:j.number().optional(),visibleThroughGeometry:j.boolean().optional(),dashed:j.boolean().optional()}),Fhe=j.object({type:j.enum(["Feature"]),geometry:ym,properties:j.object({parentId:j.any().optional()})});function uG(e,t){j.object({features:j.array(Fhe)}).parse(e),Dhe.parse(t)}var Ag,Oc=class{constructor(t,r){f(this,"type","path");f(this,"mesh",new Si);f(this,"material");f(this,"geometry");f(this,"outline");f(this,"feature");f(this,"options");f(this,"nearRadius",.2);f(this,"farRadius",.4);f(this,"nearZoomLevel");f(this,"farZoomLevel");f(this,"nearZoomAltitude");f(this,"farZoomAltitude");f(this,"accentColor","blue");f(this,"completeFraction",1);f(this,"altitudeAdjustment",1);f(this,"displayArrowsOnPath",!1);f(this,"animateArrowsOnPath",!1);f(this,"visibleThroughGeometry",!1);f(this,"dashed",!1);f(this,"isVertical",!1);f(this,"dirty",!0);f(this,"materialDirty",!0);f(this,"position",new we);O(this,Ag,0);var n,o,i,s,a,l,p;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=(s=r==null?void 0:r.displayArrowsOnPath)!=null?s:this.displayArrowsOnPath,this.animateArrowsOnPath=(a=r==null?void 0:r.animateArrowsOnPath)!=null?a:this.animateArrowsOnPath,this.visibleThroughGeometry=(l=r==null?void 0:r.visibleThroughGeometry)!=null?l:this.visibleThroughGeometry,this.dashed=(p=r==null?void 0:r.dashed)!=null?p:this.dashed}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return c(this,Ag)}set altitude(t){this.mesh&&(this.mesh.position.z=t,k(this,Ag,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Ag=new WeakMap;d();var f2=class{constructor(t){f(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof st&&t.components[0]){let n=t.components[0];if(n.dirty){for(let o of t.children)(o instanceof In||o instanceof st)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));n.dirty=!1}}}};d();d();d();var kr=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut: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)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut: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)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut: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)}}),Bounce:Object.freeze({In:function(e){return 1-kr.Bounce.Out(1-e)},Out: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},InOut:function(e){return e<.5?kr.Bounce.In(e*2)*.5:kr.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),Dg=function(){return performance.now()},Bw=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 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 s=i[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},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=Dg()),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]],s=!r;i&&i.update(t,s)===!1&&!r&&this.remove(i)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),gm={Linear:function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=gm.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)},Bezier:function(e,t){for(var r=0,n=e.length-1,o=Math.pow,i=gm.Utils.Bernstein,s=0;s<=n;s++)r+=o(1-t,n-s)*o(t,s)*e[s]*i(n,s);return r},CatmullRom:function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=gm.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)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(e,t){var r=gm.Utils.Factorial;return r(e)/r(t)/r(e-t)},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:function(e,t,r,n,o){var i=(r-e)*.5,s=(n-t)*.5,a=o*o,l=o*a;return(2*t-2*r+i+s)*l+(-3*t+3*r-2*i-s)*a+i*o+t}}},dG=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Nw=new Bw,bo=function(){function e(t,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=kr.Linear.None,this._interpolationFunction=gm.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=dG.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=Nw,Nw.add(this))}return 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=Dg()),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 s in n){var a=t[s],l=Array.isArray(a),p=l?"array":typeof a,u=!l&&Array.isArray(n[s]);if(!(p==="undefined"||p==="function")){if(u){var m=n[s];if(m.length===0)continue;for(var h=[a],g=0,v=m.length;g<v;g+=1){var I=this._handleRelativeValue(a,m[g]);if(isNaN(I)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(I)}u&&(n[s]=h)}if((p==="object"||l)&&a&&!u){r[s]=l?[]:{};var b=a;for(var C in b)r[s][C]=b[C];o[s]=l?[]:{};var m=n[s];if(!this._isDynamic){var P={};for(var C in m)P[C]=m[C];n[s]=m=P}this._setupProperties(b,r[s],m,o[s],i)}else(typeof r[s]>"u"||i)&&(r[s]=a),l||(r[s]*=1),u?o[s]=n[s].slice().reverse():o[s]=r[s]||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=Dg()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Dg()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=kr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=gm.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=Dg()),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 s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*a,p=function(){if(n._duration===0||s>l)return 1;var I=Math.trunc(s/a),b=s-I*a,C=Math.min(b/n._duration,1);return C===0&&s===n._duration?1:C},u=p(),m=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var h=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=h);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+=a*h,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,v=this._chainedTweens.length;g<v;g++)this._chainedTweens[g].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 s=r[i]||0,a=n[i],l=Array.isArray(t[i]),p=Array.isArray(a),u=!l&&p;u?t[i]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[i],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[i]=s+(a-s)*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 Xet=dG.nextId,ra=Nw,Yet=ra.getAll.bind(ra),Ket=ra.removeAll.bind(ra),Jet=ra.add.bind(ra),Qet=ra.remove.bind(ra),ett=ra.update.bind(ra);d();d();d();var fG=(e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,mG=(e,t)=>new Ae(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),$w=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),Fg=(e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),jw=(e,t)=>new Ae((e.x+t.x)/2,(e.y+t.y)/2),Gw=e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t};var m2=class{constructor(t,r){f(this,"input1");f(this,"input2");f(this,"lastAngle");f(this,"lastDistance");f(this,"totalDistance");f(this,"first");f(this,"second");this.input1=t,this.input2=r,this.lastAngle=$w(t,r),this.lastDistance=Fg(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Fg(t,r);this.input1=t,this.input2=r;let o=$w(t,r);this.lastAngle=o,this.lastDistance=n,this.totalDistance+=(Fg(this.first,t)+Fg(this.second,r))/2,this.first=jw(this.first,t),this.second=jw(this.second,r)}};d();var Lg=class{constructor(t,r,n){f(this,"touch");f(this,"camera");f(this,"cameraPlane");f(this,"viewCoordinate");f(this,"snapHolderMatrix");f(this,"snapCamera");f(this,"cameraPosition");f(this,"raycaster");f(this,"worldCoordinate");f(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 Ae(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new ps,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 Ae(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}};var yi={};da(yi,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Rhe,CLIPPING_RADIUS:()=>Rg,CONTROL_OPTIONS:()=>Lhe,DEFAULT_ANIMATION_DURATION:()=>Ww,DEFAULT_BEARING:()=>Ghe,DEFAULT_MAX_ZOOM_LEVEL:()=>$he,DEFAULT_MIN_ZOOM_LEVEL:()=>Zw,DEFAULT_PITCH:()=>jhe,DEFAULT_ZOOM_LEVEL:()=>Bhe,EVENTS:()=>b2,MAPLIBRE_TILE_SIZE:()=>h2,MAX_LAT:()=>Vw,MAX_MERCATOR_ZOOM_LEVEL:()=>g2,MIN_LAT:()=>Uw,MIN_MERCATOR_ZOOM_LEVEL:()=>y2,ROOM_MERCATOR_ZOOM_LEVEL:()=>Nhe,TWO_PI:()=>zw,WHEEL_ZOOM_MULTIPLIER:()=>Hw,ZRANGE:()=>bm});d();var h2=512,Uw=-85.051129,Vw=85.051129,Rg=1e4,Lhe={chain:"chain",cancel:"cancel"},zw=Math.PI*2,bm=100,Hw=1e4,y2=0,g2=24,Rhe=17,Nhe=20,Ww=200,b2=["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"],Bhe=18,Zw=12,$he=22,jhe=0,Ghe=0;d();function hG(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}function fr(e){for(let t=e.children.length-1;t>=0;t--)fr(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){hG(t)}):"material"in e&&typeof e.material<"u"&&hG(e.material)}var x2=!1,Uhe=!1;var v2,Lu=class extends Ne{constructor(r,n,o,i,s){super();f(this,"dirty",!1);f(this,"zoomDirty",!1);f(this,"rotationDirty",!1);f(this,"panDirty",!1);O(this,v2,Zw);f(this,"zoomSpeed",5);f(this,"rotateSpeed",100);f(this,"enabled",!0);f(this,"enableZoom",!0);f(this,"enablePan",!0);f(this,"enablePedestal",!1);f(this,"maxPedestal",1/0);f(this,"minPedestal",0);f(this,"enableRotate",!0);f(this,"minZoomAltitude",0);f(this,"maxZoomAltitude",1/0);f(this,"ignoreZoomLimits",!1);f(this,"zoomFactor",1);f(this,"panBounds",{min:new we(1/0,1/0),max:new we(-1/0,-1/0),center:new we(0,0,0),radius:1/0});f(this,"minTilt",0);f(this,"maxTilt",1.2);f(this,"MOUSE_BUTTONS",{ORBIT:ib.RIGHT,ZOOM:ib.MIDDLE,PAN:ib.LEFT});f(this,"camera");f(this,"scene");f(this,"renderer");f(this,"elevation");f(this,"orbit");f(this,"cameraPlane");f(this,"raycaster",new ps);f(this,"rendererState");f(this,"options");f(this,"state",-1);f(this,"intersection");f(this,"viewState",null);f(this,"tweens",new Map);f(this,"clock",new rM(!0));f(this,"coords",{mouse:new Ae,rotateStart:new Ae,rotateEnd:new Ae,rotateDelta:new Ae,panStart:new we,panCameraStart:new we,panEnd:new we,panDelta:new we,initialShiftPos:new Ae,initialPedestal:0,floorAnchor:new we});f(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});f(this,"scrollTimer",null);f(this,"lastWheelTime",0);f(this,"resetZoom",!1);f(this,"zoomStart");f(this,"pedestalScaleFactor",1);f(this,"isUserZooming",!1);f(this,"stayInsideBounds",!0);f(this,"userInteracting",!1);f(this,"cameraMoving",!1);f(this,"lastCameraMoveTime",Date.now());f(this,"raycastToFloor",r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new we});f(this,"isUserInteracting",()=>this.userInteracting);f(this,"getPosition",()=>new we(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));f(this,"getPedestal",()=>this.orbit.position.z);f(this,"pan",(r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))});f(this,"postRender",()=>{(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"))});f(this,"isCameraMoving",()=>this.cameraMoving);f(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);f(this,"setPosition",(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)});f(this,"updateCameraPosition",(r,n)=>{let o=r-this.panBounds.center.x,i=n-this.panBounds.center.y,s=Math.sqrt(o*o+i*i);if(this.stayInsideBounds&&s>this.panBounds.radius){let a=Math.atan2(i,o),l={x:Math.cos(a)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(a)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=r,this.orbit.position.y=n});f(this,"tilt",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")});f(this,"zoomIn",(r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},r,n,o)});f(this,"zoomOut",(r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},r,n,o)});f(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));f(this,"cancelAnimation",()=>{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)});f(this,"animateCamera",(r,n,o,i,s,a)=>{let l=T({interruptible:!0},a),p={},u={},m=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(p.x=m.x,u.x=r.position.x),r.position.y!==void 0&&(p.y=m.y,u.y=r.position.y),r.position.z!==void 0&&(p.z=m.z,u.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?u.zoom=r.zoom:u.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:w,end:M}=yb(this.getRotation(),r.rotation);p.rotation=w,u.rotation=M}r.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?u.tilt=r.tilt:u.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let h=p.zoom!==u.zoom,g=p.rotation!==u.rotation,v=p.tilt!==u.tilt,I=new bo(p).to(u,x.env.TESTING?0:n).onUpdate(w=>{this.setMulti({x:w.x,y:w.y,z:w.z},w.zoom,w.rotation,w.tilt)}).onComplete(()=>{this.completeTween(I),this.publish("multi-end",{zooming:h,rotating:g,tilting:v}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,I.state=7,this.publish("multi-start",{zooming:h,rotating:g,tilting:v})),this.publish("change")});this.rendererState.tweenGroup.add(I);let b=Array.from(this.tweens.entries()),C=b[b.length-1],P=!1;return C!=null&&(C[1].interruptible?(typeof C[1].cancelledCallback=="function"&&C[1].cancelledCallback(),this.completeTween(C[0])):(P=!0,C[0].chain(I))),this.tweens.set(I,{cancelledCallback:s,interruptible:l.interruptible}),o?I.easing(o):I.easing(kr.Quadratic.In),!r.doNotAutoStart&&!P&&(I.start(),this.publish("change")),I.cameraAnimation=!0,I});f(this,"setMulti",(r,n,o,i,s=!0)=>{this.state===-1&&this.publish("multi-start");let a=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),a=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0),a=!0)),a&&this.publish("position-updated");let l={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&&(l.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>Rg&&(this.camera.near=n-Rg,this.camera.far=n+Rg):(this.camera.near=n/bm,this.camera.far=n*bm),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(l.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&&(l.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}s&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)});f(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);f(this,"getZoomScaledMax",()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)});f(this,"setRotation",(r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=-(r%zw);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});f(this,"setZoomAltitude",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/bm,this.camera.far=n*bm,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});f(this,"setZoomLevel",r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))});f(this,"getZoomAltitude",()=>this.camera.position.z);f(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));f(this,"setTilt",(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});f(this,"getTilt",()=>this.elevation.rotation.x);f(this,"setCameraPlaneElevation",r=>{this.cameraPlane.position.z=r});f(this,"zoom",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")});f(this,"getProjectionScaleFactor",(r,n,o)=>SI(r,n,o));f(this,"update",()=>{this.orbit.updateMatrixWorld(),this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});f(this,"setPedestal",(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)});f(this,"dispose",()=>{for(let r of b2)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)});f(this,"createCameraPlane",()=>{let r=x2?2e3:1e10,n=x2?100:1,o=new vi(r,r,n,n),i=new Br({color:0,wireframe:x2,visible:x2}),s=new He(o,i);return this.scene.add(s),s});f(this,"addEventListeners",()=>{let{domElement:r}=this.renderer;for(let n of b2)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)});f(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});f(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});f(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});f(this,"removeEventListeners",()=>{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)});f(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});f(this,"onContextMenu",r=>{r.preventDefault()});f(this,"onMouseUp",()=>{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}});f(this,"onMouseMove",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)});f(this,"onTouchStart",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 m2(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});f(this,"onTouchMove",r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n=T({},this.touch.inputs.first),o=T({},this.touch.inputs.second),i=new Ae(this.touch.touches[0].x,this.touch.touches[0].y),s=new Ae(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 a=n.y<i.y&&o.y<s.y,l=n.y>i.y&&o.y>s.y;this.enableRotate&&this.state!==4&&(l||a)?(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}});f(this,"onTouchEnd",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}});f(this,"handleTouchMovePan",r=>{let n=Object.hasOwn(r,"x")?new Ae(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});f(this,"handleTouchStartDolly",()=>{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 Ae(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 Lg(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Lg(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")});f(this,"handleMouseMovePan",()=>{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});f(this,"handleTouchStartTilt",r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});f(this,"handleTouchMovePedestal",r=>{this.handleMouseMovePedestal(r.touches[0])});f(this,"handleTouchMoveTilt",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)});f(this,"handleTouchMoveDolly",()=>{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)});f(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});f(this,"handleTouchStartPan",r=>{let n=Object.hasOwn(r,"x")?new Ae(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")});f(this,"handleTouchStartPedestal",r=>{this.handleMouseDownPedestal(r.touches[0])});f(this,"onMouseDown",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()}});f(this,"onMouseWheel",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))});f(this,"handleMouseWheel",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-Gw(r)*n/Hw*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")});f(this,"setCameraFromTransformMatrix",r=>{this.orbit.updateMatrixWorld();let n=new ha;n.setFromRotationMatrix(r,"ZYX");let o=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),i=n.z,s=new we(0,0,1);s.applyEuler(n),s.setLength(o);let a=new we;a.setFromMatrixPosition(r),a.sub(s),this.enablePan&&this.setPosition(a.x,a.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-i)});f(this,"makeTransformFromTouchAnchors",(r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),i=r.worldCoordinate,s=n.worldCoordinate,a=r.reUnproject(),l=n.reUnproject();if(!a||!l||!i||!s)return null;let p=r.viewCoordinate,u=n.viewCoordinate,m=s.x-i.x,h=s.y-i.y,g=Math.atan2(h,m),v=l.x-a.x,I=l.y-a.y,b=Math.atan2(I,v),C=fG(g,b),P=new bi;P.makeRotationZ(-C);let w=P.clone();w.multiply(r.snapHolderMatrix);let M=(HU,WU,ZU)=>HU.elements[(WU-1)*4+ZU-1],E=M(o,1,1)*M(w,1,1)-p.x*M(o,3,4)*M(w,3,1),B=M(o,1,1)*M(w,1,2)-p.x*M(o,3,4)*M(w,3,2),$=M(o,1,1)*M(w,1,3)-p.x*M(o,3,4)*M(w,3,3),D=i.x*E+i.y*B+i.z*$,F=M(o,2,2)*M(w,2,1)-p.y*M(o,3,4)*M(w,3,1),W=M(o,2,2)*M(w,2,2)-p.y*M(o,3,4)*M(w,3,2),G=M(o,2,2)*M(w,2,3)-p.y*M(o,3,4)*M(w,3,3),U=i.x*F+i.y*W+i.z*G,J=M(o,1,1)*M(w,1,1)-u.x*M(o,3,4)*M(w,3,1),X=M(o,1,1)*M(w,1,2)-u.x*M(o,3,4)*M(w,3,2),ie=M(o,1,1)*M(w,1,3)-u.x*M(o,3,4)*M(w,3,3),te=s.x*J+s.y*X+s.z*ie,xe=M(o,2,2)*M(w,2,1)-u.y*M(o,3,4)*M(w,3,1),Pe=M(o,2,2)*M(w,2,2)-u.y*M(o,3,4)*M(w,3,2),he=M(o,2,2)*M(w,2,3)-u.y*M(o,3,4)*M(w,3,3),Re=s.x*xe+s.y*Pe+s.z*he,rt=Math.abs(J-E),it=Math.abs(X-B),We=Math.abs(ie-$),Xe=Math.abs(J-F),ue=Math.abs(X-W),ye=Math.abs(ie-G),fe=Math.abs(xe-E),ne=Math.abs(Pe-B),A=Math.abs(he-$),Y=Math.abs(xe-F),R=Math.abs(Pe-W),ce=Math.abs(he-G),ae=Math.min(rt+it+We,Xe+ue+ye),le=Math.min(fe+ne+A,Y+R+ce);ae<le&&(J=xe,X=Pe,ie=he,te=Re);let Se=F*$-E*G,cr=W*$-B*G,Nn=U*$-D*G,tn=J*G-F*ie,vn=X*G-W*ie,Xc=te*G-U*ie,cI=(Xc*cr-Nn*vn)/(tn*cr-Se*vn),pI=(Xc*Se-Nn*tn)/(vn*Se-cr*tn),k4=W*E-B*F,UU=G*E-$*F,VU=U*E-D*F,A4=X*F-W*J,zU=ie*F-G*J,D4=((te*F-U*J)*k4-VU*A4)/(zU*k4-UU*A4),nb=w.clone();return nb.elements[12]=cI,nb.elements[13]=pI,nb.elements[14]=D4,D4>0?nb:null});f(this,"updateTouchOrigin",()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top});f(this,"touchToScene",r=>{this.touch.touches=[];for(let n=0,o=r.touches.length;n<o;n++){let i=r.touches[n],s=mG(i,this.touch.origin);this.touch.touches.push(new Ae(s.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(s.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});f(this,"canScrollZoom",r=>{let n=Gw(r),o=this.getZoomAltitude();return!(n<0&&o===this.getZoomScaledMax()||n>0&&o===this.getZoomScaledMin())});f(this,"mouseToScene",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});f(this,"getMousePos",r=>({x:r.offsetX,y:r.offsetY}));f(this,"handleMouseDownRotate",r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});f(this,"handleMouseDownPan",()=>{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")});f(this,"handleMouseDownPedestal",r=>{let n=new Ae(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=SI(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});f(this,"handleMouseMovePedestal",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)});f(this,"handleMouseMoveRotate",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")});f(this,"publishUserZoomDebounced",ud(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));f(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});f(this,"setCameraMoving",()=>{this.cameraMoving=!0});f(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});f(this,"setUserInteracting",()=>{this.userInteracting=!0});f(this,"unsetUserInteracting",()=>{this.userInteracting=!1});f(this,"publishPedestalChangeEvent",r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});f(this,"convertAltitudeToZoomLevel",r=>{let[,n]=this.center,i=r*2*Math.tan(Qe.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(Qe.degToRad(n))*2*Math.PI*uI/i;return Qe.clamp(Math.log2(s/512),y2,g2)});f(this,"convertZoomLevelToAltitude",r=>{let[,n]=this.center,o=Qe.clamp(r,y2,g2),i=Math.pow(2,o),s=Qe.clamp(n,Uw,Vw),a=i*512;return Math.cos(Qe.degToRad(s))*Math.PI*2*uI/a*this.options.canvasHeight/2/Math.tan(Qe.degToRad(this.camera.fov)/2)});f(this,"completeTween",r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)});f(this,"debugContainer",new ya);this.camera=r,this.renderer=o,this.rendererState=i,this.scene=n,this.options=s,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,s.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r)}get defaultMinZoomLevel(){return c(this,v2)}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,s,a,l;let r=this.getPosition(),{lat:n,lon:o}=vb((s=(i=this.rendererState.center)==null?void 0:i[1])!=null?s:0,(l=(a=this.rendererState.center)==null?void 0:a[0])!=null?l:0,r.x,r.y);return[o,n]}setCenter(r,n){var s,a,l,p;let{x:o,y:i}=Ib((a=(s=this.rendererState.center)==null?void 0:s[1])!=null?a:0,(p=(l=this.rendererState.center)==null?void 0:l[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,s=this.options.canvasWidth,a=this.options.canvasHeight,l=this.getRotation(),p=this.getTilt(),u=this.getPosition();this.setRotation(n.rotation||l,!0),this.setTilt(n.tilt||p,!0);let m=yG(r,{canvasWidth:s,canvasHeight:a,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:o,maxZoom:i,position:u,camera:this.camera,orbit:this.orbit});return this.setRotation(l,!0),this.setTilt(p,!0),{center:m.position,zoomLevel:this.convertAltitudeToZoomLevel(m.zoom)}}focusOn(r,n){if(Uhe){this.debugContainer&&fr(this.debugContainer);let b=new xi(4,4,4),C=new Br({color:65280,depthTest:!1}),P=new Fl(b,C,r.length),w=new bi;r.forEach((M,E)=>{w.setPosition(M),P.setMatrixAt(E,w)}),P.instanceMatrix.needsUpdate=!0,this.debugContainer.add(P),this.scene.add(this.debugContainer)}let o=n.curve,i=n.callback,s=n.cancelledCallback,a=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,l=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,u=this.options.canvasHeight,m;n.duration!==void 0?m=n.duration:x.env.TESTING==="true"?m=0:m=Ww;let h=n.padding,g=this.getRotation(),v=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let I=yG(r,{canvasHeight:u,paddingOption:h,canvasWidth:p,minZoom:a,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(g),this.setTilt(v),this.animateCamera({position:I.position,tilt:n.tilt,rotation:n.rotation,zoom:I.zoom},m,o,i,s,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};v2=new WeakMap,f(Lu,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function yG(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:o=0,canvasHeight:i,minZoom:s,maxZoom:a,camera:l,position:p}){let u={zoom:s,position:p};if(e.length===0)return u;for(let Se of Lu.CAMERA_FRAME_PADDING_SIDES)typeof n[Se]!="number"&&(n[Se]=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 u;r.updateMatrixWorld();let h=l.matrixWorldInverse,g=l.fov*(Math.PI/180)/2,v=g,b=Math.atan(Math.tan(g)*(t/i)),C=new we(1/0,1/0,1/0),P=new we(-1/0,-1/0,-1/0),w=new Xr,M=new we;for(let Se=0,cr=e.length;Se<cr;Se++)M.copy(e[Se]),w.expandByPoint(M),M.applyMatrix4(h),C.min(M),P.max(M),M.copy(e[Se]),M.z-=o,M.applyMatrix4(h),C.min(M),P.max(M),M.copy(e[Se]),M.z+=o,M.applyMatrix4(h),C.min(M),P.max(M);let E=P.x-C.x,B=P.y-C.y,$=t-m.left-m.right,D=i-m.top-m.bottom,F=(P.x+C.x)/2,W=(P.y+C.y)/2,G=E/$,U=B/D,J=s,X=a,ie=J*Math.tan(b)*2,te=X*Math.tan(b)*2,xe=ie/t,Pe=te/t,he=Math.max(G,U);he=Qe.clamp(he,xe,Pe);let Re=$*he,rt=D*he,it={min:{x:F-Re/2-m.left*he,y:W-rt/2-m.bottom*he},max:{x:F+Re/2+m.right*he,y:W+rt/2+m.top*he}},We=(it.min.x+it.max.x)/2,Xe=(it.min.y+it.max.y)/2,ue=w.getCenter(new we),ye=Math.abs(We-it.min.x),fe=Math.abs(Xe-it.min.y),ne=ye/Math.tan(b),A=fe/Math.tan(v),Y=new we;Y.set(We,Xe,P.z+Math.max(ne,A)),Y.applyMatrix4(l.matrixWorld);let R=new we;R.set(We,Xe,P.z),R.applyMatrix4(l.matrixWorld);let ce=new we().subVectors(R,Y),ae=(ue.z-Y.z)/ce.z,le=new we().copy(Y).add(ce.clone().multiplyScalar(ae));return R.set(le.x,le.y,le.z),Y.sub(R),{position:le,zoom:Y.length()}}d();var Vhe=300,Ng,Bg,I2=class{constructor(t){f(this,"state");O(this,Ng,new we);O(this,Bg,new we);this.state=t}update(t){var o;let r,n;this.state.cameraObject.getWorldPosition(c(this,Bg));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(c(this,Ng));let s=c(this,Bg).distanceTo(c(this,Ng));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-s,"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:Vhe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Ng=new WeakMap,Bg=new WeakMap;d();var S2=class{constructor(){f(this,"percentExpanded",0);f(this,"activeId","");f(this,"gap",20);f(this,"dirty",!0)}};d();var C2=class extends Ne{constructor(r,n){super();f(this,"state");f(this,"dirty",!0);f(this,"domTree");f(this,"observers",new Map);f(this,"updateDimensions",r=>{r.forEach(n=>{var s;let i=(s=n.target.parentElement)==null?void 0:s.getAttribute("data-marker-id");if(i){let a=this.state.geometry2DMap.get(i),l=a==null?void 0:a.components[0];a&&l instanceof Js&&(l.updateDimensions(n.contentRect.width,n.contentRect.height),l.collisionDirty=!0)}}),this.publish("dimensions-update")});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 s=i.getAttribute("data-marker-id");if(s!=null&&(r=this.state.geometry2DMap.get(s),n=r.components[0],(o=n.options)!=null&&o.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(n.containerEl),this.observers.set(i.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};d();var zhe=0,Hhe=90,Whe=(x.env.NODE_ENV==="test",!1),dl={linear:kr.Linear.None,"ease-in":kr.Quadratic.In,"ease-out":kr.Quadratic.Out,"ease-in-out":kr.Quadratic.InOut},Zhe=-50,Oe,Ge,Ec,$g,jg,Xw,T2=class{constructor(t,r,n){O(this,jg);O(this,Oe);O(this,Ge);O(this,Ec);O(this,$g);k(this,Oe,t),k(this,Ge,r),k(this,Ec,n),c(this,Ge).cameraSystem.on("pedestal-change",({pedestal:o})=>{c(this,Oe).map&&(c(this,Oe).map.transform.elevation=o,c(this,Oe).map.transform.minElevationForCurrentTile=Zhe,c(this,Oe).map.triggerRepaint()),c(this,Ge).cameraSystem.setCameraPlaneElevation(o)})}get center(){return c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?c(this,Oe).map.getCenter().toArray():c(this,Ge).cameraSystem.center}setCenter(t){var r;if(c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map){(r=c(this,Oe).map)==null||r.setCenter(t),c(this,Ge).interactionSystem.handleHover();return}c(this,Ge).cameraSystem.setCenter(t[0],t[1]),c(this,Ge).interactionSystem.handleHover()}get zoomLevel(){var t;return c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?(t=c(this,Oe).map)==null?void 0:t.getZoom():c(this,Ge).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map&&((r=c(this,Oe).map)==null||r.setZoom(t)),c(this,Ge).cameraSystem.setZoomLevel(us(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 c(this,Ge).cameraSystem.isAnimating}cancelAnimation(){c(this,Ge).cameraSystem.cancelAnimation()}get maxZoomLevel(){return c(this,Ge).cameraSystem.maxZoomLevel}get minZoomLevel(){return c(this,Ge).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){c(this,Ge).panBoundsSystem.autoMinZoomLevel=t,t&&(c(this,Ge).panBoundsSystem.dirty=!0,c(this,Ge).panBoundsSystem.update())}get autoMinZoomLevel(){return c(this,Ge).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var o;r&&this.setAutoMinZoomLevel(!1);let n=us(t,yi.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(yi.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));c(this,Ge).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(o=c(this,Oe).map)==null||o.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=us(t,this.minZoomLevel,yi.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(yi.MAX_MERCATOR_ZOOM_LEVEL,"."));c(this,Ge).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=c(this,Oe).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?(t=c(this,Oe).map)==null?void 0:t.getMaxPitch():Qe.radToDeg(c(this,Ge).cameraSystem.maxTilt)}get minPitch(){var t;return c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?(t=c(this,Oe).map)==null?void 0:t.getMinPitch():Qe.radToDeg(c(this,Ge).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(zhe,t);(n=c(this,Oe).map)==null||n.setMinPitch(r),c(this,Ge).cameraSystem.minTilt=Qe.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(Hhe,t);(n=c(this,Oe).map)==null||n.setMaxPitch(r),c(this,Ge).cameraSystem.maxTilt=Qe.degToRad(r)}get bearing(){var t;return c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?(t=c(this,Oe).map)==null?void 0:t.getBearing():Qe.radToDeg(c(this,Ge).cameraSystem.getRotation())}setBearing(t){var r;if(c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map){(r=c(this,Oe).map)==null||r.setBearing(t);return}c(this,Ge).cameraSystem.setRotation(Qe.degToRad(t))}get pitch(){var t;return c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?(t=c(this,Oe).map)==null?void 0:t.getPitch():Qe.radToDeg(c(this,Ge).cameraSystem.getTilt())}setPitch(t){var r;if(c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map){(r=c(this,Oe).map)==null||r.setPitch(t);return}c(this,Ge).cameraSystem.setTilt(Qe.degToRad(us(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 c(this,Ge).cameraSystem.getPedestal()}setElevation(t){c(this,Ge).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return c(this,$g)&&c(this,$g).stop(),new Promise(n=>{var i;let o=c(this,Ge).cameraSystem.getPosition();o.z=t,c(this,Ge).cameraSystem.animateCamera({position:o},(r==null?void 0:r.duration)||300,dl[(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 c(this,Ec).insetsPadding}get panMode(){return c(this,Ge).cameraSystem.enablePan===!1&&c(this,Ge).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(c(this,Ge).cameraSystem.enablePan=!0,c(this,Ge).cameraSystem.enablePedestal=!1):(c(this,Ge).cameraSystem.enablePan=!1,c(this,Ge).cameraSystem.enablePedestal=!0))}setInsetPadding(t){c(this,Ec).insetsPadding=Object.assign({},qm,t)}animateTo(t){var s,a,l,p,u,m;if(c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map)return(m=c(this,Oe).map)==null||m.flyTo({center:(s=t.center)!=null?s:this.center,zoom:(a=t.zoomLevel)!=null?a:this.zoomLevel,bearing:(l=t.bearing)!=null?l:this.bearing,pitch:(p=t.pitch)!=null?p:this.pitch,duration:(u=t.duration)!=null?u:600}),Promise.resolve();let r=t.center?c(this,Oe).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?c(this,Ge).cameraSystem.convertZoomLevelToAltitude(us(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?Qe.degToRad(t.bearing):void 0,i=t.pitch!==void 0?Qe.degToRad(us(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(h=>{var g;c(this,Ge).cameraSystem.animateCamera({position:r,zoom:n,rotation:o,tilt:i},t.duration||0,dl[t.easing||"ease-in-out"],()=>{c(this,Ge).interactionSystem.handleHover(),h()},h,{interruptible:(g=t==null?void 0:t.interruptible)!=null?g:!0})})}getCameraFrameForCoordinates(t,r){let n=ee(this,jg,Xw).call(this,r||{},()=>Promise.resolve()),{pointCloud:o}=gG(t,c(this,Oe),c(this,Ec).geometry3DMap);if(o.length===0)return V.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:s}=c(this,Ge).cameraSystem.getCameraFrameForCoordinates(o,n);return{center:c(this,Oe).convert3DMapPositionToCoordinate(i),zoomLevel:s}}focusOn(t,r){var s,a,l,p;let{pointCloud:n,geoBounds:o,firstPosition:i}=gG(t,c(this,Oe),c(this,Ec).geometry3DMap);return n.length===0?(V.error("No valid coordinates found in targets:",t),Promise.resolve()):c(this,Oe).mode==="outdoors-overlay"&&c(this,Oe).map?(n.length===1&&i?(s=c(this,Oe).map)==null||s.flyTo({center:[i[0],i[1]],duration:(r==null?void 0:r.duration)||c(this,Oe).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?c(this,Oe).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?c(this,Oe).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||c(this,Oe).map.getMaxZoom()}):(Whe&&qhe(c(this,Oe),o),(p=c(this,Oe).map)==null||p.fitBounds(o,{duration:(a=r==null?void 0:r.duration)!=null?a:yi.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?c(this,Oe).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?c(this,Oe).map.getPitch():r==null?void 0:r.pitch,maxZoom:(l=r==null?void 0:r.maxZoomLevel)!=null?l:c(this,Oe).map.getMaxZoom()})),c(this,Ge).interactionSystem.handleHover(),Promise.resolve()):new Promise(u=>{c(this,Ge).cameraSystem.focusOn(n,ee(this,jg,Xw).call(this,r||{},u))})}};Oe=new WeakMap,Ge=new WeakMap,Ec=new WeakMap,$g=new WeakMap,jg=new WeakSet,Xw=function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:c(this,Ge).cameraSystem.convertZoomLevelToAltitude(us(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:c(this,Ge).cameraSystem.convertZoomLevelToAltitude(us(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({},qm,t==null?void 0:t.padding):this.insetsPadding,curve:dl[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Qe.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Qe.degToRad(us(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:()=>{c(this,Ge).interactionSystem.handleHover(),r()},cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}};function qw(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])}function gG(e,t,r){var a;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 s=t.getSystems().renderSystem;(s.threeDdirty||s.twoDdirty)&&t.renderSync();for(let l of e)if(typeof l=="string"){let p=r.get(l);if(!p){V.error("Entity not found with id:",l);continue}let u=new Xr;SM(t,"userData"in p&&(a=p.userData.entityId)!=null?a:p.id,n,u,p instanceof st?p.position.z:void 0);let m=t.convert3DMapPositionToCoordinate(u.min),h=t.convert3DMapPositionToCoordinate(u.max);qw(o,m),qw(o,h),i||(i=t.convert3DMapPositionToCoordinate(u.getCenter(new we)))}else n.push(t.convertTo3DMapPosition(l[1],l[0],l[2]||0)),qw(o,l),i||(i=l);return{pointCloud:n,geoBounds:o,firstPosition:i}}function qhe(e,t){var n,o,i,s;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}}}),(s=e.map)==null||s.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}d();d();var bG="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}";d();var xG="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 vG=4.291666666666667,IG=15,SG=25,CG=43/60;d();var TG=["horizontal","icon"],Xhe=new Map([[TG[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>'],[TG[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>']]),Yhe=/<svg([^>]*)>/g;function PG(e,t,r,n){let o=Xhe.get(e);return o?o.replace(Yhe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var wG=!1,zt,fl,xm,Zr,Qn,Ru,Xi,na,P2=class extends Ne{constructor(r,n,o){super();O(this,zt,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},interactive:!0,visible:!0});O(this,fl);O(this,xm);O(this,Zr);O(this,Qn);O(this,Ru);O(this,Xi,0);O(this,na,0);f(this,"dirty",!0);f(this,"getPositionAlignedCanvasCoordinates",(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}})[c(this,zt).position]);f(this,"getPositionAlignedPadding",()=>{var o,i,s,a;let r=c(this,zt).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}}[c(this,zt).position];let n={top:(o=r.top)!=null?o:0,right:(i=r.right)!=null?i:0,bottom:(s=r.bottom)!=null?s:0,left:(a=r.left)!=null?a:0};return{x:n.left-n.right,y:n.top-n.bottom}});o&&Object.entries(o).forEach(([i,s])=>{s!==void 0&&(c(this,zt)[i]=s)}),k(this,xm,r),k(this,fl,n)}get color(){return c(this,zt).color==="light"?"white":"#293136"}get iconName(){return c(this,zt).iconOnly?"icon":"horizontal"}get minWidth(){return c(this,zt).iconOnly?IG:75}get defaultWidth(){return c(this,zt).iconOnly?SG:150}get aspectRatio(){return c(this,zt).iconOnly?CG:vG}get options(){return T({},c(this,zt))}set options(r){var n,o;k(this,zt,{padding:r.padding||c(this,zt).padding,position:r.position||c(this,zt).position,iconOnly:r.iconOnly||c(this,zt).iconOnly,color:r.color||c(this,zt).color,scale:r.scale||c(this,zt).scale,onClick:c(this,zt).onClick,interactive:(n=r.interactive)!=null?n:c(this,zt).interactive,visible:(o=r.visible)!=null?o:c(this,zt).visible})}get icon(){return PG(this.iconName,this.color,c(this,Xi)*c(this,fl).pixelRatio,c(this,na)*c(this,fl).pixelRatio)}setSize(r,n){c(this,Qn)&&(c(this,Qn).uniforms.uSize.value.x=r,c(this,Qn).uniforms.uSize.value.y=n)}setXY(r,n){c(this,Qn)&&(c(this,Qn).uniforms.uSize.value.w=r,c(this,Qn).uniforms.uSize.value.z=n)}get width(){return c(this,Xi)}get height(){return c(this,na)}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)}}[c(this,zt).position]}insertIntoQuadTree(r){c(this,Ru)!=null&&typeof c(this,zt).onClick=="function"&&c(this,zt).interactive&&r.insert(c(this,Ru))}resize(r,n){if(c(this,zt).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(r,n),i=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(c(this,Xi),c(this,na)),a=Math.min(r-c(this,Xi),Math.max(0,o.x+i.x+s.x)),l=Math.min(n-c(this,na),Math.max(0,o.y+i.y+s.y));this.setSize(c(this,Xi)/r,c(this,na)/n),this.setXY(a/r,l/n),k(this,Ru,new zr(a,l,c(this,Xi),c(this,na),{entityId:"watermark"}))}update(){this.dirty&&(c(this,zt).visible===!0?(k(this,Xi,Math.min(c(this,fl).canvasWidth,Math.max(this.minWidth,this.defaultWidth*c(this,zt).scale))),k(this,na,c(this,Xi)/this.aspectRatio),Mc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(k(this,Qn,new Al({uniforms:{uTexture:{value:r},uSize:{value:new H4(0,0,0,0)},uOpacity:{value:.7}},vertexShader:bG,fragmentShader:xG,depthWrite:!1,depthTest:!1,defines:{debug:wG},wireframe:wG,transparent:!0,visible:!0})),c(this,Zr))c(this,Zr).visible=!0,c(this,Zr).material=c(this,Qn),c(this,Zr).material.needsUpdate=!0;else{let n=new vi(2,2,1,1);k(this,Zr,new He(n,c(this,Qn))),c(this,Zr).position.set(0,0,-1),c(this,Zr).frustumCulled=!1,c(this,Zr).renderOrder=999;let o=new xi(1,1,1),i=new He(o,new Br({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),c(this,Zr).add(i),c(this,xm).add(c(this,Zr))}this.resize(c(this,fl).canvasWidth,c(this,fl).canvasHeight),this.publish("texture-loaded")})):c(this,Zr)&&(c(this,Zr).visible=!1),this.dirty=!1)}destroy(){c(this,Zr)&&(c(this,xm).remove(c(this,Zr)),fr(c(this,Zr))),k(this,Zr,void 0),c(this,Qn)&&c(this,Qn).dispose(),k(this,Qn,void 0),k(this,Ru,void 0)}};zt=new WeakMap,fl=new WeakMap,xm=new WeakMap,Zr=new WeakMap,Qn=new WeakMap,Ru=new WeakMap,Xi=new WeakMap,na=new WeakMap;d();var w2=100,Qhe=!1,O2=class extends Ne{constructor(r,n){super();f(this,"currentTotalBoundingBox");f(this,"state");f(this,"cameraSystem");f(this,"debugMesh",null);f(this,"dirty",!0);f(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Xr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new we(0,0,0),new we(w2*2,w2*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(w2)));let r=new Xr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new we),o=Math.max(n.x,n.y,n.z);for(let s of this.state.geometry2DMap.values())s.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(s.position),s.positionDirty=!1);let i=M2.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,w2)).getBoundingSphere(eye).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new we),min:M2.min,max:M2.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,Qhe&&this.state.entityScene.parent instanceof Dl){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new ya,this.debugMesh.add(new He(new db(this.cameraSystem.panBounds.radius),new Br({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let s=new we;M2.getSize(s);let a=new xi(s.x,s.y,s.z),l=new Br({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new He(a,l);p.position.copy(this.currentTotalBoundingBox.getCenter(new we)),this.debugMesh.add(p)}}}},M2=new Xr,eye=new Z4;d();var MG="\xA9 Mappedin",tye="https://info.mappedin.com/feedback",Kw=["top-left","top-right","bottom-left","bottom-right"],rye=640,nye=()=>"<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>",Yw={custom:[],position:"bottom-right",feedback:!0},E2=class{constructor(t){f(this,"controlContainerEl");f(this,"controlPositions");f(this,"compact");f(this,"attribContainerEl");f(this,"attribInnerEl");f(this,"attribButtonEl");f(this,"feedbackLinkEl");f(this,"attribHTML",MG);f(this,"customAttributions",[]);f(this,"toggleAttribution",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",""))))});this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Kw.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=Yw){var o;let r=t.position&&Kw.includes(t.position)?t.position:Yw.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=nye(),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:Yw.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=tye,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=[MG],n=t.style.sourceCaches;for(let o in n){let i=n[o];if(i.used||i.usedForTerrain){let s=i.getSource();s.attribution&&r.indexOf(s.attribution)<0&&r.push(s.attribution)}}r=r.filter(o=>String(o).trim()),r=r.filter((o,i)=>{for(let s=i+1;s<r.length;s++)if(r[s].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<=rye||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}};d();var Gg,Ug,vm=class{constructor(t,r){f(this,"mesh");f(this,"type","custom-geometry");f(this,"dirty",!0);f(this,"feature");f(this,"builder");f(this,"outline");O(this,Gg,1);f(this,"color",new Lt);O(this,Ug,0);this.mesh=new Si,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){k(this,Gg,t)}get opacity(){return c(this,Gg)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return c(this,Ug)}set altitude(t){this.mesh&&(this.mesh.position.z=t,k(this,Ug,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};Gg=new WeakMap,Ug=new WeakMap;d();var _2=class{constructor(t,r){f(this,"state");f(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))}}};d();d();function OG(e){return e.children.some(t=>t.userData.isOutline)}var sye=80,Nu,Im,A2,D2,k2=class{constructor(t){f(this,"rendererState");f(this,"outlineOpacitiesDirty",!0);O(this,Nu,!0);O(this,Im,-1/0);O(this,A2,new Map);O(this,D2,new fI({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:sb}));this.rendererState=t}get geometries3DDirty(){return c(this,Nu)}set geometries3DDirty(t){k(this,Nu,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DMap.values())if(i instanceof st&&(i.visible||i.userData.preloadGeometry)){for(let s of i.children)if(s instanceof In&&s.components[0].outline&&(s.visible||i.userData.preloadGeometry)&&!OG(s)&&s.userData.entities3D.size>0)for(let a of s.userData.entities3D.values()){let l=this.rendererState.geometry3DMap.get(a),p=[];if(l instanceof Mt&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].geometry!=null&&l.components[0].material!=null){let b=l.components[0].geometry;if(!b)continue;p.push([l.components[3],new mI(b,sye)])}if(p.length===0)continue;let u=$o(p.map(b=>b[1]),!1);if(u==null)continue;let m=u.getAttribute("position"),h=new Float32Array(m.count*4),g=new ga(h,4);u.setAttribute("color",g);let v=0;for(let b=0;b<p.length;b++){let[C,P]=p[b],w=P.getAttribute("position").count;C.edgeColors=g,C.geometry=u,C.ranges={count:w,start:v},v+=w,P.dispose()}let I=new sd(u,c(this,D2));I.userData.isOutline=!0,s.add(I)}}k(this,Nu,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let s=this.rendererState.geometry3DMap.get(i);if(s instanceof Mt&&s.type==="geometry"&&s.components[3]&&s.components[3].dirty===!0&&s.components[0].geometry!=null&&s.components[0].material!=null&&s.parentObject3D instanceof In){let a=s.components[3].geometry;if(!a)continue;let l=s.components[3];if(!l)continue;let p=l.edgeColors;if(!p)continue;let u=new Lt(l.color);for(let I=0;I<l.ranges.count;I++){let b=l.ranges.start+I;p.setXYZ(b,u.r,u.g,u.b)}let m=s.components[1].height,g=a.getAttribute("position").array,v=-1/0;for(let I=0;I<l.ranges.count;I++){let C=(l.ranges.start+I)*3,P=g[C+2];v=Math.max(v,P)}for(let I=0;I<l.ranges.count;I++){let C=(l.ranges.start+I)*3,P=g[C+2];Math.abs(P-v)<1e-4&&(g[C+2]=Math.max(m,2e-4))}a.attributes.color.needsUpdate=!0,a.attributes.position.needsUpdate=!0,l.dirty=!1}}let o=r?Bo(t,16,19,0,1):c(this,Im);if((o!==c(this,Im)||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 hr){let s=n.components[3];if(s&&s.edgeColors&&s.geometry){let a=s.visible,l=Math.min(o,a?n.components[1].opacity*ep(n):0);if(s.currentOpacity!==l){for(let p=0;p<s.ranges.count;p++){let u=s.ranges.start+p;s.edgeColors.setW(u,l)}s.geometry.attributes.color.needsUpdate=!0}}}}k(this,Im,o),k(this,Nu,!1),this.outlineOpacitiesDirty=!1}destroy(){c(this,A2).clear()}};Nu=new WeakMap,Im=new WeakMap,A2=new WeakMap,D2=new WeakMap;d();d();var F2=class extends He{constructor(){super(...arguments);f(this,"userData",{entityId:""})}},aye=j.object({flipImageToFaceCamera:j.boolean().optional(),url:j.string()}),lye=j.object({type:j.enum(["Feature"]),properties:j.object({width:j.number(),height:j.number(),rotation:j.number().min(0).max(360).optional(),verticalOffset:j.number().optional()}),geometry:ym});function EG(e,t,r){j.union([j.number(),j.string()]).parse(e),lye.parse(t),aye.parse(r)}var L2=class{constructor(t){f(this,"mesh",new Si);f(this,"imageMesh");f(this,"outline");f(this,"type","image");f(this,"instanceIndex",-1);f(this,"geometry");f(this,"material");f(this,"feature");f(this,"position",new we);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)}};d();function Jw(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)}}function cye(e,t){return e.map(r=>Jw(r,t))}function pye(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}}function uye(e,t){let r=!1;for(let n=0,o=t.length-1;n<t.length;o=n++){let i=t[n].x,s=t[n].y,a=t[o].x,l=t[o].y;s>e.y!=l>e.y&&e.x<(a-i)*(e.y-s)/(l-s)+i&&(r=!r)}return r}function _G(e,t,r,n,o){for(let i=0;i<o;i++)for(let s=0;s<n;s++)if(e[r+i][t+s]!==1)return!1;return!0}function dye(e,t,r){let n=e.maxX-e.minX,o=e.maxY-e.minY,i,s,a=T({},e);return n/o>t?(s=o/r,i=s*t,a.minX+=(n-i*r)/2):(i=n/r,s=i/t,a.minY+=(o-s*r)/2),{dx:i,dy:s,gridBounds:a}}function fye(e,t,r,n,o){let i=Array(r).fill(0).map(()=>Array(r).fill(0));for(let s=0;s<r;s++)for(let a=0;a<r;a++){let l={x:t.minX+a*n,y:t.minY+s*o};uye(l,e)&&(i[s][a]=1)}return i}function mye(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 s=1;s<=Math.min(t-o,t-n)&&_G(e,o,n,s,s);s++)i=s;r[n][o]=i}return r}function hye(e,t,r,n,o,i){let s=0,a=0,l=0;for(let p=0;p<n;p++)for(let u=0;u<n;u++)if(e[p][u]===1){let m=Math.pow(t[p][u],2),h=r.minX+u*o,g=r.minY+p*i;s+=m,a+=h*m,l+=g*m}return{x:a/s,y:l/s}}function yye(e,t,r,n,o,i,s){let a=-1/0,l=null,p=e.length,u=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 h=0;h<p;h++)if(e[m][h]===1)for(let g=1;g<=p-h;g++){let v=g;if(!(v>p-m)&&_G(e,h,m,g,v)){let I=g*v,b=t.minX+(h+g/2)*r,C=t.minY+(m+v/2)*n,P={x:b,y:C},M=Math.sqrt(Math.pow(P.x-o.x,2)+Math.pow(P.y-o.y,2))/u,E=I*(1-i)-M*i*I;E>a&&(a=E,l={center:P,width:g*r*s,height:g*n*s})}}return l}function Qw(e,t,r,n={}){let{scaleFactor:o=.9,centerPriority:i=.5,resolution:s=100,minimumSizeRatio:a=.5}=n,l=sM(r),p=e.width/e.height,u=cye(t,l),m=pye(u),{dx:h,dy:g,gridBounds:v}=dye(m,p,s),I=fye(u,v,s,h,g),b=mye(I,s),C=hye(I,b,v,s,h,g),P=yye(I,v,h,g,C,i,o);return!P||P.width<e.width*a||P.height<e.height*a?e:L(T({},P),{center:Jw(P.center,-l),rotation:r,polygonCenter:Jw(C,-l)})}var Vg=Math.PI*2,gye=Math.PI/2,bye=Math.PI*1.5,xye=ld(gye,2),vye=ld(bye,2),Iye=.01,kG=!1,R2=class extends Ne{constructor(r,n,o=0,i=0,s={}){super();f(this,"rendererState");f(this,"convertTo3DMapPosition");f(this,"initialBearing",0);f(this,"naturalBearing",0);f(this,"imagePlacementOptions");f(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=o,this.naturalBearing=i,this.imagePlacementOptions=s}createImageMesh(r,n,o,i=0,s,a){var v,I,b;let l={width:o.width,height:o.height,center:this.convertTo3DMapPosition(s),rotation:(v=o.rotation)!=null?v:0},p=(I=this.imagePlacementOptions.mode)!=null?I:"default",u=(()=>{switch(p){case"fit-nearest-90":let C=(this.initialBearing-this.naturalBearing+360)%180;return C>=45&&C<=135?Qw(l,a,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return Qw(l,a,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if(kG&&u.polygonCenter){let C=new He(new db(1),new Ii({color:65280}));C.position.set(u.polygonCenter.x,u.polygonCenter.y,i),this.rendererState.entityScene.add(C)}let m=new Ii({transparent:!0,depthWrite:!1,side:fa}),h=new vi(u.width,u.height),g=new F2(h);if(g.visible=!1,(b=this.getOrDownloadImage(n))==null||b.then(C=>{m.map=C,m.needsUpdate=!0,m.map.colorSpace=ma,g.visible=!0,this.publish("image-loaded")}),g.userData.entityId=r,g.material=m,kG){let C=new He(new vi(o.width,o.height),new Ii({color:"gray"}));g.add(C);let P=new oM;g.add(P),P.scale.set(10,10,10)}return g.position.set(u.center.x,u.center.y,i+Iye),g.rotation.z=(-Qe.degToRad(u.rotation)+Vg)%Vg,g}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=>{Mc.getLoader().load(r,s=>{let a=this.imageLoadingCache.get(r);a&&!a.loaded&&(a.loaded=!0),i(s)})});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,s=ld((i-o+Vg)%Vg,2);s>xye&&s<vye&&(r.imageMesh.rotation.z=(i+Math.PI)%Vg)}update(r){var s,a,l,p,u;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 h=this.convertTo3DMapPosition(o.feature.geometry.coordinates),g={x:h.x,y:h.y};o.imageMesh=this.createImageMesh(n.id,i.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates,[g]),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&&((s=o.feature.properties)!=null&&s.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((a=o.feature.properties)==null?void 0:a.image.position)!=null&&o.feature.geometry.coordinates!=null&&o.feature.geometry.coordinates.length>0){let h=o.feature.geometry.coordinates[0].map(v=>{let I=this.convertTo3DMapPosition(v);return{x:I.x,y:I.y}}),g=this.createImageMesh(m,(l=o.feature.properties)==null?void 0:l.image.path,(p=o.feature.properties)==null?void 0:p.image,i.height,(u=o.feature.properties)==null?void 0:u.image.position,h);o.mesh.parent.add(g),o.imageMesh=g}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(i.showImage&&!o.imageMesh.visible)if(i.url){let h=this.imageLoadingCache.get(i.url);h&&h.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)}}}};d();var Sye=250,_c,N2=class extends Ne{constructor(r,n){super();f(this,"cameraDirty",!0);f(this,"focusablesDirty",!0);f(this,"state");f(this,"camera");f(this,"debugEl",null);f(this,"raycasters",[]);f(this,"collisions",new Map);f(this,"focusableEntities",new Set);f(this,"debugRaycasters",!1);O(this,_c);f(this,"update",(r=!1,n=Date.now())=>{r||Date.now()-n>Sye||(c(this,_c)&&cancelAnimationFrame(c(this,_c)),k(this,_c,requestAnimationFrame(()=>{this.updateRaf()})))});this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new Ae(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new Ae(r.x/1.2,r.y/1.2),o=new Ae(r.x+(r.x-n.x),n.y),i=new Ae(n.x,r.y+(r.y-n.y)),s=new Ae(o.x,i.y),a=new Ae(r.x,r.y/1.5),l=new Ae(r.x,r.y+(r.y-a.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,a,l,n,o,i,s].map((p,u)=>{if(this.debugRaycasters){let I=document.createElement("div");I.style.position="absolute",I.style.top=p.y+"px",I.style.left=p.x+"px",I.style.width="10px",I.style.height="10px",I.style.backgroundColor="red",this.debugEl.append(I)}let m=p.x/this.state.canvasWidth*2-1,h=-(p.y/this.state.canvasHeight)*2+1,g=new Ae(m,h),v=new ps;return v.setFromCamera(g,this.camera),[v,g,u===0?10:u<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 fm){let i=n.components[2];if(i.dirty===!0||i.focusMesh==null){i.focusMesh&&fr(i.focusMesh);let s=new Xr;s.setFromObject(n);let a=new xi(s.max.x-s.min.x,s.max.y-s.min.y,s.max.z-s.min.z),l=new Br({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),p=new He(a,l);p.position.set((s.min.x+s.max.x)/2,(s.min.y+s.max.y)/2,(s.min.z+s.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 hr&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof hr&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let i=new He(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(a=>{var l;if((a==null?void 0:a.object)!=null&&"isMesh"in a.object&&(a!=null&&a.object.isMesh)){let p=a.object.userData.entityId,u=(l=this.collisions.get(p))!=null?l:0;this.collisions.set(p,u+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(){c(this,_c)&&cancelAnimationFrame(c(this,_c)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};_c=new WeakMap;d();d();d();d();function B2(e,t){t===void 0&&(t={});var r=Tf(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return Cye(r,t);case"MultiPolygon":return Tye(r,t);default:throw new Error("invalid poly")}}function Cye(e,t){t===void 0&&(t={});var r=Tf(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{};return AG(n,o)}function Tye(e,t){t===void 0&&(t={});var r=Tf(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{},i=[];return n.forEach(function(s){i.push(AG(s,o))}),Jc(i)}function AG(e,t){return e.length>1?pM(e,t):ba(e[0],t)}function Pye(e,t){var r=!0;return fs(e,function(n){fs(t,function(o){if(r===!1)return!1;r=wye(n.geometry,o.geometry)})}),r}function wye(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!_ye(e.coordinates,t.coordinates);case"LineString":return!DG(t,e);case"Polygon":return!Ja(e,t)}break;case"LineString":switch(t.type){case"Point":return!DG(e,t);case"LineString":return!Mye(e,t);case"Polygon":return!FG(t,e)}break;case"Polygon":switch(t.type){case"Point":return!Ja(t,e);case"LineString":return!FG(e,t);case"Polygon":return!Oye(t,e)}}return!1}function DG(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(Eye(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function Mye(e,t){var r=wf(e,t);return r.features.length>0}function FG(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var o=n[r];if(Ja(o,e))return!0}var i=wf(t,B2(e));return i.features.length>0}function Oye(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var o=n[r];if(Ja(o,t))return!0}for(var i=0,s=t.coordinates[0];i<s.length;i++){var a=s[i];if(Ja(a,e))return!0}var l=wf(B2(e),B2(t));return l.features.length>0}function Eye(e,t,r){var n=r[0]-e[0],o=r[1]-e[1],i=t[0]-e[0],s=t[1]-e[1],a=n*s-o*i;return a!==0?!1:Math.abs(i)>=Math.abs(s)?i>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:s>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}function _ye(e,t){return e[0]===t[0]&&e[1]===t[1]}var LG=Pye;function e4(e,t){var r=!1;return fs(e,function(n){fs(t,function(o){if(r===!0)return!0;r=!LG(n.geometry,o.geometry)})}),r}var RG=20,kc,Bu,$u,j2,zg,$2=class{constructor(t){f(this,"dirty",!0);f(this,"map");f(this,"stylesheetId","");f(this,"userHiddenLayers",new Set);f(this,"hiddenLayersInStyle",new Set);f(this,"centerPoint");f(this,"bbox");f(this,"polygons");f(this,"handleRender",async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(c(this,kc)&&(c(this,j2).call(this),k(this,kc,!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=[],k(this,kc,!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){k(this,kc,!0);for(let r=0;r<t.length;r+=RG){let n=t.slice(r,r+RG);c(this,Bu).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=gb(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(i=uM(o.geometry.coordinates)),!i)continue;for(let s of this.polygons)if(e4(s,i)){this.expr.push(["!=",["id"],o.id]);continue}}})}c(this,zg).call(this)}}}});f(this,"expr",[]);O(this,kc,!1);O(this,Bu,[]);O(this,$u,null);O(this,j2,()=>{c(this,$u)&&(globalThis.cancelAnimationFrame(c(this,$u)),k(this,$u,null)),k(this,Bu,[])});O(this,zg,()=>{let t=c(this,Bu).pop();typeof t=="function"&&(t(),c(this,Bu).length>0&&k(this,$u,globalThis.requestAnimationFrame(c(this,zg)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],k(this,kc,!1)});f(this,"handleStyleChange",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)}});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 s=gb(i.geometry.coordinates);o.push(s)}else i.geometry.type==="MultiPolygon"&&o.push(...i.geometry.coordinates.map(s=>gb(s)));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))}};kc=new WeakMap,Bu=new WeakMap,$u=new WeakMap,j2=new WeakMap,zg=new WeakMap;d();d();d();d();var G2="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";d();var t4="#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform bool dashed;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of pathRadius. Since we've\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered \"long\", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered \"short\", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path's length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping 'y = mx + b' where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the 'complete' value as it varies from 0.0 to 1.0.\n // Fragments that are at the 'complete' value or past it will be fully\n // transparent, while fragments that are at 'complete - completeLength'\n // or before it will be fully opaque. However, we adjust the 'complete'\n // value here so that it overshoots by one full 'completeLength', so that\n // the entire path will be opaque when the 'complete' value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at 'arrowMargin' instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // \"zooming off\" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as 'arrowAnimationTimer' goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a \"looping sawtooth\" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the \"looping\" design is preferred is because\n // it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (dashed) {\n float dashLength = 0.1; // Adjust this value to change the dash length\n float gapLength = 0.1; // Adjust this value to change the gap length\n float totalLength = dashLength + gapLength;\n float numSegments = ceil(1.0 / totalLength);\n float adjustedTotalLength = 1.0 / numSegments;\n float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));\n float pattern = mod(fragPathDistance, adjustedTotalLength);\n opacity = pattern < adjustedDashLength ? 1.0 : 0.0;\n }\n\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from 'pulse'\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the 'pulse' value and whether it's covered by an arrow -- but if it's\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like \"holes\" when they're overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}\n";d();var NG="void main(void) {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n}";var BG="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 Aye=new ad;function $G(e,t,r){let{nearRadius:n,farRadius:o,accentColor:i,completeFraction:s,isVertical:a,visibleThroughGeometry:l,dashed:p}=t,{color:u}=r,m=!0,h=0,g=1/0,v=t.displayArrowsOnPath,I=!0,b=v,C=n/2+Dye,P=0;e[0].z+=C;for(let ne=1;ne<e.length;++ne){e[ne].z+=C;let A=e[ne].x-e[ne-1].x,Y=e[ne].z-e[ne-1].z;if(a)P+=Math.sqrt(A*A+Y*Y);else{let R=e[ne].y-e[ne-1].y;P+=Math.sqrt(A*A+R*R+Y*Y)}}if(!a){let ne=e[0],A=e[e.length-1];e.push(A.clone().setZ(A.z-.01)),e.unshift(ne.clone().setZ(ne.z-.01))}let w=new z4;b&&(w=Aye.load(BG),w.colorSpace=ma);let M=new Lt(u),E=new Lt(i),B={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Ae(1,1)},cameraParameters:{type:"v2",value:new Ae(h,0)},complete:{type:"f",value:m?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:h},farZoom:{type:"f",value:g},pulseColor:{type:"c",value:E},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:a},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:w},displayArrowsOnPath:{type:"b",value:v},showPulse:{type:"b",value:I},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:p}},$=new J4(e);$.curveType="catmullrom",$.tension=0;let D=30,F=8,W=D*e.length,G=new Q4($,W,n,F,!1),U=new Float32Array(G.attributes.position.count);for(let ne=e.length;ne<U.length;ne++)U[ne]=ne;G.setAttribute("vertexIndex",new ga(U,1));let J=new Float32Array(G.attributes.position.count),X=new ga(J,1);for(let ne=0;ne<=W;ne++)for(let A=0;A<=F;++A)X.setX(ne*(F+1)+A,ne/W);G.setAttribute("pathDistance",X);let ie=new Float32Array(G.attributes.normal.count*3),te=new ga(ie,3);for(let ne=0;ne<W;ne++){let A=G.tangents[ne];for(let Y=0;Y<=F;++Y)te.setXYZ(ne*(F+1)+Y,A.x,A.y,A.z)}G.setAttribute("pathTangent",te);let xe=new Float32Array(G.attributes.normal.count*3),Pe=new ga(xe,3);for(let ne=0;ne<W;ne++){let A=G.tangents[ne];var he,Re,rt;a?(he=A.x*A.y,Re=-1+A.y*A.y,rt=A.z*A.y):(he=-A.x*A.z,Re=-A.y*A.z,rt=1-A.z*A.z);let Y=Math.sqrt(he*he+Re*Re+rt*rt);Y===0&&(Y=1);let R=he/Y,ce=Re/Y,ae=rt/Y;for(let le=0;le<=F;++le)Pe.setXYZ(ne*(F+1)+le,R,ce,ae)}G.setAttribute("pathNormal",Pe);let it=new Al({uniforms:B,vertexShader:G2,fragmentShader:t4});it.transparent=!0,it.alphaTest=.5,B.resolution.value.x=1,B.resolution.value.y=1,B.vertexes.value=U.length,B.arrowTexture.value.wrapS=as,B.arrowTexture.value.wrapT=as,B.arrowTexture.value.anisotropy=16;let We=new He(G,it),Xe=We.clone(),ue=L(T({},B),{opacityMultiplier:{type:"f",value:.25}});ue.complete.value=1,Xe.material=new Al({uniforms:ue,vertexShader:G2,fragmentShader:t4}),Xe.material.transparent=!0,Xe.material.alphaTest=.5,Xe.material.depthWrite=!1,Xe.material.depthTest=!1,ue.resolution.value.x=1,ue.resolution.value.y=1,ue.vertexes.value=U.length,ue.arrowTexture.value.wrapS=as,ue.arrowTexture.value.wrapT=as,ue.arrowTexture.value.anisotropy=16,ue.complete.value=s,We.userData=Xe.userData=t.mesh.userData;let ye=t.mesh;if(!l){let ne=new Al({uniforms:B,vertexShader:G2,fragmentShader:NG}),A=new He(G,ne);A.name="stencil",A.material.colorWrite=!1,A.material.stencilWrite=!0,A.material.stencilRef=1,A.material.stencilFunc=U4,A.material.stencilZPass=cb,A.material.stencilZFail=cb,A.material.stencilFail=cb,A.material.depthWrite=!1,A.material.depthTest=!1,ye.add(A),ye.add(Xe)}ye.add(We),l&&(We.material.stencilWrite=!0,We.material.stencilRef=1,We.material.stencilFunc=G4,We.material.stencilZPass=lb,We.material.stencilZFail=lb,We.material.stencilFail=lb,We.material.needsUpdate=!0,We.layers.disableAll(),We.layers.enable(xb.ALWAYS_ON_TOP)),G.computeBoundingBox();let fe=new we;return G.boundingBox.getCenter(fe),{mesh:ye,material:it,center:fe}}var Dye=.15;var Hg=class extends Ne{constructor(r,n,o,i){super();f(this,"rendererState");f(this,"altitudeDirty",!0);f(this,"convertTo3DMapPosition");f(this,"getParentContainer");f(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=o,this.convertZoomLevelToAltitude=i}update(r,n,o){let i,s=!1;for(let a of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(a),i&&i.type==="path"&&i.components[0].type==="path"){let l=i.components[0],p=i.components[1],u=l.isVertical&&this.altitudeDirty;if(!(l instanceof Oc))continue;if(l.dirty||u){if(l.mesh.parent!=null)for(let h=l.mesh.children.length-1;h>=0;h--)fr(l.mesh.children[0]);let m=[];if(l.feature.features.forEach(h=>{let g=h.geometry.coordinates[2]||0,v;if(h.properties.parentId&&(v=this.getParentContainer(h.properties.parentId,!0),v!=null&&v.altitude!=null&&(g+=v.altitude,l.isVertical=!0)),!h.properties.parentId||v!=null&&v.visible){let I=this.convertTo3DMapPosition(h.geometry.coordinates[1],h.geometry.coordinates[0],g);m.push(I)}}),m.length>1){let{mesh:h,material:g,center:v}=$G(m,l,{color:p.color});l.mesh=h,l.material=g,l.position=v}l.dirty&&(l.nearZoomLevel!=null&&(l.nearZoomAltitude=this.convertZoomLevelToAltitude(l.nearZoomLevel)),l.farZoomLevel!=null&&(l.farZoomAltitude=this.convertZoomLevelToAltitude(l.farZoomLevel))),l.dirty=!1}p.dirty&&(l.mesh.children.forEach(m=>{m.name!=="stencil"&&(m.material.uniforms.color.value.set(p.color),m.material.visible=p.visible,m.material.needsUpdate=!0)}),l.mesh.position.z=p.altitude,p.dirty=!1),l.material&&(l.mesh.children.forEach(m=>{var g,v;if(m.name==="stencil")return;let h=m.material.uniforms;h.nearZoom.value=(g=l.nearZoomAltitude)!=null?g:r,h.farZoom.value=(v=l.farZoomAltitude)!=null?v:n,h.cameraParameters.value.x=o,l.materialDirty&&(h.nearRadius.value=l.nearRadius,h.displayArrowsOnPath.value=l.displayArrowsOnPath,h.farRadius.value=l.farRadius,h.pulseColor.value.set(l.accentColor),h.complete.value=l.completeFraction),m.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(m=>{m.name!=="stencil"&&(m.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,m.material.needsUpdate=!0)}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};d();var qr,Sm,ml,U2=class{constructor(t){f(this,"rendererState");f(this,"dirty",!1);O(this,qr);O(this,Sm);O(this,ml);this.rendererState=t}updateOne(t){if(t instanceof Mt&&t.components[0]instanceof hr&&t.components[1]instanceof ms&&t.parentObject3D instanceof In&&(k(this,qr,t.components[0]),k(this,ml,t.components[1]),c(this,qr).detached&&c(this,qr).dirty&&c(this,qr).geometry!=null&&c(this,qr).material!=null)){k(this,Sm,t.parentObject3D),c(this,qr).visible=!1;let r=new Lt(c(this,ml).color),n=c(this,ml).opacity*ep(t),o=new Ou({color:r,side:fa,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,c(this,qr).material.repeatYFactor),i=new bb(1,c(this,qr).geometry.attributes.position.count||0,0,o),s=i.addGeometry(c(this,qr).geometry);i.addInstance(s),i.userData={entities:{0:t.id},detached:!0},c(this,qr).instanceIndex=s,c(this,qr).material.setColor(c(this,qr).instanceIndex,r,c(this,ml).topColor?new Lt(c(this,ml).topColor):r),c(this,qr).mesh=i,c(this,qr).material=o,c(this,Sm).add(i),c(this,qr).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(){k(this,qr,void 0),k(this,Sm,void 0),k(this,ml,void 0)}};qr=new WeakMap,Sm=new WeakMap,ml=new WeakMap;d();d();function jG(e,t,r){var n;if(e.geometry!=null){let o=t||1e-4,i=o/e.currentHeight,s=o/r;e.geometry.scale(1,1,i),e.material&&(e.material.repeatYFactor=s),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),e.currentHeight=o}}var ju,Ac,V2=class{constructor(t){f(this,"rendererState");f(this,"dirty",!1);O(this,ju);O(this,Ac);this.rendererState=t}updateOne(t){var r;t instanceof Mt&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(k(this,ju,t.components[0]),k(this,Ac,t.components[1]),t.type==="geometry"&&c(this,Ac).height!==c(this,ju).currentHeight&&jG(c(this,ju),c(this,Ac).height,c(this,Ac).initialHeight))}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){k(this,ju,void 0),k(this,Ac,void 0)}};ju=new WeakMap,Ac=new WeakMap;d();var Fye={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},z2=class{constructor(t){f(this,"state",Fye);f(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())}};d();var Wg=9,Lye=!1,GG=.1;function Rye(e,t,r){for(let n=0;n<t;n++){let o=(r&16711680)>>16,i=(r&65280)>>8,s=r&255;e[n*3]=o/255,e[n*3+1]=i/255,e[n*3+2]=s/255}}var H2=class{constructor(t,r,n){f(this,"state");f(this,"renderer");f(this,"renderService");f(this,"pickingTexture");f(this,"pickingMaterial");f(this,"pixelBuffer");f(this,"width",0);f(this,"height",0);f(this,"scale",1/2);f(this,"color",1);f(this,"convertTo3DMapPosition");f(this,"destroyed",!1);f(this,"enabled",!1);f(this,"backgroundId",16777215);f(this,"resize",()=>{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 W4(this.width,this.height,{format:ab,type:B4,internalFormat:"RGBA"})});f(this,"shouldShowByXY",(t,r,n)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-r-1)*this.width,i=this.pixelBuffer[o*4],s=this.pixelBuffer[o*4+1],a=this.pixelBuffer[o*4+2],l=i<<16|s<<8|a;return l===n||l===this.backgroundId});f(this,"activeOccluders",new Set);f(this,"update",()=>{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 st&&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 s=n2(t,this.convertTo3DMapPosition,{color:"white",height:GG});r=this.createOccluderMesh(s,i.userData.occluderId),i.add(r)}else if(t.geometry.type==="MultiPolygon"){let s=o2(t,this.convertTo3DMapPosition,{color:"white",height:GG});r=this.createOccluderMesh(s,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(Wg),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(Wg),Lye?this.renderService.enabledLayers.add(Wg):this.renderService.enabledLayers.delete(Wg),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 s=i.components[0].projection,a=Math.floor(s.x*this.scale),l=Math.floor(s.y*this.scale),p=this.shouldShowByXY(a,l,i.occluderId);i.components[0].isOccluded=!p}}})});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 Al({glslVersion:V4,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);Rye(o,n.count,r),t.setAttribute("color",new ga(o,3))}createOccluderMesh(t,r){let n=new He(t,this.pickingMaterial);return n.layers.set(Wg),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}};var UG=new ps;var{DEFAULT_PITCH:s4,DEFAULT_BEARING:a4,DEFAULT_ZOOM_LEVEL:l4,DEFAULT_MIN_ZOOM_LEVEL:Nye,DEFAULT_MAX_ZOOM_LEVEL:Bye}=yi,$ye=Qe.radToDeg(.6435011087932844),Pr,vr,Gu,Zg,Cm,Dc,Uu,Tm,bn,n4,H,jt,Yi,Ir,oa,en,z,qg,Rr,Ht,VG,zG,HG,Fc,Xg,Yg,Kg,Jg,W2,Qg,e1,t1,Pm,o4,Vu,r1,eo,to,i4,wm,n1,r4=class extends Ne{constructor(r,n={}){var h,g,v,I,b,C,P,w,M,E,B,$;super();O(this,bn);f(this,"options");f(this,"container");f(this,"Debug");O(this,Pr);O(this,vr);O(this,Gu);O(this,Zg);O(this,Cm);O(this,Dc);O(this,Uu);O(this,Tm);f(this,"rendererDomElement");O(this,H,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new st("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:qm,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new Bw,cameraObject:new dI,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});f(this,"camera");O(this,jt);O(this,Yi);O(this,Ir);O(this,oa);O(this,en);O(this,z,{});O(this,qg,window.matchMedia("screen and (min-resolution: 2dppx)"));f(this,"map");O(this,Rr,()=>{c(this,z).renderSystem.twoDdirty=!0});O(this,Ht,()=>{c(this,z).renderSystem.threeDdirty=!0});O(this,Fc,"standalone");O(this,Xg,r=>Math.trunc(r*10)/10);O(this,Yg,()=>{c(this,z).twoDDrawSystem.dirty=!0,ee(this,bn,n4).call(this,pd()),c(this,z).watermarkSystem.dirty=!0,c(this,z).occlusion2DSystem.resize(),this.render()});O(this,Kg,()=>{c(this,Jg).call(this)});O(this,Jg,(r,n)=>{let o=r!=null?r:this.rendererDomElement.clientWidth,i=n!=null?n:this.rendererDomElement.clientHeight;if(o===0||i===0)return;c(this,H).canvasWidth=o,c(this,H).canvasHeight=i,ee(this,bn,n4).call(this,pd()),c(this,Pm).call(this),ee(this,bn,HG).call(this),c(this,z).cameraSystem.resize(this.canvasWidth,this.canvasHeight),c(this,z).cameraSystem.dirty=!0,c(this,z).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),c(this,z).htmlControlsSystem.resize(this.canvasWidth),c(this,z).geometryInFocusSystem.resize(),c(this,z).occlusion2DSystem.resize();let{top:s,left:a}=this.container.getBoundingClientRect();c(this,H).containerOffset=[s,a],this.publish("resize"),this.render()});O(this,W2,()=>{this.renderSync()});O(this,Qg,new we);O(this,e1,(r,n)=>{let o=this.mode==="standalone"?c(this,vr):this.viewCamera;if(c(this,vr).position.z+this.camera.elevation>n.z){c(this,Qg).copy(n);let i=c(this,Qg).project(o),s=(i.x+1)/2*this.canvasWidth-0/2,a=(-i.y+1)/2*this.canvasHeight-0/2,l=c(this,Xg).call(this,s),p=c(this,Xg).call(this,a);r.x=l,r.y=p}else r.x=-1e3,r.y=-1e3});O(this,t1,(r,n)=>{c(this,en).setBufferSize(r,n),c(this,vr).aspect=r/n,c(this,vr).updateProjectionMatrix(),c(this,vr).updateMatrixWorld(!0),c(this,Cm).x=r,c(this,Cm).y=n});O(this,Pm,()=>{var s;let r=c(this,H).canvasWidth=this.rendererDomElement.clientWidth,n=c(this,H).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(r*this.resolutionScale),i=Math.floor(n*this.resolutionScale);c(this,t1).call(this,o,i),(s=this.map)==null||s.resize(),c(this,H).shouldMeasureCanvas=!1});f(this,"getParentContainer",(r,n=!0)=>{if(!r)return n?c(this,H).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let o=c(this,H).geometry3DMap.get(r);return o instanceof st?o:(V.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?c(this,H).entityScene:void 0)}else if(r.type==="group-container"){let o=c(this,H).geometry3DMap.get(r.id);if(o instanceof st)return o}return n?c(this,H).entityScene:void 0});f(this,"showCollisionBoxes",()=>{c(this,z).collisionSystem.showCollisionBoxes(),this.render()});f(this,"hideCollisionBoxes",()=>{c(this,z).collisionSystem.hideCollisionBoxes(),this.render()});f(this,"projectScreenXYToCoordinate",(r,n,o=!1)=>{var h,g;let i=c(this,H).containerOffset[0],s=c(this,H).containerOffset[1],a=(r-s)/c(this,H).canvasWidth*2-1,l=-((n-i)/c(this,H).canvasHeight)*2+1,p=new Ae(a,l),u,m;if(o)UG.setFromCamera(p,c(this,vr)),u=(h=UG.intersectObject(c(this,Dc),!1)[0])==null?void 0:h.point;else{let v=c(this,z).interactionSystem.getThreeDIntersectsFromXY(p);u=(g=v==null?void 0:v[0])==null?void 0:g.point,m=c(this,z).interactionSystem.getGroupContainerIntersectsFromXY(p)}if(u)return{coordinate:this.convert3DMapPositionToCoordinate(u),groupContainers:m}});f(this,"projectCoordinateToScreenXY",r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),o=new Ae;return c(this,e1).call(this,o,n),{x:o.x,y:o.y}});f(this,"convert3DMapPositionToCoordinate",r=>{var i,s,a,l;let{lat:n,lon:o}=vb((s=(i=c(this,H).center)==null?void 0:i[1])!=null?s:0,(l=(a=c(this,H).center)==null?void 0:a[0])!=null?l:0,r.x,r.y);return[o,n,r.z]});f(this,"setBackgroundColor",(r,n)=>{c(this,en).setBackgroundColor(r,n)});f(this,"getMetresPerPixel",()=>{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:hb(o.coordinate,i.coordinate)/r});f(this,"hideOutdoorLayersUnderPoint",(r,n)=>{!this.map||(n==null?void 0:n.length)===0||(c(this,z).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())});f(this,"hideOutdoorLayersIntersectingPolygons",(r,n,o)=>{c(this,z).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,o),this.render()});O(this,Vu,new K4);O(this,r1,new bi);f(this,"render",()=>{var r;if(((r=c(this,z))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return c(this,z).renderSystem.update()});f(this,"renderSync",()=>c(this,z).renderSystem.update(!0));O(this,eo,ud(()=>{this.publish("user-interaction-start",void 0)},0,!0));O(this,to,ud(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));f(this,"on",(r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&x.env.NODE_ENV!=="test"&&(V.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))});f(this,"off",(r,n)=>{super.off(r,n)});f(this,"getCursor",()=>c(this,z).interactionSystem.getCursor());f(this,"destroy",()=>{var r;c(this,z)&&(c(this,z).cameraSystem.off("user-dolly-start",c(this,eo)),c(this,z).cameraSystem.off("user-pan-start",c(this,eo)),c(this,z).cameraSystem.off("user-rotate-start",c(this,eo)),c(this,z).cameraSystem.off("user-zoom-start",c(this,eo)),c(this,z).cameraSystem.off("user-tilt-start",c(this,eo)),c(this,z).cameraSystem.off("user-pedestal-start",c(this,eo)),c(this,z).cameraSystem.off("user-dolly-end",c(this,to)),c(this,z).cameraSystem.off("user-pan-end",c(this,to)),c(this,z).cameraSystem.off("user-rotate-end",c(this,to)),c(this,z).cameraSystem.off("user-zoom-end",c(this,to)),c(this,z).cameraSystem.off("user-tilt-end",c(this,to)),c(this,z).cameraSystem.off("user-pedestal-end",c(this,to)),c(this,z).renderSystem.off("measure-canvas",c(this,Pm)),c(this,z).meshOptimizationSystem.off("geometry-2d-added",this.render),c(this,z).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),c(this,Rr).call(this),c(this,Ht).call(this),this.renderSync(),c(this,z).renderSystem.destroy(),c(this,z).cameraSystem.off("change",this.render),c(this,z).pathSystem.off("animate:path",this.render),c(this,z).cameraSystem.dispose(),c(this,z).exporterSystem.destroy(),c(this,z).outdoorLayersSystem.destroy(),c(this,z).drawSystem.destroy(),window.removeEventListener("resize",c(this,Kg),!1),c(this,qg).removeEventListener("change",c(this,Yg)),c(this,Uu)&&c(this,Uu).disconnect(),this._subscribers={},c(this,en).destroy(),(r=c(this,Pr))==null||r.traverse(n=>{fr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),k(this,Pr,void 0),c(this,z).htmlControlsSystem.destroy(),c(this,z).collisionSystem.destroy(),c(this,z).interactionSystem.destroy(),c(this,z).domMutationSystem.destroy(),c(this,z).geometryInFocusSystem.destroy(),k(this,z,void 0),c(this,Fc)!=="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(c(this,oa)),this.container.removeChild(c(this,jt)),k(this,en,void 0))});O(this,wm,new we);O(this,n1,new we);if(c(this,H).useStandaloneCamera=(h=n.useStandaloneCamera)!=null?h:!1,c(this,H).naturalBearing=(g=n.naturalBearing)!=null?g: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&&(k(this,Fc,n.mode),this.map=n.map),c(this,H).entityScene.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),c(this,H).entityScene.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),c(this,H).geometry3DMap.set(c(this,H).entityScene.userData.entityId,c(this,H).entityScene),n.center&&(c(this,H).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,ee(this,bn,VG).call(this),ee(this,bn,zG).call(this),c(this,z).htmlControlsSystem=new E2(this.container),c(this,Fc)!=="outdoors-overlay"&&c(this,z).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),x.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),k(this,en,new vv({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:D=>{var F;(F=n.onWebGLContextRestored)==null||F.call(n,D),c(this,Rr).call(this),c(this,Ht).call(this),this.render()},onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(I=n.backgroundAlpha)!=null?I:1})),k(this,Pr,new Dl),c(this,Pr).add(c(this,H).entityScene);let o=window.__THREE_DEVTOOLS__;x.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:c(this,Pr)})),o.dispatchEvent(new CustomEvent("observe",{detail:c(this,en)}))),k(this,vr,new dI($ye,this.aspect,50,1e5)),c(this,H).cameraObject=c(this,vr),k(this,Zg,new X4),c(this,vr).renderOrder=999;let i=new ya;i.add(c(this,vr)),k(this,Tm,new ya),c(this,Tm).add(i),c(this,Pr).add(c(this,Tm)),c(this,vr).updateProjectionMatrix(),c(this,vr).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=c(this,en).domElement(),k(this,Cm,new Ae);let s=new vi(1e6,1e6),a=new Br({color:0,visible:!1});k(this,Dc,new He(s,a)),c(this,Dc).name="worldPlane",c(this,Pr).add(c(this,Dc)),(b=n.gl)!=null&&b.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",c(this,Kg),!1),c(this,qg).addEventListener("change",c(this,Yg)),typeof ResizeObserver=="function"&&((C=x.env)==null?void 0:C.NODE_ENV)!=="test"&&(k(this,Uu,new ResizeObserver(xM(D=>{c(this,Jg).call(this,D[0].contentRect.width,D[0].contentRect.height)},50))),(P=c(this,Uu))==null||P.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1920px":"100%",x.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),c(this,H).canvasWidth=this.rendererDomElement.clientWidth,c(this,H).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,p=this.canvasHeight;c(this,z).watermarkSystem=new P2(c(this,vr),c(this,H),n==null?void 0:n.watermark),c(this,z).watermarkSystem.on("texture-loaded",this.render),c(this,H).shouldMeasureCanvas=!0,c(this,H).pixelRatio=this.resolutionScale,c(this,t1).call(this,Math.floor(l*this.resolutionScale),Math.floor(p*this.resolutionScale));let u=new fb(16777215,.3*Math.PI);u.position.set(-150,-150,350),c(this,Pr).add(u);let m=new tM(16777215,.741*Math.PI);c(this,Pr).add(m),c(this,z).cameraSystem=new Lu(c(this,vr),c(this,Pr),c(this,en).renderer,c(this,H),{mode:this.mode,canvasHeight:p,canvasWidth:l}),c(this,z).cameraSystem.on("user-dolly-start",c(this,eo)),c(this,z).cameraSystem.on("user-pan-start",c(this,eo)),c(this,z).cameraSystem.on("user-rotate-start",c(this,eo)),c(this,z).cameraSystem.on("user-zoom-start",c(this,eo)),c(this,z).cameraSystem.on("user-tilt-start",c(this,eo)),c(this,z).cameraSystem.on("user-pedestal-start",c(this,eo)),c(this,z).cameraSystem.on("user-dolly-end",c(this,to)),c(this,z).cameraSystem.on("user-pan-end",c(this,to)),c(this,z).cameraSystem.on("user-rotate-end",c(this,to)),c(this,z).cameraSystem.on("user-zoom-end",c(this,to)),c(this,z).cameraSystem.on("user-tilt-end",c(this,to)),c(this,z).cameraSystem.on("user-pedestal-end",c(this,to)),c(this,z).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),c(this,z).geometryInFocusSystem&&(c(this,z).geometryInFocusSystem.cameraDirty=!0),this.render()}),c(this,z).pathSystem=new Hg(c(this,H),this.convertTo3DMapPosition,this.getParentContainer,c(this,z).cameraSystem.convertZoomLevelToAltitude),c(this,z).pathSystem.on("animate:path",this.render),c(this,z).panBoundsSystem=new O2(c(this,H),c(this,z).cameraSystem),c(this,z).panBoundsSystem.on("update",()=>{let{panBounds:D,fov:F,convertAltitudeToZoomLevel:W}=c(this,z).cameraSystem;if(c(this,z).panBoundsSystem.autoMinZoomLevel){if(D.radius<=0)return;let G=Math.min(c(this,H).canvasWidth/c(this,H).canvasHeight,1),U=F*Math.PI/180*G,J=Math.tan(U/2),{radius:X,center:ie}=c(this,z).cameraSystem.panBounds,te=X/J,xe=this.getThreeCamera().getWorldPosition(new we),Pe=ie.distanceTo(xe),he=Math.abs(xe.z-ie.z),Re=te*he/Pe,rt=W(Re);FM(rt,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(rt)}}),this.camera=new T2(this,c(this,z),c(this,H)),this.camera.setZoomLevel((E=n.zoomLevel)!=null?E:l4),this.camera.setBearing((B=n.bearing)!=null?B:a4),this.camera.setPitch(($=n.pitch)!=null?$:s4),this.camera.setMaxZoomLevel(Bye),this.camera.setMinZoomLevel(Nye),c(this,z).domVisiblitySystem=new a2(c(this,H),c(this,oa)),c(this,z).domMutationSystem=new C2(c(this,H),c(this,oa)),c(this,z).domMutationSystem.on("dimensions-update",()=>{c(this,z).collisionSystem.collidersDirty=!0,this.render()}),c(this,z).domDrawSystem=new I2(c(this,H)),c(this,z).collisionSystem=new Iv(c(this,Yi),c(this,H)),c(this,z).twoDDrawSystem=new c2(c(this,H),c(this,Ir),n.transformImageRequest),c(this,z).twoDDrawSystem.on("img:loaded",this.render),c(this,z).interactionSystem=new og(this.rendererDomElement,c(this,H),c(this,vr),c(this,Dc),c(this,z).cameraSystem.isUserInteracting),c(this,z).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:vI,easing:"ease-out"})}),c(this,z).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:vI,easing:"ease-out"})}),c(this,z).interactionSystem.on("hover",this.render),c(this,z).interactionSystem.on("click",D=>{var F,W,G,U,J,X;if(((F=D.entity2D)==null?void 0:F.id)==="watermark"&&typeof c(this,z).watermarkSystem.options.onClick=="function"&&c(this,z).watermarkSystem.options.interactive){c(this,z).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(W=D.entity3D)==null?void 0:W.id]:[],paths:((G=D.entity3D)==null?void 0:G.components[0])instanceof Oc?[D.entity3D.id]:[],markers:((U=D.entity2D)==null?void 0:U.components[0])instanceof Js?[D.entity2D.id]:[],models:((J=D.entity3D)==null?void 0:J.components[0])instanceof wc?[D.entity3D.id]:[],labels:((X=D.entity2D)==null?void 0:X.components[0])instanceof Qs?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(ie=>ie.userData.entityId):[],pointerEvent:D.pointerEvent})}),c(this,z).interactionSystem.on("hover",D=>{var F,W,G,U,J,X;D.position&&((F=D.entity2D)==null?void 0:F.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(W=D.entity3D)==null?void 0:W.id]:[],paths:((G=D.entity3D)==null?void 0:G.components[0])instanceof Oc?[D.entity3D.id]:[],markers:((U=D.entity2D)==null?void 0:U.components[0])instanceof Js?[D.entity2D.id]:[],models:((J=D.entity3D)==null?void 0:J.components[0])instanceof wc?[D.entity3D.id]:[],labels:((X=D.entity2D)==null?void 0:X.components[0])instanceof Qs?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(ie=>ie.userData.entityId):[]})}),c(this,z).geometryInFocusSystem=new N2(c(this,H),c(this,vr)),c(this,z).geometryInFocusSystem.on("geometry-in-focus",D=>{this.publish("geometry-in-focus",D)}),c(this,z).twoDVisiblitySystem=new u2(c(this,H)),c(this,z).drawSystem=new p2(c(this,H),this.convertTo3DMapPosition),c(this,z).drawSystem.on("texture-loaded",this.render),c(this,z).stackSystem=new f2(c(this,H)),c(this,z).twoDProjectionSystem=new l2(c(this,H),c(this,e1)),c(this,z).exporterSystem=new vg(c(this,H)),c(this,z).meshOptimizationSystem=new s2(c(this,H),this.convertTo3DMapPosition),c(this,z).meshOptimizationSystem.on("model-loaded",this.render),c(this,z).meshOptimizationSystem.on("geometry-2d-added",this.render),c(this,z).meshDetachmentSystem=new U2(c(this,H)),c(this,z).meshModificationSystem=new V2(c(this,H)),c(this,z).customGeometrySystem=new _2(c(this,H),this.convertTo3DMapPosition),c(this,z).outlineInterpolationSystem=new k2(c(this,H)),c(this,z).renderSystem=new d2(c(this,en),c(this,H),this.mode,c(this,Pr),c(this,vr),this.viewCamera,c(this,z)),c(this,z).imageSystem=new R2(c(this,H),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),c(this,z).text3DSystem=new Uv(c(this,H),this.convertTo3DMapPosition),c(this,z).text3DSystem.on("render",this.render),c(this,z).imageSystem.on("image-loaded",this.render),c(this,z).renderSystem.on("pre-render",()=>this.publish("pre-render")),c(this,z).renderSystem.on("post-render",()=>this.publish("post-render")),c(this,z).renderSystem.on("measure-canvas",c(this,Pm)),c(this,z).outdoorLayersSystem=new $2(this.map),c(this,z).occlusion2DSystem=new H2(c(this,H),this.convertTo3DMapPosition,c(this,en)),n.occlusionEnabled&&c(this,z).occlusion2DSystem.enable(),this.Debug=new z2(this),n.environment!==!1&&k(this,Gu,ee(this,bn,i4).call(this)),c(this,W2).call(this)}get viewCamera(){return c(this,Zg)}get canvasWidth(){return c(this,H).canvasWidth}get canvasHeight(){return c(this,H).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:pd()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return c(this,Fc)}addGroupContainer(r,n,o){if(!c(this,H).geometry3DMap.has(r)&&!c(this,H).geometry2DMap.has(r)){let i=new st(r);i.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),i.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).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,c(this,H)),(n==null?void 0:n.focusable)!==void 0&&Ew(i,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(i.userData.preloadGeometry=n.preloadGeometry),c(this,H).geometry3DMap.set(r,i);let s=this.getParentContainer(o);s instanceof st&&s.addEntity(i),c(this,Ht).call(this),this.render()}else V.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(c(this,H).geometry3DMap.has(r))V.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let i=new st(r);i.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),i.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),i.components[0]=new S2,(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),c(this,H).geometry3DMap.set(r,i);let s=this.getParentContainer(o);s instanceof st&&s.addEntity(i)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,o,i,s){if(c(this,H).geometry3DMap.has(r))V.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let a=new vm(n,o),l=new Mt(a,new ms(i));(i==null?void 0:i.interactive)!==void 0&&gn(l,i.interactive,c(this,H)),l.id=r,a.mesh.userData={entityId:r,type:"custom-geometry"},c(this,H).geometry3DMap.set(l.id,l);let p=this.getParentContainer(s);p instanceof st&&p.addEntity(l),c(this,Ht).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,o,i){var s,l;if(!c(this,H).geometry3DMap.has(r)&&!c(this,H).geometry2DMap.has(r)){let p=new In(r,new bI(o));p.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),p.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),p.userData.dirty=!0,c(this,H).geometry3DMap.set(r,p);for(let m of n.features){if(m.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(m.geometry.type))continue;let h=(m==null?void 0:m.id)||((s=m==null?void 0:m.properties)==null?void 0:s.id)||kt(),a=o||{color:yM},{visible:g}=a,v=Bn(a,["visible"]),I=c(this,z).meshOptimizationSystem.createEntityFromFeature(h,m,L(T({},v),{outline:!0}));c(this,H).geometry3DMap.set(h,I),p.userData.entities3D.add(h)}p.setVisible((l=o==null?void 0:o.visible)!=null?l:!0),(o==null?void 0:o.altitude)!=null&&p.setAltitude(o.altitude);let u=this.getParentContainer(i);u instanceof st&&u.addEntity(p),c(this,Ht).call(this),this.render()}else V.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return c(this,z).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let o=this.getParentContainer(n),i=c(this,z).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(r,i),i}addImage(r,n,o,i){try{EG(r,n,o)}catch(s){V.error(s);return}if(!c(this,H).geometry3DMap.has(r)&&!c(this,H).geometry2DMap.has(r)){let s=new L2(n),a=new Mt(s,new ms(o));a.id=r||kt(),s.mesh.userData={entityId:a.id,type:"path"},c(this,H).geometry3DMap.set(a.id,a);let l=this.getParentContainer(i);l instanceof st&&l.addEntity(a),c(this,Ht).call(this),this.render()}else V.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:s}={}){var a,l;try{aG(r,n,o)}catch(p){V.error(p);return}if(!c(this,H).geometry3DMap.has(r)&&!c(this,H).geometry2DMap.has(r)){let p=new In(r,new bI(L(T({},o),{outline:!1})));p.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),p.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),c(this,H).geometry3DMap.set(r,p),p.userData.dirty=!0,p.userData.modelURL=o.url;for(let m of n.features){let h=m.id||m.properties.id||kt(),g=c(this,z).meshOptimizationSystem.createModelFromFeature(h,m,o);(m.properties.interactive!==void 0||o.interactive!=null)&&gn(g,(a=m.properties.interactive)!=null?a:o.interactive,c(this,H)),c(this,H).geometry3DMap.set(h,g),p.userData.entities3D.add(h)}let u=this.getParentContainer(i);u instanceof st&&u.addEntity(p),c(this,Ht).call(this),(l=this.render())==null||l.then(s)}else V.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 a;let s=o==null?void 0:o.id;try{w$(r,n,o||{})}catch(l){V.error(l);return}if(s===void 0||!c(this,H).geometry2DMap.has(s)&&!c(this,H).geometry3DMap.has(s)){let l=ee(this,bn,o4).call(this,r,new Js(n,o),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&o.interactive!=="pointer-events-auto"&&gn(l,o==null?void 0:o.interactive,c(this,H));let p=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?c(this,H).geometry3DMap.get(o.attachTo):void 0;p instanceof Mt&&p.attach(l),(a=this.getParentContainer(i))==null||a.addEntity(l),this.render()}else V.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}addText3D(r,n,o,i){if(!c(this,H).geometry3DMap.has(r)&&!c(this,H).geometry2DMap.has(r)){let s=new Sc(L(T({},n),{properties:L(T({},n.properties),{id:r,content:n.properties.text})})),a=new Mt(s,new Ym(o==null?void 0:o.appearance));a.id=r,s.mesh.userData.entityId=r.toString(),s.mesh.userData.type="text3d",c(this,H).geometry3DMap.set(r,a);let l=this.getParentContainer(i);l instanceof st&&l.addEntity(a),c(this,Ht).call(this),this.render()}else V.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,o={}){var p,u;try{if(!n||!r)throw new Error("content and meshGeometryId are required");Ij.parse(o)}catch(m){V.error(m);return}let i=c(this,H).geometry3DMap.get(r);if((i==null?void 0:i.type)!=="geometry"){V.error(".labelText3D failed: target incorrect");return}let s=i==null?void 0:i.components[0];if(!s.feature.properties.textArea)return;if(s.textEntityId){let m=c(this,H).geometry3DMap.get(s.textEntityId);if((m==null?void 0:m.type)!=="text3d"){V.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let a=new Sc({type:"Feature",geometry:{coordinates:(p=s.feature.properties.textArea)==null?void 0:p.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:n,id:kt()}});a.polygonEntityId=r;let l=new Mt(a,new Ym(o==null?void 0:o.appearance));return s.textEntityId=l.id.toString(),a.mesh.userData.entityId=l.id.toString(),a.mesh.userData.type="text3d",c(this,H).geometry3DMap.set(l.id.toString(),l),o.parentId&&((u=this.getParentContainer(o.parentId))==null||u.addEntity(l)),this.render(),{id:l.id,type:"text3d"}}addLabel2D(r,n,o,i){var a;let s=o==null?void 0:o.id;try{mj(r,n,o||{})}catch(l){V.error(l);return}if(s===void 0||!c(this,H).geometry2DMap.has(s)&&!c(this,H).geometry3DMap.has(s)){let l=ee(this,bn,o4).call(this,r,new Qs(n,o||{},c(this,H)),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&gn(l,o==null?void 0:o.interactive,c(this,H));let p=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?c(this,H).geometry3DMap.get(o.attachTo):void 0;p instanceof Mt&&p.attach(l),(a=this.getParentContainer(i))==null||a.addEntity(l),c(this,Rr).call(this),this.render()}else V.error("Label2D with ID '".concat(s,"' already exists. The label cannot be added."));return{id:s,type:"label"}}addPath(r,n={},o){var l;try{uG(r,n||{})}catch(p){V.error(p);return}let i=new Oc(r,_w(n)),s=new Mt(i,new ms({color:(l=n==null?void 0:n.color)!=null?l:"#ff834c"}));s.id=(n==null?void 0:n.id)||kt(),i.mesh.userData={entityId:s.id,type:"path"},c(this,H).geometry3DMap.set(s.id,s),(n==null?void 0:n.interactive)!=null&&gn(s,n==null?void 0:n.interactive,c(this,H));let a=this.getParentContainer(o);return a instanceof st&&a.addEntity(s),c(this,Ht).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(r){c(this,z).watermarkSystem.options=r,c(this,z).watermarkSystem.dirty=!0,c(this,z).collisionSystem.collidersDirty=!0,this.render()}remove(r){var o;let n;if(typeof r=="string"||typeof r=="number"?(n=c(this,H).geometry2DMap.get(r),n==null&&(n=c(this,H).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=c(this,H).geometry2DMap.get(r.id),n==null&&(n=c(this,H).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")c(this,H).geometry3DMap.delete(n.id),n.object3d&&fr(n.object3d);else if(n.type==="group-container"){c(this,H).geometry3DMap.delete(n.userData.entityId);for(let s of n.childrenIds.values())this.remove(s),n.userData.entities2D.delete(s);let i=n.components[2];i&&i.focusMesh&&fr(i.focusMesh),fr(n)}else if(n.type==="geometry-group"){c(this,H).geometry3DMap.delete(n.userData.entityId);for(let i of n.userData.entities3D.values())this.remove(i),n.userData.entities3D.delete(i);fr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let i=n.components[0];if(n.entities2D.size>0){for(let s of n.entities2D.values())this.remove(s);n.removeAllEntities()}if(n.object3d&&(((o=n.parentObject3D)==null?void 0:o.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),fr(n.object3d)),n.type==="geometry"){let s=n.components[3];s&&(s.visible=!1,s.dirty=!0)}"focusMesh"in i&&i.focusMesh!=null&&fr(i.focusMesh),"textMesh"in i&&i.textMesh!=null&&this.remove(i.textMesh.userData.entityId),c(this,H).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let i=n.attachedTo;if(i){let s=c(this,H).geometry3DMap.get(i);s instanceof Mt&&s.detach(n)}n.object3d&&fr(n.object3d),n.type==="label"&&delete c(this,z).twoDDrawSystem.textCache[n.id],c(this,H).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&fr(n.object3d),c(this,H).geometry3DMap.delete(n.id);else if(n.type==="text3d"){fr(n.object3d);let{batchedText:i,textMesh:s,polygonEntityId:a}=n.components[0];if(s&&(i&&i.removeText(s),fr(s)),a){c(this,z).text3DSystem.remove(a);let l=c(this,H).geometry3DMap.get(a);(l==null?void 0:l.type)==="geometry"&&(l.components[0].textMesh=void 0,l.components[0].textEntityId=void 0)}c(this,H).geometry3DMap.delete(n.id)}c(this,Ht).call(this),c(this,Rr).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return c(this,Pr)}getThreeCamera(){return c(this,vr)}async setEnvironment(r){if(c(this,Pr))if(r==="basic"){c(this,Gu)||k(this,Gu,ee(this,bn,i4).call(this));let n=await c(this,Gu);c(this,Pr).environment=n}else c(this,Pr).environment=null}getEnvironment(){var r;return(r=c(this,Pr))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return c(this,z).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(c(this,z).renderSystem.threeDdirty||c(this,z).renderSystem.twoDdirty)&&this.renderSync();let n=new Xr;if(r==null)n.setFromObject(c(this,H).entityScene);else{let o=Xm(c(this,H),r);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let i=o.components[0],s=i instanceof hr?i.geometry:void 0;i.mesh instanceof pb&&s?(s.computeBoundingBox(),s.boundingBox&&n.union(s.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(Yc(n))return IM(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var o,i,s,a,l,p,u,m,h,g;if(r==null)return{type:"map-view",hoverColor:c(this,H).hoverColor,text3dHoverColor:c(this,H).text3dHoverColor};let n=Xm(c(this,H),r);if((n==null?void 0:n.type)==="custom-geometry"){let v=n.components[0],I=n.components[1];return{id:n.id,type:"custom-geometry",visible:I.visible,altitude:I.altitude,parent:(o=n.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(v.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let v=[];for(let b of n.userData.entities3D.values()){let C=this.getState(b);((C==null?void 0:C.type)==="geometry"||(C==null?void 0:C.type)==="model")&&v.push(C)}let I=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:I.opacity,color:I.color,initialColor:I.initialColor,height:I.height,altitude:n.altitude,topColor:I.topColor,outline:I.outline,shading:I.shading,texture:I.texture,topTexture:I.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(b=>c(this,H).geometry3DMap.get(b)).every(b=>b&&b.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(b=>this.getState(b)).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(v=>this.getState(v)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let v=n.components[0],I=n.object3d.parent,b=I==null?void 0:I.userData.entityId;return{id:n.id,type:"label",text:v.text||"",parent:{id:b,type:I==null?void 0:I.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:v.enabled,visible:v.visible,initialRank:rg(v.initialRank),options:{rank:rg(v.rank),appearance:v.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let v=n.components[0],I=n.object3d.parent,b=I==null?void 0:I.userData.entityId;return{id:n.id,type:"marker",enabled:v.enabled,visible:v.visible,anchor:v.options.anchor,dynamicResize:v.options.dynamicResize,parent:{id:b,type:I==null?void 0:I.type},position:this.convert3DMapPositionToCoordinate(n.position),element:v.containerEl,initialRank:rg(v.initialRank),options:{rank:rg(v.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:v.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:v,hoverColor:I,initialColor:b,initialTopColor:C,topColor:P}=n.components[1],w=n.components[0],M=n.components[1],E=n.components[2],B=n.components[3],$=n.parentObject3D;return{id:n.id,type:"geometry",opacity:M.opacity,initialColor:b,color:v,focusable:w.focusable,initialTopColor:C,topColor:P,hoverColor:I,hovered:!!(E!=null&&E.hover),height:M.height,visible:M.visible,outline:B==null?void 0:B.visible,showImage:M.showImage,texture:M.texture,topTexture:M.topTexture,flipImageToFaceCamera:M.flipImageToFaceCamera,parent:{id:$==null?void 0:$.userData.entityId,type:$==null?void 0:$.type},position:this.convert3DMapPositionToCoordinate(w.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let v=n.components[0],I=n.components[1],b=n.components[2];return{id:n.id,type:"model",position:v.mesh?this.convert3DMapPositionToCoordinate((i=v.mesh)==null?void 0:i.getWorldPosition(new we)):this.convert3DMapPositionToCoordinate(v.position),interactive:b!=null,material:I.material,parent:(s=n.parentObject3D)!=null&&s.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:I.visible,verticalOffset:I.verticalOffset,color:I.color,opacity:I.opacity,rotation:(a=I.rotation)!=null?a:md,scale:(l=I.scale)!=null?l:fd}}else if((n==null?void 0:n.type)==="path"){let v=n.components[0],I=n.components[2],b=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(v.position),visible:b.visible,interactive:I!=null,completeFraction:v.completeFraction,color:b.color,accentColor:v.accentColor,nearRadius:v.nearRadius,farRadius:v.farRadius,animateArrowsOnPath:v.animateArrowsOnPath,displayArrowsOnPath:v.displayArrowsOnPath,nearZoomLevel:v.nearZoomLevel,farZoomLevel:v.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let v=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(v.position),visible:n.components[1].visible,verticalOffset:(p=v.feature.properties.verticalOffset)!=null?p:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof Sc&&"textArea"in n.components[0].feature.properties){Gj(n);let v=n.components[0],I=n.components[1],{textMesh:b}=v,C=(u=v.mesh)==null?void 0:u.parent;C instanceof st&&((m=C.children.find(M=>M.type==="batchedtext"))==null||m.getWorldPosition(c(this,n1))),c(this,wm).set(0,0,0);let P=b?b.getWorldPosition(c(this,wm)):c(this,wm);return Object.assign({},dd,I.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(P.add(c(this,n1))),visible:(h=v.visible)!=null?h:!1,content:(g=v.feature.properties.content)!=null?g:""})}else return}}setState(r,n){var i,s;if(typeof r=="object"&&n==null){"hoverColor"in r&&(c(this,H).hoverColor=(i=r.hoverColor)!=null?i:c(this,H).hoverColor),"text3dHoverColor"in r&&(c(this,H).text3dHoverColor=(s=r.text3dHoverColor)!=null?s:c(this,H).text3dHoverColor);return}let o=Xm(c(this,H),r);if(o!=null){if(o.type==="custom-geometry"){let a=c(this,H).geometry3DMap.get(o.id);if(a instanceof Mt&&a.components[0]instanceof vm){let l=n;ea(o,c(this,H),l.visible),Hv(o,l.altitude),Pw(o,l.position,this.convertTo3DMapPosition),ww(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let a=n;gn(o,a.interactive,c(this,H))&&c(this,Ht).call(this),Hv(o,a.altitude),jj(o,c(this,H),a)}else if(o.type==="model"){let a=n;gn(o,a.interactive,c(this,H))&&c(this,Ht).call(this),ea(o,c(this,H),a.visible),Vj(o,a)}else if(o.type==="group-container"){let a=n;ea(o,c(this,H),a.visible)&&(c(this,z).outlineInterpolationSystem.outlineOpacitiesDirty=!0,c(this,z).pathSystem.altitudeDirty=!0),Hv(o,a.altitude)&&(c(this,z).pathSystem.altitudeDirty=!0),gn(o,a.interactive,c(this,H))&&c(this,Ht).call(this),Ow(o,c(this,H),a.opacity)&&(c(this,z).outlineInterpolationSystem.outlineOpacitiesDirty=!0),a.preloadGeometry&&o.userData.preloadGeometry!==!0&&(o.userData.preloadGeometry=!0,c(this,z).outlineInterpolationSystem.geometries3DDirty=!0)}else if(o.type==="geometry-group"){let a=n;ea(o,c(this,H),a.visible)&&(c(this,z).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wj(o,c(this,H),a),Wv(o,c(this,H),a.outline),a.height!=null&&Cw(o,c(this,H),a.height),a.altitude!=null&&o.setAltitude(a.altitude),Rj(o,a),Mj(o,a.shading),Ow(o,c(this,H),a.opacity)&&(c(this,z).outlineInterpolationSystem.outlineOpacitiesDirty=!0),gn(o,a.interactive,c(this,H))&&(c(this,Ht).call(this),c(this,Rr).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof hr){let a=n;ea(o,c(this,H),a.visible)&&(c(this,z).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Wv(o,c(this,H),a.outline),Oj(o,a),Ew(o,a.focusable)&&(c(this,z).geometryInFocusSystem.focusablesDirty=!0),$j(o,a.renderOrder)&&(c(this,z).meshDetachmentSystem.dirty=!0),Bj(o,a.opacity)&&(c(this,z).meshDetachmentSystem.dirty=!0,c(this,z).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Mw(o,a.flipImageToFaceCamera),a.height!=null&&Cw(o,c(this,H),a.height),Nj(o,a)&&(c(this,z).meshDetachmentSystem.dirty=!0),Tw(o,a),Dj(o,a.hoverColor),gn(o,a.interactive,c(this,H)),Fj(o,a.hovered)}c(this,Ht).call(this)}else if(o.type==="label"||o.type==="marker"){let a=n;Aj(o,n,c(this,H)),_j(o,n,c(this,H))&&(c(this,Rr).call(this),c(this,z).domMutationSystem.dirty=!0),Pw(o,a.position,this.convertTo3DMapPosition),ww(o,this.getParentContainer(a.parent,!1))&&(c(this,Rr).call(this),c(this,z).panBoundsSystem.dirty=!0),Ej(o,a.enabled),ea(o,c(this,H),a.visible)}else if(o.type==="image"){let a=n;ea(o,c(this,H),a.visible),Mw(o,a.flipImageToFaceCamera)}else if(o.type==="text3d"){let a=n;Uj(o,c(this,H),a)}this.render()}}convertTo3DMapPosition(r,n,o=0,i){var l,p,u,m,h;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(l=r[2])!=null?l:o,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:s,y:a}=Ib((u=(p=c(this,H).center)==null?void 0:p[1])!=null?u:0,(h=(m=c(this,H).center)==null?void 0:m[0])!=null?h:0,r,n);return i?(i.set(s,a,o),i):new we(s,a,o)}get backgroundColor(){return typeof c(this,en).backgroundColor=="string"?c(this,en).backgroundColor:"#".concat(c(this,en).backgroundColor.getHexString())}get backgroundAlpha(){return c(this,en).backgroundAlpha}getThreeRenderer(){return c(this,en)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?DM(n):void 0}isInView(r){let n=Xm(c(this,H),r);if(c(this,r1).identity().multiply(c(this,vr).projectionMatrix).multiply(c(this,vr).matrixWorldInverse),c(this,Vu).setFromProjectionMatrix(c(this,r1)),n instanceof Qc)return c(this,Vu).containsPoint(n.position);if(n instanceof Mt){let o=n==null?void 0:n.components[0];if(o instanceof vm||o instanceof wc)return c(this,Vu).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof hr){let i=new Xr(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return c(this,Vu).intersectsBox(i)}}return!1}getSystems(){return c(this,z)}getInternalState(){return c(this,H)}getTweenGroup(){return c(this,H).tweenGroup}};Pr=new WeakMap,vr=new WeakMap,Gu=new WeakMap,Zg=new WeakMap,Cm=new WeakMap,Dc=new WeakMap,Uu=new WeakMap,Tm=new WeakMap,bn=new WeakSet,n4=function(r){var n;c(this,Fc)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),c(this,H).pixelRatio=this.resolutionScale},H=new WeakMap,jt=new WeakMap,Yi=new WeakMap,Ir=new WeakMap,oa=new WeakMap,en=new WeakMap,z=new WeakMap,qg=new WeakMap,Rr=new WeakMap,Ht=new WeakMap,VG=function(){k(this,jt,document.createElement("div")),c(this,jt).classList.add("mappedin__smart-collision-engine__container"),k(this,Yi,document.createElement("canvas")),c(this,Yi).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(c(this,jt)),k(this,Ir,document.createElement("canvas")),c(this,Ir).classList.add("mappedin__smart-collision-engine__container"),c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px",c(this,jt).appendChild(c(this,Yi)),c(this,jt).appendChild(c(this,Ir)),c(this,Yi).width=c(this,jt).clientWidth,c(this,Yi).height=c(this,jt).clientHeight,c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px"},zG=function(){k(this,oa,document.createElement("div")),c(this,oa).classList.add("mappedin-2d-entities"),Object.assign(c(this,oa).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(c(this,oa))},HG=function(){c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px",c(this,Yi).width=c(this,jt).clientWidth,c(this,Yi).height=c(this,jt).clientHeight,c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px",c(this,z).collisionSystem.collidersDirty=!0},Fc=new WeakMap,Xg=new WeakMap,Yg=new WeakMap,Kg=new WeakMap,Jg=new WeakMap,W2=new WeakMap,Qg=new WeakMap,e1=new WeakMap,t1=new WeakMap,Pm=new WeakMap,o4=function(r,n,o,i){let s=new Qc(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i);return s.occluderId=o!=null?o:c(this,z).occlusion2DSystem.backgroundId,c(this,H).geometry2DMap.set(s.id,s),s},Vu=new WeakMap,r1=new WeakMap,eo=new WeakMap,to=new WeakMap,i4=async function(){return Mc.load(LB).then(r=>{var n;return c(this,Pr)&&((n=c(this,Pr).environment)==null||n.dispose(),r.mapping=N4,c(this,Pr).environment=r,this.render()),r})},wm=new WeakMap,n1=new WeakMap;var o1=r4;d();function jye(e,t){Gye(e,t)(e.getScene(),t),Uye(e,t),t.addFolder("Export").add({export:async()=>{let s=await e.getCurrentSceneGLTF({binary:!0}),a=new Blob([s],{type:"application/octet-stream"});var l=document.createElement("a");document.body.appendChild(l),l.style.display="none";let p=window.URL.createObjectURL(a);l.href=p,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(p)}},"export");let o=t.addFolder("Camera"),i={get bearing(){return e.camera.bearing},set bearing(s){e.camera.setBearing(s)},get pitch(){return e.camera.pitch},set pitch(s){e.camera.setPitch(s)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(s){e.camera.setZoomLevel(s)}};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)}function Gye(e,t){let r=t;return function n(o,i){let s=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 a={get height(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(o,{height:l})},set flipImageToFaceCamera(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="image"&&e.setState(o,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){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:l})},get visible(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?l.visible:!1},set outline(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(o,{outline:l})},get outline(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(p,{opacity:l})},get color(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?Te(l.color).toHexString():"#ffffff"},set color(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry"&&e.setState(p,{color:l})},set interactive(l){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:l}),r.controllersRecursive().forEach(u=>u.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"?l.interactive:!1},get completeFraction(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="path"&&e.setState(p,{completeFraction:l})},focus:()=>{}};s.add(a,"focus").onChange(()=>{let l=e.getState(o.id);(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?e.camera.focusOn([l.position]):(l==null?void 0:l.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(l))}),s.add(a,"visible"),o.type==="image"?s.add(a,"flipImageToFaceCamera"):(s.add(a,"interactive"),o.type==="path"&&s.add(a,"completeFraction",0,1,.1),o.type!=="model"&&(s.addColor(a,"color"),s.add(a,"outline"))),o.type==="geometry"&&(s.add(a,"height"),s.add(a,"opacity",0,1,.1))}else if(o.type==="marker"){let a={get interactive(){var p;let l=e.getState(o.id);return(l==null?void 0:l.type)==="marker"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="marker"&&(e.setState(p,{options:{interactive:l}}),r.controllersRecursive().forEach(u=>u.updateDisplay()))},focus:()=>{}};s.add(a,"focus").onChange(()=>{let l=e.getState(o.id);(l==null?void 0:l.type)==="marker"&&e.camera.focusOn([l.position])}),s.add(a,"interactive")}else if(o.type==="label"){let a={get interactive(){var p;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&(e.setState(p,{options:{interactive:l}}),r.controllersRecursive().forEach(u=>u.updateDisplay()))},get text(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:l})},get"Text Color"(){var p,u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(u=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:u.foregroundColor:"#000000"},set"Text Color"(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(o.id,{text:a.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var p,u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(u=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:u.size:10},set"Text Size"(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:a.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var p,u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(u=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:u.iconSize:10},set"Icon Size"(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:a.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var p,u,m;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(u=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:u.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(l){var u,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:a.text,options:{appearance:{marker:{foregroundColor:L(T({},(m=(u=p.options.appearance)==null?void 0:u.marker)==null?void 0:m.foregroundColor),{active:l})}}}})},get"Inactive Foreground Color"(){var p,u,m;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(u=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:u.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(l){var u,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:a.text,options:{appearance:{marker:{foregroundColor:L(T({},(m=(u=p.options.appearance)==null?void 0:u.marker)==null?void 0:m.foregroundColor),{inactive:l})}}}})},get"Active Background Color"(){var p,u,m;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(u=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:u.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(l){var u,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:a.text,options:{appearance:{marker:{backgroundColor:L(T({},(m=(u=p.options.appearance)==null?void 0:u.marker)==null?void 0:m.backgroundColor),{active:l})}}}})},get"Inactive Background Color"(){var p,u,m;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(u=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:u.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(l){var u,m;let p=e.getState(o.id);(p==null?void 0:p.type)==="label"&&e.setState(p,{text:a.text,options:{appearance:{marker:{backgroundColor:L(T({},(m=(u=p.options.appearance)==null?void 0:u.marker)==null?void 0:m.backgroundColor),{inactive:l})}}}})},focus:()=>{}};s.add(a,"focus").onChange(()=>{let l=e.getState(o.id);(l==null?void 0:l.type)==="label"&&e.camera.focusOn([l.position])}),s.add(a,"interactive"),s.add(a,"text"),s.add(a,"Text Size",10,50),s.add(a,"Icon Size",10,50),s.addColor(a,"Text Color"),s.addColor(a,"Active Background Color"),s.addColor(a,"Inactive Background Color"),s.addColor(a,"Active Foreground Color"),s.addColor(a,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let a={get opacity(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{opacity:l})},set visible(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{visible:l})},get visible(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(o,{outline:l})},get outline(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&(e.setState(o,{interactive:l}),r.controllersRecursive().forEach(u=>u.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var p,u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(u=(p=l.shading)==null?void 0:p.start)!=null?u:0},set shadingStart(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{start:l}})},get shadingEnd(){var p,u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(u=(p=l.shading)==null?void 0:p.end)!=null?u:0},set shadingEnd(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{end:l}})},get shadingIntensity(){var p,u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(u=(p=l.shading)==null?void 0:p.intensity)!=null?u:0},set shadingIntensity(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&e.setState(p,{shading:{intensity:l}})}};s.add(a,"visible"),s.add(a,"opacity",0,1,.1),s.add(a,"interactive"),s.add(a,"outline"),s.add(a,"shadingStart",0,1,.1),s.add(a,"shadingEnd",0,1,.1),s.add(a,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let a={set visible(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="group-container"&&e.setState(o,{visible:l})},get visible(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let p=e.getState(o.id);(p==null?void 0:p.type)==="group-container"&&(e.setState(p,{interactive:l}),r.controllersRecursive().forEach(u=>u.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};s.add(a,"visible"),s.add(a,"interactive")}if(s.close(),o.children)for(let a of o.children.values())n(a,s)}}function Uye(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)})}var WG="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",Vye="https://auth.mappedin.com/oauth2/token";async function ZG(e,t){var r,n,o,i,s,a;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:l,MercatorCoordinate:p}=await import("./outdoor-context-v4-IEFB4X2Q.js"),u=t.outdoorView.headers;u==null&&(u=await EM(Vye));let m=t.center||[0,0],h=new l({container:e,style:t.outdoorView.style||WG,center:m,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:l4,pitch:(o=t.pitch)!=null?o:s4,bearing:(i=t.bearing)!=null?i:a4,transformRequest:PM(u),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:pd(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=h.painter.context.gl,v=new o1(e,{center:m,zoomLevel:h.getZoom(),pitch:h.getPitch(),bearing:h.getBearing(),gl:g,map:h,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(s=t.naturalBearing)!=null?s:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError,useStandaloneCamera:(a=t.useStandaloneCamera)!=null?a:!1}),I={center:h.getCenter().toArray(),zoom:h.getZoom(),bearing:h.getBearing(),pitch:h.getPitch()};h.setMinZoom(v.camera.minZoomLevel),h.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",E=>{I.center=E.center,I.zoom=E.zoomLevel,I.bearing=E.bearing,I.pitch=E.pitch,h.jumpTo(I)});let b=p.fromLngLat(m,0),C=Sb(b,v.viewCamera,v.camera,()=>{v.renderSync()});h.on("style.load",async()=>{h&&(h.addLayer(C),v.renderSync())});let P=!1,w=!1;h.on("idle",()=>{h&&(P||(v.publish("outdoor-view-loaded"),P=!0),w||(w=!0,v.publish("outdoor-style-loaded")))});let M=E=>{E&&(E.sourceDataType==="metadata"||E.sourceDataType==="visibility"||E.dataType==="style"||E.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(h)};return h.on("styledata",E=>{h&&E&&E.dataType==="style"&&E.type==="styledata"&&(w=!1),M(E)}),h.on("sourcedata",M),h.on("terrain",M),h.on("error",E=>{var B;if(((B=E.error)==null?void 0:B.url)===WG){V.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}V.warn(E)}),v}else return new o1(e,t)}d();d();d();var lv=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(lv||{}),cv=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(cv||{});d();d();var i1=class i1{constructor(t,r,n){f(this,"id");f(this,"text");f(this,"target");f(this,"__type",i1.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===i1.__type}get focusTarget(){return this.target.anchorTarget}};f(i1,"__type","Label");var Lc=i1;d();var zu,s1=class s1{constructor(t,r,n){f(this,"id");O(this,zu);f(this,"__type",s1.__type);f(this,"contentEl");this.id=t,this.contentEl=r,k(this,zu,n)}get target(){return c(this,zu)}get coordinate(){return c(this,zu).anchorTarget}static is(t){return t.__type===s1.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){k(this,zu,t)}};zu=new WeakMap,f(s1,"__type","Marker");var hl=s1;d();var c1,p1,a1=class a1{constructor(t,r,n){O(this,c1);O(this,p1);f(this,"target");f(this,"__type",a1.__type);k(this,c1,t),k(this,p1,r),this.target=n}static is(t){return t.__type===a1.__type}get id(){return c(this,c1)}get url(){return c(this,p1)}};c1=new WeakMap,p1=new WeakMap,f(a1,"__type","Image");var l1=a1;d();var Mm,u1=class u1{constructor(t,r,n){f(this,"id");f(this,"groupId");f(this,"__type",u1.__type);O(this,Mm);this.id=t,this.groupId=r,k(this,Mm,n)}get target(){return c(this,Mm)}static is(t){return t.__type===u1.__type}updateTarget(t){k(this,Mm,t)}};Mm=new WeakMap,f(u1,"__type","Model");var Hu=u1;d();var d1=class d1{constructor(t,r){f(this,"id");f(this,"coordinates");f(this,"__type",d1.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===d1.__type}get focusTarget(){return this.coordinates}};f(d1,"__type","PathSegment");var Om=d1,f1=class f1{constructor(t,r,n,o){f(this,"id");f(this,"animation");f(this,"coordinates");f(this,"segments");f(this,"__type",f1.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=o.map(({id:i,coordinates:s})=>new Om(i.toString(),s))}static is(t){return t.__type===f1.__type}get focusTarget(){return this.coordinates}};f(f1,"__type","Path");var Ki=f1;d();var Rc,m1=class{constructor(t){O(this,Rc);k(this,Rc,t)}get center(){return c(this,Rc).center}get bearing(){return c(this,Rc).bearing}get pitch(){return c(this,Rc).pitch}get zoomLevel(){return c(this,Rc).zoomLevel}};Rc=new WeakMap;d();var h1=class h1{constructor(t){f(this,"id");f(this,"__type",h1.__type);this.id=t}static is(t){return t.__type===h1.__type}get focusTarget(){return this}};f(h1,"__type","Shape");var Nc=h1;d();var Z2=class Z2{constructor(t,r){f(this,"id");f(this,"target");f(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===Z2.__type}};f(Z2,"__type","Text3D");var Bc=Z2;d();d();d();var zye=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>']]),Hye=/<svg([^>]*)>/g;function qG(e,t,r){let n=zye.get(e);return n?n.replace(Hye,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}var Wye=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 '),Zye=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 '),c4="#722ED1",p4="#1890FF",XG=({type:e="departure",color:t=p4})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?Wye(t):Zye(t),"\n </div>"),qye=e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},YG=({type:e="stairs",color:t=c4,direction:r="up"})=>{let n=qye("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(qG("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>")};d();var KG=async e=>new Promise(t=>setTimeout(t,e));var Xye={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},Yye={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},$c={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:Xye,inactivePathOptions:Yye,markerOptions:{departureColor:p4,destinationColor:c4},animatePathDrawing:!0},yl,Ji,gl,ut,g1,bl,Wu,Nr,Qi,xo,es,jc,wr,JG,QG,u4,q2,Em,d4,_m,y1=class{constructor(t,r,n){O(this,wr);O(this,yl,new Map);O(this,Ji);O(this,gl);O(this,ut,$c);O(this,g1);O(this,bl);O(this,Wu);O(this,Nr,[]);O(this,Qi);O(this,xo,new Map);O(this,es,new Map);O(this,jc,new Map);O(this,_m,t=>{var r;if((r=c(this,ut).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=c(this,yl).get(t.markers[0]);n!=null&&n.action.toFloor&&(c(this,ut).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}))}});k(this,Ji,t),k(this,g1,n),k(this,gl,r)}get currentMap(){return c(this,g1).call(this)}get isMultiFloor(){if(!c(this,Nr).length)return!1;let t=new Set;for(let r of c(this,Nr))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return c(this,xo).get(t)}getMarkerById(t){return c(this,yl).get(t)}get paths(){let t=new Set;return c(this,xo).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return c(this,jc).get(c(this,Qi))}get activePath(){var t;if(c(this,Qi))return(t=c(this,xo).get(c(this,Qi).id))==null?void 0:t.path}get floorStacks(){let t=c(this,gl).getMapData();if(!c(this,Nr).length||!t)return[];let r=new Set;for(let n of c(this,Nr))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=c(this,gl).getMapData();if(!c(this,Nr).length||!t)return[];let r=new Set;for(let n of c(this,Nr))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=c(this,Nr)[t];if(!c(this,Nr).length){V.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!c(this,Nr)[t]){V.warn("Direction #".concat(t," does not exist"));return}let n=c(this,es).get(r);if(!n){V.warn("The direction is not a part of muli-direcional path");return}ee(this,wr,q2).call(this,n)}setActivePath(t){if(!c(this,Nr).length){V.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!c(this,jc).get(t)){V.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}ee(this,wr,q2).call(this,t)}setActivePathByDirections(t){if(!c(this,Nr).length){V.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=c(this,es).get(t);if(!r){V.warn("The direction is not a part of muli-direcional path");return}ee(this,wr,q2).call(this,r)}drawSync(t,r={}){var a,l,p;c(this,Wu)&&this.clear(),k(this,Wu,!0),ee(this,wr,u4).call(this,r);let n=Array.isArray(t)?t:[t],o=n[0],i=n[n.length-1],s=o.coordinates[0];k(this,Nr,n),s.floorId&&c(this,ut).setMapToDeparture&&this.currentMap.setFloor(s.floorId),(a=c(this,ut).createMarkers)!=null&&a.departure&&ee(this,wr,Em).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let u=0;u<n.length;u++){let m=n[u],h=u?T({},c(this,ut).inactivePathOptions):T({},c(this,ut).pathOptions);if(m.coordinates.length<2){V.warn("Directions must have at least 2 coordinates");return}let g=this.currentMap.Paths.add(m.coordinates,L(T({},h),{animateDrawing:c(this,ut).animatePathDrawing})),v=g.paths.map(b=>b.id.toString()),I=new Ki(kt(),g.animation,m.coordinates,g.paths);for(let b of v){c(this,xo).set(b,{path:I,entityIds:v});let C=u?L(T({},c(this,ut).inactivePathOptions),{altitude:0}):L(T({},c(this,ut).pathOptions),{altitude:.05});c(this,Ji).setState(b,C)}c(this,xo).set(I.id,{path:I,entityIds:v}),c(this,es).set(m,I),c(this,jc).set(I,m),(l=c(this,ut).createMarkers)!=null&&l.connection&&ee(this,wr,d4).call(this,m.instructions,"connection"),u===0&&(k(this,Qi,c(this,es).get(c(this,Nr)[0])),c(this,Ji).on("click",c(this,_m)))}(p=c(this,ut).createMarkers)!=null&&p.destination&&ee(this,wr,Em).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),c(this,gl).mapObjects.forEach(u=>{u.processFloorChange(u.currentFloorId)})}async draw(t,r={}){c(this,bl)&&this.clear(),ee(this,wr,u4).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0].coordinates[0];return k(this,Nr,n),i.floorId&&c(this,ut).setMapToDeparture&&this.currentMap.setFloor(i.floorId),ee(this,wr,QG).call(this,n)}clear(){c(this,yl).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),c(this,yl).clear(),c(this,xo).forEach(({path:t,entityIds:r})=>{c(this,xo).delete(t.id),r.forEach(n=>c(this,xo).delete(n)),this.currentMap.Paths.remove(r)}),c(this,bl)&&(c(this,bl).cancel(),k(this,bl,void 0)),c(this,Wu)&&k(this,Wu,!1),k(this,Nr,[]),c(this,es).clear(),c(this,jc).clear(),k(this,Qi,void 0),c(this,Ji).off("click",c(this,_m)),c(this,gl).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};yl=new WeakMap,Ji=new WeakMap,gl=new WeakMap,ut=new WeakMap,g1=new WeakMap,bl=new WeakMap,Wu=new WeakMap,Nr=new WeakMap,Qi=new WeakMap,xo=new WeakMap,es=new WeakMap,jc=new WeakMap,wr=new WeakSet,JG=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},QG=function(t){let r=t[0],n=t[t.length-1],o=!1;return k(this,bl,{promise:new Promise(async i=>{var s,a,l;if(x.env.NODE_ENV!=="test"&&await KG(500),o||!t.length){i();return}(s=c(this,ut).createMarkers)!=null&&s.departure&&ee(this,wr,Em).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let p=0;p<t.length;p++){let u=t[p],m=p?T({},c(this,ut).inactivePathOptions):T({},c(this,ut).pathOptions);if(u.coordinates.length<2){V.warn("Directions must have at least 2 coordinates"),i();return}let h=this.currentMap.Paths.add(u.coordinates,L(T({},m),{animateDrawing:c(this,ut).animatePathDrawing})),g=h.paths.map(I=>I.id.toString()),v=new Ki(kt(),h.animation,u.coordinates,h.paths);for(let I of g){c(this,xo).set(I,{path:v,entityIds:g});let b=p?L(T({},c(this,ut).inactivePathOptions),{altitude:0}):L(T({},c(this,ut).pathOptions),{altitude:.05});c(this,Ji).setState(I,b)}if(c(this,xo).set(v.id,{path:v,entityIds:g}),c(this,es).set(u,v),c(this,jc).set(v,u),x.env.NODE_ENV!=="test"&&await h.animation,o){i();return}(a=c(this,ut).createMarkers)!=null&&a.connection&&ee(this,wr,d4).call(this,u.instructions,"connection"),p===0&&(k(this,Qi,c(this,es).get(c(this,Nr)[0])),c(this,Ji).on("click",c(this,_m)))}if((l=c(this,ut).createMarkers)!=null&&l.destination&&ee(this,wr,Em).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),o){i();return}c(this,gl).mapObjects.forEach(p=>{p.processFloorChange(p.currentFloorId)}),i()}),cancel:()=>{o=!0}}),c(this,bl).promise},u4=function(t){var r,n,o;k(this,ut,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:$c.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:$c.setMapToDeparture,pathOptions:T(T({},$c.pathOptions),t.pathOptions),inactivePathOptions:T(T({},$c.inactivePathOptions),t.inactivePathOptions),createMarkers:T(T({},$c.createMarkers),t.createMarkers),markerOptions:T(T({},$c.markerOptions),t.markerOptions),animatePathDrawing:(o=t.animatePathDrawing)!=null?o:$c.animatePathDrawing})},q2=function(t){k(this,Qi,t),c(this,Nr).forEach(r=>{let n=c(this,es).get(r);if(n){let o=c(this,xo).get(n.id),i=o.path.id===c(this,Qi).id?L(T({},c(this,ut).pathOptions),{altitude:.05}):L(T({},c(this,ut).inactivePathOptions),{altitude:0});o.entityIds.forEach(s=>{c(this,Ji).setState(s,i)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},Em=function(t,r,n){var o,i,s,a,l;if(r==="connection"&&n){let p=n.action.type==="ExitConnection"?c(this,ut).markerOptions.departureColor:c(this,ut).markerOptions.destinationColor,u;if(typeof((o=c(this,ut).createMarkers)==null?void 0:o.connection)=="function"){let h=c(this,ut).createMarkers.connection(n);c(this,Ji).setState(h.id.toString(),{options:{interactive:!0}}),u={id:h.id,type:"marker"}}else u=this.currentMap.Markers.add(n.coordinate,YG({type:(s=(i=n.action.connection)==null?void 0:i.type)!=null?s:n.action.connectionType,color:p,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(u.id.toString());if(!m)throw new Error("marker component should exist");c(this,yl).set(u.id,{instruction:n,marker:new hl(u.id.toString(),m,n.coordinate)})}else{let p=r==="departure"?c(this,ut).markerOptions.departureColor:c(this,ut).markerOptions.destinationColor,u;typeof((a=c(this,ut).createMarkers)==null?void 0:a.departure)=="function"&&r==="departure"?u={id:c(this,ut).createMarkers.departure(n).id,type:"marker"}:typeof((l=c(this,ut).createMarkers)==null?void 0:l.destination)=="function"&&r==="destination"?u={id:c(this,ut).createMarkers.destination(n).id,type:"marker"}:u=this.currentMap.Markers.add(t,XG({type:r,color:p}),{anchor:"top",rank:"always-visible"}),c(this,yl).set(u.id,void 0)}},d4=function(t,r){t.filter(o=>ee(this,wr,JG).call(this,o.action)).forEach(o=>{ee(this,wr,Em).call(this,o.coordinate,r,o)})},_m=new WeakMap;d();d();d();var Kye=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>']]),Jye=/<svg([^>]*)>/g;function eU(e,t,r){let n=Kye.get(e);return n?n.replace(Jye,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}var Zu,km,vo,f4,tU,rU,m4,nU,X2=class{constructor(t,r){O(this,vo);O(this,Zu);O(this,km);f(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});k(this,Zu,t),k(this,km,r)}auto(){let t=[],r=c(this,km)[Object.keys(c(this,km))[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 s=c(this,Zu).Labels.add(o,i,ee(this,vo,f4).call(this,n));t.push(s)}});else{n.__type==="space"&&n.name!==""&&c(this,Zu).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let o=n.name;if(o){let i=c(this,Zu).Labels.add(n,o,ee(this,vo,f4).call(this,n));t.push(i)}}}),{labels:t}}};Zu=new WeakMap,km=new WeakMap,vo=new WeakSet,f4=function(t){let r=eU(ee(this,vo,tU).call(this,t),"white",12);return{appearance:{text:{foregroundColor:ee(this,vo,m4).call(this,t)},marker:{foregroundColor:{active:ee(this,vo,m4).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:ee(this,vo,nU).call(this,t)}},tU=function(t){return t.__type==="connection"?ee(this,vo,rU).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},rU=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},m4=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},nU=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var Y2=class{constructor(t,r){f(this,"Labels");f(this,"auto",()=>this.Labels.auto());this.Labels=new X2(t,r)}};d();var Ue,x1,xl,K2,h4,b1=class{constructor(t){O(this,xl);O(this,Ue);O(this,x1);f(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(c(this,Ue).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(c(this,Ue).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(c(this,Ue).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{c(this,Ue).getSystems().cameraSystem.enablePan=!0,c(this,Ue).getSystems().cameraSystem.enableZoom=!0,c(this,Ue).getSystems().cameraSystem.enableRotate=!0},disable:()=>{c(this,Ue).getSystems().cameraSystem.enablePan=!1,c(this,Ue).getSystems().cameraSystem.enableZoom=!1,c(this,Ue).getSystems().cameraSystem.enableRotate=!1}});f(this,"setMinPitch",t=>{c(this,Ue).camera.setMinPitch(t)});f(this,"setMaxPitch",t=>{c(this,Ue).camera.setMaxPitch(t)});f(this,"setMinZoomLevel",t=>{c(this,Ue).camera.setMinZoomLevel(t,!0)});f(this,"setMaxZoomLevel",t=>{c(this,Ue).camera.setMaxZoomLevel(t)});k(this,x1,t),k(this,Ue,t.core)}setScreenOffsets(t){c(this,Ue).camera.setInsetPadding(t)}get screenOffsets(){return c(this,Ue).camera.insetsPadding}get panMode(){return c(this,Ue).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&c(this,Ue).camera.setPanMode(t)}getFocusOnTransform(t,r){var o;let n=c(this,Ue).camera.getCameraFrameForCoordinates(ee(this,xl,h4).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(o=r==null?void 0:r.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new $e(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return c(this,Ue).camera.focusOn(ee(this,xl,h4).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 l;let{center:n,zoomLevel:o,bearing:i,pitch:s}=t,a=n!=null?n:this.center;return c(this,Ue).camera.animateTo({center:n!=null?[a.longitude,a.latitude,c(this,Ue).camera.elevation]:void 0,zoomLevel:o,bearing:i,pitch:s,duration:(l=r==null?void 0:r.duration)!=null?l: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,s=[r.longitude,r.latitude];c(this,Ue).camera.setCenter(s),c(this,Ue).camera.setZoomLevel(n),c(this,Ue).camera.setBearing(o),c(this,Ue).camera.setPitch(i)}get center(){let t=c(this,Ue).camera.center;return new $e(t[1],t[0],void 0)}setAutoMinZoomLevel(t){c(this,Ue).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return c(this,Ue).camera.autoMinZoomLevel}get zoomLevel(){return c(this,Ue).camera.zoomLevel}get pitch(){return c(this,Ue).camera.pitch}get minPitch(){return c(this,Ue).camera.minPitch}get maxPitch(){return c(this,Ue).camera.maxPitch}get bearing(){let t=c(this,Ue).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return c(this,Ue).camera.minZoomLevel}get maxZoomLevel(){return c(this,Ue).camera.maxZoomLevel}setElevation(t){c(this,Ue).camera.setElevation(t)}get elevation(){return c(this,Ue).camera.elevation}animateElevation(t,r){return c(this,Ue).camera.animateElevation(t,r)}updateFacadesInView(){c(this,Ue).getSystems().geometryInFocusSystem.raycast()}};Ue=new WeakMap,x1=new WeakMap,xl=new WeakSet,K2=function(t){var n,o,i,s,a,l;let r=c(this,Ue).camera.elevation;return $e.is(t)&&t.floorId!=null?(o=(n=c(this,Ue).getState(t.floorId))==null?void 0:n.altitude)!=null?o:r:fo.is(t)?(s=(i=c(this,Ue).getState(t.id))==null?void 0:i.altitude)!=null?s:r:"floor"in t&&fo.is(t.floor)&&(l=(a=c(this,Ue).getState(t.floor.id))==null?void 0:a.altitude)!=null?l:r},h4=function(t){var i;let r=[],o=(Array.isArray(t)?t:[t]).flatMap(s=>{var a;return(a=s==null?void 0:s.focusTarget)!=null?a:[s]});for(let s of o)if(s!=null)if($e.is(s)){let a=ee(this,xl,K2).call(this,s);r.push([s.longitude,s.latitude,a])}else if((s==null?void 0:s.id)!=null){let a=ee(this,xl,K2).call(this,s);if(fo.is(s)&&((i=c(this,x1).getMapDataInternal())!=null&&i.enterpriseMode)){r.push(s.id);continue}else if("geoJSON"in s&&s.geoJSON.geometry.coordinates.length>0){mM(s.geoJSON,p=>{r.push([p[0],p[1],a])});continue}let l=c(this,Ue).getBoundingArea(s.id);if(l)r.push(...l.map(p=>[p[0],p[1],a]));else if("geoJSONBoundingBox"in s){let p=ee(this,xl,K2).call(this,s);if(s.geoJSONBoundingBox!=null){let u=[[s.geoJSONBoundingBox[0],s.geoJSONBoundingBox[1],p],[s.geoJSONBoundingBox[2],s.geoJSONBoundingBox[3],p]];r.push(...u)}}}else sP(s)&&r.push(s);return r};d();var Am,v1=class{constructor({currentMapGetter:t}){O(this,Am);k(this,Am,t)}get currentMap(){return c(this,Am).call(this)}async getCurrentSceneGLTF(t){let r=c(this,Am).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(V.error("There is no map to export. Please load a map first."),new Blob)}};Am=new WeakMap;d();var ia,S1,I1=class{constructor({currentMapGetter:t}){O(this,ia,new Map);O(this,S1);k(this,S1,t)}get currentMap(){return c(this,S1).call(this)}getById(t){return c(this,ia).get(t)}add(t,r,n){let o=t.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Labels.add(o,r,L(T({},n),{attachTo:jf(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),a=new Lc(s.id.toString(),r,t);return c(this,ia).set(a.id,{label:a,entityId:a.id}),a}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:(o,i,s)=>{let a=new Lc(o.toString(),i,s);c(this,ia).set(a.id,{label:a,entityId:a.id}),r.push(a)},labelOptions:t}),r}remove(t){var n;let r=c(this,ia).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),c(this,ia).delete(t.id.toString()))}removeAll(){let t=[];return c(this,ia).forEach(({label:r})=>{this.remove(r),t.push(r),c(this,ia).delete(r.id.toString())}),t}};ia=new WeakMap,S1=new WeakMap;d();d();var y4={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},oU={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},iU=.5,vl=class{constructor(t,r,n=new Map){f(this,"containerId");f(this,"layers");f(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})}},qu,C1=class{constructor(t,r,n,o,i,s,a,l){f(this,"id");f(this,"name");f(this,"elevation");f(this,"containerId");f(this,"externalId");f(this,"metadata");f(this,"shortName");f(this,"subtitle");f(this,"occluderId");f(this,"loaded",!1);f(this,"styleMap",{});f(this,"obstructions");f(this,"entrances");f(this,"spaces");f(this,"floorImages");f(this,"floorText");f(this,"renderer");f(this,"options");f(this,"layers",new Map);f(this,"footprint");f(this,"floorStackId");f(this,"multiFloorView");f(this,"mapDataInternal");f(this,"facadesByStyleId",new Map);O(this,qu);f(this,"load",()=>{var o,i,s,a,l,p,u,m,h,g,v,I,b,C;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Ya,"-").concat(this.id),{},this.id);this.layers.set(Ya,new vl(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(Vs,"-").concat(this.id),{},this.id);this.layers.set(Vs,new vl(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Er,"-").concat(this.id),{},this.id);if(this.layers.set(Er,new vl(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 P=y4;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&&(P=this.styleMap[(s=E[0].properties)==null?void 0:s.id])}let w=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},L(T({},P),{height:(l=(a=this.multiFloorView)==null?void 0:a.floorHeight)!=null?l:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":P.color,renderOrder:2}),this.id);this.layers.set(My,new vl(this.renderer,w.id.toString()));let M=this.renderer.addGroupContainer("".concat(Df,"-").concat(this.id),{},this.id);this.layers.set(Df,new vl(this.renderer,M.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,M.id)}if(this.spaces!=null&&this.spaces.features.length>0){let P=[],w=new Map;this.spaces.features.filter($=>{var D;return $.geometry.type==="Polygon"&&((D=$.properties.kind)==null?void 0:D.toLowerCase())!=="void"}).forEach($=>{var F;let D=(F=this.mapDataInternal)==null?void 0:F.facadesBySpaceId[$.properties.id];if(D){let W=w.get(D.id)||[];w.set(D.id,[...W,$])}else P.push($)});let M=sv(P,this.styleMap),E=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),B=0;for(let[$,D]of M){let F=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(B),{features:D},$f($,this.options),E);B++;let W=E.id.toString();this.layers.get(Er).layers.set($.id||W,F.id.toString())}if(w.size>0){let $=this.renderer.addGroupContainer("".concat(Hp,"-").concat(this.id),{},this.id);this.layers.set(Hp,new vl(this.renderer,$.id.toString()));for(let[D,F]of w){let W=this.renderer.addGroupContainer(D,{focusable:!0},$),G=this.renderer.addGroupContainer("".concat(D,"-geometry"),{},W),U=sv(F,this.styleMap),J=0;for(let[X,ie]of U){let te=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(D,"-").concat(J),{features:ie},L(T({},$f(X,this.options)),{renderOrder:3}),G);J++;let xe=X.id||te.id.toString();this.layers.get(Hp).layers.set("".concat(D,"-").concat(xe),te.id.toString()),this.facadesByStyleId.has(xe)?(p=this.facadesByStyleId.get(xe))==null||p.push(D):this.facadesByStyleId.set(xe,[D])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let P=this.obstructions.features.filter(G=>G.geometry.type==="Polygon"&&G.properties.kind==="object"),w=sv(P,this.styleMap),M=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),E=0;for(let[G,U]of w){let J=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(E),{features:U},$f(G,this.options),M);E++;let X=M.id.toString();this.layers.get(Er).layers.set(G.id||X,J.id.toString())}let B=this.obstructions.features.filter(G=>G.geometry.type==="LineString"&&G.properties.kind==="Wall"&&G.properties.footprintComponent===!1),$=this.obstructions.features.filter(G=>G.geometry.type==="LineString"&&G.properties.kind==="Wall"&&G.properties.footprintComponent===!0),D=this.entrances,F=y4,W=y4;if(B!=null&&B.length>0){let G=this.styleMap[(u=B[0].properties)==null?void 0:u.id];G!=null&&(F=T({},G)),W=F;let{walls:U,entrances:J}=kP(B,(D==null?void 0:D.features)||[]),X=Math.max(F.height-.11,iU),ie=L(T({},oU),{height:X}),te=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),J,ie,n);this.layers.get(Er).layers.set(kf,te.id.toString());let xe=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[U]},$f(F,this.options),n);this.layers.get(Er).layers.set(pc,xe.id.toString())}if($!=null&&$.length>0){let G=this.styleMap[(m=$[0].properties)==null?void 0:m.id];G!=null&&(W=L(T({},G),{id:Us}));let{walls:U,entrances:J}=kP($,(D==null?void 0:D.features)||[]),X=Math.max(W.height-.11,iU),ie=L(T({},oU),{height:X}),te=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),J,ie,n);this.layers.get(Er).layers.set(Af,te.id.toString());let xe=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[U]},$f(W,this.options),n);this.layers.get(Er).layers.set(Us,xe.id.toString())}}if(this.floorImages!=null){let P=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let w of this.floorImages.features||[])"anchorId"in w.properties||"anchorId"in w.properties&&((h=w.properties)==null?void 0:h.anchorId)==null||this.renderer.addImage(kt(),w,{url:w.properties.path,flipImageToFaceCamera:(g=this.options.flipImagesToFaceCamera)!=null?g:!0},P);this.layers.set(EN,new vl(this.renderer,P.id.toString()))}if(this.floorText!=null)for(let P of this.floorText.features||[]){let w=0;"geometryId"in P.properties?w=(I=(v=this.renderer.getState(P.properties.geometryId))==null?void 0:v.height)!=null?I:0:w=(b=P.properties.verticalOffset)!=null?b:0,this.renderer.addText3D(kt(),L(T({},P),{properties:L(T({},P.properties),{verticalOffset:w})}),{},this.id)}return(C=this.multiFloorView)!=null&&C.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this});var u,m,h,g,v;this.id=r.id,this.options=i;let p=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(u=i.preloadFloors)==null?void 0:u.map(I=>I.id).includes(r.id)},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,s!=null&&a!=null&&(this.styleMap=a,this.spaces=s.space[this.id],this.entrances=s.entrance[this.id],this.obstructions=s.obstruction[this.id],this.floorImages=(m=s.floorImages)==null?void 0:m[this.id],this.floorText=(g=(h=s.enterprise)==null?void 0:h.floorText)==null?void 0:g[this.id],this.footprint=(v=s["floor.geojson"])==null?void 0:v.features.find(I=>I.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=o,this.mapDataInternal=l}get geoJSONBoundingBox(){if(c(this,qu))return c(this,qu);if(!this.footprint){V.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return k(this,qu,av(this.footprint)),c(this,qu)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};qu=new WeakMap;d();var b4=50,x4=!1,Qye=1e3,mr,Dm,sa,ts,xn,P1,Uc,Fm,Xu,Io,I4,Yu,w1,M1,O1,E1,Il,cU,_1,Vc,S4,pU,uU,Ku,T1=class extends Ne{constructor({currentMapGetter:r}){super();O(this,Io);O(this,mr);O(this,Dm,0);O(this,sa);O(this,ts,!1);O(this,xn,[]);O(this,P1,0);O(this,Uc,b4);O(this,Fm,!1);O(this,Xu,"collapsed");f(this,"expandedFactor",0);O(this,Yu,"all-floors");O(this,w1,()=>{let r=c(this,mr).call(this);if(c(this,P1)===this.expandedFactor||r==null||!c(this,ts))return;k(this,P1,this.expandedFactor);let n=Bo(this.expandedFactor,0,1,0,this.distanceBetweenFloors),i=Bo(this.expandedFactor,0,.1,0,1)===0;c(this,xn).forEach((s,a)=>{r.api.updateState(s.containerId,{visible:i?s.id===r.currentFloorId:!0,altitude:n*a})}),this.expandedFactor===0?(k(this,ts,!1),r.renderer.camera.setPanMode("default"),c(this,Vc)&&c(this,Vc).call(this)):this.expandedFactor===1&&(k(this,ts,!1),c(this,Vc)&&c(this,Vc).call(this))});O(this,M1,()=>{var r,n,o;this.expanded&&k(this,Dm,(n=(r=c(this,mr).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(o=c(this,mr).call(this))==null||o.renderer.on("user-interaction-end",c(this,E1))});O(this,O1,()=>{var n;let r=c(this,mr).call(this);if(r!=null&&this.expanded&&c(this,Fm)&&!c(this,ts)){let o=r.currentFloorId,i=[1/0,r.currentFloorId];for(let s=0;s<c(this,xn).length;s++){let a=c(this,xn)[s],l=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-s*this.distanceBetweenFloors);l<this.distanceBetweenFloors/3&&(i[0]=l,i[1]=a.id)}i[1]!==r.currentFloorId&&(r.currentFloorId=i[1],c(this,xn).forEach(s=>{r.api.updateState(s.containerId,{visible:c(this,Yu)==="all-floors"?!0:r.currentFloor.id===s.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:o}))}});O(this,E1,()=>{var n,o;let r=c(this,mr).call(this);if(this.expanded&&r&&c(this,Dm)!==((n=r.renderer.camera.elevation)!=null?n:0)){let i=[1/0,r.currentFloorId,0];for(let s=0;s<c(this,xn).length;s++){let a=c(this,xn)[s],l=Math.abs(((o=r.renderer.camera.elevation)!=null?o:0)-s*this.distanceBetweenFloors);l<i[0]&&(i[0]=l,i[1]=a.id,i[2]=s*this.distanceBetweenFloors)}c(this,Fm)&&ee(this,Io,cU).call(this,i[2]),k(this,Dm,0),r.renderer.off("user-interaction-end",c(this,E1))}});O(this,Il,null);O(this,_1,null);O(this,Vc);O(this,Ku);k(this,mr,r);let n=c(this,mr).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",c(this,M1)),n.renderer.on("camera-change",c(this,O1)),n.renderer.on("pre-render",c(this,w1)))}get state(){return c(this,Xu)}get expanded(){return c(this,Xu)!=="collapsed"}get distanceBetweenFloors(){if(c(this,Uc)==="auto"){if(c(this,Ku)!=null)return c(this,Ku);let r=ee(this,Io,uU).call(this);if(r)return k(this,Ku,r),r}return typeof c(this,Uc)=="number"?c(this,Uc):b4}clearCachedFloorSeparationDistance(){k(this,Ku,void 0)}get includedFloors(){var r;return(r=c(this,Io,I4))!=null&&r.api.mapData?c(this,xn).map(n=>{var o,i;return(i=(o=c(this,Io,I4))==null?void 0:o.api.mapData)==null?void 0:i.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return c(this,Yu)}setFloorVisiblityMode(r){k(this,Yu,r);let n=c(this,mr).call(this);n!=null&&c(this,xn).forEach(o=>{n.api.updateState(o.containerId,{visible:c(this,Yu)==="all-floors"?!0:n.currentFloor.id===o.id})})}changeFloorOnElevationChanges(r){k(this,Fm,r)}async expand(r){var o,i,s;let n=c(this,mr).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?k(this,Uc,"auto"):k(this,Uc,(o=r==null?void 0:r.distanceBetweenFloors)!=null?o:b4),k(this,xn,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(a=>n.floorsById.get(a.id)).filter(Boolean):n.currentFloorStack.floorObjects),c(this,xn).sort((a,l)=>a.elevation-l.elevation),c(this,xn).length<=1||this.expanded===!0?Promise.resolve():(k(this,ts,!0),n.api.Camera.setPanMode((i=r==null?void 0:r.cameraPanMode)!=null?i:"elevation"),this.changeFloorOnElevationChanges((s=r==null?void 0:r.changeFloorOnElevationChanges)!=null?s:!0),ee(this,Io,S4).call(this,"expand",r).then(()=>{k(this,Xu,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{k(this,ts,!1)}))}async collapse(r){let n=c(this,mr).call(this);if(n!=null)return this.expanded===!0?(k(this,ts,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),ee(this,Io,S4).call(this,"collapse",r).then(()=>{k(this,Xu,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{k(this,ts,!1)})):Promise.resolve()}destroy(){let r=c(this,mr).call(this);r!=null&&(r.renderer.off("user-interaction-start",c(this,M1)),r.renderer.off("camera-change",c(this,O1)),r.renderer.off("pre-render",c(this,w1)))}};mr=new WeakMap,Dm=new WeakMap,sa=new WeakMap,ts=new WeakMap,xn=new WeakMap,P1=new WeakMap,Uc=new WeakMap,Fm=new WeakMap,Xu=new WeakMap,Io=new WeakSet,I4=function(){return c(this,mr).call(this)},Yu=new WeakMap,w1=new WeakMap,M1=new WeakMap,O1=new WeakMap,E1=new WeakMap,Il=new WeakMap,cU=function(r){var o,i,s;c(this,Il)&&c(this,Il).stop();let n=c(this,mr).call(this);n!=null&&(k(this,Il,new bo({elevation:(o=n.renderer.camera.elevation)!=null?o:0}).to({elevation:r},150).easing(kr.Quadratic.Out).onComplete(()=>{var a;c(this,Il)&&((a=c(this,mr).call(this))==null||a.renderer.getTweenGroup().remove(c(this,Il)))}).onUpdate(({elevation:a})=>{n.renderer.camera.setElevation(a)}).start()),(i=c(this,mr).call(this))==null||i.renderer.getTweenGroup().add(c(this,Il)),(s=c(this,mr).call(this))==null||s.renderer.render())},_1=new WeakMap,Vc=new WeakMap,S4=function(r,n){var a,l,p,u;c(this,sa)&&c(this,sa).stop();let o=c(this,mr).call(this);if(o==null)return Promise.reject(new Error("No current map"));let i=c(this,xn).indexOf(o.currentFloor),s=(a=o.renderer.camera.elevation)!=null?a:0;return k(this,_1,new Promise(m=>{k(this,Vc,m)})),k(this,sa,new bo({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(l=n==null?void 0:n.duration)!=null?l:Qye).easing(dl[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m;let h=i*this.distanceBetweenFloors;o.renderer.camera.setElevation(r==="expand"?h*m:s*m)}).onComplete(()=>{var m;c(this,sa)&&((m=c(this,mr).call(this))==null||m.renderer.getTweenGroup().remove(c(this,sa)))}).start()),c(this,sa).cameraAnimation=!0,(p=c(this,mr).call(this))==null||p.renderer.getTweenGroup().add(c(this,sa)),(u=c(this,mr).call(this))==null||u.renderer.render(),c(this,_1)},pU=function(r,n,o,i){let s=v4(r,o),a=n.clone(),l=v4(a,o);if(!Yc(s)||!Yc(l))return-1;let p=0,u;x4&&i.querySelectorAll(".debug-box").forEach(h=>h.remove());do{if(p>1e4)return-1;if(p+=20,a.position.z=p,a.updateMatrixWorld(),l.makeEmpty(),v4(a,o,l),u=s.intersectsBox(l),x4){let m=lU(s,"blue",i),h=lU(l,u?"red":"green",i);m.classList.add("debug-box"),h.classList.add("debug-box")}}while(u);return p},uU=function(){let r=c(this,mr).call(this);if(!r)return;let n=r.renderer,o=n.getThreeScene();if(!r.api.mapData||!o)return;let s=c(this,xn).length>0?c(this,xn):r.currentFloorStack.floorObjects;if(s.length<2)return;let a=n.getInternalState().geometry3DMap.get(s[0].id),l=n.getInternalState().geometry3DMap.get(s[1].id);if(!a||!l)return;if(hI(a,"group-container"),hI(l,"group-container"),x4){let u=new Xr;u.setFromObject(a);let m=new Xr;if(m.setFromObject(l),a.children.forEach(P=>{P instanceof He&&P.userData.debugBox&&fr(P)}),l.children.forEach(P=>{P instanceof He&&P.userData.debugBox&&fr(P)}),!Yc(u)||!Yc(m))return;let h=new xi(u.max.x-u.min.x,u.max.y-u.min.y,u.max.z-u.min.z),g=new Br({color:255,transparent:!0,opacity:.5}),v=new He(h,g);v.position.set((u.min.x+u.max.x)/2,(u.min.y+u.max.y)/2,(u.min.z+u.max.z)/2),v.userData.debugBox=!0;let I=new xi(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),b=new Br({color:"cyan",transparent:!0,opacity:.5}),C=new He(I,b);C.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),C.userData.debugBox=!0,a.add(v),l.add(C)}let p=ee(this,Io,pU).call(this,a,l,n.getThreeCamera(),n.container);if(p!==-1)return p},Ku=new WeakMap;var Gc=new we,sU=new Ae;function v4(e,t,r=new nM){return e.traverse(n=>{if(n instanceof He){let i=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let a=0;a<i.count;a++)Gc.fromBufferAttribute(i,a),Gc.applyMatrix4(n.matrixWorld),Gc.applyMatrix4(t.matrixWorldInverse),Gc.applyMatrix4(t.projectionMatrix),Gc.z<1&&Gc.z>0&&(sU.set(Gc.x,Gc.y),r.expandByPoint(sU))}}),r}function aU(e,t){let r=t.clientWidth,n=t.clientHeight;return new Ae((e.x+1)*r/2,(1-e.y)*n/2)}function lU(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=aU(new Ae(e.min.x,e.min.y),r),i=aU(new Ae(e.max.x,e.max.y),r);n.style.left="".concat(o.x,"px"),n.style.top="".concat(i.y,"px");let s=Math.abs(i.x-o.x),a=Math.abs(i.y-o.y);return n.style.width="".concat(s,"px"),n.style.height="".concat(a,"px"),r.appendChild(n),n}d();d();function ege(e,t){return"".concat(t," ").concat(e)}var Ln=class extends Error{constructor(t,r=L4){super(ege(t,r)),this.name="MappedinError"}};var Lm,k1=class{constructor(t,r,n,o){f(this,"id");f(this,"externalId");f(this,"name");f(this,"type");f(this,"floorIds");f(this,"defaultFloorId");f(this,"floorObjects",[]);f(this,"floorObjectsByElevation",new Map);f(this,"metadata");f(this,"containerId");f(this,"facade");f(this,"renderer");O(this,Lm);var s;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(s=t.floors)!=null?s: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(c(this,Lm)==null){if(this.floorObjects.length===0)throw new Ln("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),k(this,Lm,t)}return c(this,Lm)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){V.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})})}};Lm=new WeakMap;d();function dU(e,t,r,n){let o={outdoorOpacity:1,floorStates:[]},i=e.sort((u,m)=>u.elevation-m.elevation),s=Math.min(0,i[0].elevation),a=i[i.length-1].elevation,l,p;for(let u=s;u<=a;u++){let m=i.find(b=>b.elevation===u);if(m==null){u>=0&&(l==null?l=u:p=u);continue}let h=0,g=u<0?Math.abs(m.elevation)*r:r,v=!1;if(l===0&&p!=null){let b=r*p;h=-b,g=b,v=!0}else if(l!=null&&p!=null){let b=l,C=e.find(w=>w.elevation===b-1),P=o.floorStates.find(w=>w.floor===C);if(P){let w=r*(p-l+2);P.state.footprint=L(T({},P.state.footprint),{altitude:0,height:w,visible:!0})}}l=void 0,p=void 0;let I={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(I),m.id===t.id?(I.state.visible=!0,I.state.geometry.visible=!0,I.state.labels.enabled=!0,I.state.markers.enabled=!0,I.state.occlusion.enabled=!0,(m.elevation<0||v)&&(m.elevation<0&&(o.outdoorOpacity=.2),I.state.footprint.height=g,I.state.footprint.altitude=h,I.state.footprint.visible=!0)):n.includes(m.id)&&m.elevation<t.elevation?(I.state.visible=!0,I.state.geometry.visible=!0,I.state.markers.enabled=!0,I.state.occlusion.enabled=!0,I.state.footprint.visible=!0,m.elevation<0?(I.state.footprint.height=g,I.state.footprint.altitude=h,o.outdoorOpacity=.2):(I.state.footprint.height=g,I.state.footprint.altitude=h)):t.elevation>0&&m.elevation<t.elevation&&m.elevation>=0&&(I.state.visible=!0,I.state.footprint.visible=!0,I.state.footprint.height=r,I.state.footprint.altitude=h)}return o}var tge={linear:kr.Linear.None,easeIn:kr.Quadratic.In,easeOut:kr.Quadratic.Out,easeInOut:kr.Quadratic.InOut},aa,A1=class extends Ne{constructor(r,n,o,i){var p,u,m,h;super();f(this,"floorStacksById",new Map);f(this,"floorsById",new Map);f(this,"currentFloorId","");f(this,"currentFloorStackId","");f(this,"outdoorFloorStacks",new Set);f(this,"id");f(this,"renderer");f(this,"api");f(this,"mvf");f(this,"options",{});f(this,"styleMap");f(this,"StackedMaps");f(this,"animations",new Map);f(this,"Models",{add:(r,n,o)=>{let m=o,{floorId:i,scale:s}=m,a=Bn(m,["floorId","scale"]),l=i?this.floorsById.get(i):this.currentFloor,p=T({},a);s!=null&&(p.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let u=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(h=>{var g;return{type:"Feature",properties:{id:kt(),rotation:o.rotation,scale:p.scale,interactive:o.interactive,verticalOffset:h.verticalOffset+((g=o.verticalOffset)!=null?g:0)},geometry:{type:"Point",coordinates:pi(h)}}})},p,{parent:l.id});if(u==null)throw new Ln("error creating model");return this.renderer.getState(u).children},remove:(r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)}});f(this,"Images",{add:(r,n,o)=>{let u=o,{floorId:i,flipImageToFaceCamera:s}=u,a=Bn(u,["floorId","flipImageToFaceCamera"]),l=i?this.floorsById.get(i):this.currentFloor,p={type:"Feature",properties:a,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(kt(),p,{url:n,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:r=>{this.renderer.remove(r)},removeAll:()=>{}});f(this,"Markers",{add:(r,n,o)=>{let i=FP(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),m=o,{attachTo:s}=m,a=Bn(m,["attachTo"]),l=a;a.rank==="initial"&&(l.rank="medium");let p=i.layers.get(Vs),u=this.renderer.addMarker2D(pi(r),n,L(T({},l),{occluderId:i==null?void 0:i.occluderId,attachTo:s}),p==null?void 0:p.containerId);if(!u)throw new Ln("Failed to create Marker");return u},remove:r=>{this.renderer.remove(r)},getContentEl:r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},removeAll:()=>{},setPosition:(r,n,o)=>{var a;let i=this.renderer.getState(r),s=o?this.floorsById.get(o):this.currentFloor;if(!i){V.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(i.type!=="marker"){V.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(i,{position:n,parent:(a=s==null?void 0:s.layers.get(Vs))==null?void 0:a.containerId})},animateTo:(r,n,o,i)=>{let s=this.renderer.getState(r),a=o?this.floorsById.get(o):this.currentFloor;if(!s)return V.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(s.type!=="marker")return V.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let l=T({duration:1e3,easing:"ease-in-out"},i);this.cancelAnimation(r);let p=new bo({lon:s.position[0],lat:s.position[1]}).to({lon:n[0],lat:n[1]},l.duration).easing(tge[l.easing]).onUpdate(({lon:u,lat:m})=>{var g;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let v=(g=a==null?void 0:a.layers.get(Vs))==null?void 0:g.containerId;v&&this.Markers.setPosition(r,[u,m],v)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(r,p),DP(p).then(()=>{this.animations.delete(r)})}});f(this,"Exporter",{getCurrentSceneGLTF:async r=>this.renderer.getCurrentSceneGLTF(r)});f(this,"Shapes",{add:(r,n,o)=>{let i=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=kt();return this.renderer.addGeometryGroup(s,r,n,i.id),s},remove:r=>(this.renderer.remove(r.id),r.id)});f(this,"Text3D",{label:(r,n,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){V.warn("Enterprise mode is not enabled, skipping label creation");return}let i=fU(this.renderer,r,n,o);if(i)return{textInfo:i,target:r}},labelAll:(r={})=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode))return V.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let o=[];return n.getByType("space").forEach(s=>{var a,l;if(s.locations[0]){let p=fU(this.renderer,s,(l=(a=s.locations[0])==null?void 0:a.name)!=null?l:s.name,r);p&&o.push({textInfo:p,target:s})}}),o},remove:r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){V.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r}});f(this,"Labels",{all:({onCreate:r,labelOptions:n={}})=>{for(let o of Object.entries(this.mvf.space)){let[i,s]=o;s&&s.features.forEach(a=>{var I,b,C,P,w;let l=(I=this.api.getMapData())==null?void 0:I.getById("space",a.properties.id);if(!l)return;let p=(b=this.styleMap[a.properties.id])==null?void 0:b.showImage,u=(C=a.properties.details)==null?void 0:C.images,m=p&&((P=u==null?void 0:u[0])!=null&&P.url)?{icon:u[0].url}:{},h=T({marker:T(T({},m),(w=n.appearance)==null?void 0:w.marker)},n.appearance),v=(i?this.floorsById.get(i):this.currentFloor).layers.get(Ya);if(a.properties.center&&l.name!==""){let M=this.renderer.addLabel2D(a.properties.center,l.name,L(T({id:a.properties.id+"-label"},n),{appearance:h,rank:n.rank,attachTo:jf(l)}),Jr.is(l)?l.id:v==null?void 0:v.containerId);M&&r(M.id,l.name,l)}})}},add:(r,n,o={})=>{let u=o,{attachTo:i}=u,s=Bn(u,["attachTo"]),a=FP(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),l=a.layers.get(Ya),p=this.renderer.addLabel2D(pi(r),n,L(T({},s),{occluderId:a.occluderId,attachTo:i}),l==null?void 0:l.containerId);if(!p)throw new Ln("label creating failed");return p},remove:({entityId:r})=>{this.renderer.remove(r)},removeAll:()=>{}});f(this,"Paths",{add:(r,n)=>{var p;let o=(p=n==null?void 0:n.animateDrawing)!=null?p:!0,i=[],s=r[0].floorId||"root",a=0;for(let u of r){let{floorId:m="root",latitude:h,longitude:g}=u;m!==s&&(a++,s=m),i[a]==null&&i.push({floorId:m,coordinates:[]});let v=m===u.floorId?u:new $e({longitude:g,latitude:h,floorId:m});i[a].coordinates.push(v)}let l=i.reduce((u,{floorId:m,coordinates:h},g)=>{if(g!==0){let I=i[g-1],b=I.coordinates[I.coordinates.length-1],C=h[0],P=pi(b),w=pi(C),M=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:I.floorId},geometry:{type:"Point",coordinates:P}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:w}}]},n,this.id);M&&(n!=null&&n.animateDrawing&&this.renderer.setState(M.id,{completeFraction:0}),u.push(L(T({},M),{coordinates:[b,C]})))}let v=this.renderer.addPath({type:"FeatureCollection",features:h.map(I=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:pi(I)}}))},n,m);return v&&(n!=null&&n.animateDrawing&&this.renderer.setState(v.id,{completeFraction:0}),u.push(L(T({},v),{coordinates:h}))),u},[]);if(o){let u=[],m=this.api.getMapData();return l.forEach(h=>{var v;let g=eB(h,m,this.api);u.push(new bo({fraction:0}).to({fraction:1},g===!1?0:(v=n==null?void 0:n.drawDuration)!=null?v:1500).onUpdate(I=>{this.renderer.setState(h.id,{completeFraction:I.fraction})}))}),u.forEach((h,g)=>{g<u.length-1&&h.chain(u[g+1]),this.renderer.getTweenGroup().add(h)}),u[0].start(),this.renderer.render(),this.animations.set(l[0].id.toString(),u[0]),{paths:l,animation:DP(u[u.length-1]).then(()=>{this.animations.delete(l[0].id.toString())})}}else return{paths:l,animation:Promise.resolve()}},remove:r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})}});O(this,aa,{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 T1({currentMapGetter:()=>this}),this.mvf=(p=n==null?void 0:n.mvf)!=null?p:{};let s=YN(this.mvf["styles.json"]||{});if(this.styleMap=s,k(this,aa,T({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},o==null?void 0:o.multiFloorView)),!n){this.id!=="outdoors-container"&&V.warn("Map (".concat(this.id,") created with no data."));let g=new k1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(g.id,g),this.currentFloorStackId=g.id;let v=new C1(g.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,c(this,aa),o!=null?o:{});g.addFloor(v),this.floorsById.set(v.id,v),this.setFloor(v.id);return}let a=n.getMVFFeatureByType("floor-stack");if(a==null||a.length===0)throw new Ln("MVF does not contain any Floor Stacks.");for(let g of a){let v=new k1(g,this.id,this.renderer,(u=this.mvf.facade)==null?void 0:u[g.id]);if(v.floorIds.length!==0){for(let I of v.floorIds){let b=n.getMVFFeatureById("floor",I);if(b!=null){let C=this.mvf.space[b.id],P=this.mvf.obstruction[b.id];if((C==null||C.features.length===0)&&(P==null||P.features.length===0))continue;let w=new C1(v.id,b,this.renderer,c(this,aa),o!=null?o:{},this.mvf,s,n);v.addFloor(w),this.floorsById.set(w.id,w)}}this.floorStacksById.set(g.id,v),this.currentFloorStackId||(this.currentFloorStackId=g.id)}}for(let[g]of Object.entries(n.facadesBySpaceId)){let v=n.getById("space",g);v&&(this.outdoorFloorStacks.add(v.floor.floorStack.id),(m=this.floorsById.get(v.floor.id))==null||m.setVisible(!0))}let l=(h=this.mvf.enterprise)==null?void 0:h.venue.defaultMap;if(o!=null&&o.initialFloor){let g=by(o.initialFloor);g&&this.floorsById.has(g)?l=g:V.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Ln('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let o=this.floorStacksById.get(r);if(o==null){V.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){V.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(o.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Ln('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var i,s,a,l,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=c(this,aa))!=null&&i.enabled)||n.floorStackId!==(o==null?void 0:o.id))for(let u of this.floorStacksById.values())u.floorObjects.forEach(m=>{m.id!==r&&m.setVisible(!1)});else{let u=dU(this.currentFloorStack.floorObjects,n,c(this,aa).floorHeight,((a=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:a.map(m=>m.id))||[]);(p=(l=this.api)==null?void 0:l.Outdoor)==null||p.setOpacity(u.outdoorOpacity),u.floorStates.forEach(m=>{m.floor&&this.api.updateState(m.floor.id,m.state)}),c(this,aa).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*c(this,aa).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){V.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))}};aa=new WeakMap;function fU(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,L(T({},n),{parentId:t.floor.id}))}d();var rs,F1,D1=class{constructor({currentMapGetter:t}){O(this,rs,new Map);O(this,F1);k(this,F1,t)}get currentMap(){return c(this,F1).call(this)}getById(t){return c(this,rs).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 s=i.Markers.add(o,r,L(T({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:jf(t)}));if(s==null)throw new Error("error creating marker");let a=i.Markers.getContentEl(s.id.toString());if(!a)throw new Error("marker component should exist");let l=new hl(s.id.toString(),a,t);return c(this,rs).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var n;let r=c(this,rs).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),c(this,rs).delete(t.id.toString()))}removeAll(){let t=[];return c(this,rs).forEach(({marker:r})=>{this.remove(r),t.push(r),c(this,rs).delete(r.id.toString())}),t}setPosition(t,r){var s;let n=r.anchorTarget;if(!n){V.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){V.error("Cannot determine the current map.");return}let i=c(this,rs).get(t.id);if(!i){V.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(i.entityId,pi(n),(s=n.floorId)!=null?s:o.currentFloorId),i.marker.updateTarget(r)}animateTo(t,r,n){var a;let o=r.anchorTarget;if(!o)return V.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return V.error("Cannot determine the current map."),Promise.resolve();let s=c(this,rs).get(t.id);return s?(s.marker.updateTarget(r),i.Markers.animateTo(s.entityId,pi(o),(a=o.floorId)!=null?a:i.currentFloorId,n)):(V.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};rs=new WeakMap,F1=new WeakMap;d();var Sl,R1,L1=class{constructor({currentMapGetter:t}){O(this,Sl,new Map);O(this,R1);k(this,R1,t)}get currentMap(){return c(this,R1).call(this)}getById(t){return c(this,Sl).get(t)}add(t,r,n){var l;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 s=i.Images.add(pi(o),r,L(T({},n),{floorId:o.floorId,verticalOffset:o.verticalOffset+((l=n.verticalOffset)!=null?l:0)}));if(!s)throw new Error("image component should exist");let a=new l1(s.id.toString(),r,t);return c(this,Sl).set(a.id,{image:a,entityId:s.id.toString()}),a}remove(t){var n;let r=c(this,Sl).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),c(this,Sl).delete(t.id.toString()))}removeAll(){let t=[];return c(this,Sl).forEach(({image:r})=>{this.remove(r),t.push(r),c(this,Sl).delete(r.id.toString())}),t}};Sl=new WeakMap,R1=new WeakMap;d();var la,B1,N1=class{constructor({currentMapGetter:t}){O(this,la,new Map);O(this,B1);k(this,B1,t)}get currentMap(){return c(this,B1).call(this)}getById(t){return c(this,la).get(t)}add(t,r,n){let o=[t],i=o.reduce((l,p)=>{var u;return p?(l.has(p.floorId)||l.set(p.floorId,[]),(u=l.get(p.floorId))==null||u.push(p),l):(V.error("Cannot determine coordinate from options."),l)},new Map);if(!o.length)throw new Error("targets should not be empty when adding a model");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let a=[];return i.forEach((l,p)=>{let u=kt();s.Models.add(u,l,L(T({},n),{url:r,floorId:p})).forEach(({id:h})=>{let g=new Hu(h.toString(),u,l[0]);c(this,la).set(g.id,{model:g,entityId:h.toString(),groupId:u}),a.push(g)})}),a[0]}remove(t){var n;let r=c(this,la).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),c(this,la).delete(t.id.toString()))}removeAll(){let t=[];return c(this,la).forEach(({model:r})=>{var o;let n=c(this,la).get(r.id);n&&(t.push(r),(o=this.currentMap)==null||o.Models.remove(n.entityId,n.groupId),c(this,la).delete(r.id.toString()))}),t}};la=new WeakMap,B1=new WeakMap;d();var ca,j1,$1=class{constructor({currentMapGetter:t}){O(this,ca,new Map);O(this,j1);k(this,j1,t)}get currentMap(){return c(this,j1).call(this)}getById(t){return c(this,ca).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(a=>a.id.toString()),s=new Ki(kt(),o.animation,t,o.paths);for(let a of i)c(this,ca).set(a,{path:s,entityIds:i});return c(this,ca).set(s.id,{path:s,entityIds:i}),s}remove(t){var n;let r=c(this,ca).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),c(this,ca).delete(t.id),r.entityIds.forEach(o=>c(this,ca).delete(o)))}removeAll(){let t=[];return c(this,ca).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};ca=new WeakMap,j1=new WeakMap;d();var PU=ss(mw(),1);d();var C4="#2266ff",rge="#808080",mU="#f5f5f5";var hU={radius:10,color:C4,inactiveColor:rge,heading:{color:C4,opacity:.7},accuracyRing:{color:C4,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};d();var yU="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";d();var gU=(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,s=10,a=new ls;a.moveTo(-o*Math.sin(e/2),o*Math.cos(e/2)-n);for(let l=0;l<s;l++)a.lineTo(-(i*Math.sin(e/2-e/s*l)),i*Math.cos(e/2-e/s*l)-n);for(let l=0;l<s;l++)a.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/s*l)),r*Math.cos(Math.PI/-2+Math.PI/s*l));return new cs(a,{depth:.1,bevelEnabled:!1,UVGenerator:oge(t)})},T4=(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 Ae(0,o)},oge=e=>({generateTopUV:(t,r,n,o,i)=>{let s=r[n*3],a=r[n*3+1],l=r[o*3],p=r[o*3+1],u=r[i*3],m=r[i*3+1];return[T4(s,a,e),T4(l,p,e),T4(u,m,e)]},generateSideWallUV:()=>[new Ae(0,1),new Ae(0,1),new Ae(0,1),new Ae(0,1)]});function bU(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}function ige([e,t],[r,n],[o,i]){let s=r-e,a=n-t,l=s**2+a**2;if(l===0)return;let p=((o-e)*s+(i-t)*a)/l,u;p<=0?u=[e,t]:p>=1?u=[r,n]:u=[e+p*s,t+p*a];let m=hb([o,i],u);return{proportion:Math.max(0,Math.min(1,p)),intersection:u,distance:m}}function xU(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,o=0,i=0;for(let s=0;s<e.length-1;s++){let a=e[s],l=e[s+1],p=ige(a,l,t);p!=null&&p.distance<r&&(r=p.distance,n=p.intersection,o=s,i=p.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:o,proportion:i}}function vU(e,t){let r=new Ii({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,o=.35*4,i=gU(Math.PI/6,o,n);new ad().load(yU,a=>{r.alphaMap=a,r.needsUpdate=!0});let s=new He(i,r);return s.position.z=-.05,s.renderOrder=0,s}function IU(e,t){let r=new ub(1,1,.05,32),n=new Ii({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),o=new He(r,n);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}function SU(e){let t=new ub(.35,.35,.07,32),r=new Ii({transparent:!0,color:mU,depthTest:!1,depthWrite:!1}),n=new He(t,r);n.renderOrder=2;let o=new ub(.35*.8,.35*.8,.01,32),i=new Ii({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),s=new He(o,i);return s.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,s.rotation.x=Math.PI/2,s.position.z=.07,{outerMesh:n,innerMesh:s}}var wU=ss(CU(),1);var tI="blue-dot",Ju,Cl,Ro,No,Tl,Qu,ed,td,Ar,So,G1,Pl,U1,V1,z1,H1,Q2,pa,wl,eI,rd,W1,ua,Nm=class extends Ne{constructor(r,n){super();this.core=r;this.geoJSONApi=n;O(this,Ju,null);f(this,"geometry");O(this,Cl);O(this,Ro);O(this,No);O(this,Tl);O(this,Qu);O(this,ed);O(this,td);O(this,Ar,hU);O(this,So,1);O(this,G1);O(this,Pl);f(this,"state","disabled");f(this,"following",!1);O(this,U1,r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)});O(this,V1,r=>{var o;let n;if(r!=null){let i=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(r);n=i?c(this,U1).call(this,i.id):void 0}return n});O(this,z1,r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,o,i,s]=r.children;if(c(this,Q2).call(this),o.scale.set(c(this,So),c(this,So),c(this,So)),o.position.z=.07/2*c(this,So),i.scale.set(c(this,So),c(this,So),c(this,So)),i.position.z=.07*c(this,So),this.state==="active"){i.material.color.set(c(this,Ar).color);let a=this.accuracy;a!=null?(n.visible=!0,c(this,ed)&&c(this,ed).stop(),k(this,ed,new bo({scale:n.scale.x}).to({scale:a/2},150).onUpdate(({scale:p})=>{n.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(c(this,ed))):n.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,c(this,td)&&c(this,td).stop();let{start:p,end:u}=yb(s.rotation.z,-Qe.degToRad(l));k(this,td,new bo({rotation:p}).to({rotation:u},150).onUpdate(({rotation:m})=>{s.rotation.z=m}).start()),this.core.getTweenGroup().add(c(this,td)),s.scale.set(c(this,So),c(this,So),1)}else s.visible=!1}else this.state==="inactive"&&(i.material.color.set(c(this,Ar).inactiveColor),s.visible=!1,n.visible=!1)});O(this,H1,r=>{var s,a;let n;try{n=pge.parse(bU(r,c(this,Ro)))}catch(l){c(this,pa).call(this,"error"),V.error("BlueDot: Position parse failed",l instanceof j.ZodError?l.message:String(l)),this.publish("error");return}c(this,Ar).debug&&V.log("BlueDot: Parsed position",n),k(this,No,n),c(this,pa).call(this,"position-update"),c(this,Tl)&&clearTimeout(c(this,Tl)),typeof c(this,Ar).timeout=="number"&&c(this,Ar).timeout<1/0&&k(this,Tl,setTimeout(()=>{c(this,Ar).debug&&V.log("BlueDot: Position timed out after ".concat(c(this,Ar).timeout,"ms")),c(this,pa).call(this,"timeout"),this.core.render()},c(this,Ar).timeout)),(a=this.geoJSONApi.getMapDataInternal())==null||a.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(s=n.floor)==null?void 0:s.elevation,accuracy:n.accuracy}});let o=n.floor!=null?n.floor.id:this.geoJSONApi.currentFloor.id||"outdoors-container",i=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(tI,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}},{setup:l=>{let p=IU(c(this,Ar).accuracyRing.color,c(this,Ar).accuracyRing.opacity),{outerMesh:u,innerMesh:m}=SU(c(this,Ar).color),h=vU(c(this,Ar).heading.color,c(this,Ar).heading.opacity);l.add(p),p.visible=!1,l.add(u),l.add(m),l.add(h),h.visible=!1,c(this,z1).call(this,l)},update:c(this,z1)},{visible:!0,interactive:!0},o);else{let l=this.core.getState(this.geometry);i=[l.position[0],l.position[1]]}c(this,Qu)&&c(this,Qu).stop(),k(this,Qu,new bo(i).to([n.longitude,n.latitude],1e3).easing(kr.Cubic.Out).onUpdate(l=>{if(this.geometry){let p={position:[l[0],l[1]]};p.parent=o,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(c(this,Qu)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});f(this,"onPositionUpdate",r=>{var n,o,i,s,a;if(this.state!=="disabled"){try{cge.parse(r)}catch(l){c(this,pa).call(this,"error"),V.error("BlueDot: Browser sent invalid position",l instanceof j.ZodError?l.message:String(l)),this.publish("error");return}k(this,Cl,{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:(s=r.coords)==null?void 0:s.heading,floor:c(this,V1).call(this,(a=r.coords)==null?void 0:a.floorLevel)}),c(this,H1).call(this,c(this,Cl))}});f(this,"onPositionError",r=>{var n;switch(c(this,pa).call(this,"error"),r.code){case r.PERMISSION_DENIED:V.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:V.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:V.error("Geolocation request timed out.",r);break;default:V.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)});O(this,Q2,()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==c(this,G1)){k(this,G1,r);let o=(n=this.core.getMetresPerPixel())!=null?n:1;k(this,So,Math.max(c(this,Ar).radius/(.35/o),1))}});O(this,pa,r=>{let n=lge[this.state].actions[r];if(n){switch(c(this,Ar).debug&&V.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 V.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))});O(this,wl);O(this,eI,()=>{if(c(this,wl)==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);k(this,wl,(0,wU.default)(n.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return c(this,wl)});O(this,rd,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),c(this,ua)&&(this.off("position-update",c(this,ua)),k(this,ua,void 0)),this.following=!1,k(this,wl,void 0),this.core.off("user-interaction-start",c(this,rd)),this.geoJSONApi.currentMap.off("navigation-active-path-change",c(this,W1)),this.publish("follow-change",{following:!1})});O(this,W1,()=>{k(this,wl,void 0)});O(this,ua);f(this,"follow",(r,n)=>{var i,s,a,l;if(r===!1){c(this,rd).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&V.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:(s=n==null?void 0:n.pitch)!=null?s:45,duration:(a=n==null?void 0:n.duration)!=null?a:1e3,easing:(l=n==null?void 0:n.easing)!=null?l:"ease-in-out"};this.following?c(this,ua)&&this.off("position-update",c(this,ua)):(this.following=!0,this.core.on("user-interaction-start",c(this,rd)),this.geoJSONApi.currentMap.on("navigation-active-path-change",c(this,W1))),k(this,ua,p=>{let{coordinate:u,heading:m,floor:h}=p;if(o.center=[u.longitude,u.latitude],h!=null&&h.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(h.id),k(this,wl,void 0)),r==="position-and-heading")o.bearing=m!=null?m:void 0;else if(r==="position-and-path-direction"){let g=c(this,eI).call(this);if(g!=null){let v=xU(g,[u.longitude,u.latitude]);if(v!=null){let I=g[v.segmentIndex],b=g[v.segmentIndex+1];o.bearing=aM(I,b)}}}this.core.camera.animateTo(o)}),this.on("position-update",c(this,ua)),this.publish("follow-change",{following:!0,mode:r})})}get heading(){var r;return(r=c(this,No))==null?void 0:r.heading}get accuracy(){var r;return(r=c(this,No))==null?void 0:r.accuracy}get coordinate(){var r,n;if(c(this,No)!=null)return(c(this,Pl)==null||((r=this.floor)==null?void 0:r.id)!==c(this,Pl).floorId||c(this,No).latitude!==c(this,Pl).latitude||c(this,No).longitude!==c(this,Pl).longitude)&&k(this,Pl,new $e(c(this,No).latitude,c(this,No).longitude,(n=this.floor)==null?void 0:n.id)),c(this,Pl)}get floor(){var r;return(r=c(this,No))==null?void 0:r.floor}enable(r){k(this,Ar,(0,PU.default)({},r,c(this,Ar))),c(this,pa).call(this,"enable"),this.watchDevicePosition(c(this,Ar).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),c(this,Tl)&&(clearTimeout(c(this,Tl)),k(this,Tl,void 0)),this.following&&c(this,rd).call(this),this.watchDevicePosition(!1),k(this,No,void 0),k(this,Ro,void 0),c(this,pa).call(this,"disable")}watchDevicePosition(r){if(c(this,Ju)&&(navigator.geolocation.clearWatch(c(this,Ju)),k(this,Ju,null)),c(this,Cl)&&k(this,Cl,void 0),r){if(this.state==="disabled"){V.warn("BlueDot must be enabled before watching browser position.");return}k(this,Ju,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var o,i;r==null?k(this,Ro,void 0):"coords"in r?k(this,Ro,Object.assign({},c(this,Ro),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:c(this,V1).call(this,r.coords.floorLevel)})):(k(this,Ro,Object.assign({},c(this,Ro),r)),"floorOrFloorId"in r&&(c(this,Ro).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?c(this,U1).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((o=c(this,Ro))==null?void 0:o.latitude)!=null&&((i=c(this,Ro))==null?void 0:i.longitude)!=null||c(this,Cl)!=null)&&c(this,H1).call(this,c(this,Cl))}};Ju=new WeakMap,Cl=new WeakMap,Ro=new WeakMap,No=new WeakMap,Tl=new WeakMap,Qu=new WeakMap,ed=new WeakMap,td=new WeakMap,Ar=new WeakMap,So=new WeakMap,G1=new WeakMap,Pl=new WeakMap,U1=new WeakMap,V1=new WeakMap,z1=new WeakMap,H1=new WeakMap,Q2=new WeakMap,pa=new WeakMap,wl=new WeakMap,eI=new WeakMap,rd=new WeakMap,W1=new WeakMap,ua=new WeakMap;var lge={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"}}},cge=j.object({coords:j.object({latitude:j.number(),longitude:j.number(),accuracy:j.number(),altitude:j.number().optional().nullable(),altitudeAccuracy:j.number().optional().nullable(),heading:j.number().optional().nullable(),speed:j.number().optional().nullable(),floorLevel:j.number().optional().nullable()}),timestamp:j.number()}),pge=j.object({latitude:j.number(),longitude:j.number(),floor:j.custom().optional(),accuracy:j.number().optional(),heading:j.number().optional().nullable()});d();var Ml,q1,Z1=class{constructor({currentMapGetter:t}){O(this,Ml,new Map);O(this,q1);k(this,q1,t)}get currentMap(){return c(this,q1).call(this)}getById(t){return c(this,Ml).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}),s=new Nc(i);return c(this,Ml).set(s.id,s),s}remove(t){var n;c(this,Ml).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),c(this,Ml).delete(t.id.toString()))}removeAll(){let t=[];return c(this,Ml).forEach(r=>{this.remove(r),t.push(r.id),c(this,Ml).delete(r.id.toString())}),t}};Ml=new WeakMap,q1=new WeakMap;d();var Y1,X1=class{constructor({currentMapGetter:t}){O(this,Y1);k(this,Y1,t)}get currentMap(){return c(this,Y1).call(this)}setFromStyleCollection(t){var r,n,o,i;for(let s in t)for(let a of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[s]==null||!a.layers.has(Er))continue;let l=a.layers.get(Er);if(l!=null&&l.layers.has(s)&&"color"in t[s]){let m=l.layers.get(s);m&&((n=this.currentMap)==null||n.renderer.setState(m,{color:t[s].color}))}if(l&&s===pc&&!(Us in t)){let m=l.layers.get(Us);m&&"color"in t[s]&&((o=this.currentMap)==null||o.renderer.setState(m,{color:t[s].color}))}if(!a.layers.has(Hp))continue;let p=a.layers.get(Hp),u=a.facadesByStyleId.get(s);if(u&&u.length>0)for(let m of u){let h=p.layers.get("".concat(m,"-").concat(s));h&&"color"in t[s]&&((i=this.currentMap)==null||i.renderer.setState(h,{color:t[s].color}))}}}};Y1=new WeakMap;d();var P4={opacity:1},Rn,K1,J1,Hc,Ol,nd,w4,MU,Bm=class{constructor(t,r){O(this,nd);O(this,Rn);O(this,K1,[]);O(this,J1,{opacity:"initial"});O(this,Hc,{opacity:new Map});O(this,Ol,new Set);k(this,Rn,t),k(this,K1,r||[]);let n=c(this,Rn).map;n&&n.on("idle",()=>{c(this,Hc).opacity.size||ee(this,nd,w4).call(this,n)})}setStyle(t){var r,n;if(c(this,Rn).map){(r=c(this,Rn).map)==null||r.setStyle(t),c(this,Ol).size&&(c(this,Ol).clear(),this.hide()),ee(this,nd,MU).call(this),ee(this,nd,w4).call(this,c(this,Rn).map),this.setOpacity(c(this,J1).opacity),(n=c(this,Rn).map)==null||n.moveLayer(xI);for(let[o,i,s]of c(this,K1)||[])c(this,Rn).hideOutdoorLayersIntersectingPolygons(o,i,s)}}get map(){return c(this,Rn).map}get enabled(){return!!c(this,Rn).map}get visible(){return c(this,Ol).size===0}show(){let t=c(this,Rn).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{c(this,Ol).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),c(this,Ol).clear())}hide(t=[]){let r=c(this,Rn).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(o=>{let i=r.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&i!=="none"&&(r.setLayoutProperty(o.id,"visibility","none"),c(this,Ol).add(o.id))})}setOpacity(t,r=[]){var i,s;let n=c(this,Rn).map;if(!n)return;let o=(s=(i=c(this,Rn).map)==null?void 0:i.getStyle())==null?void 0:s.layers;o&&n.once("idle",()=>{o.forEach(a=>{let l=n.getLayoutProperty(a.id,"visibility");if(!r.includes(a.id)&&l!=="none")try{let p=c(this,Hc).opacity.get(a.id);p!==void 0&&(a.id==="background"||(a.type==="symbol"?(n.setPaintProperty(a.id,"icon-opacity",t==="initial"?p[0]:t),n.setPaintProperty(a.id,"text-opacity",t==="initial"?p[1]:t)):n.setPaintProperty(a.id,"".concat(a.type,"-opacity"),t==="initial"?p[0]:t)),c(this,J1).opacity=t)}catch(p){V.warn("Error setting opacity:",p)}})})}};Rn=new WeakMap,K1=new WeakMap,J1=new WeakMap,Hc=new WeakMap,Ol=new WeakMap,nd=new WeakSet,w4=function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var i,s,a;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?c(this,Hc).opacity.set(n.id,[(i=t.getPaintProperty(n.id,"icon-opacity"))!=null?i:P4.opacity,(s=t.getPaintProperty(n.id,"text-opacity"))!=null?s:P4.opacity]):c(this,Hc).opacity.set(n.id,[(a=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?a:P4.opacity,void 0])))})},MU=function(){Object.values(c(this,Hc)).forEach(t=>t.clear())};d();function uge(){vw(!1)}var El,_l,Wc,rI=class{constructor({currentMapGetter:t}){O(this,El);O(this,_l,new Map);O(this,Wc,new Map);k(this,El,t)}labelAll(t={}){var o,i;let r=[],n=new Set;return(i=(o=c(this,El).call(this))==null?void 0:o.Text3D.labelAll(t))==null||i.forEach(({textInfo:s,target:a})=>{let l=s.id.toString(),p=c(this,Wc).get(l);if(p){n.has(l)||r.push(p.text3DView),n.add(l);return}n.add(l);let u=new Bc(l,a);c(this,_l).set(u.id,{targetId:a.id,text3d:l,text3DView:u}),c(this,Wc).set(l,{text3DView:u}),r.push(u)}),r}label(t,r,n={}){var i;if(c(this,El).call(this))if(Jr.is(t)){let s=(i=c(this,El).call(this))==null?void 0:i.Text3D.label(t,r,n);if(!s)return;let a=s.textInfo.id.toString(),l=c(this,Wc).get(a);if(l)return l.text3DView;let p=new Bc(a,s.target);return c(this,_l).set(p.id,{targetId:s.target.id,text3d:a,text3DView:p}),c(this,Wc).set(a,{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=c(this,_l).get(r);n&&((o=c(this,El).call(this))==null||o.Text3D.remove(n.text3d),c(this,_l).delete(r),c(this,Wc).delete(n.text3d))}removeAll(){c(this,_l).forEach(t=>{var r;(r=c(this,El).call(this))==null||r.Text3D.remove(t.text3d)}),c(this,_l).clear()}};El=new WeakMap,_l=new WeakMap,Wc=new WeakMap;var nI=.05,Q1=class{constructor(t,r){f(this,"core");f(this,"mapObjects",[]);f(this,"id");f(this,"mapDataExternal",{});f(this,"mapsByFloorId",{});f(this,"mapData");f(this,"currentMap");f(this,"hiddenOutdoorGeometries",[]);f(this,"lastFacadeIntersected");f(this,"manualFloorVisibility",!1);f(this,"mapView");f(this,"Camera");f(this,"Labels");f(this,"Text3D");f(this,"Markers");f(this,"Models");f(this,"Paths");f(this,"Exporter");f(this,"Navigation");f(this,"Outdoor");f(this,"BlueDot");f(this,"Shapes");f(this,"Style");f(this,"Images");f(this,"update",()=>{this.core.render()});this.core=t,this.mapView=r,this.Camera=new b1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new A1("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",l=>{this.mapView.publish("facades-in-view-change",{facades:l.map(p=>{var u;return(u=this.getMapDataInternal())==null?void 0:u.facadesById[p]}).filter(p=>p!=null)})});let o=new m1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let i=l=>p=>{var B,$,D;let u=[],m=[],h=[],g=[];p.labels.forEach(F=>{let W=this.Labels.getById(F.toString());W&&u.push(W.label)}),p.markers.forEach(F=>{let W=this.Markers.getById(F.toString())||this.Navigation.getMarkerById(F.toString());W&&m.push(W.marker)}),p.models.forEach(F=>{let W=this.Models.getById(F.toString());W&&h.push(W.model)}),p.paths.forEach(F=>{let W=this.Paths.getById(F.toString())||this.Navigation.getPathById(F.toString());W&&g.push(W.path)});let v=p.geometry.includes(tI),I=p.geometry.filter(F=>F!==tI)[0],b;I&&(b=(B=this.getMapDataInternal())==null?void 0:B.getById("space",I)),b||(b=($=this.getMapDataInternal())==null?void 0:$.getById("object",I));let C=p.containers.reduce((F,W)=>{var U;let G=(U=this.getMapDataInternal())==null?void 0:U.getById("floor",W);return G&&fo.is(G)&&F.push(G),F},[]),P,w=0;if(C.length>0){P=C[0].id;let F=this.core.getState(P);w=p.coordinate[2]?p.coordinate[2]-F.altitude:w}let M;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!1})}),b&&Jr.is(b)&&(M=(D=this.getMapDataInternal())==null?void 0:D.facadesBySpaceId[I],M&&M.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!0})})),this.lastFacadeIntersected=M;let E={coordinate:new $e({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:P,verticalOffset:w}),spaces:b&&Jr.is(b)?[b]:[],objects:b&&Do.is(b)?[b]:[],markers:m,labels:u,models:h,paths:g,blueDot:v,floors:C,facades:M?[M]:[]};"pointerEvent"in p&&(E.pointerEvent=p.pointerEvent),this.mapView.publish(l,E)};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 s={currentMapGetter:()=>this.currentMap};this.Markers=new D1(s),this.Models=new N1(s),this.Labels=new I1(s),this.Text3D=new rI(s),this.Exporter=new v1(s),this.Paths=new $1(s),this.Navigation=new y1(this.core,this,s.currentMapGetter),this.BlueDot=new Nm(this.core,this),this.BlueDot.on("position-update",l=>{this.mapView.publish("blue-dot-position-update",l)}),this.BlueDot.on("state-change",l=>{this.mapView.publish("blue-dot-state-change",l)}),this.BlueDot.on("error",l=>{this.mapView.publish("blue-dot-error",l)}),this.BlueDot.on("follow-change",l=>{this.mapView.publish("blue-dot-follow-change",l)}),this.Outdoor=new Bm(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 L1(s),this.Shapes=new Z1(s),this.Style=new X1(s);let a=new Y2(r,this.mapDataExternal);this.auto=a.auto}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(t){t.forEach(r=>{r instanceof fo&&this.core.setState(r.id,{preloadGeometry:!0})})}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(i=>{let s=i.layers.get(Er);if(s){let a=s.layers.get(pc);a&&this.core.setState(a,AP(r,this.core.getState(a)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(i=>{let s=i.layers.get(Er);if(s){let a=s.layers.get(Us);a&&this.core.setState(a,AP(r,this.core.getState(a)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(i=>{let s=i.layers.get(Er);if(s){let a=s.layers.get(kf);a&&this.core.setState(a,iv(r,this.core.getState(a)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(i=>{let s=i.layers.get(Er);if(s){let a=s.layers.get(Af);a&&this.core.setState(a,iv(r,this.core.getState(a)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(Lc.is(n))return this.core.setState(n.id,HN(L(T({},r),{type:"label"}),this.core.getState(n.id)));if(hl.is(n))return this.core.setState(n.id,WN(L(T({},r),{type:"marker"}),this.core.getState(n.id)));if((Jr.is(n)||Do.is(n))&&this.core.setState(n.id,ZN(L(T({},r),{type:"geometry"}),this.core.getState(n.id))),js.is(n)&&this.core.setState(n.id,iv(L(T({},r),{type:"doors"}),this.core.getState(n.id))),Nc.is(n)&&this.core.setState(n.id,Co(r,["altitude","color","opacity"])),Hu.is(n)){let o=r,{position:i,scale:s}=o,l=Bn(o,["position","scale"]);i&&(l.position=[i.longitude,i.latitude,i.verticalOffset]),s!=null&&(Array.isArray(s)?l.scale=s:l.scale=[s,s,s]),i&&n.updateTarget(i),this.core.setState(n.id,l)}if(fo.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;this.core.setState(n.id,Co(r,["visible","altitude"]));let s=i.layers.get(Er);s!=null&&"geometry"in r&&this.core.setState(s.containerId,Co(r.geometry,["opacity","visible"]));let a=i.layers.get(Ya);a!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&a.setVisible(r.labels.enabled);let l=i.layers.get(Vs);l!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&l.setVisible(r.markers.enabled);let p=i.layers.get(My);p!=null&&"footprint"in r&&this.core.setState(p.containerId,Co(r.footprint,["visible","height","opacity","side","color","altitude"]));let u=i.layers.get(Df);u!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&u.setVisible(r.occlusion.enabled)}if(Ui.is(n)){let i=this.core.getState(n.id);for(let s of i.children)s.type==="group-container"&&this.core.setState(s.id,Co(r,["opacity","visible"]))}if(Bc.is(n)&&this.core.setState(n.id,Co(r,Zv)),Ki.is(n))for(let i of n.segments)this.core.setState(i.id,Co(r,["color","nearRadius","farRadius","visible","completeFraction"]));Om.is(n)&&this.core.setState(n.id,Co(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return nh(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var m,h,g,v;let o;try{o=nh(t)}catch(I){V.error("Error adding map",I),n(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:i}=o,s=i["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new $e(s[1],s[0])});let a=i["manifest.geojson"].features[0].properties.name,l=new A1("mapObject-".concat(a),o,r,this),p=this.core.getBoundingArea(l.currentFloor.id);p==null&&V.error("Could not determine bounding box for map:",l.currentFloor.id);let u=(h=(m=r==null?void 0:r.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?h:[];if(u.length>0){let I,b=[];for(let C of l.floorStacksById.values())if(C.defaultFloor.footprint&&C.defaultFloor.footprint.geometry!=null&&((g=C.defaultFloor.footprint.geometry)==null?void 0:g.coordinates.length)>0){let P=C.defaultFloor.footprint,w=av(P);I==null?I=w:JN(I,w),b.push(P)}b.length>0&&I!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(I,b,u),this.hiddenOutdoorGeometries.push([I,b,u]))}if(this.mapObjects.push(l),o.getMVFFeatureByType("floor").forEach(I=>{this.mapsByFloorId[I.id]=l}),l.on("navigation-connection-click",I=>{this.mapView.publish("navigation-connection-click",I)}),l.on("navigation-active-path-change",I=>{this.mapView.publish("navigation-active-path-change",I)}),l.StackedMaps.on("stacked-maps-state-change",({state:I})=>{this.mapView.publish("stacked-maps-state-change",{state:I})}),l.on("floor-change-start",I=>{var b,C,P,w;this.mapView.publish("floor-change-start",{reason:I.reason,floor:(C=(b=this.getMapDataInternal())==null?void 0:b.getById("floor",I.floorId))!=null?C:this.currentFloor,previousFloor:(w=(P=this.getMapDataInternal())==null?void 0:P.getById("floor",I.previousFloorId))!=null?w:this.currentFloor})}),l.on("floor-change",I=>{var b,C;this.mapView.publish("floor-change",{reason:I.reason,floor:this.currentFloor,previousFloor:(C=(b=this.getMapDataInternal())==null?void 0:b.getById("floor",I.previousFloorId))!=null?C:this.currentFloor})}),this.currentMap=l,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 I=(v=r==null?void 0:r.screenOffsets)!=null?v:{top:nI*this.core.canvasHeight,left:nI*this.core.canvasWidth,right:nI*this.core.canvasWidth,bottom:nI*this.core.canvasHeight};this.core.camera.focusOn(p,{duration:ON,padding:I}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(by(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(by(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Ln("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Ln("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Ln("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Ln("Missing currentFloor");return r}getState(t){var o,i,s,a,l,p,u,m,h,g,v,I,b,C,P,w,M,E,B,$;typeof t=="object"&&Ki.is(t)&&V.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=KN(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:D,topColor:F,texture:W,topTexture:G,visible:U,height:J,opacity:X}=n;return{type:"walls",visible:U,color:D,topColor:F,texture:W?{url:W}:void 0,topTexture:G?{url:G}:void 0,height:J,opacity:X}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:D,topColor:F,texture:W,topTexture:G,visible:U,opacity:J}=n;return{type:"doors",visible:U,color:D,topColor:F,opacity:J,texture:W?{url:W}:void 0,topTexture:G?{url:G}: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 D=typeof n.parent=="object"?n.parent.id:n.parent,F=this.Markers.getById(n.id.toString()),W=F!=null&&F.marker.target?F==null?void 0:F.marker.target.anchorTarget:void 0;return W==null&&(W=new $e(n.position[1],n.position[0],D.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 D=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(i=n.parent)==null?void 0:i.toString();return delete n.parent,L(T({},n),{position:new $e({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:D}),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"&&Nc.is(t)){let[D]=n.children;if(D.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(s=n.altitude)!=null?s:0,visible:n.visible,color:n.color,height:D.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"&&fo.is(t)){let D=(a=this.currentMap.floorsById.get(t.id))==null?void 0:a.layers.get(Er),F=D?this.core.getState(D.containerId):void 0,W=(l=this.currentMap.floorsById.get(t.id))==null?void 0:l.layers.get(Ya),G=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(Vs),U=(u=this.currentMap.floorsById.get(t.id))==null?void 0:u.layers.get(My),J=U?this.core.getState(U.containerId):void 0,X=(m=this.currentMap.floorsById.get(t.id))==null?void 0:m.layers.get(Df),ie=X?this.core.getState(X.containerId):void 0;return{type:"floor",geometry:{opacity:(h=F==null?void 0:F.opacity)!=null?h:0,visible:(g=F==null?void 0:F.visible)!=null?g:!0},labels:{enabled:(v=W==null?void 0:W.visible)!=null?v:!1},markers:{enabled:(I=G==null?void 0:G.visible)!=null?I:!1},footprint:{altitude:(b=J==null?void 0:J.altitude)!=null?b:0,visible:(C=J==null?void 0:J.visible)!=null?C:!1,height:(P=J==null?void 0:J.height)!=null?P:0,opacity:(w=J==null?void 0:J.opacity)!=null?w:0,side:(M=J==null?void 0:J.side)!=null?M:"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:($=n.altitude)!=null?$:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Ui.is(t)){let D=this.core.getState(n.children[0].id);return{type:"facade",opacity:D.opacity,visible:D.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 l;if(n!=null){let p=this.core.projectScreenXYToCoordinate(t,r,!0);return p?new $e(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:s}=o,a=(l=s==null?void 0:s.find(p=>{let u=p.userData.entityId.toString();return u.includes("f_")||u.includes("m_")}))==null?void 0:l.userData.entityId.toString();return new $e(i[1],i[0],a)}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 bo(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()}};function dge(e){vM("".concat(e,"/maplibre-worker.csp.js")),UP("".concat(e,"/collision-worker.csp.js"))}d();d();var oI=class{constructor(t){f(this,"state");f(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};d();var OU=mn.object({environment:mn.union([mn.literal("basic"),mn.literal(!1)]).optional(),text3d:mn.object({hoverColor:mn.string().optional()}).optional(),geometry:mn.object({hoverColor:mn.string().optional()}).optional(),backgroundColor:mn.string().optional(),backgroundAlpha:mn.number().optional()}).strict();d();var iI=ss(ew(),1);var EU=e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||M4(e).some(r=>r<1)?!0:(console.warn=t,!1)},M4=e=>{let t=new Lt(e);return[t.r,t.g,t.b]},fge=e=>{let t=new Lt;return t.setRGB(e[0],e[1],e[2],ma),"#"+t.getHexString()},_U=(e,t)=>{let r=(0,iI.default)({},e),n=(0,iI.default)({},e,t),o=(i,s,a)=>{for(let l in s){let p=i[l],u=s[l];if(typeof u=="number"&&typeof p=="number")i[l]=p+(u-p)*a;else if(typeof u=="string"&&typeof p=="string"){if(EU(p)&&EU(u)){let m=M4(p),h=M4(u);m&&h?i[l]=fge([m[0]+(h[0]-m[0])*a,m[1]+(h[1]-m[1])*a,m[2]+(h[2]-m[2])*a]):V.warn('Color "'.concat(l,'" could not be animated!'))}}else typeof u=="object"&&u!==null&&typeof p=="object"&&p!==null?o(p,u,a):V.warn('Value "'.concat(l,'" could not be animated!'))}};return i=>{if(i=Math.min(Math.max(i,0),1),i===0)return e;if(i===1)return n;let s=(0,iI.default)({},r);return o(s,t,i),s}};var eb,Ie,kl,$m=class extends Ne{constructor(r){super();O(this,eb,{});O(this,Ie);O(this,kl);f(this,"Camera");f(this,"Labels");f(this,"Text3D");f(this,"Markers");f(this,"Images");f(this,"Models");f(this,"Paths");f(this,"Exporter");f(this,"Navigation");f(this,"BlueDot");f(this,"Style");f(this,"Shapes");f(this,"Outdoor");f(this,"update",()=>{c(this,Ie).core.render()});f(this,"getDirections",(r,n,o)=>{var i;return(i=c(this,Ie).getMapData())==null?void 0:i.getDirections(r,n,o)});f(this,"getDirectionsMultiDestination",(r,n,o)=>{var i;return(i=c(this,Ie).getMapData())==null?void 0:i.getDirectionsMultiDestination(r,n,o)});f(this,"on",(r,n)=>{super.on(r,n)});f(this,"off",(r,n)=>{super.off(r,n)});f(this,"Debug");k(this,kl,r);let n=new Q1(r,this);k(this,Ie,n),this.Camera=c(this,Ie).Camera,k(this,eb,c(this,Ie).mapDataExternal),this.Markers=c(this,Ie).Markers,this.Models=c(this,Ie).Models,this.Labels=c(this,Ie).Labels,this.Text3D=c(this,Ie).Text3D,this.Exporter=c(this,Ie).Exporter,this.Paths=c(this,Ie).Paths,this.Navigation=c(this,Ie).Navigation,this.BlueDot=c(this,Ie).BlueDot,this.Shapes=c(this,Ie).Shapes,this.Style=c(this,Ie).Style,this.auto=c(this,Ie).auto,this.Outdoor=c(this,Ie).Outdoor,this.Images=c(this,Ie).Images,c(this,kl).container.dataset.version=x.env.npm_package_version,this.Debug=new oI(c(this,Ie).core)}get StackedMaps(){return c(this,Ie).currentMap.StackedMaps}updateState(r,n){return c(this,Ie).updateState(r,n)}animateState(r,n,o){var p;let i=c(this,Ie).getState(r);if(i==null)return V.warn("Cannot animate state of ".concat(r,".")),new Promise(m=>m());let s=_U(i,n),a=c(this,Ie).tween({percent:0}).to({percent:1},(p=o==null?void 0:o.duration)!=null?p:1e3).onUpdate(({percent:u})=>{c(this,Ie).updateState(r,s(u))});o!=null&&o.easing&&o.easing in dl&&a.easing(dl[o.easing]);let l=new Promise(u=>{a.onComplete(()=>{c(this,Ie).removeTween(a),u()}).onStop(()=>{c(this,Ie).removeTween(a),u()}),a.start()});return l.cancel=()=>{a.stop(),c(this,Ie).updateState(r,s(0))},l}updateGlobalState(r){var n,o,i,s;try{OU.parse(r)}catch(a){V.error("updateGlobalState",a);return}if(typeof r=="object"){let a={};if((n=r.text3d)!=null&&n.hoverColor&&(a.text3dHoverColor=r.text3d.hoverColor),(o=r.geometry)!=null&&o.hoverColor&&(a.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let l=(i=r.backgroundColor)!=null?i:c(this,Ie).core.backgroundColor,p=(s=r.backgroundAlpha)!=null?s:c(this,Ie).core.backgroundAlpha;c(this,Ie).core.setBackgroundColor(l,p)}r.environment!=null&&c(this,Ie).core.setEnvironment(r.environment),c(this,Ie).core.setState(a)}}getGlobalState(){let r=c(this,Ie).core.getState();return{backgroundColor:c(this,Ie).core.backgroundColor,backgroundAlpha:c(this,Ie).core.backgroundAlpha,environment:c(this,Ie).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return c(this,eb)}getDimensions(){return{width:c(this,kl).canvasWidth,height:c(this,kl).canvasHeight}}expand(r){var n;return(n=c(this,Ie).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=c(this,Ie).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return c(this,Ie).addMap(r,n)}setFloor(r,n){return c(this,Ie).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return c(this,Ie).setFloorStack(r,n==null?void 0:n.context)}preloadFloors(r){c(this,Ie).preloadFloors(r)}tween(r){return c(this,Ie).tween(r)}removeTween(r){c(this,Ie).removeTween(r)}get currentFloorStack(){return c(this,Ie).currentFloorStack}get currentFloor(){return c(this,Ie).currentFloor}updateWatermark(r){c(this,Ie).updateWatermark(r)}getState(r){return c(this,Ie).getState(r)}setHoverColor(r){c(this,Ie).setHoverColor(r)}getHoverColor(){return c(this,Ie).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return c(this,Ie).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return c(this,Ie).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return c(this,Ie).isInView(r)}getDistance(r,n){var o;return(o=c(this,Ie).getMapData())==null?void 0:o.getDistance(r,n)}createCoordinate(r,n,o){return typeof r=="object"?new $e(r):new $e(r,n,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(r,n,o){return c(this,Ie).createCoordinateFromScreenCoordinate(r,n,o)}getScreenCoordinateFromCoordinate(r){return c(this,Ie).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(x.env.INTERNAL==="true")return c(this,Ie).core;throw new Error("__core is not available.")}clear(){c(this,Ie).clear()}destroy(){c(this,Ie).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-CV34C4XG.js");await new n(this,c(this,Ie)).enable(r)}async takeScreenshot(){return await c(this,kl).renderSync(),c(this,kl).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return c(this,Ie).manualFloorVisibility}set manualFloorVisibility(r){c(this,Ie).manualFloorVisibility=r}};eb=new WeakMap,Ie=new WeakMap,kl=new WeakMap;d();d();var sI=class extends Ne{constructor(r){super();f(this,"gl");f(this,"el",document.createElement("div"));f(this,"core");f(this,"origin");f(this,"map");f(this,"layer");f(this,"handleStyleChange",()=>{!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()))});f(this,"handleMove",()=>{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(Qe.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Qe.degToRad(this.map.getPitch()))});f(this,"handleError",r=>{V.warn(r)});this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new o1(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=bM.fromLngLat(this.origin,0);return this.layer=Sb(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}};var od,jm,Zc,id,aI=class aI extends Ne{constructor(r,n,o){super();O(this,od);O(this,jm);O(this,Zc);O(this,id);f(this,"on",(r,n)=>{super.on(r,n)});f(this,"off",(r,n)=>{super.off(r,n)});k(this,id,new sI(r)),k(this,od,n),k(this,jm,o)}onAdd(r){var i,s;let n=c(this,id).onAdd(r),o=L(T(T({},zp),(i=c(this,jm))!=null?i:{}),{outdoorView:T({token:c(this,od).outdoorViewToken},(s=c(this,jm))==null?void 0:s.outdoorView)});return k(this,Zc,new $m(c(this,id).core)),c(this,Zc).addMap(c(this,od),o).then(()=>{this.publish("loaded",{mapView:c(this,Zc),mapData:c(this,od)})}),n}onRemove(){c(this,Zc)&&c(this,Zc).clear(),aI.instance=null,c(this,id).onRemove()}};od=new WeakMap,jm=new WeakMap,Zc=new WeakMap,id=new WeakMap,f(aI,"instance");var Gm=aI;d();var mge=1e3*60*60*2,qc,Vm,Qt,ns,os,gi,is,zm,Hm,rb,lr,kU,AU,Um,lI,O4,E4,_4,tb=class{constructor(t,r){O(this,lr);O(this,qc,new Ne);O(this,Vm);O(this,Qt);O(this,ns);O(this,os);O(this,gi);O(this,is);O(this,zm);O(this,Hm);O(this,rb,()=>{"key"in c(this,Qt)&&"secret"in c(this,Qt)&&ee(this,lr,Um).call(this),ee(this,lr,lI).call(this)});f(this,"on",(t,r)=>c(this,qc).on(t,r));f(this,"off",(t,r)=>c(this,qc).off(t,r));k(this,Vm,t),k(this,Qt,r)}setMapIds(t){k(this,Vm,t)}setEnterprise(t){c(this,Qt).enterprise=t}async readySync(){if((!("key"in c(this,Qt))||!("secret"in c(this,Qt)))&&!("accessToken"in c(this,Qt))){V.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[ee(this,lr,Um).call(this),null];c(this,Qt).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);ee(this,lr,_4).call(this),ee(this,lr,O4).call(this,r),n!=null&&ee(this,lr,E4).call(this,n),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",c(this,rb))}async refreshing(){let t=[];return c(this,ns)!=null&&t.push(c(this,ns)),c(this,os)!=null&&t.push(c(this,os)),Promise.all(t)}getAccessTokenAsync(){return ee(this,lr,Um).call(this)}getSasTokensAsync(){return ee(this,lr,lI).call(this)}getAccessToken(){return c(this,gi)==null?(V.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):c(this,gi)}getSasToken(t){return this.isEnterpriseMode()?(V.error("SAS tokens are not available in the enterprise mode!"),{token:""}):c(this,is)==null?(V.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in c(this,is).tokens?c(this,is).tokens[t]:(V.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=c(this,Qt).enterprise)!=null?t:!1}destroy(){ee(this,lr,_4).call(this),c(this,qc).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",c(this,rb))}};qc=new WeakMap,Vm=new WeakMap,Qt=new WeakMap,ns=new WeakMap,os=new WeakMap,gi=new WeakMap,is=new WeakMap,zm=new WeakMap,Hm=new WeakMap,rb=new WeakMap,lr=new WeakSet,kU=function(t){var n;let r=t.token!==((n=c(this,gi))==null?void 0:n.token);k(this,gi,t),r&&c(this,qc).publish("access-token-refreshed",{accessToken:t})},AU=function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=c(this,is))==null?void 0:n.tokens);k(this,is,t),r&&c(this,qc).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},Um=async function(t=!1){var r;if("accessToken"in c(this,Qt)&&typeof c(this,Qt).accessToken=="string"){let n={token:c(this,Qt).accessToken,expires:Date.now()+72e5};return k(this,gi,n),n}if(!("key"in c(this,Qt))||!("secret"in c(this,Qt))||typeof c(this,Qt).key!="string"||typeof c(this,Qt).secret!="string")throw new Error("No API keys or access token provided!");return c(this,ns)!=null?c(this,ns):c(this,gi)!=null&&c(this,gi).expires!=null&&c(this,gi).expires>Date.now()&&!t?c(this,gi):(k(this,ns,uy(L(T({},c(this,Qt)),{key:c(this,Qt).key,secret:c(this,Qt).secret}),(r=c(this,Qt).enterprise)!=null?r:!1).then(n=>{let o={token:n.accessToken,expires:n.expiresTimestamp*1e3};return ee(this,lr,kU).call(this,o),o})),c(this,ns).finally(()=>{k(this,ns,void 0)}),c(this,ns))},lI=async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:c(this,os)!=null?c(this,os):c(this,is)!=null&&c(this,is).expires>Date.now()&&!t?c(this,is):(k(this,os,new Promise((r,n)=>{ee(this,lr,Um).call(this).then(o=>{let i={},s=c(this,Vm).map(a=>kT(L(T({},c(this,Qt)),{mapId:a}),o.token).then(l=>{i[a]={token:l.token,expires:l.expires}}).catch(l=>{V.error("Error getting SAS token for map ".concat(a,":"),l)}));Promise.all(s).then(()=>{let a={tokens:i,expires:Math.min(...Object.values(i).map(l=>{var p;return(p=l.expires)!=null?p:1/0}))};ee(this,lr,AU).call(this,a),r(a)})}).catch(o=>{n(o)})})),c(this,os).catch(r=>{throw r}).finally(()=>{k(this,os,void 0)}),c(this,os))},O4=function(t){if(!("key"in c(this,Qt))||!("secret"in c(this,Qt)))return;let r=t.expires!=null?t.expires-Date.now():mge;isFinite(r)&&k(this,zm,setTimeout(()=>{ee(this,lr,Um).call(this,!0).then(n=>{ee(this,lr,O4).call(this,n)})},r-KR))},E4=function(t){let r=t.expires-Date.now();isFinite(r)&&k(this,Hm,setTimeout(()=>{ee(this,lr,lI).call(this,!0).then(n=>{ee(this,lr,E4).call(this,n)})},r-eN))},_4=function(){c(this,zm)!=null&&clearTimeout(c(this,zm)),c(this,Hm)!=null&&clearTimeout(c(this,Hm))};d();var DU=(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)};var FU=":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 LU='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var RU=".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 NU=".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 BU=".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 $U='.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 Ige=[FU,LU,RU,NU,BU,$U],jU;function Tdt(e){jU=e}var Pdt=async(e,t)=>{let r,n=Dp();t&&n.updateByUserOption(t);try{t&&(r=(await uy(L(T({},t),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(s){V.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new Jf(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new Pb(o)},GU=!1;function wdt(e){GU=e}var Mdt=async(e,t)=>{var g,v,I,b,C,P,w;let r=(I="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?I:"options"in e&&"version"in((g=e.options)!=null?g:{})?(v=e.options)==null?void 0:v.version:void 0,n=L(T({},t||{}),{mvfVersion:r}),o,i=Dp();i.updateByUserOption(n);let s={};if("type"in e&&typeof e.type=="string"){if(s.enterprise=(b=e.options)==null?void 0:b.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){o=await $T(e.main,n.mvfVersion),s.languagePacks=[];for(let M of(C=e.languagePacks)!=null?C:[])M.localePack instanceof Uint8Array&&s.languagePacks.push({language:M.language,localePack:await Cf(M.localePack)})}else if(e.type==="json")o=e.main,s.languagePacks=(P=e.languagePacks)!=null?P:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(s.binaryBundle=e.main)}else o=e,s.enterprise=o.enterprise!=null;let a=BT(o),l=a.length>0?a:[n.mapId],p=new tb(l,L(T({},n),{enterprise:s.enterprise})),u;if("accessToken"in n)u=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=i.getBaseAuthUri(s.enterprise);let M=await p.getAccessTokenAsync();u=(M==null?void 0:M.token)||""}s.outdoorViewToken=u,s.env=i,s.getMapDataOptions=n;try{await p.readySync()}catch(M){V.error("Failed to ready token manager!",M)}let m=new Jf(o,s);u&&m.Analytics.init(L(T({accessToken:u,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:(w=n.analytics)==null?void 0:w.context}));let h=new Pb(m);if("language"in n)try{await h.changeLanguage(n.language)}catch(M){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(o),h},Sge=async e=>{var I;let t=GU,r,n=Dp();n.updateByUserOption(e);let o=T({},e),i=new tb([o.mapId],o);if("accessToken"in o){r=o.accessToken;let{aud:b,sub:C}=mb(r);(_N.some(P=>b.includes(P))||C&&C.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"&&V.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):V.warn("layoutId is currently unsupported!")),o.baseUri=n.getBaseUri(t);let s=performance.now(),a,l;if(t){let b=L(T({},o),{venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"}),C=await FT(b);a=C.compressed,l=C.localePacks}else a=await LT(o,r);let p=performance.now(),u=await $T(a,o.mvfVersion),m=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(u);let h=BT(u);h.length>0?i.setMapIds(h):i.setMapIds([o.mapId]);try{await i.readySync()}catch(b){V.error("Failed to ready token manager!",b)}let g=new Jf(u,{env:n,outdoorViewToken:r,tokenManager:i,enterprise:t,localePacksUrls:l,binaryBundle:a,getMapDataOptions:o}),v=new Pb(g,{search:e.search});if(g.Analytics.init(L(T({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:(I=o.analytics)==null?void 0:I.context})),g.Analytics.sendGetMapDataEvent({parseDuration:m-p,downloadDuration:p-s,viewId:o.viewId}),"language"in o)try{await v.changeLanguage(o.language)}catch(b){}return v},Odt=Sge,Edt=(e,t)=>{Gm.instance!=null&&V.warn("Only a single map venue is supported at this time.");let r=new Gm([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return Gm.instance=r,r},Cge=async(e,t,r)=>{var p,u,m,h,g,v,I,b,C,P,w,M,E,B,$;let n=performance.now(),o=mP(r,t);o&&fP(o),((p=o.injectStyles)==null||p)&&DU(Ige,{id:"mappedin__styles"});let i=kN((u=t.outdoorViewToken)!=null?u:""),s=nh(t);(m=o.outdoorView)!=null&&m.style&&s.envControl.updateTileServerBaseUrl((h=o.outdoorView)==null?void 0:h.style);let a=await ZG(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(g=o.style)==null?void 0:g.backgroundAlpha,backgroundColor:(v=o.style)==null?void 0:v.backgroundColor,outdoorView:(I=o.outdoorView)!=null&&I.token?{headers:{"x-mappedin-tiles-key":(b=o.outdoorView)==null?void 0:b.token},style:t.getEnv().tileServerUri,enabled:!!((C=o.outdoorView)!=null&&C.enabled),lowDpi:(P=o.outdoorView)==null?void 0:P.lowDpi}:void 0,watermark:L(T({},o.watermark),{visible:(M=(w=o.watermark)==null?void 0:w.visible)!=null?M:!s.enterpriseMode&&!i.remove_watermark,onClick:jU||void 0}),attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((E=o.antialiasing)!=null&&E.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(B=o.occlusion)==null?void 0:B.enabled,transformImageRequest:s.enterpriseMode?void 0:s.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:o.imagePlacementOptions,onWebGLContextCreationError:o.onWebGLContextCreationError,onWebGLContextLost:o.onWebGLContextLost,onWebGLContextRestored:o.onWebGLContextRestored,onWebGLRendererError:o.onWebGLRendererError,useStandaloneCamera:($=o.useStandaloneCamera)!=null?$:!1}),l=new $m(a);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:l.getDimensions()}),l},_dt=Cge;export{$e as a,oc as b,Rp as c,Bp as d,sc as e,js as f,Jr as g,fo as h,aae as i,Wp as j,Do as k,lc as l,cc as m,Qx as n,Ui as o,Xa as p,ev as q,wP as r,RT as s,NT as t,j as u,Nf as v,tv as w,mw as x,NB as y,bj as z,jye as A,lv as B,cv as C,uge as D,dge as E,Tdt as F,Pdt as G,wdt as H,Mdt as I,Sge as J,Odt as K,Edt as L,Cge as M,_dt as N};
|