@mappedin/mappedin-js 6.0.1-beta.44 → 6.0.1-beta.45
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 +1 -20
- package/lib/esm/{GLTFExporter-4THLS4PM.js → GLTFExporter-33O74ZRA.js} +1 -1
- package/lib/esm/{GLTFLoader-KOQIUT25.js → GLTFLoader-TFEUICFY.js} +1 -1
- package/lib/esm/{browser-LGW6JLJT.js → browser-IE62BVYL.js} +1 -1
- package/lib/esm/{chunk-5SY5TZBS.js → chunk-7QYC6UYU.js} +1 -1
- package/lib/esm/chunk-AGPZKMLJ.js +1 -0
- package/lib/esm/chunk-HALSTKAB.js +1 -0
- package/lib/esm/{chunk-A5SAO63E.js → chunk-HTXG2WUL.js} +1 -1
- package/lib/esm/chunk-L5IJY45Y.js +1 -0
- package/lib/esm/chunk-N5U7Y27D.js +1 -0
- package/lib/esm/{chunk-QO7JQA7V.js → chunk-O57EU3PO.js} +1 -1
- package/lib/esm/index.d.ts +0 -10
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-KJE2KP6V.js → inspector-CC3UZQDZ.js} +1 -1
- package/lib/esm/{internal-RS3PVAR3.js → internal-MEGLEQC5.js} +1 -1
- package/lib/esm/outdoor-context-v4-5DHMHSDP.js +1 -0
- package/lib/esm/{roboto-regular-PKVZDOB2.js → roboto-regular-E2V4PXOH.js} +1 -1
- package/lib/esm/{text3d-QIM5QGO6.js → text3d-3PC3DCSJ.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-KNDTFHOY.js +0 -1
- package/lib/esm/chunk-M46A4YQ5.js +0 -1
- package/lib/esm/chunk-Q2KR5YO7.js +0 -1
- package/lib/esm/chunk-XGYIT3MM.js +0 -1
- package/lib/esm/outdoor-context-v4-6CUOE2HW.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as Ed,A as vE,B as xE,C as vh,D as io,E as IE,F as YS,G as xs,H as SE,I as Md,J as CE,K as Is,L as n0,M as yr,N as KS,O as In,P as PE,Q as hu,R as Mi,S as Tt,T as ct,U as xh,V as JS,W as QS,X as OE,Y as Ih,Z as EE,_ as Od,a as zO,aa as _E,ba as wo,ca as AE,d as $,da as kE,e as zS,ea as e3,f as Q1,fa as o0,g as fE,ga as i0,h as wd,ha as DE,i as e0,ia as FE,j as mE,ja as LE,k as t0,ka as s0,l as du,la as RE,m as bs,ma as NE,n as hE,na as BE,o as yE,oa as $E,p as ZS,pa as Ss,q as Et,qa as t3,r as De,ra as jE,s as fu,sa as GE,t as XS,ta as yu,u as vs,ua as Sh,v as r0,va as _d,w as wa,wa as a0,x as mu,xa as Ad,y as gE,ya as kd,z as bE}from"./chunk-A5SAO63E.js";import{a as qY,ca as ME,k as TE,v as wE}from"./chunk-XGYIT3MM.js";import{a as Ho}from"./chunk-5SY5TZBS.js";import{$ as rE,$a as uE,A as XO,Aa as Ti,Ba as K1,C as YO,Ca as sE,D as Ye,Da as aE,E as Ee,Fa as wi,I as KO,J as JO,K as QO,L as bh,M as Ce,N as Xr,O as eE,P as Ci,Pa as Td,Q as Ca,R as Pa,S as Ft,Ta as J1,U as $r,Ua as lE,V as Ta,W as tE,X as Ve,Y as Pi,Ya as cE,_ as pu,_a as gs,aa as HS,ab as pE,b as W1,c as q1,ca as Vl,cb as dE,d as HO,e as Ia,f as WO,g as ms,ha as nE,ka as zl,la as oE,ma as X1,na as WS,p as qO,pa as Pd,q as ZO,r as Z1,ua as iE,va as Hl,wa as Y1,xa as qS,ya as hs,z as Sa,za as ys}from"./chunk-QO7JQA7V.js";import{a as p,b as g}from"./chunk-KNDTFHOY.js";import{b as H,c as Ul,d as fs,e as m,f as c,g as M,h as _,i as ee,j as E}from"./chunk-Q2KR5YO7.js";var kh=H(wt=>{"use strict";p();Object.defineProperty(wt,"__esModule",{value:!0});wt.regexpCode=wt.getEsmExportName=wt.getProperty=wt.safeStringify=wt.stringify=wt.strConcat=wt.addCodeArg=wt.str=wt._=wt.nil=wt._Code=wt.Name=wt.IDENTIFIER=wt._CodeOrName=void 0;var _h=class{};wt._CodeOrName=_h;wt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var gu=class extends _h{constructor(t){if(super(),!wt.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}}};wt.Name=gu;var Wo=class extends _h{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 gu&&(r[n.str]=(r[n.str]||0)+1),r),{})}};wt._Code=Wo;wt.nil=new Wo("");function r7(e,...t){let r=[e[0]],n=0;for(;n<t.length;)i3(r,t[n]),r.push(e[++n]);return new Wo(r)}wt._=r7;var o3=new Wo("+");function n7(e,...t){let r=[Ah(e[0])],n=0;for(;n<t.length;)r.push(o3),i3(r,t[n]),r.push(o3,Ah(e[++n]));return QY(r),new Wo(r)}wt.str=n7;function i3(e,t){t instanceof Wo?e.push(...t._items):t instanceof gu?e.push(t):e.push(rK(t))}wt.addCodeArg=i3;function QY(e){let t=1;for(;t<e.length-1;){if(e[t]===o3){let r=eK(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function eK(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof gu||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 gu))return'"'.concat(e).concat(t.slice(1))}var e7;function tK(e,t){return t.emptyStr()?e:e.emptyStr()?t:n7(e7||(e7=E(["","",""])),e,t)}wt.strConcat=tK;function rK(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ah(Array.isArray(e)?e.join(","):e)}function nK(e){return new Wo(Ah(e))}wt.stringify=nK;function Ah(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}wt.safeStringify=Ah;var t7;function oK(e){return typeof e=="string"&&wt.IDENTIFIER.test(e)?new Wo(".".concat(e)):r7(t7||(t7=E(["[","]"])),e)}wt.getProperty=oK;function iK(e){if(typeof e=="string"&&wt.IDENTIFIER.test(e))return new Wo("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}wt.getEsmExportName=iK;function sK(e){return new Wo(e.toString())}wt.regexpCode=sK});var l3=H(ao=>{"use strict";p();Object.defineProperty(ao,"__esModule",{value:!0});ao.ValueScope=ao.ValueScopeName=ao.Scope=ao.varKinds=ao.UsedValueState=void 0;var so=kh(),s3=class extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}},u0;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(u0||(ao.UsedValueState=u0={}));ao.varKinds={const:new so.Name("const"),let:new so.Name("let"),var:new so.Name("var")};var p0=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof so.Name?t:this.name(t)}name(t){return new so.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}}};ao.Scope=p0;var o7,d0=class extends so.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,so._)(o7||(o7=E([".","[","]"])),new so.Name(r),n)}};ao.ValueScopeName=d0;var i7,aK=(0,so._)(i7||(i7=E(["\n"],["\\n"]))),s7,a7,l7,a3=class extends p0{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?aK:so.nil}}get(){return this._scope}name(t){return new d0(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 d=a.get(s);if(d)return d}else a=this._values[i]=new Map;a.set(s,o);let l=this._scope[i]||(this._scope[i]=[]),u=l.length;return l[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,so._)(s7||(s7=E(["","",""])),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=so.nil;for(let s in t){let a=t[s];if(!a)continue;let l=n[s]=n[s]||new Map;a.forEach(u=>{if(l.has(u))return;l.set(u,u0.Started);let d=r(u);if(d){let f=this.opts.es5?ao.varKinds.var:ao.varKinds.const;i=(0,so._)(a7||(a7=E(["",""," "," = ",";",""])),i,f,u,d,this.opts._n)}else if(d=o==null?void 0:o(u))i=(0,so._)(l7||(l7=E(["","","",""])),i,d,this.opts._n);else throw new s3(u);l.set(u,u0.Completed)})}return i}};ao.ValueScope=a3});var Ze=H(Ke=>{"use strict";p();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.or=Ke.and=Ke.not=Ke.CodeGen=Ke.operators=Ke.varKinds=Ke.ValueScopeName=Ke.ValueScope=Ke.Scope=Ke.Name=Ke.regexpCode=Ke.stringify=Ke.getProperty=Ke.nil=Ke.strConcat=Ke.str=Ke._=void 0;var ut=kh(),Ei=l3(),Wl=kh();Object.defineProperty(Ke,"_",{enumerable:!0,get:function(){return Wl._}});Object.defineProperty(Ke,"str",{enumerable:!0,get:function(){return Wl.str}});Object.defineProperty(Ke,"strConcat",{enumerable:!0,get:function(){return Wl.strConcat}});Object.defineProperty(Ke,"nil",{enumerable:!0,get:function(){return Wl.nil}});Object.defineProperty(Ke,"getProperty",{enumerable:!0,get:function(){return Wl.getProperty}});Object.defineProperty(Ke,"stringify",{enumerable:!0,get:function(){return Wl.stringify}});Object.defineProperty(Ke,"regexpCode",{enumerable:!0,get:function(){return Wl.regexpCode}});Object.defineProperty(Ke,"Name",{enumerable:!0,get:function(){return Wl.Name}});var y0=l3();Object.defineProperty(Ke,"Scope",{enumerable:!0,get:function(){return y0.Scope}});Object.defineProperty(Ke,"ValueScope",{enumerable:!0,get:function(){return y0.ValueScope}});Object.defineProperty(Ke,"ValueScopeName",{enumerable:!0,get:function(){return y0.ValueScopeName}});Object.defineProperty(Ke,"varKinds",{enumerable:!0,get:function(){return y0.varKinds}});Ke.operators={GT:new ut._Code(">"),GTE:new ut._Code(">="),LT:new ut._Code("<"),LTE:new ut._Code("<="),EQ:new ut._Code("==="),NEQ:new ut._Code("!=="),NOT:new ut._Code("!"),OR:new ut._Code("||"),AND:new ut._Code("&&"),ADD:new ut._Code("+")};var Ea=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},c3=class extends Ea{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ei.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=Rd(this.rhs,t,r)),this}get names(){return this.rhs instanceof ut._CodeOrName?this.rhs.names:{}}},f0=class extends Ea{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 ut.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Rd(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ut.Name?{}:{...this.lhs.names};return h0(t,this.rhs)}},u3=class extends f0{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}},p3=class extends Ea{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}},d3=class extends Ea{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}},f3=class extends Ea{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}},m3=class extends Ea{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=Rd(this.code,t,r),this}get names(){return this.code instanceof ut._CodeOrName?this.code.names:{}}},Dh=class extends Ea{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)||(lK(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>xu(t,r.names),{})}},_a=class extends Dh{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},h3=class extends Dh{},Ld=class extends _a{};Ld.kind="else";var bu=class e extends _a{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 Ld(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(h7(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=Rd(this.condition,t,r),this}get names(){let t=super.names;return h0(t,this.condition),this.else&&xu(t,this.else.names),t}};bu.kind="if";var vu=class extends _a{};vu.kind="for";var y3=class extends vu{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=Rd(this.iteration,t,r),this}get names(){return xu(super.names,this.iteration.names)}},g3=class extends vu{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ei.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=h0(super.names,this.from);return h0(t,this.to)}},m0=class extends vu{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=Rd(this.iterable,t,r),this}get names(){return xu(super.names,this.iterable.names)}},Fh=class extends _a{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)}};Fh.kind="func";var Lh=class extends Dh{render(t){return"return "+super.render(t)}};Lh.kind="return";var b3=class extends _a{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&&xu(t,this.catch.names),this.finally&&xu(t,this.finally.names),t}},Rh=class extends _a{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};Rh.kind="catch";var Nh=class extends _a{render(t){return"finally"+super.render(t)}};Nh.kind="finally";var c7,u7,p7,v3=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?"\n":""},this._extScope=t,this._scope=new Ei.Scope({parent:t}),this._nodes=[new h3]}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 c3(t,i,n)),i}const(t,r,n){return this._def(Ei.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ei.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ei.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new f0(t,r,n))}add(t,r){return this._leafNode(new u3(t,Ke.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ut.nil&&this._leafNode(new m3(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,ut.addCodeArg)(r,o));return r.push("}"),new ut._Code(r)}if(t,r,n){if(this._blockNode(new bu(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 bu(t))}else(){return this._elseNode(new Ld)}endIf(){return this._endBlockNode(bu,Ld)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new y3(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ei.varKinds.var:Ei.varKinds.let){let s=this._scope.toName(t);return this._for(new g3(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Ei.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ut.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ut._)(c7||(c7=E(["",".length"])),s),a=>{this.var(i,(0,ut._)(u7||(u7=E(["","[","]"])),s,a)),n(i)})}return this._for(new m0("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ei.varKinds.var:Ei.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ut._)(p7||(p7=E(["Object.keys(",")"])),r),n);let i=this._scope.toName(t);return this._for(new m0("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(vu)}label(t){return this._leafNode(new p3(t))}break(t){return this._leafNode(new d3(t))}return(t){let r=new Lh;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Lh)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new b3;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Rh(i),r(i)}return n&&(this._currNode=o.finally=new Nh,this.code(n)),this._endBlockNode(Rh,Nh)}throw(t){return this._leafNode(new f3(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=ut.nil,n,o){return this._blockNode(new Fh(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Fh)}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 bu))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}};Ke.CodeGen=v3;function xu(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function h0(e,t){return t instanceof ut._CodeOrName?xu(e,t.names):e}function Rd(e,t,r){if(e instanceof ut.Name)return n(e);if(!o(e))return e;return new ut._Code(e._items.reduce((i,s)=>(s instanceof ut.Name&&(s=n(s)),s instanceof ut._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 ut._Code&&i._items.some(s=>s instanceof ut.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function lK(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}var d7;function h7(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ut._)(d7||(d7=E(["!",""])),x3(e))}Ke.not=h7;var cK=y7(Ke.operators.AND);function uK(...e){return e.reduce(cK)}Ke.and=uK;var pK=y7(Ke.operators.OR);function dK(...e){return e.reduce(pK)}Ke.or=dK;var f7;function y7(e){return(t,r)=>t===ut.nil?r:r===ut.nil?t:(0,ut._)(f7||(f7=E([""," "," ",""])),x3(t),e,x3(r))}var m7;function x3(e){return e instanceof ut.Name?e:(0,ut._)(m7||(m7=E(["(",")"])),e)}});var Mt=H(et=>{"use strict";p();Object.defineProperty(et,"__esModule",{value:!0});et.checkStrictMode=et.getErrorPath=et.Type=et.useFunc=et.setEvaluated=et.evaluatedPropsToName=et.mergeEvaluated=et.eachItem=et.unescapeJsonPointer=et.escapeJsonPointer=et.escapeFragment=et.unescapeFragment=et.schemaRefOrVal=et.schemaHasRulesButRef=et.schemaHasRules=et.checkUnknownRules=et.alwaysValidSchema=et.toHash=void 0;var Wt=Ze(),fK=kh();function mK(e){let t={};for(let r of e)t[r]=!0;return t}et.toHash=mK;function hK(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(N7(e,t),!B7(t,e.self.RULES.all))}et.alwaysValidSchema=hK;function N7(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]||G7(e,'unknown keyword: "'.concat(i,'"'))}et.checkUnknownRules=N7;function B7(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}et.schemaHasRules=B7;function yK(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}et.schemaHasRulesButRef=yK;var v7,x7;function gK({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._)(v7||(v7=E(["",""])),r)}return(0,Wt._)(x7||(x7=E(["","","",""])),e,t,(0,Wt.getProperty)(n))}et.schemaRefOrVal=gK;function bK(e){return $7(decodeURIComponent(e))}et.unescapeFragment=bK;function vK(e){return encodeURIComponent(S3(e))}et.escapeFragment=vK;function S3(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}et.escapeJsonPointer=S3;function $7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}et.unescapeJsonPointer=$7;function xK(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}et.eachItem=xK;function g7({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 I7,S7,C7,P7,T7,w7,M7,O7,E7,_7;et.mergeEvaluated={props:g7({mergeNames:(e,t,r)=>e.if((0,Wt._)(I7||(I7=E([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,Wt._)(S7||(S7=E([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,Wt._)(C7||(C7=E([""," || {}"])),r)).code((0,Wt._)(P7||(P7=E(["Object.assign(",", ",")"])),r,t)))}),mergeToName:(e,t,r)=>e.if((0,Wt._)(T7||(T7=E([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Wt._)(w7||(w7=E([""," || {}"])),r)),C3(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:j7}),items:g7({mergeNames:(e,t,r)=>e.if((0,Wt._)(M7||(M7=E([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,Wt._)(O7||(O7=E([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),mergeToName:(e,t,r)=>e.if((0,Wt._)(E7||(E7=E([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,Wt._)(_7||(_7=E([""," > "," ? "," : ",""])),r,t,r,t))),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};var A7;function j7(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Wt._)(A7||(A7=E(["{}"]))));return t!==void 0&&C3(e,r,t),r}et.evaluatedPropsToName=j7;var k7;function C3(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Wt._)(k7||(k7=E(["","",""])),t,(0,Wt.getProperty)(n)),!0))}et.setEvaluated=C3;var b7={};function IK(e,t){return e.scopeValue("func",{ref:t,code:b7[t.code]||(b7[t.code]=new fK._Code(t.code))})}et.useFunc=IK;var I3;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(I3||(et.Type=I3={}));var D7,F7,L7,R7;function SK(e,t,r){if(e instanceof Wt.Name){let n=t===I3.Num;return r?n?(0,Wt._)(D7||(D7=E(['"[" + ',' + "]"'])),e):(0,Wt._)(F7||(F7=E(['"[\'" + ',' + "\']"'])),e):n?(0,Wt._)(L7||(L7=E(['"/" + ',""])),e):(0,Wt._)(R7||(R7=E(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,Wt.getProperty)(e).toString():"/"+S3(e)}et.getErrorPath=SK;function G7(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)}}et.checkStrictMode=G7});var Aa=H(P3=>{"use strict";p();Object.defineProperty(P3,"__esModule",{value:!0});var Sn=Ze(),CK={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")};P3.default=CK});var Bh=H(Cn=>{"use strict";p();Object.defineProperty(Cn,"__esModule",{value:!0});Cn.extendErrors=Cn.resetErrorsCount=Cn.reportExtraError=Cn.reportError=Cn.keyword$DataError=Cn.keywordError=void 0;var gt=Ze(),g0=Mt(),Gn=Aa(),U7;Cn.keywordError={message:({keyword:e})=>(0,gt.str)(U7||(U7=E(['must pass "','" keyword validation'])),e)};var V7,z7;Cn.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,gt.str)(V7||(V7=E(['"','" keyword must be '," ($data)"])),e,t):(0,gt.str)(z7||(z7=E(['"','" keyword is invalid ($data)'])),e)};var H7;function PK(e,t=Cn.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,l=h6(e,t,r);(n!=null?n:s||a)?f6(i,l):m6(o,(0,gt._)(H7||(H7=E(["[","]"])),l))}Cn.reportError=PK;function TK(e,t=Cn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=h6(e,t,r);f6(o,a),i||s||m6(n,Gn.default.vErrors)}Cn.reportExtraError=TK;var W7,q7;function wK(e,t){e.assign(Gn.default.errors,t),e.if((0,gt._)(W7||(W7=E([""," !== null"])),Gn.default.vErrors),()=>e.if(t,()=>e.assign((0,gt._)(q7||(q7=E(["",".length"])),Gn.default.vErrors),t),()=>e.assign(Gn.default.vErrors,null)))}Cn.resetErrorsCount=wK;var Z7,X7,Y7,K7,J7,Q7,e6;function MK({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,Gn.default.errors,a=>{e.const(s,(0,gt._)(Z7||(Z7=E(["","[","]"])),Gn.default.vErrors,a)),e.if((0,gt._)(X7||(X7=E(["",".instancePath === undefined"])),s),()=>e.assign((0,gt._)(Y7||(Y7=E(["",".instancePath"])),s),(0,gt.strConcat)(Gn.default.instancePath,i.errorPath))),e.assign((0,gt._)(K7||(K7=E(["",".schemaPath"])),s),(0,gt.str)(J7||(J7=E(["","/",""])),i.errSchemaPath,t)),i.opts.verbose&&(e.assign((0,gt._)(Q7||(Q7=E(["",".schema"])),s),r),e.assign((0,gt._)(e6||(e6=E(["",".data"])),s),n))})}Cn.extendErrors=MK;var t6,r6,n6,o6;function f6(e,t){let r=e.const("err",t);e.if((0,gt._)(t6||(t6=E([""," === null"])),Gn.default.vErrors),()=>e.assign(Gn.default.vErrors,(0,gt._)(r6||(r6=E(["[","]"])),r)),(0,gt._)(n6||(n6=E(["",".push(",")"])),Gn.default.vErrors,r)),e.code((0,gt._)(o6||(o6=E(["","++"])),Gn.default.errors))}var i6,s6;function m6(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,gt._)(i6||(i6=E(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,gt._)(s6||(s6=E(["",".errors"])),n),t),r.return(!1))}var Iu={keyword:new gt.Name("keyword"),schemaPath:new gt.Name("schemaPath"),params:new gt.Name("params"),propertyName:new gt.Name("propertyName"),message:new gt.Name("message"),schema:new gt.Name("schema"),parentSchema:new gt.Name("parentSchema")},a6;function h6(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,gt._)(a6||(a6=E(["{}"]))):OK(e,t,r)}function OK(e,t,r={}){let{gen:n,it:o}=e,i=[EK(o,r),_K(e,r)];return AK(e,t,i),n.object(...i)}var l6;function EK({errorPath:e},{instancePath:t}){let r=t?(0,gt.str)(l6||(l6=E(["","",""])),e,(0,g0.getErrorPath)(t,g0.Type.Str)):e;return[Gn.default.instancePath,(0,gt.strConcat)(Gn.default.instancePath,r)]}var c6,u6;function _K({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,gt.str)(c6||(c6=E(["","/",""])),t,e);return r&&(o=(0,gt.str)(u6||(u6=E(["","",""])),o,(0,g0.getErrorPath)(r,g0.Type.Str))),[Iu.schemaPath,o]}var p6,d6;function AK(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:l,propertyName:u,topSchemaRef:d,schemaPath:f}=a;n.push([Iu.keyword,o],[Iu.params,typeof t=="function"?t(e):t||(0,gt._)(p6||(p6=E(["{}"])))]),l.messages&&n.push([Iu.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([Iu.schema,s],[Iu.parentSchema,(0,gt._)(d6||(d6=E(["","",""])),d,f)],[Gn.default.data,i]),u&&n.push([Iu.propertyName,u])}});var b6=H(Nd=>{"use strict";p();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.boolOrEmptySchema=Nd.topBoolOrEmptySchema=void 0;var kK=Bh(),DK=Ze(),FK=Aa(),LK={message:"boolean schema is false"},y6;function RK(e){let{gen:t,schema:r,validateName:n}=e;r===!1?g6(e,!1):typeof r=="object"&&r.$async===!0?t.return(FK.default.data):(t.assign((0,DK._)(y6||(y6=E(["",".errors"])),n),null),t.return(!0))}Nd.topBoolOrEmptySchema=RK;function NK(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),g6(e)):r.var(t,!0)}Nd.boolOrEmptySchema=NK;function g6(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,kK.reportError)(o,LK,void 0,t)}});var T3=H(Bd=>{"use strict";p();Object.defineProperty(Bd,"__esModule",{value:!0});Bd.getRules=Bd.isJSONType=void 0;var BK=["string","number","integer","boolean","null","object","array"],$K=new Set(BK);function jK(e){return typeof e=="string"&&$K.has(e)}Bd.isJSONType=jK;function GK(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Bd.getRules=GK});var w3=H(ql=>{"use strict";p();Object.defineProperty(ql,"__esModule",{value:!0});ql.shouldUseRule=ql.shouldUseGroup=ql.schemaHasRulesForType=void 0;function UK({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&v6(e,n)}ql.schemaHasRulesForType=UK;function v6(e,t){return t.rules.some(r=>x6(e,r))}ql.shouldUseGroup=v6;function x6(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))}ql.shouldUseRule=x6});var $h=H(Pn=>{"use strict";p();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.reportTypeError=Pn.checkDataTypes=Pn.checkDataType=Pn.coerceAndCheckDataType=Pn.getJSONTypes=Pn.getSchemaTypes=Pn.DataType=void 0;var VK=T3(),zK=w3(),HK=Bh(),qe=Ze(),e9=Mt(),$d;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})($d||(Pn.DataType=$d={}));function WK(e){let t=t9(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}Pn.getSchemaTypes=WK;function t9(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(VK.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Pn.getJSONTypes=t9;function qK(e,t){let{gen:r,data:n,opts:o}=e,i=ZK(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,zK.schemaHasRulesForType)(e,t[0]));if(s){let a=O3(t,n,o.strictNumbers,$d.Wrong);r.if(a,()=>{i.length?XK(e,t,i):E3(e)})}return s}Pn.coerceAndCheckDataType=qK;var r9=new Set(["string","number","integer","boolean","null"]);function ZK(e,t){return t?e.filter(r=>r9.has(r)||t==="array"&&r==="array"):[]}var I6,S6,C6,P6,T6,w6,M6,O6,E6,_6,A6,k6,D6,F6,L6,R6,N6,B6,$6,j6;function XK(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,qe._)(I6||(I6=E(["typeof ",""])),o)),a=n.let("coerced",(0,qe._)(S6||(S6=E(["undefined"]))));i.coerceTypes==="array"&&n.if((0,qe._)(C6||(C6=E([""," == 'object' && Array.isArray(",") && ",".length == 1"])),s,o,o),()=>n.assign(o,(0,qe._)(P6||(P6=E(["","[0]"])),o)).assign(s,(0,qe._)(T6||(T6=E(["typeof ",""])),o)).if(O3(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,qe._)(w6||(w6=E([""," !== undefined"])),a));for(let u of r)(r9.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);n.else(),E3(e),n.endIf(),n.if((0,qe._)(M6||(M6=E([""," !== undefined"])),a),()=>{n.assign(o,a),YK(e,a)});function l(u){switch(u){case"string":n.elseIf((0,qe._)(O6||(O6=E(["",' == "number" || ',' == "boolean"'])),s,s)).assign(a,(0,qe._)(E6||(E6=E(['"" + ',""])),o)).elseIf((0,qe._)(_6||(_6=E([""," === null"])),o)).assign(a,(0,qe._)(A6||(A6=E(['""']))));return;case"number":n.elseIf((0,qe._)(k6||(k6=E(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),s,o,s,o,o,o)).assign(a,(0,qe._)(D6||(D6=E(["+",""])),o));return;case"integer":n.elseIf((0,qe._)(F6||(F6=E(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),s,o,s,o,o,o,o)).assign(a,(0,qe._)(L6||(L6=E(["+",""])),o));return;case"boolean":n.elseIf((0,qe._)(R6||(R6=E(["",' === "false" || '," === 0 || "," === null"])),o,o,o)).assign(a,!1).elseIf((0,qe._)(N6||(N6=E(["",' === "true" || '," === 1"])),o,o)).assign(a,!0);return;case"null":n.elseIf((0,qe._)(B6||(B6=E(["",' === "" || '," === 0 || "," === false"])),o,o,o)),n.assign(a,null);return;case"array":n.elseIf((0,qe._)($6||($6=E(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),s,s,s,o)).assign(a,(0,qe._)(j6||(j6=E(["[","]"])),o))}}}var G6,U6;function YK({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,qe._)(G6||(G6=E([""," !== undefined"])),t),()=>e.assign((0,qe._)(U6||(U6=E(["","[","]"])),t,r),n))}var V6,z6,H6,W6,q6,Z6,X6;function M3(e,t,r,n=$d.Correct){let o=n===$d.Correct?qe.operators.EQ:qe.operators.NEQ,i;switch(e){case"null":return(0,qe._)(V6||(V6=E([""," "," null"])),t,o);case"array":i=(0,qe._)(z6||(z6=E(["Array.isArray(",")"])),t);break;case"object":i=(0,qe._)(H6||(H6=E([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":i=s((0,qe._)(W6||(W6=E(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":i=s();break;default:return(0,qe._)(q6||(q6=E(["typeof "," "," ",""])),t,o,e)}return n===$d.Correct?i:(0,qe.not)(i);function s(a=qe.nil){return(0,qe.and)((0,qe._)(Z6||(Z6=E(["typeof ",' == "number"'])),t),a,r?(0,qe._)(X6||(X6=E(["isFinite(",")"])),t):qe.nil)}}Pn.checkDataType=M3;var Y6,K6;function O3(e,t,r,n){if(e.length===1)return M3(e[0],t,r,n);let o,i=(0,e9.toHash)(e);if(i.array&&i.object){let s=(0,qe._)(Y6||(Y6=E(["typeof ",' != "object"'])),t);o=i.null?s:(0,qe._)(K6||(K6=E(["!"," || ",""])),t,s),delete i.null,delete i.array,delete i.object}else o=qe.nil;i.number&&delete i.integer;for(let s in i)o=(0,qe.and)(o,M3(s,t,r,n));return o}Pn.checkDataTypes=O3;var J6,Q6,KK={message:({schema:e})=>"must be ".concat(e),params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,qe._)(J6||(J6=E(["{type: ","}"])),e):(0,qe._)(Q6||(Q6=E(["{type: ","}"])),t)};function E3(e){let t=JK(e);(0,HK.reportError)(t,KK)}Pn.reportTypeError=E3;function JK(e){let{gen:t,data:r,schema:n}=e,o=(0,e9.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var l9=H(b0=>{"use strict";p();Object.defineProperty(b0,"__esModule",{value:!0});b0.assignDefaults=void 0;var jd=Ze(),QK=Mt();function eJ(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)n9(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>n9(e,i,o.default))}b0.assignDefaults=eJ;var o9,i9,s9,a9;function n9(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,jd._)(o9||(o9=E(["","",""])),i,(0,jd.getProperty)(t));if(o){(0,QK.checkStrictMode)(e,"default is ignored for: ".concat(a));return}let l=(0,jd._)(i9||(i9=E([""," === undefined"])),a);s.useDefaults==="empty"&&(l=(0,jd._)(s9||(s9=E([""," || "," === null || ",' === ""'])),l,a,a)),n.if(l,(0,jd._)(a9||(a9=E([""," = ",""])),a,(0,jd.stringify)(r)))}});var qo=H(Gt=>{"use strict";p();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 tr=Ze(),_3=Mt(),Zl=Aa(),tJ=Mt(),c9;function rJ(e,t){let{gen:r,data:n,it:o}=e;r.if(k3(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,tr._)(c9||(c9=E(["",""])),t)},!0),e.error()})}Gt.checkReportMissingProp=rJ;var u9;function nJ({gen:e,data:t,it:{opts:r}},n,o){return(0,tr.or)(...n.map(i=>(0,tr.and)(k3(e,t,i,r.ownProperties),(0,tr._)(u9||(u9=E([""," = ",""])),o,i))))}Gt.checkMissingProp=nJ;function oJ(e,t){e.setParams({missingProperty:t},!0),e.error()}Gt.reportMissingProp=oJ;var p9;function P9(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,tr._)(p9||(p9=E(["Object.prototype.hasOwnProperty"])))})}Gt.hasPropFunc=P9;var d9;function A3(e,t,r){return(0,tr._)(d9||(d9=E(["",".call(",", ",")"])),P9(e),t,r)}Gt.isOwnProperty=A3;var f9,m9;function iJ(e,t,r,n){let o=(0,tr._)(f9||(f9=E(["",""," !== undefined"])),t,(0,tr.getProperty)(r));return n?(0,tr._)(m9||(m9=E([""," && ",""])),o,A3(e,t,r)):o}Gt.propertyInData=iJ;var h9;function k3(e,t,r,n){let o=(0,tr._)(h9||(h9=E(["",""," === undefined"])),t,(0,tr.getProperty)(r));return n?(0,tr.or)(o,(0,tr.not)(A3(e,t,r))):o}Gt.noPropertyInData=k3;function T9(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Gt.allSchemaProperties=T9;function sJ(e,t){return T9(t).filter(r=>!(0,_3.alwaysValidSchema)(e,t[r]))}Gt.schemaProperties=sJ;var y9,g9,b9,v9;function aJ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,l,u){let d=u?(0,tr._)(y9||(y9=E(["",", ",", ","",""])),e,t,n,o):t,f=[[Zl.default.instancePath,(0,tr.strConcat)(Zl.default.instancePath,i)],[Zl.default.parentData,s.parentData],[Zl.default.parentDataProperty,s.parentDataProperty],[Zl.default.rootData,Zl.default.rootData]];s.opts.dynamicRef&&f.push([Zl.default.dynamicAnchors,Zl.default.dynamicAnchors]);let h=(0,tr._)(g9||(g9=E(["",", ",""])),d,r.object(...f));return l!==tr.nil?(0,tr._)(b9||(b9=E(["",".call(",", ",")"])),a,l,h):(0,tr._)(v9||(v9=E(["","(",")"])),a,h)}Gt.callValidateCode=aJ;var x9,lJ=(0,tr._)(x9||(x9=E(["new RegExp"]))),I9;function cJ({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,tr._)(I9||(I9=E(["","(",", ",")"])),o.code==="new RegExp"?lJ:(0,tJ.useFunc)(e,o),r,n)})}Gt.usePattern=cJ;var S9;function uJ(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,tr._)(S9||(S9=E(["",".length"])),r));t.forRange("i",0,l,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:_3.Type.Num},i),t.if((0,tr.not)(i),a)})}}Gt.validateArray=uJ;var C9;function pJ(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,_3.alwaysValidSchema)(o,l))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((l,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,tr._)(C9||(C9=E([""," || ",""])),s,a)),e.mergeValidEvaluated(d,a)||t.if((0,tr.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}Gt.validateUnion=pJ});var B9=H(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.validateKeywordUsage=Cs.validSchemaType=Cs.funcKeywordCode=Cs.macroKeywordCode=void 0;var Un=Ze(),Su=Aa(),dJ=qo(),fJ=Bh();function mJ(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),l=N9(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:Un.nil,errSchemaPath:"".concat(s.errSchemaPath,"/").concat(n),topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Cs.macroKeywordCode=mJ;var M9,O9,E9,_9,A9,k9;function hJ(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:l}=e;gJ(l,t);let u=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,d=N9(n,o,u),f=n.let("valid");e.block$data(f,h),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function h(){if(t.errors===!1)I(),t.modifying&&w9(e),x(()=>e.error());else{let C=t.async?b():v();t.modifying&&w9(e),x(()=>yJ(e,C))}}function b(){let C=n.let("ruleErrs",null);return n.try(()=>I((0,Un._)(M9||(M9=E(["await "])))),P=>n.assign(f,!1).if((0,Un._)(O9||(O9=E([""," instanceof ",""])),P,l.ValidationError),()=>n.assign(C,(0,Un._)(E9||(E9=E(["",".errors"])),P)),()=>n.throw(P))),C}function v(){let C=(0,Un._)(_9||(_9=E(["",".errors"])),d);return n.assign(C,null),I(Un.nil),C}function I(C=t.async?(0,Un._)(A9||(A9=E(["await "]))):Un.nil){let P=l.opts.passContext?Su.default.this:Su.default.self,w=!("compile"in t&&!a||t.schema===!1);n.assign(f,(0,Un._)(k9||(k9=E(["","",""])),C,(0,dJ.callValidateCode)(e,d,P,w)),t.modifying)}function x(C){var P;n.if((0,Un.not)((P=t.valid)!==null&&P!==void 0?P:f),C)}}Cs.funcKeywordCode=hJ;var D9;function w9(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Un._)(D9||(D9=E(["","[","]"])),n.parentData,n.parentDataProperty)))}var F9,L9,R9;function yJ(e,t){let{gen:r}=e;r.if((0,Un._)(F9||(F9=E(["Array.isArray(",")"])),t),()=>{r.assign(Su.default.vErrors,(0,Un._)(L9||(L9=E([""," === null ? "," : ",".concat(",")"])),Su.default.vErrors,t,Su.default.vErrors,t)).assign(Su.default.errors,(0,Un._)(R9||(R9=E(["",".length"])),Su.default.vErrors)),(0,fJ.extendErrors)(e)},()=>e.error())}function gJ({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function N9(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,Un.stringify)(r)})}function bJ(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")}Cs.validSchemaType=bJ;function vJ({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)}}Cs.validateKeywordUsage=vJ});var H9=H(Xl=>{"use strict";p();Object.defineProperty(Xl,"__esModule",{value:!0});Xl.extendSubschemaMode=Xl.extendSubschemaData=Xl.getSubschema=void 0;var Ps=Ze(),z9=Mt(),$9,j9;function xJ(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,Ps._)($9||($9=E(["","",""])),e.schemaPath,(0,Ps.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:a[r],schemaPath:(0,Ps._)(j9||(j9=E(["","","",""])),e.schemaPath,(0,Ps.getProperty)(t),(0,Ps.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,z9.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')}Xl.getSubschema=xJ;var G9,U9,V9;function IJ(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:u,dataPathArr:d,opts:f}=t,h=a.let("data",(0,Ps._)(G9||(G9=E(["","",""])),t.data,(0,Ps.getProperty)(r)),!0);l(h),e.errorPath=(0,Ps.str)(U9||(U9=E(["","",""])),u,(0,z9.getErrorPath)(r,n,f.jsPropertySyntax)),e.parentDataProperty=(0,Ps._)(V9||(V9=E(["",""])),r),e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Ps.Name?o:a.let("data",o,!0);l(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Xl.extendSubschemaData=IJ;function SJ(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}Xl.extendSubschemaMode=SJ});var D3=H((MMe,W9)=>{"use strict";p();W9.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 Z9=H((EMe,q9)=>{"use strict";p();var Yl=q9.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(){};v0(t,n,o,e,"",e)};Yl.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Yl.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Yl.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Yl.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 v0(e,t,r,n,o,i,s,a,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,l,u);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in Yl.arrayKeywords)for(var h=0;h<f.length;h++)v0(e,t,r,f[h],o+"/"+d+"/"+h,i,o,d,n,h)}else if(d in Yl.propsKeywords){if(f&&typeof f=="object")for(var b in f)v0(e,t,r,f[b],o+"/"+d+"/"+CJ(b),i,o,d,n,b)}else(d in Yl.keywords||e.allKeys&&!(d in Yl.skipKeywords))&&v0(e,t,r,f,o+"/"+d,i,o,d,n)}r(n,o,i,s,a,l,u)}}function CJ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var jh=H(lo=>{"use strict";p();Object.defineProperty(lo,"__esModule",{value:!0});lo.getSchemaRefs=lo.resolveUrl=lo.normalizeId=lo._getFullPath=lo.getFullPath=lo.inlineRef=void 0;var PJ=Mt(),TJ=D3(),wJ=Z9(),MJ=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function OJ(e,t=!0){return typeof e=="boolean"?!0:t===!0?!F3(e):t?X9(e)<=t:!1}lo.inlineRef=OJ;var EJ=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function F3(e){for(let t in e){if(EJ.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(F3)||typeof r=="object"&&F3(r))return!0}return!1}function X9(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!MJ.has(r)&&(typeof e[r]=="object"&&(0,PJ.eachItem)(e[r],n=>t+=X9(n)),t===1/0))return 1/0}return t}function Y9(e,t="",r){r!==!1&&(t=Gd(t));let n=e.parse(t);return K9(e,n)}lo.getFullPath=Y9;function K9(e,t){return e.serialize(t).split("#")[0]+"#"}lo._getFullPath=K9;var _J=/#\/?$/;function Gd(e){return e?e.replace(_J,""):""}lo.normalizeId=Gd;function AJ(e,t,r){return r=Gd(r),e.resolve(t,r)}lo.resolveUrl=AJ;var kJ=/^[a-z_][-a-z0-9._]*$/i;function DJ(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Gd(e[r]||t),i={"":o},s=Y9(n,o,!1),a={},l=new Set;return wJ(e,{allKeys:!0},(f,h,b,v)=>{if(v===void 0)return;let I=s+h,x=i[v];typeof f[r]=="string"&&(x=C.call(this,f[r])),P.call(this,f.$anchor),P.call(this,f.$dynamicAnchor),i[h]=x;function C(w){let T=this.opts.uriResolver.resolve;if(w=Gd(x?T(x,w):w),l.has(w))throw d(w);l.add(w);let O=this.refs[w];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?u(f,O.schema,w):w!==Gd(I)&&(w[0]==="#"?(u(f,a[w],w),a[w]=f):this.refs[w]=I),w}function P(w){if(typeof w=="string"){if(!kJ.test(w))throw new Error('invalid anchor "'.concat(w,'"'));C.call(this,"#".concat(w))}}}),a;function u(f,h,b){if(h!==void 0&&!TJ(f,h))throw d(b)}function d(f){return new Error('reference "'.concat(f,'" resolves to more than one schema'))}}lo.getSchemaRefs=DJ});var Vh=H(Kl=>{"use strict";p();Object.defineProperty(Kl,"__esModule",{value:!0});Kl.getData=Kl.KeywordCxt=Kl.validateFunctionCode=void 0;var G_=b6(),J9=$h(),R3=w3(),x0=$h(),FJ=l9(),Uh=B9(),L3=H9(),Te=Ze(),je=Aa(),LJ=jh(),ka=Mt(),Gh=Bh();function RJ(e){if(z_(e)&&(H_(e),V_(e))){$J(e);return}U_(e,()=>(0,G_.topBoolOrEmptySchema)(e))}Kl.validateFunctionCode=RJ;var r_,n_,o_;function U_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,Te._)(r_||(r_=E(["",", ",""])),je.default.data,je.default.valCxt),n.$async,()=>{e.code((0,Te._)(n_||(n_=E(['"use strict"; ',""])),Q9(r,o))),BJ(e,o),e.code(i)}):e.func(t,(0,Te._)(o_||(o_=E(["",", ",""])),je.default.data,NJ(o)),n.$async,()=>e.code(Q9(r,o)).code(i))}var i_,s_;function NJ(e){return(0,Te._)(s_||(s_=E(["{",'="", ',", ",", ","=","","}={}"])),je.default.instancePath,je.default.parentData,je.default.parentDataProperty,je.default.rootData,je.default.data,e.dynamicRef?(0,Te._)(i_||(i_=E([", ","={}"])),je.default.dynamicAnchors):Te.nil)}var a_,l_,c_,u_,p_,d_,f_,m_,h_;function BJ(e,t){e.if(je.default.valCxt,()=>{e.var(je.default.instancePath,(0,Te._)(a_||(a_=E(["",".",""])),je.default.valCxt,je.default.instancePath)),e.var(je.default.parentData,(0,Te._)(l_||(l_=E(["",".",""])),je.default.valCxt,je.default.parentData)),e.var(je.default.parentDataProperty,(0,Te._)(c_||(c_=E(["",".",""])),je.default.valCxt,je.default.parentDataProperty)),e.var(je.default.rootData,(0,Te._)(u_||(u_=E(["",".",""])),je.default.valCxt,je.default.rootData)),t.dynamicRef&&e.var(je.default.dynamicAnchors,(0,Te._)(p_||(p_=E(["",".",""])),je.default.valCxt,je.default.dynamicAnchors))},()=>{e.var(je.default.instancePath,(0,Te._)(d_||(d_=E(['""'])))),e.var(je.default.parentData,(0,Te._)(f_||(f_=E(["undefined"])))),e.var(je.default.parentDataProperty,(0,Te._)(m_||(m_=E(["undefined"])))),e.var(je.default.rootData,je.default.data),t.dynamicRef&&e.var(je.default.dynamicAnchors,(0,Te._)(h_||(h_=E(["{}"]))))})}function $J(e){let{schema:t,opts:r,gen:n}=e;U_(e,()=>{r.$comment&&t.$comment&&q_(e),zJ(e),n.let(je.default.vErrors,null),n.let(je.default.errors,0),r.unevaluated&&jJ(e),W_(e),qJ(e)})}var y_,g_,b_,v_,x_,I_,S_;function jJ(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Te._)(y_||(y_=E(["",".evaluated"])),r)),t.if((0,Te._)(g_||(g_=E(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,Te._)(b_||(b_=E(["",".props"])),e.evaluated),(0,Te._)(v_||(v_=E(["undefined"]))))),t.if((0,Te._)(x_||(x_=E(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,Te._)(I_||(I_=E(["",".items"])),e.evaluated),(0,Te._)(S_||(S_=E(["undefined"])))))}var C_;function Q9(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Te._)(C_||(C_=E(["/*# sourceURL="," */"])),r):Te.nil}function GJ(e,t){if(z_(e)&&(H_(e),V_(e))){UJ(e,t);return}(0,G_.boolOrEmptySchema)(e,t)}function V_({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 z_(e){return typeof e.schema!="boolean"}var P_;function UJ(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&q_(e),HJ(e),WJ(e);let i=n.const("_errs",je.default.errors);W_(e,i),n.var(t,(0,Te._)(P_||(P_=E([""," === ",""])),i,je.default.errors))}function H_(e){(0,ka.checkUnknownRules)(e),VJ(e)}function W_(e,t){if(e.opts.jtd)return e_(e,[],!1,t);let r=(0,J9.getSchemaTypes)(e.schema),n=(0,J9.coerceAndCheckDataType)(e,r);e_(e,r,!n,t)}function VJ(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,ka.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}function zJ(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ka.checkStrictMode)(e,"default is ignored in the schema root")}function HJ(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,LJ.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function WJ(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}var T_,w_,M_;function q_({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,Te._)(T_||(T_=E(["",".logger.log(",")"])),je.default.self,i));else if(typeof o.$comment=="function"){let s=(0,Te.str)(w_||(w_=E(["","/$comment"])),n),a=e.scopeValue("root",{ref:t.root});e.code((0,Te._)(M_||(M_=E(["",".opts.$comment(",", ",", ",".schema)"])),je.default.self,i,s,a))}}var O_,E_,__,A_;function qJ(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,Te._)(O_||(O_=E([""," === 0"])),je.default.errors),()=>t.return(je.default.data),()=>t.throw((0,Te._)(E_||(E_=E(["new ","(",")"])),o,je.default.vErrors))):(t.assign((0,Te._)(__||(__=E(["",".errors"])),n),je.default.vErrors),i.unevaluated&&ZJ(e),t.return((0,Te._)(A_||(A_=E([""," === 0"])),je.default.errors)))}var k_,D_;function ZJ({gen:e,evaluated:t,props:r,items:n}){r instanceof Te.Name&&e.assign((0,Te._)(k_||(k_=E(["",".props"])),t),r),n instanceof Te.Name&&e.assign((0,Te._)(D_||(D_=E(["",".items"])),t),n)}var F_;function e_(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:l,self:u}=e,{RULES:d}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,ka.schemaHasRulesButRef)(i,d))){o.block(()=>X_(e,"$ref",d.all.$ref.definition));return}l.jtd||XJ(e,t),o.block(()=>{for(let h of d.rules)f(h);f(d.post)});function f(h){(0,R3.shouldUseGroup)(i,h)&&(h.type?(o.if((0,x0.checkDataType)(h.type,s,l.strictNumbers)),t_(e,h),t.length===1&&t[0]===h.type&&r&&(o.else(),(0,x0.reportTypeError)(e)),o.endIf()):t_(e,h),a||o.if((0,Te._)(F_||(F_=E([""," === ",""])),je.default.errors,n||0)))}}function t_(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,FJ.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,R3.shouldUseRule)(n,i)&&X_(e,i.keyword,i.definition,t.type)})}function XJ(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(YJ(e,t),e.opts.allowUnionTypes||KJ(e,t),JJ(e,e.dataTypes))}function YJ(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Z_(e.dataTypes,r)||N3(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),eQ(e,t)}}function KJ(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&N3(e,"use allowUnionTypes to allow union type keyword")}function JJ(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,R3.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>QJ(t,s))&&N3(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(n,'"'))}}}function QJ(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Z_(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function eQ(e,t){let r=[];for(let n of e.dataTypes)Z_(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function N3(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,ka.checkStrictMode)(e,t,e.opts.strictTypes)}var L_,R_,N_,B_,I0=class{constructor(t,r,n){if((0,Uh.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,ka.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",Y_(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Uh.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",je.default.errors))}result(t,r,n){this.failResult((0,Te.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,Te.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,Te._)(L_||(L_=E([""," !== undefined && (",")"])),r,(0,Te.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?Gh.reportExtraError:Gh.reportError)(this,this.def.error,r)}$dataError(){(0,Gh.reportError)(this,this.def.$dataError||Gh.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Gh.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=Te.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Te.nil,r=Te.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,Te.or)((0,Te._)(R_||(R_=E([""," === undefined"])),o),r)),t!==Te.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Te.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,Te.or)(s(),a());function s(){if(n.length){if(!(r instanceof Te.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,Te._)(N_||(N_=E(["",""])),(0,x0.checkDataTypes)(l,r,i.opts.strictNumbers,x0.DataType.Wrong))}return Te.nil}function a(){if(o.validateSchema){let l=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,Te._)(B_||(B_=E(["!","(",")"])),l,r)}return Te.nil}}subschema(t,r){let n=(0,L3.getSubschema)(this.it,t);(0,L3.extendSubschemaData)(n,this.it,t),(0,L3.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return GJ(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=ka.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=ka.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,Te.Name)),!0}};Kl.KeywordCxt=I0;function X_(e,t,r,n){let o=new I0(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,Uh.funcKeywordCode)(o,r):"macro"in r?(0,Uh.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,Uh.funcKeywordCode)(o,r)}var tQ=/^\/(?:[^~]|~0|~1)*$/,rQ=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,$_,j_;function Y_(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return je.default.rootData;if(e[0]==="/"){if(!tQ.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));o=e,i=je.default.rootData}else{let u=rQ.exec(e);if(!u)throw new Error("Invalid JSON-pointer: ".concat(e));let d=+u[1];if(o=u[2],o==="#"){if(d>=t)throw new Error(l("property/index",d));return n[t-d]}if(d>t)throw new Error(l("data",d));if(i=r[t-d],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,Te._)($_||($_=E(["","",""])),i,(0,Te.getProperty)((0,ka.unescapeJsonPointer)(u))),s=(0,Te._)(j_||(j_=E([""," && ",""])),s,i));return s;function l(u,d){return"Cannot access ".concat(u," ").concat(d," levels up, current level is ").concat(t)}}Kl.getData=Y_});var S0=H($3=>{"use strict";p();Object.defineProperty($3,"__esModule",{value:!0});var B3=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};$3.default=B3});var zh=H(U3=>{"use strict";p();Object.defineProperty(U3,"__esModule",{value:!0});var j3=jh(),G3=class extends Error{constructor(t,r,n,o){super(o||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,j3.resolveUrl)(t,r,n),this.missingSchema=(0,j3.normalizeId)((0,j3.getFullPath)(t,this.missingRef))}};U3.default=G3});var P0=H(Zo=>{"use strict";p();Object.defineProperty(Zo,"__esModule",{value:!0});Zo.resolveSchema=Zo.getCompilingSchema=Zo.resolveRef=Zo.compileSchema=Zo.SchemaEnv=void 0;var _i=Ze(),nQ=S0(),Cu=Aa(),Ai=jh(),K_=Mt(),oQ=Vh(),Ud=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,Ai.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={}}};Zo.SchemaEnv=Ud;var J_,Q_;function z3(e){let t=e8.call(this,e);if(t)return t;let r=(0,Ai.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new _i.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:nQ.default,code:(0,_i._)(J_||(J_=E(['require("ajv/dist/runtime/validation_error").default'])))}));let l=s.scopeName("validate");e.validateName=l;let u={gen:s,allErrors:this.opts.allErrors,data:Cu.default.data,parentData:Cu.default.parentData,parentDataProperty:Cu.default.parentDataProperty,dataNames:[Cu.default.data],dataPathArr:[_i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,_i.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:_i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,_i._)(Q_||(Q_=E(['""']))),opts:this.opts,self:this},d;try{this._compilations.add(e),(0,oQ.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let f=s.toString();d="".concat(s.scopeRefs(Cu.default.scope),"return ").concat(f),this.opts.code.process&&(d=this.opts.code.process(d,e));let b=new Function("".concat(Cu.default.self),"".concat(Cu.default.scope),d)(this,this.scope.get());if(this.scope.value(l,{ref:b}),b.errors=null,b.schema=e.schema,b.schemaEnv=e,e.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:l,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){let{props:v,items:I}=u;b.evaluated={props:v instanceof _i.Name?void 0:v,items:I instanceof _i.Name?void 0:I,dynamicProps:v instanceof _i.Name,dynamicItems:I instanceof _i.Name},b.source&&(b.source.evaluated=(0,_i.stringify)(b.evaluated))}return e.validate=b,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}Zo.compileSchema=z3;function iQ(e,t,r){var n;r=(0,Ai.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=lQ.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 Ud({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=sQ.call(this,i)}Zo.resolveRef=iQ;function sQ(e){return(0,Ai.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:z3.call(this,e)}function e8(e){for(let t of this._compilations)if(aQ(t,e))return t}Zo.getCompilingSchema=e8;function aQ(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function lQ(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||C0.call(this,e,t)}function C0(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ai._getFullPath)(this.opts.uriResolver,r),o=(0,Ai.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return V3.call(this,r,e);let i=(0,Ai.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=C0.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:V3.call(this,r,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||z3.call(this,s),i===(0,Ai.normalizeId)(t)){let{schema:a}=s,{schemaId:l}=this.opts,u=a[l];return u&&(o=(0,Ai.resolveUrl)(this.opts.uriResolver,o,u)),new Ud({schema:a,schemaId:l,root:e,baseId:o})}return V3.call(this,r,s)}}Zo.resolveSchema=C0;var cQ=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function V3(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,K_.unescapeFragment)(a)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!cQ.has(a)&&u&&(t=(0,Ai.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,K_.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ai.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=C0.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Ud({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var t8=H((VMe,uQ)=>{uQ.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 n8=H((zMe,r8)=>{"use strict";p();var pQ={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};r8.exports={HEX:pQ}});var p8=H((WMe,u8)=>{"use strict";p();var{HEX:dQ}=n8(),fQ=/^(?:(?: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 a8(e){if(c8(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(fQ)||[],[r]=t;return r?{host:hQ(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function H3(e,t=!1){let r="",n=!0;for(let o of e){if(dQ[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}function mQ(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 u=H3(o);if(u!==void 0)n.push(u);else return r.error=!0,!1}o.length=0}return!0}for(let u=0;u<e.length;u++){let d=e[u];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!0),!l())break;if(t++,n.push(":"),t>7){r.error=!0;break}u-1>=0&&e[u-1]===":"&&(s=!0);continue}else if(d==="%"){if(!l())break;i=!0}else{o.push(d);continue}}return o.length&&(i?r.zone=o.join(""):a?n.push(o.join("")):n.push(H3(o))),r.address=n.join(""),r}function l8(e){if(c8(e,":")<2)return{host:e,isIPV6:!1};let t=mQ(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 hQ(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 c8(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var o8=/^\.\.?\//u,i8=/^\/\.(?:\/|$)/u,s8=/^\/\.\.(?:\/|$)/u,yQ=/^\/?(?:.|\n)*?(?=\/|$)/u;function gQ(e){let t=[];for(;e.length;)if(e.match(o8))e=e.replace(o8,"");else if(e.match(i8))e=e.replace(i8,"/");else if(e.match(s8))e=e.replace(s8,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(yQ);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 bQ(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 vQ(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=a8(r);if(n.isIPV4)r=n.host;else{let o=l8(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}u8.exports={recomposeAuthority:vQ,normalizeComponentEncoding:bQ,removeDotSegments:gQ,normalizeIPv4:a8,normalizeIPv6:l8,stringArrayToHexStripped:H3}});var g8=H((ZMe,y8)=>{"use strict";p();var xQ=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,IQ=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function d8(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function f8(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function m8(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 SQ(e){return e.secure=d8(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function CQ(e){if((e.port===(d8(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 PQ(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(IQ);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=W3[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function TQ(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o="".concat(r,":").concat(t.nid||n),i=W3[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 wQ(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!xQ.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function MQ(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var h8={scheme:"http",domainHost:!0,parse:f8,serialize:m8},OQ={scheme:"https",domainHost:h8.domainHost,parse:f8,serialize:m8},T0={scheme:"ws",domainHost:!0,parse:SQ,serialize:CQ},EQ={scheme:"wss",domainHost:T0.domainHost,parse:T0.parse,serialize:T0.serialize},_Q={scheme:"urn",parse:PQ,serialize:TQ,skipNormalize:!0},AQ={scheme:"urn:uuid",parse:wQ,serialize:MQ,skipNormalize:!0},W3={http:h8,https:OQ,ws:T0,wss:EQ,urn:_Q,"urn:uuid":AQ};y8.exports=W3});var v8=H((YMe,M0)=>{"use strict";p();var{normalizeIPv6:kQ,normalizeIPv4:DQ,removeDotSegments:Hh,recomposeAuthority:FQ,normalizeComponentEncoding:w0}=p8(),q3=g8();function LQ(e,t){return typeof e=="string"?e=Ts(Da(e,t),t):typeof e=="object"&&(e=Da(Ts(e,t),t)),e}function RQ(e,t,r){let n=Object.assign({scheme:"null"},r),o=b8(Da(e,n),Da(t,n),n,!0);return Ts(o,{...n,skipEscape:!0})}function b8(e,t,r,n){let o={};return n||(e=Da(Ts(e,r),r),t=Da(Ts(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=Hh(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=Hh(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=Hh(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=Hh(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 NQ(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ts(w0(Da(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ts(w0(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ts(w0(Da(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ts(w0(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Ts(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=q3[(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=FQ(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=Hh(a)),s===void 0&&(a=a.replace(/^\/\//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 BQ=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function $Q(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||BQ[t])return!0;return!1}var jQ=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Da(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(jQ);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=DQ(n.host);if(l.isIPV4===!1){let u=kQ(l.host);n.host=u.host.toLowerCase(),i=u.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=q3[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&$Q(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 Z3={SCHEMES:q3,normalize:LQ,resolve:RQ,resolveComponents:b8,equal:NQ,serialize:Ts,parse:Da};M0.exports=Z3;M0.exports.default=Z3;M0.exports.fastUri=Z3});var I8=H(X3=>{"use strict";p();Object.defineProperty(X3,"__esModule",{value:!0});var x8=v8();x8.code='require("ajv/dist/runtime/uri").default';X3.default=x8});var E8=H(nn=>{"use strict";p();Object.defineProperty(nn,"__esModule",{value:!0});nn.CodeGen=nn.Name=nn.nil=nn.stringify=nn.str=nn._=nn.KeywordCxt=void 0;var GQ=Vh();Object.defineProperty(nn,"KeywordCxt",{enumerable:!0,get:function(){return GQ.KeywordCxt}});var Vd=Ze();Object.defineProperty(nn,"_",{enumerable:!0,get:function(){return Vd._}});Object.defineProperty(nn,"str",{enumerable:!0,get:function(){return Vd.str}});Object.defineProperty(nn,"stringify",{enumerable:!0,get:function(){return Vd.stringify}});Object.defineProperty(nn,"nil",{enumerable:!0,get:function(){return Vd.nil}});Object.defineProperty(nn,"Name",{enumerable:!0,get:function(){return Vd.Name}});Object.defineProperty(nn,"CodeGen",{enumerable:!0,get:function(){return Vd.CodeGen}});var UQ=S0(),w8=zh(),VQ=T3(),Wh=P0(),zQ=Ze(),qh=jh(),O0=$h(),K3=Mt(),S8=t8(),HQ=I8(),M8=(e,t)=>new RegExp(e,t);M8.code="new RegExp";var WQ=["removeAdditional","useDefaults","coerceTypes"],qQ=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),ZQ={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."},XQ={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},C8=200;function YQ(e){var t,r,n,o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w,T,O,N,k,D,F;let z=e.strict,G=(t=e.code)===null||t===void 0?void 0:t.optimize,j=G===!0||G===void 0?1:G||0,K=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:M8,Z=(o=e.uriResolver)!==null&&o!==void 0?o:HQ.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:z)!==null&&s!==void 0?s:!0,strictNumbers:(l=(a=e.strictNumbers)!==null&&a!==void 0?a:z)!==null&&l!==void 0?l:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:z)!==null&&d!==void 0?d:"log",strictTuples:(h=(f=e.strictTuples)!==null&&f!==void 0?f:z)!==null&&h!==void 0?h:"log",strictRequired:(v=(b=e.strictRequired)!==null&&b!==void 0?b:z)!==null&&v!==void 0?v:!1,code:e.code?{...e.code,optimize:j,regExp:K}:{optimize:j,regExp:K},loopRequired:(I=e.loopRequired)!==null&&I!==void 0?I:C8,loopEnum:(x=e.loopEnum)!==null&&x!==void 0?x:C8,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:(T=e.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(O=e.addUsedSchema)!==null&&O!==void 0?O:!0,validateSchema:(N=e.validateSchema)!==null&&N!==void 0?N:!0,validateFormats:(k=e.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(D=e.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(F=e.int32range)!==null&&F!==void 0?F:!0,uriResolver:Z}}var Zh=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...YQ(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new zQ.ValueScope({scope:{},prefixes:qQ,es5:r,lines:n}),this.logger=ree(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,VQ.getRules)(),P8.call(this,ZQ,t,"NOT SUPPORTED"),P8.call(this,XQ,t,"DEPRECATED","warn"),this._metaOpts=eee.call(this),t.formats&&JQ.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&QQ.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),KQ.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=S8;n==="id"&&(o={...S8},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(d,f){await i.call(this,d.$schema);let h=this._addSchema(d,f);return h.validate||s.call(this,h)}async function i(d){d&&!this.getSchema(d)&&await o.call(this,{$ref:d},!0)}async function s(d){try{return this._compileSchemaEnv(d)}catch(f){if(!(f instanceof w8.default))throw f;return a.call(this,f),await l.call(this,f.missingSchema),s.call(this,d)}}function a({missingSchema:d,missingRef:f}){if(this.refs[d])throw new Error("AnySchema ".concat(d," is loaded but ").concat(f," cannot be resolved"))}async function l(d){let f=await u.call(this,d);this.refs[d]||await i.call(this,f.$schema),this.refs[d]||this.addSchema(f,d,r)}async function u(d){let f=this._loading[d];if(f)return f;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let 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,qh.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=T8.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Wh.SchemaEnv({schema:{},schemaId:n});if(r=Wh.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=T8.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,qh.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(oee.call(this,n,r),!r)return(0,K3.eachItem)(n,i=>Y3.call(this,i)),this;see.call(this,r);let o={...r,type:(0,O0.getJSONTypes)(r.type),schemaType:(0,O0.getJSONTypes)(r.schemaType)};return(0,K3.eachItem)(n,o.type.length===0?i=>Y3.call(this,i,o):i=>o.type.forEach(s=>Y3.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:u}=l.definition,d=s[a];u&&d&&(s[a]=O8(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let 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,qh.normalizeId)(s||n);let u=qh.getSchemaRefs.call(this,t,n);return l=new Wh.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),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):Wh.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{Wh.compileSchema.call(this,t)}finally{this.opts=r}}};Zh.ValidationError=UQ.default;Zh.MissingRefError=w8.default;nn.default=Zh;function P8(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 T8(e){return e=(0,qh.normalizeId)(e),this.schemas[e]||this.refs[e]}function KQ(){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 JQ(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function QQ(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 eee(){let e={...this.opts};for(let t of WQ)delete e[t];return e}var tee={log(){},warn(){},error(){}};function ree(e){if(e===!1)return tee;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 nee=/^[a-z_$][a-z0-9_$:-]*$/i;function oee(e,t){let{RULES:r}=this;if((0,K3.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!nee.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 Y3(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:{...t,type:(0,O0.getJSONTypes)(t.type),schemaType:(0,O0.getJSONTypes)(t.schemaType)}};t.before?iee.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 iee(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 see(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=O8(t)),e.validateSchema=this.compile(t,!0))}var aee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O8(e){return{anyOf:[e,aee]}}});var _8=H(J3=>{"use strict";p();Object.defineProperty(J3,"__esModule",{value:!0});var lee={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};J3.default=lee});var V8=H(Pu=>{"use strict";p();Object.defineProperty(Pu,"__esModule",{value:!0});Pu.callRef=Pu.getValidate=void 0;var cee=zh(),A8=qo(),co=Ze(),zd=Aa(),k8=P0(),E0=Mt(),D8,uee={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:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return f();let d=k8.resolveRef.call(l,u,o,r);if(d===void 0)throw new cee.default(n.opts.uriResolver,o,r);if(d instanceof k8.SchemaEnv)return h(d);return b(d);function f(){if(i===u)return _0(e,s,i,i.$async);let v=t.scopeValue("root",{ref:u});return _0(e,(0,co._)(D8||(D8=E(["",".validate"])),v),u,u.$async)}function h(v){let I=U8(e,v);_0(e,I,v,v.$async)}function b(v){let I=t.scopeValue("schema",a.code.source===!0?{ref:v,code:(0,co.stringify)(v)}:{ref:v}),x=t.name("valid"),C=e.subschema({schema:v,dataTypes:[],schemaPath:co.nil,topSchemaRef:I,errSchemaPath:r},x);e.mergeEvaluated(C),e.ok(x)}}},F8;function U8(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,co._)(F8||(F8=E(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}Pu.getValidate=U8;var L8,R8,N8,B8,$8,j8,G8;function _0(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,u=l.passContext?zd.default.this:co.nil;n?d():f();function d(){if(!a.$async)throw new Error("async schema referenced by sync schema");let v=o.let("valid");o.try(()=>{o.code((0,co._)(L8||(L8=E(["await ",""])),(0,A8.callValidateCode)(e,t,u))),b(t),s||o.assign(v,!0)},I=>{o.if((0,co._)(R8||(R8=E(["!("," instanceof ",")"])),I,i.ValidationError),()=>o.throw(I)),h(I),s||o.assign(v,!1)}),e.ok(v)}function f(){e.result((0,A8.callValidateCode)(e,t,u),()=>b(t),()=>h(t))}function h(v){let I=(0,co._)(N8||(N8=E(["",".errors"])),v);o.assign(zd.default.vErrors,(0,co._)(B8||(B8=E([""," === null ? "," : ",".concat(",")"])),zd.default.vErrors,I,zd.default.vErrors,I)),o.assign(zd.default.errors,(0,co._)($8||($8=E(["",".length"])),zd.default.vErrors))}function b(v){var I;if(!i.opts.unevaluated)return;let x=(I=r==null?void 0:r.validate)===null||I===void 0?void 0:I.evaluated;if(i.props!==!0)if(x&&!x.dynamicProps)x.props!==void 0&&(i.props=E0.mergeEvaluated.props(o,x.props,i.props));else{let C=o.var("props",(0,co._)(j8||(j8=E(["",".evaluated.props"])),v));i.props=E0.mergeEvaluated.props(o,C,i.props,co.Name)}if(i.items!==!0)if(x&&!x.dynamicItems)x.items!==void 0&&(i.items=E0.mergeEvaluated.items(o,x.items,i.items));else{let C=o.var("items",(0,co._)(G8||(G8=E(["",".evaluated.items"])),v));i.items=E0.mergeEvaluated.items(o,C,i.items,co.Name)}}}Pu.callRef=_0;Pu.default=uee});var z8=H(Q3=>{"use strict";p();Object.defineProperty(Q3,"__esModule",{value:!0});var pee=_8(),dee=V8(),fee=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",pee.default,dee.default];Q3.default=fee});var Z8=H(eC=>{"use strict";p();Object.defineProperty(eC,"__esModule",{value:!0});var A0=Ze(),Jl=A0.operators,k0={maximum:{okStr:"<=",ok:Jl.LTE,fail:Jl.GT},minimum:{okStr:">=",ok:Jl.GTE,fail:Jl.LT},exclusiveMaximum:{okStr:"<",ok:Jl.LT,fail:Jl.GTE},exclusiveMinimum:{okStr:">",ok:Jl.GT,fail:Jl.LTE}},H8,W8,mee={message:({keyword:e,schemaCode:t})=>(0,A0.str)(H8||(H8=E(["must be "," ",""])),k0[e].okStr,t),params:({keyword:e,schemaCode:t})=>(0,A0._)(W8||(W8=E(["{comparison: ",", limit: ","}"])),k0[e].okStr,t)},q8,hee={keyword:Object.keys(k0),type:"number",schemaType:"number",$data:!0,error:mee,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,A0._)(q8||(q8=E([""," "," "," || isNaN(",")"])),r,k0[t].fail,n,r))}};eC.default=hee});var eA=H(tC=>{"use strict";p();Object.defineProperty(tC,"__esModule",{value:!0});var Xh=Ze(),X8,Y8,yee={message:({schemaCode:e})=>(0,Xh.str)(X8||(X8=E(["must be multiple of ",""])),e),params:({schemaCode:e})=>(0,Xh._)(Y8||(Y8=E(["{multipleOf: ","}"])),e)},K8,J8,Q8,gee={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:yee,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Xh._)(K8||(K8=E(["Math.abs(Math.round(",") - ",") > 1e-",""])),s,s,i):(0,Xh._)(J8||(J8=E([""," !== parseInt(",")"])),s,s);e.fail$data((0,Xh._)(Q8||(Q8=E(["("," === 0 || ("," = ","/",", ","))"])),n,s,r,n,a))}};tC.default=gee});var rA=H(rC=>{"use strict";p();Object.defineProperty(rC,"__esModule",{value:!0});function tA(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}rC.default=tA;tA.code='require("ajv/dist/runtime/ucs2length").default'});var lA=H(nC=>{"use strict";p();Object.defineProperty(nC,"__esModule",{value:!0});var Tu=Ze(),bee=Mt(),vee=rA(),nA,oA,xee={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Tu.str)(nA||(nA=E(["must NOT have "," than "," characters"])),r,t)},params:({schemaCode:e})=>(0,Tu._)(oA||(oA=E(["{limit: ","}"])),e)},iA,sA,aA,Iee={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xee,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Tu.operators.GT:Tu.operators.LT,s=o.opts.unicode===!1?(0,Tu._)(iA||(iA=E(["",".length"])),r):(0,Tu._)(sA||(sA=E(["","(",")"])),(0,bee.useFunc)(e.gen,vee.default),r);e.fail$data((0,Tu._)(aA||(aA=E([""," "," ",""])),s,i,n))}};nC.default=Iee});var fA=H(oC=>{"use strict";p();Object.defineProperty(oC,"__esModule",{value:!0});var See=qo(),D0=Ze(),cA,uA,Cee={message:({schemaCode:e})=>(0,D0.str)(cA||(cA=E(['must match pattern "','"'])),e),params:({schemaCode:e})=>(0,D0._)(uA||(uA=E(["{pattern: ","}"])),e)},pA,dA,Pee={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Cee,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,D0._)(pA||(pA=E(["(new RegExp(",", ","))"])),o,s):(0,See.usePattern)(e,n);e.fail$data((0,D0._)(dA||(dA=E(["!",".test(",")"])),a,t))}};oC.default=Pee});var gA=H(iC=>{"use strict";p();Object.defineProperty(iC,"__esModule",{value:!0});var Yh=Ze(),mA,hA,Tee={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Yh.str)(mA||(mA=E(["must NOT have "," than "," properties"])),r,t)},params:({schemaCode:e})=>(0,Yh._)(hA||(hA=E(["{limit: ","}"])),e)},yA,wee={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Tee,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Yh.operators.GT:Yh.operators.LT;e.fail$data((0,Yh._)(yA||(yA=E(["Object.keys(",").length "," ",""])),r,o,n))}};iC.default=wee});var xA=H(sC=>{"use strict";p();Object.defineProperty(sC,"__esModule",{value:!0});var Kh=qo(),Jh=Ze(),Mee=Mt(),bA,vA,Oee={message:({params:{missingProperty:e}})=>(0,Jh.str)(bA||(bA=E(["must have required property '","'"])),e),params:({params:{missingProperty:e}})=>(0,Jh._)(vA||(vA=E(["{missingProperty: ","}"])),e)},Eee={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Oee,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?u():d(),a.strictRequired){let b=e.parentSchema.properties,{definedProperties:v}=e.it;for(let I of r)if((b==null?void 0:b[I])===void 0&&!v.has(I)){let x=s.schemaEnv.baseId+s.errSchemaPath,C='required property "'.concat(I,'" is not defined at "').concat(x,'" (strictRequired)');(0,Mee.checkStrictMode)(s,C,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(Jh.nil,f);else for(let b of r)(0,Kh.checkReportMissingProp)(e,b)}function d(){let b=t.let("missing");if(l||i){let v=t.let("valid",!0);e.block$data(v,()=>h(b,v)),e.ok(v)}else t.if((0,Kh.checkMissingProp)(e,r,b)),(0,Kh.reportMissingProp)(e,b),t.else()}function f(){t.forOf("prop",n,b=>{e.setParams({missingProperty:b}),t.if((0,Kh.noPropertyInData)(t,o,b,a.ownProperties),()=>e.error())})}function h(b,v){e.setParams({missingProperty:b}),t.forOf(b,n,()=>{t.assign(v,(0,Kh.propertyInData)(t,o,b,a.ownProperties)),t.if((0,Jh.not)(v),()=>{e.error(),t.break()})},Jh.nil)}}};sC.default=Eee});var PA=H(aC=>{"use strict";p();Object.defineProperty(aC,"__esModule",{value:!0});var Qh=Ze(),IA,SA,_ee={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Qh.str)(IA||(IA=E(["must NOT have "," than "," items"])),r,t)},params:({schemaCode:e})=>(0,Qh._)(SA||(SA=E(["{limit: ","}"])),e)},CA,Aee={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:_ee,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Qh.operators.GT:Qh.operators.LT;e.fail$data((0,Qh._)(CA||(CA=E(["",".length "," ",""])),r,o,n))}};aC.default=Aee});var F0=H(lC=>{"use strict";p();Object.defineProperty(lC,"__esModule",{value:!0});var TA=D3();TA.code='require("ajv/dist/runtime/equal").default';lC.default=TA});var VA=H(uC=>{"use strict";p();Object.defineProperty(uC,"__esModule",{value:!0});var cC=$h(),on=Ze(),kee=Mt(),Dee=F0(),wA,MA,Fee={message:({params:{i:e,j:t}})=>(0,on.str)(wA||(wA=E(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),params:({params:{i:e,j:t}})=>(0,on._)(MA||(MA=E(["{i: ",", j: ","}"])),e,t)},OA,EA,_A,AA,kA,DA,FA,LA,RA,NA,BA,$A,jA,GA,UA,Lee={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Fee,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"),u=i.items?(0,cC.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,on._)(OA||(OA=E([""," === false"])),s)),e.ok(l);function d(){let v=t.let("i",(0,on._)(EA||(EA=E(["",".length"])),r)),I=t.let("j");e.setParams({i:v,j:I}),t.assign(l,!0),t.if((0,on._)(_A||(_A=E([""," > 1"])),v),()=>(f()?h:b)(v,I))}function f(){return u.length>0&&!u.some(v=>v==="object"||v==="array")}function h(v,I){let x=t.name("item"),C=(0,cC.checkDataTypes)(u,x,a.opts.strictNumbers,cC.DataType.Wrong),P=t.const("indices",(0,on._)(AA||(AA=E(["{}"]))));t.for((0,on._)(kA||(kA=E([";","--;"])),v),()=>{t.let(x,(0,on._)(DA||(DA=E(["","[","]"])),r,v)),t.if(C,(0,on._)(FA||(FA=E(["continue"])))),u.length>1&&t.if((0,on._)(LA||(LA=E(["typeof ",' == "string"'])),x),(0,on._)(RA||(RA=E(["",' += "_"'])),x)),t.if((0,on._)(NA||(NA=E(["typeof ","[",'] == "number"'])),P,x),()=>{t.assign(I,(0,on._)(BA||(BA=E(["","[","]"])),P,x)),e.error(),t.assign(l,!1).break()}).code((0,on._)($A||($A=E(["","[","] = ",""])),P,x,v))})}function b(v,I){let x=(0,kee.useFunc)(t,Dee.default),C=t.name("outer");t.label(C).for((0,on._)(jA||(jA=E([";","--;"])),v),()=>t.for((0,on._)(GA||(GA=E([""," = ","; ","--;"])),I,v,I),()=>t.if((0,on._)(UA||(UA=E(["","(","[","], ","[","])"])),x,r,v,r,I),()=>{e.error(),t.assign(l,!1).break(C)})))}}};uC.default=Lee});var qA=H(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});var pC=Ze(),Ree=Mt(),Nee=F0(),zA,Bee={message:"must be equal to constant",params:({schemaCode:e})=>(0,pC._)(zA||(zA=E(["{allowedValue: ","}"])),e)},HA,WA,$ee={keyword:"const",$data:!0,error:Bee,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,pC._)(HA||(HA=E(["!","(",", ",")"])),(0,Ree.useFunc)(t,Nee.default),r,o)):e.fail((0,pC._)(WA||(WA=E([""," !== ",""])),i,r))}};dC.default=$ee});var JA=H(fC=>{"use strict";p();Object.defineProperty(fC,"__esModule",{value:!0});var ey=Ze(),jee=Mt(),Gee=F0(),ZA,Uee={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ey._)(ZA||(ZA=E(["{allowedValues: ","}"])),e)},XA,YA,KA,Vee={keyword:"enum",schemaType:"array",$data:!0,error:Uee,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,u=()=>l!=null?l:l=(0,jee.useFunc)(t,Gee.default),d;if(a||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let b=t.const("vSchema",i);d=(0,ey.or)(...o.map((v,I)=>h(b,I)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",i,b=>t.if((0,ey._)(XA||(XA=E(["","(",", ",")"])),u(),r,b),()=>t.assign(d,!0).break()))}function h(b,v){let I=o[v];return typeof I=="object"&&I!==null?(0,ey._)(YA||(YA=E(["","(",", ","[","])"])),u(),r,b,v):(0,ey._)(KA||(KA=E([""," === ",""])),r,I)}}};fC.default=Vee});var QA=H(mC=>{"use strict";p();Object.defineProperty(mC,"__esModule",{value:!0});var zee=Z8(),Hee=eA(),Wee=lA(),qee=fA(),Zee=gA(),Xee=xA(),Yee=PA(),Kee=VA(),Jee=qA(),Qee=JA(),ete=[zee.default,Hee.default,Wee.default,qee.default,Zee.default,Xee.default,Yee.default,Kee.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Jee.default,Qee.default];mC.default=ete});var yC=H(ty=>{"use strict";p();Object.defineProperty(ty,"__esModule",{value:!0});ty.validateAdditionalItems=void 0;var wu=Ze(),hC=Mt(),ek,tk,tte={message:({params:{len:e}})=>(0,wu.str)(ek||(ek=E(["must NOT have more than "," items"])),e),params:({params:{len:e}})=>(0,wu._)(tk||(tk=E(["{limit: ","}"])),e)},rte={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:tte,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,hC.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ik(e,n)}},rk,nk,ok;function ik(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,wu._)(rk||(rk=E(["",".length"])),o));if(n===!1)e.setParams({len:t.length}),e.pass((0,wu._)(nk||(nk=E([""," <= ",""])),a,t.length));else if(typeof n=="object"&&!(0,hC.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,wu._)(ok||(ok=E([""," <= ",""])),a,t.length));r.if((0,wu.not)(u),()=>l(u)),e.ok(u)}function l(u){r.forRange("i",t.length,a,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:hC.Type.Num},u),s.allErrors||r.if((0,wu.not)(u),()=>r.break())})}}ty.validateAdditionalItems=ik;ty.default=rte});var gC=H(ry=>{"use strict";p();Object.defineProperty(ry,"__esModule",{value:!0});ry.validateTuple=void 0;var sk=Ze(),L0=Mt(),nte=qo(),ote={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return ck(e,"additionalItems",t);r.items=!0,!(0,L0.alwaysValidSchema)(r,t)&&e.ok((0,nte.validateArray)(e))}},ak,lk;function ck(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;d(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=L0.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),u=n.const("len",(0,sk._)(ak||(ak=E(["",".length"])),i));r.forEach((f,h)=>{(0,L0.alwaysValidSchema)(a,f)||(n.if((0,sk._)(lk||(lk=E([""," > ",""])),u,h),()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function d(f){let{opts:h,errSchemaPath:b}=a,v=r.length,I=v===f.minItems&&(v===f.maxItems||f[t]===!1);if(h.strictTuples&&!I){let x='"'.concat(s,'" is ').concat(v,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(b,'"');(0,L0.checkStrictMode)(a,x,h.strictTuples)}}}ry.validateTuple=ck;ry.default=ote});var uk=H(bC=>{"use strict";p();Object.defineProperty(bC,"__esModule",{value:!0});var ite=gC(),ste={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,ite.validateTuple)(e,"items")};bC.default=ste});var mk=H(vC=>{"use strict";p();Object.defineProperty(vC,"__esModule",{value:!0});var pk=Ze(),ate=Mt(),lte=qo(),cte=yC(),dk,fk,ute={message:({params:{len:e}})=>(0,pk.str)(dk||(dk=E(["must NOT have more than "," items"])),e),params:({params:{len:e}})=>(0,pk._)(fk||(fk=E(["{limit: ","}"])),e)},pte={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ute,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,ate.alwaysValidSchema)(n,t)&&(o?(0,cte.validateAdditionalItems)(e,o):e.ok((0,lte.validateArray)(e)))}};vC.default=pte});var Mk=H(xC=>{"use strict";p();Object.defineProperty(xC,"__esModule",{value:!0});var Xo=Ze(),R0=Mt(),hk,yk,gk,bk,dte={message:({params:{min:e,max:t}})=>t===void 0?(0,Xo.str)(hk||(hk=E(["must contain at least "," valid item(s)"])),e):(0,Xo.str)(yk||(yk=E(["must contain at least "," and no more than "," valid item(s)"])),e,t),params:({params:{min:e,max:t}})=>t===void 0?(0,Xo._)(gk||(gk=E(["{minContains: ","}"])),e):(0,Xo._)(bk||(bk=E(["{minContains: ",", maxContains: ","}"])),e,t)},vk,xk,Ik,Sk,Ck,Pk,Tk,wk,fte={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:dte,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:l,maxContains:u}=n;i.opts.next?(s=l===void 0?1:l,a=u):s=1;let d=t.const("len",(0,Xo._)(vk||(vk=E(["",".length"])),o));if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,R0.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,R0.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,R0.alwaysValidSchema)(i,r)){let I=(0,Xo._)(xk||(xk=E([""," >= ",""])),d,s);a!==void 0&&(I=(0,Xo._)(Ik||(Ik=E([""," && "," <= ",""])),I,d,a)),e.pass(I);return}i.items=!0;let f=t.name("valid");a===void 0&&s===1?b(f,()=>t.if(f,()=>t.break())):s===0?(t.let(f,!0),a!==void 0&&t.if((0,Xo._)(Sk||(Sk=E(["",".length > 0"])),o),h)):(t.let(f,!1),h()),e.result(f,()=>e.reset());function h(){let I=t.name("_valid"),x=t.let("count",0);b(I,()=>t.if(I,()=>v(x)))}function b(I,x){t.forRange("i",0,d,C=>{e.subschema({keyword:"contains",dataProp:C,dataPropType:R0.Type.Num,compositeRule:!0},I),x()})}function v(I){t.code((0,Xo._)(Ck||(Ck=E(["","++"])),I)),a===void 0?t.if((0,Xo._)(Pk||(Pk=E([""," >= ",""])),I,s),()=>t.assign(f,!0).break()):(t.if((0,Xo._)(Tk||(Tk=E([""," > ",""])),I,a),()=>t.assign(f,!1).break()),s===1?t.assign(f,!0):t.if((0,Xo._)(wk||(wk=E([""," >= ",""])),I,s),()=>t.assign(f,!0)))}}};xC.default=fte});var Dk=H(ws=>{"use strict";p();Object.defineProperty(ws,"__esModule",{value:!0});ws.validateSchemaDeps=ws.validatePropertyDeps=ws.error=void 0;var IC=Ze(),mte=Mt(),ny=qo(),Ok,Ek;ws.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,IC.str)(Ok||(Ok=E(["must have "," "," when property "," is present"])),n,r,e)},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,IC._)(Ek||(Ek=E(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r)};var hte={keyword:"dependencies",type:"object",schemaType:"object",error:ws.error,code(e){let[t,r]=yte(e);Ak(e,t),kk(e,r)}};function yte({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 _k;function Ak(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,ny.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(l,()=>{for(let u of a)(0,ny.checkReportMissingProp)(e,u)}):(r.if((0,IC._)(_k||(_k=E([""," && (",")"])),l,(0,ny.checkMissingProp)(e,a,i))),(0,ny.reportMissingProp)(e,i),r.else())}}ws.validatePropertyDeps=Ak;function kk(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,mte.alwaysValidSchema)(i,t[a])||(r.if((0,ny.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))}ws.validateSchemaDeps=kk;ws.default=hte});var Rk=H(SC=>{"use strict";p();Object.defineProperty(SC,"__esModule",{value:!0});var Lk=Ze(),gte=Mt(),Fk,bte={message:"property name must be valid",params:({params:e})=>(0,Lk._)(Fk||(Fk=E(["{propertyName: ","}"])),e.propertyName)},vte={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:bte,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,gte.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,Lk.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};SC.default=vte});var PC=H(CC=>{"use strict";p();Object.defineProperty(CC,"__esModule",{value:!0});var N0=qo(),ki=Ze(),xte=Aa(),B0=Mt(),Nk,Ite={message:"must NOT have additional properties",params:({params:e})=>(0,ki._)(Nk||(Nk=E(["{additionalProperty: ","}"])),e.additionalProperty)},Bk,$k,jk,Gk,Ste={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Ite,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,B0.alwaysValidSchema)(s,r))return;let u=(0,N0.allSchemaProperties)(n.properties),d=(0,N0.allSchemaProperties)(n.patternProperties);f(),e.ok((0,ki._)(Bk||(Bk=E([""," === ",""])),i,xte.default.errors));function f(){t.forIn("key",o,x=>{!u.length&&!d.length?v(x):t.if(h(x),()=>v(x))})}function h(x){let C;if(u.length>8){let P=(0,B0.schemaRefOrVal)(s,n.properties,"properties");C=(0,N0.isOwnProperty)(t,P,x)}else u.length?C=(0,ki.or)(...u.map(P=>(0,ki._)($k||($k=E([""," === ",""])),x,P))):C=ki.nil;return d.length&&(C=(0,ki.or)(C,...d.map(P=>(0,ki._)(jk||(jk=E(["",".test(",")"])),(0,N0.usePattern)(e,P),x)))),(0,ki.not)(C)}function b(x){t.code((0,ki._)(Gk||(Gk=E(["delete ","[","]"])),o,x))}function v(x){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){b(x);return}if(r===!1){e.setParams({additionalProperty:x}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,B0.alwaysValidSchema)(s,r)){let C=t.name("valid");l.removeAdditional==="failing"?(I(x,C,!1),t.if((0,ki.not)(C),()=>{e.reset(),b(x)})):(I(x,C),a||t.if((0,ki.not)(C),()=>t.break()))}}function I(x,C,P){let w={keyword:"additionalProperties",dataProp:x,dataPropType:B0.Type.Str};P===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,C)}}};CC.default=Ste});var zk=H(wC=>{"use strict";p();Object.defineProperty(wC,"__esModule",{value:!0});var Cte=Vh(),Uk=qo(),TC=Mt(),Vk=PC(),Pte={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&&Vk.default.code(new Cte.KeywordCxt(i,Vk.default,"additionalProperties"));let s=(0,Uk.allSchemaProperties)(r);for(let f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=TC.mergeEvaluated.props(t,(0,TC.toHash)(s),i.props));let a=s.filter(f=>!(0,TC.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let l=t.name("valid");for(let f of a)u(f)?d(f):(t.if((0,Uk.propertyInData)(t,o,f,i.opts.ownProperties)),d(f),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};wC.default=Pte});var Yk=H(MC=>{"use strict";p();Object.defineProperty(MC,"__esModule",{value:!0});var Hk=qo(),$0=Ze(),Wk=Mt(),qk=Mt(),Zk,Xk,Tte={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,Hk.allSchemaProperties)(r),l=a.filter(I=>(0,Wk.alwaysValidSchema)(i,r[I]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof $0.Name)&&(i.props=(0,qk.evaluatedPropsToName)(t,i.props));let{props:f}=i;h();function h(){for(let I of a)u&&b(I),i.allErrors?v(I):(t.var(d,!0),v(I),t.if(d))}function b(I){for(let x in u)new RegExp(I).test(x)&&(0,Wk.checkStrictMode)(i,"property ".concat(x," matches pattern ").concat(I," (use allowMatchingProperties)"))}function v(I){t.forIn("key",n,x=>{t.if((0,$0._)(Zk||(Zk=E(["",".test(",")"])),(0,Hk.usePattern)(e,I),x),()=>{let C=l.includes(I);C||e.subschema({keyword:"patternProperties",schemaProp:I,dataProp:x,dataPropType:qk.Type.Str},d),i.opts.unevaluated&&f!==!0?t.assign((0,$0._)(Xk||(Xk=E(["","[","]"])),f,x),!0):!C&&!i.allErrors&&t.if((0,$0.not)(d),()=>t.break())})})}}};MC.default=Tte});var Kk=H(OC=>{"use strict";p();Object.defineProperty(OC,"__esModule",{value:!0});var wte=Mt(),Mte={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,wte.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"}};OC.default=Mte});var Jk=H(EC=>{"use strict";p();Object.defineProperty(EC,"__esModule",{value:!0});var Ote=qo(),Ete={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ote.validateUnion,error:{message:"must match a schema in anyOf"}};EC.default=Ete});var rD=H(_C=>{"use strict";p();Object.defineProperty(_C,"__esModule",{value:!0});var j0=Ze(),_te=Mt(),Qk,Ate={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,j0._)(Qk||(Qk=E(["{passingSchemas: ","}"])),e.passing)},eD,tD,kte={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ate,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(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,f)=>{let h;(0,_te.alwaysValidSchema)(o,d)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&t.if((0,j0._)(eD||(eD=E([""," && ",""])),l,s)).assign(s,!1).assign(a,(0,j0._)(tD||(tD=E(["[",", ","]"])),a,f)).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,f),h&&e.mergeEvaluated(h,j0.Name)})})}}};_C.default=kte});var nD=H(AC=>{"use strict";p();Object.defineProperty(AC,"__esModule",{value:!0});var Dte=Mt(),Fte={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,Dte.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};AC.default=Fte});var cD=H(kC=>{"use strict";p();Object.defineProperty(kC,"__esModule",{value:!0});var G0=Ze(),lD=Mt(),iD,sD,Lte={message:({params:e})=>(0,G0.str)(iD||(iD=E(['must match "','" schema'])),e.ifClause),params:({params:e})=>(0,G0._)(sD||(sD=E(["{failingKeyword: ","}"])),e.ifClause)},aD,Rte={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Lte,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,lD.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=oD(n,"then"),i=oD(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else o?t.if(a,u("then")):t.if((0,G0.not)(a),u("else"));e.pass(s,()=>e.error(!0));function l(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,f){return()=>{let h=e.subschema({keyword:d},a);t.assign(s,a),e.mergeValidEvaluated(h,s),f?t.assign(f,(0,G0._)(aD||(aD=E(["",""])),d)):e.setParams({ifClause:d})}}}};function oD(e,t){let r=e.schema[t];return r!==void 0&&!(0,lD.alwaysValidSchema)(e,r)}kC.default=Rte});var uD=H(DC=>{"use strict";p();Object.defineProperty(DC,"__esModule",{value:!0});var Nte=Mt(),Bte={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Nte.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};DC.default=Bte});var pD=H(FC=>{"use strict";p();Object.defineProperty(FC,"__esModule",{value:!0});var $te=yC(),jte=uk(),Gte=gC(),Ute=mk(),Vte=Mk(),zte=Dk(),Hte=Rk(),Wte=PC(),qte=zk(),Zte=Yk(),Xte=Kk(),Yte=Jk(),Kte=rD(),Jte=nD(),Qte=cD(),ere=uD();function tre(e=!1){let t=[Xte.default,Yte.default,Kte.default,Jte.default,Qte.default,ere.default,Hte.default,Wte.default,zte.default,qte.default,Zte.default];return e?t.push(jte.default,Ute.default):t.push($te.default,Gte.default),t.push(Vte.default),t}FC.default=tre});var ED=H(LC=>{"use strict";p();Object.defineProperty(LC,"__esModule",{value:!0});var Mr=Ze(),dD,fD,rre={message:({schemaCode:e})=>(0,Mr.str)(dD||(dD=E(['must match format "','"'])),e),params:({schemaCode:e})=>(0,Mr._)(fD||(fD=E(["{format: ","}"])),e)},mD,hD,yD,gD,bD,vD,xD,ID,SD,CD,PD,TD,wD,MD,OD,nre={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:rre,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=a;if(!l.validateFormats)return;o?h():b();function h(){let v=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),I=r.const("fDef",(0,Mr._)(mD||(mD=E(["","[","]"])),v,s)),x=r.let("fType"),C=r.let("format");r.if((0,Mr._)(hD||(hD=E(["typeof ",' == "object" && !('," instanceof RegExp)"])),I,I),()=>r.assign(x,(0,Mr._)(yD||(yD=E(["",'.type || "string"'])),I)).assign(C,(0,Mr._)(gD||(gD=E(["",".validate"])),I)),()=>r.assign(x,(0,Mr._)(bD||(bD=E(['"string"'])))).assign(C,I)),e.fail$data((0,Mr.or)(P(),w()));function P(){return l.strictSchema===!1?Mr.nil:(0,Mr._)(vD||(vD=E([""," && !",""])),s,C)}function w(){let T=d.$async?(0,Mr._)(xD||(xD=E(["(",".async ? await ","(",") : ","(","))"])),I,C,n,C,n):(0,Mr._)(ID||(ID=E(["","(",")"])),C,n),O=(0,Mr._)(SD||(SD=E(["(typeof ",' == "function" ? '," : ",".test(","))"])),C,T,C,n);return(0,Mr._)(CD||(CD=E([""," && "," !== true && "," === "," && !",""])),C,C,x,t,O)}}function b(){let v=f.formats[i];if(!v){P();return}if(v===!0)return;let[I,x,C]=w(v);I===t&&e.pass(T());function P(){if(l.strictSchema===!1){f.logger.warn(O());return}throw new Error(O());function O(){return'unknown format "'.concat(i,'" ignored in schema at path "').concat(u,'"')}}function w(O){let N=O instanceof RegExp?(0,Mr.regexpCode)(O):l.code.formats?(0,Mr._)(PD||(PD=E(["","",""])),l.code.formats,(0,Mr.getProperty)(i)):void 0,k=r.scopeValue("formats",{key:i,ref:O,code:N});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,Mr._)(TD||(TD=E(["",".validate"])),k)]:["string",O,k]}function T(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Mr._)(wD||(wD=E(["await ","(",")"])),C,n)}return typeof x=="function"?(0,Mr._)(MD||(MD=E(["","(",")"])),C,n):(0,Mr._)(OD||(OD=E(["",".test(",")"])),C,n)}}}};LC.default=nre});var _D=H(RC=>{"use strict";p();Object.defineProperty(RC,"__esModule",{value:!0});var ore=ED(),ire=[ore.default];RC.default=ire});var AD=H(Hd=>{"use strict";p();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.contentVocabulary=Hd.metadataVocabulary=void 0;Hd.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Hd.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var DD=H(NC=>{"use strict";p();Object.defineProperty(NC,"__esModule",{value:!0});var sre=z8(),are=QA(),lre=pD(),cre=_D(),kD=AD(),ure=[sre.default,are.default,(0,lre.default)(),cre.default,kD.metadataVocabulary,kD.contentVocabulary];NC.default=ure});var LD=H(U0=>{"use strict";p();Object.defineProperty(U0,"__esModule",{value:!0});U0.DiscrError=void 0;var FD;(function(e){e.Tag="tag",e.Mapping="mapping"})(FD||(U0.DiscrError=FD={}))});var GD=H($C=>{"use strict";p();Object.defineProperty($C,"__esModule",{value:!0});var Wd=Ze(),BC=LD(),RD=P0(),pre=zh(),dre=Mt(),ND,fre={message:({params:{discrError:e,tagName:t}})=>e===BC.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,Wd._)(ND||(ND=E(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t)},BD,$D,jD,mre={keyword:"discriminator",type:"object",schemaType:"object",error:fre,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),u=t.const("tag",(0,Wd._)(BD||(BD=E(["","",""])),r,(0,Wd.getProperty)(a)));t.if((0,Wd._)($D||($D=E(["typeof ",' == "string"'])),u),()=>d(),()=>e.error(!1,{discrError:BC.DiscrError.Tag,tag:u,tagName:a})),e.ok(l);function d(){let b=h();t.if(!1);for(let v in b)t.elseIf((0,Wd._)(jD||(jD=E([""," === ",""])),u,v)),t.assign(l,f(b[v]));t.else(),e.error(!1,{discrError:BC.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(b){let v=t.name("valid"),I=e.subschema({keyword:"oneOf",schemaProp:b},v);return e.mergeEvaluated(I,Wd.Name),v}function h(){var b;let v={},I=C(o),x=!0;for(let T=0;T<s.length;T++){let O=s[T];if(O!=null&&O.$ref&&!(0,dre.schemaHasRulesButRef)(O,i.self.RULES)){let k=O.$ref;if(O=RD.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,k),O instanceof RD.SchemaEnv&&(O=O.schema),O===void 0)throw new pre.default(i.opts.uriResolver,i.baseId,k)}let N=(b=O==null?void 0:O.properties)===null||b===void 0?void 0:b[a];if(typeof N!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(a,'"'));x=x&&(I||C(O)),P(N,T)}if(!x)throw new Error('discriminator: "'.concat(a,'" must be required'));return v;function C({required:T}){return Array.isArray(T)&&T.includes(a)}function P(T,O){if(T.const)w(T.const,O);else if(T.enum)for(let N of T.enum)w(N,O);else throw new Error('discriminator: "properties/'.concat(a,'" must have "const" or "enum"'))}function w(T,O){if(typeof T!="string"||T in v)throw new Error('discriminator: "'.concat(a,'" values must be unique strings'));v[T]=O}}}};$C.default=mre});var UD=H((X5e,hre)=>{hre.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 GC=H((rr,jC)=>{"use strict";p();Object.defineProperty(rr,"__esModule",{value:!0});rr.MissingRefError=rr.ValidationError=rr.CodeGen=rr.Name=rr.nil=rr.stringify=rr.str=rr._=rr.KeywordCxt=rr.Ajv=void 0;var yre=E8(),gre=DD(),bre=GD(),VD=UD(),vre=["/properties"],V0="http://json-schema.org/draft-07/schema",qd=class extends yre.default{_addVocabularies(){super._addVocabularies(),gre.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(bre.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(VD,vre):VD;this.addMetaSchema(t,V0,!1),this.refs["http://json-schema.org/schema"]=V0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(V0)?V0:void 0)}};rr.Ajv=qd;jC.exports=rr=qd;jC.exports.Ajv=qd;Object.defineProperty(rr,"__esModule",{value:!0});rr.default=qd;var xre=Vh();Object.defineProperty(rr,"KeywordCxt",{enumerable:!0,get:function(){return xre.KeywordCxt}});var Zd=Ze();Object.defineProperty(rr,"_",{enumerable:!0,get:function(){return Zd._}});Object.defineProperty(rr,"str",{enumerable:!0,get:function(){return Zd.str}});Object.defineProperty(rr,"stringify",{enumerable:!0,get:function(){return Zd.stringify}});Object.defineProperty(rr,"nil",{enumerable:!0,get:function(){return Zd.nil}});Object.defineProperty(rr,"Name",{enumerable:!0,get:function(){return Zd.Name}});Object.defineProperty(rr,"CodeGen",{enumerable:!0,get:function(){return Zd.CodeGen}});var Ire=S0();Object.defineProperty(rr,"ValidationError",{enumerable:!0,get:function(){return Ire.default}});var Sre=zh();Object.defineProperty(rr,"MissingRefError",{enumerable:!0,get:function(){return Sre.default}})});var XD=H(Ms=>{"use strict";p();Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatNames=Ms.fastFormats=Ms.fullFormats=void 0;function Xd(e,t){return{validate:e,compare:t}}Ms.fullFormats={date:Xd(WD,zC),time:Xd(qD,HC),"date-time":Xd(wre,ZD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Ere,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Rre,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:_re,int32:{type:"number",validate:Dre},int64:{type:"number",validate:Fre},float:{type:"number",validate:HD},double:{type:"number",validate:HD},password:!0,binary:!0};Ms.fastFormats={...Ms.fullFormats,date:Xd(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,zC),time:Xd(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,HC),"date-time":Xd(/^\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,ZD),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};Ms.formatNames=Object.keys(Ms.fullFormats);function Cre(e){return e%4===0&&(e%100!==0||e%400===0)}var Pre=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Tre=[0,31,28,31,30,31,30,31,31,30,31,30,31];function WD(e){let t=Pre.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&&Cre(r)?29:Tre[n])}function zC(e,t){if(e&&t)return e>t?1:e<t?-1:0}var UC=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function qD(e,t){let r=UC.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 HC(e,t){if(!(e&&t))return;let r=UC.exec(e),n=UC.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 VC=/t|\s/i;function wre(e){let t=e.split(VC);return t.length===2&&WD(t[0])&&qD(t[1],!0)}function ZD(e,t){if(!(e&&t))return;let[r,n]=e.split(VC),[o,i]=t.split(VC),s=zC(r,o);if(s!==void 0)return s||HC(n,i)}var Mre=/\/|:/,Ore=/^(?:[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 Ere(e){return Mre.test(e)&&Ore.test(e)}var zD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _re(e){return zD.lastIndex=0,zD.test(e)}var Are=-(2**31),kre=2**31-1;function Dre(e){return Number.isInteger(e)&&e<=kre&&e>=Are}function Fre(e){return Number.isInteger(e)}function HD(){return!0}var Lre=/[^\\]\\Z/;function Rre(e){if(Lre.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var oF=H(Yd=>{"use strict";p();Object.defineProperty(Yd,"__esModule",{value:!0});Yd.formatLimitDefinition=void 0;var Nre=GC(),Di=Ze(),Ql=Di.operators,z0={formatMaximum:{okStr:"<=",ok:Ql.LTE,fail:Ql.GT},formatMinimum:{okStr:">=",ok:Ql.GTE,fail:Ql.LT},formatExclusiveMaximum:{okStr:"<",ok:Ql.LT,fail:Ql.GTE},formatExclusiveMinimum:{okStr:">",ok:Ql.GT,fail:Ql.LTE}},YD,KD,Bre={message:({keyword:e,schemaCode:t})=>Di.str(YD||(YD=E(["should be "," ",""])),z0[e].okStr,t),params:({keyword:e,schemaCode:t})=>Di._(KD||(KD=E(["{comparison: ",", limit: ","}"])),z0[e].okStr,t)},JD,QD,eF,tF,rF,nF;Yd.formatLimitDefinition={keyword:Object.keys(z0),type:"string",schemaType:"string",$data:!0,error:Bre,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 Nre.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?u():d();function u(){let h=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),b=t.const("fmt",Di._(JD||(JD=E(["","[","]"])),h,l.schemaCode));e.fail$data(Di.or(Di._(QD||(QD=E(["typeof ",' != "object"'])),b),Di._(eF||(eF=E([""," instanceof RegExp"])),b),Di._(tF||(tF=E(["typeof ",'.compare != "function"'])),b),f(b)))}function d(){let h=l.schema,b=a.formats[h];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error('"'.concat(o,'": format "').concat(h,'" does not define "compare" function'));let v=t.scopeValue("formats",{key:h,ref:b,code:s.code.formats?Di._(rF||(rF=E(["","",""])),s.code.formats,Di.getProperty(h)):void 0});e.fail$data(f(v))}function f(h){return Di._(nF||(nF=E(["",".compare(",", ",") "," 0"])),h,r,n,z0[o].fail)}},dependencies:["format"]};var $re=e=>(e.addKeyword(Yd.formatLimitDefinition),e);Yd.default=$re});var cF=H((oy,lF)=>{"use strict";p();Object.defineProperty(oy,"__esModule",{value:!0});var Kd=XD(),jre=oF(),WC=Ze(),iF=new WC.Name("fullFormats"),Gre=new WC.Name("fastFormats"),qC=(e,t={keywords:!0})=>{if(Array.isArray(t))return sF(e,t,Kd.fullFormats,iF),e;let[r,n]=t.mode==="fast"?[Kd.fastFormats,Gre]:[Kd.fullFormats,iF],o=t.formats||Kd.formatNames;return sF(e,o,r,n),t.keywords&&jre.default(e),e};qC.get=(e,t="full")=>{let n=(t==="fast"?Kd.fastFormats:Kd.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var aF;function sF(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=WC._(aF||(aF=E(['require("ajv-formats/dist/formats").',""])),n));for(let s of t)e.addFormat(s,r[s])}lF.exports=oy=qC;Object.defineProperty(oy,"__esModule",{value:!0});oy.default=qC});var J$=H((GYe,aw)=>{"use strict";p();var Mx=qY();Mx.default&&(Mx=Mx.default);aw.exports=K$;aw.exports.default=K$;function K$(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 u=i-n,d=s-o,f=Math.min(u,d),h=f/2;if(f===0){var b=[n,o];return b.distance=0,b}for(var v=new Mx(void 0,$fe),I=n;I<i;I+=f)for(var x=o;x<s;x+=f)v.push(new uc(I+h,x+h,h,e));var C=Gfe(e),P=new uc(n+u/2,o+d/2,0,e);P.d>C.d&&(C=P);for(var w=v.length;v.length;){var T=v.pop();T.d>C.d&&(C=T,r&&console.log("found best %d after %d probes",Math.round(1e4*T.d)/1e4,w)),!(T.max-C.d<=t)&&(h=T.h/2,v.push(new uc(T.x-h,T.y-h,h,e)),v.push(new uc(T.x+h,T.y-h,h,e)),v.push(new uc(T.x-h,T.y+h,h,e)),v.push(new uc(T.x+h,T.y+h,h,e)),w+=4)}r&&(console.log("num probes: "+w),console.log("best distance: "+C.d));var O=[C.x,C.y];return O.distance=C.d,O}function $fe(e,t){return t.max-e.max}function uc(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=jfe(e,t,n),this.max=this.d+this.h*Math.SQRT2}function jfe(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,u=l-1;a<l;u=a++){var d=s[a],f=s[u];d[1]>t!=f[1]>t&&e<(f[0]-d[0])*(t-d[1])/(f[1]-d[1])+d[0]&&(n=!n),o=Math.min(o,Ufe(e,t,d,f))}return o===0?0:(n?1:-1)*Math.sqrt(o)}function Gfe(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],u=o[a],d=l[0]*u[1]-u[0]*l[1];r+=(l[0]+u[0])*d,n+=(l[1]+u[1])*d,t+=d*3}return t===0?new uc(o[0][0],o[0][1],0,e):new uc(r/t,n/t,0,e)}function Ufe(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 Ij=H((xw,Iw)=>{p();(function(e,t){typeof xw=="object"&&typeof Iw<"u"?Iw.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(xw,function(){"use strict";function e(x,C,P,w,T){(function O(N,k,D,F,z){for(;F>D;){if(F-D>600){var G=F-D+1,j=k-D+1,K=Math.log(G),Z=.5*Math.exp(2*K/3),oe=.5*Math.sqrt(K*Z*(G-Z)/G)*(j-G/2<0?-1:1),Q=Math.max(D,Math.floor(k-j*Z/G+oe)),ge=Math.min(F,Math.floor(k+(G-j)*Z/G+oe));O(N,k,Q,ge,z)}var be=N[k],pe=D,_e=F;for(t(N,D,k),z(N[F],be)>0&&t(N,D,F);pe<_e;){for(t(N,pe,_e),pe++,_e--;z(N[pe],be)<0;)pe++;for(;z(N[_e],be)>0;)_e--}z(N[D],be)===0?t(N,D,_e):t(N,++_e,F),_e<=k&&(D=_e+1),k<=_e&&(F=_e-1)}})(x,C,P||0,w||x.length-1,T||r)}function t(x,C,P){var w=x[C];x[C]=x[P],x[P]=w}function r(x,C){return x<C?-1:x>C?1:0}var n=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(x,C,P){if(!P)return C.indexOf(x);for(var w=0;w<C.length;w++)if(P(x,C[w]))return w;return-1}function i(x,C){s(x,0,x.children.length,C,x)}function s(x,C,P,w,T){T||(T=v(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var O=C;O<P;O++){var N=x.children[O];a(T,x.leaf?w(N):N)}return T}function a(x,C){return x.minX=Math.min(x.minX,C.minX),x.minY=Math.min(x.minY,C.minY),x.maxX=Math.max(x.maxX,C.maxX),x.maxY=Math.max(x.maxY,C.maxY),x}function l(x,C){return x.minX-C.minX}function u(x,C){return x.minY-C.minY}function d(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function f(x){return x.maxX-x.minX+(x.maxY-x.minY)}function h(x,C){return x.minX<=C.minX&&x.minY<=C.minY&&C.maxX<=x.maxX&&C.maxY<=x.maxY}function b(x,C){return C.minX<=x.maxX&&C.minY<=x.maxY&&C.maxX>=x.minX&&C.maxY>=x.minY}function v(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(x,C,P,w,T){for(var O=[C,P];O.length;)if(!((P=O.pop())-(C=O.pop())<=w)){var N=C+Math.ceil((P-C)/w/2)*w;e(x,N,C,P,T),O.push(C,N,N,P)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(x){var C=this.data,P=[];if(!b(x,C))return P;for(var w=this.toBBox,T=[];C;){for(var O=0;O<C.children.length;O++){var N=C.children[O],k=C.leaf?w(N):N;b(x,k)&&(C.leaf?P.push(N):h(x,k)?this._all(N,P):T.push(N))}C=T.pop()}return P},n.prototype.collides=function(x){var C=this.data;if(!b(x,C))return!1;for(var P=[];C;){for(var w=0;w<C.children.length;w++){var T=C.children[w],O=C.leaf?this.toBBox(T):T;if(b(x,O)){if(C.leaf||h(x,O))return!0;P.push(T)}}C=P.pop()}return!1},n.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var C=0;C<x.length;C++)this.insert(x[C]);return this}var P=this._build(x.slice(),0,x.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(x){return x&&this._insert(x,this.data.height-1),this},n.prototype.clear=function(){return this.data=v([]),this},n.prototype.remove=function(x,C){if(!x)return this;for(var P,w,T,O=this.data,N=this.toBBox(x),k=[],D=[];O||k.length;){if(O||(O=k.pop(),w=k[k.length-1],P=D.pop(),T=!0),O.leaf){var F=o(x,O.children,C);if(F!==-1)return O.children.splice(F,1),k.push(O),this._condense(k),this}T||O.leaf||!h(O,N)?w?(P++,O=w.children[P],T=!1):O=null:(k.push(O),D.push(P),P=0,w=O,O=O.children[0])}return this},n.prototype.toBBox=function(x){return x},n.prototype.compareMinX=function(x,C){return x.minX-C.minX},n.prototype.compareMinY=function(x,C){return x.minY-C.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(x){return this.data=x,this},n.prototype._all=function(x,C){for(var P=[];x;)x.leaf?C.push.apply(C,x.children):P.push.apply(P,x.children),x=P.pop();return C},n.prototype._build=function(x,C,P,w){var T,O=P-C+1,N=this._maxEntries;if(O<=N)return i(T=v(x.slice(C,P+1)),this.toBBox),T;w||(w=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,w-1))),(T=v([])).leaf=!1,T.height=w;var k=Math.ceil(O/N),D=k*Math.ceil(Math.sqrt(N));I(x,C,P,D,this.compareMinX);for(var F=C;F<=P;F+=D){var z=Math.min(F+D-1,P);I(x,F,z,k,this.compareMinY);for(var G=F;G<=z;G+=k){var j=Math.min(G+k-1,z);T.children.push(this._build(x,G,j,w-1))}}return i(T,this.toBBox),T},n.prototype._chooseSubtree=function(x,C,P,w){for(;w.push(C),!C.leaf&&w.length-1!==P;){for(var T=1/0,O=1/0,N=void 0,k=0;k<C.children.length;k++){var D=C.children[k],F=d(D),z=(G=x,j=D,(Math.max(j.maxX,G.maxX)-Math.min(j.minX,G.minX))*(Math.max(j.maxY,G.maxY)-Math.min(j.minY,G.minY))-F);z<O?(O=z,T=F<T?F:T,N=D):z===O&&F<T&&(T=F,N=D)}C=N||C.children[0]}var G,j;return C},n.prototype._insert=function(x,C,P){var w=P?x:this.toBBox(x),T=[],O=this._chooseSubtree(w,this.data,C,T);for(O.children.push(x),a(O,w);C>=0&&T[C].children.length>this._maxEntries;)this._split(T,C),C--;this._adjustParentBBoxes(w,T,C)},n.prototype._split=function(x,C){var P=x[C],w=P.children.length,T=this._minEntries;this._chooseSplitAxis(P,T,w);var O=this._chooseSplitIndex(P,T,w),N=v(P.children.splice(O,P.children.length-O));N.height=P.height,N.leaf=P.leaf,i(P,this.toBBox),i(N,this.toBBox),C?x[C-1].children.push(N):this._splitRoot(P,N)},n.prototype._splitRoot=function(x,C){this.data=v([x,C]),this.data.height=x.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(x,C,P){for(var w,T,O,N,k,D,F,z=1/0,G=1/0,j=C;j<=P-C;j++){var K=s(x,0,j,this.toBBox),Z=s(x,j,P,this.toBBox),oe=(T=K,O=Z,N=void 0,k=void 0,D=void 0,F=void 0,N=Math.max(T.minX,O.minX),k=Math.max(T.minY,O.minY),D=Math.min(T.maxX,O.maxX),F=Math.min(T.maxY,O.maxY),Math.max(0,D-N)*Math.max(0,F-k)),Q=d(K)+d(Z);oe<z?(z=oe,w=j,G=Q<G?Q:G):oe===z&&Q<G&&(G=Q,w=j)}return w||P-C},n.prototype._chooseSplitAxis=function(x,C,P){var w=x.leaf?this.compareMinX:l,T=x.leaf?this.compareMinY:u;this._allDistMargin(x,C,P,w)<this._allDistMargin(x,C,P,T)&&x.children.sort(w)},n.prototype._allDistMargin=function(x,C,P,w){x.children.sort(w);for(var T=this.toBBox,O=s(x,0,C,T),N=s(x,P-C,P,T),k=f(O)+f(N),D=C;D<P-C;D++){var F=x.children[D];a(O,x.leaf?T(F):F),k+=f(O)}for(var z=P-C-1;z>=C;z--){var G=x.children[z];a(N,x.leaf?T(G):G),k+=f(N)}return k},n.prototype._adjustParentBBoxes=function(x,C,P){for(var w=P;w>=0;w--)a(C[w],x)},n.prototype._condense=function(x){for(var C=x.length-1,P=void 0;C>=0;C--)x[C].children.length===0?C>0?(P=x[C-1].children).splice(P.indexOf(x[C]),1):this.clear():i(x[C],this.toBBox)},n})});var ww=H(ke=>{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.earthRadius=63710088e-1;ke.factors={centimeters:ke.earthRadius*100,centimetres:ke.earthRadius*100,degrees:ke.earthRadius/111325,feet:ke.earthRadius*3.28084,inches:ke.earthRadius*39.37,kilometers:ke.earthRadius/1e3,kilometres:ke.earthRadius/1e3,meters:ke.earthRadius,metres:ke.earthRadius,miles:ke.earthRadius/1609.344,millimeters:ke.earthRadius*1e3,millimetres:ke.earthRadius*1e3,nauticalmiles:ke.earthRadius/1852,radians:1,yards:ke.earthRadius*1.0936};ke.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/ke.earthRadius,yards:1.0936133};ke.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 dc(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}ke.feature=dc;function Ome(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return Sw(t).geometry;case"LineString":return Pw(t).geometry;case"Polygon":return Cw(t).geometry;case"MultiPoint":return Cj(t).geometry;case"MultiLineString":return Sj(t).geometry;case"MultiPolygon":return Pj(t).geometry;default:throw new Error(e+" is invalid")}}ke.geometry=Ome;function Sw(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(!Dx(e[0])||!Dx(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return dc(n,t,r)}ke.point=Sw;function Eme(e,t,r){return r===void 0&&(r={}),Fx(e.map(function(n){return Sw(n,t)}),r)}ke.points=Eme;function Cw(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 dc(a,t,r)}ke.polygon=Cw;function _me(e,t,r){return r===void 0&&(r={}),Fx(e.map(function(n){return Cw(n,t)}),r)}ke.polygons=_me;function Pw(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 dc(n,t,r)}ke.lineString=Pw;function Ame(e,t,r){return r===void 0&&(r={}),Fx(e.map(function(n){return Pw(n,t)}),r)}ke.lineStrings=Ame;function Fx(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}ke.featureCollection=Fx;function Sj(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return dc(n,t,r)}ke.multiLineString=Sj;function Cj(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return dc(n,t,r)}ke.multiPoint=Cj;function Pj(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return dc(n,t,r)}ke.multiPolygon=Pj;function kme(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return dc(n,t,r)}ke.geometryCollection=kme;function Dme(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}ke.round=Dme;function Tj(e,t){t===void 0&&(t="kilometers");var r=ke.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}ke.radiansToLength=Tj;function Tw(e,t){t===void 0&&(t="kilometers");var r=ke.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}ke.lengthToRadians=Tw;function Fme(e,t){return wj(Tw(e,t))}ke.lengthToDegrees=Fme;function Lme(e){var t=e%360;return t<0&&(t+=360),t}ke.bearingToAzimuth=Lme;function wj(e){var t=e%(2*Math.PI);return t*180/Math.PI}ke.radiansToDegrees=wj;function Rme(e){var t=e%360;return t*Math.PI/180}ke.degreesToRadians=Rme;function Nme(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 Tj(Tw(e,t),r)}ke.convertLength=Nme;function Bme(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=ke.areaFactors[t];if(!n)throw new Error("invalid original units");var o=ke.areaFactors[r];if(!o)throw new Error("invalid final units");return e/n*o}ke.convertArea=Bme;function Dx(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}ke.isNumber=Dx;function $me(e){return!!e&&e.constructor===Object}ke.isObject=$me;function jme(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(!Dx(t))throw new Error("bbox must only contain numbers")})}ke.validateBBox=jme;function Gme(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")}ke.validateId=Gme});var Aj=H(Ur=>{"use strict";p();Object.defineProperty(Ur,"__esModule",{value:!0});var kn=ww();function jy(e,t,r){if(e!==null)for(var n,o,i,s,a,l,u,d=0,f=0,h,b=e.type,v=b==="FeatureCollection",I=b==="Feature",x=v?e.features.length:1,C=0;C<x;C++){u=v?e.features[C].geometry:I?e.geometry:e,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var P=0;P<a;P++){var w=0,T=0;if(s=h?u.geometries[P]:u,s!==null){l=s.coordinates;var O=s.type;switch(d=r&&(O==="Polygon"||O==="MultiPolygon")?1:0,O){case null:break;case"Point":if(t(l,f,C,w,T)===!1)return!1;f++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],f,C,w,T)===!1)return!1;f++,O==="MultiPoint"&&w++}O==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-d;o++){if(t(l[n][o],f,C,w,T)===!1)return!1;f++}O==="MultiLineString"&&w++,O==="Polygon"&&T++}O==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(T=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-d;i++){if(t(l[n][o][i],f,C,w,T)===!1)return!1;f++}T++}w++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(jy(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ume(e,t,r,n){var o=r;return jy(e,function(i,s,a,l,u){s===0&&r===void 0?o=i:o=t(o,i,s,a,l,u)},n),o}function Mj(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 Vme(e,t,r){var n=r;return Mj(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}function Oj(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 zme(e,t,r){var n=r;return Oj(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}function Hme(e){var t=[];return jy(e,function(r){t.push(r)}),t}function Mw(e,t){var r,n,o,i,s,a,l,u,d,f,h=0,b=e.type==="FeatureCollection",v=e.type==="Feature",I=b?e.features.length:1;for(r=0;r<I;r++){for(a=b?e.features[r].geometry:v?e.geometry:e,u=b?e.features[r].properties:v?e.properties:{},d=b?e.features[r].bbox:v?e.bbox:void 0,f=b?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,u,d,f)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,h,u,d,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],h,u,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Wme(e,t,r){var n=r;return Mw(e,function(o,i,s,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,s,a,l)}),n}function Lx(e,t){Mw(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(kn.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 u=0;u<r.coordinates.length;u++){var d=r.coordinates[u],f={type:l,coordinates:d};if(t(kn.feature(f,o),n,u)===!1)return!1}})}function qme(e,t,r){var n=r;return Lx(e,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=t(n,o,i,s)}),n}function Ej(e,t){Lx(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,u=0,d=0;if(jy(r,function(f,h,b,v,I){if(a===void 0||n>l||v>u||I>d){a=f,l=n,u=v,d=I,i=0;return}var x=kn.lineString([a,f],r.properties);if(t(x,n,o,I,i)===!1)return!1;i++,a=f})===!1)return!1}}})}function Zme(e,t,r){var n=r,o=!1;return Ej(e,function(i,s,a,l,u){o===!1&&r===void 0?n=i:n=t(n,i,s,a,l,u),o=!0}),n}function _j(e,t){if(!e)throw new Error("geojson is required");Lx(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(kn.lineString(s[a],r.properties),n,o,a)===!1)return!1;break}}})}function Xme(e,t,r){var n=r;return _j(e,function(o,i,s,a){i===0&&r===void 0?n=o:n=t(n,o,i,s,a)}),n}function Yme(e,t){if(t=t||{},!kn.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),kn.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),kn.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),kn.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),kn.lineString([l[n][o][i],l[n][o][i+1]],s,t)}throw new Error("geojson is invalid")}function Kme(e,t){if(t=t||{},!kn.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 kn.point(l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),kn.point(l[n],s,t);case"LineString":return i<0&&(i=l.length+i),kn.point(l[i],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i),kn.point(l[o][i],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i),kn.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),kn.point(l[n][o][i],s,t)}throw new Error("geojson is invalid")}Ur.coordAll=Hme;Ur.coordEach=jy;Ur.coordReduce=Ume;Ur.featureEach=Oj;Ur.featureReduce=zme;Ur.findPoint=Kme;Ur.findSegment=Yme;Ur.flattenEach=Lx;Ur.flattenReduce=qme;Ur.geomEach=Mw;Ur.geomReduce=Wme;Ur.lineEach=_j;Ur.lineReduce=Xme;Ur.propEach=Mj;Ur.propReduce=Vme;Ur.segmentEach=Ej;Ur.segmentReduce=Zme});var Ow=H((dQe,Dj)=>{"use strict";p();var kj=Object.prototype.toString;Dj.exports=function(t){var r=kj.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&kj.call(t.callee)==="[object Function]"),n}});var Uj=H((mQe,Gj)=>{"use strict";p();var jj;Object.keys||(Gy=Object.prototype.hasOwnProperty,Ew=Object.prototype.toString,Fj=Ow(),_w=Object.prototype.propertyIsEnumerable,Lj=!_w.call({toString:null},"toString"),Rj=_w.call(function(){},"prototype"),Uy=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Rx=function(e){var t=e.constructor;return t&&t.prototype===e},Nj={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Bj=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!Nj["$"+e]&&Gy.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Rx(window[e])}catch{return!0}}catch{return!0}return!1}(),$j=function(e){if(typeof window>"u"||!Bj)return Rx(e);try{return Rx(e)}catch{return!1}},jj=function(t){var r=t!==null&&typeof t=="object",n=Ew.call(t)==="[object Function]",o=Fj(t),i=r&&Ew.call(t)==="[object String]",s=[];if(!r&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var a=Rj&&n;if(i&&t.length>0&&!Gy.call(t,0))for(var l=0;l<t.length;++l)s.push(String(l));if(o&&t.length>0)for(var u=0;u<t.length;++u)s.push(String(u));else for(var d in t)!(a&&d==="prototype")&&Gy.call(t,d)&&s.push(String(d));if(Lj)for(var f=$j(t),h=0;h<Uy.length;++h)!(f&&Uy[h]==="constructor")&&Gy.call(t,Uy[h])&&s.push(Uy[h]);return s});var Gy,Ew,Fj,_w,Lj,Rj,Uy,Rx,Nj,Bj,$j;Gj.exports=jj});var Bx=H((yQe,Hj)=>{"use strict";p();var Jme=Array.prototype.slice,Qme=Ow(),Vj=Object.keys,Nx=Vj?function(t){return Vj(t)}:Uj(),zj=Object.keys;Nx.shim=function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=function(n){return Qme(n)?zj(Jme.call(n)):zj(n)})}else Object.keys=Nx;return Object.keys||Nx};Hj.exports=Nx});var qj=H((bQe,Wj)=>{"use strict";p();Wj.exports=Error});var Xj=H((xQe,Zj)=>{"use strict";p();Zj.exports=EvalError});var Kj=H((SQe,Yj)=>{"use strict";p();Yj.exports=RangeError});var Qj=H((PQe,Jj)=>{"use strict";p();Jj.exports=ReferenceError});var Aw=H((wQe,eG)=>{"use strict";p();eG.exports=SyntaxError});var el=H((OQe,tG)=>{"use strict";p();tG.exports=TypeError});var nG=H((_Qe,rG)=>{"use strict";p();rG.exports=URIError});var Vy=H((kQe,oG)=>{"use strict";p();oG.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0}});var $x=H((FQe,sG)=>{"use strict";p();var iG=typeof Symbol<"u"&&Symbol,ehe=Vy();sG.exports=function(){return typeof iG!="function"||typeof Symbol!="function"||typeof iG("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ehe()}});var lG=H((RQe,aG)=>{"use strict";p();var kw={__proto__:null,foo:{}},the=Object;aG.exports=function(){return{__proto__:kw}.foo===kw.foo&&!(kw instanceof the)}});var pG=H((BQe,uG)=>{"use strict";p();var rhe="Function.prototype.bind called on incompatible ",nhe=Object.prototype.toString,ohe=Math.max,ihe="[object Function]",cG=function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},she=function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},ahe=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};uG.exports=function(t){var r=this;if(typeof r!="function"||nhe.apply(r)!==ihe)throw new TypeError(rhe+r);for(var n=she(arguments,1),o,i=function(){if(this instanceof o){var d=r.apply(this,cG(n,arguments));return Object(d)===d?d:this}return r.apply(t,cG(n,arguments))},s=ohe(0,r.length-n.length),a=[],l=0;l<s;l++)a[l]="$"+l;if(o=Function("binder","return function ("+ahe(a,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var u=function(){};u.prototype=r.prototype,o.prototype=new u,u.prototype=null}return o}});var jx=H((jQe,dG)=>{"use strict";p();var lhe=pG();dG.exports=Function.prototype.bind||lhe});var Dw=H((UQe,fG)=>{"use strict";p();var che=Function.prototype.call,uhe=Object.prototype.hasOwnProperty,phe=jx();fG.exports=phe.call(che,uhe)});var Hi=H((zQe,bG)=>{"use strict";p();var at,dhe=qj(),fhe=Xj(),mhe=Kj(),hhe=Qj(),zf=Aw(),Vf=el(),yhe=nG(),gG=Function,Fw=function(e){try{return gG('"use strict"; return ('+e+").constructor;")()}catch{}},Ku=Object.getOwnPropertyDescriptor;if(Ku)try{Ku({},"")}catch{Ku=null}var Lw=function(){throw new Vf},ghe=Ku?function(){try{return arguments.callee,Lw}catch{try{return Ku(arguments,"callee").get}catch{return Lw}}}():Lw,Gf=$x()(),bhe=lG()(),Jr=Object.getPrototypeOf||(bhe?function(e){return e.__proto__}:null),Uf={},vhe=typeof Uint8Array>"u"||!Jr?at:Jr(Uint8Array),Ju={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?at:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?at:ArrayBuffer,"%ArrayIteratorPrototype%":Gf&&Jr?Jr([][Symbol.iterator]()):at,"%AsyncFromSyncIteratorPrototype%":at,"%AsyncFunction%":Uf,"%AsyncGenerator%":Uf,"%AsyncGeneratorFunction%":Uf,"%AsyncIteratorPrototype%":Uf,"%Atomics%":typeof Atomics>"u"?at:Atomics,"%BigInt%":typeof BigInt>"u"?at:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?at:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?at:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?at:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":dhe,"%eval%":eval,"%EvalError%":fhe,"%Float32Array%":typeof Float32Array>"u"?at:Float32Array,"%Float64Array%":typeof Float64Array>"u"?at:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?at:FinalizationRegistry,"%Function%":gG,"%GeneratorFunction%":Uf,"%Int8Array%":typeof Int8Array>"u"?at:Int8Array,"%Int16Array%":typeof Int16Array>"u"?at:Int16Array,"%Int32Array%":typeof Int32Array>"u"?at:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Gf&&Jr?Jr(Jr([][Symbol.iterator]())):at,"%JSON%":typeof JSON=="object"?JSON:at,"%Map%":typeof Map>"u"?at:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Gf||!Jr?at:Jr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?at:Promise,"%Proxy%":typeof Proxy>"u"?at:Proxy,"%RangeError%":mhe,"%ReferenceError%":hhe,"%Reflect%":typeof Reflect>"u"?at:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?at:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Gf||!Jr?at:Jr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?at:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Gf&&Jr?Jr(""[Symbol.iterator]()):at,"%Symbol%":Gf?Symbol:at,"%SyntaxError%":zf,"%ThrowTypeError%":ghe,"%TypedArray%":vhe,"%TypeError%":Vf,"%Uint8Array%":typeof Uint8Array>"u"?at:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?at:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?at:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?at:Uint32Array,"%URIError%":yhe,"%WeakMap%":typeof WeakMap>"u"?at:WeakMap,"%WeakRef%":typeof WeakRef>"u"?at:WeakRef,"%WeakSet%":typeof WeakSet>"u"?at:WeakSet};if(Jr)try{null.error}catch(e){mG=Jr(Jr(e)),Ju["%Error.prototype%"]=mG}var mG,xhe=function e(t){var r;if(t==="%AsyncFunction%")r=Fw("async function () {}");else if(t==="%GeneratorFunction%")r=Fw("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Fw("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Jr&&(r=Jr(o.prototype))}return Ju[t]=r,r},hG={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},zy=jx(),Gx=Dw(),Ihe=zy.call(Function.call,Array.prototype.concat),She=zy.call(Function.apply,Array.prototype.splice),yG=zy.call(Function.call,String.prototype.replace),Ux=zy.call(Function.call,String.prototype.slice),Che=zy.call(Function.call,RegExp.prototype.exec),Phe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,The=/\\(\\)?/g,whe=function(t){var r=Ux(t,0,1),n=Ux(t,-1);if(r==="%"&&n!=="%")throw new zf("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new zf("invalid intrinsic syntax, expected opening `%`");var o=[];return yG(t,Phe,function(i,s,a,l){o[o.length]=a?yG(l,The,"$1"):s||i}),o},Mhe=function(t,r){var n=t,o;if(Gx(hG,n)&&(o=hG[n],n="%"+o[0]+"%"),Gx(Ju,n)){var i=Ju[n];if(i===Uf&&(i=xhe(n)),typeof i>"u"&&!r)throw new Vf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new zf("intrinsic "+t+" does not exist!")};bG.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Vf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Vf('"allowMissing" argument must be a boolean');if(Che(/^%?[^%]*%?$/,t)===null)throw new zf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=whe(t),o=n.length>0?n[0]:"",i=Mhe("%"+o+"%",r),s=i.name,a=i.value,l=!1,u=i.alias;u&&(o=u[0],She(n,Ihe([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var h=n[d],b=Ux(h,0,1),v=Ux(h,-1);if((b==='"'||b==="'"||b==="`"||v==='"'||v==="'"||v==="`")&&b!==v)throw new zf("property names with quotes must have matching quotes");if((h==="constructor"||!f)&&(l=!0),o+="."+h,s="%"+o+"%",Gx(Ju,s))a=Ju[s];else if(a!=null){if(!(h in a)){if(!r)throw new Vf("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ku&&d+1>=n.length){var I=Ku(a,h);f=!!I,f&&"get"in I&&!("originalValue"in I.get)?a=I.get:a=a[h]}else f=Gx(a,h),a=a[h];f&&!l&&(Ju[s]=a)}}return a}});var zx=H((WQe,vG)=>{"use strict";p();var Ohe=Hi(),Vx=Ohe("%Object.defineProperty%",!0)||!1;if(Vx)try{Vx({},"a",{value:1})}catch{Vx=!1}vG.exports=Vx});var Wx=H((ZQe,xG)=>{"use strict";p();var Ehe=Hi(),Hx=Ehe("%Object.getOwnPropertyDescriptor%",!0);if(Hx)try{Hx([],"length")}catch{Hx=null}xG.exports=Hx});var qx=H((YQe,CG)=>{"use strict";p();var IG=zx(),_he=Aw(),Hf=el(),SG=Wx();CG.exports=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Hf("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Hf("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Hf("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Hf("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Hf("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Hf("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!SG&&SG(t,r);if(IG)IG(t,r,{configurable:s===null&&l?l.configurable:!s,enumerable:o===null&&l?l.enumerable:!o,value:n,writable:i===null&&l?l.writable:!i});else if(a||!o&&!i&&!s)t[r]=n;else throw new _he("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Zx=H((JQe,TG)=>{"use strict";p();var Rw=zx(),PG=function(){return!!Rw};PG.hasArrayLengthDefineBug=function(){if(!Rw)return null;try{return Rw([],"length",{value:1}).length!==1}catch{return!0}};TG.exports=PG});var fc=H((eet,EG)=>{"use strict";p();var Ahe=Bx(),khe=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Dhe=Object.prototype.toString,Fhe=Array.prototype.concat,wG=qx(),Lhe=function(e){return typeof e=="function"&&Dhe.call(e)==="[object Function]"},MG=Zx()(),Rhe=function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!Lhe(n)||!n())return}MG?wG(e,t,r,!0):wG(e,t,r)},OG=function(e,t){var r=arguments.length>2?arguments[2]:{},n=Ahe(t);khe&&(n=Fhe.call(n,Object.getOwnPropertySymbols(t)));for(var o=0;o<n.length;o+=1)Rhe(e,n[o],t[n[o]],r[n[o]])};OG.supportsDescriptors=!!MG;EG.exports=OG});var FG=H((ret,DG)=>{"use strict";p();var Nhe=Hi(),_G=qx(),Bhe=Zx()(),AG=Wx(),kG=el(),$he=Nhe("%Math.floor%");DG.exports=function(t,r){if(typeof t!="function")throw new kG("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||$he(r)!==r)throw new kG("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in t&&AG){var s=AG(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(i=!1)}return(o||i||!n)&&(Bhe?_G(t,"length",r,!0,!0):_G(t,"length",r)),t}});var Qu=H((oet,Xx)=>{"use strict";p();var Nw=jx(),Yx=Hi(),jhe=FG(),Ghe=el(),NG=Yx("%Function.prototype.apply%"),BG=Yx("%Function.prototype.call%"),$G=Yx("%Reflect.apply%",!0)||Nw.call(BG,NG),LG=zx(),Uhe=Yx("%Math.max%");Xx.exports=function(t){if(typeof t!="function")throw new Ghe("a function is required");var r=$G(Nw,BG,arguments);return jhe(r,1+Uhe(0,t.length-(arguments.length-1)),!0)};var RG=function(){return $G(Nw,NG,arguments)};LG?LG(Xx.exports,"apply",{value:RG}):Xx.exports.apply=RG});var Lo=H((set,UG)=>{"use strict";p();var jG=Hi(),GG=Qu(),Vhe=GG(jG("String.prototype.indexOf"));UG.exports=function(t,r){var n=jG(t,!!r);return typeof n=="function"&&Vhe(t,".prototype.")>-1?GG(n):n}});var Bw=H((cet,qG)=>{"use strict";p();var zhe=Bx(),HG=Vy()(),WG=Lo(),VG=Object,Hhe=WG("Array.prototype.push"),zG=WG("Object.prototype.propertyIsEnumerable"),Whe=HG?Object.getOwnPropertySymbols:null;qG.exports=function(t,r){if(t==null)throw new TypeError("target must be an object");var n=VG(t);if(arguments.length===1)return n;for(var o=1;o<arguments.length;++o){var i=VG(arguments[o]),s=zhe(i),a=HG&&(Object.getOwnPropertySymbols||Whe);if(a)for(var l=a(i),u=0;u<l.length;++u){var d=l[u];zG(i,d)&&Hhe(s,d)}for(var f=0;f<s.length;++f){var h=s[f];if(zG(i,h)){var b=i[h];n[h]=b}}}return n}});var jw=H((pet,ZG)=>{"use strict";p();var $w=Bw(),qhe=function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var s in o)i+=s;return e!==i},Zhe=function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch{return e[1]==="y"}return!1};ZG.exports=function(){return!Object.assign||qhe()||Zhe()?$w:Object.assign}});var YG=H((fet,XG)=>{"use strict";p();var Xhe=fc(),Yhe=jw();XG.exports=function(){var t=Yhe();return Xhe(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var eU=H((het,QG)=>{"use strict";p();var Khe=fc(),Jhe=Qu(),Qhe=Bw(),KG=jw(),eye=YG(),tye=Jhe.apply(KG()),JG=function(t,r){return tye(Object,arguments)};Khe(JG,{getPolyfill:KG,implementation:Qhe,shim:eye});QG.exports=JG});var rU=H((get,tU)=>{"use strict";p();var Wy=function(){return typeof(function(){}).name=="string"},Hy=Object.getOwnPropertyDescriptor;if(Hy)try{Hy([],"length")}catch{Hy=null}Wy.functionsHaveConfigurableNames=function(){if(!Wy()||!Hy)return!1;var t=Hy(function(){},"name");return!!t&&!!t.configurable};var rye=Function.prototype.bind;Wy.boundFunctionsHaveNames=function(){return Wy()&&typeof rye=="function"&&(function(){}).bind().name!==""};tU.exports=Wy});var iU=H((vet,oU)=>{"use strict";p();var nU=qx(),nye=Zx()(),oye=rU().functionsHaveConfigurableNames(),iye=el();oU.exports=function(t,r){if(typeof t!="function")throw new iye("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||oye)&&(nye?nU(t,"name",r,!0,!0):nU(t,"name",r)),t}});var Gw=H((Iet,sU)=>{"use strict";p();var sye=iU(),aye=el(),lye=Object;sU.exports=sye(function(){if(this==null||this!==lye(this))throw new aye("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var Uw=H((Pet,aU)=>{"use strict";p();var cye=Gw(),uye=fc().supportsDescriptors,pye=Object.getOwnPropertyDescriptor;aU.exports=function(){if(uye&&/a/mig.flags==="gim"){var t=pye(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(n,"sticky",{get:function(){r+="y"}}),r==="dy")return t.get}}return cye}});var uU=H((wet,cU)=>{"use strict";p();var dye=fc().supportsDescriptors,fye=Uw(),mye=Object.getOwnPropertyDescriptor,hye=Object.defineProperty,yye=TypeError,lU=Object.getPrototypeOf,gye=/a/;cU.exports=function(){if(!dye||!lU)throw new yye("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=fye(),r=lU(gye),n=mye(r,"flags");return(!n||n.get!==t)&&hye(r,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var mU=H((Oet,fU)=>{"use strict";p();var bye=fc(),vye=Qu(),xye=Gw(),pU=Uw(),Iye=uU(),dU=vye(pU());bye(dU,{getPolyfill:pU,implementation:xye,shim:Iye});fU.exports=dU});var mc=H((_et,hU)=>{"use strict";p();var Sye=Vy();hU.exports=function(){return Sye()&&!!Symbol.toStringTag}});var zw=H((ket,gU)=>{"use strict";p();var Cye=mc()(),Pye=Lo(),Vw=Pye("Object.prototype.toString"),Kx=function(t){return Cye&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Vw(t)==="[object Arguments]"},yU=function(t){return Kx(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Vw(t)!=="[object Array]"&&Vw(t.callee)==="[object Function]"},Tye=function(){return Kx(arguments)}();Kx.isLegacyArguments=yU;gU.exports=Tye?Kx:yU});var bU=H(()=>{p()});var BU=H((Net,NU)=>{p();var eM=typeof Map=="function"&&Map.prototype,Hw=Object.getOwnPropertyDescriptor&&eM?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qx=eM&&Hw&&typeof Hw.get=="function"?Hw.get:null,vU=eM&&Map.prototype.forEach,tM=typeof Set=="function"&&Set.prototype,Ww=Object.getOwnPropertyDescriptor&&tM?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,e2=tM&&Ww&&typeof Ww.get=="function"?Ww.get:null,xU=tM&&Set.prototype.forEach,wye=typeof WeakMap=="function"&&WeakMap.prototype,Zy=wye?WeakMap.prototype.has:null,Mye=typeof WeakSet=="function"&&WeakSet.prototype,Xy=Mye?WeakSet.prototype.has:null,Oye=typeof WeakRef=="function"&&WeakRef.prototype,IU=Oye?WeakRef.prototype.deref:null,Eye=Boolean.prototype.valueOf,_ye=Object.prototype.toString,Aye=Function.prototype.toString,kye=String.prototype.match,rM=String.prototype.slice,yc=String.prototype.replace,Dye=String.prototype.toUpperCase,SU=String.prototype.toLowerCase,AU=RegExp.prototype.test,CU=Array.prototype.concat,Hs=Array.prototype.join,Fye=Array.prototype.slice,PU=Math.floor,Xw=typeof BigInt=="function"?BigInt.prototype.valueOf:null,qw=Object.getOwnPropertySymbols,Yw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Dn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Wf||!0)?Symbol.toStringTag:null,kU=Object.prototype.propertyIsEnumerable,TU=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function wU(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||AU.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-PU(-e):PU(e);if(n!==e){var o=String(n),i=rM.call(t,o.length+1);return yc.call(o,r,"$&_")+"."+yc.call(yc.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yc.call(t,r,"$&_")}var Kw=bU(),MU=Kw.custom,OU=FU(MU)?MU:null;NU.exports=function e(t,r,n,o){var i=r||{};if(hc(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(hc(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=hc(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(hc(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(hc(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return RU(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?wU(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return a?wU(t,u):u}var d=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof t=="object")return Jw(t)?"[Array]":"[Object]";var f=Jye(i,n);if(typeof o>"u")o=[];else if(LU(o,t)>=0)return"[Circular]";function h(K,Z,oe){if(Z&&(o=Fye.call(o),o.push(Z)),oe){var Q={depth:i.depth};return hc(i,"quoteStyle")&&(Q.quoteStyle=i.quoteStyle),e(K,Q,n+1,o)}return e(K,i,n+1,o)}if(typeof t=="function"&&!EU(t)){var b=Vye(t),v=Jx(t,h);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(v.length>0?" { "+Hs.call(v,", ")+" }":"")}if(FU(t)){var I=Wf?yc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Yw.call(t);return typeof t=="object"&&!Wf?qy(I):I}if(Xye(t)){for(var x="<"+SU.call(String(t.nodeName)),C=t.attributes||[],P=0;P<C.length;P++)x+=" "+C[P].name+"="+DU(Lye(C[P].value),"double",i);return x+=">",t.childNodes&&t.childNodes.length&&(x+="..."),x+="</"+SU.call(String(t.nodeName))+">",x}if(Jw(t)){if(t.length===0)return"[]";var w=Jx(t,h);return f&&!Kye(w)?"["+Qw(w,f)+"]":"[ "+Hs.call(w,", ")+" ]"}if(Nye(t)){var T=Jx(t,h);return!("cause"in Error.prototype)&&"cause"in t&&!kU.call(t,"cause")?"{ ["+String(t)+"] "+Hs.call(CU.call("[cause]: "+h(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Hs.call(T,", ")+" }"}if(typeof t=="object"&&s){if(OU&&typeof t[OU]=="function"&&Kw)return Kw(t,{depth:d-n});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(zye(t)){var O=[];return vU&&vU.call(t,function(K,Z){O.push(h(Z,t,!0)+" => "+h(K,t))}),_U("Map",Qx.call(t),O,f)}if(qye(t)){var N=[];return xU&&xU.call(t,function(K){N.push(h(K,t))}),_U("Set",e2.call(t),N,f)}if(Hye(t))return Zw("WeakMap");if(Zye(t))return Zw("WeakSet");if(Wye(t))return Zw("WeakRef");if($ye(t))return qy(h(Number(t)));if(Gye(t))return qy(h(Xw.call(t)));if(jye(t))return qy(Eye.call(t));if(Bye(t))return qy(h(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!Rye(t)&&!EU(t)){var k=Jx(t,h),D=TU?TU(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",z=!D&&Dn&&Object(t)===t&&Dn in t?rM.call(gc(t),8,-1):F?"Object":"",G=D||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",j=G+(z||F?"["+Hs.call(CU.call([],z||[],F||[]),": ")+"] ":"");return k.length===0?j+"{}":f?j+"{"+Qw(k,f)+"}":j+"{ "+Hs.call(k,", ")+" }"}return String(t)};function DU(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function Lye(e){return yc.call(String(e),/"/g,""")}function Jw(e){return gc(e)==="[object Array]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function Rye(e){return gc(e)==="[object Date]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function EU(e){return gc(e)==="[object RegExp]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function Nye(e){return gc(e)==="[object Error]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function Bye(e){return gc(e)==="[object String]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function $ye(e){return gc(e)==="[object Number]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function jye(e){return gc(e)==="[object Boolean]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function FU(e){if(Wf)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Yw)return!1;try{return Yw.call(e),!0}catch{}return!1}function Gye(e){if(!e||typeof e!="object"||!Xw)return!1;try{return Xw.call(e),!0}catch{}return!1}var Uye=Object.prototype.hasOwnProperty||function(e){return e in this};function hc(e,t){return Uye.call(e,t)}function gc(e){return _ye.call(e)}function Vye(e){if(e.name)return e.name;var t=kye.call(Aye.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function LU(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function zye(e){if(!Qx||!e||typeof e!="object")return!1;try{Qx.call(e);try{e2.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Hye(e){if(!Zy||!e||typeof e!="object")return!1;try{Zy.call(e,Zy);try{Xy.call(e,Xy)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Wye(e){if(!IU||!e||typeof e!="object")return!1;try{return IU.call(e),!0}catch{}return!1}function qye(e){if(!e2||!e||typeof e!="object")return!1;try{e2.call(e);try{Qx.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function Zye(e){if(!Xy||!e||typeof e!="object")return!1;try{Xy.call(e,Xy);try{Zy.call(e,Zy)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Xye(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function RU(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return RU(rM.call(e,0,t.maxStringLength),t)+n}var o=yc.call(yc.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Yye);return DU(o,"single",t)}function Yye(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+Dye.call(t.toString(16))}function qy(e){return"Object("+e+")"}function Zw(e){return e+" { ? }"}function _U(e,t,r,n){var o=n?Qw(r,n):Hs.call(r,", ");return e+" ("+t+") {"+o+"}"}function Kye(e){for(var t=0;t<e.length;t++)if(LU(e[t],"\n")>=0)return!1;return!0}function Jye(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Hs.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Hs.call(Array(t+1),r)}}function Qw(e,t){if(e.length===0)return"";var r="\n"+t.prev+t.base;return r+Hs.call(e,","+r)+"\n"+t.prev}function Jx(e,t){var r=Jw(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=hc(e,o)?t(e[o],e):""}var i=typeof qw=="function"?qw(e):[],s;if(Wf){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var l in e)hc(e,l)&&(r&&String(Number(l))===l&&l<e.length||Wf&&s["$"+l]instanceof Symbol||(AU.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof qw=="function")for(var u=0;u<i.length;u++)kU.call(e,i[u])&&n.push("["+t(i[u])+"]: "+t(e[i[u]],e));return n}});var oM=H(($et,jU)=>{"use strict";p();var $U=Hi(),qf=Lo(),Qye=BU(),ege=el(),t2=$U("%WeakMap%",!0),r2=$U("%Map%",!0),tge=qf("WeakMap.prototype.get",!0),rge=qf("WeakMap.prototype.set",!0),nge=qf("WeakMap.prototype.has",!0),oge=qf("Map.prototype.get",!0),ige=qf("Map.prototype.set",!0),sge=qf("Map.prototype.has",!0),nM=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},age=function(e,t){var r=nM(e,t);return r&&r.value},lge=function(e,t,r){var n=nM(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},cge=function(e,t){return!!nM(e,t)};jU.exports=function(){var t,r,n,o={assert:function(i){if(!o.has(i))throw new ege("Side channel does not contain "+Qye(i))},get:function(i){if(t2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return tge(t,i)}else if(r2){if(r)return oge(r,i)}else if(n)return age(n,i)},has:function(i){if(t2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return nge(t,i)}else if(r2){if(r)return sge(r,i)}else if(n)return cge(n,i);return!1},set:function(i,s){t2&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new t2),rge(t,i,s)):r2?(r||(r=new r2),ige(r,i,s)):(n||(n={key:{},next:null}),lge(n,i,s))}};return o}});var UU=H((Get,GU)=>{"use strict";p();var uge=Dw(),Yy=oM()(),tl=el(),iM={assert:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");if(Yy.assert(e),!iM.has(e,t))throw new tl("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");var r=Yy.get(e);return r&&r["$"+t]},has:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");var r=Yy.get(e);return!!r&&uge(r,"$"+t)},set:function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");var n=Yy.get(e);n||(n={},Yy.set(e,n)),n["$"+t]=r}};Object.freeze&&Object.freeze(iM);GU.exports=iM});var HU=H((Vet,zU)=>{"use strict";p();var Ky=UU(),pge=SyntaxError,VU=typeof StopIteration=="object"?StopIteration:null;zU.exports=function(t){if(!VU)throw new pge("this environment lacks StopIteration");Ky.set(t,"[[Done]]",!1);var r={next:function(){var o=Ky.get(this,"[[Iterator]]"),i=Ky.get(o,"[[Done]]");try{return{done:i,value:i?void 0:o.next()}}catch(s){if(Ky.set(o,"[[Done]]",!0),s!==VU)throw s;return{done:!0,value:void 0}}}};return Ky.set(r,"[[Iterator]]",t),r}});var sM=H((Het,WU)=>{p();var dge={}.toString;WU.exports=Array.isArray||function(e){return dge.call(e)=="[object Array]"}});var aM=H((qet,qU)=>{"use strict";p();var fge=String.prototype.valueOf,mge=function(t){try{return fge.call(t),!0}catch{return!1}},hge=Object.prototype.toString,yge="[object String]",gge=mc()();qU.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:gge?mge(t):hge.call(t)===yge}});var cM=H((Xet,YU)=>{"use strict";p();var lM=typeof Map=="function"&&Map.prototype?Map:null,bge=typeof Set=="function"&&Set.prototype?Set:null,n2;lM||(n2=function(t){return!1});var XU=lM?Map.prototype.has:null,ZU=bge?Set.prototype.has:null;!n2&&!XU&&(n2=function(t){return!1});YU.exports=n2||function(t){if(!t||typeof t!="object")return!1;try{if(XU.call(t),ZU)try{ZU.call(t)}catch{return!0}return t instanceof lM}catch{}return!1}});var pM=H((Ket,QU)=>{"use strict";p();var vge=typeof Map=="function"&&Map.prototype?Map:null,uM=typeof Set=="function"&&Set.prototype?Set:null,o2;uM||(o2=function(t){return!1});var KU=vge?Map.prototype.has:null,JU=uM?Set.prototype.has:null;!o2&&!JU&&(o2=function(t){return!1});QU.exports=o2||function(t){if(!t||typeof t!="object")return!1;try{if(JU.call(t),KU)try{KU.call(t)}catch{return!0}return t instanceof uM}catch{}return!1}});var pV=H((Qet,a2)=>{"use strict";p();var eV=zw(),tV=HU();$x()()||Vy()()?(i2=Symbol.iterator,a2.exports=function(t){if(t!=null&&typeof t[i2]<"u")return t[i2]();if(eV(t))return Array.prototype[i2].call(t)}):(rV=sM(),nV=aM(),dM=Hi(),oV=dM("%Map%",!0),iV=dM("%Set%",!0),pi=Lo(),fM=pi("Array.prototype.push"),mM=pi("String.prototype.charCodeAt"),sV=pi("String.prototype.slice"),aV=function(t,r){var n=t.length;if(r+1>=n)return r+1;var o=mM(t,r);if(o<55296||o>56319)return r+1;var i=mM(t,r+1);return i<56320||i>57343?r+1:r+2},s2=function(t){var r=0;return{next:function(){var o=r>=t.length,i;return o||(i=t[r],r+=1),{done:o,value:i}}}},hM=function(t,r){if(rV(t)||eV(t))return s2(t);if(nV(t)){var n=0;return{next:function(){var i=aV(t,n),s=sV(t,n,i);return n=i,{done:i>t.length,value:s}}}}if(r&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},!oV&&!iV?a2.exports=function(t){if(t!=null)return hM(t,!0)}:(lV=cM(),cV=pM(),yM=pi("Map.prototype.forEach",!0),gM=pi("Set.prototype.forEach",!0),(typeof g>"u"||!g.versions||!g.versions.node)&&(bM=pi("Map.prototype.iterator",!0),vM=pi("Set.prototype.iterator",!0)),xM=pi("Map.prototype.@@iterator",!0)||pi("Map.prototype._es6-shim iterator_",!0),IM=pi("Set.prototype.@@iterator",!0)||pi("Set.prototype._es6-shim iterator_",!0),uV=function(t){if(lV(t)){if(bM)return tV(bM(t));if(xM)return xM(t);if(yM){var r=[];return yM(t,function(o,i){fM(r,[i,o])}),s2(r)}}if(cV(t)){if(vM)return tV(vM(t));if(IM)return IM(t);if(gM){var n=[];return gM(t,function(o){fM(n,o)}),s2(n)}}},a2.exports=function(t){return uV(t)||hM(t)}));var i2,rV,nV,dM,oV,iV,pi,fM,mM,sV,aV,s2,hM,lV,cV,yM,gM,bM,vM,xM,IM,uV});var SM=H((ttt,fV)=>{"use strict";p();var dV=function(e){return e!==e};fV.exports=function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||dV(t)&&dV(r))}});var CM=H((ntt,mV)=>{"use strict";p();var xge=SM();mV.exports=function(){return typeof Object.is=="function"?Object.is:xge}});var yV=H((itt,hV)=>{"use strict";p();var Ige=CM(),Sge=fc();hV.exports=function(){var t=Ige();return Sge(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var xV=H((att,vV)=>{"use strict";p();var Cge=fc(),Pge=Qu(),Tge=SM(),gV=CM(),wge=yV(),bV=Pge(gV(),Object);Cge(bV,{getPolyfill:gV,implementation:Tge,shim:wge});vV.exports=bV});var TM=H((ctt,PV)=>{"use strict";p();var Mge=Qu(),CV=Lo(),Oge=Hi(),PM=Oge("%ArrayBuffer%",!0),l2=CV("ArrayBuffer.prototype.byteLength",!0),Ege=CV("Object.prototype.toString"),IV=!!PM&&!l2&&new PM(0).slice,SV=!!IV&&Mge(IV);PV.exports=l2||SV?function(t){if(!t||typeof t!="object")return!1;try{return l2?l2(t):SV(t,0),!0}catch{return!1}}:PM?function(t){return Ege(t)==="[object ArrayBuffer]"}:function(t){return!1}});var wV=H((ptt,TV)=>{"use strict";p();var _ge=Date.prototype.getDay,Age=function(t){try{return _ge.call(t),!0}catch{return!1}},kge=Object.prototype.toString,Dge="[object Date]",Fge=mc()();TV.exports=function(t){return typeof t!="object"||t===null?!1:Fge?Age(t):kge.call(t)===Dge}});var AV=H((ftt,_V)=>{"use strict";p();var wM=Lo(),MV=mc()(),OV,EV,MM,OM;MV&&(OV=wM("Object.prototype.hasOwnProperty"),EV=wM("RegExp.prototype.exec"),MM={},c2=function(){throw MM},OM={toString:c2,valueOf:c2},typeof Symbol.toPrimitive=="symbol"&&(OM[Symbol.toPrimitive]=c2));var c2,Lge=wM("Object.prototype.toString"),Rge=Object.getOwnPropertyDescriptor,Nge="[object RegExp]";_V.exports=MV?function(t){if(!t||typeof t!="object")return!1;var r=Rge(t,"lastIndex"),n=r&&OV(r,"value");if(!n)return!1;try{EV(t,OM)}catch(o){return o===MM}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Lge(t)===Nge}});var FV=H((htt,DV)=>{"use strict";p();var Bge=Lo(),kV=Bge("SharedArrayBuffer.prototype.byteLength",!0);DV.exports=kV?function(t){if(!t||typeof t!="object")return!1;try{return kV(t),!0}catch{return!1}}:function(t){return!1}});var RV=H((gtt,LV)=>{"use strict";p();var $ge=Number.prototype.toString,jge=function(t){try{return $ge.call(t),!0}catch{return!1}},Gge=Object.prototype.toString,Uge="[object Number]",Vge=mc()();LV.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:Vge?jge(t):Gge.call(t)===Uge}});var $V=H((vtt,BV)=>{"use strict";p();var NV=Lo(),zge=NV("Boolean.prototype.toString"),Hge=NV("Object.prototype.toString"),Wge=function(t){try{return zge(t),!0}catch{return!1}},qge="[object Boolean]",Zge=mc()();BV.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:Zge&&Symbol.toStringTag in t?Wge(t):Hge(t)===qge}});var VV=H((Itt,EM)=>{"use strict";p();var Xge=Object.prototype.toString,Yge=$x()();Yge?(jV=Symbol.prototype.toString,GV=/^Symbol\(.*\)$/,UV=function(t){return typeof t.valueOf()!="symbol"?!1:GV.test(jV.call(t))},EM.exports=function(t){if(typeof t=="symbol")return!0;if(Xge.call(t)!=="[object Symbol]")return!1;try{return UV(t)}catch{return!1}}):EM.exports=function(t){return!1};var jV,GV,UV});var WV=H((Ctt,HV)=>{"use strict";p();var zV=typeof BigInt<"u"&&BigInt;HV.exports=function(){return typeof zV=="function"&&typeof BigInt=="function"&&typeof zV(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var XV=H((Ttt,_M)=>{"use strict";p();var Kge=WV()();Kge?(qV=BigInt.prototype.valueOf,ZV=function(t){try{return qV.call(t),!0}catch{}return!1},_M.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:ZV(t)}):_M.exports=function(t){return!1};var qV,ZV});var KV=H((Mtt,YV)=>{"use strict";p();var Jge=aM(),Qge=RV(),ebe=$V(),tbe=VV(),rbe=XV();YV.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(Jge(t))return"String";if(Qge(t))return"Number";if(ebe(t))return"Boolean";if(tbe(t))return"Symbol";if(rbe(t))return"BigInt"}});var ez=H((Ett,QV)=>{"use strict";p();var u2=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,JV=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,p2;u2||(p2=function(t){return!1});var kM=u2?u2.prototype.has:null,AM=JV?JV.prototype.has:null;!p2&&!kM&&(p2=function(t){return!1});QV.exports=p2||function(t){if(!t||typeof t!="object")return!1;try{if(kM.call(t,kM),AM)try{AM.call(t,AM)}catch{return!0}return t instanceof u2}catch{}return!1}});var rz=H((Att,FM)=>{"use strict";p();var nbe=Hi(),tz=Lo(),obe=nbe("%WeakSet%",!0),DM=tz("WeakSet.prototype.has",!0);DM?(d2=tz("WeakMap.prototype.has",!0),FM.exports=function(t){if(!t||typeof t!="object")return!1;try{if(DM(t,DM),d2)try{d2(t,d2)}catch{return!0}return t instanceof obe}catch{}return!1}):FM.exports=function(t){return!1};var d2});var oz=H((Dtt,nz)=>{"use strict";p();var ibe=cM(),sbe=pM(),abe=ez(),lbe=rz();nz.exports=function(t){if(t&&typeof t=="object"){if(ibe(t))return"Map";if(sbe(t))return"Set";if(abe(t))return"WeakMap";if(lbe(t))return"WeakSet"}return!1}});var lz=H((Ltt,az)=>{"use strict";p();var sz=Function.prototype.toString,Zf=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,RM,f2;if(typeof Zf=="function"&&typeof Object.defineProperty=="function")try{RM=Object.defineProperty({},"length",{get:function(){throw f2}}),f2={},Zf(function(){throw 42},null,RM)}catch(e){e!==f2&&(Zf=null)}else Zf=null;var cbe=/^\s*class\b/,NM=function(t){try{var r=sz.call(t);return cbe.test(r)}catch{return!1}},LM=function(t){try{return NM(t)?!1:(sz.call(t),!0)}catch{return!1}},m2=Object.prototype.toString,ube="[object Object]",pbe="[object Function]",dbe="[object GeneratorFunction]",fbe="[object HTMLAllCollection]",mbe="[object HTML document.all class]",hbe="[object HTMLCollection]",ybe=typeof Symbol=="function"&&!!Symbol.toStringTag,gbe=!(0 in[,]),BM=function(){return!1};typeof document=="object"&&(iz=document.all,m2.call(iz)===m2.call(document.all)&&(BM=function(t){if((gbe||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=m2.call(t);return(r===fbe||r===mbe||r===hbe||r===ube)&&t("")==null}catch{}return!1}));var iz;az.exports=Zf?function(t){if(BM(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Zf(t,null,RM)}catch(r){if(r!==f2)return!1}return!NM(t)&&LM(t)}:function(t){if(BM(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(ybe)return LM(t);if(NM(t))return!1;var r=m2.call(t);return r!==pbe&&r!==dbe&&!/^\[object HTML/.test(r)?!1:LM(t)}});var pz=H((Ntt,uz)=>{"use strict";p();var bbe=lz(),vbe=Object.prototype.toString,cz=Object.prototype.hasOwnProperty,xbe=function(t,r,n){for(var o=0,i=t.length;o<i;o++)cz.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},Ibe=function(t,r,n){for(var o=0,i=t.length;o<i;o++)n==null?r(t.charAt(o),o,t):r.call(n,t.charAt(o),o,t)},Sbe=function(t,r,n){for(var o in t)cz.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},Cbe=function(t,r,n){if(!bbe(r))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),vbe.call(t)==="[object Array]"?xbe(t,r,o):typeof t=="string"?Ibe(t,r,o):Sbe(t,r,o)};uz.exports=Cbe});var fz=H(($tt,dz)=>{"use strict";p();dz.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var hz=H((Gtt,mz)=>{"use strict";p();var $M=fz(),Pbe=typeof globalThis>"u"?global:globalThis;mz.exports=function(){for(var t=[],r=0;r<$M.length;r++)typeof Pbe[$M[r]]=="function"&&(t[t.length]=$M[r]);return t}});var xz=H((Vtt,vz)=>{"use strict";p();var y2=pz(),Tbe=hz(),yz=Qu(),UM=Lo(),h2=Wx(),wbe=UM("Object.prototype.toString"),bz=mc()(),gz=typeof globalThis>"u"?global:globalThis,GM=Tbe(),VM=UM("String.prototype.slice"),jM=Object.getPrototypeOf,Mbe=UM("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},g2={__proto__:null};bz&&h2&&jM?y2(GM,function(e){var t=new gz[e];if(Symbol.toStringTag in t){var r=jM(t),n=h2(r,Symbol.toStringTag);if(!n){var o=jM(r);n=h2(o,Symbol.toStringTag)}g2["$"+e]=yz(n.get)}}):y2(GM,function(e){var t=new gz[e],r=t.slice||t.set;r&&(g2["$"+e]=yz(r))});var Obe=function(t){var r=!1;return y2(g2,function(n,o){if(!r)try{"$"+n(t)===o&&(r=VM(o,1))}catch{}}),r},Ebe=function(t){var r=!1;return y2(g2,function(n,o){if(!r)try{n(t),r=VM(o,1)}catch{}}),r};vz.exports=function(t){if(!t||typeof t!="object")return!1;if(!bz){var r=VM(wbe(t),8,-1);return Mbe(GM,r)>-1?r:r!=="Object"?!1:Ebe(t)}return h2?Obe(t):null}});var Cz=H((Htt,Sz)=>{"use strict";p();var _be=Lo(),Iz=_be("ArrayBuffer.prototype.byteLength",!0),Abe=TM();Sz.exports=function(t){return Abe(t)?Iz?Iz(t):t.byteLength:NaN}});var Zz=H((qtt,qz)=>{"use strict";p();var zz=eU(),Ws=Lo(),Pz=mU(),kbe=Hi(),Xf=pV(),Dbe=oM(),Tz=xV(),wz=zw(),Mz=sM(),Oz=TM(),Ez=wV(),_z=AV(),Az=FV(),kz=Bx(),Dz=KV(),Fz=oz(),Lz=xz(),Rz=Cz(),Nz=Ws("SharedArrayBuffer.prototype.byteLength",!0),Bz=Ws("Date.prototype.getTime"),zM=Object.getPrototypeOf,$z=Ws("Object.prototype.toString"),v2=kbe("%Set%",!0),HM=Ws("Map.prototype.has",!0),x2=Ws("Map.prototype.get",!0),jz=Ws("Map.prototype.size",!0),I2=Ws("Set.prototype.add",!0),Hz=Ws("Set.prototype.delete",!0),S2=Ws("Set.prototype.has",!0),b2=Ws("Set.prototype.size",!0);function Gz(e,t,r,n){for(var o=Xf(e),i;(i=o.next())&&!i.done;)if(Wi(t,i.value,r,n))return Hz(e,i.value),!0;return!1}function Wz(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function Fbe(e,t,r,n,o,i){var s=Wz(r);if(s!=null)return s;var a=x2(t,s),l=zz({},o,{strict:!1});return typeof a>"u"&&!HM(t,s)||!Wi(n,a,l,i)?!1:!HM(e,s)&&Wi(n,a,l,i)}function Lbe(e,t,r){var n=Wz(r);return n!=null?n:S2(t,n)&&!S2(e,n)}function Uz(e,t,r,n,o,i){for(var s=Xf(e),a,l;(a=s.next())&&!a.done;)if(l=a.value,Wi(r,l,o,i)&&Wi(n,x2(t,l),o,i))return Hz(e,l),!0;return!1}function Wi(e,t,r,n){var o=r||{};if(o.strict?Tz(e,t):e===t)return!0;var i=Dz(e),s=Dz(t);if(i!==s)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return o.strict?Tz(e,t):e==t;var a=n.has(e),l=n.has(t),u;if(a&&l){if(n.get(e)===n.get(t))return!0}else u={};return a||n.set(e,u),l||n.set(t,u),Bbe(e,t,o,n)}function Vz(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Rbe(e,t,r,n){if(b2(e)!==b2(t))return!1;for(var o=Xf(e),i=Xf(t),s,a,l;(s=o.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new v2),I2(l,s.value);else if(!S2(t,s.value)){if(r.strict||!Lbe(e,t,s.value))return!1;l||(l=new v2),I2(l,s.value)}if(l){for(;(a=i.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!Gz(l,a.value,r.strict,n))return!1}else if(!r.strict&&!S2(e,a.value)&&!Gz(l,a.value,r.strict,n))return!1;return b2(l)===0}return!0}function Nbe(e,t,r,n){if(jz(e)!==jz(t))return!1;for(var o=Xf(e),i=Xf(t),s,a,l,u,d,f;(s=o.next())&&!s.done;)if(u=s.value[0],d=s.value[1],u&&typeof u=="object")l||(l=new v2),I2(l,u);else if(f=x2(t,u),typeof f>"u"&&!HM(t,u)||!Wi(d,f,r,n)){if(r.strict||!Fbe(e,t,u,d,r,n))return!1;l||(l=new v2),I2(l,u)}if(l){for(;(a=i.next())&&!a.done;)if(u=a.value[0],f=a.value[1],u&&typeof u=="object"){if(!Uz(l,e,u,f,r,n))return!1}else if(!r.strict&&(!e.has(u)||!Wi(x2(e,u),f,r,n))&&!Uz(l,e,u,f,zz({},r,{strict:!1}),n))return!1;return b2(l)===0}return!0}function Bbe(e,t,r,n){var o,i;if(typeof e!=typeof t||e==null||t==null||$z(e)!==$z(t)||wz(e)!==wz(t))return!1;var s=Mz(e),a=Mz(t);if(s!==a)return!1;var l=e instanceof Error,u=t instanceof Error;if(l!==u||(l||u)&&(e.name!==t.name||e.message!==t.message))return!1;var d=_z(e),f=_z(t);if(d!==f||(d||f)&&(e.source!==t.source||Pz(e)!==Pz(t)))return!1;var h=Ez(e),b=Ez(t);if(h!==b||(h||b)&&Bz(e)!==Bz(t)||r.strict&&zM&&zM(e)!==zM(t))return!1;var v=Lz(e),I=Lz(t);if(v!==I)return!1;if(v||I){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var x=Vz(e),C=Vz(t);if(x!==C)return!1;if(x||C){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var P=Oz(e),w=Oz(t);if(P!==w)return!1;if(P||w)return Rz(e)!==Rz(t)?!1:typeof Uint8Array=="function"&&Wi(new Uint8Array(e),new Uint8Array(t),r,n);var T=Az(e),O=Az(t);if(T!==O)return!1;if(T||O)return Nz(e)!==Nz(t)?!1:typeof Uint8Array=="function"&&Wi(new Uint8Array(e),new Uint8Array(t),r,n);if(typeof e!=typeof t)return!1;var N=kz(e),k=kz(t);if(N.length!==k.length)return!1;for(N.sort(),k.sort(),o=N.length-1;o>=0;o--)if(N[o]!=k[o])return!1;for(o=N.length-1;o>=0;o--)if(i=N[o],!Wi(e[i],t[i],r,n))return!1;var D=Fz(e),F=Fz(t);return D!==F?!1:D==="Set"||F==="Set"?Rbe(e,t,r,n):D==="Map"?Nbe(e,t,r,n):!0}qz.exports=function(t,r,n){return Wi(t,r,n,Dbe())}});var uH=H(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});function $be(e){return e&&e.__esModule?e:{default:e}}var jbe=Object.defineProperty,$t=(e,t)=>jbe(e,"name",{value:t,configurable:!0}),Gbe=Zz(),Ube=$be(Gbe),Xz=class{constructor(t){this.direction=!1,this.compareProperties=!0;var r,n,o;this.precision=10**-((r=t==null?void 0:t.precision)!=null?r:17),this.direction=(n=t==null?void 0:t.direction)!=null?n:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,r){if(t.type!==r.type||!Jy(t,r))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,r.coordinates);case"LineString":return this.compareLine(t.coordinates,r.coordinates);case"Polygon":return this.comparePolygon(t,r);case"GeometryCollection":return this.compareGeometryCollection(t,r);case"Feature":return this.compareFeature(t,r);case"FeatureCollection":return this.compareFeatureCollection(t,r);default:if(t.type.startsWith("Multi")){let n=WM(t),o=WM(r);return n.every(i=>o.some(s=>this.compare(i,s)))}}return!1}compareCoord(t,r){return t.length===r.length&&t.every((n,o)=>Math.abs(n-r[o])<this.precision)}compareLine(t,r,n=0,o=!1){if(!Jy(t,r))return!1;let i=t,s=r;if(o&&!this.compareCoord(i[0],s[0])){let l=this.fixStartIndex(s,i);if(l)s=l;else return!1}let a=this.compareCoord(i[n],s[n]);return this.direction||a?this.comparePath(i,s):this.compareCoord(i[n],s[s.length-(1+n)])?this.comparePath(i.slice().reverse(),s):!1}fixStartIndex(t,r){let n,o=-1;for(let i=0;i<t.length;i++)if(this.compareCoord(t[i],r[0])){o=i;break}return o>=0&&(n=[].concat(t.slice(o,t.length),t.slice(1,o+1))),n}comparePath(t,r){return t.every((n,o)=>this.compareCoord(n,r[o]))}comparePolygon(t,r){if(this.compareLine(t.coordinates[0],r.coordinates[0],1,!0)){let n=t.coordinates.slice(1,t.coordinates.length),o=r.coordinates.slice(1,r.coordinates.length);return n.every(i=>o.some(s=>this.compareLine(i,s,1,!0)))}return!1}compareGeometryCollection(t,r){return Jy(t.geometries,r.geometries)&&this.compareBBox(t,r)&&t.geometries.every((n,o)=>this.compare(n,r.geometries[o]))}compareFeature(t,r){return t.id===r.id&&(this.compareProperties?Ube.default.call(void 0,t.properties,r.properties):!0)&&this.compareBBox(t,r)&&this.compare(t.geometry,r.geometry)}compareFeatureCollection(t,r){return Jy(t.features,r.features)&&this.compareBBox(t,r)&&t.features.every((n,o)=>this.compare(n,r.features[o]))}compareBBox(t,r){return!t.bbox&&!r.bbox||(t.bbox&&r.bbox?this.compareCoord(t.bbox,r.bbox):!1)}};$t(Xz,"GeojsonEquality");var Vbe=Xz;function Jy(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}$t(Jy,"sameLength");function WM(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}$t(WM,"explode");var go=63710088e-1,ZM={centimeters:go*100,centimetres:go*100,degrees:360/(2*Math.PI),feet:go*3.28084,inches:go*39.37,kilometers:go/1e3,kilometres:go/1e3,meters:go,metres:go,miles:go/1609.344,millimeters:go*1e3,millimetres:go*1e3,nauticalmiles:go/1852,radians:1,yards:go*1.0936},qM={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function rl(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}$t(rl,"feature");function Yz(e,t,r={}){switch(e){case"Point":return C2(t).geometry;case"LineString":return T2(t).geometry;case"Polygon":return P2(t).geometry;case"MultiPoint":return YM(t).geometry;case"MultiLineString":return XM(t).geometry;case"MultiPolygon":return KM(t).geometry;default:throw new Error(e+" is invalid")}}$t(Yz,"geometry");function C2(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Qy(e[0])||!Qy(e[1]))throw new Error("coordinates must contain numbers");return rl({type:"Point",coordinates:e},t,r)}$t(C2,"point");function Kz(e,t,r={}){return eg(e.map(n=>C2(n,t)),r)}$t(Kz,"points");function P2(e,t,r={}){for(let o of e){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let i=0;i<o[o.length-1].length;i++)if(o[o.length-1][i]!==o[0][i])throw new Error("First and last Position are not equivalent.")}return rl({type:"Polygon",coordinates:e},t,r)}$t(P2,"polygon");function Jz(e,t,r={}){return eg(e.map(n=>P2(n,t)),r)}$t(Jz,"polygons");function T2(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return rl({type:"LineString",coordinates:e},t,r)}$t(T2,"lineString");function Qz(e,t,r={}){return eg(e.map(n=>T2(n,t)),r)}$t(Qz,"lineStrings");function eg(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}$t(eg,"featureCollection");function XM(e,t,r={}){return rl({type:"MultiLineString",coordinates:e},t,r)}$t(XM,"multiLineString");function YM(e,t,r={}){return rl({type:"MultiPoint",coordinates:e},t,r)}$t(YM,"multiPoint");function KM(e,t,r={}){return rl({type:"MultiPolygon",coordinates:e},t,r)}$t(KM,"multiPolygon");function eH(e,t,r={}){return rl({type:"GeometryCollection",geometries:e},t,r)}$t(eH,"geometryCollection");function tH(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,t||0);return Math.round(e*r)/r}$t(tH,"round");function JM(e,t="kilometers"){let r=ZM[t];if(!r)throw new Error(t+" units is invalid");return e*r}$t(JM,"radiansToLength");function w2(e,t="kilometers"){let r=ZM[t];if(!r)throw new Error(t+" units is invalid");return e/r}$t(w2,"lengthToRadians");function rH(e,t){return QM(w2(e,t))}$t(rH,"lengthToDegrees");function nH(e){let t=e%360;return t<0&&(t+=360),t}$t(nH,"bearingToAzimuth");function QM(e){return e%(2*Math.PI)*180/Math.PI}$t(QM,"radiansToDegrees");function oH(e){return e%360*Math.PI/180}$t(oH,"degreesToRadians");function iH(e,t="kilometers",r="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return JM(w2(e,t),r)}$t(iH,"convertLength");function sH(e,t="meters",r="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");let n=qM[t];if(!n)throw new Error("invalid original units");let o=qM[r];if(!o)throw new Error("invalid final units");return e/n*o}$t(sH,"convertArea");function Qy(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}$t(Qy,"isNumber");function aH(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}$t(aH,"isObject");function lH(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(t=>{if(!Qy(t))throw new Error("bbox must only contain numbers")})}$t(lH,"validateBBox");function cH(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")}$t(cH,"validateId");At.GeojsonEquality=Vbe;At.areaFactors=qM;At.bearingToAzimuth=nH;At.convertArea=sH;At.convertLength=iH;At.degreesToRadians=oH;At.earthRadius=go;At.factors=ZM;At.feature=rl;At.featureCollection=eg;At.geometry=Yz;At.geometryCollection=eH;At.isNumber=Qy;At.isObject=aH;At.lengthToDegrees=rH;At.lengthToRadians=w2;At.lineString=T2;At.lineStrings=Qz;At.multiLineString=XM;At.multiPoint=YM;At.multiPolygon=KM;At.point=C2;At.points=Kz;At.polygon=P2;At.polygons=Jz;At.radiansToDegrees=QM;At.radiansToLength=JM;At.round=tH;At.validateBBox=lH;At.validateId=cH});var IH=H(Vr=>{"use strict";p();Object.defineProperty(Vr,"__esModule",{value:!0});var zbe=Object.defineProperty,dn=(e,t)=>zbe(e,"name",{value:t,configurable:!0}),Fn=uH();function Yf(e,t,r){if(e!==null)for(var n,o,i,s,a,l,u,d=0,f=0,h,b=e.type,v=b==="FeatureCollection",I=b==="Feature",x=v?e.features.length:1,C=0;C<x;C++){u=v?e.features[C].geometry:I?e.geometry:e,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var P=0;P<a;P++){var w=0,T=0;if(s=h?u.geometries[P]:u,s!==null){l=s.coordinates;var O=s.type;switch(d=r&&(O==="Polygon"||O==="MultiPolygon")?1:0,O){case null:break;case"Point":if(t(l,f,C,w,T)===!1)return!1;f++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],f,C,w,T)===!1)return!1;f++,O==="MultiPoint"&&w++}O==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-d;o++){if(t(l[n][o],f,C,w,T)===!1)return!1;f++}O==="MultiLineString"&&w++,O==="Polygon"&&T++}O==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(T=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-d;i++){if(t(l[n][o][i],f,C,w,T)===!1)return!1;f++}T++}w++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Yf(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}dn(Yf,"coordEach");function pH(e,t,r,n){var o=r;return Yf(e,function(i,s,a,l,u){s===0&&r===void 0?o=i:o=t(o,i,s,a,l,u)},n),o}dn(pH,"coordReduce");function e4(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}}dn(e4,"propEach");function dH(e,t,r){var n=r;return e4(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}dn(dH,"propReduce");function t4(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++);}dn(t4,"featureEach");function fH(e,t,r){var n=r;return t4(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}dn(fH,"featureReduce");function mH(e){var t=[];return Yf(e,function(r){t.push(r)}),t}dn(mH,"coordAll");function M2(e,t){var r,n,o,i,s,a,l,u,d,f,h=0,b=e.type==="FeatureCollection",v=e.type==="Feature",I=b?e.features.length:1;for(r=0;r<I;r++){for(a=b?e.features[r].geometry:v?e.geometry:e,u=b?e.features[r].properties:v?e.properties:{},d=b?e.features[r].bbox:v?e.bbox:void 0,f=b?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,u,d,f)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,h,u,d,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],h,u,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}dn(M2,"geomEach");function hH(e,t,r){var n=r;return M2(e,function(o,i,s,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,s,a,l)}),n}dn(hH,"geomReduce");function tg(e,t){M2(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(Fn.feature.call(void 0,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 u=0;u<r.coordinates.length;u++){var d=r.coordinates[u],f={type:l,coordinates:d};if(t(Fn.feature.call(void 0,f,o),n,u)===!1)return!1}})}dn(tg,"flattenEach");function yH(e,t,r){var n=r;return tg(e,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=t(n,o,i,s)}),n}dn(yH,"flattenReduce");function r4(e,t){tg(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,u=0,d=0;if(Yf(r,function(f,h,b,v,I){if(a===void 0||n>l||v>u||I>d){a=f,l=n,u=v,d=I,i=0;return}var x=Fn.lineString.call(void 0,[a,f],r.properties);if(t(x,n,o,I,i)===!1)return!1;i++,a=f})===!1)return!1}}})}dn(r4,"segmentEach");function gH(e,t,r){var n=r,o=!1;return r4(e,function(i,s,a,l,u){o===!1&&r===void 0?n=i:n=t(n,i,s,a,l,u),o=!0}),n}dn(gH,"segmentReduce");function n4(e,t){if(!e)throw new Error("geojson is required");tg(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(Fn.lineString.call(void 0,s[a],r.properties),n,o,a)===!1)return!1;break}}})}dn(n4,"lineEach");function bH(e,t,r){var n=r;return n4(e,function(o,i,s,a){i===0&&r===void 0?n=o:n=t(n,o,i,s,a)}),n}dn(bH,"lineReduce");function vH(e,t){if(t=t||{},!Fn.isObject.call(void 0,t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.segmentIndex||0,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),Fn.lineString.call(void 0,[l[i],l[i+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i-1),Fn.lineString.call(void 0,[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),Fn.lineString.call(void 0,[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),Fn.lineString.call(void 0,[l[n][o][i],l[n][o][i+1]],s,t)}throw new Error("geojson is invalid")}dn(vH,"findSegment");function xH(e,t){if(t=t||{},!Fn.isObject.call(void 0,t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.coordIndex||0,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 Fn.point.call(void 0,l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),Fn.point.call(void 0,l[n],s,t);case"LineString":return i<0&&(i=l.length+i),Fn.point.call(void 0,l[i],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i),Fn.point.call(void 0,l[o][i],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i),Fn.point.call(void 0,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),Fn.point.call(void 0,l[n][o][i],s,t)}throw new Error("geojson is invalid")}dn(xH,"findPoint");Vr.coordAll=mH;Vr.coordEach=Yf;Vr.coordReduce=pH;Vr.featureEach=t4;Vr.featureReduce=fH;Vr.findPoint=xH;Vr.findSegment=vH;Vr.flattenEach=tg;Vr.flattenReduce=yH;Vr.geomEach=M2;Vr.geomReduce=hH;Vr.lineEach=n4;Vr.lineReduce=bH;Vr.propEach=e4;Vr.propReduce=dH;Vr.segmentEach=r4;Vr.segmentReduce=gH});var SH=H(O2=>{"use strict";p();Object.defineProperty(O2,"__esModule",{value:!0});var Hbe=Object.defineProperty,Wbe=(e,t)=>Hbe(e,"name",{value:t,configurable:!0}),qbe=IH();function o4(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return qbe.coordEach.call(void 0,e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}Wbe(o4,"bbox");var Zbe=o4;O2.bbox=o4;O2.default=Zbe});var MH=H((ort,i4)=>{p();var qs=Ij(),PH=ww(),TH=Aj(),Kf=SH().default,Xbe=TH.featureEach,rrt=TH.coordEach,nrt=PH.polygon,CH=PH.featureCollection;function wH(e){var t=new qs(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Kf(r),qs.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:Kf(o),n.push(o)}):Xbe(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Kf(o),n.push(o)}),qs.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:Kf(r),qs.prototype.remove.call(this,r,n)},t.clear=function(){return qs.prototype.clear.call(this)},t.search=function(r){var n=qs.prototype.search.call(this,this.toBBox(r));return CH(n)},t.collides=function(r){return qs.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=qs.prototype.all.call(this);return CH(r)},t.toJSON=function(){return qs.prototype.toJSON.call(this)},t.fromJSON=function(r){return qs.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=Kf(r);else if(r.type==="FeatureCollection")n=Kf(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}i4.exports=wH;i4.exports.default=wH});var c5=H((Yg,Mm)=>{p();var N0e=200,aq="__lodash_hash_undefined__",B0e=800,$0e=16,lq=9007199254740991,cq="[object Arguments]",j0e="[object Array]",G0e="[object AsyncFunction]",U0e="[object Boolean]",V0e="[object Date]",z0e="[object Error]",uq="[object Function]",H0e="[object GeneratorFunction]",W0e="[object Map]",q0e="[object Number]",Z0e="[object Null]",pq="[object Object]",X0e="[object Proxy]",Y0e="[object RegExp]",K0e="[object Set]",J0e="[object String]",Q0e="[object Undefined]",eve="[object WeakMap]",tve="[object ArrayBuffer]",rve="[object DataView]",nve="[object Float32Array]",ove="[object Float64Array]",ive="[object Int8Array]",sve="[object Int16Array]",ave="[object Int32Array]",lve="[object Uint8Array]",cve="[object Uint8ClampedArray]",uve="[object Uint16Array]",pve="[object Uint32Array]",dve=/[\\^$.*+?()[\]{}|]/g,fve=/^\[object .+?Constructor\]$/,mve=/^(?:0|[1-9]\d*)$/,ar={};ar[nve]=ar[ove]=ar[ive]=ar[sve]=ar[ave]=ar[lve]=ar[cve]=ar[uve]=ar[pve]=!0;ar[cq]=ar[j0e]=ar[tve]=ar[U0e]=ar[rve]=ar[V0e]=ar[z0e]=ar[uq]=ar[W0e]=ar[q0e]=ar[pq]=ar[Y0e]=ar[K0e]=ar[J0e]=ar[eve]=!1;var dq=typeof global=="object"&&global&&global.Object===Object&&global,hve=typeof self=="object"&&self&&self.Object===Object&&self,Qg=dq||hve||Function("return this")(),fq=typeof Yg=="object"&&Yg&&!Yg.nodeType&&Yg,Kg=fq&&typeof Mm=="object"&&Mm&&!Mm.nodeType&&Mm,mq=Kg&&Kg.exports===fq,Q4=mq&&dq.process,JW=function(){try{var e=Kg&&Kg.require&&Kg.require("util").types;return e||Q4&&Q4.binding&&Q4.binding("util")}catch{}}(),QW=JW&&JW.isTypedArray;function yve(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 gve(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function bve(e){return function(t){return e(t)}}function vve(e,t){return e==null?void 0:e[t]}function xve(e,t){return function(r){return e(t(r))}}var Ive=Array.prototype,Sve=Function.prototype,sI=Object.prototype,e5=Qg["__core-js_shared__"],aI=Sve.toString,yl=sI.hasOwnProperty,eq=function(){var e=/[^.]+$/.exec(e5&&e5.keys&&e5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),hq=sI.toString,Cve=aI.call(Object),Pve=RegExp("^"+aI.call(yl).replace(dve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oI=mq?Qg.Buffer:void 0,tq=Qg.Symbol,rq=Qg.Uint8Array,nq=oI?oI.allocUnsafe:void 0,yq=xve(Object.getPrototypeOf,Object),oq=Object.create,Tve=sI.propertyIsEnumerable,wve=Ive.splice,Gp=tq?tq.toStringTag:void 0,iI=function(){try{var e=s5(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Mve=oI?oI.isBuffer:void 0,iq=Math.max,Ove=Date.now,gq=s5(Qg,"Map"),Jg=s5(Object,"create"),Eve=function(){function e(){}return function(t){if(!Vp(t))return{};if(oq)return oq(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Up(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 _ve(){this.__data__=Jg?Jg(null):{},this.size=0}function Ave(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function kve(e){var t=this.__data__;if(Jg){var r=t[e];return r===aq?void 0:r}return yl.call(t,e)?t[e]:void 0}function Dve(e){var t=this.__data__;return Jg?t[e]!==void 0:yl.call(t,e)}function Fve(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Jg&&t===void 0?aq:t,this}Up.prototype.clear=_ve;Up.prototype.delete=Ave;Up.prototype.get=kve;Up.prototype.has=Dve;Up.prototype.set=Fve;function gl(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 Lve(){this.__data__=[],this.size=0}function Rve(e){var t=this.__data__,r=lI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():wve.call(t,r,1),--this.size,!0}function Nve(e){var t=this.__data__,r=lI(t,e);return r<0?void 0:t[r][1]}function Bve(e){return lI(this.__data__,e)>-1}function $ve(e,t){var r=this.__data__,n=lI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}gl.prototype.clear=Lve;gl.prototype.delete=Rve;gl.prototype.get=Nve;gl.prototype.has=Bve;gl.prototype.set=$ve;function Om(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 jve(){this.size=0,this.__data__={hash:new Up,map:new(gq||gl),string:new Up}}function Gve(e){var t=uI(this,e).delete(e);return this.size-=t?1:0,t}function Uve(e){return uI(this,e).get(e)}function Vve(e){return uI(this,e).has(e)}function zve(e,t){var r=uI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Om.prototype.clear=jve;Om.prototype.delete=Gve;Om.prototype.get=Uve;Om.prototype.has=Vve;Om.prototype.set=zve;function Em(e){var t=this.__data__=new gl(e);this.size=t.size}function Hve(){this.__data__=new gl,this.size=0}function Wve(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function qve(e){return this.__data__.get(e)}function Zve(e){return this.__data__.has(e)}function Xve(e,t){var r=this.__data__;if(r instanceof gl){var n=r.__data__;if(!gq||n.length<N0e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Om(n)}return r.set(e,t),this.size=r.size,this}Em.prototype.clear=Hve;Em.prototype.delete=Wve;Em.prototype.get=qve;Em.prototype.has=Zve;Em.prototype.set=Xve;function Yve(e,t){var r=o5(e),n=!r&&n5(e),o=!r&&!n&&Iq(e),i=!r&&!n&&!o&&Cq(e),s=r||n||o||i,a=s?gve(e.length,String):[],l=a.length;for(var u in e)(t||yl.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||vq(u,l)))&&a.push(u);return a}function t5(e,t,r){(r!==void 0&&!pI(e[t],r)||r===void 0&&!(t in e))&&i5(e,t,r)}function Kve(e,t,r){var n=e[t];(!(yl.call(e,t)&&pI(n,r))||r===void 0&&!(t in e))&&i5(e,t,r)}function lI(e,t){for(var r=e.length;r--;)if(pI(e[r][0],t))return r;return-1}function i5(e,t,r){t=="__proto__"&&iI?iI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Jve=pxe();function cI(e){return e==null?e===void 0?Q0e:Z0e:Gp&&Gp in Object(e)?dxe(e):bxe(e)}function sq(e){return eb(e)&&cI(e)==cq}function Qve(e){if(!Vp(e)||yxe(e))return!1;var t=l5(e)?Pve:fve;return t.test(Sxe(e))}function exe(e){return eb(e)&&Sq(e.length)&&!!ar[cI(e)]}function txe(e){if(!Vp(e))return gxe(e);var t=xq(e),r=[];for(var n in e)n=="constructor"&&(t||!yl.call(e,n))||r.push(n);return r}function bq(e,t,r,n,o){e!==t&&Jve(t,function(i,s){if(o||(o=new Em),Vp(i))rxe(e,t,s,r,bq,n,o);else{var a=n?n(r5(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),t5(e,s,a)}},Pq)}function rxe(e,t,r,n,o,i,s){var a=r5(e,r),l=r5(t,r),u=s.get(l);if(u){t5(e,r,u);return}var d=i?i(a,l,r+"",e,t,s):void 0,f=d===void 0;if(f){var h=o5(l),b=!h&&Iq(l),v=!h&&!b&&Cq(l);d=l,h||b||v?o5(a)?d=a:Cxe(a)?d=lxe(a):b?(f=!1,d=ixe(l,!0)):v?(f=!1,d=axe(l,!0)):d=[]:Pxe(l)||n5(l)?(d=a,n5(a)?d=Txe(a):(!Vp(a)||l5(a))&&(d=fxe(l))):f=!1}f&&(s.set(l,d),o(d,l,n,i,s),s.delete(l)),t5(e,r,d)}function nxe(e,t){return xxe(vxe(e,t,Tq),e+"")}var oxe=iI?function(e,t){return iI(e,"toString",{configurable:!0,enumerable:!1,value:Mxe(t),writable:!0})}:Tq;function ixe(e,t){if(t)return e.slice();var r=e.length,n=nq?nq(r):new e.constructor(r);return e.copy(n),n}function sxe(e){var t=new e.constructor(e.byteLength);return new rq(t).set(new rq(e)),t}function axe(e,t){var r=t?sxe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function lxe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function cxe(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?i5(r,a,l):Kve(r,a,l)}return r}function uxe(e){return nxe(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&&mxe(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 pxe(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 uI(e,t){var r=e.__data__;return hxe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function s5(e,t){var r=vve(e,t);return Qve(r)?r:void 0}function dxe(e){var t=yl.call(e,Gp),r=e[Gp];try{e[Gp]=void 0;var n=!0}catch{}var o=hq.call(e);return n&&(t?e[Gp]=r:delete e[Gp]),o}function fxe(e){return typeof e.constructor=="function"&&!xq(e)?Eve(yq(e)):{}}function vq(e,t){var r=typeof e;return t=t==null?lq:t,!!t&&(r=="number"||r!="symbol"&&mve.test(e))&&e>-1&&e%1==0&&e<t}function mxe(e,t,r){if(!Vp(r))return!1;var n=typeof t;return(n=="number"?a5(r)&&vq(t,r.length):n=="string"&&t in r)?pI(r[t],e):!1}function hxe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function yxe(e){return!!eq&&eq in e}function xq(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||sI;return e===r}function gxe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function bxe(e){return hq.call(e)}function vxe(e,t,r){return t=iq(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=iq(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),yve(e,this,a)}}function r5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var xxe=Ixe(oxe);function Ixe(e){var t=0,r=0;return function(){var n=Ove(),o=$0e-(n-r);if(r=n,o>0){if(++t>=B0e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Sxe(e){if(e!=null){try{return aI.call(e)}catch{}try{return e+""}catch{}}return""}function pI(e,t){return e===t||e!==e&&t!==t}var n5=sq(function(){return arguments}())?sq:function(e){return eb(e)&&yl.call(e,"callee")&&!Tve.call(e,"callee")},o5=Array.isArray;function a5(e){return e!=null&&Sq(e.length)&&!l5(e)}function Cxe(e){return eb(e)&&a5(e)}var Iq=Mve||Oxe;function l5(e){if(!Vp(e))return!1;var t=cI(e);return t==uq||t==H0e||t==G0e||t==X0e}function Sq(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lq}function Vp(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function eb(e){return e!=null&&typeof e=="object"}function Pxe(e){if(!eb(e)||cI(e)!=pq)return!1;var t=yq(e);if(t===null)return!0;var r=yl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&aI.call(r)==Cve}var Cq=QW?bve(QW):exe;function Txe(e){return cxe(e,Pq(e))}function Pq(e){return a5(e)?Yve(e,!0):txe(e)}var wxe=uxe(function(e,t,r){bq(e,t,r)});function Mxe(e){return function(){return e}}function Tq(e){return e}function Oxe(){return!1}Mm.exports=wxe});var C5=H((nb,km)=>{p();var r2e=200,Wq="__lodash_hash_undefined__",n2e=800,o2e=16,qq=9007199254740991,Zq="[object Arguments]",i2e="[object Array]",s2e="[object AsyncFunction]",a2e="[object Boolean]",l2e="[object Date]",c2e="[object Error]",Xq="[object Function]",u2e="[object GeneratorFunction]",p2e="[object Map]",d2e="[object Number]",f2e="[object Null]",Yq="[object Object]",m2e="[object Proxy]",h2e="[object RegExp]",y2e="[object Set]",g2e="[object String]",b2e="[object Undefined]",v2e="[object WeakMap]",x2e="[object ArrayBuffer]",I2e="[object DataView]",S2e="[object Float32Array]",C2e="[object Float64Array]",P2e="[object Int8Array]",T2e="[object Int16Array]",w2e="[object Int32Array]",M2e="[object Uint8Array]",O2e="[object Uint8ClampedArray]",E2e="[object Uint16Array]",_2e="[object Uint32Array]",A2e=/[\\^$.*+?()[\]{}|]/g,k2e=/^\[object .+?Constructor\]$/,D2e=/^(?:0|[1-9]\d*)$/,lr={};lr[S2e]=lr[C2e]=lr[P2e]=lr[T2e]=lr[w2e]=lr[M2e]=lr[O2e]=lr[E2e]=lr[_2e]=!0;lr[Zq]=lr[i2e]=lr[x2e]=lr[a2e]=lr[I2e]=lr[l2e]=lr[c2e]=lr[Xq]=lr[p2e]=lr[d2e]=lr[Yq]=lr[h2e]=lr[y2e]=lr[g2e]=lr[v2e]=!1;var Kq=typeof global=="object"&&global&&global.Object===Object&&global,F2e=typeof self=="object"&&self&&self.Object===Object&&self,sb=Kq||F2e||Function("return this")(),Jq=typeof nb=="object"&&nb&&!nb.nodeType&&nb,ob=Jq&&typeof km=="object"&&km&&!km.nodeType&&km,Qq=ob&&ob.exports===Jq,d5=Qq&&Kq.process,Nq=function(){try{var e=ob&&ob.require&&ob.require("util").types;return e||d5&&d5.binding&&d5.binding("util")}catch{}}(),Bq=Nq&&Nq.isTypedArray;function eZ(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 L2e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function R2e(e){return function(t){return e(t)}}function N2e(e,t){return e==null?void 0:e[t]}function B2e(e,t){return function(r){return e(t(r))}}var $2e=Array.prototype,j2e=Function.prototype,yI=Object.prototype,f5=sb["__core-js_shared__"],gI=j2e.toString,xl=yI.hasOwnProperty,$q=function(){var e=/[^.]+$/.exec(f5&&f5.keys&&f5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),tZ=yI.toString,G2e=gI.call(Object),U2e=RegExp("^"+gI.call(xl).replace(A2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mI=Qq?sb.Buffer:void 0,jq=sb.Symbol,Gq=sb.Uint8Array,Uq=mI?mI.allocUnsafe:void 0,rZ=B2e(Object.getPrototypeOf,Object),Vq=Object.create,V2e=yI.propertyIsEnumerable,z2e=$2e.splice,zp=jq?jq.toStringTag:void 0,hI=function(){try{var e=x5(Object,"defineProperty");return e({},"",{}),e}catch{}}(),H2e=mI?mI.isBuffer:void 0,zq=Math.max,W2e=Date.now,nZ=x5(sb,"Map"),ib=x5(Object,"create"),q2e=function(){function e(){}return function(t){if(!vl(t))return{};if(Vq)return Vq(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Hp(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 Z2e(){this.__data__=ib?ib(null):{},this.size=0}function X2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Y2e(e){var t=this.__data__;if(ib){var r=t[e];return r===Wq?void 0:r}return xl.call(t,e)?t[e]:void 0}function K2e(e){var t=this.__data__;return ib?t[e]!==void 0:xl.call(t,e)}function J2e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ib&&t===void 0?Wq:t,this}Hp.prototype.clear=Z2e;Hp.prototype.delete=X2e;Hp.prototype.get=Y2e;Hp.prototype.has=K2e;Hp.prototype.set=J2e;function Il(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 Q2e(){this.__data__=[],this.size=0}function eIe(e){var t=this.__data__,r=bI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():z2e.call(t,r,1),--this.size,!0}function tIe(e){var t=this.__data__,r=bI(t,e);return r<0?void 0:t[r][1]}function rIe(e){return bI(this.__data__,e)>-1}function nIe(e,t){var r=this.__data__,n=bI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}Il.prototype.clear=Q2e;Il.prototype.delete=eIe;Il.prototype.get=tIe;Il.prototype.has=rIe;Il.prototype.set=nIe;function Dm(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 oIe(){this.size=0,this.__data__={hash:new Hp,map:new(nZ||Il),string:new Hp}}function iIe(e){var t=xI(this,e).delete(e);return this.size-=t?1:0,t}function sIe(e){return xI(this,e).get(e)}function aIe(e){return xI(this,e).has(e)}function lIe(e,t){var r=xI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Dm.prototype.clear=oIe;Dm.prototype.delete=iIe;Dm.prototype.get=sIe;Dm.prototype.has=aIe;Dm.prototype.set=lIe;function Fm(e){var t=this.__data__=new Il(e);this.size=t.size}function cIe(){this.__data__=new Il,this.size=0}function uIe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function pIe(e){return this.__data__.get(e)}function dIe(e){return this.__data__.has(e)}function fIe(e,t){var r=this.__data__;if(r instanceof Il){var n=r.__data__;if(!nZ||n.length<r2e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Dm(n)}return r.set(e,t),this.size=r.size,this}Fm.prototype.clear=cIe;Fm.prototype.delete=uIe;Fm.prototype.get=pIe;Fm.prototype.has=dIe;Fm.prototype.set=fIe;function mIe(e,t){var r=g5(e),n=!r&&y5(e),o=!r&&!n&&lZ(e),i=!r&&!n&&!o&&uZ(e),s=r||n||o||i,a=s?L2e(e.length,String):[],l=a.length;for(var u in e)(t||xl.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||sZ(u,l)))&&a.push(u);return a}function m5(e,t,r){(r!==void 0&&!II(e[t],r)||r===void 0&&!(t in e))&&b5(e,t,r)}function hIe(e,t,r){var n=e[t];(!(xl.call(e,t)&&II(n,r))||r===void 0&&!(t in e))&&b5(e,t,r)}function bI(e,t){for(var r=e.length;r--;)if(II(e[r][0],t))return r;return-1}function b5(e,t,r){t=="__proto__"&&hI?hI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var yIe=OIe();function vI(e){return e==null?e===void 0?b2e:f2e:zp&&zp in Object(e)?EIe(e):LIe(e)}function Hq(e){return ab(e)&&vI(e)==Zq}function gIe(e){if(!vl(e)||DIe(e))return!1;var t=S5(e)?U2e:k2e;return t.test($Ie(e))}function bIe(e){return ab(e)&&cZ(e.length)&&!!lr[vI(e)]}function vIe(e){if(!vl(e))return FIe(e);var t=aZ(e),r=[];for(var n in e)n=="constructor"&&(t||!xl.call(e,n))||r.push(n);return r}function v5(e,t,r,n,o){e!==t&&yIe(t,function(i,s){if(o||(o=new Fm),vl(i))xIe(e,t,s,r,v5,n,o);else{var a=n?n(h5(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),m5(e,s,a)}},pZ)}function xIe(e,t,r,n,o,i,s){var a=h5(e,r),l=h5(t,r),u=s.get(l);if(u){m5(e,r,u);return}var d=i?i(a,l,r+"",e,t,s):void 0,f=d===void 0;if(f){var h=g5(l),b=!h&&lZ(l),v=!h&&!b&&uZ(l);d=l,h||b||v?g5(a)?d=a:jIe(a)?d=TIe(a):b?(f=!1,d=SIe(l,!0)):v?(f=!1,d=PIe(l,!0)):d=[]:GIe(l)||y5(l)?(d=a,y5(a)?d=UIe(a):(!vl(a)||S5(a))&&(d=_Ie(l))):f=!1}f&&(s.set(l,d),o(d,l,n,i,s),s.delete(l)),m5(e,r,d)}function oZ(e,t){return NIe(RIe(e,t,dZ),e+"")}var IIe=hI?function(e,t){return hI(e,"toString",{configurable:!0,enumerable:!1,value:HIe(t),writable:!0})}:dZ;function SIe(e,t){if(t)return e.slice();var r=e.length,n=Uq?Uq(r):new e.constructor(r);return e.copy(n),n}function CIe(e){var t=new e.constructor(e.byteLength);return new Gq(t).set(new Gq(e)),t}function PIe(e,t){var r=t?CIe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function TIe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function wIe(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?b5(r,a,l):hIe(r,a,l)}return r}function MIe(e){return oZ(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&&AIe(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 OIe(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 iZ(e,t,r,n,o,i){return vl(e)&&vl(t)&&(i.set(t,e),v5(e,t,void 0,iZ,i),i.delete(t)),e}function xI(e,t){var r=e.__data__;return kIe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function x5(e,t){var r=N2e(e,t);return gIe(r)?r:void 0}function EIe(e){var t=xl.call(e,zp),r=e[zp];try{e[zp]=void 0;var n=!0}catch{}var o=tZ.call(e);return n&&(t?e[zp]=r:delete e[zp]),o}function _Ie(e){return typeof e.constructor=="function"&&!aZ(e)?q2e(rZ(e)):{}}function sZ(e,t){var r=typeof e;return t=t==null?qq:t,!!t&&(r=="number"||r!="symbol"&&D2e.test(e))&&e>-1&&e%1==0&&e<t}function AIe(e,t,r){if(!vl(r))return!1;var n=typeof t;return(n=="number"?I5(r)&&sZ(t,r.length):n=="string"&&t in r)?II(r[t],e):!1}function kIe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function DIe(e){return!!$q&&$q in e}function aZ(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||yI;return e===r}function FIe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function LIe(e){return tZ.call(e)}function RIe(e,t,r){return t=zq(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=zq(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),eZ(e,this,a)}}function h5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var NIe=BIe(IIe);function BIe(e){var t=0,r=0;return function(){var n=W2e(),o=o2e-(n-r);if(r=n,o>0){if(++t>=n2e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function $Ie(e){if(e!=null){try{return gI.call(e)}catch{}try{return e+""}catch{}}return""}function II(e,t){return e===t||e!==e&&t!==t}var y5=Hq(function(){return arguments}())?Hq:function(e){return ab(e)&&xl.call(e,"callee")&&!V2e.call(e,"callee")},g5=Array.isArray;function I5(e){return e!=null&&cZ(e.length)&&!S5(e)}function jIe(e){return ab(e)&&I5(e)}var lZ=H2e||WIe;function S5(e){if(!vl(e))return!1;var t=vI(e);return t==Xq||t==u2e||t==s2e||t==m2e}function cZ(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qq}function vl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ab(e){return e!=null&&typeof e=="object"}function GIe(e){if(!ab(e)||vI(e)!=Yq)return!1;var t=rZ(e);if(t===null)return!0;var r=xl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&gI.call(r)==G2e}var uZ=Bq?R2e(Bq):bIe;function UIe(e){return wIe(e,pZ(e))}var VIe=oZ(function(e){return e.push(void 0,iZ),eZ(zIe,void 0,e)});function pZ(e){return I5(e)?mIe(e,!0):vIe(e)}var zIe=MIe(function(e,t,r,n){v5(e,t,r,n)});function HIe(e){return function(){return e}}function dZ(e){return e}function WIe(){return!1}km.exports=VIe});var rX=H((Zpt,mb)=>{"use strict";p();var uSe=!1,Zp=!1,XZ=!0,YZ=!1,y={},KZ=!1;typeof mb<"u"&&mb.exports?(mb.exports=y,KZ=!0):typeof document<"u"?window.ClipperLib=y:self.ClipperLib=y;var DI;KZ?(Wr="chrome",DI="Netscape"):(Wr=navigator.userAgent.toString().toLowerCase(),DI=navigator.appName);var Wr,ot={};Wr.indexOf("chrome")!=-1&&Wr.indexOf("chromium")==-1?ot.chrome=1:ot.chrome=0;Wr.indexOf("chromium")!=-1?ot.chromium=1:ot.chromium=0;Wr.indexOf("safari")!=-1&&Wr.indexOf("chrome")==-1&&Wr.indexOf("chromium")==-1?ot.safari=1:ot.safari=0;Wr.indexOf("firefox")!=-1?ot.firefox=1:ot.firefox=0;Wr.indexOf("firefox/17")!=-1?ot.firefox17=1:ot.firefox17=0;Wr.indexOf("firefox/15")!=-1?ot.firefox15=1:ot.firefox15=0;Wr.indexOf("firefox/3")!=-1?ot.firefox3=1:ot.firefox3=0;Wr.indexOf("opera")!=-1?ot.opera=1:ot.opera=0;Wr.indexOf("msie 10")!=-1?ot.msie10=1:ot.msie10=0;Wr.indexOf("msie 9")!=-1?ot.msie9=1:ot.msie9=0;Wr.indexOf("msie 8")!=-1?ot.msie8=1:ot.msie8=0;Wr.indexOf("msie 7")!=-1?ot.msie7=1:ot.msie7=0;Wr.indexOf("msie ")!=-1?ot.msie=1:ot.msie=0;y.biginteger_used=null;var jc,pSe=0xdeadbeefcafe,qZ=(pSe&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 ht(){return new re(null)}function dSe(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 fSe(e,t,r,n,o,i){for(var s=t&32767,a=t>>15;--i>=0;){var l=this[e]&32767,u=this[e++]>>15,d=a*l+u*s;l=s*l+((d&32767)<<15)+r[n]+(o&1073741823),o=(l>>>30)+(d>>>15)+a*u+(o>>>30),r[n++]=l&1073741823}return o}function mSe(e,t,r,n,o,i){for(var s=t&16383,a=t>>14;--i>=0;){var l=this[e]&16383,u=this[e++]>>14,d=a*l+u*s;l=s*l+((d&16383)<<14)+r[n]+o,o=(l>>28)+(d>>14)+a*u,r[n++]=l&268435455}return o}qZ&&DI=="Microsoft Internet Explorer"?(re.prototype.am=fSe,jc=30):qZ&&DI!="Netscape"?(re.prototype.am=dSe,jc=26):(re.prototype.am=mSe,jc=28);re.prototype.DB=jc;re.prototype.DM=(1<<jc)-1;re.prototype.DV=1<<jc;var j5=52;re.prototype.FV=Math.pow(2,j5);re.prototype.F1=j5-jc;re.prototype.F2=2*jc-j5;var hSe="0123456789abcdefghijklmnopqrstuvwxyz",LI=new Array,jm,xi;jm=48;for(xi=0;xi<=9;++xi)LI[jm++]=xi;jm=97;for(xi=10;xi<36;++xi)LI[jm++]=xi;jm=65;for(xi=10;xi<36;++xi)LI[jm++]=xi;function ZZ(e){return hSe.charAt(e)}function JZ(e,t){var r=LI[e.charCodeAt(t)];return r==null?-1:r}function ySe(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function gSe(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 $c(e){var t=ht();return t.fromInt(e),t}function bSe(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:JZ(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 vSe(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function xSe(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=ZZ(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+=ZZ(n));return o?i:"0"}function ISe(){var e=ht();return re.ZERO.subTo(this,e),e}function SSe(){return this.s<0?this.negate():this}function CSe(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 RI(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 PSe(){return this.t<=0?0:this.DB*(this.t-1)+RI(this[this.t-1]^this.s&this.DM)}function TSe(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 wSe(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 MSe(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 OSe(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 ESe(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 _Se(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 ASe(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 kSe(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=ht());var i=ht(),s=this.s,a=e.s,l=this.DB-RI(n[n.t-1]);l>0?(n.lShiftTo(l,i),o.lShiftTo(l,r)):(n.copyTo(i),o.copyTo(r));var u=i.t,d=i[u-1];if(d!=0){var f=d*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),h=this.FV/f,b=(1<<this.F1)/f,v=1<<this.F2,I=r.t,x=I-u,C=t==null?ht():t;for(i.dlShiftTo(x,C),r.compareTo(C)>=0&&(r[r.t++]=1,r.subTo(C,r)),re.ONE.dlShiftTo(u,C),C.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--x>=0;){var P=r[--I]==d?this.DM:Math.floor(r[I]*h+(r[I-1]+v)*b);if((r[I]+=i.am(0,P,r,x,0,u))<P)for(i.dlShiftTo(x,C),r.subTo(C,r);r[I]<--P;)r.subTo(C,r)}t!=null&&(r.drShiftTo(u,t),s!=a&&re.ZERO.subTo(t,t)),r.t=u,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&re.ZERO.subTo(r,r)}}}function DSe(e){var t=ht();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(re.ZERO)>0&&e.subTo(t,t),t}function Xp(e){this.m=e}function FSe(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function LSe(e){return e}function RSe(e){e.divRemTo(this.m,null,e)}function NSe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function BSe(e,t){e.squareTo(t),this.reduce(t)}Xp.prototype.convert=FSe;Xp.prototype.revert=LSe;Xp.prototype.reduce=RSe;Xp.prototype.mulTo=NSe;Xp.prototype.sqrTo=BSe;function $Se(){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 Yp(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 jSe(e){var t=ht();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 GSe(e){var t=ht();return e.copyTo(t),this.reduce(t),t}function USe(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 VSe(e,t){e.squareTo(t),this.reduce(t)}function zSe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Yp.prototype.convert=jSe;Yp.prototype.revert=GSe;Yp.prototype.reduce=USe;Yp.prototype.mulTo=zSe;Yp.prototype.sqrTo=VSe;function HSe(){return(this.t>0?this[0]&1:this.s)==0}function WSe(e,t){if(e>4294967295||e<1)return re.ONE;var r=ht(),n=ht(),o=t.convert(this),i=RI(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 qSe(e,t){var r;return e<256||t.isEven()?r=new Xp(t):r=new Yp(t),this.exp(e,r)}re.prototype.copyTo=ySe;re.prototype.fromInt=gSe;re.prototype.fromString=bSe;re.prototype.clamp=vSe;re.prototype.dlShiftTo=TSe;re.prototype.drShiftTo=wSe;re.prototype.lShiftTo=MSe;re.prototype.rShiftTo=OSe;re.prototype.subTo=ESe;re.prototype.multiplyTo=_Se;re.prototype.squareTo=ASe;re.prototype.divRemTo=kSe;re.prototype.invDigit=$Se;re.prototype.isEven=HSe;re.prototype.exp=WSe;re.prototype.toString=xSe;re.prototype.negate=ISe;re.prototype.abs=SSe;re.prototype.compareTo=CSe;re.prototype.bitLength=PSe;re.prototype.mod=DSe;re.prototype.modPowInt=qSe;re.ZERO=$c(0);re.ONE=$c(1);function ZSe(){var e=ht();return this.copyTo(e),e}function XSe(){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 YSe(){return this.t==0?this.s:this[0]<<24>>24}function KSe(){return this.t==0?this.s:this[0]<<16>>16}function JSe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function QSe(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function e3e(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=$c(r),o=ht(),i=ht(),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 t3e(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=JZ(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 r3e(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),G5,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 n3e(){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 o3e(e){return this.compareTo(e)==0}function i3e(e){return this.compareTo(e)<0?this:e}function s3e(e){return this.compareTo(e)>0?this:e}function a3e(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 l3e(e,t){return e&t}function c3e(e){var t=ht();return this.bitwiseTo(e,l3e,t),t}function G5(e,t){return e|t}function u3e(e){var t=ht();return this.bitwiseTo(e,G5,t),t}function QZ(e,t){return e^t}function p3e(e){var t=ht();return this.bitwiseTo(e,QZ,t),t}function eX(e,t){return e&~t}function d3e(e){var t=ht();return this.bitwiseTo(e,eX,t),t}function f3e(){for(var e=ht(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function m3e(e){var t=ht();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function h3e(e){var t=ht();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function y3e(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 g3e(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+y3e(this[e]);return this.s<0?this.t*this.DB:-1}function b3e(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function v3e(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=b3e(this[r]^t);return e}function x3e(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function I3e(e,t){var r=re.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function S3e(e){return this.changeBit(e,G5)}function C3e(e){return this.changeBit(e,eX)}function P3e(e){return this.changeBit(e,QZ)}function T3e(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 w3e(e){var t=ht();return this.addTo(e,t),t}function M3e(e){var t=ht();return this.subTo(e,t),t}function O3e(e){var t=ht();return this.multiplyTo(e,t),t}function E3e(){var e=ht();return this.squareTo(e),e}function _3e(e){var t=ht();return this.divRemTo(e,t,null),t}function A3e(e){var t=ht();return this.divRemTo(e,null,t),t}function k3e(e){var t=ht(),r=ht();return this.divRemTo(e,t,r),new Array(t,r)}function D3e(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function F3e(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 hb(){}function tX(e){return e}function L3e(e,t,r){e.multiplyTo(t,r)}function R3e(e,t){e.squareTo(t)}hb.prototype.convert=tX;hb.prototype.revert=tX;hb.prototype.mulTo=L3e;hb.prototype.sqrTo=R3e;function N3e(e){return this.exp(e,new hb)}function B3e(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 $3e(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 Gm(e){this.r2=ht(),this.q3=ht(),re.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function j3e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=ht();return e.copyTo(t),this.reduce(t),t}function G3e(e){return e}function U3e(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 V3e(e,t){e.squareTo(t),this.reduce(t)}function z3e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Gm.prototype.convert=j3e;Gm.prototype.revert=G3e;Gm.prototype.reduce=U3e;Gm.prototype.mulTo=z3e;Gm.prototype.sqrTo=V3e;function H3e(e,t){var r=e.bitLength(),n,o=$c(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 Xp(t):t.isEven()?i=new Gm(t):i=new Yp(t);var s=new Array,a=3,l=n-1,u=(1<<n)-1;if(s[1]=i.convert(this),n>1){var d=ht();for(i.sqrTo(s[1],d);a<=u;)s[a]=ht(),i.mulTo(d,s[a-2],s[a]),a+=2}var f=e.t-1,h,b=!0,v=ht(),I;for(r=RI(e[f])-1;f>=0;){for(r>=l?h=e[f]>>r-l&u:(h=(e[f]&(1<<r+1)-1)<<l-r,f>0&&(h|=e[f-1]>>this.DB+r-l)),a=n;(h&1)==0;)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),b)s[h].copyTo(o),b=!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(;f>=0&&(e[f]&1<<r)==0;)i.sqrTo(o,v),I=o,o=v,v=I,--r<0&&(r=this.DB-1,--f)}return i.revert(o)}function W3e(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 q3e(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 Z3e(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return re.ZERO;for(var r=e.clone(),n=this.clone(),o=$c(1),i=$c(0),s=$c(0),a=$c(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 Qn=[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],X3e=(1<<26)/Qn[Qn.length-1];function Y3e(e){var t,r=this.abs();if(r.t==1&&r[0]<=Qn[Qn.length-1]){for(t=0;t<Qn.length;++t)if(r[0]==Qn[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Qn.length;){for(var n=Qn[t],o=t+1;o<Qn.length&&n<X3e;)n*=Qn[o++];for(n=r.modInt(n);t<o;)if(n%Qn[t++]==0)return!1}return r.millerRabin(e)}function K3e(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>Qn.length&&(e=Qn.length);for(var o=ht(),i=0;i<e;++i){o.fromInt(Qn[Math.floor(Math.random()*Qn.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=JSe;re.prototype.toRadix=e3e;re.prototype.fromRadix=t3e;re.prototype.fromNumber=r3e;re.prototype.bitwiseTo=a3e;re.prototype.changeBit=I3e;re.prototype.addTo=T3e;re.prototype.dMultiply=D3e;re.prototype.dAddOffset=F3e;re.prototype.multiplyLowerTo=B3e;re.prototype.multiplyUpperTo=$3e;re.prototype.modInt=q3e;re.prototype.millerRabin=K3e;re.prototype.clone=ZSe;re.prototype.intValue=XSe;re.prototype.byteValue=YSe;re.prototype.shortValue=KSe;re.prototype.signum=QSe;re.prototype.toByteArray=n3e;re.prototype.equals=o3e;re.prototype.min=i3e;re.prototype.max=s3e;re.prototype.and=c3e;re.prototype.or=u3e;re.prototype.xor=p3e;re.prototype.andNot=d3e;re.prototype.not=f3e;re.prototype.shiftLeft=m3e;re.prototype.shiftRight=h3e;re.prototype.getLowestSetBit=g3e;re.prototype.bitCount=v3e;re.prototype.testBit=x3e;re.prototype.setBit=S3e;re.prototype.clearBit=C3e;re.prototype.flipBit=P3e;re.prototype.add=w3e;re.prototype.subtract=M3e;re.prototype.multiply=O3e;re.prototype.divide=_3e;re.prototype.remainder=A3e;re.prototype.divideAndRemainder=k3e;re.prototype.modPow=H3e;re.prototype.modInverse=Z3e;re.prototype.pow=N3e;re.prototype.gcd=W3e;re.prototype.isProbablePrime=Y3e;re.prototype.square=E3e;var tt=re;tt.prototype.IsNegative=function(){return this.compareTo(tt.ZERO)==-1};tt.op_Equality=function(e,t){return e.compareTo(t)==0};tt.op_Inequality=function(e,t){return e.compareTo(t)!=0};tt.op_GreaterThan=function(e,t){return e.compareTo(t)>0};tt.op_LessThan=function(e,t){return e.compareTo(t)<0};tt.op_Addition=function(e,t){return new tt(e).add(new tt(t))};tt.op_Subtraction=function(e,t){return new tt(e).subtract(new tt(t))};tt.Int128Mul=function(e,t){return new tt(e).multiply(new tt(t))};tt.op_Division=function(e,t){return e.divide(t)};tt.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof FI>"u"&&(FI=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 FI;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};FI(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)};ot.msie||ot.opera||ot.safari?y.Cast_Int32=function(e){return e|0}:y.Cast_Int32=function(e){return~~e};ot.chrome?y.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:ot.firefox&&typeof Number.toInteger=="function"?y.Cast_Int64=function(e){return Number.toInteger(e)}:ot.msie7||ot.msie8?y.Cast_Int64=function(e){return parseInt(e,10)}:ot.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,Zp)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};Zp?(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};YZ&&(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;uSe?(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&&tt.op_Equality(tt.Int128Mul(e.X-t.X,r.Y-t.Y),tt.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};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?tt.op_Equality(tt.Int128Mul(r.Delta.Y,n.Delta.X),tt.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?tt.op_Equality(tt.Int128Mul(o.Y-i.Y,i.X-s.X),tt.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?tt.op_Equality(tt.Int128Mul(o.Y-i.Y,s.X-a.X),tt.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?tt.op_Equality(tt.Int128Mul(e.Delta.Y,t.Delta.X),tt.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?tt.op_Equality(tt.Int128Mul(e.Y-t.Y,t.X-r.X),tt.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?tt.op_Equality(tt.Int128Mul(e.Y-t.Y,r.X-n.X),tt.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){XZ?!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],u=l,d=l;;){if(y.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==l&&(l=u.Next),u=this.RemoveEdge(u),d=u;continue}if(u.Prev==u.Next)break;if(r&&y.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==l&&(l=u.Next),u=this.RemoveEdge(u),u=u.Prev,d=u;continue}if(u=u.Next,u==d)break}if(!r&&u==u.Next||r&&u.Prev==u.Next)return!1;r||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=y.ClipperBase.Skip);var f=l;u=l;do this.InitEdge2(u,t),u=u.Next,s&&u.Curr.Y!=l.Curr.Y&&(s=!1);while(u!=l);if(s){if(r)return!1;u.Prev.OutIdx=y.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var h=new y.LocalMinima;for(h.Next=null,h.Y=u.Bot.Y,h.LeftBound=null,h.RightBound=u,h.RightBound.Side=y.EdgeSide.esRight,h.RightBound.WindDelta=0;u.Next.OutIdx!=y.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(h),this.m_edges.push(o),!0}this.m_edges.push(o);for(var b,v=null;u=this.FindNextLocMin(u),u!=v;){v==null&&(v=u);var h=new y.LocalMinima;h.Next=null,h.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(h.LeftBound=u.Prev,h.RightBound=u,b=!1):(h.LeftBound=u,h.RightBound=u.Prev,b=!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,u=this.ProcessBound(h.LeftBound,b);var I=this.ProcessBound(h.RightBound,!b);h.LeftBound.OutIdx==y.ClipperBase.Skip?h.LeftBound=null:h.RightBound.OutIdx==y.ClipperBase.Skip&&(h.RightBound=null),this.InsertLocalMinima(h),b||(u=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,Zp&&(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,Zp&&(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)};Zp&&(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),Zp&&(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),Zp&&(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,u;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),u=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),u=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 d=e.OutIdx,f=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var h=this.m_ActiveEdges;h!==null;){if(h.OutIdx==f){h.OutIdx=d,h.Side=u;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(XZ&&(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 u,d,f,h;e.PolyTyp==y.PolyType.ptSubject?(u=this.m_SubjFillType,f=this.m_ClipFillType):(u=this.m_ClipFillType,f=this.m_SubjFillType),t.PolyTyp==y.PolyType.ptSubject?(d=this.m_SubjFillType,h=this.m_ClipFillType):(d=this.m_ClipFillType,h=this.m_SubjFillType);var b,v;switch(u){case y.PolyFillType.pftPositive:b=e.WindCnt;break;case y.PolyFillType.pftNegative:b=-e.WindCnt;break;default:b=Math.abs(e.WindCnt);break}switch(d){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||b!==0&&b!=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)(b===0||b==1)&&(this.AddOutPt(t,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if((b===0||b==1)&&(v===0||v==1)&&!o&&!i){var I,x;switch(f){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:x=t.WindCnt2;break;case y.PolyFillType.pftNegative:x=-t.WindCnt2;break;default:x=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(b==1&&v==1)switch(this.m_ClipType){case y.ClipType.ctIntersection:I>0&&x>0&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctUnion:I<=0&&x<=0&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctDifference:(e.PolyTyp==y.PolyType.ptClip&&I>0&&x>0||e.PolyTyp==y.PolyType.ptSubject&&I<=0&&x<=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,u=this.GetNextInAEL(e,n);u!==null&&!(u.Curr.X==e.Top.X&&e.NextInLML!==null&&u.Dx<e.NextInLML.Dx);){var d=this.GetNextInAEL(u,n);if(n==y.Direction.dLeftToRight&&u.Curr.X<=i||n==y.Direction.dRightToLeft&&u.Curr.X>=o){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),u==a&&l){n==y.Direction.dLeftToRight?this.IntersectEdges(e,u,u.Top,!1):this.IntersectEdges(u,e,u.Top,!1),a.OutIdx>=0&&y.Error("ProcessHorizontal error");return}else if(n==y.Direction.dLeftToRight){var f=new y.IntPoint(u.Curr.X,e.Curr.Y);this.IntersectEdges(e,u,f,!0)}else{var f=new y.IntPoint(u.Curr.X,e.Curr.Y);this.IntersectEdges(u,e,f,!0)}this.SwapPositionsInAEL(e,u)}else if(n==y.Direction.dLeftToRight&&u.Curr.X>=i||n==y.Direction.dRightToLeft&&u.Curr.X<=o)break;u=d}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 b=e.PrevInAEL,d=e.NextInAEL;if(b!==null&&b.Curr.X==e.Bot.X&&b.Curr.Y==e.Bot.Y&&b.WindDelta!==0&&b.OutIdx>=0&&b.Curr.Y>b.Top.Y&&y.ClipperBase.SlopesEqual(e,b,this.m_UseFullRange)){var v=this.AddOutPt(b,e.Bot);this.AddJoin(h,v,e.Top)}else if(d!==null&&d.Curr.X==e.Bot.X&&d.Curr.Y==e.Bot.Y&&d.WindDelta!==0&&d.OutIdx>=0&&d.Curr.Y>d.Top.Y&&y.ClipperBase.SlopesEqual(e,d,this.m_UseFullRange)){var v=this.AddOutPt(d,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{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 J3e=function(e){return e<0?Math.ceil(e-.5):Math.round(e)},Q3e=function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},eCe=function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},tCe=function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)};ot.msie?y.Clipper.Round=J3e:ot.chromium?y.Clipper.Round=eCe:ot.safari?y.Clipper.Round=tCe:y.Clipper.Round=Q3e;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 u=s.Pt.Y>e.OffPt.Y;return l==u?!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 d={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,o.Pt.X,i.Pt.X,s.Pt.X,d))return!1;var f=d.Left,h=d.Right,b=new y.IntPoint,v;return n.Pt.X>=f&&n.Pt.X<=h?(b.X=n.Pt.X,b.Y=n.Pt.Y,v=n.Pt.X>o.Pt.X):i.Pt.X>=f&&i.Pt.X<=h?(b.X=i.Pt.X,b.Y=i.Pt.Y,v=i.Pt.X>s.Pt.X):o.Pt.X>=f&&o.Pt.X<=h?(b.X=o.Pt.X,b.Y=o.Pt.Y,v=o.Pt.X>n.Pt.X):(b.X=s.Pt.X,b.Y=s.Pt.Y,v=s.Pt.X>i.Pt.X),e.OutPt1=n,e.OutPt2=i,this.JoinHorz(n,o,i,s,b,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 x=s.Pt.Y>i.Pt.Y||!y.ClipperBase.SlopesEqual(i.Pt,s.Pt,e.OffPt,this.m_UseFullRange);if(x){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==x?!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};YZ&&(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 u=new Array(i),d=0,f=e.length,h=e[d];d<f;d++,h=e[d])u[d]=new y.IntPoint(t[l].X+h.X,t[l].Y+h.Y);a.push(u)}else for(var l=0;l<s;l++){for(var u=new Array(i),d=0,f=e.length,h=e[d];d<f;d++,h=e[d])u[d]=new y.IntPoint(t[l].X-h.X,t[l].Y-h.Y);a.push(u)}for(var b=new Array,l=0;l<s-1+o;l++)for(var d=0;d<i;d++){var v=new Array;v.push(a[l%s][d%i]),v.push(a[(l+1)%s][d%i]),v.push(a[(l+1)%s][(d+1)%i]),v.push(a[l%s][(d+1)%i]),y.Clipper.Orientation(v)||v.reverse(),b.push(v)}var I=new y.Clipper(0);return I.AddPaths(b,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,u=0,d=i.length;u<d;++u){var l=y.Clipper.Minkowski(r,i[u],!0,o);a.AddPaths(l,y.PolyType.ptSubject,!0)}o&&a.AddPaths(i,y.PolyType.ptClip,!0);var f=new y.Paths;return a.Execute(y.ClipType.ctUnion,f,s,s),f}};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};FI(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 u=s;s=s*this.m_cos-this.m_sin*a,a=u*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 d=i-1,l=0;l<i;l++)d=this.OffsetPoint(l,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==y.EndType.etClosedLine){for(var d=i-1,l=0;l<i;l++)d=this.OffsetPoint(l,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var f=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(-f.X,-f.Y),d=0;for(var l=i-1;l>=0;l--)d=this.OffsetPoint(l,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var d=0,l=1;l<i-1;++l)d=this.OffsetPoint(l,d,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;d=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,d):this.DoRound(l,d)}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),d=i-1;for(var l=d-1;l>0;--l)d=this.OffsetPoint(l,d,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)):(d=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,u,d,f,h=[],b=0;b<o;b++)if(s=n[b],i=s.length,i!==0){if(i<3){a=s,h.push(a);continue}for(a=s,l=t*t,u=s[0],d=1,f=1;f<i;f++)(s[f].X-u.X)*(s[f].X-u.X)+(s[f].Y-u.Y)*(s[f].Y-u.Y)<=l||(a[d]=s[f],u=s[f],d++);u=s[d-1],(s[0].X-u.X)*(s[0].X-u.X)+(s[0].Y-u.Y)*(s[0].Y-u.Y)<=l&&d--,d<i&&a.splice(d,i-d),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,u,d,f,h,b,v,I,x,C,P,w=e.length,T=t*t,O=[];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?(b=1,o.push({X:o[0].X,Y:o[0].Y}),a=o.length):b=0,h=[],n=0;n<a-2;n++)l=o[n],d=o[n+1],u=o[n+2],C=l.X,P=l.Y,v=u.X-C,I=u.Y-P,(v!==0||I!==0)&&(x=((d.X-C)*v+(d.Y-P)*I)/(v*v+I*I),x>1?(C=u.X,P=u.Y):x>0&&(C+=v*x,P+=I*x)),v=d.X-C,I=d.Y-P,f=v*v+I*I,f<=T&&(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}),b&&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&&O.push(s)}return!e[0]instanceof Array&&(O=O[0]),typeof O>"u"&&(O=[[]]),O};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,u=0,d=0,f=e.length;if(f<2)return 0;for(t&&(e[f]=e[0],f++);--f;)i=e[f],a=i.X,l=i.Y,s=e[f-1],u=s.X,d=s.Y,o+=n((a-u)*(a-u)+(l-d)*(l-d));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,u,d;for(a=0;a<o;a++)for(i=n[a],r.holes[a]=i.Contour(),l=0,u=i.Childs(),d=u.length;l<d;l++)s=u[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};mb.exports=y});var SY=H((Cxt,AS)=>{p();(function(){"use strict";function e(s,a){var l=s.x-a.x,u=s.y-a.y;return l*l+u*u}function t(s,a,l){var u=a.x,d=a.y,f=l.x-u,h=l.y-d;if(f!==0||h!==0){var b=((s.x-u)*f+(s.y-d)*h)/(f*f+h*h);b>1?(u=l.x,d=l.y):b>0&&(u+=f*b,d+=h*b)}return f=s.x-u,h=s.y-d,f*f+h*h}function r(s,a){for(var l=s[0],u=[l],d,f=1,h=s.length;f<h;f++)d=s[f],e(d,l)>a&&(u.push(d),l=d);return l!==d&&u.push(d),u}function n(s,a,l,u,d){for(var f=u,h,b=a+1;b<l;b++){var v=t(s[b],s[a],s[l]);v>f&&(h=b,f=v)}f>u&&(h-a>1&&n(s,a,h,u,d),d.push(s[h]),l-h>1&&n(s,h,l,u,d))}function o(s,a){var l=s.length-1,u=[s[0]];return n(s,0,l,a,u),u.push(s[l]),u}function i(s,a,l){if(s.length<=2)return s;var u=a!==void 0?a*a:1;return s=l?s:r(s,u),s=o(s,u),s}typeof define=="function"&&define.amd?define(function(){return i}):typeof AS<"u"?(AS.exports=i,AS.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});p();p();p();p();p();p();var Ch=e=>e!=null;var ZY=function(){let t=globalThis.fetch;return{fetch(...r){if(!Ch(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}}}(),UE=ZY.fetch;var WE=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],VE=WE[0],qE="https://api-gateway.mappedin.com/track-analytics/a/",ZE="deny-watchposition",XE="load-mapview",YE="load-mapdata",KE="change-language",JE="query-directions";var Ma,Oi,Dd,l0,Fd=class{constructor(){M(this,Dd);M(this,Ma,Object.freeze({}));M(this,Oi);m(this,"oneTimeEventsSent",new Set);m(this,"sendGetDirectionsEvent",yE((t,r)=>this.sendAnalyticEvent(JE,{start:t,end:r,type:"location_to_location"}),2500));_(this,Oi,ee(this,Dd,l0).call(this,c(this,Ma)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){_(this,Ma,{}),_(this,Oi,ee(this,Dd,l0).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return _(this,Ma,Object.freeze(Object.assign({},c(this,Ma),t))),_(this,Oi,ee(this,Dd,l0).call(this,t)),c(this,Oi)}updateState(t){let r={...t};r.mapId&&(r.analyticsBaseUrl=r3({...c(this,Oi),mapId:r.mapId})),r.context&&(r.context=HE(r.context)),r.baseUri&&(r.analyticsBaseUrl=r3({baseUri:r.baseUri,mapId:c(this,Oi).mapId})),Object.assign(c(this,Oi),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,Oi)}getContext(){return this.getState().context||c(this,Ma).context||VE}getSessionId(){return this.getState().sessionId||c(this,Ma).sessionId||zE()}sendAnalyticEvent(t,r={}){let n=this.getState(),o=YY(n.analyticsBaseUrl,t),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":n.deviceId};if(n.logEvents&&$.log("Analytics.track",o,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return $.warn("Auth needs to be ready to send analytics.");let s={...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)),UE(o,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(s)})}capture(t,r){if(JY.includes(t))return $.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=KY.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(YE,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(KE,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(ZE)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(XE,{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)}};Ma=new WeakMap,Oi=new WeakMap,Dd=new WeakSet,l0=function(t){var n,o,i,s;let r=(n=t.baseUri)!=null?n:qE;return{baseUri:r,analyticsBaseUrl:r3({...t,baseUri:r}),version:((o=g==null?void 0:g.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||XY(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||zE(),platformString:t.platformString||"",context:HE(t.context)||VE,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 r3({mapId:e,baseUri:t=qE}){return"".concat(t).concat(e,"/")}function XY(){return fu.getInstance().loadLocalData("deviceId")}function zE(){return fu.getInstance().loadSessionData("id")}function YY(e,t){return e+t}function HE(e){return WE.find(t=>t===e)}var KY=["$select-location","$select-category","$query-suggest","$query-search"],JY=[XE,YE,JE,ZE,KE],OTe=new Fd,Oa,Ph=class{constructor(t){M(this,Oa);m(this,"capture");m(this,"updateState");_(this,Oa,t),this.capture=c(this,Oa).capture.bind(c(this,Oa)),this.updateState=c(this,Oa).updateState.bind(c(this,Oa))}getState(){return Object.assign({},c(this,Oa).getState())}};Oa=new WeakMap;p();p();var wh,Mh,Oh,Th=class{constructor(t,r,{enabled:n=!1}={}){M(this,wh);m(this,"searchInstance");M(this,Mh);M(this,Oh);m(this,"enabled",!1);_(this,wh,t),_(this,Mh,r),_(this,Oh,()=>{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 $.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return $.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return $.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return $.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-RS3PVAR3.js").then(({InternalSearch:t})=>new t(c(this,wh)))),c(this,Mh).on("language-change",c(this,Oh)),await this.searchInstance)}};wh=new WeakMap,Mh=new WeakMap,Oh=new WeakMap;var QE=new WeakMap,Cr,n3=class extends De{constructor(r,{search:n}={}){super();M(this,Cr);m(this,"Analytics");m(this,"Search");m(this,"Query");m(this,"getDirections",(r,n,o)=>c(this,Cr).getDirections(r,n,o));m(this,"getDirectionsMultiDestination",(r,n,o)=>c(this,Cr).getDirectionsMultiDestination(r,n,o));_(this,Cr,r),QE.set(this,r),this.Analytics=new Ph(r.Analytics),this.Query=r.Query,this.Search=new Th(this,r,{enabled:n==null?void 0:n.enabled}),c(this,Cr).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return c(this,Cr).getEnv()}getAccessToken(){var r;return(r=c(this,Cr).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return c(this,Cr).mapName}get mapCenter(){return c(this,Cr).mapCenter}get organizationId(){return c(this,Cr).organizationId}get outdoorViewToken(){return c(this,Cr).outdoorViewToken}getByType(r){return c(this,Cr).getByType(r)}getById(r,n){return c(this,Cr).getById(r,n)}getByExternalId(r,n){return c(this,Cr).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return c(this,Cr).changeLanguage(r)}get currentLanguage(){return c(this,Cr).currentLanguage}get naturalBearing(){var r;return(r=c(this,Cr).naturalBearing)!=null?r:0}getDistance(r,n){return c(this,Cr).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return c(this,Cr).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return c(this,Cr).toJSONBundle({downloadLanguagePacks:r})}};Cr=new WeakMap;var c0=n3;function Eh(e){let t=QE.get(e);if(!t)throw new Error("MapDataInternal not found");return t}p();p();p();p();p();p();p();p();p();var pF=fs(GC(),1),dF=fs(cF(),1);p();var Ure=e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2};function H0(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(H0);let t={...e};for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let o=H0(n);if(Ure(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]={...o,allOf:[o.allOf[i]]};continue}}t[r]=o}return t}var uF={$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 cOe=dF.default.default(new pF.default.default).compile(H0(uF));p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var pt={};Ul(pt,{HasPropertyKey:()=>zre,IsArray:()=>Tn,IsAsyncIterator:()=>ZC,IsBigInt:()=>iy,IsBoolean:()=>ec,IsDate:()=>Mu,IsFunction:()=>XC,IsIterator:()=>YC,IsNull:()=>KC,IsNumber:()=>Fi,IsObject:()=>Ut,IsRegExp:()=>sy,IsString:()=>Xt,IsSymbol:()=>JC,IsUint8Array:()=>Fa,IsUndefined:()=>gr});p();function zre(e,t){return t in e}function ZC(e){return Ut(e)&&!Tn(e)&&!Fa(e)&&Symbol.asyncIterator in e}function Tn(e){return Array.isArray(e)}function iy(e){return typeof e=="bigint"}function ec(e){return typeof e=="boolean"}function Mu(e){return e instanceof globalThis.Date}function XC(e){return typeof e=="function"}function YC(e){return Ut(e)&&!Tn(e)&&!Fa(e)&&Symbol.iterator in e}function KC(e){return e===null}function Fi(e){return typeof e=="number"}function Ut(e){return typeof e=="object"&&e!==null}function sy(e){return e instanceof globalThis.RegExp}function Xt(e){return typeof e=="string"}function JC(e){return typeof e=="symbol"}function Fa(e){return e instanceof globalThis.Uint8Array}function gr(e){return e===void 0}function Hre(e){return e.map(t=>W0(t))}function Wre(e){return new Date(e.getTime())}function qre(e){return new Uint8Array(e)}function Zre(e){return new RegExp(e.source,e.flags)}function Xre(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=W0(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=W0(e[r]);return t}function W0(e){return Tn(e)?Hre(e):Mu(e)?Wre(e):Fa(e)?qre(e):sy(e)?Zre(e):Ut(e)?Xre(e):e}function nr(e){return W0(e)}function fF(e){return e.map(t=>ay(t))}function ay(e,t){return t===void 0?nr(e):nr({...t,...e})}p();p();p();function q0(e){return ze(e)&&Symbol.asyncIterator in e}function Z0(e){return ze(e)&&Symbol.iterator in e}function QC(e){return ze(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function X0(e){return e instanceof Promise}function Vn(e){return e instanceof Date&&Number.isFinite(e.getTime())}function mF(e){return e instanceof globalThis.Map}function hF(e){return e instanceof globalThis.Set}function Yo(e){return ArrayBuffer.isView(e)}function Jd(e){return e instanceof globalThis.Uint8Array}function Fe(e,t){return t in e}function ze(e){return e!==null&&typeof e=="object"}function Ge(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}function br(e){return e===void 0}function La(e){return e===null}function Os(e){return typeof e=="boolean"}function we(e){return typeof e=="number"}function Y0(e){return Number.isInteger(e)}function sn(e){return typeof e=="bigint"}function dt(e){return typeof e=="string"}function tc(e){return typeof e=="function"}function Ra(e){return typeof e=="symbol"}function an(e){return sn(e)||Os(e)||La(e)||we(e)||dt(e)||Ra(e)||br(e)}var Dt;(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&&!Ge(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?we(s):Number.isFinite(s)}e.IsNumberLike=o;function i(s){let a=br(s);return e.AllowNullVoid?a||s===null:a}e.IsVoidLike=i})(Dt||(Dt={}));p();function Yre(e){return globalThis.Object.freeze(e).map(t=>ly(t))}function Kre(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=ly(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=ly(e[r]);return globalThis.Object.freeze(t)}function ly(e){return Tn(e)?Yre(e):Mu(e)?e:Fa(e)?e:sy(e)?e:Ut(e)?Kre(e):e}function J(e,t){let r=t!==void 0?{...t,...e}:e;switch(Dt.InstanceMode){case"freeze":return ly(r);case"clone":return nr(r);default:return r}}p();var Ae=class extends Error{constructor(t){super(t)}};p();p();p();var or=Symbol.for("TypeBox.Transform"),Na=Symbol.for("TypeBox.Readonly"),zn=Symbol.for("TypeBox.Optional"),Ko=Symbol.for("TypeBox.Hint"),W=Symbol.for("TypeBox.Kind");function yF(e){return Ut(e)&&e[Na]==="Readonly"}function Es(e){return Ut(e)&&e[zn]==="Optional"}function eP(e){return bt(e,"Any")}function Ba(e){return bt(e,"Array")}function cy(e){return bt(e,"AsyncIterator")}function tP(e){return bt(e,"BigInt")}function rP(e){return bt(e,"Boolean")}function uy(e){return bt(e,"Constructor")}function Jre(e){return bt(e,"Date")}function py(e){return bt(e,"Function")}function Ou(e){return bt(e,"Integer")}function Or(e){return bt(e,"Intersect")}function dy(e){return bt(e,"Iterator")}function bt(e,t){return Ut(e)&&W in e&&e[W]===t}function $a(e){return bt(e,"Literal")}function Mo(e){return bt(e,"MappedKey")}function sr(e){return bt(e,"MappedResult")}function rc(e){return bt(e,"Never")}function Qre(e){return bt(e,"Not")}function ene(e){return bt(e,"Null")}function Eu(e){return bt(e,"Number")}function jr(e){return bt(e,"Object")}function _u(e){return bt(e,"Promise")}function nP(e){return bt(e,"Record")}function oP(e){return bt(e,"Ref")}function iP(e){return bt(e,"RegExp")}function fy(e){return bt(e,"String")}function tne(e){return bt(e,"Symbol")}function Oo(e){return bt(e,"TemplateLiteral")}function rne(e){return bt(e,"This")}function Qd(e){return Ut(e)&&or in e}function Li(e){return bt(e,"Tuple")}function nne(e){return bt(e,"Undefined")}function Ot(e){return bt(e,"Union")}function one(e){return bt(e,"Uint8Array")}function ine(e){return bt(e,"Unknown")}function sne(e){return bt(e,"Unsafe")}function ane(e){return bt(e,"Void")}function nc(e){return Ut(e)&&W in e&&Xt(e[W])}function Ri(e){return eP(e)||Ba(e)||rP(e)||tP(e)||cy(e)||uy(e)||Jre(e)||py(e)||Ou(e)||Or(e)||dy(e)||$a(e)||Mo(e)||sr(e)||rc(e)||Qre(e)||ene(e)||Eu(e)||jr(e)||_u(e)||nP(e)||oP(e)||iP(e)||fy(e)||tne(e)||Oo(e)||rne(e)||Li(e)||nne(e)||Ot(e)||one(e)||ine(e)||sne(e)||ane(e)||nc(e)}var R={};Ul(R,{IsAny:()=>xF,IsArray:()=>IF,IsAsyncIterator:()=>SF,IsBigInt:()=>CF,IsBoolean:()=>PF,IsConstructor:()=>TF,IsDate:()=>wF,IsFunction:()=>MF,IsInteger:()=>OF,IsIntersect:()=>EF,IsIterator:()=>_F,IsKind:()=>eL,IsKindOf:()=>mt,IsLiteral:()=>hy,IsLiteralBoolean:()=>fne,IsLiteralNumber:()=>kF,IsLiteralString:()=>AF,IsLiteralValue:()=>DF,IsMappedKey:()=>FF,IsMappedResult:()=>LF,IsNever:()=>RF,IsNot:()=>NF,IsNull:()=>BF,IsNumber:()=>$F,IsObject:()=>jF,IsOptional:()=>dne,IsPromise:()=>GF,IsProperties:()=>cP,IsReadonly:()=>pne,IsRecord:()=>UF,IsRecursive:()=>mne,IsRef:()=>VF,IsRegExp:()=>zF,IsSchema:()=>ft,IsString:()=>HF,IsSymbol:()=>WF,IsTemplateLiteral:()=>qF,IsThis:()=>ZF,IsTransform:()=>Yt,IsTuple:()=>XF,IsUint8Array:()=>YF,IsUndefined:()=>ef,IsUnion:()=>uP,IsUnionLiteral:()=>hne,IsUnknown:()=>KF,IsUnsafe:()=>JF,IsVoid:()=>QF,TypeGuardUnknownTypeError:()=>sP});p();var sP=class extends Ae{},lne=["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 gF(e){try{return new RegExp(e),!0}catch{return!1}}function aP(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 bF(e){return lP(e)||ft(e)}function my(e){return gr(e)||iy(e)}function qt(e){return gr(e)||Fi(e)}function lP(e){return gr(e)||ec(e)}function Lt(e){return gr(e)||Xt(e)}function cne(e){return gr(e)||Xt(e)&&aP(e)&&gF(e)}function une(e){return gr(e)||Xt(e)&&aP(e)}function vF(e){return gr(e)||ft(e)}function pne(e){return Ut(e)&&e[Na]==="Readonly"}function dne(e){return Ut(e)&&e[zn]==="Optional"}function xF(e){return mt(e,"Any")&&Lt(e.$id)}function IF(e){return mt(e,"Array")&&e.type==="array"&&Lt(e.$id)&&ft(e.items)&&qt(e.minItems)&&qt(e.maxItems)&&lP(e.uniqueItems)&&vF(e.contains)&&qt(e.minContains)&&qt(e.maxContains)}function SF(e){return mt(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Lt(e.$id)&&ft(e.items)}function CF(e){return mt(e,"BigInt")&&e.type==="bigint"&&Lt(e.$id)&&my(e.exclusiveMaximum)&&my(e.exclusiveMinimum)&&my(e.maximum)&&my(e.minimum)&&my(e.multipleOf)}function PF(e){return mt(e,"Boolean")&&e.type==="boolean"&&Lt(e.$id)}function TF(e){return mt(e,"Constructor")&&e.type==="Constructor"&&Lt(e.$id)&&Tn(e.parameters)&&e.parameters.every(t=>ft(t))&&ft(e.returns)}function wF(e){return mt(e,"Date")&&e.type==="Date"&&Lt(e.$id)&&qt(e.exclusiveMaximumTimestamp)&&qt(e.exclusiveMinimumTimestamp)&&qt(e.maximumTimestamp)&&qt(e.minimumTimestamp)&&qt(e.multipleOfTimestamp)}function MF(e){return mt(e,"Function")&&e.type==="Function"&&Lt(e.$id)&&Tn(e.parameters)&&e.parameters.every(t=>ft(t))&&ft(e.returns)}function OF(e){return mt(e,"Integer")&&e.type==="integer"&&Lt(e.$id)&&qt(e.exclusiveMaximum)&&qt(e.exclusiveMinimum)&&qt(e.maximum)&&qt(e.minimum)&&qt(e.multipleOf)}function cP(e){return Ut(e)&&Object.entries(e).every(([t,r])=>aP(t)&&ft(r))}function EF(e){return mt(e,"Intersect")&&!(Xt(e.type)&&e.type!=="object")&&Tn(e.allOf)&&e.allOf.every(t=>ft(t)&&!Yt(t))&&Lt(e.type)&&(lP(e.unevaluatedProperties)||vF(e.unevaluatedProperties))&&Lt(e.$id)}function _F(e){return mt(e,"Iterator")&&e.type==="Iterator"&&Lt(e.$id)&&ft(e.items)}function mt(e,t){return Ut(e)&&W in e&&e[W]===t}function AF(e){return hy(e)&&Xt(e.const)}function kF(e){return hy(e)&&Fi(e.const)}function fne(e){return hy(e)&&ec(e.const)}function hy(e){return mt(e,"Literal")&&Lt(e.$id)&&DF(e.const)}function DF(e){return ec(e)||Fi(e)||Xt(e)}function FF(e){return mt(e,"MappedKey")&&Tn(e.keys)&&e.keys.every(t=>Fi(t)||Xt(t))}function LF(e){return mt(e,"MappedResult")&&cP(e.properties)}function RF(e){return mt(e,"Never")&&Ut(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function NF(e){return mt(e,"Not")&&ft(e.not)}function BF(e){return mt(e,"Null")&&e.type==="null"&&Lt(e.$id)}function $F(e){return mt(e,"Number")&&e.type==="number"&&Lt(e.$id)&&qt(e.exclusiveMaximum)&&qt(e.exclusiveMinimum)&&qt(e.maximum)&&qt(e.minimum)&&qt(e.multipleOf)}function jF(e){return mt(e,"Object")&&e.type==="object"&&Lt(e.$id)&&cP(e.properties)&&bF(e.additionalProperties)&&qt(e.minProperties)&&qt(e.maxProperties)}function GF(e){return mt(e,"Promise")&&e.type==="Promise"&&Lt(e.$id)&&ft(e.item)}function UF(e){return mt(e,"Record")&&e.type==="object"&&Lt(e.$id)&&bF(e.additionalProperties)&&Ut(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&gF(r[0])&&Ut(t.patternProperties)&&ft(t.patternProperties[r[0]])})(e)}function mne(e){return Ut(e)&&Ko in e&&e[Ko]==="Recursive"}function VF(e){return mt(e,"Ref")&&Lt(e.$id)&&Xt(e.$ref)}function zF(e){return mt(e,"RegExp")&&Lt(e.$id)&&Xt(e.source)&&Xt(e.flags)&&qt(e.maxLength)&&qt(e.minLength)}function HF(e){return mt(e,"String")&&e.type==="string"&&Lt(e.$id)&&qt(e.minLength)&&qt(e.maxLength)&&cne(e.pattern)&&une(e.format)}function WF(e){return mt(e,"Symbol")&&e.type==="symbol"&&Lt(e.$id)}function qF(e){return mt(e,"TemplateLiteral")&&e.type==="string"&&Xt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function ZF(e){return mt(e,"This")&&Lt(e.$id)&&Xt(e.$ref)}function Yt(e){return Ut(e)&&or in e}function XF(e){return mt(e,"Tuple")&&e.type==="array"&&Lt(e.$id)&&Fi(e.minItems)&&Fi(e.maxItems)&&e.minItems===e.maxItems&&(gr(e.items)&&gr(e.additionalItems)&&e.minItems===0||Tn(e.items)&&e.items.every(t=>ft(t)))}function ef(e){return mt(e,"Undefined")&&e.type==="undefined"&&Lt(e.$id)}function hne(e){return uP(e)&&e.anyOf.every(t=>AF(t)||kF(t))}function uP(e){return mt(e,"Union")&&Lt(e.$id)&&Ut(e)&&Tn(e.anyOf)&&e.anyOf.every(t=>ft(t))}function YF(e){return mt(e,"Uint8Array")&&e.type==="Uint8Array"&&Lt(e.$id)&&qt(e.minByteLength)&&qt(e.maxByteLength)}function KF(e){return mt(e,"Unknown")&&Lt(e.$id)}function JF(e){return mt(e,"Unsafe")}function QF(e){return mt(e,"Void")&&e.type==="void"&&Lt(e.$id)}function eL(e){return Ut(e)&&W in e&&Xt(e[W])&&!lne.includes(e[W])}function ft(e){return Ut(e)&&(xF(e)||IF(e)||PF(e)||CF(e)||SF(e)||TF(e)||wF(e)||MF(e)||OF(e)||EF(e)||_F(e)||hy(e)||FF(e)||LF(e)||RF(e)||NF(e)||BF(e)||$F(e)||jF(e)||GF(e)||UF(e)||VF(e)||zF(e)||HF(e)||WF(e)||qF(e)||ZF(e)||XF(e)||ef(e)||uP(e)||YF(e)||KF(e)||JF(e)||QF(e)||eL(e))}p();var pP="(true|false)",yy="(0|[1-9][0-9]*)",dP="(.*)",yne="(?!.*)",xEe="^".concat(pP,"$"),ja="^".concat(yy,"$"),Ga="^".concat(dP,"$"),tL="^".concat(yne,"$");p();var Hn={};Ul(Hn,{Clear:()=>bne,Delete:()=>vne,Entries:()=>gne,Get:()=>Sne,Has:()=>xne,Set:()=>Ine});p();var tf=new Map;function gne(){return new Map(tf)}function bne(){return tf.clear()}function vne(e){return tf.delete(e)}function xne(e){return tf.has(e)}function Ine(e,t){tf.set(e,t)}function Sne(e){return tf.get(e)}var Gr={};Ul(Gr,{Clear:()=>Pne,Delete:()=>Tne,Entries:()=>Cne,Get:()=>One,Has:()=>wne,Set:()=>Mne});p();var rf=new Map;function Cne(){return new Map(rf)}function Pne(){return rf.clear()}function Tne(e){return rf.delete(e)}function wne(e){return rf.has(e)}function Mne(e,t){rf.set(e,t)}function One(e){return rf.get(e)}p();function rL(e,t){return e.includes(t)}function nL(e){return[...new Set(e)]}function Ene(e,t){return e.filter(r=>t.includes(r))}function _ne(e,t){return e.reduce((r,n)=>Ene(r,n),t)}function oL(e){return e.length===1?e[0]:e.length>1?_ne(e.slice(1),e[0]):[]}function iL(e){let t=[];for(let r of e)t.push(...r);return t}p();function oc(e){return J({[W]:"Any"},e)}p();function K0(e,t){return J({[W]:"Array",type:"array",items:e},t)}p();function J0(e,t){return J({[W]:"AsyncIterator",type:"AsyncIterator",items:e},t)}p();p();p();function Ane(e,t){let{[t]:r,...n}=e;return n}function Pr(e,t){return t.reduce((r,n)=>Ane(r,n),e)}p();function Rt(e){return J({[W]:"Never",not:{}},e)}p();p();function vt(e){return J({[W]:"MappedResult",properties:e})}p();p();function Q0(e,t,r){return J({[W]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}p();function ic(e,t,r){return J({[W]:"Function",type:"Function",parameters:e,returns:t},r)}p();p();p();p();function gy(e,t){return J({[W]:"Union",anyOf:e},t)}function kne(e){return e.some(t=>Es(t))}function sL(e){return e.map(t=>Es(t)?Dne(t):t)}function Dne(e){return Pr(e,[zn])}function Fne(e,t){return kne(e)?uo(gy(sL(e),t)):gy(sL(e),t)}function _s(e,t){return e.length===0?Rt(t):e.length===1?J(e[0],t):Fne(e,t)}p();function Nt(e,t){return e.length===0?Rt(t):e.length===1?J(e[0],t):gy(e,t)}p();p();p();var ev=class extends Ae{};function Lne(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function fP(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Ua(e,t){return fP(e,t,"(")}function by(e,t){return fP(e,t,")")}function aL(e,t){return fP(e,t,"|")}function Rne(e){if(!(Ua(e,0)&&by(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Ua(e,r)&&(t+=1),by(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function Nne(e){return e.slice(1,e.length-1)}function Bne(e){let t=0;for(let r=0;r<e.length;r++)if(Ua(e,r)&&(t+=1),by(e,r)&&(t-=1),aL(e,r)&&t===0)return!0;return!1}function $ne(e){for(let t=0;t<e.length;t++)if(Ua(e,t))return!0;return!1}function jne(e){let[t,r]=[0,0],n=[];for(let i=0;i<e.length;i++)if(Ua(e,i)&&(t+=1),by(e,i)&&(t-=1),aL(e,i)&&t===0){let s=e.slice(r,i);s.length>0&&n.push(nf(s)),r=i+1}let o=e.slice(r);return o.length>0&&n.push(nf(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}function Gne(e){function t(o,i){if(!Ua(o,i))throw new ev("TemplateLiteralParser: Index must point to open parens");let s=0;for(let a=i;a<o.length;a++)if(Ua(o,a)&&(s+=1),by(o,a)&&(s-=1),s===0)return[i,a];throw new ev("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,i){for(let s=i;s<o.length;s++)if(Ua(o,s))return[i,s];return[i,o.length]}let n=[];for(let o=0;o<e.length;o++)if(Ua(e,o)){let[i,s]=t(e,o),a=e.slice(i,s+1);n.push(nf(a)),o=s}else{let[i,s]=r(e,o),a=e.slice(i,s);a.length>0&&n.push(nf(a)),o=s-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}function nf(e){return Rne(e)?nf(Nne(e)):Bne(e)?jne(e):$ne(e)?Gne(e):{type:"const",const:Lne(e)}}function of(e){return nf(e.slice(1,e.length-1))}var mP=class extends Ae{};function Une(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 Vne(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 zne(e){return e.type==="const"&&e.const===".*"}function Au(e){return Une(e)||zne(e)?!1:Vne(e)?!0:e.type==="and"?e.expr.every(t=>Au(t)):e.type==="or"?e.expr.every(t=>Au(t)):e.type==="const"?!0:(()=>{throw new mP("Unknown expression type")})()}function tv(e){let t=of(e.pattern);return Au(t)}p();var hP=class extends Ae{};function*lL(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of lL(e.slice(1)))yield"".concat(t).concat(r)}function*Hne(e){return yield*lL(e.expr.map(t=>[...vy(t)]))}function*Wne(e){for(let t of e.expr)yield*vy(t)}function*qne(e){return yield e.const}function*vy(e){return e.type==="and"?yield*Hne(e):e.type==="or"?yield*Wne(e):e.type==="const"?yield*qne(e):(()=>{throw new hP("Unknown expression")})()}function sf(e){let t=of(e.pattern);return Au(t)?[...vy(t)]:[]}p();p();function _t(e,t){return J({[W]:"Literal",const:e,type:typeof e},t)}p();function rv(e){return J({[W]:"Boolean",type:"boolean"},e)}p();function af(e){return J({[W]:"BigInt",type:"bigint"},e)}p();function As(e){return J({[W]:"Number",type:"number"},e)}p();function Jo(e){return J({[W]:"String",type:"string"},e)}function*Zne(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield rv():t==="number"?yield As():t==="bigint"?yield af():t==="string"?yield Jo():yield(()=>{let r=t.split("|").map(n=>_t(n.trim()));return r.length===0?Rt():r.length===1?r[0]:_s(r)})()}function*Xne(e){if(e[1]!=="{"){let t=_t("$"),r=yP(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=Zne(e.slice(2,t)),n=yP(e.slice(t+1));return yield*[...r,...n]}yield _t(e)}function*yP(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=_t(e.slice(0,t)),n=Xne(e.slice(t));return yield*[r,...n]}yield _t(e)}function cL(e){return[...yP(e)]}p();var gP=class extends Ae{};function Yne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uL(e,t){return Oo(e)?e.pattern.slice(1,e.pattern.length-1):Ot(e)?"(".concat(e.anyOf.map(r=>uL(r,t)).join("|"),")"):Eu(e)?"".concat(t).concat(yy):Ou(e)?"".concat(t).concat(yy):tP(e)?"".concat(t).concat(yy):fy(e)?"".concat(t).concat(dP):$a(e)?"".concat(t).concat(Yne(e.const.toString())):rP(e)?"".concat(t).concat(pP):(()=>{throw new gP("Unexpected Kind '".concat(e[W],"'"))})()}function bP(e){return"^".concat(e.map(t=>uL(t,"")).join(""),"$")}p();function ku(e){let r=sf(e).map(n=>_t(n));return _s(r)}p();function nv(e,t){let r=Xt(e)?bP(cL(e)):bP(e);return J({[W]:"TemplateLiteral",type:"string",pattern:r},t)}function Kne(e){return sf(e).map(r=>r.toString())}function Jne(e){let t=[];for(let r of e)t.push(...po(r));return t}function Qne(e){return[e.toString()]}function po(e){return[...new Set(Oo(e)?Kne(e):Ot(e)?Jne(e.anyOf):$a(e)?Qne(e.const):Eu(e)?["[number]"]:Ou(e)?["[number]"]:[])]}p();function eoe(e,t,r){let n={};for(let o of Object.getOwnPropertyNames(t))n[o]=lf(e,po(t[o]),r);return n}function toe(e,t,r){return eoe(e,t.properties,r)}function pL(e,t,r){let n=toe(e,t,r);return vt(n)}function fL(e,t){return e.map(r=>mL(r,t))}function roe(e){return e.filter(t=>!rc(t))}function noe(e,t){return ov(roe(fL(e,t)))}function ooe(e){return e.some(t=>rc(t))?[]:e}function ioe(e,t){return _s(ooe(fL(e,t)))}function soe(e,t){return t in e?e[t]:t==="[number]"?_s(e):Rt()}function aoe(e,t){return t==="[number]"?e:Rt()}function loe(e,t){return t in e?e[t]:Rt()}function mL(e,t){var r;return Or(e)?noe(e.allOf,t):Ot(e)?ioe(e.anyOf,t):Li(e)?soe((r=e.items)!=null?r:[],t):Ba(e)?aoe(e.items,t):jr(e)?loe(e.properties,t):Rt()}function xy(e,t){return t.map(r=>mL(e,r))}function dL(e,t){return _s(xy(e,t))}function lf(e,t,r){return sr(t)?pL(e,t,r):Mo(t)?hL(e,t,r):J(Ri(t)?dL(e,po(t)):dL(e,t),r)}function coe(e,t,r){return{[t]:lf(e,[t],nr(r))}}function uoe(e,t,r){return t.reduce((n,o)=>({...n,...coe(e,o,r)}),{})}function poe(e,t,r){return uoe(e,t.keys,r)}function hL(e,t,r){let n=poe(e,t,r);return vt(n)}p();function iv(e,t){return J({[W]:"Iterator",type:"Iterator",items:e},t)}p();function doe(e){let t=[];for(let r in e)Es(e[r])||t.push(r);return t}function foe(e,t){let r=doe(e),n=r.length>0?{[W]:"Object",type:"object",properties:e,required:r}:{[W]:"Object",type:"object",properties:e};return J(n,t)}var Vt=foe;p();function sv(e,t){return J({[W]:"Promise",type:"Promise",item:e},t)}p();p();function moe(e){return J(Pr(e,[Na]))}function hoe(e){return J({...e,[Na]:"Readonly"})}function yoe(e,t){return t===!1?moe(e):hoe(e)}function Qo(e,t){let r=t!=null?t:!0;return sr(e)?yL(e,r):yoe(e,r)}function goe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Qo(e[n],t);return r}function boe(e,t){return goe(e.properties,t)}function yL(e,t){let r=boe(e,t);return vt(r)}p();function ks(e,t){return J(e.length>0?{[W]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[W]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function gL(e,t){return e in t?ei(e,t[e]):vt(t)}function voe(e){return{[e]:_t(e)}}function xoe(e){let t={};for(let r of e)t[r]=_t(r);return t}function Ioe(e,t){return rL(t,e)?voe(e):xoe(t)}function Soe(e,t){let r=Ioe(e,t);return gL(e,r)}function Iy(e,t){return t.map(r=>ei(e,r))}function Coe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=ei(e,t[n]);return r}function ei(e,t){var n;let r={...t};return Es(t)?uo(ei(e,Pr(t,[zn]))):yF(t)?Qo(ei(e,Pr(t,[Na]))):sr(t)?gL(e,t.properties):Mo(t)?Soe(e,t.keys):uy(t)?Q0(Iy(e,t.parameters),ei(e,t.returns),r):py(t)?ic(Iy(e,t.parameters),ei(e,t.returns),r):cy(t)?J0(ei(e,t.items),r):dy(t)?iv(ei(e,t.items),r):Or(t)?fo(Iy(e,t.allOf),r):Ot(t)?Nt(Iy(e,t.anyOf),r):Li(t)?ks(Iy(e,(n=t.items)!=null?n:[]),r):jr(t)?Vt(Coe(e,t.properties),r):Ba(t)?K0(ei(e,t.items),r):_u(t)?sv(ei(e,t.item),r):t}function Poe(e,t){let r={};for(let n of e)r[n]=ei(n,t);return r}function bL(e,t,r){let n=Ri(e)?po(e):e,o=t({[W]:"MappedKey",keys:n}),i=Poe(n,o);return Vt(i,r)}p();function Toe(e){return J(Pr(e,[zn]))}function woe(e){return J({...e,[zn]:"Optional"})}function Moe(e,t){return t===!1?Toe(e):woe(e)}function uo(e,t){let r=t!=null?t:!0;return sr(e)?vL(e,r):Moe(e,r)}function Ooe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=uo(e[n],t);return r}function Eoe(e,t){return Ooe(e.properties,t)}function vL(e,t){let r=Eoe(e,t);return vt(r)}p();function Sy(e,t={}){let r=e.every(o=>jr(o)),n=Ri(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return J(t.unevaluatedProperties===!1||Ri(t.unevaluatedProperties)||r?{...n,[W]:"Intersect",type:"object",allOf:e}:{...n,[W]:"Intersect",allOf:e},t)}function _oe(e){return e.every(t=>Es(t))}function Aoe(e){return Pr(e,[zn])}function xL(e){return e.map(t=>Es(t)?Aoe(t):t)}function koe(e,t){return _oe(e)?uo(Sy(xL(e),t)):Sy(xL(e),t)}function ov(e,t={}){if(e.length===0)return Rt(t);if(e.length===1)return J(e[0],t);if(e.some(r=>Qd(r)))throw new Error("Cannot intersect transform types");return koe(e,t)}p();function fo(e,t){if(e.length===0)return Rt(t);if(e.length===1)return J(e[0],t);if(e.some(r=>Qd(r)))throw new Error("Cannot intersect transform types");return Sy(e,t)}function IL(e){return e.map(t=>vP(t))}function Doe(e){return fo(IL(e))}function Foe(e){return Nt(IL(e))}function Loe(e){return vP(e)}function vP(e){return Or(e)?Doe(e.allOf):Ot(e)?Foe(e.anyOf):_u(e)?Loe(e.item):e}function SL(e,t){return J(vP(e),t)}p();p();p();p();function CL(e){let t=[];for(let r of e)t.push(Yr(r));return t}function Roe(e){let t=CL(e);return iL(t)}function Noe(e){let t=CL(e);return oL(t)}function Boe(e){return e.map((t,r)=>r.toString())}function $oe(e){return["[number]"]}function joe(e){return globalThis.Object.getOwnPropertyNames(e)}function Goe(e){return xP?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)?Roe(e.allOf):Ot(e)?Noe(e.anyOf):Li(e)?Boe((t=e.items)!=null?t:[]):Ba(e)?$oe(e.items):jr(e)?joe(e.properties):nP(e)?Goe(e.patternProperties):[]}var xP=!1;function Va(e){xP=!0;let t=Yr(e);xP=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}function Uoe(e){return e.map(t=>t==="[number]"?As():_t(t))}function av(e,t){if(sr(e))return PL(e,t);{let r=Yr(e),n=Uoe(r),o=_s(n);return J(o,t)}}function Voe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=av(e[n],nr(t));return r}function zoe(e,t){return Voe(e.properties,t)}function PL(e,t){let r=zoe(e,t);return vt(r)}p();function sc(e){let t=Yr(e),r=xy(e,t);return t.map((n,o)=>[t[o],r[o]])}function Hoe(e){let t=[];for(let r of e)t.push(...Yr(r));return nL(t)}function Woe(e){return e.filter(t=>!rc(t))}function qoe(e,t){let r=[];for(let n of e)r.push(...xy(n,[t]));return Woe(r)}function Zoe(e,t){let r={};for(let n of t)r[n]=ov(qoe(e,n));return r}function TL(e,t){let r=Hoe(e),n=Zoe(e,r);return Vt(n,t)}p();p();function lv(e){return J({[W]:"Date",type:"Date"},e)}p();function cv(e){return J({[W]:"Null",type:"null"},e)}p();function uv(e){return J({[W]:"Symbol",type:"symbol"},e)}p();function pv(e){return J({[W]:"Undefined",type:"undefined"},e)}p();function dv(e){return J({[W]:"Uint8Array",type:"Uint8Array"},e)}p();function za(e){return J({[W]:"Unknown"},e)}function Xoe(e){return e.map(t=>IP(t,!1))}function Yoe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Qo(IP(e[r],!1));return t}function fv(e,t){return t===!0?e:Qo(e)}function IP(e,t){return ZC(e)?fv(oc(),t):YC(e)?fv(oc(),t):Tn(e)?Qo(ks(Xoe(e))):Fa(e)?dv():Mu(e)?lv():Ut(e)?fv(Vt(Yoe(e)),t):XC(e)?fv(ic([],za()),t):gr(e)?pv():KC(e)?cv():JC(e)?uv():iy(e)?af():Fi(e)?_t(e):ec(e)?_t(e):Xt(e)?_t(e):Vt({})}function wL(e,t){return J(IP(e,!0),t)}p();function ML(e,t){return ks(e.parameters,t)}p();function Cy(e,t){return e.map(r=>Ni(r,t))}function Koe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Ni(e[n],t);return r}function Joe(e,t){return e.parameters=Cy(e.parameters,t),e.returns=Ni(e.returns,t),e}function Qoe(e,t){return e.parameters=Cy(e.parameters,t),e.returns=Ni(e.returns,t),e}function eie(e,t){return e.allOf=Cy(e.allOf,t),e}function tie(e,t){return e.anyOf=Cy(e.anyOf,t),e}function rie(e,t){return gr(e.items)||(e.items=Cy(e.items,t)),e}function nie(e,t){return e.items=Ni(e.items,t),e}function oie(e,t){return e.properties=Koe(e.properties,t),e}function iie(e,t){return e.item=Ni(e.item,t),e}function sie(e,t){return e.items=Ni(e.items,t),e}function aie(e,t){return e.items=Ni(e.items,t),e}function lie(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=Pr(r,["$id"]);return Ni(n,t)}function cie(e,t){return uy(e)?Joe(e,t):py(e)?Qoe(e,t):Or(e)?eie(e,t):Ot(e)?tie(e,t):Li(e)?rie(e,t):Ba(e)?nie(e,t):jr(e)?oie(e,t):_u(e)?iie(e,t):cy(e)?sie(e,t):dy(e)?aie(e,t):oP(e)?lie(e,t):e}function Ni(e,t){return cie(ay(e),fF(t))}p();function OL(e,t){if(gr(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),o=[...new Set(r)].map(i=>_t(i));return Nt(o,{...t,[Ko]:"Enum"})}p();p();p();var CP=class extends Ae{},X;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(X||(X={}));function ti(e){return e===X.False?e:X.True}function cf(e){throw new CP(e)}function Fr(e){return R.IsNever(e)||R.IsIntersect(e)||R.IsUnion(e)||R.IsUnknown(e)||R.IsAny(e)}function Lr(e,t){return R.IsNever(t)?LL(e,t):R.IsIntersect(t)?mv(e,t):R.IsUnion(t)?MP(e,t):R.IsUnknown(t)?$L(e,t):R.IsAny(t)?wP(e,t):cf("StructuralRight")}function wP(e,t){return X.True}function uie(e,t){return R.IsIntersect(t)?mv(e,t):R.IsUnion(t)&&t.anyOf.some(r=>R.IsAny(r)||R.IsUnknown(r))?X.True:R.IsUnion(t)?X.Union:R.IsUnknown(t)||R.IsAny(t)?X.True:X.Union}function pie(e,t){return R.IsUnknown(e)?X.False:R.IsAny(e)?X.Union:R.IsNever(e)?X.True:X.False}function die(e,t){return R.IsObject(t)&&hv(t)?X.True:Fr(t)?Lr(e,t):R.IsArray(t)?ti(Bt(e.items,t.items)):X.False}function fie(e,t){return Fr(t)?Lr(e,t):R.IsAsyncIterator(t)?ti(Bt(e.items,t.items)):X.False}function mie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsBigInt(t)?X.True:X.False}function DL(e,t){return R.IsLiteralBoolean(e)||R.IsBoolean(e)?X.True:X.False}function hie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsBoolean(t)?X.True:X.False}function yie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsConstructor(t)?e.parameters.length>t.parameters.length?X.False:e.parameters.every((r,n)=>ti(Bt(t.parameters[n],r))===X.True)?ti(Bt(e.returns,t.returns)):X.False:X.False}function gie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsDate(t)?X.True:X.False}function bie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsFunction(t)?e.parameters.length>t.parameters.length?X.False:e.parameters.every((r,n)=>ti(Bt(t.parameters[n],r))===X.True)?ti(Bt(e.returns,t.returns)):X.False:X.False}function FL(e,t){return R.IsLiteral(e)&&pt.IsNumber(e.const)||R.IsNumber(e)||R.IsInteger(e)?X.True:X.False}function vie(e,t){return R.IsInteger(t)||R.IsNumber(t)?X.True:Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):X.False}function mv(e,t){return t.allOf.every(r=>Bt(e,r)===X.True)?X.True:X.False}function xie(e,t){return e.allOf.some(r=>Bt(r,t)===X.True)?X.True:X.False}function Iie(e,t){return Fr(t)?Lr(e,t):R.IsIterator(t)?ti(Bt(e.items,t.items)):X.False}function Sie(e,t){return R.IsLiteral(t)&&t.const===e.const?X.True:Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsString(t)?BL(e,t):R.IsNumber(t)?RL(e,t):R.IsInteger(t)?FL(e,t):R.IsBoolean(t)?DL(e,t):X.False}function LL(e,t){return X.False}function Cie(e,t){return X.True}function EL(e){let[t,r]=[e,0];for(;R.IsNot(t);)t=t.not,r+=1;return r%2===0?t:za()}function Pie(e,t){return R.IsNot(e)?Bt(EL(e),t):R.IsNot(t)?Bt(e,EL(t)):cf("Invalid fallthrough for Not")}function Tie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsNull(t)?X.True:X.False}function RL(e,t){return R.IsLiteralNumber(e)||R.IsNumber(e)||R.IsInteger(e)?X.True:X.False}function wie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsInteger(t)||R.IsNumber(t)?X.True:X.False}function mo(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function _L(e){return hv(e)}function AL(e){return mo(e,0)||mo(e,1)&&"description"in e.properties&&R.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(R.IsString(e.properties.description.anyOf[0])&&R.IsUndefined(e.properties.description.anyOf[1])||R.IsString(e.properties.description.anyOf[1])&&R.IsUndefined(e.properties.description.anyOf[0]))}function SP(e){return mo(e,0)}function kL(e){return mo(e,0)}function Mie(e){return mo(e,0)}function Oie(e){return mo(e,0)}function Eie(e){return hv(e)}function _ie(e){let t=As();return mo(e,0)||mo(e,1)&&"length"in e.properties&&ti(Bt(e.properties.length,t))===X.True}function Aie(e){return mo(e,0)}function hv(e){let t=As();return mo(e,0)||mo(e,1)&&"length"in e.properties&&ti(Bt(e.properties.length,t))===X.True}function kie(e){let t=ic([oc()],oc());return mo(e,0)||mo(e,1)&&"then"in e.properties&&ti(Bt(e.properties.then,t))===X.True}function NL(e,t){return Bt(e,t)===X.False||R.IsOptional(e)&&!R.IsOptional(t)?X.False:X.True}function wn(e,t){return R.IsUnknown(e)?X.False:R.IsAny(e)?X.Union:R.IsNever(e)||R.IsLiteralString(e)&&_L(t)||R.IsLiteralNumber(e)&&SP(t)||R.IsLiteralBoolean(e)&&kL(t)||R.IsSymbol(e)&&AL(t)||R.IsBigInt(e)&&Mie(t)||R.IsString(e)&&_L(t)||R.IsSymbol(e)&&AL(t)||R.IsNumber(e)&&SP(t)||R.IsInteger(e)&&SP(t)||R.IsBoolean(e)&&kL(t)||R.IsUint8Array(e)&&Eie(t)||R.IsDate(e)&&Oie(t)||R.IsConstructor(e)&&Aie(t)||R.IsFunction(e)&&_ie(t)?X.True:R.IsRecord(e)&&R.IsString(PP(e))?t[Ko]==="Record"?X.True:X.False:R.IsRecord(e)&&R.IsNumber(PP(e))?mo(t,0)?X.True:X.False:X.False}function Die(e,t){return Fr(t)?Lr(e,t):R.IsRecord(t)?ri(e,t):R.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!R.IsOptional(t.properties[r]))return X.False;if(R.IsOptional(t.properties[r]))return X.True;if(NL(e.properties[r],t.properties[r])===X.False)return X.False}return X.True})():X.False}function Fie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)&&kie(t)?X.True:R.IsPromise(t)?ti(Bt(e.item,t.item)):X.False}function PP(e){return ja in e.patternProperties?As():Ga in e.patternProperties?Jo():cf("Unknown record key pattern")}function TP(e){return ja in e.patternProperties?e.patternProperties[ja]:Ga in e.patternProperties?e.patternProperties[Ga]:cf("Unable to get record value schema")}function ri(e,t){let[r,n]=[PP(t),TP(t)];return R.IsLiteralString(e)&&R.IsNumber(r)&&ti(Bt(e,n))===X.True?X.True:R.IsUint8Array(e)&&R.IsNumber(r)||R.IsString(e)&&R.IsNumber(r)||R.IsArray(e)&&R.IsNumber(r)?Bt(e,n):R.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(NL(n,e.properties[o])===X.False)return X.False;return X.True})():X.False}function Lie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?Bt(TP(e),TP(t)):X.False}function Rie(e,t){let r=R.IsRegExp(e)?Jo():e,n=R.IsRegExp(t)?Jo():t;return Bt(r,n)}function BL(e,t){return R.IsLiteral(e)&&pt.IsString(e.const)||R.IsString(e)?X.True:X.False}function Nie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsString(t)?X.True:X.False}function Bie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsSymbol(t)?X.True:X.False}function $ie(e,t){return R.IsTemplateLiteral(e)?Bt(ku(e),t):R.IsTemplateLiteral(t)?Bt(e,ku(t)):cf("Invalid fallthrough for TemplateLiteral")}function jie(e,t){return R.IsArray(t)&&e.items!==void 0&&e.items.every(r=>Bt(r,t.items)===X.True)}function Gie(e,t){return R.IsNever(e)?X.True:R.IsUnknown(e)?X.False:R.IsAny(e)?X.Union:X.False}function Uie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)&&hv(t)||R.IsArray(t)&&jie(e,t)?X.True:R.IsTuple(t)?pt.IsUndefined(e.items)&&!pt.IsUndefined(t.items)||!pt.IsUndefined(e.items)&&pt.IsUndefined(t.items)?X.False:pt.IsUndefined(e.items)&&!pt.IsUndefined(t.items)||e.items.every((r,n)=>Bt(r,t.items[n])===X.True)?X.True:X.False:X.False}function Vie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsUint8Array(t)?X.True:X.False}function zie(e,t){return Fr(t)?Lr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ri(e,t):R.IsVoid(t)?qie(e,t):R.IsUndefined(t)?X.True:X.False}function MP(e,t){return t.anyOf.some(r=>Bt(e,r)===X.True)?X.True:X.False}function Hie(e,t){return e.anyOf.every(r=>Bt(r,t)===X.True)?X.True:X.False}function $L(e,t){return X.True}function Wie(e,t){return R.IsNever(t)?LL(e,t):R.IsIntersect(t)?mv(e,t):R.IsUnion(t)?MP(e,t):R.IsAny(t)?wP(e,t):R.IsString(t)?BL(e,t):R.IsNumber(t)?RL(e,t):R.IsInteger(t)?FL(e,t):R.IsBoolean(t)?DL(e,t):R.IsArray(t)?pie(e,t):R.IsTuple(t)?Gie(e,t):R.IsObject(t)?wn(e,t):R.IsUnknown(t)?X.True:X.False}function qie(e,t){return R.IsUndefined(e)||R.IsUndefined(e)?X.True:X.False}function Zie(e,t){return R.IsIntersect(t)?mv(e,t):R.IsUnion(t)?MP(e,t):R.IsUnknown(t)?$L(e,t):R.IsAny(t)?wP(e,t):R.IsObject(t)?wn(e,t):R.IsVoid(t)?X.True:X.False}function Bt(e,t){return R.IsTemplateLiteral(e)||R.IsTemplateLiteral(t)?$ie(e,t):R.IsRegExp(e)||R.IsRegExp(t)?Rie(e,t):R.IsNot(e)||R.IsNot(t)?Pie(e,t):R.IsAny(e)?uie(e,t):R.IsArray(e)?die(e,t):R.IsBigInt(e)?mie(e,t):R.IsBoolean(e)?hie(e,t):R.IsAsyncIterator(e)?fie(e,t):R.IsConstructor(e)?yie(e,t):R.IsDate(e)?gie(e,t):R.IsFunction(e)?bie(e,t):R.IsInteger(e)?vie(e,t):R.IsIntersect(e)?xie(e,t):R.IsIterator(e)?Iie(e,t):R.IsLiteral(e)?Sie(e,t):R.IsNever(e)?Cie(e,t):R.IsNull(e)?Tie(e,t):R.IsNumber(e)?wie(e,t):R.IsObject(e)?Die(e,t):R.IsRecord(e)?Lie(e,t):R.IsString(e)?Nie(e,t):R.IsSymbol(e)?Bie(e,t):R.IsTuple(e)?Uie(e,t):R.IsPromise(e)?Fie(e,t):R.IsUint8Array(e)?Vie(e,t):R.IsUndefined(e)?zie(e,t):R.IsUnion(e)?Hie(e,t):R.IsUnknown(e)?Wie(e,t):R.IsVoid(e)?Zie(e,t):cf("Unknown left type operand '".concat(e[W],"'"))}function ac(e,t){return Bt(e,t)}p();p();p();function Xie(e,t,r,n,o){let i={};for(let s of globalThis.Object.getOwnPropertyNames(e))i[s]=uf(e[s],t,r,n,nr(o));return i}function Yie(e,t,r,n,o){return Xie(e.properties,t,r,n,o)}function jL(e,t,r,n,o){let i=Yie(e,t,r,n,o);return vt(i)}function Kie(e,t,r,n){let o=ac(e,t);return o===X.Union?Nt([r,n]):o===X.True?r:n}function uf(e,t,r,n,o){return sr(e)?jL(e,t,r,n,o):Mo(e)?J(GL(e,t,r,n,o)):J(Kie(e,t,r,n),o)}function Jie(e,t,r,n,o){return{[e]:uf(_t(e),t,r,n,nr(o))}}function Qie(e,t,r,n,o){return e.reduce((i,s)=>({...i,...Jie(s,t,r,n,o)}),{})}function ese(e,t,r,n,o){return Qie(e.keys,t,r,n,o)}function GL(e,t,r,n,o){let i=ese(e,t,r,n,o);return vt(i)}p();function tse(e){return e.allOf.every(t=>Ha(t))}function rse(e){return e.anyOf.some(t=>Ha(t))}function nse(e){return!Ha(e.not)}function Ha(e){return e[W]==="Intersect"?tse(e):e[W]==="Union"?rse(e):e[W]==="Not"?nse(e):e[W]==="Undefined"}p();function UL(e,t){return pf(ku(e),t)}function ose(e,t){let r=e.filter(n=>ac(n,t)===X.False);return r.length===1?r[0]:Nt(r)}function pf(e,t,r={}){return Oo(e)?J(UL(e,t),r):sr(e)?J(VL(e,t),r):J(Ot(e)?ose(e.anyOf,t):ac(e,t)!==X.False?Rt():e,r)}function ise(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=pf(e[n],t);return r}function sse(e,t){return ise(e.properties,t)}function VL(e,t){let r=sse(e,t);return vt(r)}p();p();p();function zL(e,t){return df(ku(e),t)}function ase(e,t){let r=e.filter(n=>ac(n,t)!==X.False);return r.length===1?r[0]:Nt(r)}function df(e,t,r){return Oo(e)?J(zL(e,t),r):sr(e)?J(HL(e,t),r):J(Ot(e)?ase(e.anyOf,t):ac(e,t)!==X.False?e:Rt(),r)}function lse(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=df(e[n],t);return r}function cse(e,t){return lse(e.properties,t)}function HL(e,t){let r=cse(e,t);return vt(r)}p();function WL(e,t){return J(e.returns,t)}p();function qL(e){return J({[W]:"Integer",type:"integer"},e)}p();p();p();function use(e,t,r){return{[e]:Bi(_t(e),t,nr(r))}}function pse(e,t,r){return e.reduce((o,i)=>({...o,...use(i,t,r)}),{})}function dse(e,t,r){return pse(e.keys,t,r)}function ZL(e,t,r){let n=dse(e,t,r);return vt(n)}function fse(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function mse(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function hse(e){return e.toUpperCase()}function yse(e){return e.toLowerCase()}function gse(e,t,r){let n=of(e.pattern);if(!Au(n))return{...e,pattern:XL(e.pattern,t)};let s=[...vy(n)].map(u=>_t(u)),a=YL(s,t),l=Nt(a);return nv([l],r)}function XL(e,t){return typeof e=="string"?t==="Uncapitalize"?fse(e):t==="Capitalize"?mse(e):t==="Uppercase"?hse(e):t==="Lowercase"?yse(e):e:e.toString()}function YL(e,t){return e.map(r=>Bi(r,t))}function Bi(e,t,r={}){return Mo(e)?ZL(e,t,r):Oo(e)?gse(e,t,r):Ot(e)?Nt(YL(e.anyOf,t),r):$a(e)?_t(XL(e.const,t),r):J(e,r)}function KL(e,t={}){return Bi(e,"Capitalize",t)}p();function JL(e,t={}){return Bi(e,"Lowercase",t)}p();function QL(e,t={}){return Bi(e,"Uncapitalize",t)}p();function eR(e,t={}){return Bi(e,"Uppercase",t)}p();function tR(e,t){return J({[W]:"Not",not:e},t)}p();p();p();function bse(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=ff(e[o],t,nr(r));return n}function vse(e,t,r){return bse(e.properties,t,r)}function rR(e,t,r){let n=vse(e,t,r);return vt(n)}function xse(e,t){return e.map(r=>OP(r,t))}function Ise(e,t){return e.map(r=>OP(r,t))}function Sse(e,t){let{[t]:r,...n}=e;return n}function Cse(e,t){return t.reduce((r,n)=>Sse(r,n),e)}function Pse(e,t){let r=Pr(e,[or,"$id","required","properties"]),n=Cse(e.properties,t);return Vt(n,r)}function OP(e,t){return Or(e)?fo(xse(e.allOf,t)):Ot(e)?Nt(Ise(e.anyOf,t)):jr(e)?Pse(e,t):Vt({})}function ff(e,t,r){if(Mo(t))return nR(e,t,r);if(sr(e))return rR(e,t,r);let n=Ri(t)?po(t):t;return J({...OP(e,n),...r})}function Tse(e,t,r){return{[t]:ff(e,[t],nr(r))}}function wse(e,t,r){return t.reduce((n,o)=>({...n,...Tse(e,o,r)}),{})}function Mse(e,t,r){return wse(e,t.keys,r)}function nR(e,t,r){let n=Mse(e,t,r);return vt(n)}p();function oR(e,t){return ks(e.parameters,t)}p();p();function iR(e){return e.map(t=>sR(t))}function Ose(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=uo(e[r]);return t}function Ese(e){let t=Pr(e,[or,"$id","required","properties"]),r=Ose(e.properties);return Vt(r,t)}function sR(e){return Or(e)?fo(iR(e.allOf)):Ot(e)?Nt(iR(e.anyOf)):jr(e)?Ese(e):Vt({})}function yv(e,t){return sr(e)?aR(e,t):J({...sR(e),...t})}function _se(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=yv(e[n],nr(t));return r}function Ase(e,t){return _se(e.properties,t)}function aR(e,t){let r=Ase(e,t);return vt(r)}p();p();p();function kse(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=mf(e[o],t,nr(r));return n}function Dse(e,t,r){return kse(e.properties,t,r)}function lR(e,t,r){let n=Dse(e,t,r);return vt(n)}function Fse(e,t){return e.map(r=>EP(r,t))}function Lse(e,t){return e.map(r=>EP(r,t))}function Rse(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}function Nse(e,t){let r=Pr(e,[or,"$id","required","properties"]),n=Rse(e.properties,t);return Vt(n,r)}function EP(e,t){return Or(e)?fo(Fse(e.allOf,t)):Ot(e)?Nt(Lse(e.anyOf,t)):jr(e)?Nse(e,t):Vt({})}function mf(e,t,r){if(Mo(t))return cR(e,t,r);if(sr(e))return lR(e,t,r);let n=Ri(t)?po(t):t;return J({...EP(e,n),...r})}function Bse(e,t,r){return{[t]:mf(e,[t],nr(r))}}function $se(e,t,r){return t.reduce((n,o)=>({...n,...Bse(e,o,r)}),{})}function jse(e,t,r){return $se(e,t.keys,r)}function cR(e,t,r){let n=jse(e,t,r);return vt(n)}p();function uR(e){return Qo(uo(e))}p();function Du(e,t,r){return J({[W]:"Record",type:"object",patternProperties:{[e]:t}},r)}function _P(e,t,r){let n={};for(let o of e)n[o]=t;return Vt(n,{...r,[Ko]:"Record"})}function Gse(e,t,r){return tv(e)?_P(po(e),t,r):Du(e.pattern,t,r)}function Use(e,t,r){return _P(po(Nt(e)),t,r)}function Vse(e,t,r){return _P([e.toString()],t,r)}function zse(e,t,r){return Du(e.source,t,r)}function Hse(e,t,r){let n=gr(e.pattern)?Ga:e.pattern;return Du(n,t,r)}function Wse(e,t,r){return Du(Ga,t,r)}function qse(e,t,r){return Du(tL,t,r)}function Zse(e,t,r){return Du(ja,t,r)}function Xse(e,t,r){return Du(ja,t,r)}function pR(e,t,r={}){return Ot(e)?Use(e.anyOf,t,r):Oo(e)?Gse(e,t,r):$a(e)?Vse(e.const,t,r):Ou(e)?Zse(e,t,r):Eu(e)?Xse(e,t,r):iP(e)?zse(e,t,r):fy(e)?Hse(e,t,r):eP(e)?Wse(e,t,r):rc(e)?qse(e,t,r):Rt(r)}p();var Yse=0;function dR(e,t={}){gr(t.$id)&&(t.$id="T".concat(Yse++));let r=ay(e({[W]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,J({[Ko]:"Recursive",...r},t)}p();function fR(e,t){if(Xt(e))return J({[W]:"Ref",$ref:e},t);if(gr(e.$id))throw new Error("Reference target type must specify an $id");return J({[W]:"Ref",$ref:e.$id},t)}p();function mR(e,t){let r=Xt(e)?new globalThis.RegExp(e):e;return J({[W]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}p();p();function hR(e){return e.map(t=>yR(t))}function Kse(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Pr(e[r],[zn]);return t}function Jse(e){let t=Pr(e,[or,"$id","required","properties"]),r=Kse(e.properties);return Vt(r,t)}function yR(e){return Or(e)?fo(hR(e.allOf)):Ot(e)?Nt(hR(e.anyOf)):jr(e)?Jse(e):Vt({})}function gv(e,t){return sr(e)?gR(e,t):J({...yR(e),...t})}function Qse(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=gv(e[n],t);return r}function eae(e,t){return Qse(e.properties,t)}function gR(e,t){let r=eae(e,t);return vt(r)}p();function tae(e){var t;return Or(e)?e.allOf:Ot(e)?e.anyOf:Li(e)?(t=e.items)!=null?t:[]:[]}function bR(e){return tae(e)}p();function vR(e,t){return J(e.returns,t)}p();function xR(e){return JSON.parse(JSON.stringify(e))}p();var AP=class{constructor(t){this.schema=t}Decode(t){return new kP(this.schema,t)}},kP=class{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let i={Encode:s=>r[or].Encode(t(s)),Decode:s=>this.decode(r[or].Decode(s))};return{...r,[or]:i}}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return{...r,[or]:n}}Encode(t){return Qd(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function IR(e){return new AP(e)}p();function bv(e={}){var t;return J({[W]:(t=e[W])!=null?t:"Unsafe"},e)}p();function SR(e){return J({[W]:"Void",type:"void"},e)}p();var DP={};Ul(DP,{Any:()=>oc,Array:()=>K0,AsyncIterator:()=>J0,Awaited:()=>SL,BigInt:()=>af,Boolean:()=>rv,Capitalize:()=>KL,Composite:()=>TL,Const:()=>wL,Constructor:()=>Q0,ConstructorParameters:()=>ML,Date:()=>lv,Deref:()=>Ni,Enum:()=>OL,Exclude:()=>pf,Extends:()=>uf,Extract:()=>df,Function:()=>ic,Index:()=>lf,InstanceType:()=>WL,Integer:()=>qL,Intersect:()=>fo,Iterator:()=>iv,KeyOf:()=>av,Literal:()=>_t,Lowercase:()=>JL,Mapped:()=>bL,Never:()=>Rt,Not:()=>tR,Null:()=>cv,Number:()=>As,Object:()=>Vt,Omit:()=>ff,Optional:()=>uo,Parameters:()=>oR,Partial:()=>yv,Pick:()=>mf,Promise:()=>sv,Readonly:()=>Qo,ReadonlyOptional:()=>uR,Record:()=>pR,Recursive:()=>dR,Ref:()=>fR,RegExp:()=>mR,Required:()=>gv,Rest:()=>bR,ReturnType:()=>vR,Strict:()=>xR,String:()=>Jo,Symbol:()=>uv,TemplateLiteral:()=>nv,Transform:()=>IR,Tuple:()=>ks,Uint8Array:()=>dv,Uncapitalize:()=>QL,Undefined:()=>pv,Union:()=>Nt,Unknown:()=>za,Unsafe:()=>bv,Uppercase:()=>eR,Void:()=>SR});p();var S=DP;var Kt=(e,t)=>S.Unsafe(S.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),Mn=Kt("g","GeometryId"),st=Kt("f","FloorId"),FP=[Mn,st];p();p();var Py=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."}),LP=S.Partial(Py,{$id:"Details",description:"Additional information about a given entity."}),$i=S.Object({details:S.Optional(S.Ref(LP))},{$id:"WithDetails"}),Fu=e=>{let t=[...e].sort(),r=S.Pick(Py,e),n=S.Omit(Py,e);return S.Object({details:S.Intersect([r,S.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},RP=[Py,LP];p();p();var NP=S.Record(S.String(),S.Unknown(),{$id:"Extra"}),ji=S.Object({extra:S.Optional(S.Ref(NP))}),BP=[NP];p();p();var hf=S.Object({geometryId:S.Ref(Mn),floorId:S.Ref(st)},{$id:"GeometryAnchor"}),rae=S.Object({geometryAnchor:S.Ref(hf)}),Lu=(e,t)=>S.Object({geometryAnchors:S.Array(S.Ref(hf),e)},t),$P=[hf];p();p();p();p();p();var yf=S.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),gf=S.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Ru=S.Tuple([S.Ref(yf),S.Ref(gf)],{$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(Ru)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),vv=S.Object({type:S.Literal("MultiPoint"),coordinates:S.Array(S.Ref(Ru))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),xv=S.Object({type:S.Literal("LineString"),coordinates:S.Array(S.Ref(Ru),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Iv=S.Object({type:S.Literal("MultiLineString"),coordinates:S.Array(S.Array(S.Ref(Ru),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),CR=S.Array(S.Ref(Ru),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),jP=S.Array(S.Ref(CR),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),bf=S.Object({type:S.Literal("Polygon"),coordinates:S.Ref(jP)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),vf=S.Object({type:S.Literal("MultiPolygon"),coordinates:S.Array(S.Ref(jP))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),ln=(e,t,r)=>S.Object({type:S.Literal("Feature"),geometry:e,properties:t},r),Wn=(e,t,r)=>S.Object({type:S.Literal("FeatureCollection"),features:S.Array(e,r)},t),GP=[yf,gf,Ru,On,vv,xv,Iv,CR,jP,bf,vf];var PR=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."}))}),$i],{$id:"FloorProperties"}),TR=ln(S.Union([S.Ref(bf),S.Ref(vf),S.Null()]),S.Ref(PR),{$id:"FloorFeature"}),wR=Wn(S.Ref(TR),{$id:"FloorCollection"}),nae=S.Object({floors:S.Ref(wR)}),MR={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:nae,references:[PR,TR,wR]};p();p();p();var Sv=class{constructor(t){m(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}},Cv=class{constructor(t){m(this,"_tag","Some");m(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return OR(t(this.value))}mapAsync(t){return t(this.value).then(r=>OR(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:lc()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?lc():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return ue(this.value)}okOrElse(t){return ue(this.value)}iter(){return new Sv(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?xf([this.value,t.value]):lc()}zipWith(t,r){return t.isSome()?xf(r(this.value,t.value)):lc()}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="Some"}get[Symbol.toStringTag](){return"Some"}},Pv=class{constructor(){m(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return ye(t)}okOrElse(t){return ye(t())}iter(){return new Sv(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="None"}get[Symbol.toStringTag](){return"None"}},xf=e=>new Cv(e),lc=()=>new Pv,OR=e=>e instanceof Cv||e instanceof Pv?e:e==null?lc():xf(e);var Tv=class{constructor(t){m(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}},UP=class{constructor(t){m(this,"_tag","Ok");m(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return xf(this.value)}err(){return lc()}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 ue(t(this.value))}async mapAsync(t){return t(this.value).then(ue)}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 Tv(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,")")}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="Ok"}get[Symbol.toStringTag](){return"Ok"}},VP=class e{constructor(t){m(this,"_tag","Err");m(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return lc()}err(){return xf(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 Tv(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,")")}static[Symbol.hasInstance](t){let r=t;return r!=null&&r._tag==="Err"}get[Symbol.toStringTag](){return"Err"}},ue=e=>new UP(e),ye=e=>new VP(e);p();var Ds;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Ds||(Ds={}));var oae=e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},Wa=e=>{let t=oae(e);return n=>{let o=t.get(n);return o==null?ye({kind:Ds.UnknownFloorError,properties:{floorId:n}}):ue(o)}};p();p();p();p();var pr=e=>S.Unsafe(e);p();var Je=e=>Object.keys(e);p();var ER=e=>{if(e.floors==null)return ye({kind:Ds.FloorMissingError,properties:null});if(e.geometry==null)return ye({kind:Ds.GeometryMissingError,properties:null});let t=Wa(e);for(let r of Je(e.geometry)){let n=t(r);if(n.isErr())return n}return ue(!0)};var _R=S.Intersect([S.Object({id:S.Ref(Mn)}),$i],{$id:"GeometryProperties"}),AR=ln(S.Union([S.Ref(On),S.Ref(vv),S.Ref(xv),S.Ref(Iv),S.Ref(bf),S.Ref(vf)]),S.Ref(_R),{$id:"GeometryFeature"}),kR=Wn(S.Ref(AR),{$id:"GeometryCollection"}),iae=S.Object({geometry:pr(S.Record(st,S.Ref(kR),{additionalProperties:!1}))},{$id:"GeometrySchema"}),sae=/^geometry\/(.*)\.geojson$/,DR={name:"core:geometry",schema:iae,intoBundle:function*(e){if(e.geometry!=null)for(let t of Je(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(sae))==null?void 0:o[1];if(n)return{geometry:{[n]:r(t)}}},references:[_R,AR,kR],integrityCheck:ER};p();p();var xt=e=>Object.entries(e);var aae=e=>{var r;let t=new Map;for(let[n,o]of xt((r=e.geometry)!=null?r:{}))t.set(n,new Map(o==null?void 0:o.features.map(i=>[i.properties.id,i])));return t},Er=e=>{let t=aae(e);return(n,o)=>{let i=t.get(n);if(i==null)return ye({kind:Ds.UnknownFloorError,properties:{floorId:n}});let s=i.get(o);return s==null?ye({kind:Ds.UnknownGeometryError,properties:{floorId:n,geometryId:o}}):ue(s)}};p();var zP=S.Object({type:S.Literal("file"),name:S.String({description:"The name of the file."})},{$id:"ManifestFile"}),FR=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(zP)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),LR=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(FR),S.Ref(zP)]),{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"}),RR=Wn(ln(On,S.Ref(LR)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),lae=S.Object({manifest:S.Ref(RR)}),NR={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:lae,references:[zP,FR,LR,RR]};var ho=S.Object({geometryId:S.Ref(Mn)},{$id:"WithGeometryId"}),wv=S.Object({geometryIds:S.Array(S.Ref(Mn))},{$id:"WithGeometryIds"}),HP=[ho,wv];p();p();var BR=(e,t)=>S.Unsafe(S.Transform(S.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),yo=(e,t)=>{let r=BR(e,t),n=[...e,"unknown"],o=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:r,values:n,record:o}};p();p();p();var Ty;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(Ty||(Ty={}));var $R=e=>{var n;if(e.annotations==null)return ue(!0);let t=Er(e),r=new Set(Je((n=e.annotationSymbols)!=null?n:{}));for(let o of Je(e.annotations)){let i=e.annotations[o];if(i!=null)for(let s of i){if(!r.has(s.symbolKey))return ye({kind:Ty.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 ye({kind:Ty.AnnotationNonPointGeometryError,properties:{annotationId:s.id,floorId:o,geometryId:s.geometryId}})}}return ue(!0)};var jR=Kt("a","AnnotationId"),WP=S.Intersect([ho,S.Object({id:S.Ref(jR,{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"}),GR=S.Object({url:S.String({format:"uri",description:"The URL for the symbol."}),name:S.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),cae=S.Object({annotations:pr(S.Record(st,S.Array(S.Ref(WP)),{additionalProperties:!1})),annotationSymbols:pr(S.Record(S.Index(WP,["symbolKey"]),S.Ref(GR)))},{$id:"AnnotationsSchema"}),uae=/^annotations\/(.*)\.json$/,UR={name:"ext:mvf-annotations",schema:cae,intoBundle:function*(e){if(e.annotations!=null)for(let t of Je(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(uae))==null?void 0:o[1];if(n)return{annotations:{[n]:r(t)}}},references:[jR,WP,GR],integrityCheck:$R};p();p();p();p();p();p();var qP=class extends Ae{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}},wy=class extends Ae{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}},Mv;(function(e){function t(n,o){if(Gr.Has(n))throw new qP(n);return Gr.Set(n,o),(i={})=>bv({...i,[W]:n})}e.Type=t;function r(n,o){if(Hn.Has(n))throw new wy(n);return Hn.Set(n,o),n}e.Format=r})(Mv||(Mv={}));p();p();p();function pae(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[W],"'");default:return"Unknown error type"}}var dae=pae;function VR(){return dae}p();var ZP=class extends Ae{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};function fae(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new ZP(e);return It(r,t)}function ni(e,t){return!dt(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function It(e,t){return e[W]==="This"||e[W]==="Ref"?fae(e,t):e}p();var XP=class extends Ae{constructor(t){super("Unable to hash value"),this.value=t}},Eo;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Eo||(Eo={}));var If=BigInt("14695981039346656037"),[mae,hae]=[BigInt("1099511628211"),BigInt("18446744073709551616")],yae=Array.from({length:256}).map((e,t)=>BigInt(t)),zR=new Float64Array(1),HR=new DataView(zR.buffer),WR=new Uint8Array(zR.buffer);function*gae(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 bae(e){En(Eo.Array);for(let t of e)Sf(t)}function vae(e){En(Eo.Boolean),En(e?1:0)}function xae(e){En(Eo.BigInt),HR.setBigInt64(0,e);for(let t of WR)En(t)}function Iae(e){En(Eo.Date),Sf(e.getTime())}function Sae(e){En(Eo.Null)}function Cae(e){En(Eo.Number),HR.setFloat64(0,e);for(let t of WR)En(t)}function Pae(e){En(Eo.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Sf(t),Sf(e[t])}function Tae(e){En(Eo.String);for(let t=0;t<e.length;t++)for(let r of gae(e.charCodeAt(t)))En(r)}function wae(e){En(Eo.Symbol),Sf(e.description)}function Mae(e){En(Eo.Uint8Array);for(let t=0;t<e.length;t++)En(e[t])}function Oae(e){return En(Eo.Undefined)}function Sf(e){if(Ge(e))return bae(e);if(Os(e))return vae(e);if(sn(e))return xae(e);if(Vn(e))return Iae(e);if(La(e))return Sae(e);if(we(e))return Cae(e);if(ze(e))return Pae(e);if(dt(e))return Tae(e);if(Ra(e))return wae(e);if(Jd(e))return Mae(e);if(br(e))return Oae(e);throw new XP(e)}function En(e){If=If^yae[e],If=If*mae%hae}function cc(e){return If=BigInt("14695981039346656037"),Sf(e),If}p();var YP=class extends Ae{constructor(t){super("Unknown type"),this.schema=t}};function Eae(e){return e[W]==="Any"||e[W]==="Unknown"}function rt(e){return e!==void 0}function _ae(e,t,r){return!0}function Aae(e,t,r){if(!Ge(r)||rt(e.minItems)&&!(r.length>=e.minItems)||rt(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>cn(e.items,t,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let s of r){let a=cc(s);if(i.has(a))return!1;i.add(a)}return!0}())return!1;if(!(rt(e.contains)||we(e.minContains)||we(e.maxContains)))return!0;let n=rt(e.contains)?e.contains:Rt(),o=r.reduce((i,s)=>cn(n,t,s)?i+1:i,0);return!(o===0||we(e.minContains)&&o<e.minContains||we(e.maxContains)&&o>e.maxContains)}function kae(e,t,r){return q0(r)}function Dae(e,t,r){return!(!sn(r)||rt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||rt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||rt(e.maximum)&&!(r<=e.maximum)||rt(e.minimum)&&!(r>=e.minimum)||rt(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function Fae(e,t,r){return Os(r)}function Lae(e,t,r){return cn(e.returns,t,r.prototype)}function Rae(e,t,r){return!(!Vn(r)||rt(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||rt(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||rt(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||rt(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||rt(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function Nae(e,t,r){return tc(r)}function Bae(e,t,r){return!(!Y0(r)||rt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||rt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||rt(e.maximum)&&!(r<=e.maximum)||rt(e.minimum)&&!(r>=e.minimum)||rt(e.multipleOf)&&r%e.multipleOf!==0)}function $ae(e,t,r){let n=e.allOf.every(o=>cn(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(Va(e)),i=Object.getOwnPropertyNames(r).every(s=>o.test(s));return n&&i}else if(ft(e.unevaluatedProperties)){let o=new RegExp(Va(e)),i=Object.getOwnPropertyNames(r).every(s=>o.test(s)||cn(e.unevaluatedProperties,t,r[s]));return n&&i}else return n}function jae(e,t,r){return Z0(r)}function Gae(e,t,r){return r===e.const}function Uae(e,t,r){return!1}function Vae(e,t,r){return!cn(e.not,t,r)}function zae(e,t,r){return La(r)}function Hae(e,t,r){return!(!Dt.IsNumberLike(r)||rt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||rt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||rt(e.minimum)&&!(r>=e.minimum)||rt(e.maximum)&&!(r<=e.maximum)||rt(e.multipleOf)&&r%e.multipleOf!==0)}function Wae(e,t,r){if(!Dt.IsObjectLike(r)||rt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||rt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let o of n){let i=e.properties[o];if(e.required&&e.required.includes(o)){if(!cn(i,t,r[o])||(Ha(i)||Eae(i))&&!(o in r))return!1}else if(Dt.IsExactOptionalProperty(r,o)&&!cn(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)||cn(e.additionalProperties,t,r[i])):!0}function qae(e,t,r){return X0(r)}function Zae(e,t,r){if(!Dt.IsRecordLike(r)||rt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||rt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),s=Object.entries(r).every(([u,d])=>i.test(u)?cn(o,t,d):!0),a=typeof e.additionalProperties=="object"?Object.entries(r).every(([u,d])=>i.test(u)?!0:cn(e.additionalProperties,t,d)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(u=>i.test(u)):!0;return s&&a&&l}function Xae(e,t,r){return cn(It(e,t),t,r)}function Yae(e,t,r){let n=new RegExp(e.source,e.flags);return rt(e.minLength)&&!(r.length>=e.minLength)||rt(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}function Kae(e,t,r){return!dt(r)||rt(e.minLength)&&!(r.length>=e.minLength)||rt(e.maxLength)&&!(r.length<=e.maxLength)||rt(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:rt(e.format)?Hn.Has(e.format)?Hn.Get(e.format)(r):!1:!0}function Jae(e,t,r){return Ra(r)}function Qae(e,t,r){return dt(r)&&new RegExp(e.pattern).test(r)}function ele(e,t,r){return cn(It(e,t),t,r)}function tle(e,t,r){if(!Ge(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(!cn(e.items[n],t,r[n]))return!1;return!0}function rle(e,t,r){return br(r)}function nle(e,t,r){return e.anyOf.some(n=>cn(n,t,r))}function ole(e,t,r){return!(!Jd(r)||rt(e.maxByteLength)&&!(r.length<=e.maxByteLength)||rt(e.minByteLength)&&!(r.length>=e.minByteLength))}function ile(e,t,r){return!0}function sle(e,t,r){return Dt.IsVoidLike(r)}function ale(e,t,r){return Gr.Has(e[W])?Gr.Get(e[W])(e,r):!1}function cn(e,t,r){let n=rt(e.$id)?[...t,e]:t,o=e;switch(o[W]){case"Any":return _ae(o,n,r);case"Array":return Aae(o,n,r);case"AsyncIterator":return kae(o,n,r);case"BigInt":return Dae(o,n,r);case"Boolean":return Fae(o,n,r);case"Constructor":return Lae(o,n,r);case"Date":return Rae(o,n,r);case"Function":return Nae(o,n,r);case"Integer":return Bae(o,n,r);case"Intersect":return $ae(o,n,r);case"Iterator":return jae(o,n,r);case"Literal":return Gae(o,n,r);case"Never":return Uae(o,n,r);case"Not":return Vae(o,n,r);case"Null":return zae(o,n,r);case"Number":return Hae(o,n,r);case"Object":return Wae(o,n,r);case"Promise":return qae(o,n,r);case"Record":return Zae(o,n,r);case"Ref":return Xae(o,n,r);case"RegExp":return Yae(o,n,r);case"String":return Kae(o,n,r);case"Symbol":return Jae(o,n,r);case"TemplateLiteral":return Qae(o,n,r);case"This":return ele(o,n,r);case"Tuple":return tle(o,n,r);case"Undefined":return rle(o,n,r);case"Union":return nle(o,n,r);case"Uint8Array":return ole(o,n,r);case"Unknown":return ile(o,n,r);case"Void":return sle(o,n,r);default:if(!Gr.Has(o[W]))throw new YP(o);return ale(o,n,r)}}function Qe(...e){return e.length===3?cn(e[0],e[1],e[2]):cn(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 KP=class extends Ae{constructor(t){super("Unknown type"),this.schema=t}};function qa(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function nt(e){return e!==void 0}var oi=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 ce(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:VR()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}function*lle(e,t,r,n){}function*cle(e,t,r,n){if(!Ge(n))return yield ce(q.Array,e,r,n);nt(e.minItems)&&!(n.length>=e.minItems)&&(yield ce(q.ArrayMinItems,e,r,n)),nt(e.maxItems)&&!(n.length<=e.maxItems)&&(yield ce(q.ArrayMaxItems,e,r,n));for(let s=0;s<n.length;s++)yield*un(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=cc(a);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield ce(q.ArrayUniqueItems,e,r,n)),!(nt(e.contains)||nt(e.minContains)||nt(e.maxContains)))return;let o=nt(e.contains)?e.contains:Rt(),i=n.reduce((s,a,l)=>un(o,t,"".concat(r).concat(l),a).next().done===!0?s+1:s,0);i===0&&(yield ce(q.ArrayContains,e,r,n)),we(e.minContains)&&i<e.minContains&&(yield ce(q.ArrayMinContains,e,r,n)),we(e.maxContains)&&i>e.maxContains&&(yield ce(q.ArrayMaxContains,e,r,n))}function*ule(e,t,r,n){q0(n)||(yield ce(q.AsyncIterator,e,r,n))}function*ple(e,t,r,n){if(!sn(n))return yield ce(q.BigInt,e,r,n);nt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ce(q.BigIntExclusiveMaximum,e,r,n)),nt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ce(q.BigIntExclusiveMinimum,e,r,n)),nt(e.maximum)&&!(n<=e.maximum)&&(yield ce(q.BigIntMaximum,e,r,n)),nt(e.minimum)&&!(n>=e.minimum)&&(yield ce(q.BigIntMinimum,e,r,n)),nt(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield ce(q.BigIntMultipleOf,e,r,n))}function*dle(e,t,r,n){Os(n)||(yield ce(q.Boolean,e,r,n))}function*fle(e,t,r,n){yield*un(e.returns,t,r,n.prototype)}function*mle(e,t,r,n){if(!Vn(n))return yield ce(q.Date,e,r,n);nt(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield ce(q.DateExclusiveMaximumTimestamp,e,r,n)),nt(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield ce(q.DateExclusiveMinimumTimestamp,e,r,n)),nt(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield ce(q.DateMaximumTimestamp,e,r,n)),nt(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield ce(q.DateMinimumTimestamp,e,r,n)),nt(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield ce(q.DateMultipleOfTimestamp,e,r,n))}function*hle(e,t,r,n){tc(n)||(yield ce(q.Function,e,r,n))}function*yle(e,t,r,n){if(!Y0(n))return yield ce(q.Integer,e,r,n);nt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ce(q.IntegerExclusiveMaximum,e,r,n)),nt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ce(q.IntegerExclusiveMinimum,e,r,n)),nt(e.maximum)&&!(n<=e.maximum)&&(yield ce(q.IntegerMaximum,e,r,n)),nt(e.minimum)&&!(n>=e.minimum)&&(yield ce(q.IntegerMinimum,e,r,n)),nt(e.multipleOf)&&n%e.multipleOf!==0&&(yield ce(q.IntegerMultipleOf,e,r,n))}function*gle(e,t,r,n){let o=!1;for(let i of e.allOf)for(let s of un(i,t,r,n))o=!0,yield s;if(o)return yield ce(q.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let i=new RegExp(Va(e));for(let s of Object.getOwnPropertyNames(n))i.test(s)||(yield ce(q.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(s),n))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(Va(e));for(let s of Object.getOwnPropertyNames(n))if(!i.test(s)){let a=un(e.unevaluatedProperties,t,"".concat(r,"/").concat(s),n[s]).next();a.done||(yield a.value)}}}function*ble(e,t,r,n){Z0(n)||(yield ce(q.Iterator,e,r,n))}function*vle(e,t,r,n){n!==e.const&&(yield ce(q.Literal,e,r,n))}function*xle(e,t,r,n){yield ce(q.Never,e,r,n)}function*Ile(e,t,r,n){un(e.not,t,r,n).next().done===!0&&(yield ce(q.Not,e,r,n))}function*Sle(e,t,r,n){La(n)||(yield ce(q.Null,e,r,n))}function*Cle(e,t,r,n){if(!Dt.IsNumberLike(n))return yield ce(q.Number,e,r,n);nt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ce(q.NumberExclusiveMaximum,e,r,n)),nt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ce(q.NumberExclusiveMinimum,e,r,n)),nt(e.maximum)&&!(n<=e.maximum)&&(yield ce(q.NumberMaximum,e,r,n)),nt(e.minimum)&&!(n>=e.minimum)&&(yield ce(q.NumberMinimum,e,r,n)),nt(e.multipleOf)&&n%e.multipleOf!==0&&(yield ce(q.NumberMultipleOf,e,r,n))}function*Ple(e,t,r,n){if(!Dt.IsObjectLike(n))return yield ce(q.Object,e,r,n);nt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ce(q.ObjectMinProperties,e,r,n)),nt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ce(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 ce(q.ObjectRequiredProperty,e.properties[a],"".concat(r,"/").concat(qa(a)),void 0));if(e.additionalProperties===!1)for(let a of s)i.includes(a)||(yield ce(q.ObjectAdditionalProperties,e,"".concat(r,"/").concat(qa(a)),n[a]));if(typeof e.additionalProperties=="object")for(let a of s)i.includes(a)||(yield*un(e.additionalProperties,t,"".concat(r,"/").concat(qa(a)),n[a]));for(let a of i){let l=e.properties[a];e.required&&e.required.includes(a)?(yield*un(l,t,"".concat(r,"/").concat(qa(a)),n[a]),Ha(e)&&!(a in n)&&(yield ce(q.ObjectRequiredProperty,l,"".concat(r,"/").concat(qa(a)),void 0))):Dt.IsExactOptionalProperty(n,a)&&(yield*un(l,t,"".concat(r,"/").concat(qa(a)),n[a]))}}function*Tle(e,t,r,n){X0(n)||(yield ce(q.Promise,e,r,n))}function*wle(e,t,r,n){if(!Dt.IsRecordLike(n))return yield ce(q.Object,e,r,n);nt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ce(q.ObjectMinProperties,e,r,n)),nt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ce(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*un(i,t,"".concat(r,"/").concat(qa(a)),l));if(typeof e.additionalProperties=="object")for(let[a,l]of Object.entries(n))s.test(a)||(yield*un(e.additionalProperties,t,"".concat(r,"/").concat(qa(a)),l));if(e.additionalProperties===!1){for(let[a,l]of Object.entries(n))if(!s.test(a))return yield ce(q.ObjectAdditionalProperties,e,"".concat(r,"/").concat(qa(a)),l)}}function*Mle(e,t,r,n){yield*un(It(e,t),t,r,n)}function*Ole(e,t,r,n){if(!dt(n))return yield ce(q.String,e,r,n);if(nt(e.minLength)&&!(n.length>=e.minLength)&&(yield ce(q.StringMinLength,e,r,n)),nt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ce(q.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield ce(q.RegExp,e,r,n)}function*Ele(e,t,r,n){if(!dt(n))return yield ce(q.String,e,r,n);nt(e.minLength)&&!(n.length>=e.minLength)&&(yield ce(q.StringMinLength,e,r,n)),nt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ce(q.StringMaxLength,e,r,n)),dt(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield ce(q.StringPattern,e,r,n))),dt(e.format)&&(Hn.Has(e.format)?Hn.Get(e.format)(n)||(yield ce(q.StringFormat,e,r,n)):yield ce(q.StringFormatUnknown,e,r,n))}function*_le(e,t,r,n){Ra(n)||(yield ce(q.Symbol,e,r,n))}function*Ale(e,t,r,n){if(!dt(n))return yield ce(q.String,e,r,n);new RegExp(e.pattern).test(n)||(yield ce(q.StringPattern,e,r,n))}function*kle(e,t,r,n){yield*un(It(e,t),t,r,n)}function*Dle(e,t,r,n){if(!Ge(n))return yield ce(q.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield ce(q.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield ce(q.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*un(e.items[o],t,"".concat(r,"/").concat(o),n[o])}function*Fle(e,t,r,n){br(n)||(yield ce(q.Undefined,e,r,n))}function*Lle(e,t,r,n){if(Qe(e,t,n))return;let o=e.anyOf.map(i=>new oi(un(i,t,r,n)));yield ce(q.Union,e,r,n,o)}function*Rle(e,t,r,n){if(!Jd(n))return yield ce(q.Uint8Array,e,r,n);nt(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield ce(q.Uint8ArrayMaxByteLength,e,r,n)),nt(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield ce(q.Uint8ArrayMinByteLength,e,r,n))}function*Nle(e,t,r,n){}function*Ble(e,t,r,n){Dt.IsVoidLike(n)||(yield ce(q.Void,e,r,n))}function*$le(e,t,r,n){Gr.Get(e[W])(e,n)||(yield ce(q.Kind,e,r,n))}function*un(e,t,r,n){let o=nt(e.$id)?[...t,e]:t,i=e;switch(i[W]){case"Any":return yield*lle(i,o,r,n);case"Array":return yield*cle(i,o,r,n);case"AsyncIterator":return yield*ule(i,o,r,n);case"BigInt":return yield*ple(i,o,r,n);case"Boolean":return yield*dle(i,o,r,n);case"Constructor":return yield*fle(i,o,r,n);case"Date":return yield*mle(i,o,r,n);case"Function":return yield*hle(i,o,r,n);case"Integer":return yield*yle(i,o,r,n);case"Intersect":return yield*gle(i,o,r,n);case"Iterator":return yield*ble(i,o,r,n);case"Literal":return yield*vle(i,o,r,n);case"Never":return yield*xle(i,o,r,n);case"Not":return yield*Ile(i,o,r,n);case"Null":return yield*Sle(i,o,r,n);case"Number":return yield*Cle(i,o,r,n);case"Object":return yield*Ple(i,o,r,n);case"Promise":return yield*Tle(i,o,r,n);case"Record":return yield*wle(i,o,r,n);case"Ref":return yield*Mle(i,o,r,n);case"RegExp":return yield*Ole(i,o,r,n);case"String":return yield*Ele(i,o,r,n);case"Symbol":return yield*_le(i,o,r,n);case"TemplateLiteral":return yield*Ale(i,o,r,n);case"This":return yield*kle(i,o,r,n);case"Tuple":return yield*Dle(i,o,r,n);case"Undefined":return yield*Fle(i,o,r,n);case"Union":return yield*Lle(i,o,r,n);case"Uint8Array":return yield*Rle(i,o,r,n);case"Unknown":return yield*Nle(i,o,r,n);case"Void":return yield*Ble(i,o,r,n);default:if(!Gr.Has(i[W]))throw new KP(e);return yield*$le(i,o,r,n)}}function Fs(...e){let t=e.length===3?un(e[0],e[1],"",e[2]):un(e[0],[],"",e[1]);return new oi(t)}p();var jle=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},ZR=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)},JP,Ov,XR,QP=class extends Ae{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),JP.add(this),Ov.set(this,void 0),jle(this,Ov,t,"f"),this.error=r}Errors(){return new oi(ZR(this,JP,"m",XR).call(this))}};Ov=new WeakMap,JP=new WeakSet,XR=function*(){this.error&&(yield this.error),yield*ZR(this,Ov,"f")};function qR(e,t,r){if(!Qe(e,t,r))throw new QP(Fs(e,t,r))}function Ev(...e){return e.length===3?qR(e[0],e[1],e[2]):qR(e[0],[],e[1])}p();p();p();function Gle(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=St(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=St(e[r]);return t}function Ule(e){return e.map(t=>St(t))}function Vle(e){return e.slice()}function zle(e){return new Map(St([...e.entries()]))}function Hle(e){return new Set(St([...e.entries()]))}function Wle(e){return new Date(e.toISOString())}function St(e){if(Ge(e))return Ule(e);if(Vn(e))return Wle(e);if(Yo(e))return Vle(e);if(mF(e))return zle(e);if(hF(e))return Hle(e);if(ze(e))return Gle(e);if(an(e))return e;throw new Error("ValueClone: Unable to clone value")}var _o=class extends Ae{constructor(t,r){super(r),this.schema=t}};function Ct(e){return tc(e)?e():St(e)}function qle(e,t){return Fe(e,"default")?Ct(e.default):{}}function Zle(e,t){if(e.uniqueItems===!0&&!Fe(e,"default"))throw new _o(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!Fe(e,"default"))throw new _o(e,"Array with the contains constraint requires a default value");return"default"in e?Ct(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>Ao(e.items,t)):[]}function Xle(e,t){return Fe(e,"default")?Ct(e.default):async function*(){}()}function Yle(e,t){return Fe(e,"default")?Ct(e.default):BigInt(0)}function Kle(e,t){return Fe(e,"default")?Ct(e.default):!1}function Jle(e,t){if(Fe(e,"default"))return Ct(e.default);{let r=Ao(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 Qle(e,t){return Fe(e,"default")?Ct(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function ece(e,t){return Fe(e,"default")?Ct(e.default):()=>Ao(e.returns,t)}function tce(e,t){return Fe(e,"default")?Ct(e.default):e.minimum!==void 0?e.minimum:0}function rce(e,t){if(Fe(e,"default"))return Ct(e.default);{let r=e.allOf.reduce((n,o)=>{let i=Ao(o,t);return typeof i=="object"?{...n,...i}:i},{});if(!Qe(e,t,r))throw new _o(e,"Intersect produced invalid value. Consider using a default value.");return r}}function nce(e,t){return Fe(e,"default")?Ct(e.default):function*(){}()}function oce(e,t){return Fe(e,"default")?Ct(e.default):e.const}function ice(e,t){if(Fe(e,"default"))return Ct(e.default);throw new _o(e,"Never types cannot be created. Consider using a default value.")}function sce(e,t){if(Fe(e,"default"))return Ct(e.default);throw new _o(e,"Not types must have a default value")}function ace(e,t){return Fe(e,"default")?Ct(e.default):null}function lce(e,t){return Fe(e,"default")?Ct(e.default):e.minimum!==void 0?e.minimum:0}function cce(e,t){if(Fe(e,"default"))return Ct(e.default);{let r=new Set(e.required),n={};for(let[o,i]of Object.entries(e.properties))r.has(o)&&(n[o]=Ao(i,t));return n}}function uce(e,t){return Fe(e,"default")?Ct(e.default):Promise.resolve(Ao(e.item,t))}function pce(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(Fe(e,"default"))return Ct(e.default);if(r===Ga||r===ja)return{};{let o=r.slice(1,r.length-1).split("|"),i={};for(let s of o)i[s]=Ao(n,t);return i}}function dce(e,t){return Fe(e,"default")?Ct(e.default):Ao(It(e,t),t)}function fce(e,t){if(Fe(e,"default"))return Ct(e.default);throw new _o(e,"RegExp types cannot be created. Consider using a default value.")}function mce(e,t){if(e.pattern!==void 0){if(Fe(e,"default"))return Ct(e.default);throw new _o(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(Fe(e,"default"))return Ct(e.default);throw new _o(e,"String types with formats must specify a default value")}else return Fe(e,"default")?Ct(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function hce(e,t){return Fe(e,"default")?Ct(e.default):"value"in e?Symbol.for(e.value):Symbol()}function yce(e,t){if(Fe(e,"default"))return Ct(e.default);if(!tv(e))throw new _o(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return sf(e)[0]}function gce(e,t){if(YR++>Tce)throw new _o(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Fe(e,"default")?Ct(e.default):Ao(It(e,t),t)}function bce(e,t){return Fe(e,"default")?Ct(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>Ao(e.items[n],t))}function vce(e,t){if(Fe(e,"default"))return Ct(e.default)}function xce(e,t){if(Fe(e,"default"))return Ct(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return Ao(e.anyOf[0],t)}function Ice(e,t){return Fe(e,"default")?Ct(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function Sce(e,t){return Fe(e,"default")?Ct(e.default):{}}function Cce(e,t){if(Fe(e,"default"))return Ct(e.default)}function Pce(e,t){if(Fe(e,"default"))return Ct(e.default);throw new Error("User defined types must specify a default value")}function Ao(e,t){let r=ni(e,t),n=e;switch(n[W]){case"Any":return qle(n,r);case"Array":return Zle(n,r);case"AsyncIterator":return Xle(n,r);case"BigInt":return Yle(n,r);case"Boolean":return Kle(n,r);case"Constructor":return Jle(n,r);case"Date":return Qle(n,r);case"Function":return ece(n,r);case"Integer":return tce(n,r);case"Intersect":return rce(n,r);case"Iterator":return nce(n,r);case"Literal":return oce(n,r);case"Never":return ice(n,r);case"Not":return sce(n,r);case"Null":return ace(n,r);case"Number":return lce(n,r);case"Object":return cce(n,r);case"Promise":return uce(n,r);case"Record":return pce(n,r);case"Ref":return dce(n,r);case"RegExp":return fce(n,r);case"String":return mce(n,r);case"Symbol":return hce(n,r);case"TemplateLiteral":return yce(n,r);case"This":return gce(n,r);case"Tuple":return bce(n,r);case"Undefined":return vce(n,r);case"Union":return xce(n,r);case"Uint8Array":return Ice(n,r);case"Unknown":return Sce(n,r);case"Void":return Cce(n,r);default:if(!Gr.Has(n[W]))throw new _o(n,"Unknown type");return Pce(n,r)}}var Tce=512,YR=0;function ii(...e){return YR=0,e.length===2?Ao(e[0],e[1]):Ao(e[0],[])}var _v=class extends Ae{constructor(t,r){super(r),this.schema=t}};function wce(e,t,r){if(e[W]==="Object"&&typeof r=="object"&&!La(r)){let n=e,o=Object.getOwnPropertyNames(r),i=Object.entries(n.properties),[s,a]=[1/i.length,i.length];return i.reduce((l,[u,d])=>{let f=d[W]==="Literal"&&d.const===r[u]?a:0,h=Qe(d,t,r[u])?s:0,b=o.includes(u)?s:0;return l+(f+h+b)},0)}else return Qe(e,t,r)?1:0}function Mce(e,t,r){let n=e.anyOf.map(s=>It(s,t)),[o,i]=[n[0],0];for(let s of n){let a=wce(s,t,r);a>i&&(o=s,i=a)}return o}function Oce(e,t,r){if("default"in e)return typeof r=="function"?e.default:St(e.default);{let n=Mce(e,t,r);return eT(n,t,r)}}function Ece(e,t,r){return Qe(e,t,r)?St(r):ii(e,t)}function _ce(e,t,r){return Qe(e,t,r)?r:ii(e,t)}function Ace(e,t,r){if(Qe(e,t,r))return St(r);let n=Ge(r)?St(r):ii(e,t),o=we(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,s=(we(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(l=>Ls(e.items,t,l));if(e.uniqueItems!==!0)return s;let a=[...new Set(s)];if(!Qe(e,t,a))throw new _v(e,"Array cast produced invalid data due to uniqueItems constraint");return a}function kce(e,t,r){if(Qe(e,t,r))return ii(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]=Ls(s,t,r.prototype[i]));return o}function Dce(e,t,r){let n=ii(e,t),o=ze(n)&&ze(r)?{...n,...r}:r;return Qe(e,t,o)?o:ii(e,t)}function Fce(e,t,r){throw new _v(e,"Never types cannot be cast")}function Lce(e,t,r){if(Qe(e,t,r))return r;if(r===null||typeof r!="object")return ii(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]=Ls(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]=Ls(e.additionalProperties,t,r[s]))}return o}function Rce(e,t,r){if(Qe(e,t,r))return St(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return ii(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n],i={};for(let[s,a]of Object.entries(r))i[s]=Ls(o,t,a);return i}function Nce(e,t,r){return Ls(It(e,t),t,r)}function Bce(e,t,r){return Ls(It(e,t),t,r)}function $ce(e,t,r){return Qe(e,t,r)?St(r):Ge(r)?e.items===void 0?[]:e.items.map((n,o)=>Ls(n,t,r[o])):ii(e,t)}function jce(e,t,r){return Qe(e,t,r)?St(r):Oce(e,t,r)}function Ls(e,t,r){let n=dt(e.$id)?[...t,e]:t,o=e;switch(e[W]){case"Array":return Ace(o,n,r);case"Constructor":return kce(o,n,r);case"Intersect":return Dce(o,n,r);case"Never":return Fce(o,n,r);case"Object":return Lce(o,n,r);case"Record":return Rce(o,n,r);case"Ref":return Nce(o,n,r);case"This":return Bce(o,n,r);case"Tuple":return $ce(o,n,r);case"Union":return jce(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Ece(e,t,r);default:return _ce(o,n,r)}}function eT(...e){return e.length===3?Ls(e[0],e[1],e[2]):Ls(e[0],[],e[1])}p();function Gce(e){return nc(e)&&e[W]!=="Unsafe"}function Uce(e,t,r){return Ge(r)?r.map(n=>ko(e.items,t,n)):r}function Vce(e,t,r){let n=e.unevaluatedProperties,i=e.allOf.map(a=>ko(a,t,St(r))).reduce((a,l)=>ze(l)?{...a,...l}:l,{});if(!ze(r)||!ze(i)||!nc(n))return i;let s=Yr(e);for(let a of Object.getOwnPropertyNames(r))s.includes(a)||Qe(n,t,r[a])&&(i[a]=ko(n,t,r[a]));return i}function zce(e,t,r){if(!ze(r)||Ge(r))return r;let n=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Fe(e.properties,o)){r[o]=ko(e.properties[o],t,r[o]);continue}if(nc(n)&&Qe(n,t,r[o])){r[o]=ko(n,t,r[o]);continue}delete r[o]}return r}function Hce(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]=ko(s,t,r[l]);continue}if(nc(n)&&Qe(n,t,r[l])){r[l]=ko(n,t,r[l]);continue}delete r[l]}return r}function Wce(e,t,r){return ko(It(e,t),t,r)}function qce(e,t,r){return ko(It(e,t),t,r)}function Zce(e,t,r){if(!Ge(r))return r;if(br(e.items))return[];let n=Math.min(r.length,e.items.length);for(let o=0;o<n;o++)r[o]=ko(e.items[o],t,r[o]);return r.length>n?r.slice(0,n):r}function Xce(e,t,r){for(let n of e.anyOf)if(Gce(n)&&Qe(n,t,r))return ko(n,t,r);return r}function ko(e,t,r){let n=dt(e.$id)?[...t,e]:t,o=e;switch(o[W]){case"Array":return Uce(o,n,r);case"Intersect":return Vce(o,n,r);case"Object":return zce(o,n,r);case"Record":return Hce(o,n,r);case"Ref":return Wce(o,n,r);case"This":return qce(o,n,r);case"Tuple":return Zce(o,n,r);case"Union":return Xce(o,n,r);default:return r}}function Av(...e){return e.length===3?ko(e[0],e[1],e[2]):ko(e[0],[],e[1])}p();function kv(e){return dt(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function Yce(e){return sn(e)||Os(e)||we(e)}function My(e){return e===!0||we(e)&&e===1||sn(e)&&e===BigInt("1")||dt(e)&&(e.toLowerCase()==="true"||e==="1")}function Oy(e){return e===!1||we(e)&&(e===0||Object.is(e,-0))||sn(e)&&e===BigInt("0")||dt(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function Kce(e){return dt(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}function Jce(e){return dt(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}function Qce(e){return dt(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 eue(e){return dt(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 tue(e){return dt(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}function rue(e,t){let r=JR(e);return r===t?r:e}function nue(e,t){let r=QR(e);return r===t?r:e}function oue(e,t){let r=KR(e);return r===t?r:e}function iue(e,t){return dt(e.const)?rue(t,e.const):we(e.const)?nue(t,e.const):Os(e.const)?oue(t,e.const):t}function KR(e){return My(e)?!0:Oy(e)?!1:e}function sue(e){let t=r=>r.split(".")[0];return kv(e)?BigInt(t(e)):we(e)?BigInt(Math.trunc(e)):Oy(e)?BigInt(0):My(e)?BigInt(1):e}function JR(e){return Yce(e)?e.toString():Ra(e)&&e.description!==void 0?e.description.toString():e}function QR(e){return kv(e)?parseFloat(e):My(e)?1:Oy(e)?0:e}function aue(e){return kv(e)?parseInt(e):we(e)?e|0:My(e)?1:Oy(e)?0:e}function lue(e){return dt(e)&&e.toLowerCase()==="null"?null:e}function cue(e){return dt(e)&&e==="undefined"?void 0:e}function uue(e){return Vn(e)?e:we(e)?new Date(e):My(e)?new Date(1):Oy(e)?new Date(0):kv(e)?new Date(parseInt(e)):Jce(e)?new Date("1970-01-01T".concat(e,".000Z")):Kce(e)?new Date("1970-01-01T".concat(e)):eue(e)?new Date("".concat(e,".000Z")):Qce(e)?new Date(e):tue(e)?new Date("".concat(e,"T00:00:00.000Z")):e}function pue(e,t,r){return(Ge(r)?r:[r]).map(o=>Rs(e.items,t,o))}function due(e,t,r){return sue(r)}function fue(e,t,r){return KR(r)}function mue(e,t,r){return uue(r)}function hue(e,t,r){return aue(r)}function yue(e,t,r){return e.allOf.reduce((n,o)=>Rs(o,t,n),r)}function gue(e,t,r){return iue(e,r)}function bue(e,t,r){return lue(r)}function vue(e,t,r){return QR(r)}function xue(e,t,r){if(!ze(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))Fe(r,n)&&(r[n]=Rs(e.properties[n],t,r[n]));return r}function Iue(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]=Rs(i,t,a);return r}function Sue(e,t,r){return Rs(It(e,t),t,r)}function Cue(e,t,r){return JR(r)}function Pue(e,t,r){return dt(r)||we(r)?Symbol(r):r}function Tue(e,t,r){return Rs(It(e,t),t,r)}function wue(e,t,r){return Ge(r)&&!br(e.items)?r.map((o,i)=>i<e.items.length?Rs(e.items[i],t,o):o):r}function Mue(e,t,r){return cue(r)}function Oue(e,t,r){for(let n of e.anyOf){let o=Rs(n,t,St(r));if(Qe(n,t,o))return o}return r}function Rs(e,t,r){let n=ni(e,t),o=e;switch(e[W]){case"Array":return pue(o,n,r);case"BigInt":return due(o,n,r);case"Boolean":return fue(o,n,r);case"Date":return mue(o,n,r);case"Integer":return hue(o,n,r);case"Intersect":return yue(o,n,r);case"Literal":return gue(o,n,r);case"Null":return bue(o,n,r);case"Number":return vue(o,n,r);case"Object":return xue(o,n,r);case"Record":return Iue(o,n,r);case"Ref":return Sue(o,n,r);case"String":return Cue(o,n,r);case"Symbol":return Pue(o,n,r);case"This":return Tue(o,n,r);case"Tuple":return wue(o,n,r);case"Undefined":return Mue(o,n,r);case"Union":return Oue(o,n,r);default:return r}}function Dv(...e){return e.length===3?Rs(e[0],e[1],e[2]):Rs(e[0],[],e[1])}p();p();var Cf=class extends Ae{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}},Nu=class extends Ae{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 vr(e,t,r){try{return Yt(e)?e[or].Decode(r):r}catch(n){throw new Nu(e,t,r,n)}}function Eue(e,t,r,n){return Ge(n)?vr(e,r,n.map((o,i)=>Ns(e.items,t,"".concat(r,"/").concat(i),o))):vr(e,r,n)}function _ue(e,t,r,n){if(!ze(n)||an(n))return vr(e,r,n);let o=sc(e),i=o.map(d=>d[0]),s={...n};for(let[d,f]of o)d in s&&(s[d]=Ns(f,t,"".concat(r,"/").concat(d),s[d]));if(!Yt(e.unevaluatedProperties))return vr(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,u={...s};for(let d of a)i.includes(d)||(u[d]=vr(l,"".concat(r,"/").concat(d),u[d]));return vr(e,r,u)}function Aue(e,t,r,n){return vr(e,r,Ns(e.not,t,r,n))}function kue(e,t,r,n){if(!ze(n))return vr(e,r,n);let o=Yr(e),i={...n};for(let u of o)Fe(i,u)&&(br(i[u])&&(!ef(e.properties[u])||Dt.IsExactOptionalProperty(i,u))||(i[u]=Ns(e.properties[u],t,"".concat(r,"/").concat(u),i[u])));if(!ft(e.additionalProperties))return vr(e,r,i);let s=Object.getOwnPropertyNames(i),a=e.additionalProperties,l={...i};for(let u of s)o.includes(u)||(l[u]=vr(a,"".concat(r,"/").concat(u),l[u]));return vr(e,r,l)}function Due(e,t,r,n){if(!ze(n))return vr(e,r,n);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),s={...n};for(let d of Object.getOwnPropertyNames(n))i.test(d)&&(s[d]=Ns(e.patternProperties[o],t,"".concat(r,"/").concat(d),s[d]));if(!ft(e.additionalProperties))return vr(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,u={...s};for(let d of a)i.test(d)||(u[d]=vr(l,"".concat(r,"/").concat(d),u[d]));return vr(e,r,u)}function Fue(e,t,r,n){let o=It(e,t);return vr(e,r,Ns(o,t,r,n))}function Lue(e,t,r,n){let o=It(e,t);return vr(e,r,Ns(o,t,r,n))}function Rue(e,t,r,n){return Ge(n)&&Ge(e.items)?vr(e,r,e.items.map((o,i)=>Ns(o,t,"".concat(r,"/").concat(i),n[i]))):vr(e,r,n)}function Nue(e,t,r,n){for(let o of e.anyOf){if(!Qe(o,t,n))continue;let i=Ns(o,t,r,n);return vr(e,r,i)}return vr(e,r,n)}function Ns(e,t,r,n){let o=ni(e,t),i=e;switch(e[W]){case"Array":return Eue(i,o,r,n);case"Intersect":return _ue(i,o,r,n);case"Not":return Aue(i,o,r,n);case"Object":return kue(i,o,r,n);case"Record":return Due(i,o,r,n);case"Ref":return Fue(i,o,r,n);case"Symbol":return vr(i,r,n);case"This":return Lue(i,o,r,n);case"Tuple":return Rue(i,o,r,n);case"Union":return Nue(i,o,r,n);default:return vr(i,r,n)}}function Pf(e,t,r){return Ns(e,t,"",r)}p();var Tf=class extends Ae{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}},Bu=class extends Ae{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[or].Encode(r):r}catch(n){throw new Bu(e,t,r,n)}}function Bue(e,t,r,n){let o=_n(e,r,n);return Ge(o)?o.map((i,s)=>Bs(e.items,t,"".concat(r,"/").concat(s),i)):o}function $ue(e,t,r,n){let o=_n(e,r,n);if(!ze(n)||an(n))return o;let i=sc(e),s=i.map(f=>f[0]),a={...o};for(let[f,h]of i)f in a&&(a[f]=Bs(h,t,"".concat(r,"/").concat(f),a[f]));if(!Yt(e.unevaluatedProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.unevaluatedProperties,d={...a};for(let f of l)s.includes(f)||(d[f]=_n(u,"".concat(r,"/").concat(f),d[f]));return d}function jue(e,t,r,n){return _n(e.not,r,_n(e,r,n))}function Gue(e,t,r,n){let o=_n(e,r,n);if(!ze(o))return o;let i=Yr(e),s={...o};for(let d of i)Fe(s,d)&&(br(s[d])&&(!ef(e.properties[d])||Dt.IsExactOptionalProperty(s,d))||(s[d]=Bs(e.properties[d],t,"".concat(r,"/").concat(d),s[d])));if(!ft(e.additionalProperties))return s;let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,u={...s};for(let d of a)i.includes(d)||(u[d]=_n(l,"".concat(r,"/").concat(d),u[d]));return u}function Uue(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={...o};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(a[f]=Bs(e.patternProperties[i],t,"".concat(r,"/").concat(f),a[f]));if(!ft(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,d={...a};for(let f of l)s.test(f)||(d[f]=_n(u,"".concat(r,"/").concat(f),d[f]));return d}function Vue(e,t,r,n){let o=It(e,t),i=Bs(o,t,r,n);return _n(e,r,i)}function zue(e,t,r,n){let o=It(e,t),i=Bs(o,t,r,n);return _n(e,r,i)}function Hue(e,t,r,n){let o=_n(e,r,n);return Ge(e.items)?e.items.map((i,s)=>Bs(i,t,"".concat(r,"/").concat(s),o[s])):[]}function Wue(e,t,r,n){for(let o of e.anyOf){if(!Qe(o,t,n))continue;let i=Bs(o,t,r,n);return _n(e,r,i)}for(let o of e.anyOf){let i=Bs(o,t,r,n);if(Qe(e,t,i))return _n(e,r,i)}return _n(e,r,n)}function Bs(e,t,r,n){let o=ni(e,t),i=e;switch(e[W]){case"Array":return Bue(i,o,r,n);case"Intersect":return $ue(i,o,r,n);case"Not":return jue(i,o,r,n);case"Object":return Gue(i,o,r,n);case"Record":return Uue(i,o,r,n);case"Ref":return Vue(i,o,r,n);case"This":return zue(i,o,r,n);case"Tuple":return Hue(i,o,r,n);case"Union":return Wue(i,o,r,n);default:return _n(i,r,n)}}function Fv(e,t,r){return Bs(e,t,"",r)}p();function que(e,t){return Yt(e)||Kr(e.items,t)}function Zue(e,t){return Yt(e)||Kr(e.items,t)}function Xue(e,t){return Yt(e)||Kr(e.returns,t)||e.parameters.some(r=>Kr(r,t))}function Yue(e,t){return Yt(e)||Kr(e.returns,t)||e.parameters.some(r=>Kr(r,t))}function Kue(e,t){return Yt(e)||Yt(e.unevaluatedProperties)||e.allOf.some(r=>Kr(r,t))}function Jue(e,t){return Yt(e)||Kr(e.items,t)}function Que(e,t){return Yt(e)||Kr(e.not,t)}function epe(e,t){return Yt(e)||Object.values(e.properties).some(r=>Kr(r,t))||ft(e.additionalProperties)&&Kr(e.additionalProperties,t)}function tpe(e,t){return Yt(e)||Kr(e.item,t)}function rpe(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Yt(e)||Kr(n,t)||ft(e.additionalProperties)&&Yt(e.additionalProperties)}function npe(e,t){return Yt(e)?!0:Kr(It(e,t),t)}function ope(e,t){return Yt(e)?!0:Kr(It(e,t),t)}function ipe(e,t){return Yt(e)||!br(e.items)&&e.items.some(r=>Kr(r,t))}function spe(e,t){return Yt(e)||e.anyOf.some(r=>Kr(r,t))}function Kr(e,t){let r=ni(e,t),n=e;if(e.$id&&tT.has(e.$id))return!1;switch(e.$id&&tT.add(e.$id),e[W]){case"Array":return que(n,r);case"AsyncIterator":return Zue(n,r);case"Constructor":return Xue(n,r);case"Function":return Yue(n,r);case"Intersect":return Kue(n,r);case"Iterator":return Jue(n,r);case"Not":return Que(n,r);case"Object":return epe(n,r);case"Promise":return tpe(n,r);case"Record":return rpe(n,r);case"Ref":return npe(n,r);case"This":return ope(n,r);case"Tuple":return ipe(n,r);case"Union":return spe(n,r);default:return Yt(e)}}var tT=new Set;function $s(e,t){return tT.clear(),Kr(e,t)}function eN(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Qe(t,r,n))throw new Cf(t,n,Fs(t,r,n).First());return $s(t,r)?Pf(t,r,n):n}p();function Za(e,t){let r=Fe(e,"default")?e.default:void 0,n=tc(r)?r():St(r);return br(t)?n:ze(t)&&ze(n)?Object.assign(n,t):t}function rT(e){return nc(e)&&"default"in e}function ape(e,t,r){let n=Za(e,r);if(!Ge(n))return n;for(let o=0;o<n.length;o++)n[o]=Do(e.items,t,n[o]);return n}function lpe(e,t,r){return Vn(r)?r:Za(e,r)}function cpe(e,t,r){let n=Za(e,r);return e.allOf.reduce((o,i)=>{let s=Do(i,t,n);return ze(s)?{...o,...s}:s},{})}function upe(e,t,r){let n=Za(e,r);if(!ze(n))return n;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let s=Do(e.properties[i],t,n[i]);br(s)||(n[i]=Do(e.properties[i],t,n[i]))}if(!rT(e.additionalProperties))return n;for(let i of Object.getOwnPropertyNames(n))o.includes(i)||(n[i]=Do(e.additionalProperties,t,n[i]));return n}function ppe(e,t,r){let n=Za(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)&&rT(s)&&(n[l]=Do(s,t,n[l]));if(!rT(o))return n;for(let l of Object.getOwnPropertyNames(n))a.test(l)||(n[l]=Do(o,t,n[l]));return n}function dpe(e,t,r){return Do(It(e,t),t,Za(e,r))}function fpe(e,t,r){return Do(It(e,t),t,r)}function mpe(e,t,r){let n=Za(e,r);if(!Ge(n)||br(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]=Do(o[s],t,n[s]));return n}function hpe(e,t,r){let n=Za(e,r);for(let o of e.anyOf){let i=Do(o,t,St(n));if(Qe(o,t,i))return i}return n}function Do(e,t,r){let n=ni(e,t),o=e;switch(o[W]){case"Array":return ape(o,n,r);case"Date":return lpe(o,n,r);case"Intersect":return cpe(o,n,r);case"Object":return upe(o,n,r);case"Record":return ppe(o,n,r);case"Ref":return dpe(o,n,r);case"This":return fpe(o,n,r);case"Tuple":return mpe(o,n,r);case"Union":return hpe(o,n,r);default:return Za(o,r)}}function Lv(...e){return e.length===3?Do(e[0],e[1],e[2]):Do(e[0],[],e[1])}p();p();var si={};Ul(si,{Delete:()=>gpe,Format:()=>Ey,Get:()=>vpe,Has:()=>bpe,Set:()=>ype,ValuePointerRootDeleteError:()=>Nv,ValuePointerRootSetError:()=>Rv});p();var Rv=class extends Ae{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}},Nv=class extends Ae{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function tN(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*Ey(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 tN(e.slice(t,r))),t=n+1):r=n;yield tN(e.slice(t))}function ype(e,t,r){if(t==="")throw new Rv(e,t,r);let[n,o,i]=[null,e,""];for(let s of Ey(t))o[s]===void 0&&(o[s]={}),n=o,o=o[s],i=s;n[i]=r}function gpe(e,t){if(t==="")throw new Nv(e,t);let[r,n,o]=[null,e,""];for(let i of Ey(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 bpe(e,t){if(t==="")return!0;let[r,n,o]=[null,e,""];for(let i of Ey(t)){if(n[i]===void 0)return!1;r=n,n=n[i],o=i}return Object.getOwnPropertyNames(r).includes(o)}function vpe(e,t){if(t==="")return e;let r=e;for(let n of Ey(t)){if(r[n]===void 0)return;r=r[n]}return r}p();function xpe(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=>$u(e[o],t[o]))}function Ipe(e,t){return Vn(t)&&e.getTime()===t.getTime()}function Spe(e,t){return!Ge(t)||e.length!==t.length?!1:e.every((r,n)=>$u(r,t[n]))}function Cpe(e,t){return!Yo(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>$u(r,t[n]))}function Ppe(e,t){return e===t}function $u(e,t){if(Vn(e))return Ipe(e,t);if(Yo(e))return Cpe(e,t);if(Ge(e))return Spe(e,t);if(ze(e))return xpe(e,t);if(an(e))return Ppe(e,t);throw new Error("ValueEquals: Unable to compare value")}var Tpe=Vt({type:_t("insert"),path:Jo(),value:za()}),wpe=Vt({type:_t("update"),path:Jo(),value:za()}),Mpe=Vt({type:_t("delete"),path:Jo()}),nN=Nt([Tpe,wpe,Mpe]),Bv=class extends Ae{constructor(t,r){super(r),this.value=t}};function $v(e,t){return{type:"update",path:e,value:t}}function oN(e,t){return{type:"insert",path:e,value:t}}function iN(e){return{type:"delete",path:e}}function rN(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new Bv(e,"Cannot diff objects with symbols")}function*Ope(e,t,r){if(rN(t),rN(r),!QC(r))return yield $v(e,r);let n=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let i of o)Fe(t,i)||(yield oN("".concat(e,"/").concat(i),r[i]));for(let i of n)Fe(r,i)&&($u(t,r)||(yield*jv("".concat(e,"/").concat(i),t[i],r[i])));for(let i of n)Fe(r,i)||(yield iN("".concat(e,"/").concat(i)))}function*Epe(e,t,r){if(!Ge(r))return yield $v(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*jv("".concat(e,"/").concat(n),t[n],r[n]);for(let n=0;n<r.length;n++)n<t.length||(yield oN("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield iN("".concat(e,"/").concat(n)))}function*_pe(e,t,r){if(!Yo(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield $v(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*jv("".concat(e,"/").concat(n),t[n],r[n])}function*Ape(e,t,r){t!==r&&(yield $v(e,r))}function*jv(e,t,r){if(QC(t))return yield*Ope(e,t,r);if(Ge(t))return yield*Epe(e,t,r);if(Yo(t))return yield*_pe(e,t,r);if(an(t))return yield*Ape(e,t,r);throw new Bv(t,"Unable to diff value")}function sN(e,t){return[...jv("",e,t)]}function kpe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function Dpe(e){return e.length===0}function aN(e,t){if(kpe(t))return St(t[0].value);if(Dpe(t))return St(e);let r=St(e);for(let n of t)switch(n.type){case"insert":{si.Set(r,n.path,n.value);break}case"update":{si.Set(r,n.path,n.value);break}case"delete":{si.Delete(r,n.path);break}}return r}p();function lN(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=$s(t,r)?Fv(t,r,n):n;if(!Qe(t,r,o))throw new Tf(t,o,Fs(t,r,o).First());return o}p();var Gv=class extends Ae{constructor(t){super(t)}};function Fpe(e,t,r,n){if(!ze(r))si.Set(e,t,St(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)nT(e,"".concat(t,"/").concat(s),r[s],n[s])}}function Lpe(e,t,r,n){if(!Ge(r))si.Set(e,t,St(n));else{for(let o=0;o<n.length;o++)nT(e,"".concat(t,"/").concat(o),r[o],n[o]);r.splice(n.length)}}function Rpe(e,t,r,n){if(Yo(r)&&r.length===n.length)for(let o=0;o<r.length;o++)r[o]=n[o];else si.Set(e,t,St(n))}function Npe(e,t,r,n){r!==n&&si.Set(e,t,n)}function nT(e,t,r,n){if(Ge(n))return Lpe(e,t,r,n);if(Yo(n))return Rpe(e,t,r,n);if(ze(n))return Fpe(e,t,r,n);if(an(n))return Npe(e,t,r,n)}function cN(e){return Yo(e)||an(e)}function Bpe(e,t){return ze(e)&&Ge(t)||Ge(e)&&ze(t)}function uN(e,t){if(cN(e)||cN(t))throw new Gv("Only object and array types can be mutated at the root level");if(Bpe(e,t))throw new Gv("Cannot assign due type mismatch of assignable values");nT(e,"",e,t)}p();var $pe=[(e,t,r)=>St(r),(e,t,r)=>Lv(e,t,r),(e,t,r)=>Av(e,t,r),(e,t,r)=>Dv(e,t,r),(e,t,r)=>(Ev(e,t,r),r),(e,t,r)=>$s(e,t)?Pf(e,t,r):r];function pN(e,t,r){return $pe.reduce((n,o)=>o(e,t,n),r)}function dN(...e){return e.length===3?pN(e[0],e[1],e[2]):pN(e[0],[],e[1])}p();var Xa={};Ul(Xa,{Assert:()=>Ev,Cast:()=>eT,Check:()=>Qe,Clean:()=>Av,Clone:()=>St,Convert:()=>Dv,Create:()=>ii,Decode:()=>eN,Default:()=>Lv,Diff:()=>sN,Edit:()=>nN,Encode:()=>lN,Equal:()=>$u,Errors:()=>Fs,Hash:()=>cc,Mutate:()=>uN,Parse:()=>dN,Patch:()=>aN,ValueErrorIterator:()=>oi});p();p();var oT=class extends Ae{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));m(this,"schema");this.schema=r}};function jpe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new oT(e);return ju(r,t)}function Uv(e,t){return!pt.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function ju(e,t){return e[W]==="This"||e[W]==="Ref"?jpe(e,t):e}p();function Gpe(e,t,r){let n=e.get(t);if(n!==void 0)return n;let o=$s(t,r);return e.set(t,o),o}function Vv(){let e=new WeakMap;return{HasTransform:(t,r)=>Gpe(e,t,r)}}function xr(e,t,r){try{return R.IsTransform(e)?e[or].Decode(r):r}catch(n){throw new Nu(e,t,r,n)}}function Upe(e,t,r,n,o){return pt.IsArray(n)?xr(e,r,n.map((i,s)=>js(e.items,t,"".concat(r,"/").concat(s),i,o))):xr(e,r,n)}function Vpe(e,t,r,n,o){if(!pt.IsObject(n)||an(n))return xr(e,r,n);let i=sc(e),s=i.map(f=>f[0]),a={...n};for(let[f,h]of i)f in a&&(a[f]=js(h,t,"".concat(r,"/").concat(f),a[f],o));if(!R.IsTransform(e.unevaluatedProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),u=e.unevaluatedProperties,d={...a};for(let f of l)s.includes(f)||(d[f]=xr(u,"".concat(r,"/").concat(f),d[f]));return xr(e,r,d)}function zpe(e,t,r,n,o){return xr(e,r,js(e.not,t,r,n,o))}function Hpe(e,t,r,n,o){if(!pt.IsObject(n))return xr(e,r,n);let i=Yr(e),s={...n};for(let d of i)pt.HasPropertyKey(s,d)&&(pt.IsUndefined(s[d])&&(!R.IsUndefined(e.properties[d])||Dt.IsExactOptionalProperty(s,d))||(s[d]=js(e.properties[d],t,"".concat(r,"/").concat(d),s[d],o)));if(!R.IsSchema(e.additionalProperties))return xr(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,u={...s};for(let d of a)i.includes(d)||(u[d]=xr(l,"".concat(r,"/").concat(d),u[d]));return xr(e,r,u)}function Wpe(e,t,r,n,o){if(!pt.IsObject(n))return xr(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),a={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(a[f]=js(e.patternProperties[i],t,"".concat(r,"/").concat(f),a[f],o));if(!R.IsSchema(e.additionalProperties))return xr(e,r,a);let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,d={...a};for(let f of l)s.test(f)||(d[f]=xr(u,"".concat(r,"/").concat(f),d[f]));return xr(e,r,d)}function qpe(e,t,r,n,o){let i=ju(e,t);return xr(e,r,js(i,t,r,n,o))}function Zpe(e,t,r,n,o){let i=ju(e,t);return xr(e,r,js(i,t,r,n,o))}function Xpe(e,t,r,n,o){return pt.IsArray(n)&&pt.IsArray(e.items)?xr(e,r,e.items.map((i,s)=>js(i,t,"".concat(r,"/").concat(s),n[s],o))):xr(e,r,n)}function Ype(e,t,r,n,o){for(let i of e.anyOf){if(!Xa.Check(i,t,n))continue;let s=js(i,t,r,n,o);return xr(e,r,s)}return xr(e,r,n)}function js(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=Uv(e,t),s=e;switch(e[W]){case"Array":return Upe(s,i,r,n,o);case"Intersect":return Vpe(s,i,r,n,o);case"Not":return zpe(s,i,r,n,o);case"Object":return Hpe(s,i,r,n,o);case"Record":return Wpe(s,i,r,n,o);case"Ref":return qpe(s,i,r,n,o);case"Symbol":return xr(s,r,n);case"This":return Zpe(s,i,r,n,o);case"Tuple":return Xpe(s,i,r,n,o);case"Union":return Ype(s,i,r,n,o);default:return xr(s,r,n)}}function fN(e,t,r){let n=Vv();return js(e,t,"",r,n)}p();function An(e,t,r){try{return R.IsTransform(e)?e[or].Encode(r):r}catch(n){throw new Bu(e,t,r,n)}}function Kpe(e,t,r,n,o){let i=An(e,r,n);return pt.IsArray(i)?i.map((s,a)=>Gs(e.items,t,"".concat(r,"/").concat(a),s,o)):i}function Jpe(e,t,r,n,o){let i=An(e,r,n);if(!pt.IsObject(n)||an(n))return i;let s=sc(e),a=s.map(h=>h[0]),l={...i};for(let[h,b]of s)h in l&&(l[h]=Gs(b,t,"".concat(r,"/").concat(h),l[h],o));if(!R.IsTransform(e.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=e.unevaluatedProperties,f={...l};for(let h of u)a.includes(h)||(f[h]=An(d,"".concat(r,"/").concat(h),f[h]));return f}function Qpe(e,t,r,n){return An(e.not,r,An(e,r,n))}function ede(e,t,r,n,o){let i=An(e,r,n);if(!pt.IsObject(i))return i;let s=Yr(e),a={...i};for(let f of s)pt.HasPropertyKey(a,f)&&(pt.IsUndefined(a[f])&&(!R.IsUndefined(e.properties[f])||Dt.IsExactOptionalProperty(a,f))||(a[f]=Gs(e.properties[f],t,"".concat(r,"/").concat(f),a[f],o)));if(!R.IsSchema(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,d={...a};for(let f of l)s.includes(f)||(d[f]=An(u,"".concat(r,"/").concat(f),d[f]));return d}function tde(e,t,r,n,o){let i=An(e,r,n);if(!pt.IsObject(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(s),l={...i};for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(l[h]=Gs(e.patternProperties[s],t,"".concat(r,"/").concat(h),l[h],o));if(!R.IsSchema(e.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=e.additionalProperties,f={...l};for(let h of u)a.test(h)||(f[h]=An(d,"".concat(r,"/").concat(h),f[h]));return f}function rde(e,t,r,n,o){let i=ju(e,t),s=Gs(i,t,r,n,o);return An(e,r,s)}function nde(e,t,r,n,o){let i=ju(e,t),s=Gs(i,t,r,n,o);return An(e,r,s)}function ode(e,t,r,n,o){let i=An(e,r,n);return pt.IsArray(e.items)?e.items.map((s,a)=>Gs(s,t,"".concat(r,"/").concat(a),i[a],o)):[]}function ide(e,t,r,n,o){for(let i of e.anyOf){if(!Xa.Check(i,t,n))continue;let s=Gs(i,t,r,n,o);return An(e,r,s)}for(let i of e.anyOf){let s=Gs(i,t,r,n,o);if(Xa.Check(e,t,s))return An(e,r,s)}return An(e,r,n)}function Gs(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=Uv(e,t),s=e;switch(e[W]){case"Array":return Kpe(s,i,r,n,o);case"Intersect":return Jpe(s,i,r,n,o);case"Not":return Qpe(s,i,r,n);case"Object":return ede(s,i,r,n,o);case"Record":return tde(s,i,r,n,o);case"Ref":return rde(s,i,r,n,o);case"This":return nde(s,i,r,n,o);case"Tuple":return ode(s,i,r,n,o);case"Union":return ide(s,i,r,n,o);default:return An(s,r,n)}}function mN(e,t,r){let n=Vv();return Gs(e,t,"",r,n)}p();var iT=class{constructor(t,r,n,o){this.schema=t,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=$s(t,r)}Code(){return this.code}Errors(t){return Fs(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new Cf(this.schema,t,this.Errors(t).First());return this.hasTransform?Pf(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?Fv(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new Tf(this.schema,t,this.Errors(t).First());return r}},Ya;(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})(Ya||(Ya={}));var zv;(function(e){function t(i){return i.length===0?!1:Ya.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(!(Ya.IsAlpha(a)||Ya.IsNumeric(a)||Ya.DollarSign(a)||Ya.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})(zv||(zv={}));var sT;(function(e){function t(r){let n=[];for(let o=0;o<r.length;o++){let i=r.charCodeAt(o);Ya.IsNumeric(i)||Ya.IsAlpha(i)?n.push(r.charAt(o)):n.push("_".concat(i,"_"))}return n.join("").replace(/__/g,"_")}e.Encode=t})(sT||(sT={}));var aT;(function(e){function t(r){return r.replace(/'/g,"\\'")}e.Escape=t})(aT||(aT={}));var lT=class extends Ae{constructor(t){super("Unknown type"),this.schema=t}},Hv=class extends Ae{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}},Gu;(function(e){function t(s,a,l){return Dt.ExactOptionalPropertyTypes?"('".concat(a,"' in ").concat(s," ? ").concat(l," : true)"):"(".concat(zv.Encode(s,a)," !== undefined ? ").concat(l," : true)")}e.IsExactOptionalProperty=t;function r(s){return Dt.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 Dt.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 Dt.AllowNaN?"typeof ".concat(s," === 'number'"):"Number.isFinite(".concat(s,")")}e.IsNumberLike=o;function i(s){return Dt.AllowNullVoid?"(".concat(s," === undefined || ").concat(s," === null)"):"".concat(s," === undefined")}e.IsVoidLike=i})(Gu||(Gu={}));var Wv;(function(e){function t(A){return A[W]==="Any"||A[W]==="Unknown"}function*r(A,Y,L){yield"true"}function*n(A,Y,L){yield"Array.isArray(".concat(L,")");let[le,ne]=[Ue("value","any"),Ue("acc","number")];we(A.maxItems)&&(yield"".concat(L,".length <= ").concat(A.maxItems)),we(A.minItems)&&(yield"".concat(L,".length >= ").concat(A.minItems));let ae=_e(A.items,Y,"value");if(yield"".concat(L,".every((").concat(le,") => ").concat(ae,")"),ft(A.contains)||we(A.minContains)||we(A.maxContains)){let ve=ft(A.contains)?A.contains:Rt(),ur=_e(ve,Y,"value"),jn=we(A.minContains)?["(count >= ".concat(A.minContains,")")]:[],rn=we(A.maxContains)?["(count <= ".concat(A.maxContains,")")]:[],xn="const count = value.reduce((".concat(ne,", ").concat(le,") => ").concat(ur," ? acc + 1 : acc, 0)"),uu=["(count > 0)",...jn,...rn].join(" && ");yield"((".concat(le,") => { ").concat(xn,"; return ").concat(uu,"})(").concat(L,")")}if(A.uniqueItems===!0){let ur="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(le,") => { ").concat(ur," )(").concat(L,")")}}function*o(A,Y,L){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(L,")")}function*i(A,Y,L){yield"(typeof ".concat(L," === 'bigint')"),sn(A.exclusiveMaximum)&&(yield"".concat(L," < BigInt(").concat(A.exclusiveMaximum,")")),sn(A.exclusiveMinimum)&&(yield"".concat(L," > BigInt(").concat(A.exclusiveMinimum,")")),sn(A.maximum)&&(yield"".concat(L," <= BigInt(").concat(A.maximum,")")),sn(A.minimum)&&(yield"".concat(L," >= BigInt(").concat(A.minimum,")")),sn(A.multipleOf)&&(yield"(".concat(L," % BigInt(").concat(A.multipleOf,")) === 0"))}function*s(A,Y,L){yield"(typeof ".concat(L," === 'boolean')")}function*a(A,Y,L){yield*be(A.returns,Y,"".concat(L,".prototype"))}function*l(A,Y,L){yield"(".concat(L," instanceof Date) && Number.isFinite(").concat(L,".getTime())"),we(A.exclusiveMaximumTimestamp)&&(yield"".concat(L,".getTime() < ").concat(A.exclusiveMaximumTimestamp)),we(A.exclusiveMinimumTimestamp)&&(yield"".concat(L,".getTime() > ").concat(A.exclusiveMinimumTimestamp)),we(A.maximumTimestamp)&&(yield"".concat(L,".getTime() <= ").concat(A.maximumTimestamp)),we(A.minimumTimestamp)&&(yield"".concat(L,".getTime() >= ").concat(A.minimumTimestamp)),we(A.multipleOfTimestamp)&&(yield"(".concat(L,".getTime() % ").concat(A.multipleOfTimestamp,") === 0"))}function*u(A,Y,L){yield"(typeof ".concat(L," === 'function')")}function*d(A,Y,L){yield"Number.isInteger(".concat(L,")"),we(A.exclusiveMaximum)&&(yield"".concat(L," < ").concat(A.exclusiveMaximum)),we(A.exclusiveMinimum)&&(yield"".concat(L," > ").concat(A.exclusiveMinimum)),we(A.maximum)&&(yield"".concat(L," <= ").concat(A.maximum)),we(A.minimum)&&(yield"".concat(L," >= ").concat(A.minimum)),we(A.multipleOf)&&(yield"(".concat(L," % ").concat(A.multipleOf,") === 0"))}function*f(A,Y,L){let le=A.allOf.map(ne=>_e(ne,Y,L)).join(" && ");if(A.unevaluatedProperties===!1){let ne=it("".concat(new RegExp(Va(A)),";")),ae="Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ne,".test(key))");yield"(".concat(le," && ").concat(ae,")")}else if(ft(A.unevaluatedProperties)){let ne=it("".concat(new RegExp(Va(A)),";")),ae="Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ne,".test(key) || ").concat(_e(A.unevaluatedProperties,Y,"".concat(L,"[key]")),")");yield"(".concat(le," && ").concat(ae,")")}else yield"(".concat(le,")")}function*h(A,Y,L){yield"(typeof value === 'object' && Symbol.iterator in ".concat(L,")")}function*b(A,Y,L){typeof A.const=="number"||typeof A.const=="boolean"?yield"(".concat(L," === ").concat(A.const,")"):yield"(".concat(L," === '").concat(aT.Escape(A.const),"')")}function*v(A,Y,L){yield"false"}function*I(A,Y,L){let le=_e(A.not,Y,L);yield"(!".concat(le,")")}function*x(A,Y,L){yield"(".concat(L," === null)")}function*C(A,Y,L){yield Gu.IsNumberLike(L),we(A.exclusiveMaximum)&&(yield"".concat(L," < ").concat(A.exclusiveMaximum)),we(A.exclusiveMinimum)&&(yield"".concat(L," > ").concat(A.exclusiveMinimum)),we(A.maximum)&&(yield"".concat(L," <= ").concat(A.maximum)),we(A.minimum)&&(yield"".concat(L," >= ").concat(A.minimum)),we(A.multipleOf)&&(yield"(".concat(L," % ").concat(A.multipleOf,") === 0"))}function*P(A,Y,L){yield Gu.IsObjectLike(L),we(A.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length >= ").concat(A.minProperties)),we(A.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length <= ").concat(A.maxProperties));let le=Object.getOwnPropertyNames(A.properties);for(let ne of le){let ae=zv.Encode(L,ne),ve=A.properties[ne];if(A.required&&A.required.includes(ne))yield*be(ve,Y,ae),(Ha(ve)||t(ve))&&(yield"('".concat(ne,"' in ").concat(L,")"));else{let ur=_e(ve,Y,ae);yield Gu.IsExactOptionalProperty(L,ne,ur)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===le.length)yield"Object.getOwnPropertyNames(".concat(L,").length === ").concat(le.length);else{let ne="[".concat(le.map(ae=>"'".concat(ae,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ne,".includes(key))")}if(typeof A.additionalProperties=="object"){let ne=_e(A.additionalProperties,Y,"".concat(L,"[key]")),ae="[".concat(le.map(ve=>"'".concat(ve,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ae,".includes(key) || ").concat(ne,"))")}}function*w(A,Y,L){yield"(typeof value === 'object' && typeof ".concat(L,".then === 'function')")}function*T(A,Y,L){yield Gu.IsRecordLike(L),we(A.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length >= ").concat(A.minProperties)),we(A.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length <= ").concat(A.maxProperties));let[le,ne]=Object.entries(A.patternProperties)[0],ae=it("".concat(new RegExp(le))),ve=_e(ne,Y,"value"),ur=ft(A.additionalProperties)?_e(A.additionalProperties,Y,L):A.additionalProperties===!1?"false":"true",jn="(".concat(ae,".test(key) ? ").concat(ve," : ").concat(ur,")");yield"(Object.entries(".concat(L,").every(([key, value]) => ").concat(jn,"))")}function*O(A,Y,L){let le=It(A,Y);if(pe.functions.has(A.$ref))return yield"".concat(yt(A.$ref),"(").concat(L,")");yield*be(le,Y,L)}function*N(A,Y,L){let le=it("".concat(new RegExp(A.source,A.flags),";"));yield"(typeof ".concat(L," === 'string')"),we(A.maxLength)&&(yield"".concat(L,".length <= ").concat(A.maxLength)),we(A.minLength)&&(yield"".concat(L,".length >= ").concat(A.minLength)),yield"".concat(le,".test(").concat(L,")")}function*k(A,Y,L){if(yield"(typeof ".concat(L," === 'string')"),we(A.maxLength)&&(yield"".concat(L,".length <= ").concat(A.maxLength)),we(A.minLength)&&(yield"".concat(L,".length >= ").concat(A.minLength)),A.pattern!==void 0){let le=it("".concat(new RegExp(A.pattern),";"));yield"".concat(le,".test(").concat(L,")")}A.format!==void 0&&(yield"format('".concat(A.format,"', ").concat(L,")"))}function*D(A,Y,L){yield"(typeof ".concat(L," === 'symbol')")}function*F(A,Y,L){yield"(typeof ".concat(L," === 'string')");let le=it("".concat(new RegExp(A.pattern),";"));yield"".concat(le,".test(").concat(L,")")}function*z(A,Y,L){yield"".concat(yt(A.$ref),"(").concat(L,")")}function*G(A,Y,L){if(yield"Array.isArray(".concat(L,")"),A.items===void 0)return yield"".concat(L,".length === 0");yield"(".concat(L,".length === ").concat(A.maxItems,")");for(let le=0;le<A.items.length;le++){let ne=_e(A.items[le],Y,"".concat(L,"[").concat(le,"]"));yield"".concat(ne)}}function*j(A,Y,L){yield"".concat(L," === undefined")}function*K(A,Y,L){let le=A.anyOf.map(ne=>_e(ne,Y,L));yield"(".concat(le.join(" || "),")")}function*Z(A,Y,L){yield"".concat(L," instanceof Uint8Array"),we(A.maxByteLength)&&(yield"(".concat(L,".length <= ").concat(A.maxByteLength,")")),we(A.minByteLength)&&(yield"(".concat(L,".length >= ").concat(A.minByteLength,")"))}function*oe(A,Y,L){yield"true"}function*Q(A,Y,L){yield Gu.IsVoidLike(L)}function*ge(A,Y,L){let le=pe.instances.size;pe.instances.set(le,A),yield"kind('".concat(A[W],"', ").concat(le,", ").concat(L,")")}function*be(A,Y,L,le=!0){let ne=dt(A.$id)?[...Y,A]:Y,ae=A;if(le&&dt(A.$id)){let ve=yt(A.$id);if(pe.functions.has(ve))return yield"".concat(ve,"(").concat(L,")");{let ur=Xe(ve,A,Y,"value",!1);return pe.functions.set(ve,ur),yield"".concat(ve,"(").concat(L,")")}}switch(ae[W]){case"Any":return yield*r(ae,ne,L);case"Array":return yield*n(ae,ne,L);case"AsyncIterator":return yield*o(ae,ne,L);case"BigInt":return yield*i(ae,ne,L);case"Boolean":return yield*s(ae,ne,L);case"Constructor":return yield*a(ae,ne,L);case"Date":return yield*l(ae,ne,L);case"Function":return yield*u(ae,ne,L);case"Integer":return yield*d(ae,ne,L);case"Intersect":return yield*f(ae,ne,L);case"Iterator":return yield*h(ae,ne,L);case"Literal":return yield*b(ae,ne,L);case"Never":return yield*v(ae,ne,L);case"Not":return yield*I(ae,ne,L);case"Null":return yield*x(ae,ne,L);case"Number":return yield*C(ae,ne,L);case"Object":return yield*P(ae,ne,L);case"Promise":return yield*w(ae,ne,L);case"Record":return yield*T(ae,ne,L);case"Ref":return yield*O(ae,ne,L);case"RegExp":return yield*N(ae,ne,L);case"String":return yield*k(ae,ne,L);case"Symbol":return yield*D(ae,ne,L);case"TemplateLiteral":return yield*F(ae,ne,L);case"This":return yield*z(ae,ne,L);case"Tuple":return yield*G(ae,ne,L);case"Undefined":return yield*j(ae,ne,L);case"Union":return yield*K(ae,ne,L);case"Uint8Array":return yield*Z(ae,ne,L);case"Unknown":return yield*oe(ae,ne,L);case"Void":return yield*Q(ae,ne,L);default:if(!Gr.Has(ae[W]))throw new lT(A);return yield*ge(ae,ne,L)}}let pe={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function _e(A,Y,L,le=!0){return"(".concat([...be(A,Y,L,le)].join(" && "),")")}function yt(A){return"check_".concat(sT.Encode(A))}function it(A){let Y="local_".concat(pe.variables.size);return pe.variables.set(Y,"const ".concat(Y," = ").concat(A)),Y}function Xe(A,Y,L,le,ne=!0){let[ae,ve]=["\n",xn=>"".padStart(xn," ")],ur=Ue("value","any"),jn=de("boolean"),rn=[...be(Y,L,le,ne)].map(xn=>"".concat(ve(4)).concat(xn)).join(" &&".concat(ae));return"function ".concat(A,"(").concat(ur,")").concat(jn," {").concat(ae).concat(ve(2),"return (").concat(ae).concat(rn).concat(ae).concat(ve(2),")\n}")}function Ue(A,Y){let L=pe.language==="typescript"?": ".concat(Y):"";return"".concat(A).concat(L)}function de(A){return pe.language==="typescript"?": ".concat(A):""}function me(A,Y,L){let le=Xe("check",A,Y,"value"),ne=Ue("value","any"),ae=de("boolean"),ve=[...pe.functions.values()],ur=[...pe.variables.values()],jn=dt(A.$id)?"return function check(".concat(ne,")").concat(ae," {\n return ").concat(yt(A.$id),"(value)\n}"):"return ".concat(le);return[...ur,...ve,jn].join("\n")}function te(...A){let Y={language:"javascript"},[L,le,ne]=A.length===2&&Ge(A[1])?[A[0],A[1],Y]:A.length===2&&!Ge(A[1])?[A[0],[],A[1]]:A.length===3?[A[0],A[1],A[2]]:A.length===1?[A[0],[],Y]:[null,[],Y];if(pe.language=ne.language,pe.variables.clear(),pe.functions.clear(),pe.instances.clear(),!ft(L))throw new Hv(L);for(let ae of le)if(!ft(ae))throw new Hv(ae);return me(L,le,ne)}e.Code=te;function ie(A,Y=[]){let L=te(A,Y,{language:"javascript"}),le=globalThis.Function("kind","format","hash",L),ne=new Map(pe.instances);function ae(rn,xn,uu){if(!Gr.Has(rn)||!ne.has(xn))return!1;let US=Gr.Get(rn),VS=ne.get(xn);return US(VS,uu)}function ve(rn,xn){return Hn.Has(rn)?Hn.Get(rn)(xn):!1}function ur(rn){return cc(rn)}let jn=le(ae,ve,ur);return new iT(A,Y,jn,L)}e.Compile=ie})(Wv||(Wv={}));p();p();var hN={},sde=function(e,t,r,n,o){var i=new Worker(hN[t]||(hN[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 u=new Error(l[0]);u.code=l[1],u.stack=l[2],o(u,null)}else o(null,a)},i.postMessage(r,n),i},Jt=Uint8Array,qn=Uint16Array,ky=Int32Array,Ef=new Jt([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]),_f=new Jt([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]),_y=new Jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vN=function(e,t){for(var r=new qn(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new ky(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}},xN=vN(Ef,2),hT=xN.b,Kv=xN.r;hT[28]=258,Kv[258]=28;var IN=vN(_f,0),SN=IN.b,uT=IN.r,Ay=new qn(32768);for(kt=0;kt<32768;++kt)Ka=(kt&43690)>>1|(kt&21845)<<1,Ka=(Ka&52428)>>2|(Ka&13107)<<2,Ka=(Ka&61680)>>4|(Ka&3855)<<4,Ay[kt]=((Ka&65280)>>8|(Ka&255)<<8)>>1;var Ka,kt,li=function(e,t,r){for(var n=e.length,o=0,i=new qn(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new qn(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new qn(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var u=o<<4|e[o],d=t-e[o],f=s[e[o]-1]++<<d,h=f|(1<<d)-1;f<=h;++f)a[Ay[f]>>l]=u}else for(a=new qn(n),o=0;o<n;++o)e[o]&&(a[o]=Ay[s[e[o]-1]++]>>15-e[o]);return a},Ja=new Jt(288);for(kt=0;kt<144;++kt)Ja[kt]=8;var kt;for(kt=144;kt<256;++kt)Ja[kt]=9;var kt;for(kt=256;kt<280;++kt)Ja[kt]=7;var kt;for(kt=280;kt<288;++kt)Ja[kt]=8;var kt,Of=new Jt(32);for(kt=0;kt<32;++kt)Of[kt]=5;var kt,CN=li(Ja,9,0),PN=li(Ja,9,1),TN=li(Of,5,0),wN=li(Of,5,1),Zv=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ai=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},Xv=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},Dy=function(e){return(e+7)/8|0},Uu=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Jt(e.subarray(t,r))},tx={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},MN=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rr=function(e,t,r){var n=new Error(t||MN[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Rr),!r)throw n;return n},ON=function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new Jt(0);var s=!r,a=s||t.i!=2,l=t.i;s&&(r=new Jt(o*3));var u=function(L){var le=r.length;if(L>le){var ne=new Jt(Math.max(le*2,L));ne.set(r),r=ne}},d=t.f||0,f=t.p||0,h=t.b||0,b=t.l,v=t.d,I=t.m,x=t.n,C=o*8;do{if(!b){d=ai(e,f,1);var P=ai(e,f+1,3);if(f+=3,P)if(P==1)b=PN,v=wN,I=9,x=5;else if(P==2){var N=ai(e,f,31)+257,k=ai(e,f+10,15)+4,D=N+ai(e,f+5,31)+1;f+=14;for(var F=new Jt(D),z=new Jt(19),G=0;G<k;++G)z[_y[G]]=ai(e,f+G*3,7);f+=k*3;for(var j=Zv(z),K=(1<<j)-1,Z=li(z,j,1),G=0;G<D;){var oe=Z[ai(e,f,K)];f+=oe&15;var w=oe>>4;if(w<16)F[G++]=w;else{var Q=0,ge=0;for(w==16?(ge=3+ai(e,f,3),f+=2,Q=F[G-1]):w==17?(ge=3+ai(e,f,7),f+=3):w==18&&(ge=11+ai(e,f,127),f+=7);ge--;)F[G++]=Q}}var be=F.subarray(0,N),pe=F.subarray(N);I=Zv(be),x=Zv(pe),b=li(be,I,1),v=li(pe,x,1)}else Rr(1);else{var w=Dy(f)+4,T=e[w-4]|e[w-3]<<8,O=w+T;if(O>o){l&&Rr(0);break}a&&u(h+T),r.set(e.subarray(w,O),h),t.b=h+=T,t.p=f=O*8,t.f=d;continue}if(f>C){l&&Rr(0);break}}a&&u(h+131072);for(var _e=(1<<I)-1,yt=(1<<x)-1,it=f;;it=f){var Q=b[Xv(e,f)&_e],Xe=Q>>4;if(f+=Q&15,f>C){l&&Rr(0);break}if(Q||Rr(2),Xe<256)r[h++]=Xe;else if(Xe==256){it=f,b=null;break}else{var Ue=Xe-254;if(Xe>264){var G=Xe-257,de=Ef[G];Ue=ai(e,f,(1<<de)-1)+hT[G],f+=de}var me=v[Xv(e,f)&yt],te=me>>4;me||Rr(3),f+=me&15;var pe=SN[te];if(te>3){var de=_f[te];pe+=Xv(e,f)&(1<<de)-1,f+=de}if(f>C){l&&Rr(0);break}a&&u(h+131072);var ie=h+Ue;if(h<pe){var A=i-pe,Y=Math.min(pe,ie);for(A+h<0&&Rr(3);h<Y;++h)r[h]=n[A+h]}for(;h<ie;++h)r[h]=r[h-pe]}}t.l=b,t.p=it,t.b=h,t.f=d,b&&(d=1,t.m=I,t.d=v,t.n=x)}while(!d);return h!=r.length&&s?Uu(r,0,h):r.subarray(0,h)},Us=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},wf=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},Yv=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:gT,l:0};if(o==1){var s=new Jt(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(O,N){return O.f-N.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,d=1,f=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=o-1;)a=r[r[u].f<r[f].f?u++:f++],l=r[u!=d&&r[u].f<r[f].f?u++:f++],r[d++]={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 b=new qn(h+1),v=Jv(r[d-1],b,0);if(v>t){var n=0,I=0,x=v-t,C=1<<x;for(i.sort(function(N,k){return b[k.s]-b[N.s]||N.f-k.f});n<o;++n){var P=i[n].s;if(b[P]>t)I+=C-(1<<v-b[P]),b[P]=t;else break}for(I>>=x;I>0;){var w=i[n].s;b[w]<t?I-=1<<t-b[w]++-1:++n}for(;n>=0&&I;--n){var T=i[n].s;b[T]==t&&(--b[T],++I)}v=t}return{t:new Jt(b),l:v}},Jv=function(e,t,r){return e.s==-1?Math.max(Jv(e.l,t,r+1),Jv(e.r,t,r+1)):t[e.s]=r},pT=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new qn(++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}},Mf=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},yT=function(e,t,r){var n=r.length,o=Dy(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},dT=function(e,t,r,n,o,i,s,a,l,u,d){Us(t,d++,r),++o[256];for(var f=Yv(o,15),h=f.t,b=f.l,v=Yv(i,15),I=v.t,x=v.l,C=pT(h),P=C.c,w=C.n,T=pT(I),O=T.c,N=T.n,k=new qn(19),D=0;D<P.length;++D)++k[P[D]&31];for(var D=0;D<O.length;++D)++k[O[D]&31];for(var F=Yv(k,7),z=F.t,G=F.l,j=19;j>4&&!z[_y[j-1]];--j);var K=u+5<<3,Z=Mf(o,Ja)+Mf(i,Of)+s,oe=Mf(o,h)+Mf(i,I)+s+14+3*j+Mf(k,z)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&K<=Z&&K<=oe)return yT(t,d,e.subarray(l,l+u));var Q,ge,be,pe;if(Us(t,d,1+(oe<Z)),d+=2,oe<Z){Q=li(h,b,0),ge=h,be=li(I,x,0),pe=I;var _e=li(z,G,0);Us(t,d,w-257),Us(t,d+5,N-1),Us(t,d+10,j-4),d+=14;for(var D=0;D<j;++D)Us(t,d+3*D,z[_y[D]]);d+=3*j;for(var yt=[P,O],it=0;it<2;++it)for(var Xe=yt[it],D=0;D<Xe.length;++D){var Ue=Xe[D]&31;Us(t,d,_e[Ue]),d+=z[Ue],Ue>15&&(Us(t,d,Xe[D]>>5&127),d+=Xe[D]>>12)}}else Q=CN,ge=Ja,be=TN,pe=Of;for(var D=0;D<a;++D){var de=n[D];if(de>255){var Ue=de>>18&31;wf(t,d,Q[Ue+257]),d+=ge[Ue+257],Ue>7&&(Us(t,d,de>>23&31),d+=Ef[Ue]);var me=de&31;wf(t,d,be[me]),d+=pe[me],me>3&&(wf(t,d,de>>5&8191),d+=_f[me])}else wf(t,d,Q[de]),d+=ge[de]}return wf(t,d,Q[256]),d+ge[256]},EN=new ky([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gT=new Jt(0),_N=function(e,t,r,n,o,i){var s=i.z||e.length,a=new Jt(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),u=i.l,d=(i.r||0)&7;if(t){d&&(l[0]=i.r>>3);for(var f=EN[t-1],h=f>>13,b=f&8191,v=(1<<r)-1,I=i.p||new qn(32768),x=i.h||new qn(v+1),C=Math.ceil(r/3),P=2*C,w=function(ae){return(e[ae]^e[ae+1]<<C^e[ae+2]<<P)&v},T=new ky(25e3),O=new qn(288),N=new qn(32),k=0,D=0,F=i.i||0,z=0,G=i.w||0,j=0;F+2<s;++F){var K=w(F),Z=F&32767,oe=x[K];if(I[Z]=oe,x[K]=Z,G<=F){var Q=s-F;if((k>7e3||z>24576)&&(Q>423||!u)){d=dT(e,l,0,T,O,N,D,z,j,F-j,d),z=k=D=0,j=F;for(var ge=0;ge<286;++ge)O[ge]=0;for(var ge=0;ge<30;++ge)N[ge]=0}var be=2,pe=0,_e=b,yt=Z-oe&32767;if(Q>2&&K==w(F-yt))for(var it=Math.min(h,Q)-1,Xe=Math.min(32767,F),Ue=Math.min(258,Q);yt<=Xe&&--_e&&Z!=oe;){if(e[F+be]==e[F+be-yt]){for(var de=0;de<Ue&&e[F+de]==e[F+de-yt];++de);if(de>be){if(be=de,pe=yt,de>it)break;for(var me=Math.min(yt,de-2),te=0,ge=0;ge<me;++ge){var ie=F-yt+ge&32767,A=I[ie],Y=ie-A&32767;Y>te&&(te=Y,oe=ie)}}}Z=oe,oe=I[Z],yt+=Z-oe&32767}if(pe){T[z++]=268435456|Kv[be]<<18|uT[pe];var L=Kv[be]&31,le=uT[pe]&31;D+=Ef[L]+_f[le],++O[257+L],++N[le],G=F+be,++k}else T[z++]=e[F],++O[e[F]]}}for(F=Math.max(F,G);F<s;++F)T[z++]=e[F],++O[e[F]];d=dT(e,l,u,T,O,N,D,z,j,F-j,d),u||(i.r=d&7|l[d/8|0]<<3,d-=7,i.h=x,i.p=I,i.i=F,i.w=G)}else{for(var F=i.w||0;F<s+u;F+=65535){var ne=F+65535;ne>=s&&(l[d/8|0]=u,ne=s),d=yT(l,d+1,e.subarray(F,ne))}i.i=s}return Uu(a,0,n+Dy(d)+o)},ade=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}(),lde=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=ade[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var AN=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new Jt(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return _N(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)},bT=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},yN=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 u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var d=u.indexOf(" ",8)+1;t+=u.slice(d,u.indexOf("(",d))}else{t+=u;for(var f in a.prototype)t+=";"+l+".prototype."+f+"="+a.prototype[f].toString()}else t+=u}else r[l]=a}return t},qv=[],cde=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},ude=function(e,t,r,n){if(!qv[r]){for(var o="",i={},s=e.length-1,a=0;a<s;++a)o=yN(e[a],o,i);qv[r]={c:yN(e[s],o,i),e:i}}var l=bT({},qv[r].e);return sde(qv[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,cde(l),n)},pde=function(){return[Jt,qn,ky,Ef,_f,_y,hT,SN,PN,wN,Ay,MN,li,Zv,ai,Xv,Dy,Uu,Rr,ON,xT,rx,kN]},dde=function(){return[Jt,qn,ky,Ef,_f,_y,Kv,uT,CN,Ja,TN,Of,Ay,EN,gT,li,Us,wf,Yv,Jv,pT,Mf,yT,dT,Dy,Uu,_N,AN,vT,rx]};var rx=function(e){return postMessage(e,[e.buffer])},kN=function(e){return e&&{out:e.size&&new Jt(e.size),dictionary:e.dictionary}},DN=function(e,t,r,n,o,i){var s=ude(r,n,o,function(a,l){s.terminate(),i(a,l)});return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}};var Vs=function(e,t){return e[t]|e[t+1]<<8},Gi=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},cT=function(e,t){return Gi(e,t)+Gi(e,t+4)*4294967296},pn=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function fde(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Rr(7),DN(e,t,[dde],function(n){return rx(vT(n.data[0],n.data[1]))},0,r)}function vT(e,t){return AN(e,t||{},0,0)}function mde(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Rr(7),DN(e,t,[pde],function(n){return rx(xT(n.data[0],kN(n.data[1])))},1,r)}function xT(e,t){return ON(e,{i:2},t&&t.out,t&&t.dictionary)}var FN=function(e,t,r,n){for(var o in e){var i=e[o],s=t+o,a=n;Array.isArray(i)&&(a=bT(n,i[1]),i=i[0]),i instanceof Jt?r[s]=[i,a]:(r[s+="/"]=[new Jt(0),a],FN(i,s,r,n))}},gN=typeof TextEncoder<"u"&&new TextEncoder,fT=typeof TextDecoder<"u"&&new TextDecoder,hde=0;try{fT.decode(gT,{stream:!0}),hde=1}catch{}var yde=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:Uu(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 Qv(e,t){if(t){for(var r=new Jt(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(gN)return gN.encode(e);for(var o=e.length,i=new Jt(e.length+(e.length>>1)),s=0,a=function(d){i[s++]=d},n=0;n<o;++n){if(s+5>i.length){var l=new Jt(s+8+(o-n<<1));l.set(i),i=l}var u=e.charCodeAt(n);u<128||t?a(u):u<2048?(a(192|u>>6),a(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++n)&1023,a(240|u>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|u&63)):(a(224|u>>12),a(128|u>>6&63),a(128|u&63))}return Uu(i,0,s)}function IT(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(fT)return fT.decode(e);var o=yde(e),i=o.s,r=o.r;return r.length&&Rr(8),i}}var gde=function(e,t){return t+30+Vs(e,t+26)+Vs(e,t+28)},bde=function(e,t,r){var n=Vs(e,t+28),o=IT(e.subarray(t+46,t+46+n),!(Vs(e,t+8)&2048)),i=t+46+n,s=Gi(e,t+20),a=r&&s==4294967295?vde(e,i):[s,Gi(e,t+24),Gi(e,t+42)],l=a[0],u=a[1],d=a[2];return[Vs(e,t+10),l,u,o,i+Vs(e,t+30)+Vs(e,t+32),d]},vde=function(e,t){for(;Vs(e,t)!=1;t+=4+Vs(e,t+2));return[cT(e,t+12),cT(e,t+4),cT(e,t+20)]},mT=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&Rr(9),t+=n+4}return t},bN=function(e,t,r,n,o,i,s,a){var l=n.length,u=r.extra,d=a&&a.length,f=mT(u);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),b=h.getFullYear()-1980;if((b<0||b>119)&&Rr(10),pn(e,t,b<<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,f),t+=16,s!=null&&(pn(e,t,d),pn(e,t+6,r.attrs),pn(e,t+10,s),t+=14),e.set(n,t),t+=l,f)for(var v in u){var I=u[v],x=I.length;pn(e,t,+v),pn(e,t+2,x),e.set(I,t+4),t+=4+x}return d&&(e.set(a,t),t+=d),t},xde=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 LN(e,t,r){r||(r=t,t={}),typeof r!="function"&&Rr(7);var n={};FN(e,"",n,t);var o=Object.keys(n),i=o.length,s=0,a=0,l=i,u=new Array(i),d=[],f=function(){for(var x=0;x<d.length;++x)d[x]()},h=function(x,C){ex(function(){r(x,C)})};ex(function(){h=r});var b=function(){var x=new Jt(a+22),C=s,P=a-s;a=0;for(var w=0;w<l;++w){var T=u[w];try{var O=T.c.length;bN(x,a,T,T.f,T.u,O);var N=30+T.f.length+mT(T.extra),k=a+N;x.set(T.c,k),bN(x,s,T,T.f,T.u,O,a,T.m),s+=16+N+(T.m?T.m.length:0),a=k+O}catch(D){return h(D,null)}}xde(x,s,u.length,P,C),h(null,x)};i||b();for(var v=function(x){var C=o[x],P=n[C],w=P[0],T=P[1],O=lde(),N=w.length;O.p(w);var k=Qv(C),D=k.length,F=T.comment,z=F&&Qv(F),G=z&&z.length,j=mT(T.extra),K=T.level==0?0:8,Z=function(oe,Q){if(oe)f(),h(oe,null);else{var ge=Q.length;u[x]=bT(T,{size:N,crc:O.d(),c:Q,f:k,m:z,u:D!=C.length||z&&F.length!=G,compression:K}),s+=30+D+j+ge,a+=76+2*(D+j)+(G||0)+ge,--i||b()}};if(D>65535&&Z(Rr(11,0,1),null),!K)Z(null,w);else if(N<16e4)try{Z(null,vT(w,T))}catch(oe){Z(oe,null)}else d.push(fde(w,T,Z))},I=0;I<l;++I)v(I);return f}var ex=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function RN(e,t,r){r||(r=t,t={}),typeof r!="function"&&Rr(7);var n=[],o=function(){for(var x=0;x<n.length;++x)n[x]()},i={},s=function(x,C){ex(function(){r(x,C)})};ex(function(){s=r});for(var a=e.length-22;Gi(e,a)!=101010256;--a)if(!a||e.length-a>65558)return s(Rr(13,0,1),null),o;var l=Vs(e,a+8);if(l){var u=l,d=Gi(e,a+16),f=d==4294967295||u==65535;if(f){var h=Gi(e,a-12);f=Gi(e,h)==101075792,f&&(u=l=Gi(e,h+32),d=Gi(e,h+48))}for(var b=t&&t.filter,v=function(x){var C=bde(e,d,f),P=C[0],w=C[1],T=C[2],O=C[3],N=C[4],k=C[5],D=gde(e,k);d=N;var F=function(G,j){G?(o(),s(G,null)):(j&&(i[O]=j),--l||s(null,i))};if(!b||b({name:O,size:w,originalSize:T,compression:P}))if(!P)F(null,Uu(e,D,D+w));else if(P==8){var z=e.subarray(D,D+w);if(T<524288||w>.8*T)try{F(null,xT(z,{out:new Jt(T)}))}catch(G){F(G,null)}else n.push(mde(z,{size:T},F))}else F(Rr(14,"unknown compression type "+P,1),null);else F(null,null)},I=0;I<u;++I)v(I)}else s(null,{});return o}p();var Ide=e=>{if(e!=null)return e.trim()===""?void 0:e},Sde=e=>e!=null,nx=(e,t,r=0)=>{var n;if(R.IsNull(e))return"null";if(R.IsUndefined(e))return"undefined";if(R.IsString(e))return"<string>";if(R.IsNumber(e))return"<number>";if(R.IsBoolean(e))return"<boolean>";if(R.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(R.IsRef(e)){let o=t.find(i=>i.$id===e.$ref);return o==null?e.$ref:nx(o,t,r)}if(R.IsArray(e))return"".concat(nx(e.items,t,r+1),"[]");if(R.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let i="".concat(e.anyOf.map(s=>nx(s,t,r+1)).filter(Sde).join(" | "));return r>0?"(".concat(i,")"):i}return(n=e.$id)!=null?n:""},Cde=(e,t,r)=>{var i;let n=t.message;R.IsUnion(t.schema)&&(n="Expected one of: ".concat(nx(t.schema,r)));let o="#/definitions/".concat(e).concat((i=Ide(t.path))!=null?i:"");return"".concat(o,": ").concat(n)},ox=(e,t,r)=>{let n=t.First();if(n!=null)return Cde(e,n,r)};var Af;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(Af||(Af={}));var kf=class extends Error{constructor(r,n){super(n);m(this,"name");m(this,"kind");this.name="CompressError",this.kind=r}},Pde=e=>new kf(Af.Archive,e.message),Tde=e=>{let t=Object.values(tx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},wde=(e,t,r)=>{var n;return new kf(Af.Validate,(n=ox(e,t,r))!=null?n:"Unknown validate error")},Mde=e=>new kf(Af.Encode,e.message),Ode=e=>new kf(Af.Unknown,e instanceof Error?e.message:String(e)),ST=(e,t,r)=>t instanceof Bu?Mde(t):t instanceof oi?wde(e,t,r):Tde(t)?Pde(t):Ode(t);p();var Df;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(Df||(Df={}));var Ff=class extends Error{constructor(r,n){super(n);m(this,"name");m(this,"kind");this.name="DecompressError",this.kind=r}},Ede=e=>new Ff(Df.Unarchive,e.message),_de=e=>{let t=Object.values(tx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},Ade=(e,t,r)=>{var n;return new Ff(Df.Validate,(n=ox(e,t,r))!=null?n:"Unknown validate error")},kde=e=>new Ff(Df.Decode,e.message),Dde=e=>new Ff(Df.Unknown,e instanceof Error?e.message:String(e)),CT=(e,t,r)=>t instanceof Nu?kde(t):t instanceof oi?Ade(e,t,r):_de(t)?Ede(t):Dde(t);p();p();p();var Fde=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Lde=[0,31,28,31,30,31,30,31,31,30,31,30,31],Rde=e=>e%4===0&&(e%100!==0||e%400===0),ix=e=>{let t=Fde.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&&Rde(r)?29:Lde[n])};p();var Nde=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,sx=e=>{let t=Nde.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 u=n-l*s,d=r-a*s-(u<0?1:0);return(d===23||d===-1)&&(u===59||u===-1)&&o<61};var Bde=/t|\s/i,NN=e=>{let t=e.split(Bde);return t.length===2&&ix(t[0])&&sx(t[1])};p();var $de=/\/|:/,jde=/^(?:[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,BN=e=>$de.test(e)&&jde.test(e);var Gde=[["date",ix],["time",sx],["date-time",NN],["uri",BN]],$N=()=>{for(let[e,t]of Gde)try{Mv.Format(e,t)}catch(r){if(r instanceof wy)continue;throw r}};p();p();p();var jN=e=>e instanceof Error?e:new Error(String(e));var ax=e=>(...t)=>{try{return ue(e(...t))}catch(r){return ye(jN(r))}};var Ude=ax((e,t)=>{let r={};for(let n of t)for(let o of n.intoBundle(e))r[o.path]=Qv(JSON.stringify(o.contents));return r}),PT=async(e,t,r)=>Ude(e,t).andThenAsync(n=>new Promise(o=>{LN(n,{...r,consume:!0},(i,s)=>{o(i?ye(i):ue(s))})}));p();p();function lx(e,t,r=[]){let n={...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=Vde(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 u=new Map(i.map(h=>[GN(h,a),h])),f=l.map(h=>{let b=u.get(GN(h,a));return b?lx(h,b,r):h});n[s]=f}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]=lx(a,i,r):n[o]=i}}else n[o]=i;return n}function Vde(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 GN(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}var zde=e=>e,Hde=e=>JSON.parse(IT(e)),Wde=(e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,zde)!==void 0),qde=ax((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,Hde);if(s){r=lx(r,s,[]);break}}}return r}),TT=async(e,t)=>new Promise(r=>RN(e,{filter:n=>Wde(n,t)},(n,o)=>{r(n?ye(n):ue(o))})).then(r=>r.andThen(n=>qde(n,t)));p();var Zde=e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string",Xde=e=>{if(e.length<2)return!1;let t=e.filter(Zde);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},cx=e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&Xde(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,cx(r)])):Array.isArray(e)?e.map(cx):e;p();var ux=e=>typeof e=="object"&&e!=null&&"$ref"in e?{...e,$ref:"#/definitions/".concat(e.$ref)}:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ux(r)])):Array.isArray(e)?e.map(ux):e;var Lf;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(Lf||(Lf={}));var Yde=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}}),Kde=(...e)=>{let t=new Map;for(let r of Yde(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return ye({kind:Lf.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 ue(t)},ci,Vu,Qa,Ui,wT=class wT{constructor(t,r,n,o){M(this,ci);M(this,Vu);M(this,Qa,[]);M(this,Ui);_(this,ci,t),_(this,Vu,r),_(this,Qa,n),_(this,Ui,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(!R.IsSchema(n))return ye({kind:Lf.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let o=Kde(GP.values(),FP.values(),RP.values(),BP.values(),$P.values(),HP.values(),t.extensions.flatMap(i=>{var s;return(s=i.references)!=null?s:[]}).values());if(!o.isOk())return o;try{$N();let i=Wv.Compile(n,[...o.value.values()]);return ue(new wT(n,i,t.extensions,o.value))}catch(i){return i instanceof Ae?ye({kind:Lf.TypeboxError,message:i.message,original:i}):ye({kind:Lf.UnknownError,message:"An unknown error occurred while compiling the schema",original:i})}}is(t){return c(this,Vu).Check(t)}parse(t){return c(this,Vu).Check(t)?ue(t):ye(c(this,Vu).Errors(t))}decode(t){try{return ue(fN(c(this,ci),[...c(this,Ui).values()],t))}catch(r){return ye(r)}}encode(t){try{return ue(mN(c(this,ci),[...c(this,Ui).values()],t))}catch(r){return ye(r)}}verify(t){for(let r of c(this,Qa))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return ye(n.error)}return ue(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([c(this,ci),...c(this,Ui).values()])),r=cx(ux({$id:"#/definitions/".concat((n=c(this,ci).$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=>PT(r,c(this,Qa))).then(r=>r.mapErr(n=>{var o;return ST((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>PT(r,c(this,Qa))).then(r=>r.mapErr(n=>{var o;return ST((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}async decompress(t){return TT(t,c(this,Qa)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var o;return CT((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}async decompressUnsafe(t){return TT(t,c(this,Qa)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var o;return CT((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}};ci=new WeakMap,Vu=new WeakMap,Qa=new WeakMap,Ui=new WeakMap;var px=wT;var Rf,dx=class{constructor(){M(this,Rf,[]);this.extend=this.extend.bind(this)}extend(t){return c(this,Rf).push(t),this}extendOptional(t){let r={...t,schema:S.Partial(t.schema)};return c(this,Rf).push(r),this}build(){return px.create(this)}get extensions(){return c(this,Rf)}};Rf=new WeakMap;var UN=()=>new dx().extend(MR).extend(DR).extend(NR);p();p();p();var Vi;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Vi||(Vi={}));var VN=e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return ue(!0);let r=Object.entries(t).map(([i,s])=>({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 ye({kind:Vi.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:"navigationFlags.".concat(i.key)}});if(i.index!=n){if(o!=31)return ye({kind:Vi.NavigationFlagMissingDeclaration,properties:{index:n,bit:o+1,path:"navigationFlags"}});if(i.index!=n+1||i.bit!=0)return ye({kind:Vi.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=i.index,o=0}else{if(i.bit!==o+1)return ye({kind:Vi.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:o+1,path:"navigationFlags"}});o=i.bit}}return ue(!0)};p();var zN=2**32-1,fx=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}},Fy=(e,t,r)=>{if(t.index==-1&&e.length===0)return ue(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return ye({kind:Vi.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>zN)return ye({kind:Vi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:zN,path:r}});continue}else if(i>t.flag)return ye({kind:Vi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:t.flag,path:r}})}return ue(!0)};p();function Ly(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}var Jde=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"}),HN=S.Intersect([Jde,$i],{$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.'}),MT={accessible:"accessible",outdoors:"outdoors"},WN=S.Record(S.String(),HN,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),Qde=S.Object({navigationFlags:S.Ref(WN)},{$id:"NavigationFlagsSchema"}),mx=S.Array(S.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),OT=S.Object({flags:S.Ref(mx)},{$id:"WithFlags"}),zu=S.Intersect([hf,OT],{$id:"FlaggedGeometryAnchor"}),efe=S.Object({geometryAnchor:zu},{$id:"WithFlaggedGeometryAnchor"}),tfe=S.Object({geometryAnchors:S.Array(zu)},{$id:"WithFlaggedGeometryAnchors"}),qN={name:"ext:mvf-navigation-flags",schema:Qde,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:[HN,WN,mx,zu,efe,tfe],integrityCheck:VN};p();var ZN=e=>{if(e.connections==null)return ue(!0);let t=Er(e),r=fx(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=Fy(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=Fy(s.flags,r,"connections[".concat(n,"].exits[").concat(i,"]"));if(l.isErr())return l}}return ue(!0)};var YN=Kt("c","ConnectionId"),{schema:rfe,values:VHe,record:nfe}=yo(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),KN=rfe;var ET=nfe,JN=S.Intersect([S.Object({id:S.Ref(YN,{description:"The unique identifier for the connection."}),entrances:S.Array(S.Ref(zu)),exits:S.Array(S.Ref(zu)),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(KN,{description:"The type of connection."})}),$i,ji],{$id:"ConnectionsProperties"}),QN=S.Array(S.Ref(JN),{$id:"ConnectionsCollection"}),ofe=S.Object({connections:S.Ref(QN)},{$id:"ConnectionsExtensionSchema"}),XN="connections.json",eB={name:"ext:connections",schema:ofe,intoBundle:function*(e){e.connections!=null&&(yield{path:XN,contents:e.connections})},fromBundle:(e,t,r)=>{if(e===XN)return{connections:r(t)}},references:[JN,QN,KN,YN,zu,mx],integrityCheck:ZN};p();p();var tB=e=>{if(e.defaultStyle==null)return ue(!0);let t=Er(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 ue(!0)};var rB=S.Intersect([Lu(),ji,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"}),nB=S.Record(S.String(),S.Ref(rB),{$id:"DefaultStyleCollection",additionalProperties:!1}),ife=S.Object({defaultStyle:S.Ref(nB)},{$id:"DefaultStyleSchema"}),oB={name:"ext:mvf-default-style",schema:ife,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:[rB,nB],integrityCheck:tB};p();p();p();var Hu=Kt("lcat","LocationCategoryId"),_T=S.Intersect([S.Object({id:S.Ref(Hu),parent:S.Optional(S.Ref(Hu))}),Fu(["name"]),ji],{$id:"LocationCategory"}),iB=[Hu,_T];p();p();var Wu;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Wu||(Wu={}));var sB=e=>{var o,i,s,a,l,u,d,f,h;if(e.locationCategories==null&&e.locations==null)return ue(!0);let t=new Set((i=(o=e.locationCategories)==null?void 0:o.map(b=>b.id))!=null?i:[]);for(let b of(s=e.locationCategories)!=null?s:[])if(b.parent!=null&&!t.has(b.parent))return ye({kind:Wu.UnknownParentCategoryError,properties:{categoryId:b.id,parentCategoryId:b.parent}});let r=Er(e);for(let b of(a=e.locations)!=null?a:[]){for(let v of b.categories)if(!t.has(v))return ye({kind:Wu.UnknownCategoryError,properties:{locationId:b.id,categoryId:v}});for(let v of b.geometryAnchors){let I=r(v.floorId,v.geometryId);if(I.isErr())return I}}let n=new Set((u=(l=e.locations)==null?void 0:l.map(b=>b.id))!=null?u:[]);for(let b of(d=e.locationInstances)!=null?d:[]){if(!n.has(b.parentId))return ye({kind:Wu.UnknownParentLocationError,properties:{locationInstanceId:b.id,parentLocationId:b.parentId}});for(let v of(f=b.categories)!=null?f:[])if(!t.has(v))return ye({kind:Wu.UnknownCategoryError,properties:{locationId:b.id,categoryId:v}});for(let v of(h=b.geometryAnchors)!=null?h:[]){let I=r(v.floorId,v.geometryId);if(I.isErr())return I}}return ue(!0)};p();var qu=Kt("loc","LocationId"),hx=Kt("loci","LocationInstanceId"),aB=S.Object({name:S.String(),url:S.String({format:"uri"})},{$id:"LocationSocial"}),lB=S.Object({url:S.String({format:"uri"})},{$id:"LocationImage"}),AT=S.Object({label:S.String(),url:S.String({format:"uri"})},{$id:"LocationLink"}),kT=S.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),cB=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"}),sfe="PublicHolidays",DT=S.Union([cB,S.Literal(sfe)],{$id:"OpeningHoursDayOrPublicHoliday"}),yx=S.Object({"@type":S.Optional(S.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:S.Optional(S.Ref(kT,{description:"The time the opening hours start"})),closes:S.Optional(S.Ref(kT,{description:"The time the opening hours end"})),dayOfWeek:S.Optional(S.Union([S.Ref(DT),S.Array(S.Ref(DT))],{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"}),gx=S.Intersect([S.Object({id:S.Ref(qu),categories:S.Array(S.Ref(Hu)),logo:S.Optional(S.String({format:"uri"})),phone:S.Optional(S.String()),social:S.Array(S.Ref(aB)),images:S.Array(S.Ref(lB)),links:S.Array(S.Ref(AT)),website:S.Optional(S.Ref(AT)),openingHours:S.Optional(S.Array(S.Ref(yx)))}),Fu(["name"]),Lu(),ji],{$id:"Location"}),FT=S.Intersect([S.Object({id:S.Ref(hx),parentId:S.Ref(qu)}),S.Partial(S.Omit(gx,["id","parentId"]))],{$id:"LocationInstance"}),bx=[qu,hx,aB,lB,AT,kT,cB,DT,yx,gx,FT];var afe=S.Object({locations:S.Array(S.Ref(gx)),locationCategories:S.Array(S.Ref(_T)),locationInstances:S.Optional(S.Array(S.Ref(FT)))},{$id:"LocationsExtensionSchema"}),uB="locations.json",pB="location-categories.json",dB="location-instances.json",fB={name:"ext:locations",schema:afe,intoBundle:function*(e){e.locations!=null&&(yield{path:uB,contents:e.locations}),e.locationCategories!=null&&(yield{path:pB,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:dB,contents:e.locationInstances})},fromBundle:(e,t,r)=>{if(e===uB)return{locations:r(t)};if(e===pB)return{locationCategories:r(t)};if(e===dB)return{locationInstances:r(t)}},references:[...iB,...bx],integrityCheck:sB};p();p();var zs;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(zs||(zs={}));var mB=e=>{var l,u,d,f,h,b,v,I,x,C,P,w,T,O,N,k,D,F,z,G;if(e.enterprise==null)return ue(!0);let t=e.enterprise,r=new Set((u=(l=e.locationCategories)==null?void 0:l.map(j=>j.id))!=null?u:[]);for(let j of(d=t.categories)!=null?d:[])if(!r.has(j.categoryId))return ye({kind:zs.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:j.id,locationCategoryId:j.categoryId}});let n=new Set((h=(f=e.locations)==null?void 0:f.map(j=>j.id))!=null?h:[]);for(let j of(b=t.locations)!=null?b:[]){if(!n.has(j.locationId))return ye({kind:zs.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:j.id,locationId:j.locationId}});for(let K of(v=j.siblingGroups)!=null?v:[])for(let Z of(I=K.siblings)!=null?I:[])if(!n.has(Z))return ye({kind:zs.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:j.id,siblingLocationId:Z,label:K.label}})}let o=new Set((C=(x=e.enterprise.locations)==null?void 0:x.map(j=>j.id))!=null?C:[]);if(((P=t.venue)==null?void 0:P.topLocations)!=null){for(let j of t.venue.topLocations)if(!o.has(j))return ye({kind:zs.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:j}})}let i=new Set((T=(w=e.locationInstances)==null?void 0:w.map(j=>j.id))!=null?T:[]);for(let j of(O=t.locationInstances)!=null?O:[]){if(!o.has(j.parentId))return ye({kind:zs.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:j.id,enterpriseLocationId:j.parentId}});if(!i.has(j.locationInstanceId))return ye({kind:zs.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:j.id,locationInstanceId:j.locationInstanceId}});for(let K of(N=j.siblingGroups)!=null?N:[])for(let Z of(k=K.siblings)!=null?k:[])if(!n.has(Z))return ye({kind:zs.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:j.id,siblingLocationId:Z,label:K.label}})}let s=Wa(e),a=Er(e);for(let[j,K]of xt((D=t.floorText)!=null?D:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of K.features){if(!("geometryId"in oe.properties))continue;let Q=a(j,oe.properties.geometryId);if(Q.isErr())return Q}}for(let[j,K]of xt((F=t.textures)!=null?F:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of K){let Q=a(j,oe.geometryId);if(Q.isErr())return Q}}for(let[j,K]of xt((z=t.layers)!=null?z:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of Je(K!=null?K:{})){let Q=a(j,oe);if(Q.isErr())return Q}}for(let[j,K]of xt((G=t.textAreas)!=null?G:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of K.features)if("geometryId"in oe.properties){let Q=a(j,oe.properties.geometryId);if(Q.isErr())return Q}}return ue(!0)};p();p();var Zu=Kt("el","EnterpriseLocationId"),LT=Kt("ec","EnterpriseCategoryId"),RT=Kt("eli","EnterpriseLocationInstanceId"),NT=Kt("ev","EnterpriseVenueId"),BT=Kt("eft","EnterpriseFloorTextId"),hB=[Zu,LT,RT,NT,BT];var yB=S.Object({id:S.Ref(LT),categoryId:S.Ref(Hu),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"}),$T=S.Object({categories:S.Optional(S.Array(S.Ref(yB)))},{$id:"EnterpriseCategoriesSchema"}),gB=[yB,$T];p();var bB=yo(["left","center","right"]),lfe=bB.schema,qWe=bB.values,jT=S.Object({id:S.Ref(BT),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:lfe},{$id:"FloorTextCommonProperties"}),GT=S.Intersect([S.Ref(jT),ho],{$id:"AnchoredFloorTextProperties"}),UT=S.Intersect([S.Ref(jT),S.Object({verticalOffset:S.Number()})],{$id:"FloatingFloorTextProperties"}),vB=S.Union([S.Ref(GT),S.Ref(UT)],{$id:"FloorTextProperties"}),xB=ln(On,S.Ref(vB),{$id:"FloorTextFeature"}),cfe=ln(On,S.Ref(GT),{$id:"AnchoredFloorTextFeature"}),ufe=ln(On,S.Ref(UT),{$id:"FloatingFloorTextFeature"}),IB=Wn(S.Ref(xB),{$id:"EnterpriseFloorTextFeatureCollection"}),SB=S.Record(st,S.Ref(IB),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),VT=S.Object({floorText:S.Optional(S.Ref(SB))},{$id:"EnterpriseFloorTextSchema"}),CB=[jT,GT,UT,vB,xB,cfe,ufe,IB,SB,VT];p();var PB=pr(S.Record(Mn,S.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),TB=pr(S.Record(st,S.Ref(PB),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),zT=S.Object({layers:S.Optional(S.Ref(TB))},{$id:"EnterpriseLayersSchema"}),wB=[PB,TB,zT];p();p();p();var HT=yo(["closed-temporarily","new","pop-up","coming-soon","relocated"]),pfe=HT.schema,oqe=HT.values,iqe=HT.record,WT=S.Object({type:pfe,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."}),qT=S.Object({label:S.String(),siblings:S.Array(S.Ref(qu))},{$id:"SiblingGroup"}),vx=S.Object({name:S.String(),code:S.String()},{$id:"Language"}),MB=[WT,qT,vx];var xx=S.Object({id:S.Ref(Zu),locationId:S.Ref(qu),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(WT),{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(qT))),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"}),ZT=S.Object({locations:S.Optional(S.Array(S.Ref(xx)))},{$id:"EnterpriseLocationsSchema"}),OB=[xx,ZT];var EB=S.Intersect([S.Object({id:S.Ref(RT),parentId:S.Ref(Zu),locationInstanceId:S.Ref(hx)}),S.Partial(S.Omit(xx,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),XT=S.Object({locationInstances:S.Optional(S.Array(S.Ref(EB)))},{$id:"EnterpriseLocationInstancesSchema"}),_B=[EB,XT];p();var YT=yo(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),AB=YT.schema,Pqe=YT.values,Tqe=YT.record,KT=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(AB),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"}),kB=S.Intersect([S.Ref(KT),ho],{$id:"EnterpriseAnchoredTextAreaProperties"}),DB=S.Intersect([S.Ref(KT),S.Object({verticalOffset:S.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),FB=S.Union([kB,DB],{$id:"EnterpriseTextAreaProperties"}),LB=ln(S.Ref(On),FB,{$id:"EnterpriseTextAreaFeature"}),RB=Wn(S.Ref(LB),{$id:"EnterpriseTextAreaCollection"}),NB=S.Record(st,S.Ref(RB),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),BB=S.Object({textAreas:S.Optional(S.Ref(NB))},{$id:"EnterpriseTextAreasSchema"}),$B=[AB,KT,kB,DB,FB,LB,RB,NB];p();var JT=S.Object({u:S.Number(),v:S.Number()},{$id:"EnterpriseTextureUV"}),QT=yo(["top","side"],{$id:"EnterpriseTextureFace"}),jB=QT.schema,_qe=QT.values,Aqe=QT.record,ew=yo(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),GB=ew.schema,kqe=ew.values,Dqe=ew.record,UB=S.Tuple([yf,gf,yf,gf],{$id:"EnterpriseTextureBounds"}),VB=S.Intersect([S.Object({repeat:S.Ref(JT),offset:S.Ref(JT),rotation:S.Number({minimum:0,maximum:360}),path:S.String({format:"uri"}),face:S.Ref(jB),surface:S.Ref(GB),bounds:S.Ref(UB)},{$id:"EnterpriseTextureProperties"}),ho],{$id:"EnterpriseTexture"}),zB=S.Array(S.Ref(VB),{$id:"EnterpriseTextures"}),HB=S.Record(st,S.Ref(zB),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),tw=S.Object({textures:S.Optional(S.Ref(HB))},{$id:"EnterpriseTexturesSchema"}),WB=[VB,zB,tw,JT,jB,GB,UB,HB];p();var qB=S.Intersect([S.Object({id:S.Ref(NT),slug:S.String(),defaultLanguage:S.Ref(vx),languages:S.Array(S.Ref(vx)),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(Zu))),operationHours:S.Optional(S.Array(S.Ref(yx))),coverImage:S.Optional(S.String({format:"uri"}))}),Fu(["name"]),ji],{$id:"EnterpriseVenue"}),rw=S.Object({venue:S.Optional(S.Ref(qB))},{$id:"EnterpriseVenueSchema"}),ZB=[qB,rw];var YB=S.Intersect([rw,ZT,XT,$T,tw,VT,zT,BB],{$id:"EnterpriseProperties"}),XB=S.Object({enterprise:S.Optional(S.Ref(YB))},{$id:"EnterpriseExtensionSchema"}),dfe=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,KB={name:"ext:enterprise",schema:XB,intoBundle:function*(e){var r,n,o,i,s,a;if(e.enterprise==null)return;let t=e.enterprise;for(let l of Je(t))switch(l){case"floorText":for(let u of Je((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(u,".geojson"),contents:((n=t.floorText)!=null?n:{})[u]};continue;case"textures":for(let u of Je((o=t.textures)!=null?o:{}))yield{path:"enterprise/textures/".concat(u,".json"),contents:((i=t.textures)!=null?i:{})[u]};continue;case"textAreas":for(let u of Je((s=t.textAreas)!=null?s:{}))yield{path:"enterprise/textAreas/".concat(u,".geojson"),contents:((a=t.textAreas)!=null?a:{})[u]};continue;default:yield{path:"enterprise/".concat(l,".json"),contents:t[l]};continue}},fromBundle:(e,t,r)=>{let n=e.match(dfe);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:[YB,XB,...ZB,...OB,..._B,...gB,...WB,...wB,...CB,...$B,...hB,...MB,...bx],integrityCheck:mB};p();p();p();p();var Ix;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Ix||(Ix={}));var JB=e=>{if(e.floorStacks==null)return ue(!0);let t=Wa(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 ye({kind:Ix.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return ue(!0)};var Sx=Kt("fs","FloorStackId"),e$=S.Intersect([S.Object({id:S.Ref(Sx,{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."}))}),$i],{$id:"FloorStacksProperties"}),t$=S.Array(S.Ref(e$),{$id:"FloorStackCollection"}),ffe=S.Object({floorStacks:S.Ref(t$)},{$id:"FloorStackExtensionSchema"}),QB="floor-stacks.json",r$={name:"ext:floor-stacks",schema:ffe,intoBundle:function*(e){e.floorStacks!=null&&(yield{path:QB,contents:e.floorStacks})},fromBundle:(e,t,r)=>{if(e===QB)return{floorStacks:r(t)}},references:[Sx,e$,t$],integrityCheck:JB};p();p();var Ry;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(Ry||(Ry={}));var n$=e=>{if(e.facade==null)return ue(!0);if(e.floorStacks==null)return ye({kind:Ry.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Er(e);for(let[n,o]of xt(e.facade))if(o!=null){if(!t.has(n))return ye({kind:Ry.UnknownFloorStackError,properties:{floorStackId:n}});for(let i of o.geometryAnchors){let s=r(i.floorId,i.geometryId);if(s.isErr())return s}}return ue(!0)};var o$=Kt("fc","FacadeId"),i$=S.Intersect([S.Object({id:S.Ref(o$)}),Lu({minItems:1})],{$id:"FacadeProperties"}),mfe=S.Object({facade:pr(S.Record(Sx,S.Ref(i$),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),hfe=/^facade\/(.*)\.json$/,s$={name:"ext:facade",schema:mfe,intoBundle:function*(e){if(e.facade!=null)for(let t of Je(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(hfe))==null?void 0:o[1];if(n)return{facade:{[n]:r(t)}}},references:[o$,i$],integrityCheck:n$};p();p();var a$=e=>{if(e.floorImages==null)return ue(!0);let t=Er(e);for(let[r,n]of xt(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 ue(!0)};var nw=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"}),l$=S.Intersect([S.Ref(nw),ho],{$id:"AnchoredFloorImageProperties"}),c$=S.Intersect([S.Ref(nw),S.Object({verticalOffset:S.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),u$=S.Union([l$,c$],{$id:"FloorImageProperties"}),p$=ln(S.Ref(On),u$,{$id:"FloorImageFeature"}),d$=Wn(S.Ref(p$),{$id:"FloorImageCollection"}),yfe=S.Object({floorImages:pr(S.Record(st,S.Ref(d$),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),gfe=/^floorImages\/(.*)\.geojson$/,f$={name:"ext:floor-images",schema:yfe,intoBundle:function*(e){if(e.floorImages!=null)for(let t of Je(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(gfe))==null?void 0:o[1];if(n)return{floorImages:{[n]:r(t)}}},references:[nw,l$,c$,u$,p$,d$],integrityCheck:a$};p();p();var m$=e=>{if(e.kinds==null)return ue(!0);let t=Er(e);for(let[r,n]of xt(e.kinds))if(n!=null)for(let o of Je(n)){let i=t(r,o);if(i.isErr())return i}return ue(!0)};var{values:nXe,schema:bfe,record:oXe}=yo(["room","hallway","wall","desk","poi","area"],{$id:"Kind"}),h$=bfe;var y$=pr(S.Record(Mn,S.Ref(h$),{additionalProperties:!1,$id:"GeometryKinds"})),vfe=S.Object({kinds:pr(S.Record(st,S.Ref(y$),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),xfe=/^kinds\/(.*)\.json$/,g$={name:"ext:kinds",schema:vfe,intoBundle:function*(e){if(e.kinds!=null)for(let t of Je(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(xfe))==null?void 0:o[1];if(n)return{kinds:{[n]:r(t)}}},references:[h$,y$],integrityCheck:m$};p();p();p();var Cx;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(Cx||(Cx={}));var b$=e=>{if(e.nodes==null)return ue(!0);let t=Er(e),r=fx(e);for(let[n,o]of xt(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 u=t(n,l);if(u.isErr())return u}for(let[l,u]of a.properties.neighbors.entries()){if(!i.has(u.id))return ye({kind:Cx.UnknownNeighbor,properties:{floorId:n,nodeId:a.properties.id,neighborId:u.id}});let d=Fy(u.flags,r,'nodes["'.concat(n,'"].features[').concat(s,"].properties.neighbors[").concat(l,"]"));if(d.isErr())return d}}}return ue(!0)};var ow=Kt("n","NodeId"),v$=S.Intersect([S.Object({id:S.Ref(ow,{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."})}),OT],{$id:"NodeNeighbor"}),x$=S.Intersect([S.Object({id:S.Ref(ow,{description:"The unique identifier for the node."}),neighbors:S.Array(S.Ref(v$),{description:"The neighbors of the node."})}),wv],{$id:"NodeProperties"}),I$=ln(S.Ref(On),x$,{$id:"NodeFeature"}),S$=Wn(S.Ref(I$),{$id:"NodeCollection"}),Ife=S.Object({nodes:pr(S.Record(st,S.Ref(S$),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),Sfe=/^nodes\/(.*)\.json$/,C$={name:"ext:nodes",schema:Ife,intoBundle:function*(e){if(e.nodes!=null)for(let t of Je(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(Sfe))==null?void 0:o[1];if(n)return{nodes:{[n]:r(t)}}},references:[ow,v$,x$,I$,S$],integrityCheck:b$};p();p();p();var Px;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(Px||(Px={}));var P$=e=>{if(e.outdoors==null)return ue(!0);let t=Wa(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 ye({kind:Px.FloorInFloorStackError,properties:{floorId:r,floorStackId:o.id}})}}return ue(!0)};var w$=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:"OutdoorsProperties"}),Cfe=S.Object({outdoors:S.Ref(w$)},{$id:"OutdoorsExtensionSchema"}),T$="outdoors.json",M$={name:"ext:outdoors",schema:Cfe,intoBundle:function*(e){e.outdoors!=null&&(yield{path:T$,contents:e.outdoors})},fromBundle:(e,t,r)=>{if(e===T$)return{outdoors:r(t)}},references:[w$],integrityCheck:P$};p();p();p();var Tx;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Tx||(Tx={}));var O$=e=>{if(e.tileset==null)return ue(!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 ye({kind:Tx.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return ue(!0)};var iw=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."}),E$=S.Object({default:S.Ref(iw,{description:"The default tileset style, which should be used."}),others:S.Optional(S.Array(S.Ref(iw,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Pfe=S.Object({tileset:S.Ref(E$)},{$id:"TilesetExtensionSchema"}),_$={name:"ext:mvf-tileset",schema:Pfe,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:[iw,E$],integrityCheck:O$};p();var A$=S.Object({},{$id:"WalkableProperties"}),k$=S.Object({},{$id:"NonWalkableProperties"}),D$=pr(S.Record(Mn,S.Ref(A$),{$id:"WalkableGeometries",additionalProperties:!1})),F$=pr(S.Record(Mn,S.Ref(k$),{$id:"NonWalkableGeometries",additionalProperties:!1})),Tfe=S.Object({walkable:pr(S.Record(st,S.Ref(D$),{additionalProperties:!1})),nonwalkable:pr(S.Record(st,S.Ref(F$),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),wfe=/^walkable\/(.*)\.json$/,Mfe=/^nonwalkable\/(.*)\.json$/,L$={name:"ext:mvf-traversability",schema:Tfe,intoBundle:function*(e){if(e.walkable!=null)for(let t of Je(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of Je(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},fromBundle:(e,t,r)=>{var i,s;let n=(i=e.match(wfe))==null?void 0:i[1];if(n!=null)return{walkable:{[n]:r(t)}};let o=(s=e.match(Mfe))==null?void 0:s[1];if(o!=null)return{nonwalkable:{[o]:r(t)}}},references:[A$,k$,D$,F$]};p();p();p();var wx;(function(e){e.WindowNonLineStringGeometryError="WindowNonLineStringGeometryError"})(wx||(wx={}));var R$=e=>{if(e.windows==null)return ue(!0);let t=Er(e);for(let r of Je(e.windows)){let n=e.windows[r];if(n!=null)for(let o of n){let i=t(r,o.geometryId);if(i.isErr())return i;if(i.value.geometry.type!=="LineString")return ye({kind:wx.WindowNonLineStringGeometryError,properties:{windowId:o.id,floorId:r,geometryId:o.geometryId}})}}return ue(!0)};var N$=Kt("w","WindowId"),B$=S.Intersect([S.Object({id:S.Ref(N$,{description:"The unique identifier for the window."})}),ho],{$id:"WindowProperties"}),Ofe=S.Object({windows:pr(S.Record(st,S.Array(S.Ref(B$)),{additionalProperties:!1}))},{$id:"WindowsSchema"}),Efe=/^windows\/(.*)\.json$/,$$={name:"ext:mvf-windows",schema:Ofe,intoBundle:function*(e){if(e.windows!=null)for(let t of Je(e.windows))yield{path:"windows/".concat(t,".json"),contents:e.windows[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(Efe))==null?void 0:o[1];if(n)return{windows:{[n]:r(t)}}},references:[N$,B$],integrityCheck:R$};p();p();function j$(e){return e.replace(/^g_/,"s_")}function _fe(e){return e.replace(/^g_/,"o_")}function Afe(e){return e.replace(/^g_/,"w_")}function kfe(e){return e.replace(/^g_/,"ar_")}function Dfe(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({...e,geometry:{type:i,coordinates:s},properties:{...e.properties,id:"".concat(t,"-").concat(o++),kind:r}});return n}default:return[{...e,properties:{...e.properties,id:t,kind:r}}]}}function Ny(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 u=Dfe(i,r(a),l),d=u.map(h=>h.properties.id),f=d.map(h=>({geometryId:h,floorId:s}));o.set(a,{ids:d,features:u,anchors:f})}}return o}function G$(e){var l,u,d,f;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((l=e.kinds)!=null?l:{}).filter(h=>h!==void 0).flatMap(xt)),n=xt(e.geometry).flatMap(([h,b])=>{var v;return((v=b==null?void 0:b.features)!=null?v:[]).map(I=>({feature:I,floorId:h}))}).flat(),o=new Set(Object.values((u=e.walkable)!=null?u:{}).filter(h=>h!==void 0).flatMap(Je)),i=new Set(Object.values((d=e.nonwalkable)!=null?d:{}).filter(h=>h!==void 0).flatMap(Je)),s=new Set(Array.from(r.entries()).filter(([h,b])=>b==="area").map(([h])=>h)),a=new Set(Object.values((f=e.windows)!=null?f:{}).filter(h=>h!==void 0).flatMap(h=>h.map(b=>b.geometryId)));return o.size>0&&(t.space=Ny(n,o,j$,r)),i.size>0&&(t.obstruction=Ny(n,i,_fe,r)),s.size>0&&(t.area=Ny(n,s,kfe,r)),a.size>0&&(t.window=Ny(n,a,Afe,r)),o.size===0&&i.size===0&&s.size===0&&(t.space=Ny(n,new Set(n.map(h=>h.feature.properties.id)),j$,r)),t}function U$(e){let t=Ffe(e),r=G$(e),n=Lfe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}function Ffe(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 Lfe(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}p();function V$(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,o]of xt(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 u={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:l.geometry,properties:u})}r[n]=s}return{annotation:r}}p();function z$(e,{nodesByGeometryId:t}){var s,a,l,u,d,f,h;let r={"connection.json":[],entrance:{}},n=(s=e.navigationFlags)==null?void 0:s[MT.accessible],o=(a=e.navigationFlags)==null?void 0:a[MT.outdoors],i=new Map(Object.values((l=e.geometry)!=null?l:{}).flatMap(b=>{var v;return(v=b==null?void 0:b.features)!=null?v:[]}).map(b=>[b.properties.id,b]));for(let b of(u=e.connections)!=null?u:[]){if(sw(b,i)){let C=Rfe(b,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&&b.entrances.every(C=>Ly(C,n))&&b.exits.every(C=>Ly(C,n)),I=Array.from(new Set([...b.entrances.map(C=>t.get(C.geometryId)),...b.exits.map(C=>t.get(C.geometryId))].flat().filter(C=>C!=null))),x={id:b.id,externalId:(f=(d=b.details)==null?void 0:d.externalId)!=null?f:"",type:b.type,accessible:v,nodes:I};(h=b.details)!=null&&h.name&&(x.details={name:b.details.name}),b.extra&&(x.extra=b.extra),r["connection.json"].push(x)}return r}function sw(e,t){return e.type==ET.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}function Rfe(e,t,r,n){var i,s;if(e.type!==ET.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 u={type:"Feature",geometry:l.geometry,properties:{id:e.id,externalId:(s=(i=e.details)==null?void 0:i.externalId)!=null?s:"",isExterior:Nfe(e,n)}},d=e.details;d&&(u.properties.details={name:d.name,description:d.description},d.icon&&(u.properties.details.images=[{url:d.icon,altText:"".concat(d.name," icon")}]));let f=r.get(a.geometryId);f&&f.length>0&&(u.properties.node=f[0]),o.push([a.floorId,u])}}return o}function Nfe(e,t){return e.entrances.some(r=>Ly(r,t))||e.exits.some(r=>Ly(r,t))}p();function W$(e,{geometryMaps:t,nodesByGeometryId:r}){var P,w,T,O,N,k,D,F,z,G,j,K,Z,oe,Q,ge,be,pe,_e,yt,it,Xe,Ue;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 de=e.enterprise.venue;n.venue={...n.venue,slug:de.slug,name:(w=de.details.name)!=null?w:n.venue.name,externalId:(T=de.details.externalId)!=null?T:"",defaultLanguage:de.defaultLanguage,languages:de.languages,countrycode:de.countrycode,coverImage:de.coverImage,logo:de.logo,icon:de.details.icon,extra:de.extra,mappedinWebUrl:de.mappedinWebUrl,operationHours:de.operationHours,topLocations:de.topLocations}}let i=new Map,s=new Map,a=e.locations,l=e.enterprise.locations;if(a&&l){let de=new Map(a.map(me=>[me.id,me]));for(let me of l){let te=de.get(me.locationId);if(te){let ie=te.details,A={id:me.id,name:ie.name,externalId:(O=ie.externalId)!=null?O:"",type:me.type,sortOrder:me.sortOrder,amenity:me.amenity,description:ie.description,extra:te.extra,links:te.links,operationHours:te.openingHours,gallery:me.gallery,logo:te.logo,shortName:ie.shortName,picture:me.picture,showFloatingLabelWhenImagePresent:me.showFloatingLabelWhenImagePresent,showLogo:me.showLogo,siblingGroups:me.siblingGroups,states:me.states,tags:me.tags,spaces:[],nodes:[],polygons:[]};te.phone&&(A.phone={number:te.phone});let Y=H$(te.social);te.website&&(Y.website=te.website.url),A.social=Y;for(let L of te.geometryAnchors){let le=t.space.get(L.geometryId);if(le){let ae=new Set(le.features.filter(ve=>ve.geometry.type==="Polygon").map(ve=>ve.properties.id));for(let ve of le.anchors)A.spaces.push({floor:ve.floorId,id:ve.geometryId}),ae.has(ve.geometryId)&&A.polygons.push({map:ve.floorId,id:ve.geometryId})}let ne=r.get(L.geometryId);for(let ae of ne!=null?ne:[])A.nodes.push({map:L.floorId,id:ae})}n.locations.push(A);for(let L of te.categories)i.set(L,[...(N=i.get(L))!=null?N:[],me.id]);s.set(me.id,te.categories)}}}let u=e.enterprise.locationInstances,d=e.locationInstances;if(u&&d){let de=new Map(d.map(te=>[te.id,te])),me=[];for(let te of u){let ie=de.get(te.locationInstanceId);if(ie){let A={id:te.id,parent:te.parentId,name:(k=ie.details)==null?void 0:k.name,externalId:(D=ie.details)==null?void 0:D.externalId,type:te.type,sortOrder:te.sortOrder,amenity:te.amenity,description:(F=ie.details)==null?void 0:F.description,extra:ie.extra,links:ie.links,operationHours:ie.openingHours,gallery:te.gallery,picture:te.picture,showFloatingLabelWhenImagePresent:te.showFloatingLabelWhenImagePresent,showLogo:te.showLogo,siblingGroups:te.siblingGroups,states:te.states,tags:te.tags,logo:ie.logo,shortName:(z=ie.details)==null?void 0:z.shortName};ie.phone&&(A.phone={number:ie.phone});let Y=H$((G=ie.social)!=null?G:[]);if(ie.website&&(Y.website=ie.website.url),Object.keys(Y).length>0&&(A.social=Y),(j=ie.geometryAnchors)!=null&&j.length){let L=ie.geometryAnchors.flatMap(le=>{var ne,ae;return(ae=(ne=t.space.get(le.geometryId))==null?void 0:ne.anchors)!=null?ae:[]});L.length>0&&(A.spaces=L.map(le=>({floor:le.floorId,id:le.geometryId})))}if(ie.geometryAnchors){A.spaces=[],A.polygons=[],A.nodes=[];for(let L of ie.geometryAnchors){let le=t.space.get(L.geometryId);if(le){let ae=new Set(le.features.filter(ve=>ve.geometry.type==="Polygon").map(ve=>ve.properties.id));for(let ve of le.anchors)A.spaces.push({floor:ve.floorId,id:ve.geometryId}),ae.has(ve.geometryId)&&A.polygons.push({map:ve.floorId,id:ve.geometryId})}let ne=r.get(L.geometryId);for(let ae of ne!=null?ne:[])A.nodes.push({map:L.floorId,id:ae})}}me.push(A)}}me.length>0&&(n.locationInstances=me)}let f=e.locationCategories,h=e.enterprise.categories;if(f&&h){let de=[],me=new Map(f.map(Y=>[Y.id,Y])),te=new Map(h.map(Y=>[Y.categoryId,Y.id])),ie=new Map;for(let Y of f){let L=te.get(Y.parent);if(L){let le=(K=ie.get(L))!=null?K:[];le.push(Y.id),ie.set(L,le)}}for(let Y of h){let L=me.get(Y.categoryId);if(L){let ne=((Z=ie.get(Y.id))!=null?Z:[]).map(ve=>te.get(ve)).filter(ve=>ve!==void 0),ae={id:Y.id,name:L.details.name,externalId:(oe=L.details.externalId)!=null?oe:"",sortOrder:Y.sortOrder,children:ne,locations:(Q=i.get(Y.categoryId))!=null?Q:[],icon:L.details.icon,picture:Y.picture,color:Y.color,extra:L.extra,iconFromDefaultList:Y.iconFromDefaultList};de.push(ae)}}n.categories=de;let A={};for(let[Y,L]of s.entries())A[Y]=L.map(le=>te.get(le)).filter(le=>le!==void 0);n.categoryPriorities=A}let b={};for(let[de,me]of Object.entries((ge=e.defaultStyle)!=null?ge:{}))if(me.buffer>0){let te=me.geometryAnchors.flatMap(ie=>{var A,Y;return(Y=(A=t.space.get(ie.geometryId))==null?void 0:A.anchors)!=null?Y:[]});b[de]={edgeOffset:me.buffer,geometryAnchors:te}}Object.keys(b).length>0&&(n.enterpriseStyles=b);let v=new Map;for(let de of Object.values((be=e.enterprise.layers)!=null?be:{}))if(de)for(let[me,te]of xt(de)){if(typeof te!="string")continue;let ie=(pe=v.get(te))!=null?pe:{name:te,id:"ely_".concat(te),spaces:[]};ie.spaces.push(...(yt=(_e=t.space.get(me))==null?void 0:_e.anchors.map(A=>({floorId:A.floorId,spaceId:A.geometryId})))!=null?yt:[]),v.set(te,ie)}v.size>0&&(n.layers=Array.from(v.values()));let I=[];for(let de of Object.values((it=e.enterprise.textures)!=null?it:{}))for(let me of de){let te=(Xe=t.space.get(me.geometryId))==null?void 0:Xe.anchors;!te||te.length<1||me.face==="unknown"||me.surface==="unknown"||I.push({repeat:me.repeat,offset:me.offset,rotation:me.rotation,path:me.path,face:me.face,surface:me.surface,bounds:me.bounds,geometryAnchors:te})}I.length>0&&(n.textures=I);let x={};for(let[de,me]of Object.entries((Ue=e.enterprise.floorText)!=null?Ue:{})){let te={type:"FeatureCollection",features:[]};for(let ie of me.features){if(ie.properties.align==="unknown")continue;let A={align:ie.properties.align,color:ie.properties.color,fontFamily:ie.properties.fontFamily,fontSize:ie.properties.fontSize,rotation:ie.properties.rotation,text:ie.properties.text,visible:ie.properties.visible};"geometryId"in ie.properties?A.geometryId=ie.properties.geometryId:A.verticalOffset=ie.properties.verticalOffset,te.features.push({type:"Feature",geometry:ie.geometry,properties:A})}te.features.length>0&&(x[de]=te)}Object.keys(x).length>0&&(n.floorText=x);let C={enterprise:n};if(e.enterprise.textAreas){let de={};for(let[me,te]of xt(e.enterprise.textAreas)){let ie={type:"FeatureCollection",features:[]};for(let A of te.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 L={type:"Feature",geometry:A.geometry,properties:Y};ie.features.push(L)}de[me]=ie}C.textAreas=de}return C}var Bfe=["facebook","instagram","twitter"];function H$(e){let t={};for(let{name:r,url:n}of e){let o=r.toLowerCase();Bfe.includes(o)&&(t[o]=n)}return t}p();function q$(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[o,i]of xt(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(u=>({floorId:s,spaceId:u}))}).filter(s=>s!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}p();function Z$(e,t={}){var o,i,s,a,l,u,d,f,h,b,v,I;let r={type:"FeatureCollection",features:[]},n=[];for(let x of e.floors.features)n.push({id:x.properties.id.replace(/^f_/,"m_"),externalId:(i=(o=x.properties.details)==null?void 0:o.externalId)!=null?i:"",elevation:x.properties.elevation,name:(a=(s=x.properties.details)==null?void 0:s.name)!=null?a:"",shortName:(u=(l=x.properties.details)==null?void 0:l.shortName)!=null?u:"",subtitle:x.properties.subtitle}),r.features.push({type:"Feature",geometry:x.geometry,properties:{id:x.properties.id,externalId:(f=(d=x.properties.details)==null?void 0:d.externalId)!=null?f:"",elevation:x.properties.elevation,name:(b=(h=x.properties.details)==null?void 0:h.name)!=null?b:"",shortName:(I=(v=x.properties.details)==null?void 0:v.shortName)!=null?I:"",subtitle:x.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}p();function X$(e,{geometryMaps:t}){var o,i,s,a,l;let r={},n={};for(let[u,d]of xt((o=e.floorImages)!=null?o:{})){let f={features:[],type:"FeatureCollection"};for(let h of(i=d==null?void 0:d.features)!=null?i:[])if("verticalOffset"in h.properties)f.features.push(h);else{let{geometryId:b,...v}=h.properties,I=(l=(s=t.space.get(b))==null?void 0:s.ids[0])!=null?l:(a=t.obstruction.get(b))==null?void 0:a.ids[0];if(!I)continue;let x={geometry:h.geometry,properties:{...v,anchorId:I},type:h.type};f.features.push(x)}n[u]=f}return Object.keys(n).length>0&&(r.floorImages=n),r}p();function Y$(e,t={}){var o,i,s,a,l,u,d;let r=[];for(let f of(o=e==null?void 0:e.floorStacks)!=null?o:[]){let h={id:f.id,floors:f.floors,maps:f.floors,externalId:(s=(i=f.details)==null?void 0:i.externalId)!=null?s:"",name:(l=(a=f.details)==null?void 0:a.name)!=null?l:"",shortName:(d=(u=f.details)==null?void 0:u.shortName)!=null?d:"",type:"Building"};f.defaultFloor&&(h.defaultFloor=f.defaultFloor),r.push(h)}if(e.outdoors){let f={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(f)}return{"floorstack.json":r,"mapstack.geojson":r}}p();p();var Q$=fs(J$(),1),Vfe=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)},zfe=(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,u]=o[s],[d,f]=o[a];u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(i=!i)}return i},Hfe=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)]}}},Wfe=e=>{let t=Vfe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},Ox=e=>{try{let r=Hfe(e).geometry.coordinates;if(!zfe(r,e)){let o=(0,Q$.default)(e.geometry.coordinates,Wfe(e));return ue([o[0],o[1]])}return ue(r)}catch{return ye(new Error("Unable to calculate center of polygon"))}};function lw(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}function ej(e,{geometryMaps:t,nodesByGeometryId:r}){var u,d,f,h,b,v,I,x,C;let n=Kfe(e.defaultStyle),o={},i={},s={},a={};for(let P of Je(e.geometry)){let w=e.geometry[P];if(!w)continue;let T=[],O=[],N=[],k=[];for(let D of w.features){let F=D.properties.id,z=n.has(F),G=(u=r.get(F))!=null?u:[];for(let j of(f=(d=t.space.get(F))==null?void 0:d.features)!=null?f:[])T.push(qfe(j,G));for(let j of(b=(h=t.obstruction.get(F))==null?void 0:h.features)!=null?b:[])O.push(Zfe(j,z));for(let j of(I=(v=t.area.get(F))==null?void 0:v.features)!=null?I:[])N.push(Xfe(j,G));for(let j of(C=(x=t.window.get(F))==null?void 0:x.features)!=null?C:[])k.push(Yfe(j))}T.length>0&&(o[P]={type:"FeatureCollection",features:T.filter(D=>D!==null)}),O.length>0&&(i[P]={type:"FeatureCollection",features:O.filter(D=>D!==null)}),N.length>0&&(s[P]={type:"FeatureCollection",features:N.filter(D=>D!==null)}),k.length>0&&(a[P]={type:"FeatureCollection",features:k.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 qfe(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}),lw(r)&&(r.properties.center=Ox(r).unwrapOr(void 0)),r}function Zfe(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 lw(n)&&(n.properties.center=Ox(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 Xfe(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 lw(n)&&(n.properties.center=Ox(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 Yfe(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}function Kfe(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))}p();function tj(e,{geometryMaps:t,geometryFeatureById:r}){var o,i,s,a,l,u,d,f,h,b,v,I,x;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=Jfe(e,{geometryFeatureById:r}),P=[];for(let w of e.locations){let T={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(T);for(let{geometryId:O,floorId:N}of w.geometryAnchors)T.spaces.push(...(u=(l=t.space.get(O))==null?void 0:l.ids.map(k=>({id:k,floor:N})))!=null?u:[]),T.obstructions.push(...(f=(d=t.obstruction.get(O))==null?void 0:d.ids.map(k=>({id:k,floor:N})))!=null?f:[]),T.areas.push(...(b=(h=t.area.get(O))==null?void 0:h.ids.map(k=>({id:k,floor:N})))!=null?b:[]),T.entrances.push(...(v=C.entrancesByGeometryId.get(O))!=null?v:[]),T.connections.push(...(I=C.connectionsByGeometryId.get(O))!=null?I:[]),T.annotations.push(...(x=C.annotationsByGeometryId.get(O))!=null?x:[])}n["location.json"]=P}return n}function Jfe(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 xt(e.annotations))for(let l of a!=null?a:[]){let u=l.geometryId,d=l.id,f=(n=r.annotationsByGeometryId.get(u))!=null?n:[];f.push({floor:s,id:d}),r.annotationsByGeometryId.set(u,f)}if(e.connections)for(let s of e.connections){let a=sw(s,t),l=Array.from(new Map([...s.entrances,...s.exits].map(u=>["".concat(u.geometryId,"_").concat(u.floorId),u])).values());for(let u of l){let d=u.geometryId;if(a){let f=(o=r.entrancesByGeometryId.get(d))!=null?o:[];f.push({floor:u.floorId,id:s.id}),r.entrancesByGeometryId.set(d,f)}else{let f=(i=r.connectionsByGeometryId.get(d))!=null?i:[];f.push(s.id),r.connectionsByGeometryId.set(d,f)}}}return r}p();function rj(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}p();function nj(e,{geometryMaps:t}){var a,l,u,d,f,h,b,v,I,x,C,P,w,T,O;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,o=new Map;for(let N of(l=(a=e.floors)==null?void 0:a.features)!=null?l:[])o.set(N.properties.id,N.properties.elevation);let i=new Map;for(let N of Object.values((u=e.nodes)!=null?u:{}))for(let k of(d=N==null?void 0:N.features)!=null?d:[])for(let D of k.properties.geometryIds)i.set(D,[...(f=i.get(D))!=null?f:[],k.properties.id]);let s=new Map;for(let N of(h=e.connections)!=null?h:[]){let k=N.exits.map(D=>{var F;return{...D,nodes:(F=i.get(D.geometryId))!=null?F:[]}});for(let D of N.entrances){let F=(b=i.get(D.geometryId))!=null?b:[];for(let z of F)for(let G of k){let j=Math.abs(((v=o.get(D.floorId))!=null?v:0)-((I=o.get(G.floorId))!=null?I:0))*N.floorCostMultiplier,K=(x=s.get(z))!=null?x:[];K.push(...G.nodes.map(Z=>({id:Z,weight:j+N.entryCost}))),s.set(z,K)}}}for(let[N,k]of xt((C=e.nodes)!=null?C:{}))for(let D of(P=k==null?void 0:k.features)!=null?P:[]){let F=(w=t.space.get(D.properties.geometryIds[0]))==null?void 0:w.features[0],z=(F==null?void 0:F.geometry.type)==="Point"&&((T=F==null?void 0:F.properties.details)!=null&&T.externalId)?F.properties.details.externalId:"",G={type:"Feature",geometry:D.geometry,properties:{id:D.properties.id,floor:N,space:D.properties.geometryIds.map(j=>{var K;return(K=t.space.get(j))==null?void 0:K.ids}).flat().filter(j=>j!==void 0),neighbors:[...D.properties.neighbors.map(j=>({id:j.id,weight:j.extraCost})),...(O=s.get(D.properties.id))!=null?O:[]],map:N,externalId:z}};n.push(G)}return r}p();function Qfe(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 oj(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(u=>u.features),...Array.from(t.obstruction.values()).map(u=>u.features)],i=new Map(o.flatMap(u=>u.map(d=>[d.properties.id,d.geometry.type])));for(let[u,d]of xt(e.defaultStyle)){let f=Qfe(d.geometryAnchors.flatMap(h=>{var b,v,I,x;return[...(v=(b=t.space.get(h.geometryId))==null?void 0:b.ids)!=null?v:[],...(x=(I=t.obstruction.get(h.geometryId))==null?void 0:I.ids)!=null?x:[]]}),i);if(f.Point&&f.Point.length>0){let h={points:Array.from(f.Point.values()),showImage:((s=d.extra)==null?void 0:s.showImage)!==void 0?((a=d.extra)==null?void 0:a.showImage)===!0:d.opacity!==0};n["".concat(u,".Point")]=h}if(f.LineString&&f.LineString.length>0){let h={lineStrings:Array.from(f.LineString.values()),altitude:d.altitude,color:d.color,height:d.height,opacity:d.opacity,width:d.buffer};n["".concat(u,".LineString")]=h}if(f.Polygon&&f.Polygon.length>0){let h={polygons:Array.from(f.Polygon.values()),altitude:d.altitude,color:d.color,height:d.height,opacity:d.opacity};((l=d.extra)==null?void 0:l.showImage)!==void 0&&(h.showImage=d.extra.showImage===!0),n["".concat(u,".Polygon")]=h}}return r}var eme=UN().extendOptional(qN).extendOptional(C$).extendOptional(eB).extendOptional(g$).extendOptional(L$).extendOptional(oB).extendOptional(r$).extendOptional(M$).extendOptional(_$).extendOptional(f$).extendOptional(s$).extendOptional(UR).extendOptional(fB).extendOptional(KB).extendOptional($$).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function tme(e){let t=U$(e),r=Z$(e,t),n=ej(e,t),o=nj(e,t),i=z$(e,t),s=oj(e,t),a=Y$(e,t),l=X$(e,t),u=q$(e,t),d=V$(e,t),f=tj(e,t),h=W$(e,t),b=rj(e,t);return{...r,...n,...o,...i,...s,...a,"tileset.json":e.tileset,...l,...u,...d,...f,...h,...b}}async function cw(e){let t=await eme.decompress(e);return t.isOk()?ue(tme(t.value)):ye(t.error)}p();function Nf(e){return e.endsWith("/")?e:"".concat(e,"/")}p();var Bf="https://app.mappedin.com/",ij="https://auth.mappedin.com/";p();p();var rme=e=>{let t=Date.now();return e-t},Ex=(e,t)=>rme(e)<=t*60*1e3;var aj=60,lj=aj*60*1e3,sj="accessTokens";async function By(e,t=!1){let r="".concat(e.key),n=fu.getInstance(),o=(n==null?void 0:n.loadSessionData(sj))||{},i=Math.floor(Date.now()/1e3);if(o[r]&&!Ex(o[r].expiresTimestamp*1e3,aj))return o[r];let s=t?await nme(e,i):await ome(e,i),a={...o,[r]:s};return n==null||n.saveSessionData(sj,a),s}async function nme(e,t){var i;let r="".concat((i=e.baseAuthUri)!=null?i:ij,"oauth2/token"),n=await zi()(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 ome(e,t){let r="".concat(e.baseAuthUri?Nf(e.baseAuthUri):Bf,"api/api-key/token"),n=await zi()(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}}p();var uj=60,pj=uj*60*1e3,cj="miSasTokens";async function uw(e,t){let r="".concat(t,"__").concat(e.mapId),n=fu.getInstance(),o=(n==null?void 0:n.loadSessionData(cj))||{};if(o[r]&&!Ex(o[r].expires,uj))return o[r];let i=await ime(e,t),s={...o,[r]:{token:i.token,expires:new Date(i.expires).getTime()}};return n==null||n.saveSessionData(cj,s),i}async function ime(e,t){let r="".concat(e.baseUri?Nf(e.baseUri):Bf,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await zi()(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 dj=globalThis.fetch,hj,sme=(hj=g==null?void 0:g.env)==null?void 0:hj.npm_package_version;function zi(){if(dj==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return dj}var pw={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function yj(e){var r;let t={...pw,...e};return t.headers={...t.headers,"mappedin-sdk-version":sme},t.things=[],"platformString"in e&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}function ame(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 lme(e,t,r=!1){let n=ame(e,t,r),o=await zi()(n.url,n.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}var cme=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 $.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){$.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:i,locale_packs:s}}return r};async function ume(e,t="exports/mvf/1/bundle"){var u,d;let r=yj({baseUri:"https://api-gateway.mappedin.com/",...pw,...e}),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((u=r.version)!=null?u:"2.0.0");r.headers["Content-Type"]="application/zip";let o=await lme(r,n),i=o.url,s=o.locale_packs,a=(d=r.perspective)!=null?d:pw.perspective,l=cme(o);if(a!=null&&a!==""&&l!=null){let f=l[a];f==null?$.warn("Perspective ".concat(a," not found in response! Loading default perspective instead.")):($.log('Loading perspective "'.concat(a,'"')),i=f.url,s=f.locale_packs)}return{url:i,localePacks:s,updated_at:o.updated_at}}var $y=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function dw(e,{signal:t}){let r=await(await zi()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}async function $f(e){let r=(await import("./browser-LGW6JLJT.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let o=r["enterprise/locations.json"];o&&(n.enterprise.locations=JSON.parse($y().decode(o)));let i=r["enterprise/categories.json"];i&&(n.enterprise.categories=JSON.parse($y().decode(i)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse($y().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse($y().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse($y().decode(r["manifest.json"]))),n}async function gj(e,{signal:t}){try{let r=await(await zi()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await $f(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}async function fw(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 ume(e,n),s=await zi()(o).then(l=>l.arrayBuffer()),a=new Uint8Array(s);t({compressed:a,localePacks:i})}catch(n){r(n)}})}async function mw(e,t){return new Promise(async(r,n)=>{try{let{url:o}=await pme(e,t),i=await zi()(o).then(a=>a.arrayBuffer()),s=new Uint8Array(i);r(s)}catch(o){n(o)}})}async function pme(e,t){let r=new URL("".concat(e.baseUri?Nf(e.baseUri):Bf,"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 zi()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}function hw(e){var n,o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w,T;let t=new TextDecoder,r=t.decode.bind(t);try{let O={"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&&(O.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(O.enterprise.locations=JSON.parse(r((o=e.enterprise)==null?void 0:o["locations.json"]))),(i=e.enterprise)!=null&&i["categories.json"]&&(O.enterprise.categories=JSON.parse(r((s=e.enterprise)==null?void 0:s["categories.json"]))),(a=e.enterprise)!=null&&a["venue.json"]&&(O.enterprise.venue=JSON.parse(r((l=e.enterprise)==null?void 0:l["venue.json"]))),(u=e.enterprise)!=null&&u["layers.json"]&&(O.enterprise.layers=JSON.parse(r((d=e.enterprise)==null?void 0:d["layers.json"]))),(f=e.enterprise)!=null&&f["locationInstances.json"]&&(O.enterprise.locationInstances=JSON.parse(r((h=e.enterprise)==null?void 0:h["locationInstances.json"]))),(b=e.enterprise)!=null&&b["enterpriseStyles.json"]&&(O.enterprise.enterpriseStyles=JSON.parse(r((v=e.enterprise)==null?void 0:v["enterpriseStyles.json"]))),(I=e.enterprise)!=null&&I["textures.json"]&&(O.enterprise.textures=JSON.parse(r((x=e.enterprise)==null?void 0:x["textures.json"]))),(C=e.enterprise)!=null&&C["floorText.json"]&&(O.enterprise.floorText=JSON.parse(r((P=e.enterprise)==null?void 0:P["floorText.json"]))),(w=e.enterprise)!=null&&w["categoryPriorities.json"]&&(O.enterprise.categoryPriorities=JSON.parse(r((T=e.enterprise)==null?void 0:T["categoryPriorities.json"])))),e["floorstack.json"]!=null?O["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(O["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),O["floorstack.json"]==null&&O["mapstack.json"]==null&&O["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(O["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),O["floor.geojson"]==null&&O["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(O["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(O["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(O["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(O["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){O.annotation={};let k=Object.keys(e.annotation);for(let D of k){let F=D.replace(/\.json|\.geojson/g,"");O.annotation[F]=JSON.parse(r(e.annotation[D]))}}let N=Object.keys(e.space);for(let k of N){let D=k.replace(/\.json|\.geojson/g,"");O.space[D]=JSON.parse(r(e.space[k]))}if(e.obstruction!=null){let k=Object.keys(e.obstruction);for(let D of k){let F=D.replace(/\.json|\.geojson/g,"");O.obstruction[F]=JSON.parse(r(e.obstruction[D]))}}else O.obstruction={};if(e.entrance!=null){let k=Object.keys(e.entrance);for(let D of k){let F=D.replace(/\.json|\.geojson/g,"");O.entrance[F]=JSON.parse(r(e.entrance[D]))}}else O.entrance={};if("floorImages"in e&&e.floorImages!=null){O.floorImages={};for(let k of Object.keys(e.floorImages)){let D=k.replace(/\.json|\.geojson/g,"");O.floorImages[D]=JSON.parse(r(e.floorImages[k]))}}if("textAreas"in e&&e.textAreas!=null){O.textAreas={};for(let k of Object.keys(e.textAreas)){let D=k.replace(/\.json|\.geojson/g,"");O.textAreas[D]=JSON.parse(r(e.textAreas[k]))}}if("facade"in e&&e.facade!=null){O.facade={};for(let k of Object.keys(e.facade)){let D=k.replace(/\.json|\.geojson/g,"");O.facade[D]=JSON.parse(r(e.facade[k]))}}if("area"in e&&e.area!=null){O.area={};for(let k of Object.keys(e.area)){let D=k.replace(/\.json|\.geojson/g,"");O.area[D]=JSON.parse(r(e.area[k]))}}return O}catch(O){throw $.error(O),new Error("MVF parsing failed! Probably encountered a bad file.")}}function dme(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 yw(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-LGW6JLJT.js")).unzipSync(e);if(!dme(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"){$.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 Xu(){let e="us",t={};function r(){return yme(bme(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?fj.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?fj.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}var bj=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"}),fj=Object.freeze({...bj,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),fme=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"}),mme=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"}),hme=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 yme(e,t){return{...e,...t}}var gme={eu:fme,us:bj,"us-staging-enterprise":mme,"us-staging-self-serve":hme};function bme(e){return gme[e]}var gw=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_",""))},mj=async e=>{let t=performance.now(),r=await cw(e);return $.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw $.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()};async function bw(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await yw(e);return hw(r)}catch{return mj(e)}case"3.0.0":return mj(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}p();p();p();function ui(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 Fo(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function jf(e){return e.type==="Feature"?e.geometry:e}function vj(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function vme(e,t,r){r===void 0&&(r={});for(var n=ui(e),o=Fo(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")),xme(o[i],o[i+1],n,s,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function xme(e,t,r,n,o){var i=r[0],s=r[1],a=e[0],l=e[1],u=t[0],d=t[1],f=r[0]-a,h=r[1]-l,b=u-a,v=d-l,I=f*v-h*b;if(o!==null){if(Math.abs(I)>o)return!1}else if(I!==0)return!1;if(n){if(n==="start")return Math.abs(b)>=Math.abs(v)?b>0?a<i&&i<=u:u<=i&&i<a:v>0?l<s&&s<=d:d<=s&&s<l;if(n==="end")return Math.abs(b)>=Math.abs(v)?b>0?a<=i&&i<u:u<i&&i<=a:v>0?l<=s&&s<d:d<s&&s<=l;if(n==="both")return Math.abs(b)>=Math.abs(v)?b>0?a<i&&i<u:u<i&&i<a:v>0?l<s&&s<d:d<s&&s<l}else return Math.abs(b)>=Math.abs(v)?b>0?a<=i&&i<=u:u<=i&&i<=a:v>0?l<=s&&s<=d:d<=s&&s<=l;return!1}var xj=vme;p();function Ime(e,t){t===void 0&&(t={});var r=Md(e),n=(r[0]+r[2])/2,o=(r[1]+r[3])/2;return vs([n,o],t.properties,t)}var _x=Ime;p();p();function Sme(e,t,r){r===void 0&&(r={});var n=ui(e),o=ui(t),i=io(o[1]-n[1]),s=io(o[0]-n[0]),a=io(n[1]),l=io(o[1]),u=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return vE(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),r.units)}var pc=Sme;function Ax(e,t){return t===void 0&&(t={}),SE(e,function(r,n){var o=n.geometry.coordinates;return r+pc(o[0],o[1],t)},0)}p();p();p();function kx(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Cme(e,t);var n=ui(e),o=ui(t),i=io(n[0]),s=io(o[0]),a=io(n[1]),l=io(o[1]),u=Math.sin(s-i)*Math.cos(l),d=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-i);return vh(Math.atan2(u,d))}function Cme(e,t){var r=kx(t,e);return r=(r+180)%360,r}p();function Yu(e,t,r,n){n===void 0&&(n={});var o=ui(e),i=io(o[0]),s=io(o[1]),a=io(r),l=xE(t,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a)),d=i+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u)),f=vh(d),h=vh(u);return vs([f,h],n.properties)}p();p();function Pme(e){if(!e)throw new Error("geojson is required");var t=[];return xs(e,function(r){Tme(r,t)}),mu(t)}function Tme(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Fo(n);break;case"LineString":r=[Fo(n)]}r.forEach(function(o){var i=wme(o,e.properties);i.forEach(function(s){s.id=t.length,t.push(s)})})}}function wme(e,t){var r=[];return e.reduce(function(n,o){var i=wa([n,o],t);return i.bbox=Mme(n,o),r.push(i),o}),r}function Mme(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,u=n>i?n:i;return[s,a,l,u]}var vw=Pme;var EH=fs(MH(),1);function Ybe(e,t){var r={},n=[];if(e.type==="LineString"&&(e=XS(e)),t.type==="LineString"&&(t=XS(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=OH(e,t);return o&&n.push(o),mu(n)}var i=(0,EH.default)();return i.load(vw(t)),YS(vw(e),function(s){YS(i.search(s),function(a){var l=OH(s,a);if(l){var u=Fo(l).join(",");r[u]||(r[u]=!0,n.push(l))}})}),mu(n)}function OH(e,t){var r=Fo(e),n=Fo(t);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],i=r[0][1],s=r[1][0],a=r[1][1],l=n[0][0],u=n[0][1],d=n[1][0],f=n[1][1],h=(f-u)*(s-o)-(d-l)*(a-i),b=(d-l)*(i-u)-(f-u)*(o-l),v=(s-o)*(i-u)-(a-i)*(o-l);if(h===0)return null;var I=b/h,x=v/h;if(I>=0&&I<=1&&x>=0&&x<=1){var C=o+I*(s-o),P=i+I*(a-i);return vs([C,P])}return null}var Jf=Ybe;function Kbe(e,t,r){r===void 0&&(r={});var n=vs([1/0,1/0],{dist:1/0}),o=0;return xs(e,function(i){for(var s=Fo(i),a=0;a<s.length-1;a++){var l=vs(s[a]);l.properties.dist=pc(t,l,r);var u=vs(s[a+1]);u.properties.dist=pc(t,u,r);var d=pc(l,u,r),f=Math.max(l.properties.dist,u.properties.dist),h=kx(l,u),b=Yu(t,f,h+90,r),v=Yu(t,f,h-90,r),I=Jf(wa([b.geometry.coordinates,v.geometry.coordinates]),wa([l.geometry.coordinates,u.geometry.coordinates])),x=null;I.features.length>0&&(x=I.features[0],x.properties.dist=pc(t,x,r),x.properties.location=o+pc(l,x,r)),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a,n.properties.location=o),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a+1,n.properties.location=o+d),x&&x.properties.dist<n.properties.dist&&(n=x,n.properties.index=a),o+=d}}),n}var rg=Kbe;function Jbe(e,t,r){var n=Fo(r);if(vj(r)!=="LineString")throw new Error("line must be a LineString");var o=rg(r,e),i=rg(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),wa(a,r.properties)}var s4=Jbe;var Qbe=1e-7;function a4(e){return{type:"Point",coordinates:e}}function e1e(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,o=r.map(i=>rg(e,a4(i)));return n.reduce((i,s)=>{let a=s4(a4(s),o[0],e),l=s4(a4(s),o[1],e),u=Ax(a)<Ax(l)?a:l;return u.properties={...e.properties,entrances:[]},i.concat([u])},[])}function l4(e,t){return t.reduce((r,n)=>{let o={epsilon:Qbe},i=r.obstructions.findIndex(a=>xj(_x(n),a,o)),s=r.obstructions[i];if(s){let[a,l]=e1e(s,n);r.entrances.push(n),r.obstructions.splice(i,1,a,l)}return r},{obstructions:[e],entrances:[]})}p();p();p();var ng=class ng{constructor(t,r,n){m(this,"__type",ng.__type);m(this,"id",Et());m(this,"latitude");m(this,"longitude");m(this,"floorId");m(this,"verticalOffset");var o;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(o=t.verticalOffset)!=null?o:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===ng.__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(){}};m(ng,"__type","coordinate");var c4=ng,Le=c4;p();var zr=class{constructor(t){m(this,"id");this.id=t}};var Zs,Zn,ep,bc,og=class og extends zr{constructor(r,n){super(n.mvfData.properties.id);m(this,"__type",og.__type);M(this,Zs);M(this,Zn,{});M(this,ep);M(this,bc);_(this,Zs,r),_(this,ep,n.floorId),_(this,bc,n.mvfData)}static is(r){return r.__type===og.__type}get locations(){return c(this,Zn).locations?c(this,Zn).locations:(c(this,Zn).locations=(c(this,Zs).locationIdsByNodeId[this.id]||[]).map(r=>c(this,Zs).getById("enterprise-location",r)).filter(Boolean),c(this,Zn).locations)}get space(){var r;return c(this,Zs).getById("space",(r=c(this,Zs).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=c(this,Zs).getById("floor",c(this,ep));if(r==null)throw new Error("Floor ".concat(c(this,ep)," not found!"));return r}get coordinate(){if(c(this,Zn).coordinate==null){let[r,n]=c(this,bc).geometry.coordinates;c(this,Zn).coordinate=new Le(n,r,c(this,ep))}return c(this,Zn).coordinate}get externalId(){var r;return(r=c(this,bc).properties.externalId)!=null?r:""}get neighbors(){if(c(this,Zn).neighbours==null){let r=c(this,bc).properties.neighbors.map(n=>{let o=c(this,Zs).getById("node",n.id);if(o==null)throw new Error("Node ".concat(n.id," not found!"));return o});c(this,Zn).neighbours=r}return c(this,Zn).neighbours}get geoJSON(){return{...c(this,bc),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,Zn)))delete c(this,Zn)[r]}};Zs=new WeakMap,Zn=new WeakMap,ep=new WeakMap,bc=new WeakMap,m(og,"__type","node");var u4=og,vc=u4;p();p();p();p();var ig,nl,E2=class E2 extends zr{constructor(r){super(String(Et()));M(this,ig,{});M(this,nl);_(this,nl,r.mvfData)}static is(r){return r.__type===E2.__type}get url(){return c(this,nl).url}get name(){if("displayName"in c(this,nl))return c(this,nl).displayName;if("label"in c(this,nl))return c(this,nl).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(c(this,ig)))delete c(this,ig)[r]}};ig=new WeakMap,nl=new WeakMap,m(E2,"__type","hyperlink");var p4=E2,tp=p4;p();p();function sg(e){return typeof e=="string"?e:e.id}function f4(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}var d4=8,Xs=e=>typeof e=="number"?e.toFixed(d4):f4(e)?e[1].toFixed(d4)+"-"+e[0].toFixed(d4):e.map(t=>Xs(t)).join("-"),t1e=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)},_2=e=>{if(!t1e(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 ag,xc,rp,A2=class A2 extends zr{constructor(r){super(String(Et()));M(this,ag,{});M(this,xc);M(this,rp);_(this,xc,r.mvfData),_(this,rp,r.mapData)}static is(r){return r.__type===A2.__type}get url(){let r=c(this,xc).url;if(c(this,rp).tokenManager==null)return r;let n=_2(c(this,xc).url);if(n==null)return r;let o=n.mapId;try{if(c(this,rp).tokenManager.isEnterpriseMode())return r;let i=c(this,rp).tokenManager.getSasToken(o).token;if(i==null||i==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(i)}catch(i){return $.error("Error getting SAS token for image",{error:i,url:r}),r}}get name(){return c(this,xc).altText}get altText(){return c(this,xc).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(c(this,ag)))delete c(this,ag)[r]}};ag=new WeakMap,xc=new WeakMap,rp=new WeakMap,m(A2,"__type","image");var m4=A2,np=m4;p();var op,qi=class{constructor(t,r){m(this,"id");M(this,op);this.id=t}get geoJSONBoundingBox(){return c(this,op)?c(this,op):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(_(this,op,Md(this.geoJSON)),c(this,op))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};op=new WeakMap;var Qf,Zi,ol,fn=class extends qi{constructor(r,n){super(n.properties.id,r);M(this,Qf);M(this,Zi);M(this,ol,{});_(this,Qf,r),_(this,Zi,n)}get externalId(){var r;return(r=c(this,Zi).properties.externalId)!=null?r:""}get name(){var n,o,i,s,a;let r="";return"details"in c(this,Zi).properties||(r=(n=c(this,Zi).properties.externalId)!=null?n:""),r===""&&(r=(i=(o=c(this,Zi).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,Zi).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,ol).images!=null)return c(this,ol).images;let r=(i=(o=(n=c(this,Zi).properties.details)==null?void 0:n.images)==null?void 0:o.map(l=>new np({mvfData:l,mapData:c(this,Qf)})))!=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,ol).images=r,r}get links(){var n,o,i,s,a;if(c(this,ol).links!=null)return c(this,ol).links;let r=(i=(o=(n=c(this,Zi).properties.details)==null?void 0:n.links)==null?void 0:o.map(l=>new tp({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,ol).links=r,r}get locationProfiles(){var r;return(r=c(this,Qf).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};Qf=new WeakMap,Zi=new WeakMap,ol=new WeakMap;var cg,ip,em,tm,lg=class lg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",lg.__type);M(this,cg);M(this,ip);M(this,em,{});M(this,tm);_(this,cg,r),_(this,ip,n.floorId),_(this,tm,n.mvfData)}static is(r){return r.__type===lg.__type}get center(){var r;if(c(this,em).center==null){let[n,o]=(r=c(this,tm).properties.center)!=null?r:[0,0];c(this,em).center=new Le(o,n,c(this,ip))}return c(this,em).center}get floor(){let r=c(this,cg).getById("floor",c(this,ip));if(r==null)throw new Error("Floor ".concat(c(this,ip)," not found!"));return r}get geoJSON(){return{...c(this,tm),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};cg=new WeakMap,ip=new WeakMap,em=new WeakMap,tm=new WeakMap,m(lg,"__type","area");var h4=lg,Ic=h4;p();var sp,il,ap,rm,ug=class ug extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",ug.__type);M(this,sp);M(this,il);M(this,ap);M(this,rm);_(this,il,{}),_(this,rm,n.mvfData),_(this,sp,r),_(this,ap,n.floorId)}static is(r){return r.__type===ug.__type}get floor(){let r=c(this,sp).getById("floor",c(this,ap));if(r==null)throw new Error("Floor ".concat(c(this,ap)," not found!"));return r}get center(){if(c(this,il).center==null){let[[r,n],[o,i]]=c(this,rm).geometry.coordinates,s=(r+o)/2,a=(n+i)/2;c(this,il).center=new Le(a,s,c(this,ap))}return c(this,il).center}get isExterior(){var o;let r=c(this,sp).obstructionIdByEntranceId[this.id],n=c(this,sp).getMVFFeatureById("obstruction",r);return(o=n==null?void 0:n.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...c(this,rm),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,il)))delete c(this,il)[r]}};sp=new WeakMap,il=new WeakMap,ap=new WeakMap,rm=new WeakMap,m(ug,"__type","door");var y4=ug,Ys=y4;p();var Sc,lp,Ro,Ks,pg=class pg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",pg.__type);M(this,Sc);M(this,lp);M(this,Ro,{});M(this,Ks);_(this,Sc,r),_(this,lp,n.floorId),_(this,Ks,n.mvfData)}getMvfData(){return c(this,Ks)}static is(r){return r.__type===pg.__type}get type(){return n1e(c(this,Ks).properties.kind)}get locations(){if(c(this,Ro).locations)return c(this,Ro).locations;c(this,Ro).locations=[];let r=c(this,Sc).mvfLocationsBySpaceId[c(this,Ks).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let o=c(this,Sc).getById("enterprise-location",n.id);o&&c(this,Ro).locations.push(o)}return c(this,Ro).locations}get floor(){let r=c(this,Sc).getById("floor",c(this,lp));if(r==null)throw new Error("Floor ".concat(c(this,lp)," not found!"));return r}get doors(){return c(this,Ks).properties.destinationNodes.reduce((r,n)=>{let o=c(this,Sc).doorsByNodeId[n];return o&&r.push(o),r},[])}get center(){var r;if(c(this,Ro).center==null){let[n,o]=(r=c(this,Ks).properties.center)!=null?r:[0,0];c(this,Ro).center=new Le(o,n,c(this,lp))}return c(this,Ro).center}get geoJSON(){return{...c(this,Ks),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,Ro)))delete c(this,Ro)[r]}};Sc=new WeakMap,lp=new WeakMap,Ro=new WeakMap,Ks=new WeakMap,m(pg,"__type","space");var g4=pg,r1e=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function n1e(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return r1e.includes(t)?t:"room"}var Qr=g4;p();var di,Qt,fi,fg,v4,dg=class dg extends qi{constructor(r,n){super(n.mvfData.properties.id,r);M(this,fg);m(this,"__type",dg.__type);M(this,di);M(this,Qt,{});M(this,fi);_(this,di,r),_(this,fi,n.mvfData)}static is(r){return r.__type===dg.__type}get focusTarget(){return this}get name(){var r,n;return"name"in c(this,fi).properties?(n=ee(this,fg,v4).call(this,"name"))!=null?n:"":(r=c(this,fi).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in c(this,fi).properties?(n=ee(this,fg,v4).call(this,"shortName"))!=null?n:"":(r=c(this,fi).properties.externalId)!=null?r:""}get externalId(){var r;return(r=c(this,fi).properties.externalId)!=null?r:""}get elevation(){return c(this,fi).properties.elevation}get spaces(){if(c(this,Qt).spaces==null){let r=c(this,di).spaces.filter(n=>n.floor.id===this.id);c(this,Qt).spaces=r}return c(this,Qt).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=c(this,fi).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(c(this,Qt).objects==null){let r=c(this,di).objects.filter(n=>n.floor.id===this.id);c(this,Qt).objects=r}return c(this,Qt).objects}get connections(){if(c(this,Qt).connections==null){let r=c(this,di).connections.filter(n=>n.floors.includes(this));c(this,Qt).connections=r}return c(this,Qt).connections}get doors(){if(c(this,Qt).doors==null){let r=c(this,di).doors.filter(n=>n.floor.id===this.id);c(this,Qt).doors=r}return c(this,Qt).doors}get annotations(){if(c(this,Qt).annotations==null){let r=c(this,di).annotations.filter(n=>n.floor.id===this.id);c(this,Qt).annotations=r}return c(this,Qt).annotations}get pois(){if(c(this,Qt).pois==null){let r=c(this,di).pointsOfInterest.filter(n=>n.floor.id===this.id);c(this,Qt).pois=r}return c(this,Qt).pois}get floorStack(){if(c(this,Qt).floorStack==null){let r=c(this,di).floorStacks.find(n=>n.floors.includes(this));c(this,Qt).floorStack=r}return c(this,Qt).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,Qt)))delete c(this,Qt)[r]}};di=new WeakMap,Qt=new WeakMap,fi=new WeakMap,fg=new WeakSet,v4=function(r){let n=c(this,fi).properties[r];return c(this,di).getPropTranslation(this.__type,r,this.id,n)},m(dg,"__type","floor");var b4=dg,No=b4;p();p();p();function mg(e){let t;if(Qr.is(e)||Ys.is(e)||Bo.is(e)||Ic.is(e)||Xi.is(e))t=e.center;else if(Cc.is(e)||Pc.is(e))t=e.coordinate;else if(Le.is(e))t=e;else if(vc.is(e))t=e.coordinate;else if(sl.is(e))t=e.coordinates[0];else return;return t}p();p();var cp={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}},Js="ExteriorWalls",Tc="Walls",_H=0,nm="InteriorDoors",om="ExteriorDoors",_r="GeometryLayer",al="LabelsLayer",Qs="MarkersLayer",hg="FootprintLayer",im="OcclusionLayer",AH="ImagesLayer",up="FacadesLayer";var kH=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],o1e={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function x4(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&$.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function I4(e,t){var o,i,s,a,l,u;let r=((o=e==null?void 0:e.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,n={...cp,...e,outdoorView:{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=cp.outdoorView)==null?void 0:a.layersHiddenByGeometry,...e==null?void 0:e.outdoorView},bearing:(u=(l=e==null?void 0:e.bearing)!=null?l:t.naturalBearing)!=null?u:0,imagePlacementOptions:{...cp.imagePlacementOptions,...e==null?void 0:e.imagePlacementOptions},multiFloorView:{...cp.multiFloorView,...e==null?void 0:e.multiFloorView}};return r&&n.outdoorView&&(n.outdoorView.token=r),n}function DH(e){let t={remove_watermark:!1};if(e)try{let r=Q1(e);Object.assign(t,r.capabilities)}catch(r){$.error("Error decoding capabilities from token",r)}return t}var wc,mi,ll,yg=class yg extends fn{constructor(r,n){let o=Object.values(n.mvfDataByFloorId)[0];super(r,o);m(this,"__type",yg.__type);M(this,wc);M(this,mi);M(this,ll);_(this,mi,{}),_(this,wc,r),_(this,ll,n.mvfDataByFloorId)}static is(r){return r.__type===yg.__type}get accessible(){var r;return(r=Object.values(c(this,ll))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(c(this,ll))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(c(this,ll))[0].properties.extra}get coordinates(){return c(this,mi).coordinates==null&&(c(this,mi).coordinates=Object.entries(c(this,ll)).map(([r,n])=>new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),c(this,mi).coordinates}get nodes(){return Object.values(c(this,ll))[0].properties.nodes.map(r=>c(this,wc).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?c(this,wc).getById("floor",r.floorId):void 0).filter(Ch)}get locationProfiles(){var n,o,i,s,a;if(c(this,mi).locationProfiles!=null)return c(this,mi).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],u=Xs(l),d=(a=c(this,wc).mvfConnectionIdsByLatLon[u])!=null?a:[];for(let f of d){let h=c(this,wc).locationProfilesByAttachedFeatureId[f];if(h!=null){r=h;break}}}return c(this,mi).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,mi)))delete c(this,mi)[r]}};wc=new WeakMap,mi=new WeakMap,ll=new WeakMap,m(yg,"__type","connection");var S4=yg,pp=S4;p();var bg,dp,Mc,fp,gg=class gg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",gg.__type);M(this,bg);M(this,dp);M(this,Mc,{});M(this,fp);_(this,bg,r),_(this,dp,n.floorId),_(this,fp,n.mvfData)}static is(r){return r.__type===gg.__type}get type(){let r=c(this,fp).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=c(this,bg).getById("floor",c(this,dp));if(r==null)throw new Error("Floor ".concat(c(this,dp)," not found!"));return r}get center(){var r;if(c(this,Mc).center==null){let[n,o]=(r=c(this,fp).properties.center)!=null?r:[0,0];c(this,Mc).center=new Le(o,n,c(this,dp))}return c(this,Mc).center}get geoJSON(){return{...c(this,fp),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,Mc)))c(this,Mc)[r]=null}};bg=new WeakMap,dp=new WeakMap,Mc=new WeakMap,fp=new WeakMap,m(gg,"__type","object");var C4=gg,Bo=C4;p();var xg,mp,Oc,sm,vg=class vg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",vg.__type);M(this,xg);M(this,mp);M(this,Oc,{});M(this,sm);_(this,xg,r),_(this,sm,n.mvfData),_(this,mp,n.floorId)}static is(r){return r.__type===vg.__type}get floor(){let r=c(this,xg).getById("floor",c(this,mp));if(r==null)throw new Error("Floor ".concat(c(this,mp)," not found!"));return r}get coordinate(){var r;if(c(this,Oc).coordinate==null){let[n,o]=(r=c(this,sm).geometry.coordinates)!=null?r:[0,0];c(this,Oc).coordinate=new Le(o,n,c(this,mp))}return c(this,Oc).coordinate}get geoJSON(){return{...c(this,sm),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,Oc))c(this,Oc)[r]=null}};xg=new WeakMap,mp=new WeakMap,Oc=new WeakMap,sm=new WeakMap,m(vg,"__type","point-of-interest");var P4=vg,Cc=P4;p();var Sg,hp,Ec,yp,Cg,w4,Ig=class Ig extends fn{constructor(r,n){super(r,n.mvfData);M(this,Cg);m(this,"__type",Ig.__type);M(this,Sg);M(this,hp);M(this,Ec,{});M(this,yp);_(this,Sg,r),_(this,hp,n.floorId),_(this,yp,n.mvfData)}static is(r){return r.__type===Ig.__type}get group(){return ee(this,Cg,w4).call(this).group}get type(){return ee(this,Cg,w4).call(this).type}get coordinate(){if(c(this,Ec).coordinate==null){let[r,n]=c(this,yp).geometry.coordinates;c(this,Ec).coordinate=new Le(n,r,c(this,hp))}return c(this,Ec).coordinate}get floor(){let r=c(this,Sg).getById("floor",c(this,hp));if(r==null)throw new Error("Floor ".concat(c(this,hp)," not found!"));return r}get geoJSON(){return{...c(this,yp),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,Ec)))delete c(this,Ec)[r]}};Sg=new WeakMap,hp=new WeakMap,Ec=new WeakMap,yp=new WeakMap,Cg=new WeakSet,w4=function(){let[r,n]=c(this,yp).properties.symbolId.split("--");return{group:r,type:n}},m(Ig,"__type","annotation");var T4=Ig,Pc=T4;p();var _c,hi,Yi,am,Tg,O4,Pg=class Pg extends qi{constructor(r,n){super(n.mvfData.id,r);M(this,Tg);m(this,"__type",Pg.__type);M(this,_c);M(this,hi,{});M(this,Yi);M(this,am);_(this,_c,r),_(this,Yi,n.mvfData),_(this,am,n.facadeId)}static is(r){return r.__type===Pg.__type}get type(){return c(this,Yi).type}get name(){var r;return(r=ee(this,Tg,O4).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=ee(this,Tg,O4).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=c(this,Yi).externalId)!=null?r:""}get floors(){var r,n;if(c(this,hi).floors==null){let o=((n=(r=c(this,Yi).floors)!=null?r:c(this,Yi).maps)!=null?n:[]).reduce((i,s)=>{let a=c(this,_c).floorsById[s];return a&&i.push(a),i},[]);o.length===0&&$.error("Floor stack ".concat(this.id," has no floors")),c(this,hi).floors=o}return c(this,hi).floors}get defaultFloor(){if(c(this,hi).defaultFloor!=null)return c(this,hi).defaultFloor;let r=c(this,Yi).defaultFloor?c(this,_c).getById("floor",c(this,Yi).defaultFloor):void 0;return c(this,hi).defaultFloor=r||this.floors.reduce((n,o)=>Math.abs(o.elevation)<Math.abs(n.elevation)?o:n),c(this,hi).defaultFloor}get facade(){return c(this,am)?c(this,_c).facadesById[c(this,am)]: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,hi)))delete c(this,hi)[r]}};_c=new WeakMap,hi=new WeakMap,Yi=new WeakMap,am=new WeakMap,Tg=new WeakSet,O4=function(r){return c(this,_c).getPropTranslation(this.__type,r,this.id,c(this,Yi)[r])},m(Pg,"__type","floor-stack");var M4=Pg,k2=M4;p();var lm,gp,Mg,ea,wg=class wg extends qi{constructor(r,n){super(n.mvfData.id,r);m(this,"__type",wg.__type);M(this,lm);M(this,gp);M(this,Mg);M(this,ea,{});_(this,lm,n.mvfData),_(this,gp,r),_(this,Mg,n.floorStackId)}static is(r){return r.__type===wg.__type}get floorStack(){return c(this,gp).getById("floor-stack",c(this,Mg))}get spaces(){if(!c(this,ea).spaces){c(this,ea).spaces=[];for(let r of c(this,lm).spaces){let n=c(this,gp).getById("space",r.spaceId);n&&c(this,ea).spaces.push(n)}}return c(this,ea).spaces}get center(){if(!c(this,ea).center){let r={type:"FeatureCollection",features:[]};for(let o of this.spaces){let i=c(this,gp).mvfSpacesById[o.id];i&&r.features.push(i)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=_x(r);c(this,ea).center=new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],c(this,lm).spaces[0].floorId)}return c(this,ea).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};lm=new WeakMap,gp=new WeakMap,Mg=new WeakMap,ea=new WeakMap,m(wg,"__type","facade");var E4=wg,Xi=E4;p();var i1e=(e,t)=>{var l,u,d,f,h,b,v,I,x,C,P;let r={},n={},o={},i={},s={},a={};for(let w of e["location.json"]||[]){let T=new cm(t,{mvfData:w});if(r[w.id]=T,w.externalId&&(i[w.externalId]==null&&(i[w.externalId]=[]),i[w.externalId].push(T)),w.categories)for(let N of w.categories)s[N]==null&&(s[N]=[]),s[N].push(T);let O=[...(u=(l=w.obstructions)==null?void 0:l.map(N=>N.id))!=null?u:[],...(f=(d=w.spaces)==null?void 0:d.map(N=>N.id))!=null?f:[],...(b=(h=w.annotations)==null?void 0:h.map(N=>N.id))!=null?b:[],...(v=w.connections)!=null?v:[],...(x=(I=w.entrances)==null?void 0:I.map(N=>N.id))!=null?x:[],...(P=(C=w.areas)==null?void 0:C.map(N=>N.id))!=null?P:[]];for(let N of O)N&&(a[N]==null&&(a[N]=[]),a[N].push(T))}for(let w of e["category.json"]||[]){let T=new F2(t,{mvfData:w});n[w.id]=T,w.parent&&(o[w.parent]==null&&(o[w.parent]=[]),o[w.parent].push(T))}return{locationCategoriesByParentId:o,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:i,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:a}},s1e=(e,t,r)=>{var x,C;let n={},o={},i={},s={},a={},l={},u={},d={},f={},h={},b={},v={},I=globalThis.Object.keys(e.space);for(let P of I){let w=e.space[P];if(w!=null)for(let T of w.features){v[T.properties.id]=P,u[T.properties.id]=T;for(let O of T.properties.destinationNodes)a[O]==null&&(a[O]=[]),a[O].push(T.properties.id);if(T.properties.kind==="desk-entrance"&&(l[T.properties.externalId]==null&&(l[T.properties.externalId]=[]),l[T.properties.externalId].push(...T.properties.destinationNodes)),!["void","desk-entrance"].includes((x=T.properties.kind)!=null?x:"")){if((C=T.properties.kind)!=null&&C.includes("connection")){let O=Xs(T.geometry.coordinates);h[O]==null&&(h[O]=[]),h[O].push(T.properties.id);continue}if(T.properties.kind==="poi"){let O=new Cc(r,{floorId:P,mvfData:T});i[T.properties.id]=O,f[P]||(f[P]=[]),f[P].push(T),T.properties.externalId&&(s[T.properties.externalId]==null&&(s[T.properties.externalId]=[]),s[T.properties.externalId].push(O))}else{let O=new Qr(r,{floorId:P,mvfData:T});n[T.properties.id]=O,T.properties.externalId&&(o[T.properties.externalId]==null&&(o[T.properties.externalId]=[]),o[T.properties.externalId].push(O)),d[P]||(d[P]=[]),d[P].push(T)}}}}for(let P in h){let w=h[P],T={};for(let N of w){let k=v[N],D=u[N],F=t==null?void 0:t["n_"+D.properties.id.split("s_")[1]];T[k]={...D,properties:{...D.properties,accessible:(F==null?void 0:F.accessible)===!0}}}let O=new pp(r,{mvfDataByFloorId:T});b[O.id]=O}return{spacesById:n,spacesByExternalId:o,poisById:i,poisByExternalId:s,connectionsById:b,spaceIdsByDestinationNodeId:a,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:u,connectionIdsByLatLon:h,mvfSpacesByFloorId:d,mvfPoisByFloorId:f}},a1e=(e,t)=>{var s,a;let r={},n={},o={},i={};for(let l of e["node.geojson"].features){o[l.properties.id]=l;let u=new vc(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});r[l.properties.id]=u,l.properties.externalId&&(n[l.properties.externalId]==null&&(n[l.properties.externalId]=[]),n[l.properties.externalId].push(u));let d=(a=l.properties.floor)!=null?a:l.properties.map;i[d]||(i[d]=[]),i[d].push(l)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}},l1e=(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 u of l.features){o[u.properties.id]=u;for(let f of u.properties.entrances)i[f]=u.properties.id;if(u.properties.kind==="Wall")continue;let d=new Bo(t,{floorId:a,mvfData:u});r[u.properties.id]=d,u.properties.externalId&&(n[u.properties.externalId]==null&&(n[u.properties.externalId]=[]),n[u.properties.externalId].push(d))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:o,obstructionIdByEntranceId:i}},c1e=(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 No(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 No(t,{mvfData:{properties:i}});r[i.id]=s}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:o}},u1e=(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 u of a){let d=(l=e.facade)==null?void 0:l[u.id],f=new k2(t,{mvfData:u,facadeId:d==null?void 0:d.id});if(r[u.id]=f,u.externalId&&(n[u.externalId]==null&&(n[u.externalId]=[]),n[u.externalId].push(f)),o[u.id]=u,d){let h=new Xi(t,{mvfData:d,floorStackId:u.id});i[d.id]=h;for(let b of d.spaces)s[b.spaceId]=h}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:o,facadesById:i,facadesBySpaceId:s}},p1e=(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=Xs(a.geometry.coordinates);n[l]==null&&(n[l]=[]),n[l].push(s.id)}return i},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:n}},d1e=(e,t)=>{let r={},n={},o={},i={},s={},a=globalThis.Object.keys(e.entrance);for(let l of a){let u=e.entrance[l];if(u!=null)for(let d of u.features){i[d.properties.id]=d;let f=new Ys(t,{floorId:l,mvfData:d});d.properties.node&&(o[d.properties.node]=f),r[d.properties.id]=f,d.properties.externalId&&(n[d.properties.externalId]==null&&(n[d.properties.externalId]=[]),n[d.properties.externalId].push(f)),s[l]||(s[l]=[]),s[l].push(d)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:o,mvfEntrancesById:i,mvfEntrancesByFloorId:s}},f1e=(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 u=l.properties;u.textArea=a,u.textArea&&(u.textArea.position=s.geometry.coordinates)}}}}},m1e=(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 u=l.properties;u.image=a,u.image&&(u.image.position=s.geometry.coordinates)}}}}},h1e=(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 u=l.properties;u.style={styleId:i,edgeOffset:s.edgeOffset}}})}},y1e=(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)}}},g1e=(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 u=new Pc(t,{floorId:s,mvfData:l});r[l.properties.id]=u,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o}},b1e=(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 u=new Ic(t,{floorId:s,mvfData:l});r[l.properties.id]=u,l.properties.externalId&&(n[l.properties.externalId]==null&&(n[l.properties.externalId]=[]),n[l.properties.externalId].push(u))}}return{areasById:r,areasByExternalId:n,mvfAreasById:o}},FH=(e,t)=>{var C,P,w,T,O,N,k,D,F,z,G,j,K;let r={},n={},o={},i={},s=((P=(C=e.enterprise)==null?void 0:C.locations)!=null?P:[]).reduce((Z,oe)=>(Z[oe.id]=oe,Z),{}),a={},l={},u={},d={},f={},h={},b=((w=e.enterprise)==null?void 0:w.venue)||{},v={},I={};for(let Z of(O=(T=e.enterprise)==null?void 0:T.categories)!=null?O:[]){let oe=new D2(t,{mvfData:Z});a[Z.id]=oe,Z.externalId&&(l[Z.externalId]==null&&(l[Z.externalId]=[]),l[Z.externalId].push(oe)),u[Z.id]=Z,Z.locations.forEach(Q=>{f[Q]==null&&(f[Q]=[]),f[Q].push(Z.id)})}let x={};for(let Z of(k=(N=e.enterprise)==null?void 0:N.locationInstances)!=null?k:[]){let oe=s[Z.parent],Q=Object.keys(oe),ge={};for(let pe of Q)ge[pe]=void 0;let be={...ge,polygons:[],nodes:[],...Z};x[be.parent]==null&&(x[be.parent]=[]),x[be.parent].push(new sl(t,{mvfData:be,categoryIds:((F=(D=e.enterprise)==null?void 0:D.categoryPriorities)==null?void 0:F[be.id])||f[be.id],parentId:Z.parent})),v[be.id]=Z}for(let Z in e.space){let oe=e.space[Z];if(oe!=null)for(let Q of oe.features)for(let ge of Q.properties.destinationNodes)I[ge]==null&&(I[ge]=[]),I[ge].push(Q.properties.id)}for(let Z of(G=(z=e.enterprise)==null?void 0:z.locations)!=null?G:[]){let oe=new sl(t,{mvfData:Z,categoryIds:((K=(j=e.enterprise)==null?void 0:j.categoryPriorities)==null?void 0:K[Z.id])||f[Z.id],locationInstances:x[Z.id]});o[Z.id]=oe,Z.externalId&&(i[Z.externalId]==null&&(i[Z.externalId]=[]),i[Z.externalId].push(oe)),Z.nodes.forEach(Q=>{h[Q.id]==null&&(h[Q.id]=[]),h[Q.id].push(Z.id)});for(let Q of Z.polygons)d[Q.id]==null&&(d[Q.id]=[]),d[Q.id].push(Z)}if(t.enterpriseMode===!0){for(let Z in t.mvfConnectionsById){let oe={},Q=t.mvfConnectionsById[Z];for(let ge of t.mvfConnectionsById[Z].nodes){let be=t.nodesById[ge];be!=null&&(oe[be.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[be.coordinate.longitude,be.coordinate.latitude]},properties:{id:Z,externalId:Q.externalId,kind:"enterprise."+Q.type,destinationNodes:[],flags:"",type:Q.type,nodes:Q.nodes,accessible:Q.accessible,extra:Q.extra,details:Q.details}})}Object.keys(oe).length>0&&(r[Z]=new pp(t,{mvfDataByFloorId:oe}),Q.externalId&&(n[Q.externalId]==null&&(n[Q.externalId]=[]),n[Q.externalId].push(r[Z])))}t.connectionsById=r}return{spaceIdsByNodeId:I,connectionsByExternalId:n,locationIdsByNodeId:h,mvfLocationsBySpaceId:d,mvfLocationsById:s,mvfCategoriesById:u,locationsById:o,locationsByExternalId:i,locationInstancesById:v,categoriesById:a,categoriesByExternalId:l,venue:b}},LH=(e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}=a1e(e,t),{mvfConnectionsById:s,mvfConnectionsByNodeId:a,mvfConnectionIdsByLatLon:l}=p1e(e,o),{spacesById:u,spacesByExternalId:d,spaceIdsByDestinationNodeId:f,poisById:h,poisByExternalId:b,mvfSpacesById:v,objectEntranceNodeIdsByObstructionId:I,connectionsById:x,connectionIdsByLatLon:C,mvfSpacesByFloorId:P,mvfPoisByFloorId:w}=s1e(e,a,t),{objectsById:T,objectsByExternalId:O,mvfObstructionById:N,obstructionIdByEntranceId:k}=l1e(e,t),{floorsById:D,floorsByExternalId:F,mvfFloorsById:z}=c1e(e,t),{floorStacksById:G,floorStacksByExternalId:j,mvfFloorStacksById:K,facadesById:Z,facadesBySpaceId:oe}=u1e(e,t),{doorsById:Q,doorsByExternalId:ge,doorsByNodeId:be,mvfEntrancesById:pe,mvfEntrancesByFloorId:_e}=d1e(e,t),{annotationsById:yt,mvfAnnotationsById:it,mvfAnnotationsByFloorId:Xe}=g1e(e,t),{areasById:Ue,areasByExternalId:de,mvfAreasById:me}=b1e(e,t);m1e(e,v,N),f1e(e,v,N),h1e(e,v),y1e(e,v,N);let{locationCategoriesByParentId:te,locationProfilesById:ie,locationCategoriesById:A,locationProfilesByExternalId:Y,locationProfilesByCategoryId:L,locationProfilesByAttachedFeatureId:le}=i1e(e,t);return{spacesById:u,spacesByExternalId:d,nodesById:r,nodesByExternalId:n,objectsById:T,objectsByExternalId:O,floorsById:D,floorsByExternalId:F,floorStacksById:G,floorStacksByExternalId:j,facadesById:Z,facadesBySpaceId:oe,connectionsById:x,doorsById:Q,doorsByExternalId:ge,doorsByNodeId:be,poisById:h,poisByExternalId:b,annotationsById:yt,areasById:Ue,areasByExternalId:de,spaceIdsByDestinationNodeId:f,objectEntranceNodeIdsByObstructionId:I,obstructionIdByEntranceId:k,connectionIdsByLatLon:C,locationProfilesById:ie,locationCategoriesById:A,locationProfilesByExternalId:Y,locationProfilesByCategoryId:L,locationCategoriesByParentId:te,mvfSpacesById:v,mvfNodesById:o,mvfObstructionById:N,mvfFloorsById:z,mvfFloorStacksById:K,mvfConnectionsById:s,mvfConnectionsByNodeId:a,mvfEntrancesById:pe,mvfAnnotationsById:it,mvfNodesByFloorId:i,mvfSpacesByFloorId:P,mvfPoisByFloorId:w,mvfAreasById:me,mvfEntrancesByFloorId:_e,mvfAnnotationsByFloorId:Xe,locationProfilesByAttachedFeatureId:le,mvfConnectionIdsByLatLon:l}};p();var v1e=new Set(["polygons"]),Ki,dr,bo,Eg,Og=class Og extends zr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",Og.__type);m(this,"description");m(this,"name","");m(this,"amenity");m(this,"externalId","");m(this,"extra");m(this,"gallery");m(this,"instances");m(this,"logo");m(this,"operationHours");m(this,"phone");m(this,"picture");m(this,"shortName");m(this,"showFloatingLabelWhenImagePresent");m(this,"showLogo");m(this,"siblingGroups");m(this,"social");m(this,"sortOrder",-1);m(this,"states");m(this,"tags");m(this,"type","");M(this,Ki);M(this,dr,{});M(this,bo);M(this,Eg);_(this,Ki,r),_(this,bo,n.mvfData),_(this,Eg,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let o in n.mvfData)!v1e.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(n.parentId){let i=c(this,Ki).locationsById[n.parentId];return c(this,bo)[o]!=null?c(this,Ki).getPropTranslation(this.__type,o,c(this,bo).id,c(this,bo)[o]):c(this,Ki).getPropTranslation(this.__type,o,c(this,bo).id,i[o])}return c(this,Ki).getPropTranslation(this.__type,o,c(this,bo).id,c(this,bo)[o])}})}static is(r){return r.__type===Og.__type}get focusTarget(){return this.spaces}get categories(){return c(this,dr).categories?c(this,dr).categories:(c(this,dr).categories=(c(this,Eg).map(r=>c(this,Ki).getById("enterprise-category",r))||[]).filter(Boolean),c(this,dr).categories)}get coordinates(){if(c(this,dr).coordinates)return c(this,dr).coordinates;c(this,dr).coordinates=[];for(let r=0;r<this.nodes.length;r++)c(this,dr).coordinates.push(this.nodes[r].coordinate);return c(this,dr).coordinates}get nodes(){if(c(this,dr).nodes)return c(this,dr).nodes;c(this,dr).nodes=[];for(let r=0;r<c(this,bo).nodes.length;r++){let n=c(this,Ki).getById("node",c(this,bo).nodes[r].id);n&&c(this,dr).nodes.push(n)}return c(this,dr).nodes}get spaces(){if(c(this,dr).spaces)return c(this,dr).spaces;c(this,dr).spaces=[];for(let r=0;r<c(this,bo).polygons.length;r++){let n=c(this,Ki).getById("space",c(this,bo).polygons[r].id);n&&c(this,dr).spaces.push(n)}return c(this,dr).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,dr)))delete c(this,dr)[r]}};Ki=new WeakMap,dr=new WeakMap,bo=new WeakMap,Eg=new WeakMap,m(Og,"__type","enterprise-location");var _4=Og,sl=_4;p();var x1e=new Set,bp,Xn,ta,_g=class _g extends zr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",_g.__type);m(this,"name","");m(this,"color");m(this,"externalId","");m(this,"extra");m(this,"icon");m(this,"iconFromDefaultList");m(this,"sortOrder",-1);m(this,"picture");M(this,bp);M(this,Xn,{});M(this,ta);_(this,bp,r),_(this,ta,n.mvfData);for(let o in n.mvfData)!x1e.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return c(this,bp).getPropTranslation(this.__type,o,c(this,ta).id,c(this,ta)[o])}})}static is(r){return r.__type===_g.__type}get children(){if(c(this,Xn).children)return c(this,Xn).children;c(this,Xn).children=[];for(let r=0;r<c(this,ta).children.length;r++){let n=c(this,bp).getById("enterprise-category",c(this,ta).children[r]);n&&c(this,Xn).children.push(n)}return c(this,Xn).children}get locations(){if(c(this,Xn).locations)return c(this,Xn).locations;c(this,Xn).locations=[];for(let r=0;r<c(this,ta).locations.length;r++){let n=c(this,bp).getById("enterprise-location",c(this,ta).locations[r]);n&&c(this,Xn).locations.push(n)}return c(this,Xn).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,Xn)))delete c(this,Xn)[r]}};bp=new WeakMap,Xn=new WeakMap,ta=new WeakMap,m(_g,"__type","enterprise-category");var A4=_g,D2=A4;p();var I1e=new Set,kg,Dg,Ag=class Ag extends zr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",Ag.__type);m(this,"countrycode");m(this,"externalId","");m(this,"defaultLanguage",{code:"en",name:"English"});m(this,"defaultMap");m(this,"extra");m(this,"icon");m(this,"languages",[]);m(this,"links",[]);m(this,"logo");m(this,"mappedinWebUrl");m(this,"slug","");m(this,"topLocations");m(this,"tzid");M(this,kg,{});M(this,Dg);_(this,Dg,n.mvfData);for(let o in n.mvfData)!I1e.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=n.mvfData[o])}static is(r){return r.__type===Ag.__type}get name(){var r;return(r=c(this,Dg).name)!=null?r:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,kg)))delete c(this,kg)[r]}};kg=new WeakMap,Dg=new WeakMap,m(Ag,"__type","enterprise-venue");var k4=Ag,D4=k4;p();function F4(e){var o,i,s,a,l,u;let t=((i=(o=e.enterprise)==null?void 0:o.locations)==null?void 0:i.reduce((d,f)=>(d[f.id]=f,d),{}))||{};for(let d of((s=e.enterprise)==null?void 0:s.locationInstances)||[])t[d.id]=d;let r={};for(let d of e["floorstack.json"]||[])r[d.id]=d;let n={};for(let d of((a=e["floor.geojson"])==null?void 0:a.features)||[])d.properties&&d.properties.id&&(n[d.properties.id]=d.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((u=(l=e.enterprise)==null?void 0:l.categories)==null?void 0:u.reduce((d,f)=>(d[f.id]=f,d),{}))||{},"floor-stack":r,floor:n}}}function RH(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}function NH(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}p();p();p();p();p();p();p();var vp=class{constructor({origin:t,destination:r,distance:n=0,angle:o=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:s=!0}){m(this,"origin");m(this,"destination");m(this,"distance");m(this,"angle");m(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=o,this.weight=i||0,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.")}};p();p();p();function cl(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=ui(e),o=jf(t),i=o.type,s=t.bbox,a=o.coordinates;if(s&&S1e(n,s)===!1)return!1;i==="Polygon"&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(BH(n,a[u][0],r.ignoreBoundary)){for(var d=!1,f=1;f<a[u].length&&!d;)BH(n,a[u][f],!r.ignoreBoundary)&&(d=!0),f++;d||(l=!0)}return l}function BH(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],u=t[i][1],d=e[1]*(s-l)+a*(l-e[0])+u*(e[0]-s)===0&&(s-e[0])*(l-e[0])<=0&&(a-e[1])*(u-e[1])<=0;if(d)return!r;var f=a>e[1]!=u>e[1]&&e[0]<(l-s)*(e[1]-a)/(u-a)+s;f&&(n=!n)}return n}function S1e(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}p();p();function ul([e,t],[r,n]){let o=t-n,i=e-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}p();var C1e=63710088e-1;function Ji(e,t){let[r,n]=e.map(d=>d*Math.PI/180),[o,i]=t.map(d=>d*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),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return C1e*u}p();p();function L2(e,t,r,n){let[o,i]=e,[s,a]=t,[l,u]=r,[d,f]=n;if(i===a&&o===s||u===f&&l===d)return null;let h=(d-l)*(a-i)-(f-u)*(s-o);if(h===0)return null;let b=((f-u)*(o-l)-(d-l)*(i-u))/h,v=((a-i)*(o-l)-(s-o)*(i-u))/h;if(b<0||b>1||v<0||v>1)return null;let I=i+b*(a-i);return[o+b*(s-o),I]}p();function L4(e,t,r,n){let o=Yu(e,r/1e3,n),i=Yu(t,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}p();function R4(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}var $H=111e3;function jH(e,t,r=[],n=0){let o=!0,i=e.geometry.coordinates,s=t.geometry.coordinates,a=R4(ul(i,s)-Math.PI/2),l=R4(ul(i,s)+Math.PI/2),u=n/$H,d=n/($H*Math.cos(i[1]*Math.PI/180)),f=Math.min(i[1],s[1])-u,h=Math.max(i[1],s[1])+u,b=Math.min(i[0],s[0])-d,v=Math.max(i[0],s[0])+d;for(let I of r)if(!(Math.max(I[0][1],I[1][1])<f||Math.min(I[0][1],I[1][1])>h||Math.max(I[0][0],I[1][0])<b||Math.min(I[0][0],I[1][0])>v)){if(n>0){let x=L4(i,s,n,a),C=L4(i,s,n,l);if(L2(x[0],x[1],I[0],I[1])||L2(C[0],C[1],I[0],I[1])){o=!1;return}}else if(L2(i,s,I[0],I[1])){o=!1;return}}return o}var xp,mn,N4,GH,UH,VH,zH,HH,WH,N2,R2=class{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){M(this,mn);m(this,"edges",{});m(this,"nodesById");m(this,"nodesByGroup",new Map);M(this,xp);M(this,N2,(t,r)=>{let n=0;for(let o of r)(!o[c(this,xp)]||o[c(this,xp)]===t.properties[c(this,xp)])&&cl(t.geometry.coordinates,o.geometry.geometry)&&(n+=Math.max(0,o.cost));return n});_(this,xp,r);let{features:o}=t;this.nodesById=ee(this,mn,GH).call(this,o),ee(this,mn,UH).call(this),ee(this,mn,VH).call(this,o,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,o)=>{let i=Ji(t.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:o,zones:i}){let s=ee(this,mn,N4).call(this,t),a=ee(this,mn,N4).call(this,r);if(s.length===0||a.length===0)return[];let{frontier:l,cameFrom:u,costSoFar:d}=ee(this,mn,zH).call(this,s,a);for(;l.length>0;){let f=l.shift();if(!f)break;if(ee(this,mn,HH).call(this,f.origin,a))return ee(this,mn,WH).call(this,u,f.origin.properties.id);for(let h of this.edges[f.origin.properties.id]){if(o!=null&&o.has(h.origin.properties.id)&&h.destination.properties.map!==h.origin.properties.map)continue;let b=d[f.origin.properties.id]+h.weight+c(this,N2).call(this,h.destination,i);if(!(b===1/0||n!=null&&n.has(h.destination.properties.id))&&(d[h.destination.properties.id]==null||b<d[h.destination.properties.id])){let v=b+this.getShortestEuclideanDistance(h.destination,a);d[h.destination.properties.id]=b,u[h.destination.properties.id]=h,l.push({origin:h.destination,priority:v})}}l.sort((h,b)=>h.priority-b.priority)}return[]}};xp=new WeakMap,mn=new WeakSet,N4=function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},GH=function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},UH=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]))},VH=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],u=Ji(o.geometry.coordinates,l.geometry.coordinates),d=ul(o.geometry.coordinates,l.geometry.coordinates);return new vp({origin:o,destination:l,pathWeight:a,distance:u,angle:d,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},zH=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}},HH=function(t,r){return r.some(n=>n.properties.id===t.properties.id)},WH=function(t,r){let n=[],o=t[r];for(;o;)n.push(o),o=t[o.origin.properties.id];return n.reverse()},N2=new WeakMap;var P1e=.4,um=class{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o}){m(this,"groupBy");m(this,"graph");m(this,"geometryEdgesByMapId",new Map);m(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});m(this,"getDistance",(t,r)=>Ji(t,r));m(this,"getAngle",(t,r)=>ul(t,r));this.groupBy=n,this.graph=new R2({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((u,d)=>{this.geometryEdgesByMapId.get(l).push([u,a[d+1]||a[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:o,disabledConnectionNodeIds:i,simplify:s,multiplicativeDistanceWeightScaling:a}){var f,h;let l=(f=s==null?void 0:s.enabled)!=null?f:!0,u=t!=null?t:[],d=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:u,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(i)});return d.length===0?{type:"FeatureCollection",features:[]}:(l&&(d=this.simplifyAllSteps(d,(h=s==null?void 0:s.bufferRadius)!=null?h:P1e,a)),this.generatePath(d))}simplifyAllSteps(t,r,n){var u,d;let o=[],i=[t[0]];for(let f=1;f<t.length;f++)if(this.groupBy!=="default"&&t[f].origin.properties[this.groupBy]!==t[f-1].origin.properties[this.groupBy]){let h=t[f-1].origin.properties[this.groupBy],b=(u=this.geometryEdgesByMapId.get(h))!=null?u:[];o.push(...this.simplifySteps(i,b,r,n)),i=[t[f]]}else i.push(t[f]);let s=t[t.length-1],a=this.groupBy==="default"?this.groupBy:s.origin.properties[this.groupBy],l=(d=this.geometryEdgesByMapId.get(a))!=null?d:[];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||!jH(t[s].origin,t[a].origin,r,n)){let l=a-1;i.push(new vp({...t[s],destination:t[l].origin,distance:Ji(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:ul(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),s=l}return i.push(new vp({...t[s],destination:t[t.length-1].origin,distance:Ji(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:ul(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),i}};p();function yi(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}function T1e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}var B4=(e,t)=>{let r=T1e(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}=l4(o,s);i=l.map(u=>u.geometry.coordinates),n.entrances.features.push(...a)}n.walls.geometry.coordinates.push(...i)}return n};function qH(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 ZH(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 B2(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 $4(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 XH(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 YH(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function KH(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 JH(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 $2(e,t){return e.reduce((r,n)=>{let o=t[n.properties.id];if(o==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let i={...o,id:o.id+"-textures"};r.set(i,[n])}else r.has(o)||r.set(o,[]),r.get(o).push(n);return r},new Map)}function pm(e,t={}){var o,i,s,a,l,u,d;let r={...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 f=(d=(u=t==null?void 0:t.style)==null?void 0:u.wallTopColor)!=null?d:t==null?void 0:t.wallTopColor;f!=null&&(r.topColor=f)}return r}var QH=(e,t)=>{var o;let n=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(_r);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Tc);case"exterior-walls":return n==null?void 0:n.layers.get(Js);case"interior-doors":return n==null?void 0:n.layers.get(nm);case"exterior-doors":return n==null?void 0:n.layers.get(om);default:return typeof e=="string"?e:e.id}};function j4(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}function j2(e){return e.bbox?e.bbox:Md(e)}function eW(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 tW(e){return[...new Set(e)]}function G4(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}function dm(e){if(Qr.is(e)||Bo.is(e))return e.id}function rW(e,t,r){var i,s,a,l,u,d;let n=e.coordinates.length===2,o=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let f=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),h=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);f&&h&&(o=((s=(i=r.getState(f))==null?void 0:i.visible)!=null?s:!0)&&((l=(a=r.getState(h))==null?void 0:a.visible)!=null?l:!0))}else{let f=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;o=f&&(d=(u=r.getState(f))==null?void 0:u.visible)!=null?d:!0}return o}var nW=Math.PI*.1,Ar,Ln,Yn,Ip,Sp,pl,Cp,mm,gi,oW,fm,iW,V2=class{constructor(t,r,n,o){M(this,gi);M(this,Ar,{});M(this,Ln);M(this,Yn);M(this,Ip);M(this,Sp);M(this,pl);M(this,Cp);M(this,mm);_(this,Ln,r),_(this,Yn,t.features),_(this,Ip,n),_(this,Sp,o)}get path(){return c(this,Yn).map(t=>c(this,Ln).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(c(this,Ar).departure)return c(this,Ar).departure;let t=c(this,Yn)[0].properties.id,r=c(this,Ip)[0];if(c(this,Ip).length>1){for(let n of c(this,Ip))if(Fg(n,c(this,Ln)).includes(t)){r=n;break}}return c(this,Ar).departure=r,r}get destination(){if(c(this,Ar).destination)return c(this,Ar).destination;let t=c(this,Yn)[c(this,Yn).length-1].properties.id,r=c(this,Sp)[0];if(c(this,Sp).length>1){for(let n of c(this,Sp))if(Fg(n,c(this,Ln)).includes(t)){r=n;break}}return c(this,Ar).destination=r,r}get coordinates(){return c(this,Ar).coordinates?c(this,Ar).coordinates:(c(this,Ar).coordinates=c(this,Yn).map(t=>new Le(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),c(this,Ar).coordinates)}get distance(){return c(this,Ar).distance?c(this,Ar).distance:(c(this,Ar).distance=c(this,Yn).reduce((t,r)=>t+(r.properties.distance||0),0),c(this,Ar).distance)}get instructions(){if(c(this,Yn).length<2)return[];if(c(this,Ar).instructions)return c(this,Ar).instructions;let t=[],r=0;for(let n=0;n<c(this,Yn).length;n++){let o=c(this,Yn)[n],i=c(this,Yn)[n-1],s=c(this,Yn)[n+1],a=new Le(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=ee(this,gi,oW).call(this,{prevDirection:i,direction:o,nextDirection:s});r+=(i==null?void 0:i.properties.distance)||0;for(let u of l)u&&(t.push({action:u,distance:r,coordinate:a,node:c(this,Ln).getById("node",o.properties.id)}),r=0)}return c(this,Ar).instructions=t,c(this,Ar).instructions}};Ar=new WeakMap,Ln=new WeakMap,Yn=new WeakMap,Ip=new WeakMap,Sp=new WeakMap,pl=new WeakMap,Cp=new WeakMap,mm=new WeakMap,gi=new WeakSet,oW=function(t){var v,I;let{prevDirection:r,direction:n,nextDirection:o}=t,i=r&&c(this,Ln).getById("floor",r.properties.groupBy),s=c(this,Ln).getById("floor",n.properties.groupBy),a=o&&c(this,Ln).getById("floor",o.properties.groupBy),l=[];r||l.push({type:"Departure"});let u=c(this,Ln).getMVFFeatureByNodeId("connection",n.properties.id),d=u?c(this,Ln).getById("connection",u.id):void 0,f=u&&u.nodes.length>1,h=c(this,Ln).enterpriseMode&&(!n.properties.destination||!(u!=null&&u.nodes.includes(n.properties.destination))||!(u!=null&&u.nodes.includes(n.properties.id)));if(u&&!(!f||h))if(!c(this,pl)||c(this,pl)==="exit")l.push(ee(this,gi,fm).call(this,"TakeConnection",s,a,d,u)),_(this,pl,"take"),_(this,Cp,d),_(this,mm,u);else{let x=c(this,Ln).getMVFFeatureByNodeId("connection",(v=r==null?void 0:r.properties.id)!=null?v:""),C=c(this,Ln).getById("connection",(I=x==null?void 0:x.id)!=null?I:"");l.push(ee(this,gi,fm).call(this,"ExitConnection",s,i,C,x)),_(this,pl,"exit"),_(this,Cp,d),_(this,mm,u)}else c(this,pl)==="take"?(l.push(ee(this,gi,fm).call(this,"ExitConnection",s,i,c(this,Cp),c(this,mm))),_(this,pl,"exit"),_(this,Cp,d)):a&&s.id!==a.id?l.push(ee(this,gi,fm).call(this,"TakeConnection",s,a,d)):i&&i.id!==s.id?l.push(ee(this,gi,fm).call(this,"ExitConnection",s,i,d)):l.push(ee(this,gi,iW).call(this,r,n));return o||l.push({type:"Arrival"}),l},fm=function(t,r,n,o,i){var l,u;let s="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let d=r.elevation-n.elevation;d>0?s="down":d<0&&(s="up")}let a=(u=(l=o==null?void 0:o.type)!=null?l:i==null?void 0:i.type)!=null?u:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:s,connection:o,connectionType:a}},iW=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?-YH(t.properties.angle,r.properties.angle):0;return Math.abs(i)>=nW?{type:"Turn",bearing:KH(i,nW),referencePosition:"At"}:null};var z2=class{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:o,multiplicativeDistanceWeightScaling:i}){m(this,"navigator");m(this,"connections");m(this,"getDirections",(t,r,n,o)=>{let{accessible:i,smoothing:{enabled:s,radius:a}}=n,l=t.flatMap(v=>Fg(v,o)),u=r.flatMap(v=>Fg(v,o)),d=this.getExcludedNodeIds(n.excludedConnections).filter(v=>!l.includes(v)&&!u.includes(v)),f=this.getDisabledConnectionNodeIds(i).filter(v=>!l.includes(v)&&!u.includes(v)),h=this.navigator.getDirections({zones:n.zones.map(v=>{var I;return{geometry:v.geometry,cost:v.cost,map:(I=v.floor)==null?void 0:I.id}}),originIds:l,destinationNodeIds:u,excludedNodeIds:d,disabledConnectionNodeIds:f,simplify:{enabled:s,bufferRadius:a},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(h,t,r);let b=new V2(h,o,t,r);if(!(b.distance===0&&new Set([...l,...u]).size===l.length+u.length))return b});m(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,[])});m(this,"getDisabledConnectionNodeIds",t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]));m(this,"addCoordinateDirections",(t,[r],[n])=>{if(t.features.length){if(Le.is(r)){let o=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if(Le.is(n)){let o=this.createDirectionFeature(n,0,0),i=t.features[t.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[n.longitude,n.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(o)}}});m(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 um({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 Fg(e,t){var r,n,o,i;if(cm.is(e))return e.navigationTarget.flatMap(s=>Fg(s,t));if(Pc.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(Le.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(Cc.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(Ys.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(Ic.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(Qr.is(e)){let s=t==null?void 0:t.getMVFFeatureById("space",e.id);return s==null?[]:s.properties.destinationNodes}else{if(pp.is(e))return e.coordinates.reduce((s,a)=>{var u;let l=t.Query.nearest(a,{types:["node"]});return(u=l==null?void 0:l[0])!=null&&u.feature.id&&s.push(l[0].feature.id),s},[]);if(Bo.is(e)){let s=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return s!=null?s:[]}else return Xi.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"):sl.is(e)?e.nodes.map(s=>s.id):vc.is(e)?[e.id]:[]}}p();p();p();p();p();p();function sW(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return aW(this.cover(t,r),t,r,e)}function aW(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,u=e._x1,d=e._y1,f,h,b,v,I,x,C,P;if(!i)return e._root=s,e;for(;i.length;)if((I=t>=(f=(a+u)/2))?a=f:u=f,(x=r>=(h=(l+d)/2))?l=h:d=h,o=i,!(i=i[C=x<<1|I]))return o[C]=s,e;if(b=+e._x.call(null,i.data),v=+e._y.call(null,i.data),t===b&&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>=(f=(a+u)/2))?a=f:u=f,(x=r>=(h=(l+d)/2))?l=h:d=h;while((C=x<<1|I)===(P=(v>=h)<<1|b>=f));return o[P]=i,o[C]=s,e}function lW(e){var t,r,n=e.length,o,i,s=new Array(n),a=new Array(n),l=1/0,u=1/0,d=-1/0,f=-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>d&&(d=o),i<u&&(u=i),i>f&&(f=i));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<n;++r)aW(this,s[r],a[r],e[r]);return this}p();function cW(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,u;r>e||e>=o||n>t||t>=i;)switch(u=(t<n)<<1|e<r,l=new Array(4),l[u]=a,a=l,s*=2,u){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}p();function uW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}p();function pW(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]]}p();p();function en(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function dW(e,t,r){var n,o=this._x0,i=this._y0,s,a,l,u,d=this._x1,f=this._y1,h=[],b=this._root,v,I;for(b&&h.push(new en(b,o,i,d,f)),r==null?r=1/0:(o=e-r,i=t-r,d=e+r,f=t+r,r*=r);v=h.pop();)if(!(!(b=v.node)||(s=v.x0)>d||(a=v.y0)>f||(l=v.x1)<o||(u=v.y1)<i))if(b.length){var x=(s+l)/2,C=(a+u)/2;h.push(new en(b[3],x,C,l,u),new en(b[2],s,C,x,u),new en(b[1],x,a,l,C),new en(b[0],s,a,x,C)),(I=(t>=C)<<1|e>=x)&&(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,b.data),w=t-+this._y.call(null,b.data),T=P*P+w*w;if(T<r){var O=Math.sqrt(r=T);o=e-O,i=t-O,d=e+O,f=t+O,n=b.data}}return n}p();function fW(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,r=this._root,n,o,i,s=this._x0,a=this._y0,l=this._x1,u=this._y1,d,f,h,b,v,I,x,C;if(!r)return this;if(r.length)for(;;){if((v=d>=(h=(s+l)/2))?s=h:l=h,(I=f>=(b=(a+u)/2))?a=b:u=b,t=r,!(r=r[x=I<<1|v]))return this;if(!r.length)break;(t[x+1&3]||t[x+2&3]||t[x+3&3])&&(n=t,C=x)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(i=r.next)&&delete r.next,o?(i?o.next=i:delete o.next,this):t?(i?t[x]=i:delete t[x],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[C]=r:this._root=r),this):(this._root=i,this)}function mW(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}p();function hW(){return this._root}p();function yW(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}p();function gW(e){var t=[],r,n=this._root,o,i,s,a,l;for(n&&t.push(new en(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 u=(i+a)/2,d=(s+l)/2;(o=n[3])&&t.push(new en(o,u,d,a,l)),(o=n[2])&&t.push(new en(o,i,d,u,l)),(o=n[1])&&t.push(new en(o,u,s,a,d)),(o=n[0])&&t.push(new en(o,i,s,u,d))}return this}p();function bW(e){var t=[],r=[],n;for(this._root&&t.push(new en(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,u=n.y1,d=(s+l)/2,f=(a+u)/2;(i=o[0])&&t.push(new en(i,s,a,d,f)),(i=o[1])&&t.push(new en(i,d,a,l,f)),(i=o[2])&&t.push(new en(i,s,f,d,u)),(i=o[3])&&t.push(new en(i,d,f,l,u))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}p();function vW(e){return e[0]}function xW(e){return arguments.length?(this._x=e,this):this._x}p();function IW(e){return e[1]}function SW(e){return arguments.length?(this._y=e,this):this._y}function Lg(e,t,r){var n=new U4(t==null?vW:t,r==null?IW:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}function U4(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 CW(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var Kn=Lg.prototype=U4.prototype;Kn.copy=function(){var e=new U4(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=CW(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]=CW(n));return e};Kn.add=sW;Kn.addAll=lW;Kn.cover=cW;Kn.data=uW;Kn.extent=pW;Kn.find=dW;Kn.remove=fW;Kn.removeAll=mW;Kn.root=hW;Kn.size=yW;Kn.visit=gW;Kn.visitAfter=bW;Kn.x=xW;Kn.y=SW;var $o,Ac,H2=class{constructor(t){M(this,$o,{});M(this,Ac);_(this,Ac,t)}getTreeByType(t,r,n){var s;if(c(this,$o)[t]||(c(this,$o)[t]={}),c(this,$o)[t][r]&&c(this,$o)[t][r][n])return c(this,$o)[t][r][n];c(this,$o)[t][r]||(c(this,$o)[t][r]={}),c(this,$o)[t][r][n]||(c(this,$o)[t][r][n]=Lg());let o=c(this,$o)[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,Ac).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,Ac).mvfPoisByFloorId[n]||[];break;case"door":i=c(this,Ac).mvfEntrancesByFloorId[n]||[];break;case"annotation":i=c(this,Ac).mvfAnnotationsByFloorId[n]||[];break}return(i==null?void 0:i.length)>0&&o.addAll(i),o}};$o=new WeakMap,Ac=new WeakMap;p();var Pt;(function(e){e.assertEqual=o=>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"&&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})(Pt||(Pt={}));var z4;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(z4||(z4={}));var he=Pt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kc=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}},se=Pt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),w1e=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),jo=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=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 u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],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,Pt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};jo.create=e=>new jo(e);var gm=(e,t)=>{let r;switch(e.code){case se.invalid_type:e.received===he.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,Pt.jsonStringifyReplacer));break;case se.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(Pt.joinValues(e.keys,", "));break;case se.invalid_union:r="Invalid input";break;case se.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(Pt.joinValues(e.options));break;case se.invalid_enum_value:r="Invalid enum value. Expected ".concat(Pt.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,'"'):Pt.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,Pt.assertNever(e)}return{message:r}},wW=gm;function M1e(e){wW=e}function W2(){return wW}var q2=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},O1e=[];function fe(e,t){let r=W2(),n=q2({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===gm?void 0:gm].filter(o=>!!o)});e.common.issues.push(n)}var Rn=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 Be;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 Be;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}}},Be=Object.freeze({status:"aborted"}),ym=e=>({status:"dirty",value:e}),Jn=e=>({status:"valid",value:e}),H4=e=>e.status==="aborted",W4=e=>e.status==="dirty",Bg=e=>e.status==="valid",$g=e=>typeof Promise<"u"&&e instanceof Promise;function Z2(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)}function MW(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}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 Rg,Ng,vi=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||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},PW=(e,t)=>{if(Bg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new jo(e.common.issues);return this._error=r,this._error}}};function He(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 l,u;let{message:d}=e;return s.code==="invalid_enum_value"?{message:d!=null?d:a.defaultError}:typeof a.data>"u"?{message:(l=d!=null?d:n)!==null&&l!==void 0?l:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d!=null?d:r)!==null&&u!==void 0?u:a.defaultError}},description:o}}var We=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return kc(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:kc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:kc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if($g(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let o={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:kc(t)},i=this._parseSync({data:t,path:o.path,parent:o});return PW(o,i)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:kc(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await($g(o)?o:Promise.resolve(o));return PW(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({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 Go({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return bi.create(this,this._def)}nullable(){return na.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ml.create(this,this._def)}promise(){return Lc.create(this,this._def)}or(t){return _p.create([this,t],this._def)}and(t){return Ap.create(this,t,this._def)}transform(t){return new Go({...He(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rp({...He(this._def),innerType:this,defaultValue:r,typeName:Re.ZodDefault})}brand(){return new jg({typeName:Re.ZodBranded,type:this,...He(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Np({...He(this._def),innerType:this,catchValue:r,typeName:Re.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Gg.create(this,t)}readonly(){return Bp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},E1e=/^c[^\s-]{8,}$/i,_1e=/^[0-9a-z]+$/,A1e=/^[0-9A-HJKMNP-TV-Z]{26}$/,k1e=/^[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,D1e=/^[a-z0-9_-]{21}$/i,F1e=/^[-+]?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)?)??$/,L1e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R1e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",V4,N1e=/^(?:(?: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])$/,B1e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,$1e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OW="((\\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])))",j1e=new RegExp("^".concat(OW,"$"));function EW(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}function G1e(e){return new RegExp("^".concat(EW(e),"$"))}function _W(e){let t="".concat(OW,"T").concat(EW(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 U1e(e,t){return!!((t==="v4"||!t)&&N1e.test(e)||(t==="v6"||!t)&&B1e.test(e))}var Dc=class e extends We{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){let i=this._getOrReturnCtx(t);return fe(i,{code:se.invalid_type,expected:he.string,received:i.parsedType}),Be}let n=new Rn,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),fe(o,{code: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),fe(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?fe(o,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&fe(o,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")L1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"email",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")V4||(V4=new RegExp(R1e,"u")),V4.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"emoji",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")k1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"uuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")D1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"nanoid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")E1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"cuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")_1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"cuid2",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")A1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"ulid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),fe(o,{validation:"url",code: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),fe(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),fe(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),fe(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),fe(o,{code:se.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?_W(i).test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:se.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?j1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:se.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?G1e(i).test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{code:se.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?F1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"duration",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?U1e(t.data,i.version)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"ip",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?$1e.test(t.data)||(o=this._getOrReturnCtx(t,o),fe(o,{validation:"base64",code:se.invalid_string,message:i.message}),n.dirty()):Pt.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:se.invalid_string,...Me.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...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({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...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({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({kind:"duration",...Me.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Me.errToObj(r)})}includes(t,r){return this._addCheck({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({kind:"startsWith",value:t,...Me.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Me.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Me.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Me.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Me.errToObj(r)})}nonempty(t){return this.min(1,Me.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Dc.create=e=>{var t;return new Dc({checks:[],typeName:Re.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};function V1e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}var Pp=class e extends We{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)!==he.number){let i=this._getOrReturnCtx(t);return fe(i,{code:se.invalid_type,expected:he.number,received:i.parsedType}),Be}let n,o=new Rn;for(let i of this._def.checks)i.kind==="int"?Pt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),fe(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),fe(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),fe(n,{code:se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?V1e(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),fe(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),fe(n,{code:se.not_finite,message:i.message}),o.dirty()):Pt.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,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({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Me.toString(o)}]})}_addCheck(t){return new e({...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"&&Pt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Pp.create=e=>new Pp({checks:[],typeName:Re.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});var Tp=class e extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==he.bigint){let i=this._getOrReturnCtx(t);return fe(i,{code:se.invalid_type,expected:he.bigint,received:i.parsedType}),Be}let n,o=new Rn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),fe(n,{code: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),fe(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),fe(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Pt.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({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Me.toString(o)}]})}_addCheck(t){return new e({...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}};Tp.create=e=>{var t;return new Tp({checks:[],typeName:Re.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};var wp=class extends We{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){let n=this._getOrReturnCtx(t);return fe(n,{code:se.invalid_type,expected:he.boolean,received:n.parsedType}),Be}return Jn(t.data)}};wp.create=e=>new wp({typeName:Re.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});var Mp=class e extends We{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){let i=this._getOrReturnCtx(t);return fe(i,{code:se.invalid_type,expected:he.date,received:i.parsedType}),Be}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return fe(i,{code:se.invalid_date}),Be}let n=new Rn,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),fe(o,{code: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),fe(o,{code:se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Pt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...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}};Mp.create=e=>new Mp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Re.ZodDate,...He(e)});var bm=class extends We{_parse(t){if(this._getType(t)!==he.symbol){let n=this._getOrReturnCtx(t);return fe(n,{code:se.invalid_type,expected:he.symbol,received:n.parsedType}),Be}return Jn(t.data)}};bm.create=e=>new bm({typeName:Re.ZodSymbol,...He(e)});var Op=class extends We{_parse(t){if(this._getType(t)!==he.undefined){let n=this._getOrReturnCtx(t);return fe(n,{code:se.invalid_type,expected:he.undefined,received:n.parsedType}),Be}return Jn(t.data)}};Op.create=e=>new Op({typeName:Re.ZodUndefined,...He(e)});var Ep=class extends We{_parse(t){if(this._getType(t)!==he.null){let n=this._getOrReturnCtx(t);return fe(n,{code:se.invalid_type,expected:he.null,received:n.parsedType}),Be}return Jn(t.data)}};Ep.create=e=>new Ep({typeName:Re.ZodNull,...He(e)});var Fc=class extends We{constructor(){super(...arguments),this._any=!0}_parse(t){return Jn(t.data)}};Fc.create=e=>new Fc({typeName:Re.ZodAny,...He(e)});var fl=class extends We{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Jn(t.data)}};fl.create=e=>new fl({typeName:Re.ZodUnknown,...He(e)});var Qi=class extends We{_parse(t){let r=this._getOrReturnCtx(t);return fe(r,{code:se.invalid_type,expected:he.never,received:r.parsedType}),Be}};Qi.create=e=>new Qi({typeName:Re.ZodNever,...He(e)});var vm=class extends We{_parse(t){if(this._getType(t)!==he.undefined){let n=this._getOrReturnCtx(t);return fe(n,{code:se.invalid_type,expected:he.void,received:n.parsedType}),Be}return Jn(t.data)}};vm.create=e=>new vm({typeName:Re.ZodVoid,...He(e)});var ml=class e extends We{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==he.array)return fe(r,{code:se.invalid_type,expected:he.array,received:r.parsedType}),Be;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(fe(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&&(fe(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&&(fe(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 vi(r,s,r.path,a)))).then(s=>Rn.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new vi(r,s,r.path,a)));return Rn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Me.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Me.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Me.toString(r)}})}nonempty(t){return this.min(1,t)}};ml.create=(e,t)=>new ml({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...He(t)});function hm(e){if(e instanceof vo){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=bi.create(hm(n))}return new vo({...e._def,shape:()=>t})}else return e instanceof ml?new ml({...e._def,type:hm(e.element)}):e instanceof bi?bi.create(hm(e.unwrap())):e instanceof na?na.create(hm(e.unwrap())):e instanceof ra?ra.create(e.items.map(t=>hm(t))):e}var vo=class e extends We{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Pt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==he.object){let u=this._getOrReturnCtx(t);return fe(u,{code:se.invalid_type,expected:he.object,received:u.parsedType}),Be}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Qi&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let l=[];for(let u of s){let d=i[u],f=o.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new vi(o,f,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Qi){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(fe(o,{code:se.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of a){let f=o.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new vi(o,f,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Rn.mergeObjectSync(n,u)):Rn.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,i,s,a;let l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Me.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Re.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return Pt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return Pt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return hm(this)}partial(t){let r={};return Pt.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return Pt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof bi;)i=i._def.innerType;r[n]=i}}),new e({...this._def,shape:()=>r})}keyof(){return AW(Pt.objectKeys(this.shape))}};vo.create=(e,t)=>new vo({shape:()=>e,unknownKeys:"strip",catchall:Qi.create(),typeName:Re.ZodObject,...He(t)});vo.strictCreate=(e,t)=>new vo({shape:()=>e,unknownKeys:"strict",catchall:Qi.create(),typeName:Re.ZodObject,...He(t)});vo.lazycreate=(e,t)=>new vo({shape:e,unknownKeys:"strip",catchall:Qi.create(),typeName:Re.ZodObject,...He(t)});var _p=class extends We{_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 jo(a.ctx.common.issues));return fe(r,{code:se.invalid_union,unionErrors:s}),Be}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...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 u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new jo(l));return fe(r,{code:se.invalid_union,unionErrors:a}),Be}}get options(){return this._def.options}};_p.create=(e,t)=>new _p({options:e,typeName:Re.ZodUnion,...He(t)});var dl=e=>e instanceof kp?dl(e.schema):e instanceof Go?dl(e.innerType()):e instanceof Dp?[e.value]:e instanceof Fp?e.options:e instanceof Lp?Pt.objectValues(e.enum):e instanceof Rp?dl(e._def.innerType):e instanceof Op?[void 0]:e instanceof Ep?[null]:e instanceof bi?[void 0,...dl(e.unwrap())]:e instanceof na?[null,...dl(e.unwrap())]:e instanceof jg||e instanceof Bp?dl(e.unwrap()):e instanceof Np?dl(e._def.innerType):[],X2=class e extends We{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.object)return fe(r,{code:se.invalid_type,expected:he.object,received:r.parsedType}),Be;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(fe(r,{code:se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Be)}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=dl(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({typeName:Re.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...He(n)})}};function q4(e,t){let r=kc(e),n=kc(t);if(e===t)return{valid:!0,data:e};if(r===he.object&&n===he.object){let o=Pt.objectKeys(t),i=Pt.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let l=q4(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===he.array&&n===he.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=q4(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===he.date&&n===he.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ap=class extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(H4(i)||H4(s))return Be;let a=q4(i.value,s.value);return a.valid?((W4(i)||W4(s))&&r.dirty(),{status:r.value,value:a.data}):(fe(n,{code:se.invalid_intersection_types}),Be)};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}))}};Ap.create=(e,t,r)=>new Ap({left:e,right:t,typeName:Re.ZodIntersection,...He(r)});var ra=class e extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.array)return fe(n,{code:se.invalid_type,expected:he.array,received:n.parsedType}),Be;if(n.data.length<this._def.items.length)return fe(n,{code:se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Be;!this._def.rest&&n.data.length>this._def.items.length&&(fe(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 vi(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>Rn.mergeArray(r,s)):Rn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ra.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ra({items:e,typeName:Re.ZodTuple,rest:null,...He(t)})};var Y2=class e extends We{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!==he.object)return fe(n,{code:se.invalid_type,expected:he.object,received:n.parsedType}),Be;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new vi(n,a,n.path,a)),value:s._parse(new vi(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Rn.mergeObjectAsync(r,o):Rn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof We?new e({keyType:t,valueType:r,typeName:Re.ZodRecord,...He(n)}):new e({keyType:Dc.create(),valueType:t,typeName:Re.ZodRecord,...He(r)})}},xm=class extends We{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!==he.map)return fe(n,{code:se.invalid_type,expected:he.map,received:n.parsedType}),Be;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],u)=>({key:o._parse(new vi(n,a,n.path,[u,"key"])),value:i._parse(new vi(n,l,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Be;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Be;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}};xm.create=(e,t,r)=>new xm({valueType:t,keyType:e,typeName:Re.ZodMap,...He(r)});var Im=class e extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.set)return fe(n,{code:se.invalid_type,expected:he.set,received:n.parsedType}),Be;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(fe(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&&(fe(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 u=new Set;for(let d of l){if(d.status==="aborted")return Be;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((l,u)=>i._parse(new vi(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:Me.toString(r)}})}max(t,r){return new e({...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)}};Im.create=(e,t)=>new Im({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...He(t)});var K2=class e extends We{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.function)return fe(r,{code:se.invalid_type,expected:he.function,received:r.parsedType}),Be;function n(a,l){return q2({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,W2(),gm].filter(u=>!!u),issueData:{code:se.invalid_arguments,argumentsError:l}})}function o(a,l){return q2({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,W2(),gm].filter(u=>!!u),issueData:{code:se.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Lc){let a=this;return Jn(async function(...l){let u=new jo([]),d=await a._def.args.parseAsync(l,i).catch(b=>{throw u.addIssue(n(l,b)),u}),f=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(f,i).catch(b=>{throw u.addIssue(o(f,b)),u})})}else{let a=this;return Jn(function(...l){let u=a._def.args.safeParse(l,i);if(!u.success)throw new jo([n(l,u.error)]);let d=Reflect.apply(s,this,u.data),f=a._def.returns.safeParse(d,i);if(!f.success)throw new jo([o(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ra.create(t).rest(fl.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ra.create([]).rest(fl.create()),returns:r||fl.create(),typeName:Re.ZodFunction,...He(n)})}},kp=class extends We{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})}};kp.create=(e,t)=>new kp({getter:e,typeName:Re.ZodLazy,...He(t)});var Dp=class extends We{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return fe(r,{received:r.data,code:se.invalid_literal,expected:this._def.value}),Be}return{status:"valid",value:t.data}}get value(){return this._def.value}};Dp.create=(e,t)=>new Dp({value:e,typeName:Re.ZodLiteral,...He(t)});function AW(e,t){return new Fp({values:e,typeName:Re.ZodEnum,...He(t)})}var Fp=class e extends We{constructor(){super(...arguments),Rg.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{expected:Pt.joinValues(n),received:r.parsedType,code:se.invalid_type}),Be}if(Z2(this,Rg,"f")||MW(this,Rg,new Set(this._def.values),"f"),!Z2(this,Rg,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return fe(r,{received:r.data,code:se.invalid_enum_value,options:n}),Be}return Jn(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,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Rg=new WeakMap;Fp.create=AW;var Lp=class extends We{constructor(){super(...arguments),Ng.set(this,void 0)}_parse(t){let r=Pt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==he.string&&n.parsedType!==he.number){let o=Pt.objectValues(r);return fe(n,{expected:Pt.joinValues(o),received:n.parsedType,code:se.invalid_type}),Be}if(Z2(this,Ng,"f")||MW(this,Ng,new Set(Pt.getValidEnumValues(this._def.values)),"f"),!Z2(this,Ng,"f").has(t.data)){let o=Pt.objectValues(r);return fe(n,{received:n.data,code:se.invalid_enum_value,options:o}),Be}return Jn(t.data)}get enum(){return this._def.values}};Ng=new WeakMap;Lp.create=(e,t)=>new Lp({values:e,typeName:Re.ZodNativeEnum,...He(t)});var Lc=class extends We{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.promise&&r.common.async===!1)return fe(r,{code:se.invalid_type,expected:he.promise,received:r.parsedType}),Be;let n=r.parsedType===he.promise?r.data:Promise.resolve(r.data);return Jn(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Lc.create=(e,t)=>new Lc({type:e,typeName:Re.ZodPromise,...He(t)});var Go=class extends We{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.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=>{fe(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 Be;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Be:l.status==="dirty"||r.value==="dirty"?ym(l.value):l});{if(r.value==="aborted")return Be;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Be:a.status==="dirty"||r.value==="dirty"?ym(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"?Be:(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"?Be:(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(!Bg(s))return s;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=>Bg(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):s);Pt.assertNever(o)}};Go.create=(e,t,r)=>new Go({schema:e,typeName:Re.ZodEffects,effect:t,...He(r)});Go.createWithPreprocess=(e,t,r)=>new Go({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...He(r)});var bi=class extends We{_parse(t){return this._getType(t)===he.undefined?Jn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};bi.create=(e,t)=>new bi({innerType:e,typeName:Re.ZodOptional,...He(t)});var na=class extends We{_parse(t){return this._getType(t)===he.null?Jn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};na.create=(e,t)=>new na({innerType:e,typeName:Re.ZodNullable,...He(t)});var Rp=class extends We{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===he.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rp.create=(e,t)=>new Rp({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});var Np=class extends We{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return $g(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jo(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new jo(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Np.create=(e,t)=>new Np({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});var Sm=class extends We{_parse(t){if(this._getType(t)!==he.nan){let n=this._getOrReturnCtx(t);return fe(n,{code:se.invalid_type,expected:he.nan,received:n.parsedType}),Be}return{status:"valid",value:t.data}}};Sm.create=e=>new Sm({typeName:Re.ZodNaN,...He(e)});var z1e=Symbol("zod_brand"),jg=class extends We{_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}},Gg=class e extends We{_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"?Be:i.status==="dirty"?(r.dirty(),ym(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"?Be: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:Re.ZodPipeline})}},Bp=class extends We{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Bg(o)&&(o.value=Object.freeze(o.value)),o);return $g(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Bp.create=(e,t)=>new Bp({innerType:e,typeName:Re.ZodReadonly,...He(t)});function kW(e,t={},r){return e?Fc.create().superRefine((n,o)=>{var i,s;if(!e(n)){let a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(s=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&s!==void 0?s:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:l})}}):Fc.create()}var H1e={object:vo.lazycreate},Re;(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"})(Re||(Re={}));var W1e=(e,t={message:"Input not instance of ".concat(e.name)})=>kW(r=>r instanceof e,t),DW=Dc.create,FW=Pp.create,q1e=Sm.create,Z1e=Tp.create,LW=wp.create,X1e=Mp.create,Y1e=bm.create,K1e=Op.create,J1e=Ep.create,Q1e=Fc.create,e0e=fl.create,t0e=Qi.create,r0e=vm.create,n0e=ml.create,o0e=vo.create,i0e=vo.strictCreate,s0e=_p.create,a0e=X2.create,l0e=Ap.create,c0e=ra.create,u0e=Y2.create,p0e=xm.create,d0e=Im.create,f0e=K2.create,m0e=kp.create,h0e=Dp.create,y0e=Fp.create,g0e=Lp.create,b0e=Lc.create,TW=Go.create,v0e=bi.create,x0e=na.create,I0e=Go.createWithPreprocess,S0e=Gg.create,C0e=()=>DW().optional(),P0e=()=>FW().optional(),T0e=()=>LW().optional(),w0e={string:e=>Dc.create({...e,coerce:!0}),number:e=>Pp.create({...e,coerce:!0}),boolean:e=>wp.create({...e,coerce:!0}),bigint:e=>Tp.create({...e,coerce:!0}),date:e=>Mp.create({...e,coerce:!0})},M0e=Be,B=Object.freeze({__proto__:null,defaultErrorMap:gm,setErrorMap:M1e,getErrorMap:W2,makeIssue:q2,EMPTY_PATH:O1e,addIssueToContext:fe,ParseStatus:Rn,INVALID:Be,DIRTY:ym,OK:Jn,isAborted:H4,isDirty:W4,isValid:Bg,isAsync:$g,get util(){return Pt},get objectUtil(){return z4},ZodParsedType:he,getParsedType:kc,ZodType:We,datetimeRegex:_W,ZodString:Dc,ZodNumber:Pp,ZodBigInt:Tp,ZodBoolean:wp,ZodDate:Mp,ZodSymbol:bm,ZodUndefined:Op,ZodNull:Ep,ZodAny:Fc,ZodUnknown:fl,ZodNever:Qi,ZodVoid:vm,ZodArray:ml,ZodObject:vo,ZodUnion:_p,ZodDiscriminatedUnion:X2,ZodIntersection:Ap,ZodTuple:ra,ZodRecord:Y2,ZodMap:xm,ZodSet:Im,ZodFunction:K2,ZodLazy:kp,ZodLiteral:Dp,ZodEnum:Fp,ZodNativeEnum:Lp,ZodPromise:Lc,ZodEffects:Go,ZodTransformer:Go,ZodOptional:bi,ZodNullable:na,ZodDefault:Rp,ZodCatch:Np,ZodNaN:Sm,BRAND:z1e,ZodBranded:jg,ZodPipeline:Gg,ZodReadonly:Bp,custom:kW,Schema:We,ZodSchema:We,late:H1e,get ZodFirstPartyTypeKind(){return Re},coerce:w0e,any:Q1e,array:n0e,bigint:Z1e,boolean:LW,date:X1e,discriminatedUnion:a0e,effect:TW,enum:y0e,function:f0e,instanceof:W1e,intersection:l0e,lazy:m0e,literal:h0e,map:p0e,nan:q1e,nativeEnum:g0e,never:t0e,null:J1e,nullable:x0e,number:FW,object:o0e,oboolean:T0e,onumber:P0e,optional:v0e,ostring:C0e,pipeline:S0e,preprocess:I0e,promise:b0e,record:u0e,set:d0e,strictObject:i0e,string:DW,symbol:Y1e,transformer:TW,tuple:c0e,undefined:K1e,union:s0e,unknown:e0e,void:r0e,NEVER:M0e,ZodIssueCode:se,quotelessJson:w1e,ZodError:jo});var O0e=B.object({limit:B.enum(["same-floor","same-elevation"]).optional(),radius:B.number().optional(),types:B.array(B.enum(["node","point-of-interest"])).min(1)}),oa,Vg,Ug=class{constructor(t){M(this,oa);M(this,Vg);_(this,oa,t),_(this,Vg,new H2(c(this,oa)))}nearest(t,r){try{O0e.parse(r)}catch(s){$.error(s);return}let n=mg(t);if(!n)return;let o=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let s of c(this,oa).getByType("floor-stack")){let a=s.defaultFloor;a&&o.push(a.id)}else if(r.limit==="same-elevation"){let s=c(this,oa).floorsById[n.floorId];if(s){let a=s==null?void 0:s.elevation;a&&(o=c(this,oa).getByType("floor-stack").map(l=>{var u;return(u=l.floors.find(d=>d.elevation===a))==null?void 0:u.id}).filter(Boolean))}}let i=[];for(let s of tW(r.types))for(let a of o){let l=c(this,Vg).getTreeByType(s,c(this,oa).mapName,a).find(n.latitude,n.longitude,r.radius);if(l){let u=c(this,oa).getById(s,l==null?void 0:l.properties.id);u&&i.push({distance:Ji([n.longitude,n.latitude],l.geometry.coordinates),feature:u})}}return i.sort((s,a)=>s.distance-a.distance)}};oa=new WeakMap,Vg=new WeakMap;p();p();var zg,J2=class{constructor(t){M(this,zg);_(this,zg,t||[])}get raw(){return c(this,zg)}};zg=new WeakMap;var hn,xe,Zt,Hg=class Hg extends zr{constructor(r,n){super(n.mvfData.id);m(this,"__type",Hg.__type);m(this,"id","loc_");m(this,"name","");m(this,"externalId");m(this,"description");m(this,"logo");m(this,"phone");m(this,"social",[]);m(this,"images",[]);m(this,"links",[]);m(this,"website");m(this,"icon");M(this,hn);M(this,xe,{});M(this,Zt);_(this,hn,r),_(this,Zt,n.mvfData);for(let o in n.mvfData)o==="links"?this.links=n.mvfData.links.map(i=>new tp({mvfData:i})):o==="pictures"?this.images=n.mvfData.pictures.map(i=>{var s;return i.url?new np({mvfData:{...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 tp({mvfData:n.mvfData.website})):o==="icon"?n.mvfData.icon&&(this.icon=new np({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,Zt)[o]}})}static is(r){return r.__type===Hg.__type}get spaces(){if(c(this,xe).spaces)return c(this,xe).spaces;if(c(this,Zt).spaces==null)return c(this,xe).spaces=[],c(this,xe).spaces;c(this,xe).spaces=[];for(let r=0;r<c(this,Zt).spaces.length;r++){let n=c(this,hn).getById("space",c(this,Zt).spaces[r].id);n&&c(this,xe).spaces.push(n)}return c(this,xe).spaces}get points(){if(c(this,xe).points)return c(this,xe).points;if(c(this,Zt).spaces==null)return c(this,xe).points=[],c(this,xe).points;c(this,xe).points=[];for(let r=0;r<c(this,Zt).spaces.length;r++){let n=c(this,hn).getById("point-of-interest",c(this,Zt).spaces[r].id);n&&c(this,xe).points.push(n)}return c(this,xe).points}get doors(){if(c(this,xe).doors)return c(this,xe).doors;if(c(this,Zt).entrances==null)return c(this,xe).doors=[],c(this,xe).doors;c(this,xe).doors=[];for(let r=0;r<c(this,Zt).entrances.length;r++){let n=c(this,hn).getById("door",c(this,Zt).entrances[r].id);n&&c(this,xe).doors.push(n)}return c(this,xe).doors}get connections(){var n;if(c(this,xe).connections)return c(this,xe).connections;if(c(this,Zt).connections==null)return c(this,xe).connections=[],c(this,xe).connections;let r=new Set;for(let o=0;o<c(this,Zt).connections.length;o++){let i=c(this,Zt).connections[o],s=c(this,hn).mvfConnectionsById[i],l=(s==null?[]:s.nodes).map(u=>c(this,hn).getById("node",u)).filter(Boolean);for(let u of l){if(u==null)continue;let d=Xs([u.coordinate.longitude,u.coordinate.latitude]),h=((n=c(this,hn).connectionSpaceIdsByLatLon[d])!=null?n:[]).map(b=>c(this,hn).connectionsById[b]).filter(b=>b!=null);for(let b of h)r.add(b)}}return c(this,xe).connections=Array.from(r),c(this,xe).connections}get annotations(){if(c(this,xe).annotations)return c(this,xe).annotations;if(c(this,Zt).annotations==null)return c(this,xe).annotations=[],c(this,xe).annotations;c(this,xe).annotations=[];for(let r=0;r<c(this,Zt).annotations.length;r++){let n=c(this,hn).getById("annotation",c(this,Zt).annotations[r].id);n&&c(this,xe).annotations.push(n)}return c(this,xe).annotations}get categories(){return c(this,xe).categories?c(this,xe).categories:c(this,Zt).categories==null?(c(this,xe).categories=[],c(this,xe).categories):(c(this,xe).categories=c(this,Zt).categories.map(r=>c(this,hn).getById("location-category",r)).filter(r=>r!=null),c(this,xe).categories)}get mapObjects(){return c(this,xe).mapObjects?c(this,xe).mapObjects:c(this,Zt).obstructions==null?(c(this,xe).mapObjects=[],c(this,xe).mapObjects):(c(this,xe).mapObjects=c(this,Zt).obstructions.map(r=>c(this,hn).getById("object",r.id)).filter(r=>r!=null),c(this,xe).mapObjects)}get areas(){return c(this,xe).areas?c(this,xe).areas:c(this,Zt).areas==null?(c(this,xe).areas=[],c(this,xe).areas):(c(this,xe).areas=c(this,Zt).areas.map(r=>c(this,hn).getById("area",r.id)).filter(r=>r!=null),c(this,xe).areas)}get focusTarget(){if(c(this,xe).focusTarget)return c(this,xe).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,xe).focusTarget=r,r}get openingHours(){var r;return c(this,xe).openingHours?c(this,xe).openingHours:(c(this,xe).openingHours=new J2((r=c(this,Zt).openingHoursSpecification)!=null?r:[]),c(this,xe).openingHours)}get navigationTarget(){if(c(this,xe).navigationTarget)return c(this,xe).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,xe).navigationTarget=r,r}toJSON(){return{id:this.id,name:this.name}}};hn=new WeakMap,xe=new WeakMap,Zt=new WeakMap,m(Hg,"__type","location-profile");var Z4=Hg,cm=Z4;p();var Rc,xo,$p,Wg=class Wg extends zr{constructor(r,n){super(n.mvfData.id);m(this,"__type",Wg.__type);m(this,"id","cat_");m(this,"name","");m(this,"icon","");M(this,Rc);M(this,xo,{});M(this,$p);_(this,Rc,r),_(this,$p,n.mvfData);for(let o in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return c(this,$p)[o]}})}static is(r){return r.__type===Wg.__type}get parent(){return c(this,xo).parent?c(this,xo).parent:(c(this,xo).parent=c(this,$p).parent?c(this,Rc).getById("location-category",c(this,$p).parent):void 0,c(this,xo).parent)}get children(){return c(this,xo).children?c(this,xo).children:(c(this,xo).children=c(this,Rc).locationCategoriesByParentId[this.id]||[],c(this,xo).children)}get locationProfiles(){if(c(this,xo).locationProfiles)return c(this,xo).locationProfiles;let r=[];for(let n of c(this,Rc).locationProfilesByCategoryId[this.id]||[]){let o=c(this,Rc).getById("location-profile",n.id);o&&r.push(o)}return c(this,xo).locationProfiles=r,r}toJSON(){return{id:this.id,name:this.name}}};Rc=new WeakMap,xo=new WeakMap,$p=new WeakMap,m(Wg,"__type","location-category");var X4=Wg,F2=X4;var Oe,Q2,RW,Cm,Pm=class extends De{constructor(r,n){var a,l,u,d,f;super();M(this,Q2);m(this,"Analytics");M(this,Oe,{});m(this,"Query");m(this,"mvf");m(this,"outdoorViewToken");m(this,"spaceIdsByDestinationNodeId");m(this,"objectEntranceNodeIdsByObstructionId");m(this,"obstructionIdByEntranceId");m(this,"venue");m(this,"tokenManager");m(this,"directions");m(this,"enterpriseMode",!1);m(this,"nodesById");m(this,"spacesById");m(this,"floorsById");m(this,"floorStacksById");m(this,"facadesById");m(this,"facadesBySpaceId");m(this,"connectionsById");m(this,"objectsById");m(this,"doorsById");m(this,"pointsOfInterestById");m(this,"annotationsById");m(this,"areasById");m(this,"locationProfilesById");m(this,"locationCategoriesById");m(this,"locationProfilesByExternalId");m(this,"locationsById");m(this,"locationProfilesByCategoryId");m(this,"locationCategoriesByParentId");m(this,"categoriesById");m(this,"doorsByNodeId");m(this,"mvfLocationsBySpaceId");m(this,"locationIdsByNodeId");m(this,"spaceIdsByNodeId");m(this,"mvfAnnotationsById");m(this,"mvfConnectionsById");m(this,"mvfConnectionsByNodeId");m(this,"mvfConnectionIdsByLatLon");m(this,"mvfEntrancesById");m(this,"mvfNodesById");m(this,"mvfObstructionById");m(this,"mvfSpacesById");m(this,"mvfFloorsById");m(this,"mvfFloorStacksById");m(this,"mvfAreasById");m(this,"connectionSpaceIdsByLatLon");m(this,"locationProfilesByAttachedFeatureId");m(this,"spacesByExternalId");m(this,"nodesByExternalId");m(this,"objectsByExternalId");m(this,"poisByExternalId");m(this,"floorsByExternalId");m(this,"floorStacksByExternalId");m(this,"doorsByExternalId");m(this,"areasByExternalId");m(this,"connectionsByExternalId");m(this,"locationsByExternalId");m(this,"categoriesByExternalId");m(this,"mvfNodesByFloorId");m(this,"mvfSpacesByFloorId");m(this,"mvfPoisByFloorId");m(this,"mvfEntrancesByFloorId");m(this,"mvfAnnotationsByFloorId");m(this,"localePacksUrls");m(this,"currentLanguage");m(this,"languagePacks",{});m(this,"tilesets",{});m(this,"binaryBundle");m(this,"envControl");m(this,"getMapDataOptions");M(this,Cm);m(this,"getDirectionsMultiDestination",(r,n,o)=>this.getDirections(r,n,{...o,multiDestination:!0}));m(this,"getDirections",(r,n,o)=>{let{accessible:i=!1,smoothing:s=!0,multiDestination:a=!1}=o||{},l=typeof s=="object"?s.enabled:s,u=typeof s=="object"?s.radius:void 0,d=(o==null?void 0:o.zones)||[],f={accessible:i,zones:d,smoothing:{enabled:l!=null?l:!0,radius:u!=null?u:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(a&&Array.isArray(n)){let h=Array.isArray(r)?r:[r],b=[];for(let v of n){let I=Array.isArray(v)?v:[v],x=this.directions.getDirections(h,I,f,this);if(!x){$.error("getDirections failed due to missing directions for one of the segments");return}h=I,b.push(x)}return b}else{let h=Array.isArray(r)?r:[r],b=Array.isArray(n)?n:[n];if(Array.isArray(b[0])){$.error("getDirections does not support multi-destination without multisegment option");return}return h[0].id&&b[0].id&&this.Analytics.sendGetDirectionsEvent(h[0].id,b[0].id),this.directions.getDirections(h,b,f,this)}});m(this,"transformImageRequest",async r=>{var o;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!RH(r))return{url:r};if(NH(r))return{url:r};let n=_2(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 $.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:Xu();if(this.envControl=o,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new Fd,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,((u=r["tileset.json"])==null?void 0:u.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,o.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let h of r["tileset.json"].others)this.tilesets[h.key]=h;this.enterpriseMode=(d=n==null?void 0:n.enterprise)!=null?d:!1,this.tokenManager=n==null?void 0:n.tokenManager;let i=LH(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=FH(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 D4(this,{mvfData:s.venue});let h={};for(let b in s.mvfLocationsById)h[b]=s.mvfLocationsById[b];for(let b in s.locationInstancesById)h[b]=s.locationInstancesById[b];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":h,"enterprise-category":s.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},(f=n==null?void 0:n.languagePacks)==null||f.forEach(({language:b,localePack:v})=>{this.languagePacks[b.code]=F4(v)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Ug(this),this.directions=new z2({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new Le(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return c(this,Oe).spaces==null&&(c(this,Oe).spaces=globalThis.Object.values(this.spacesById)),c(this,Oe).spaces}get objects(){return c(this,Oe).objects==null&&(c(this,Oe).objects=globalThis.Object.values(this.objectsById)),c(this,Oe).objects}get connections(){return c(this,Oe).connections==null&&(c(this,Oe).connections=globalThis.Object.values(this.connectionsById)),c(this,Oe).connections}get floors(){return c(this,Oe).floors==null&&(c(this,Oe).floors=globalThis.Object.values(this.floorsById)),c(this,Oe).floors}get floorStacks(){return c(this,Oe).floorStacks==null&&(c(this,Oe).floorStacks=globalThis.Object.values(this.floorStacksById)),c(this,Oe).floorStacks}get facades(){return c(this,Oe).facades==null&&(c(this,Oe).facades=globalThis.Object.values(this.facadesById)),c(this,Oe).facades}get doors(){return c(this,Oe).doors==null&&(c(this,Oe).doors=globalThis.Object.values(this.doorsById)),c(this,Oe).doors}get pointsOfInterest(){return c(this,Oe).pointsOfInterest==null&&(c(this,Oe).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),c(this,Oe).pointsOfInterest}get annotations(){return c(this,Oe).annotations==null&&(c(this,Oe).annotations=globalThis.Object.values(this.annotationsById)),c(this,Oe).annotations}get areas(){return c(this,Oe).areas==null&&(c(this,Oe).areas=globalThis.Object.values(this.areasById)),c(this,Oe).areas}get nodes(){return c(this,Oe).nodes==null&&(c(this,Oe).nodes=globalThis.Object.values(this.nodesById)),c(this,Oe).nodes}get locations(){return c(this,Oe).locations==null&&(c(this,Oe).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return c(this,Oe).categories==null&&(c(this,Oe).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return c(this,Oe).locationProfiles==null&&(c(this,Oe).locationProfiles=globalThis.Object.values(this.locationProfilesById)),c(this,Oe).locationProfiles}get locationCategories(){return c(this,Oe).locationCategories==null&&(c(this,Oe).locationCategories=globalThis.Object.values(this.locationCategoriesById)),c(this,Oe).locationCategories}get mvfFloors(){return c(this,Oe).mvfFloors==null&&(c(this,Oe).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),c(this,Oe).mvfFloors}get mvfFloorStacks(){return c(this,Oe).mvfFloorStacks==null&&(c(this,Oe).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),c(this,Oe).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,Q2,RW).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,u,d,f,h,b,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(u=this.doorsByExternalId[n])!=null?u:[];case"connection":return(d=this.connectionsByExternalId[n])!=null?d:[];case"object":return(f=this.objectsByExternalId[n])!=null?f:[];case"point-of-interest":return(h=this.poisByExternalId[n])!=null?h:[];case"area":return(b=this.areasByExternalId[n])!=null?b:[];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,u,d,f,h;return(h=(f=(d=(u=(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?u:this.objectsById[r])!=null?d:this.pointsOfInterestById[r])!=null?f: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,u;if(!this.currentLanguage)return i;let{code:s}=this.currentLanguage,a=(u=(l=this.languagePacks[s])==null?void 0:l.optimized)==null?void 0:u[r];if(a){let d=a[o];if(d!=null&&d[n]!==void 0)return d[n]}return i}async changeLanguage(r){var a;let n=r.toLowerCase();if(!n){$.error("language code must be defined");return}if(!this.currentLanguage){$.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){$.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){$.error("locale packs url not found for ".concat(i.code));return}c(this,Cm)&&c(this,Cm).abort();let u=new AbortController;_(this,Cm,u);let d;try{d=await gj(l,{signal:u.signal})}catch(f){$.error("failed downloading language pack",f);return}if(!d||u.signal.aborted)return;s=F4(d),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=mg(r),i=mg(n);return Ji([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 dw(this.localePacksUrls[s.code],{signal:i.signal}),l=await $f(a);l&&n.push({language:{code:s.code,name:s.name},localePack:l})}}catch(a){$.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){$.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 dw(this.localePacksUrls[s.code],{signal:i.signal});a&&n.push({language:{code:s.code,name:s.name},localePack:a})}}catch(a){$.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,Oe)))c(this,Oe)[r]=null}};Oe=new WeakMap,Q2=new WeakSet,RW=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=Xs([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)},Cm=new WeakMap;p();p();p();p();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var NW="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=";p();p();var BW=!1;function $W(){BW=!0}function jW(){return BW}var eI=class{constructor(t){m(this,"backgroundAlpha",1);m(this,"backgroundColor",new Ft);m(this,"width",0);m(this,"height",0);m(this,"options",{});m(this,"renderer");m(this,"enabledLayers",new Set([0,1]));m(this,"handleWebGLContextCreationError",t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)});m(this,"handleWebGLContextLost",t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)});m(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,jW()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Ft,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new dE({canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Ft((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(a){$.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();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){g.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}};p();p();var GW='"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';p();p();p();p();p();function UW(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}p();function VW(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}p();function zW(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,u=e.y+e.h;return r<l&&s<o&&n<u&&a<i}p();function hl(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}p();var Hr=class{constructor(t,r,n,o,i){m(this,"x");m(this,"y");m(this,"w");m(this,"h");m(this,"userData");this.userData=typeof i>"u"?null:i,this.x=t,this.y=r,this.w=n,this.h=o}contains(t){return t===this?!1:UW(this,t)}intersects(t){return zW(this,t)}intersectsPoint(t){return VW(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var ia=class e{constructor(t,r){m(this,"topLeft");m(this,"topRight");m(this,"bottomLeft");m(this,"bottomRight");m(this,"divided",!1);m(this,"boundary");m(this,"capacity",16);m(this,"objects",[]);m(this,"parent");this.parent=r,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:r,w:n,h:o}=this.boundary;this.topLeft=new e(new Hr(t,r,n/2,o/2),this),this.topRight=new e(new Hr(t+n/2,r,n/2,o/2),this),this.bottomLeft=new e(new Hr(t,r+o/2,n/2,o/2),this),this.bottomRight=new e(new Hr(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&&(hl(r,this.topLeft.queryRect(t)),hl(r,this.topRight.queryRect(t)),hl(r,this.bottomLeft.queryRect(t)),hl(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(hl(r,this.topLeft.queryPoint(t)),hl(r,this.topRight.queryPoint(t)),hl(r,this.bottomLeft.queryPoint(t)),hl(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()}};p();p();var HW=["","","low","medium","high","always-visible"];function WW(e){return Math.min(5,Math.max(2,e))}function Tm(e){if(typeof e=="number")return WW(e);let t=HW.indexOf(e);return t===-1?3:t}function qg(e){let t=WW(e);return HW[t]}function ZW(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 u=Date.now();!a&&r.leading===!1&&(a=u);let d=t-(u-a);return n=globalThis,o=arguments,d<=0||d>t?(s&&(clearTimeout(s),s=null),a=u,i=e.apply(n,o),s||(n=o=null)):!s&&r.trailing!==!1&&(s=setTimeout(l,d)),i}}var jp=!1,Y4="",_0e=150,tI=class extends De{constructor(r,n,o=Y4?new Worker(Y4):new Worker(URL.createObjectURL(new Blob([GW],{type:"text/javascript"})))){super();m(this,"worker");m(this,"debugContext");m(this,"debugCanvas");m(this,"collidersDirty",!0);m(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);m(this,"visibleCollidersQTree",new ia(new Hr(0,0,0,0)));m(this,"interactiveCollidersQTree",new ia(new Hr(0,0,0,0)));m(this,"coreState");m(this,"postMessage");m(this,"showCollisionBoxes",()=>{jp=!0,this.debugCanvas.style.display="block"});m(this,"hideCollisionBoxes",()=>{jp=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});m(this,"currentMsgId","");m(this,"working",!1);m(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});m(this,"componentArray",[]);m(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 u=this.coreState.geometry2DMap.get(l);u&&(a=u.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()});m(this,"resolve",r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,o=-1,i,s,a;jp&&(this.visibleCollidersQTree=new ia(new Hr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new ia(new Hr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let u=this.componentArray[l];n[l]!=null&&(o=n[l][0],i=n[l][2],u.offscreen=n[l][1]===1,o!==-1&&i!=null?(a=new Hr(i.x,i.y,i.w,i.h,{entityId:u.id}),jp&&this.visibleCollidersQTree.insert(a),s=this.coreState.geometry2DMap.get(u.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new Hr(i.x,i.y,i.w,i.h,{entityId:u.id})),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),o!==-1&&o!==u.currentStrategyIndex&&(u.activeBoundingBox=a,u.onStrategySelected(o))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),o!==-1&&o!==u.currentStrategyIndex&&u.onStrategySelected(o)))}jp&&this.drawDebug(),this.publish("visibility-changed")});m(this,"drawDebug",()=>{jp&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});m(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=ZW(this._postMessage,_0e,!1),jp?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 K4(e){Y4=e}p();p();p();p();var rI=class{constructor(t){m(this,"type");m(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},nI=class{constructor(){m(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};p();function XW(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 ct&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}var wm,Xg=class extends De{constructor(r,n,o,i,s){super();m(this,"raycaster",new gs);m(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});m(this,"coreState");m(this,"camera");m(this,"worldPlane");m(this,"_quadtree",new ia(new Hr(0,0,0,0)));m(this,"_container");m(this,"lastPointerEvent");m(this,"cursor","grab");m(this,"touchesCount",0);m(this,"isUserInteracting");m(this,"hasTouched",!1);M(this,wm);m(this,"onPointerMoveRaf",r=>{this.lastPointerEvent=r,c(this,wm)&&cancelAnimationFrame(c(this,wm)),_(this,wm,requestAnimationFrame(()=>{this.onPointerMove(r)}))});m(this,"onPointerMove",r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()});m(this,"tapsControl",new nI);m(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 rI(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))});m(this,"clickTimeout");m(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())});m(this,"dirty3D",!0);m(this,"cachedHitBoxes",{entities:[],groups:[]});m(this,"ndcPoint",new Ee);m(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){return this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(o=>{var i,s;return((i=o.object)==null?void 0:i.name)==="worldPlane"||((s=o.object)==null?void 0:s.visible)})}getGroupContainerIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(i=>i.object.visible),o;return n!=null&&n.length>0&&(o=XW(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=F0e(r,o,n);this.cursor!==i&&(this.cursor=i,i==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),(r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry"?r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh):(r==null?void 0:r.type)==="group-container"&&r.components[1]&&!this.cachedHitBoxes.groups.includes(r)&&this.cachedHitBoxes.groups.push(r);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var x,C,P,w,T;let n=[r.offsetX,r.offsetY],o=this._quadtree.queryPoint(n),[i]=o.filter(O=>O.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),u=(x=l[0])==null?void 0:x.point,d=[],f=[];for(let O of l.filter(N=>N.object.name!=="worldPlane"))O.object instanceof Ve&&O.object.material.depthTest===!1?d.push(O):f.push(O);let h=(P=(C=d[0])!=null?C:f[0])!=null?P:void 0,b,v;if(h!=null){if(b=R0e(h.object,this.coreState.geometry3DMap),!b){let O=(w=h==null?void 0:h.instanceId)!=null?w:h==null?void 0:h.batchId;b=O!=null&&(h!=null&&h.object.userData.entities)?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[O]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId)}b!=null&&b.components[2]&&(v=b)}let I=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((T=i==null?void 0:i.userData)==null?void 0:T.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(i==null?void 0:i.userData.entityId),entity3D:v,position:u,groupContainers:I}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&KW(this.state.lastHover,!1,this.coreState),r&&KW(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!hE(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}};wm=new WeakMap;function KW(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 F0e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}function L0e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Vl)return;if(t.userData.isSingleModel)return t;t=t.parent}}function R0e(e,t){let r=L0e(e);return r?t.get(r.userData.entityId):void 0}p();var Mq=fs(c5());var tb=4,Exe=8,_xe="0.6",wq="low-priority-pin",u5=B.object({rank:B.union([B.enum(["low","medium","high","always-visible"]),B.number()]).optional(),interactive:B.union([B.boolean(),B.literal("pointer-events-auto")]).optional(),id:B.string().optional(),anchor:B.union([B.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),B.array(B.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:B.boolean().optional(),zIndex:B.number().optional(),lowPriorityPin:B.object({enabled:B.boolean().optional(),size:B.number().positive().optional(),color:B.string().optional()}).optional()});function Oq(e,t,r){B.array(B.number()).min(2).max(3).parse(e),B.string().parse(t),u5.parse(r)}var Axe=Object.freeze({enabled:!0,size:Exe,color:"#666"}),_m=class _m{constructor(t,r={}){m(this,"id");m(this,"type","marker");m(this,"rank",0);m(this,"initialRank",0);m(this,"activeAnchor","center");m(this,"pointerEvents","none");m(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...Axe}});m(this,"projection",new Ee);m(this,"enabled",!0);m(this,"canShow",!1);m(this,"visible",!0);m(this,"isOccluded",!1);m(this,"offscreen",!1);m(this,"strategyIndex",-1);m(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});m(this,"dimensions",{width:0,height:0});m(this,"markerContainer");m(this,"containerEl");m(this,"contentEl",null);m(this,"contentHtml","");m(this,"style",{top:"0px",left:"0px"});m(this,"dirty",!1);m(this,"attachedDirty",!0);m(this,"collisionDirty",!0);m(this,"visibilityNeedsUpdate","show");m(this,"animation",null);m(this,"currentStrategyIndex",-1);m(this,"onStrategySelected",(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",wq);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=_xe,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",u=-s/2+"px";switch(this.style.top=l,this.style.left=u,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=u}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left});m(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,o,i;if(this.id=(r==null?void 0:r.id)||Et(),this.options=(0,Mq.default)(this.options,r),typeof r.rank=="string")this.rank=Tm(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let s=Math.trunc(g.env.NODE_ENV==="test"?_m.testId:_m.testId*10)/10;_m.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,u=t/2,d=t/2;switch(s){case"top":{a=r,l=0;break}case"bottom":{a=0,l=r;break}case"left":{u=t,d=0;break}case"right":{u=0,d=t;break}case"top-left":{a=r,u=t,l=0,d=0;break}case"top-right":{a=r,d=t,l=0,u=0;break}case"bottom-left":{l=r,u=t,a=0,d=0;break}case"bottom-right":{l=r,d=t,a=0,u=0;break}}return[a+tb,l+tb,u+tb,d+tb]}}));if((i=this.options.lowPriorityPin)!=null&&i.enabled){let s={name:wq,getBoundingBox:()=>{let a=Math.max(2,tb/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(){}};m(_m,"testId",0);var aa=_m;p();p();p();p();p();var Am=class{constructor(){m(this,"hover",!1);m(this,"dirty",!1)}};p();p();function dI(e){"@babel/helpers - typeof";return dI=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},dI(e)}var kxe=/^\s+/,Dxe=/\s+$/;function Se(e,t){if(e=e||"",t=t||{},e instanceof Se)return e;if(!(this instanceof Se))return new Se(e,t);var r=Fxe(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}Se.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=Lq(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=_q(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=_q(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=Eq(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Eq(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 Aq(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return Bxe(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(fr(this._r,255)*100)+"%",g:Math.round(fr(this._g,255)*100)+"%",b:Math.round(fr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(fr(this._r,255)*100)+"%, "+Math.round(fr(this._g,255)*100)+"%, "+Math.round(fr(this._b,255)*100)+"%)":"rgba("+Math.round(fr(this._r,255)*100)+"%, "+Math.round(fr(this._g,255)*100)+"%, "+Math.round(fr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Yxe[Aq(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+kq(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Se(t);n="#"+kq(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 Se(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(Uxe,arguments)},brighten:function(){return this._applyModification(Vxe,arguments)},darken:function(){return this._applyModification(zxe,arguments)},desaturate:function(){return this._applyModification($xe,arguments)},saturate:function(){return this._applyModification(jxe,arguments)},greyscale:function(){return this._applyModification(Gxe,arguments)},spin:function(){return this._applyModification(Hxe,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Zxe,arguments)},complement:function(){return this._applyCombination(Wxe,arguments)},monochromatic:function(){return this._applyCombination(Xxe,arguments)},splitcomplement:function(){return this._applyCombination(qxe,arguments)},triad:function(){return this._applyCombination(Dq,[3])},tetrad:function(){return this._applyCombination(Dq,[4])}};Se.fromRatio=function(e,t){if(dI(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=rb(e[n]));e=r}return Se(e,t)};function Fxe(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=e2e(e)),dI(e)=="object"&&(bl(e.r)&&bl(e.g)&&bl(e.b)?(t=Lxe(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):bl(e.h)&&bl(e.s)&&bl(e.v)?(n=rb(e.s),o=rb(e.v),t=Nxe(e.h,n,o),s=!0,a="hsv"):bl(e.h)&&bl(e.s)&&bl(e.l)&&(n=rb(e.s),i=rb(e.l),t=Rxe(e.h,n,i),s=!0,a="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=Lq(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 Lxe(e,t,r){return{r:fr(e,255)*255,g:fr(t,255)*255,b:fr(r,255)*255}}function Eq(e,t,r){e=fr(e,255),t=fr(t,255),r=fr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,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 Rxe(e,t,r){var n,o,i;e=fr(e,360),t=fr(t,100),r=fr(r,100);function s(u,d,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?u+(d-u)*6*f:f<1/2?d:f<2/3?u+(d-u)*(2/3-f)*6:u}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 _q(e,t,r){e=fr(e,255),t=fr(t,255),r=fr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,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 Nxe(e,t,r){e=fr(e,360)*6,t=fr(t,100),r=fr(r,100);var n=Math.floor(e),o=e-n,i=r*(1-t),s=r*(1-o*t),a=r*(1-(1-o)*t),l=n%6,u=[r,s,i,i,a,r][l],d=[a,r,r,s,i,i][l],f=[i,i,a,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function Aq(e,t,r,n){var o=[ts(Math.round(e).toString(16)),ts(Math.round(t).toString(16)),ts(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 Bxe(e,t,r,n,o){var i=[ts(Math.round(e).toString(16)),ts(Math.round(t).toString(16)),ts(Math.round(r).toString(16)),ts(Rq(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 kq(e,t,r,n){var o=[ts(Rq(n)),ts(Math.round(e).toString(16)),ts(Math.round(t).toString(16)),ts(Math.round(r).toString(16))];return o.join("")}Se.equals=function(e,t){return!e||!t?!1:Se(e).toRgbString()==Se(t).toRgbString()};Se.random=function(){return Se.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function $xe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.s-=t/100,r.s=fI(r.s),Se(r)}function jxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.s+=t/100,r.s=fI(r.s),Se(r)}function Gxe(e){return Se(e).desaturate(100)}function Uxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.l+=t/100,r.l=fI(r.l),Se(r)}function Vxe(e,t){t=t===0?0:t||10;var r=Se(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)))),Se(r)}function zxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.l-=t/100,r.l=fI(r.l),Se(r)}function Hxe(e,t){var r=Se(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Se(r)}function Wxe(e){var t=Se(e).toHsl();return t.h=(t.h+180)%360,Se(t)}function Dq(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Se(e).toHsl(),n=[Se(e)],o=360/t,i=1;i<t;i++)n.push(Se({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}function qxe(e){var t=Se(e).toHsl(),r=t.h;return[Se(e),Se({h:(r+72)%360,s:t.s,l:t.l}),Se({h:(r+216)%360,s:t.s,l:t.l})]}function Zxe(e,t,r){t=t||6,r=r||30;var n=Se(e).toHsl(),o=360/r,i=[Se(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(Se(n));return i}function Xxe(e,t){t=t||6;for(var r=Se(e).toHsv(),n=r.h,o=r.s,i=r.v,s=[],a=1/t;t--;)s.push(Se({h:n,s:o,v:i})),i=(i+a)%1;return s}Se.mix=function(e,t,r){r=r===0?0:r||50;var n=Se(e).toRgb(),o=Se(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 Se(s)};Se.readability=function(e,t){var r=Se(e),n=Se(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Se.isReadable=function(e,t,r){var n=Se.readability(e,t),o,i;switch(i=!1,o=t2e(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};Se.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 u=0;u<t.length;u++)i=Se.readability(e,t[u]),i>o&&(o=i,n=Se(t[u]));return Se.isReadable(e,n,{level:a,size:l})||!s?n:(r.includeFallbackColors=!1,Se.mostReadable(e,["#fff","#000"],r))};var p5=Se.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"},Yxe=Se.hexNames=Kxe(p5);function Kxe(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function Lq(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function fr(e,t){Jxe(e)&&(e="100%");var r=Qxe(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 fI(e){return Math.min(1,Math.max(0,e))}function Uo(e){return parseInt(e,16)}function Jxe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Qxe(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ts(e){return e.length==1?"0"+e:""+e}function rb(e){return e<=1&&(e=e*100+"%"),e}function Rq(e){return Math.round(parseFloat(e)*255).toString(16)}function Fq(e){return Uo(e)/255}var es=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 bl(e){return!!es.CSS_UNIT.exec(e)}function e2e(e){e=e.replace(kxe,"").replace(Dxe,"").toLowerCase();var t=!1;if(p5[e])e=p5[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=es.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=es.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=es.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=es.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=es.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=es.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=es.hex8.exec(e))?{r:Uo(r[1]),g:Uo(r[2]),b:Uo(r[3]),a:Fq(r[4]),format:t?"name":"hex8"}:(r=es.hex6.exec(e))?{r:Uo(r[1]),g:Uo(r[2]),b:Uo(r[3]),format:t?"name":"hex"}:(r=es.hex4.exec(e))?{r:Uo(r[1]+""+r[1]),g:Uo(r[2]+""+r[2]),b:Uo(r[3]+""+r[3]),a:Fq(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=es.hex3.exec(e))?{r:Uo(r[1]+""+r[1]),g:Uo(r[2]+""+r[2]),b:Uo(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function t2e(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 P5=fs(C5());var w5=B.object({rank:B.union([B.enum(["low","medium","high","always-visible"]),B.number()]).optional(),interactive:B.boolean().optional(),appearance:B.object({margin:B.number().min(6).optional(),text:B.object({numLines:B.number().optional(),lineHeight:B.number().optional(),size:B.number().optional(),maxWidth:B.number().optional(),foregroundColor:B.string().optional(),backgroundColor:B.string().optional()}).optional(),marker:B.object({size:B.number().optional(),foregroundColor:B.object({active:B.string().optional(),inactive:B.string().optional()}).optional(),backgroundColor:B.object({active:B.string().optional(),inactive:B.string().optional()}).optional()}).optional()}).optional()});function yZ(e,t,r){B.array(B.number()).min(2).max(3).parse(e),B.string().parse(t),w5.parse(r||{})}var Lm={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}}},qIe={lightOnDark:{...Lm,text:{...Lm.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Lm.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Lm,text:{...Lm.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Lm.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},ZIe="LOW_PRIORITY",fZ=4,XIe=6,YIe=20,KIe=2.5,JIe=2,QIe="cover",eSe=-1/0,mZ=6.5,hZ={heightAbovePolygon:0,appearance:qIe.darkOnLight};var Rm=class Rm{constructor(t,r,n){m(this,"lines",0);m(this,"id");m(this,"rank");m(this,"type","label");m(this,"initialRank");m(this,"contextConfigured",!1);m(this,"fillText");m(this,"newStyle",{});m(this,"opacity",0);m(this,"visibilityNeedsUpdate",!1);m(this,"text");m(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});m(this,"projection",new Ee);m(this,"labelCacheId");m(this,"_cache",{});m(this,"appearance");m(this,"options");m(this,"visible",!0);m(this,"enabled",!0);m(this,"isOccluded",!1);m(this,"offscreen",!1);m(this,"canShow",!1);m(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});m(this,"dimensions",{width:0,height:0});m(this,"currentStrategyIndex",-1);m(this,"totalMarkerSize",0);m(this,"dirty",!0);m(this,"attachedDirty",!0);m(this,"collisionDirty",!0);m(this,"lastTextAlign");m(this,"imageHash");m(this,"markerSize",0);m(this,"iconVisible",!1);m(this,"dp");m(this,"animate",!0);m(this,"onStrategySelected",t=>{if(this.currentStrategyIndex===t)return;let r=this.strategies[t];r&&r.onStrategySelected(this),this.currentStrategyIndex=t;let n=this.style;this.style=this.newStyle,this.newStyle=n});m(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:Et(),this.options=(0,P5.default)({},r,hZ),this.text=t,this.dp=(a=1)=>a*n.pixelRatio,typeof r.rank=="string")this.rank=Tm(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(g.env.NODE_ENV==="test"?Rm.testId:Rm.testId*10)/10;Rm.testId+=.001,this.rank=a,this.initialRank=a}let o=(0,P5.default)({},this.options.appearance,hZ.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||Se(o.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:o.marker.backgroundColor.active,inactive:o.marker.backgroundColor.inactive||Se(o.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:o.marker.icon,iconSize:o.marker.iconSize||YIe,iconPadding:(s=o.marker.iconPadding)!=null?s:JIe,iconFit:o.marker.iconFit||QIe,iconOverflow:o.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:o.marker.iconVisibleAtZoomLevel==null?eSe:o.marker.iconVisibleAtZoomLevel}}}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(mZ),this.totalMarkerSize=Math.ceil((this.markerSize+KIe)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,o=Math.max(XIe,n),i=this.iconVisible?o/2:0,s=this.iconVisible?this.totalMarkerSize:mZ,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+fZ,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-fZ,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:ZIe,getBoundingBox:()=>[s/2+i,s/2+i,s/2+i,s/2+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}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(){}};m(Rm,"testId",0);var T5=Rm,la=T5;p();p();var SI=class extends De{constructor(r,n){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"textSet",new Set);m(this,"batchedTextMap",new Map);m(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var a,l,u;let n,o,i,s=[];for(let d of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(d),(n==null?void 0:n.type)==="text3d"){o=n.components[0],i=n.components[1];let f=(a=o.mesh)==null?void 0:a.parent;if(!f||!(f instanceof ct)||!(o instanceof Nc))continue;if("textArea"in o.feature.properties&&o.mesh!=null&&o.polygonEntityId!=null&&o.textMesh==null&&o.mesh.parent!=null&&((u=(l=o.feature.properties)==null?void 0:l.textArea)==null?void 0:u.position)!=null){if(this.textSet.has(o.polygonEntityId))continue;this.textSet.add(o.polygonEntityId),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,Nm().then(({BatchedText:v})=>{let I=new v;return I.type="batchedtext",f.add(I),I}));let b=this.batchedTextMap.get(f);if(!b)throw new Error("batched text required");s.push(gZ({entityId:d,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(o.mesh!=null&&o.textMesh==null&&o.mesh.parent!=null){if(this.textSet.has(d.toString()))continue;this.textSet.add(d.toString()),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,Nm().then(({BatchedText:v})=>{let I=new v;return I.type="batchedtext",f.add(I),I}));let b=this.batchedTextMap.get(f);if(!b)throw new Error("batched text required");s.push(gZ({entityId:d,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let h=this.batchedTextMap.get(f);o.textMesh&&h&&o.polygonEntityId!=null&&Promise.all([h,Promise.resolve({meshComponent:o,styleComponent:i})]).then(([b,{meshComponent:v,styleComponent:I}])=>{let{textMesh:x}=v;if(b&&x){let C=_5(b,x);v.visible&&!C?b.add(x):!v.visible&&C&&b.remove(x)}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=e3(i+n);s>Math.PI/2&&s<3*Math.PI/2&&(o.rotation.z=e3(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 Ti(i.maxWidth,i.maxHeight),a=new Ve(s,new $r({color:"pink"})),{textMesh:l}=n;if(!l)continue;let u=this.convertTo3DMapPosition(i.position,lb);a.position.copy(u),a.position.z=l.position.z-.1,a.rotation.z=l.rotation.z,M5.identity(),M5.makeRotationAxis(new Ce(0,0,1),l.userData.rotationZ),lb.set(i.maxWidth/2,0,0),lb.applyMatrix4(M5),a.position.x-=lb.x,a.position.y-=lb.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 E5(e){Nm().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}var M5=new Ci,lb=new Ce,O5;async function bZ(e){let{preloadFont:t}=await Nm();return t(e)}function Nm(){return O5||(O5=import("./text3d-QIM5QGO6.js").then(e=>e)),O5}async function gZ({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:o,rendererState:i,type:s="text-area"}){return Promise.all([Nm(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:a,createTroikaTextArea:l},u])=>s==="text-area"?l(u.entityId,u.meshComponent,u.styleComponent,n):a(u.entityId,u.meshComponent,u.styleComponent,n)).catch(a=>{$.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 u=i.geometry3DMap.get(t.polygonEntityId);if((u==null?void 0:u.type)==="geometry"){let d=u.components[0],f=u.components[1];d.textMesh=a.text,d.mesh!=null&&(a.text.position.z=f.altitude+f.height+tSe)}}else l[2]=Nm().then(({syncText:u})=>u(a.text));return Promise.all(l)}).then(a=>{if(!a)return;let[l,u]=a;u.add(l),t.batchedText||(t.batchedText=u)})}function _5(e,t){return e._members.has(t)}var tSe=.5;var rSe=B.object({visible:B.boolean(),color:B.string(),flipToFaceCamera:B.boolean(),font:B.string().optional(),fontSize:B.number(),margin:B.union([B.number(),B.tuple([B.number(),B.number(),B.number(),B.number()])]),outlineColor:B.string(),outlineOpacity:B.number(),outlineBlur:B.union([B.number(),B.string()]),outlineWidth:B.number(),outlineOffsetX:B.number(),outlineOffsetY:B.number(),strokeWidth:B.number(),maxWidth:B.number().optional(),maxHeight:B.number().optional(),strokeOpacity:B.number(),strokeColor:B.string(),fillOpacity:B.number(),hoverColor:B.string().optional(),id:B.union([B.string(),B.number()]),type:B.literal("text3d"),position:B.tuple([B.number(),B.number(),B.number()]),content:B.string()}),vZ=rSe.partial().omit({id:!0,type:!0}).strict(),xZ=vZ.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),IZ=B.object({appearance:vZ.optional(),parentId:B.string().optional()}).strict(),Nc=class{constructor(t){m(this,"mesh",new Mi);m(this,"textMesh");m(this,"type","text3d");m(this,"feature");m(this,"parent");m(this,"batchedText");m(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?_5(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}};p();var Bm=class{constructor(t){m(this,"color");m(this,"dirty",!0);m(this,"visible",!0);m(this,"edgeColors");m(this,"geometry");m(this,"ranges");m(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};p();p();p();var CI=class extends nE{constructor(r){let n=r,o=3,i=o*4;super(new Float32Array(r*i),o,r,Z1,ZO);m(this,"_width");m(this,"_height");m(this,"_propertiesLength");this._width=i,this._height=n,this._propertiesLength=o}setColor(r,n,o){let i=this.image.data,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 Ft(n[o],n[o+1],n[o+2]),s=new Ft(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}};var SZ="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";var CZ="#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 iSe=-.05,sSe=1,Wp=class extends wi{constructor(r,n,o=1){super(r);m(this,"propertiesTexture");m(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});m(this,"colorSpace",Sa);m(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 CI(n),this.uniforms.uRepeatYFactor.value=o,this.onBeforeCompile=i=>{let s=this.uniforms.uGradientIntensity,a=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,d=this.uniforms.uTexture,f=this.uniforms.uRepeatYFactor,h=this.uniforms.uBlendTexture;this.uniforms=i.uniforms,i.vertexShader=SZ,i.fragmentShader=CZ,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:a,uGradientStart:l,uMinSideAlpha:{value:iSe},uMaxSideAlpha:{value:sSe},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:d,uRepeatYFactor:f,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=ms,r.wrapT=ms,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=ms,r.wrapT=ms,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?XO:Sa,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()}};p();function PZ(e,t){var a,l,u;let r=0;for(let d of e)r+=((l=(a=d.components[0])==null?void 0:a.geometry)==null?void 0:l.attributes.position.count)||0;let n=new Ft(t.color),o;o=new Wp({color:n,side:t.side==="back"?HO:t.side==="front"?q1:Ia,opacity:(u=t.opacity)!=null?u:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let i=new n0(e.length,r,0,o),s;for(let d of e)s=d.components[0],!(!(s instanceof yr)||!s.geometry)&&(s.mesh=i,s.material=o,s.instanceIndex=i.addGeometry(s.geometry),i.addInstance(s.instanceIndex),i.userData.entities[s.instanceIndex]=d.id,o instanceof Wp&&o.setColor(s.instanceIndex,n,t.topColor?new Ft(t.topColor):n));return i.perObjectFrustumCulled=!0,i.matrixAutoUpdate=!1,i}function PI(e){return Se(e).darken(30).toRgbString()}function TZ(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,u;e.index?(l=e.index.count/3,u=function(w,T){return e.index.getX(w*3+T)}):(l=i.count/3,u=function(w,T){return w*3+T});let d=new Ci;d.makeRotationFromQuaternion(new bh().setFromEuler(new Ca(0,0,r/180*Math.PI)));let f=t.find(w=>w.face==="top"),h;f&&(h={min:n(f.bounds[1],f.bounds[0],0),max:n(f.bounds[3],f.bounds[2],o.max.z)});let b=t.find(w=>w.face==="side"),v;if(b&&(v={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],o.max.z)}),!(!v&&!h))for(let w=0;w<l;++w){let T=s.getX(u(w,0))+s.getX(u(w,1))+s.getX(u(w,2)),O=s.getY(u(w,0))+s.getY(u(w,1))+s.getY(u(w,2)),N=s.getZ(u(w,0))+s.getZ(u(w,1))+s.getZ(u(w,2)),k=Math.abs(T),D=Math.abs(O),F=Math.abs(N);var I,x;k<=D&&k<=F?(I="x",D<=F?x="y":x="z"):D<=k&&D<=F?(I="y",k<=F?x="x":x="z"):(I="z",k<=D?x="x":x="y"),I==="z"&&(I=x,x="z");let z,G,j,K,Z,oe;if(x==="z"||I==="z"){if(!b||!v)continue;z=b.repeat.u,G=b.repeat.v,j=b.offset.u,K=b.offset.v,Z=b.rotation,oe=v}else{if(!f||!h)continue;z=f.repeat.u,G=f.repeat.v,j=f.offset.u,K=f.offset.v,Z=(360-r+f.rotation)%360,oe=h}let{min:Q,max:ge}=oe,be=new Pa;be.position.set(Q.x,Q.y,0),be.updateMatrix(),be.updateMatrixWorld();let pe=Q.clone().applyMatrix4(d),_e=ge.clone().applyMatrix4(d),yt=Math.abs(_e.x-pe.x),it=Math.abs(_e.y-pe.y),Xe=new Ce(yt,it,ge.z).applyMatrix4(be.matrixWorld),Ue=Math.abs(Xe[I]-Q[I]),de=Math.abs(Xe[x]-Q[x]),me=Z*Math.PI/180||0,te=Math.cos(me),ie=Math.sin(me),A=be.matrixWorld.clone().invert(),Y=new bh().setFromEuler(new Ca(0,0,r/180*Math.PI));for(let L=0;L<3;L++){let ne=new Ce(i.getX(u(w,L)),i.getY(u(w,L)),i.getZ(u(w,L))).applyMatrix4(A);ne.applyQuaternion(Y);let ae=ne.applyMatrix4(be.matrixWorld),ve=ae.x,ur=ae.y,jn=ae.z;var C,P;I==="x"?C=z*(ve-Q[I])/Ue+j:I==="y"?C=z*(ur-Q[I])/Ue+j:C=z*(jn-Q[I])/Ue+j,x==="x"?P=G*(ve-Q[x])/de+K:x==="y"?P=G*(ur-Q[x])/de+K:P=G*(jn-Q[x])/de+K,C-=.5,P-=.5;let rn=C*te-P*ie+.5,xn=C*ie+P*te+.5;a.setX(u(w,L),rn),a.setY(u(w,L),xn)}}}p();var $m=class{constructor(){m(this,"focusMesh");m(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 hu&&e.components[1]===void 0?(e.components[1]=new Am,e.components[1].dirty=!0):e instanceof Tt&&e.components[2]===void 0?(e.components[2]=new Am,e.components[2].dirty=!0):e instanceof ct&&e.components[1]===void 0&&(e.components[1]=new Am,e.components[1].dirty=!0),!0):(e instanceof hu?e.components[1]=void 0:e instanceof Tt?e.components[2]=void 0:e instanceof ct&&(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 wZ(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=PI(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 MZ(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 OZ(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}function k5(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){let n=e.components[0];for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),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 D5(e,t){t!==void 0&&(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&(e.components[1].initialColor=t.initialColor),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor),e.components[1].dirty=!0)}function F5(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?(e.object3d.position.copy(r(t[1],t[0],t[2]||0)),e.positionDirty=!0):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}function L5(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof ct?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}function EZ(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}function _Z(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{u5.parse(t.options||{})}catch(o){return $.error(o),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",gn(e,!1,r)):(n.pointerEvents="none",gn(e,t.options.interactive,r))),AZ(e,t.options.rank),!0}}return!1}function AZ(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Tm(t),!0):!1}function kZ(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&&(l.text=t.text,l.dirty=!0);try{w5.parse(t.options||{})}catch(u){$.error(u);return}((n=t.options)==null?void 0:n.appearance)!==void 0&&Object.keys((o=t.options)==null?void 0:o.appearance).length>0&&(LE(l.appearance,((i=t.options)==null?void 0:i.appearance)||{}),l.dirty=!0),gn(e,(s=t.options)==null?void 0:s.interactive,r),AZ(e,(a=t.options)==null?void 0:a.rank)}}function DZ(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}function FZ(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 R5(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}function ca(e,t,r){if(r!==void 0){if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){e.components[1].visible=r,e.components[1].dirty=!0;let n=e.components[3];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof PE){let o=t.geometry2DMap.get(n.userData.entityId);if(o){let i=o.components[0];i instanceof la&&(i.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}function N5(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 ct&&(n=e.parent.opacity),LZ(e,t,n),!0}}return!1}function LZ(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 ct&&o.type==="group-container")&&LZ(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 RZ(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 NZ(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof yr){let o=e.components[0];return o.detached===!1&&(o.detached=!0,o.dirty=!0),!0}}return!1}function BZ(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 TI(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 wI(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 Tt&&wI(o,t,r)}else if(e.type==="geometry"){let n=e.components[3],o=e.components[1];!n&&r===!0?e.components[3]=new Bm(o.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}function B5(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof yr&&r.focusable!==t)return r.focusable=t,!0}else if(e.type==="group-container"){let r=e.components[2]!==void 0;if(t===!0&&!r)return e.components[2]=new $m,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}function $Z(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 jZ(e,t,r){let{visible:n,color:o}=r;if(e.type!=="path")return;let i=e.components[0];n!=null&&ca(e,t,n),o!=null&&D5(e,{color:o}),Object.assign(i,$5(r)),AE(r)||(i.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(i.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(i.dirty=!0))}function $5(e){return wo(e,lSe)}var lSe=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel"];function GZ(e){if(!(e instanceof Tt&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var MI=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function UZ(e,t,r){ca(e,t,r.visible);let n=e.components[1],o=wo(r,MI);"margin"in r&&$.warn("update to margin is not supported atm"),"content"in r&&$.warn("content update is not supported atm");try{xZ.parse(o)}catch(i){$.error(i);return}Object.keys(o).length>0&&(Object.assign(n,o),n.dirty=!0)}var cSe=["color","material","opacity","verticalOffset","rotation","position","scale"];function VZ(e,t){let r=wo(t,cSe),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 qp,ua,OI,Bc,zZ,ub,EI,HZ,WZ,pb,_I,db,fb,AI,cb=class{constructor(t){M(this,Bc);M(this,qp,null);M(this,ua);m(this,"getCurrentSceneGLTF",async t=>{let r={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},n=await ee(this,Bc,zZ).call(this),o=c(this,OI).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});M(this,OI,t=>{let{scale:r,light:n,onlyVisible:o}=t,i=new Vl,s=new Xr().setFromObject(c(this,ua).entityScene);if(c(this,ub).call(this,c(this,ua).entityScene,i,o),n){let a=new J1(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});M(this,ub,(t,r,n)=>{t.material&&(t instanceof X1?ee(this,Bc,HZ).call(this,t).forEach(o=>r.add(o)):t instanceof Pd&&r.add(ee(this,Bc,WZ).call(this,t))),t.children.forEach(o=>{(!n||o.visible)&&c(this,ub).call(this,o,r,n)})});M(this,EI,(t,r,n)=>{let o=new aE({color:new Ft(t),metalness:0});return o.opacity=r,o.transparent=n,o});M(this,pb,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,u=r.attributes.normal,d=r.attributes.uv;return c(this,_I).call(this,l,u),c(this,fb).call(this,o,a,i,s),d&&c(this,AI).call(this,d),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Ia),t});M(this,_I,(t,r)=>{let n=new Ce,o=new Ce;for(let i=0;i<t.count;i++)n.fromBufferAttribute(t,i),c(this,db).call(this,n),t.setXYZ(i,n.x,n.y,n.z),r&&(o.fromBufferAttribute(r,i),c(this,db).call(this,o),r.setXYZ(i,o.x,o.y,o.z))});M(this,db,t=>{let r=t.y;t.y=t.z,t.z=-r});M(this,fb,(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 Ca)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)}});M(this,AI,t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),o=t.getY(r);t.setXY(r,n,o)}});_(this,ua,t),c(this,ua).entityScene=t.entityScene,c(this,ua).geometry3DMap=t.geometry3DMap}destroy(){_(this,qp,null)}};qp=new WeakMap,ua=new WeakMap,OI=new WeakMap,Bc=new WeakSet,zZ=async function(){if(!c(this,qp)){let{GLTFExporter:t}=await import("./GLTFExporter-4THLS4PM.js");_(this,qp,new t)}return c(this,qp)},ub=new WeakMap,EI=new WeakMap,HZ=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,ua).geometry3DMap.get(l)),i=new Map;return o.forEach(l=>{var b;if(!l||!(l instanceof Tt))return;let u=l.components[1],d=l.components[2];if(!u.visible||u instanceof Is&&u.opacity===0||u instanceof Sh||u instanceof a0)return;let f=d!=null&&d.hover?u.hoverColor||c(this,ua).hoverColor:u.color,h="".concat(f,"-").concat(u.opacity,"-").concat(Number(u.visible));i.has(h)||i.set(h,[]),(b=i.get(h))==null||b.push(l)}),i.forEach((l,u)=>{let[d,f,h]=u.split("-"),b=l.reduce((C,P)=>{if(P.type==="custom-geometry")return C;let w=P.components[0];return"geometry"in w&&w.geometry instanceof tE&&C.push(w.geometry),C},[]),v=c(this,EI).call(this,d,Number(f),t.material.transparent),I=Ho(b,!0),x=new Ve(I,v);x.position.copy(t.position),x.rotation.copy(t.rotation),x.scale.copy(t.scale),x.visible=!!h,c(this,fb).call(this,x.position,x.scale,x.rotation,x.quaternion),r.push(c(this,pb).call(this,x))}),r},WZ=function(t){let r=t.geometry.clone(),n=t.material,o=new $r({color:n.color,side:Ia});o.opacity=n.opacity,o.transparent=n.transparent;let i=new Pd(r,o);return i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),i.visible=t.visible,c(this,pb).call(this,i)},pb=new WeakMap,_I=new WeakMap,db=new WeakMap,fb=new WeakMap,AI=new WeakMap;p();p();p();var U5=fs(rX());function nX(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}nX.prototype=Error.prototype;U5.default.Error=function(e){throw new nX(e)};var qr=U5.default;var rCe="gray",nCe=.1,yb=100,V5=new qr.ClipperOffset;function oCe(e,t){V5.Clear(),t/=2;let r=e.map(o=>({X:o.x*yb,Y:o.y*yb}));V5.AddPath(r,qr.JoinType.jtMiter,qr.EndType.etClosedPolygon);let n=new qr.Paths;return V5.Execute(n,t*yb),n.length?n.map(i=>i.map(s=>({x:s.X/yb,y:s.Y/yb}))):[e]}function NI(e,t,r){var h,b,v,I,x;let{color:n=rCe,opacity:o=1,altitude:i=0,height:s=nCe}=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}},u=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});((b=(h=e.properties)==null?void 0:h.style)==null?void 0:b.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((v=e.properties)==null?void 0:v.image)!=null?u=oCe(u,((x=(I=e.properties)==null?void 0:I.style)==null?void 0:x.edgeOffset)||0):u=[u];let d=[];for(let C of u){let P=new hs;P.moveTo(C[0].x,C[0].y),C.slice(1).forEach(N=>P.lineTo(N.x,N.y)),P.lineTo(C[0].x,C[0].y);let w=e.geometry.coordinates.slice(1);P.holes=w.map(N=>{let k=N.map(F=>t(F[1],F[0])),D=new Hl;return D.moveTo(k[0].x,k[0].y),k.slice(1).forEach(F=>D.lineTo(F.x,F.y)),D.lineTo(k[0].x,k[0].y),D});let T={bevelEnabled:!1,depth:s},O=new ys(P,T);O.userData={style:{color:n,opacity:o}},d.push(O)}if(d.length===1)return d[0];let f=Ho(d);return f.userData={style:{color:n,opacity:o},_split:!0},f}p();var iCe="gray",sCe=.1;function BI(e,t,r){let{color:n=iCe,opacity:o=1,altitude:i=0,height:s=sCe}=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},u=[];e.geometry.coordinates.forEach(f=>{let h=new hs,b=f[0].map(x=>{let C=t(x[1],x[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(b[0].x,b[0].y),b.slice(1).forEach(x=>h.lineTo(x.x,x.y)),h.lineTo(b[0].x,b[0].y);let v=f.slice(1);h.holes=v.map(x=>{let C=x.map(w=>t(w[1],w[0])),P=new Hl;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 ys(h,l);u.push(I)});let d=Ho(u);return d.translate(0,0,i||0),d.userData={style:{color:n,opacity:o}},d}p();var aCe="gray",z5=new qr.ClipperOffset,eo=100;function oX(e,t,r){let{color:n=aCe,opacity:o=1,width:i=1,join:s="round",cap:a="round",height:l=.01,altitude:u=0}=r||{};Array.isArray(o)&&(o=0);let d=[];for(let I=0;I<e.geometry.coordinates.length-1;I++){let x=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]);d.push([x,C])}z5.AddPaths(d.map(I=>I.map(x=>({X:x.x*eo,Y:x.y*eo}))),s==="round"?qr.JoinType.jsRound:s==="miter"?qr.JoinType.jsMiter:qr.JoinType.jsSquare,a==="round"?qr.EndType.etOpenRound:a==="butt"?qr.EndType.etOpenButt:qr.EndType.etOpenSquare);let f=new qr.PolyTree;z5.Execute(f,i/2*eo);let h=[],b={bevelEnabled:!1,depth:l};for(let I of f.m_AllPolys){let x=new hs;if(I.IsHole())continue;let C=I.m_polygon;x.moveTo(C[0].X/eo,C[0].Y/eo),C.slice(1).forEach(P=>x.lineTo(P.X/eo,P.Y/eo)),x.lineTo(C[0].X/eo,C[0].Y/eo),x.holes=I.m_Childs.map(P=>{let w=new Hl,T=P.m_polygon;return w.moveTo(T[0].X/eo,T[0].Y/eo),T.slice(1).forEach(O=>w.lineTo(O.X/eo,O.Y/eo)),w.lineTo(T[0].X/eo,T[0].Y/eo),w}),h.push(new ys(x,b))}let v=Ho(h);return v.translate(0,0,u||0),v.userData={style:{color:n,opacity:o}},z5.Clear(),v}p();var to=100,lCe=.22,cCe=.01;function iX(e,t,r={}){let{width:n=lCe,height:o=cCe,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}},u={bevelEnabled:!1,depth:o},d=new qr.ClipperOffset,f=e.geometry.coordinates.map(I=>I.map(x=>t(x[1],x[0])));d.AddPaths(f.map(I=>I.map(x=>({X:x.x*to,Y:x.y*to}))),qr.JoinType.jsMiter,qr.EndType.etOpenRound);let h=new qr.PolyTree;d.Execute(h,n/2*to);let b=[];for(let I of h.m_AllPolys){let x=new hs;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;x.moveTo(C[0].X/to,C[0].Y/to),C.slice(1).forEach(P=>x.lineTo(P.X/to,P.Y/to)),x.lineTo(C[0].X/to,C[0].Y/to),x.holes=I.m_Childs.map(P=>{let w=new Hl,T=P.m_polygon;return w.moveTo(T[0].X/to,T[0].Y/to),T.slice(1).forEach(O=>w.lineTo(O.X/to,O.Y/to)),w.lineTo(T[0].X/to,T[0].Y/to),w}),b.push(new ys(x,u))}let v=Ho(b);return v.translate(0,0,a||0),v.userData={style:{color:i,opacity:s}},d.Clear(),v}p();p();var Um=B.object({type:B.enum(["Point"]),coordinates:B.array(B.number()).min(2).max(3)});var uCe=B.object({rotation:B.array(B.number()).length(3).optional(),altitude:B.number().optional(),scale:B.array(B.number()).length(3).optional(),interactive:B.boolean().optional(),verticalOffset:B.number().optional(),id:B.union([B.number(),B.string()]).optional()}),pCe=B.object({type:B.enum(["Feature"]),geometry:Um,properties:uCe}),dCe=B.object({type:B.enum(["FeatureCollection"]),features:B.array(pCe)}),fCe=B.object({color:B.string()}),mCe=B.object({url:B.string(),color:B.string().optional(),opacity:B.number().optional(),material:B.record(B.string(),fCe).optional()});function aX(e,t,r){B.union([B.number(),B.string()]).parse(e),dCe.parse(t),mCe.parse(r)}var gb,bb,Gc=class{constructor(t){m(this,"mesh");m(this,"type","model");m(this,"positionDirty",!0);m(this,"outline");m(this,"geometry");m(this,"material");m(this,"feature");m(this,"instanceIndex",-1);m(this,"visible",!0);m(this,"color",new Ft);m(this,"position",new Ce);M(this,gb,0);M(this,bb,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return c(this,gb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,_(this,gb,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(Ye.degToRad(t[0]),Ye.degToRad(t[1]),Ye.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,bb)}set opacity(t){var r,n,o;if(this.mesh){if(this.mesh.children[0]instanceof zl){for(let i of this.mesh.children)if(i instanceof zl){((r=i.userData)==null?void 0:r.originalOpacity)===void 0&&(i.userData.originalOpacity=i.material.opacity);let s=Ss(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 Ve&&i.material&&(Array.isArray(i.material)?i.material.forEach(s=>{sX(s,t)}):sX(i.material,t))});_(this,bb,t)}}};gb=new WeakMap,bb=new WeakMap;function sX(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}p();function $I(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 u=hCe(o,n);(a=t.mesh)==null||a.traverse(d=>{d instanceof Ve&&d.material&&(Array.isArray(d.material)?d.material.forEach(f=>{u[f.name]?f.color.set(u[f.name].color):f.color.set(o)}):u[d.material.name]?d.material.color.set(u[d.material.name].color):d.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 hCe(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 lX(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 yCe(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 gCe=1e4,jI=class extends De{constructor(r,n){super();m(this,"state");m(this,"convertTo3DMapPosition");m(this,"loader");m(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-KOQIUT25.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,o){var a,l;let i=new yr(n),s=new Tt(i,new Is({...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 Bm(PI(o.color))),s.id=r,s}createModelFromFeature(r,n,o){let i=new Gc(n),s={...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 a0(s),l=new Tt(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 Ci,s=new Ca,a=new bh,l=new Ce,u=new Mi,d=await this.getGLTFLoader(),f=new Promise(h=>{d.load(n,b=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?b.scene.traverse(v=>{let I=v;if("isMesh"in I&&I.isMesh===!0){let x=new zl(I.geometry,I.material,r.size);x.userData={entities:{}},u.add(x),o.add(u)}}):(b.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())}),u.add(b.scene),o.add(u),u.userData.isSingleModel=!0,u.userData.entityId=r.values().next().value,u.userData.type="model")),h()})});return this.optimizePromise.push(f.then(()=>{var v,I,x,C,P,w,T,O,N,k,D,F;let h=0,b;for(let z of r.values()){if(b=this.state.geometry3DMap.get(z),!b||(b==null?void 0:b.type)!=="model")continue;let G=b.components[0],j=b.components[1],K=b.components[0].feature;G.mesh=u,G.instanceIndex=h,$I(b),b.components[1].dirty=!1;let{x:Z,y:oe}=this.convertTo3DMapPosition(K.geometry.coordinates[1],K.geometry.coordinates[0],0);G.position.set(Z,oe,G.altitude),s.set(Ye.degToRad((I=(v=j.rotation)==null?void 0:v[0])!=null?I:kd[0]),Ye.degToRad((C=(x=j.rotation)==null?void 0:x[1])!=null?C:kd[1]),Ye.degToRad((w=(P=j.rotation)==null?void 0:P[2])!=null?w:kd[2])),l.set((O=(T=j.scale)==null?void 0:T[0])!=null?O:Ad[0],(k=(N=j.scale)==null?void 0:N[1])!=null?k:Ad[1],(F=(D=j.scale)==null?void 0:D[2])!=null?F:Ad[2]),a.setFromEuler(s),i.compose(G.position,a,l),u.children.forEach(Q=>{!b||(b==null?void 0:b.type)!=="model"||!(Q instanceof zl)||(Q.setMatrixAt(h,i),Q.userData.entities[h]=b.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")})),u}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 yr&&(o=s.components[0].feature,i=s.components[1],o.geometry.type==="Polygon"?(n=NI(o,this.convertTo3DMapPosition,i),(a=o.properties)!=null&&a.textures&&o.properties.textures.length>0&&TZ(n,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(s,n)):o.geometry.type==="MultiPolygon"?(n=BI(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)):o.geometry.type==="LineString"?(n=oX(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)):o.geometry.type==="MultiLineString"&&(n=iX(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)));return r}optimize(r){var n;if(r.visible&&(r instanceof In||r instanceof ct)){for(let s of r.children)this.optimize(s);if(r instanceof ct||r.userData.dirty===!1)return;let o={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(s){$.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 u=a==null?void 0:a.components[0];if((a==null?void 0:a.type)==="geometry"){let d=a.components[1];s++,s>=gCe&&(s=0,i++);let f=yCe(d)+i;o[f]===void 0&&(o[f]={style:d,entities:[]}),o[f].entities.push(a)}else u&&"mesh"in u&&u.mesh&&((n=u.mesh)==null?void 0:n.parent)!==r&&r.add(u.mesh)}for(let l in o){let u=PZ(o[l].entities,o[l].style);r.add(u),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 u of a.entities2D.values())u&&(a.attach(u),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};p();var GI=class{constructor(t,r){m(this,"state");m(this,"dirty",!0);m(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof aa&&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}}};p();var UI=class{constructor(t,r){m(this,"state");m(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,o;for(let i of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(i),t){o=t.components[0];let s=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(s instanceof Tt)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}}};p();p();var bCe=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}}}(),cX=({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}=bCe(n);l.font=a;let u=[],d=e.split(" "),f=0,h=0,b=0;for(;h<d.length;){let C=d[h];if(f===o&&f>0){u[f-1]+="...";break}if(u[f]==null&&(u[f]=C,h++),d.length===1){u[f]=C;break}if(d[h]==null)break;let{width:P}=l.measureText(u[f]+" "+d[h]);P<=r*n?(u[f]+=" "+d[h],h++):f++}u.forEach(C=>{let{width:P}=l.measureText(C);b=Math.max(P,b)});let v=t*n*i,I=u.length*v;return{maxWidth:b,maxHeight:I,lines:u.length,draw:(C,P,w)=>{u.length===1?(s.strokeText&&C.strokeText(u[0],P,w),C.fillText(u[0],P,w)):(s.strokeText&&(C.strokeText(u[0],P,w-v/2),C.strokeText(u[1],P,w+v/2)),C.fillText(u[0],P,w-v/2),C.fillText(u[1],P,w+v/2))}}};p();function uX(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 vCe=3.5,xCe=2.5,ICe=2,SCe=5,vb=2.5;var VI=class extends De{constructor(r,n,o){super();m(this,"dirty",!1);m(this,"state");m(this,"colliderContext");m(this,"colliderCanvas");m(this,"transformRequestFunc");m(this,"transformRequest",async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r});m(this,"pinCache",{});m(this,"imageCache",{});m(this,"imagePromiseCache",{});m(this,"imageDimensionsCache",{});m(this,"textCache",{});m(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,u,d;for(let f of this.state.geometry2DIdsInScene)if(d=this.state.geometry2DMap.get(f),d!=null&&(u=d.components[0],u instanceof la&&!d.disposed)){if(l=u.appearance.marker.iconVisibleAtZoomLevel,u.appearance.marker.icon!=null&&l&&r>=l!==u.iconVisible&&(u.iconVisible=r>=l,u.dirty=!0),(u.dirty||this.dirty)&&u.calculateMarkerSize(),i=u.appearance.marker.foregroundColor,s=u.appearance.marker.backgroundColor,a=wd(u.markerSize,2),o="".concat(i.active,"-").concat(i.inactive,"-").concat(s.active,"-").concat(s.inactive,"-").concat(a,"-").concat(u.iconVisible),u.labelCacheId=o,this.pinCache[o]||this.prepare(u,o,this.colliderContext),u.appearance.marker.icon&&(!u.imageHash||u.dirty)&&this.cacheImage(u),this.textCache[u.id]==null||u.dirty||this.dirty){u.collisionDirty=!0,this.textCache[u.id]={};let{textDrawFn:h,width:b,height:v}=this.processText(u.text,u.appearance.text.size,u.appearance.text.maxWidth,u.appearance.text.numLines,u.appearance.text.lineHeight);["left","center","right"].forEach(x=>{this.textCache[u.id][x]=this.textToCanvas(h,u.appearance.text.size,x,b,v,u.appearance.text.foregroundColor,u.appearance.text.backgroundColor)}),u.dimensions={width:Math.ceil(b/n),height:Math.ceil(v/n)},u.currentStrategyIndex===-1&&(u.currentStrategyIndex=0);let I=u.strategies[u.currentStrategyIndex];if(I){I.onStrategySelected(u);let x=u.style;u.style=u.newStyle,u.newStyle=x}}u.canShow&&u.visible&&(u.enabled||u.visibilityNeedsUpdate!==!1)&&this.draw(u,o,this.colliderContext),u.dirty=!1}this.dirty=!1});m(this,"processText",(r,n,o,i,s)=>{let a=this.state.pixelRatio,{draw:l,maxWidth:u,maxHeight:d}=cX({text:r,size:n,pixelRatio:a,maxWidth:o,maxLines:i,lineHeight:s});return{textDrawFn:l,width:u+vb*a*2,height:d+vb*a*2}});m(this,"textToCanvas",(r,n,o,i,s,a,l)=>{let u=this.state.pixelRatio,d,f=i,h=s;window.OffscreenCanvas!=null&&!_E()?d=new OffscreenCanvas(f,h):(d=document.createElement("canvas"),d.width=f,d.height=h,d.style.width=f+"px",d.style.height=h+"px");let b=d.getContext("2d",{willReadFrequently:!0});if(!b)return;b.textAlign=o,b.font="bold ".concat(n*u,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=vb*u,b.fillStyle=a,b.strokeStyle=l;let v=o==="left"?0:o==="center"?f/2:f-vb*u/2;return r(b,v,(h+vb*u/2)/2),d});m(this,"cacheImage",r=>{if(!r.appearance.marker.icon)return;let n=NE(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(o=>{this.transformRequest(r.appearance.marker.icon).then(i=>{let s=uX(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}))});m(this,"createPinCanvas",(r,n,o,i)=>{let s,a=this.state.pixelRatio,l=r.totalMarkerSize*2*a;window.OffscreenCanvas!=null?s=new OffscreenCanvas(l,l):(s=document.createElement("canvas"),s.width=l,s.height=l,s.style.width=l/a+"px",s.style.height=l/a+"px");let u=s.getContext("2d");return u.shadowColor="rgba(0,0,0,0.3)",u.shadowOffsetY=ICe*a,u.shadowBlur=SCe*a,u.beginPath(),u.arc(l/2,l/2,n/2+xCe*a/2,0,2*Math.PI),u.fillStyle=o,u.fill(),u.beginPath(),u.arc(l/2,l/2,n/2,0,2*Math.PI),u.shadowColor="transparent",u.fillStyle=i,u.fill(),s});m(this,"prepare",(r,n,o)=>{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),a=this.createPinCanvas(r,r.iconVisible?r.markerSize:vCe*i,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive);this.pinCache[n]=[s,a]});this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=o}draw(r,n,o){var u,d;if(!r.canShow||!r.visible)return;o.save(),o.globalAlpha=r.opacity;let i=this.state.pixelRatio,s=r.projection.x*i,a=r.projection.y*i,l=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(o.drawImage(l,s-r.totalMarkerSize*i,a-r.totalMarkerSize*i),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let f=this.imageCache[r.imageHash],h=(r.appearance.marker.iconSize-r.appearance.marker.iconPadding)*i,b=r.appearance.marker.iconFit,v=h,I=h,x="".concat(r.imageHash,"_").concat(b);if(this.imageDimensionsCache[x])v=this.imageDimensionsCache[x].width,I=this.imageDimensionsCache[x].height;else{let C=f.width*i,P=f.height*i;if(b==="contain"){let w=Math.sqrt(C**2+P**2),T=h/w;v=C*T,I=P*T}if(b==="cover"){let w=h/C,T=h/P,O=Math.max(w,T);v=C*O,I=P*O}}o.save(),o.beginPath(),o.arc(s,a,h/2,0,2*Math.PI),o.closePath(),((d=(u=r==null?void 0:r.appearance)==null?void 0:u.marker)==null?void 0:d.iconOverflow)!=="visible"&&o.clip(),o.drawImage(f,s-v/2,a-I/2,v,I),o.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left&&r.style.top&&o.drawImage(this.textCache[r.id][r.style.textAlign],s+r.style.left*i,a+r.style.top*i),o.restore()}};p();p();var Kp=class Kp{constructor(){m(this,"loader");this.loader=new Td}static getInstance(){return Kp.instance||(Kp.instance=new Kp),Kp.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};m(Kp,"instance");var H5=Kp,Uc=H5.getInstance();function CCe(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 Jp,xb,zI=class extends De{constructor(r,n){super();M(this,Jp);m(this,"state");m(this,"convertTo3DMapPosition");m(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,o){var i;if(n.texture!==r.texture&&n.texture!==""&&ee(this,Jp,xb).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&ee(this,Jp,xb).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,Jp,xb).call(this,s.path,r,"topTexture"):s.face==="side"&&r.texture!==s.path&&ee(this,Jp,xb).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,u,d,f,h;let r,n,o;for(let b of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(b),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 x=this.state.geometry3DMap.get(I);x instanceof Tt&&(x.type==="geometry"||x.type==="custom-geometry")&&(r=x.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 yr&&this.processTextures(P,v)}let x=v.opacity*yu(o);o.getOpacity()!==x&&o.setOpacity(x),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 x=CCe(o,this.state.hoverColor);if(v.setColor(x[0],x[1]),I.visible!==v.visible&&(v.visible=I.visible,v instanceof yr&&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*yu(o);C!==v.opacity&&(v.opacity=C),I.renderOrder!==v.renderOrder&&(v.renderOrder=I.renderOrder),I.dirty=!1,v instanceof yr&&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&&($I(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(lX(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 x=(u=v.hoverColor)!=null?u:this.state.text3dHoverColor;I.color=v.hoverByPolygon?x:(d=v.color)!=null?d:_d.color,I.outlineColor=v.hoverByPolygon?x:(f=v.outlineColor)!=null?f:_d.outlineColor,I.strokeColor=v.hoverByPolygon?x:(h=v.strokeColor)!=null?h:_d.strokeColor}v.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};Jp=new WeakSet,xb=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)=>{Uc.getLoader().load(r,l=>{o==="topTexture"?n.topTexture=l:n.texture=l,n.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{$.error("Failed to load texture: ".concat(r)),a("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,i)}};p();var HI=class extends De{constructor(r){super();m(this,"state");m(this,"animating",new Map);m(this,"isAnimating",!1);m(this,"startTime",-1);m(this,"showDuration",300);m(this,"hideDuration",250);m(this,"update",()=>{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 la&&(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")});m(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[o,i]]of this.animating.entries()){let s=i===1?this.showDuration:this.hideDuration,a=(r-this.startTime)/s;n.opacity=Ss(a,0,1,o,i,i===0?BE:$E),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")}};p();var WI=class extends De{constructor(r,n,o,i,s,a,l){super();m(this,"state");m(this,"renderer");m(this,"mode");m(this,"scene");m(this,"cameraObject");m(this,"viewCamera");m(this,"systems");m(this,"needs2DRecompute",!1);m(this,"twoDdirty",!0);m(this,"threeDdirty",!0);m(this,"frameId",null);m(this,"twoDFrameId",null);m(this,"animationFrameId",null);m(this,"nextFrame",null);m(this,"update",(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()})})});m(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});m(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});m(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())})});m(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.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),FE(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(),DE(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){$.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.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};p();var PCe=B.object({interactive:B.boolean().optional(),id:B.string().optional(),nearRadius:B.number().optional(),farRadius:B.number().optional(),accentColor:B.string().optional(),displayArrowsOnPath:B.boolean().optional(),animateArrowsOnPath:B.boolean().optional(),nearZoomLevel:B.number().optional(),farZoomLevel:B.number().optional()}),TCe=B.object({type:B.enum(["Feature"]),geometry:Um,properties:B.object({parentId:B.any().optional()})});function pX(e,t){B.object({features:B.array(TCe)}).parse(e),PCe.parse(t)}var Ib,Vc=class{constructor(t,r){m(this,"type","path");m(this,"mesh",new Mi);m(this,"material");m(this,"geometry");m(this,"outline");m(this,"feature");m(this,"options");m(this,"nearRadius",.2);m(this,"farRadius",.4);m(this,"nearZoomLevel");m(this,"farZoomLevel");m(this,"nearZoomAltitude");m(this,"farZoomAltitude");m(this,"accentColor","blue");m(this,"completeFraction",1);m(this,"altitudeAdjustment",1);m(this,"displayArrowsOnPath",!1);m(this,"animateArrowsOnPath",!1);m(this,"isVertical",!1);m(this,"dirty",!0);m(this,"materialDirty",!0);m(this,"position",new Ce);M(this,Ib,0);var n,o,i,s,a;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}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,Ib)}set altitude(t){this.mesh&&(this.mesh.position.z=t,_(this,Ib,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Ib=new WeakMap;p();var qI=class{constructor(t){m(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof ct&&t.components[0]){let n=t.components[0];if(n.dirty){for(let o of t.children)(o instanceof In||o instanceof ct)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));n.dirty=!1}}}};p();p();p();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}}}}),Sb=function(){return performance.now()},q5=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=Sb()),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}(),Vm={Linear:function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=Vm.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=Vm.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=Vm.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=Vm.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}}},dX=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),W5=new q5,Io=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=Vm.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=dX.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=W5,W5.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=Sb()),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),u=l?"array":typeof a,d=!l&&Array.isArray(n[s]);if(!(u==="undefined"||u==="function")){if(d){var f=n[s];if(f.length===0)continue;for(var h=[a],b=0,v=f.length;b<v;b+=1){var I=this._handleRelativeValue(a,f[b]);if(isNaN(I)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(I)}d&&(n[s]=h)}if((u==="object"||l)&&a&&!d){r[s]=l?[]:{};var x=a;for(var C in x)r[s][C]=x[C];o[s]=l?[]:{};var f=n[s];if(!this._isDynamic){var P={};for(var C in f)P[C]=f[C];n[s]=f=P}this._setupProperties(x,r[s],f,o[s],i)}else(typeof r[s]>"u"||i)&&(r[s]=a),l||(r[s]*=1),d?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=Sb()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Sb()),!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=Vm.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=Sb()),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,u=function(){if(n._duration===0||s>l)return 1;var I=Math.trunc(s/a),x=s-I*a,C=Math.min(x/n._duration,1);return C===0&&s===n._duration?1:C},d=u(),f=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),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 b=0,v=this._chainedTweens.length;b<v;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,o){for(var i in n)if(r[i]!==void 0){var s=r[i]||0,a=n[i],l=Array.isArray(t[i]),u=Array.isArray(a),d=!l&&u;d?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 emt=dX.nextId,pa=W5,tmt=pa.getAll.bind(pa),rmt=pa.removeAll.bind(pa),nmt=pa.add.bind(pa),omt=pa.remove.bind(pa),imt=pa.update.bind(pa);p();p();p();var fX=(e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,mX=(e,t)=>new Ee(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),Z5=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),Cb=(e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),X5=(e,t)=>new Ee((e.x+t.x)/2,(e.y+t.y)/2),Y5=e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t};var ZI=class{constructor(t,r){m(this,"input1");m(this,"input2");m(this,"lastAngle");m(this,"lastDistance");m(this,"totalDistance");m(this,"first");m(this,"second");this.input1=t,this.input2=r,this.lastAngle=Z5(t,r),this.lastDistance=Cb(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Cb(t,r);this.input1=t,this.input2=r;let o=Z5(t,r);this.lastAngle=o,this.lastDistance=n,this.totalDistance+=(Cb(this.first,t)+Cb(this.second,r))/2,this.first=X5(this.first,t),this.second=X5(this.second,r)}};p();var Pb=class{constructor(t,r,n){m(this,"touch");m(this,"camera");m(this,"cameraPlane");m(this,"viewCoordinate");m(this,"snapHolderMatrix");m(this,"snapCamera");m(this,"cameraPosition");m(this,"raycaster");m(this,"worldCoordinate");m(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new Ee(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new gs,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 Ee(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 Ii={};Ul(Ii,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>MCe,CLIPPING_RADIUS:()=>Tb,CONTROL_OPTIONS:()=>wCe,DEFAULT_ANIMATION_DURATION:()=>tO,DEFAULT_BEARING:()=>kCe,DEFAULT_MAX_ZOOM_LEVEL:()=>_Ce,DEFAULT_MIN_ZOOM_LEVEL:()=>rO,DEFAULT_PITCH:()=>ACe,DEFAULT_ZOOM_LEVEL:()=>ECe,EVENTS:()=>JI,MAPLIBRE_TILE_SIZE:()=>XI,MAX_LAT:()=>J5,MAX_MERCATOR_ZOOM_LEVEL:()=>KI,MIN_LAT:()=>K5,MIN_MERCATOR_ZOOM_LEVEL:()=>YI,ROOM_MERCATOR_ZOOM_LEVEL:()=>OCe,TWO_PI:()=>Q5,WHEEL_ZOOM_MULTIPLIER:()=>eO,ZRANGE:()=>zm});p();var XI=512,K5=-85.051129,J5=85.051129,Tb=1e4,wCe={chain:"chain",cancel:"cancel"},Q5=Math.PI*2,zm=100,eO=1e4,YI=0,KI=24,MCe=17,OCe=20,tO=200,JI=["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"],ECe=18,rO=12,_Ce=22,ACe=0,kCe=0;p();function hX(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}function mr(e){for(let t=e.children.length-1;t>=0;t--)mr(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){hX(t)}):"material"in e&&typeof e.material<"u"&&hX(e.material)}var QI=!1,DCe=!1;var eS,Qp=class extends De{constructor(r,n,o,i,s){super();m(this,"dirty",!1);m(this,"zoomDirty",!1);m(this,"rotationDirty",!1);m(this,"panDirty",!1);M(this,eS,rO);m(this,"zoomSpeed",5);m(this,"rotateSpeed",100);m(this,"enabled",!0);m(this,"enableZoom",!0);m(this,"enablePan",!0);m(this,"enablePedestal",!1);m(this,"maxPedestal",1/0);m(this,"minPedestal",0);m(this,"enableRotate",!0);m(this,"minZoomAltitude",0);m(this,"maxZoomAltitude",1/0);m(this,"ignoreZoomLimits",!1);m(this,"zoomFactor",1);m(this,"panBounds",{min:new Ce(1/0,1/0),max:new Ce(-1/0,-1/0),center:new Ce(0,0,0),radius:1/0});m(this,"minTilt",0);m(this,"maxTilt",1.2);m(this,"MOUSE_BUTTONS",{ORBIT:W1.RIGHT,ZOOM:W1.MIDDLE,PAN:W1.LEFT});m(this,"camera");m(this,"scene");m(this,"renderer");m(this,"elevation");m(this,"orbit");m(this,"cameraPlane");m(this,"raycaster",new gs);m(this,"rendererState");m(this,"options");m(this,"state",-1);m(this,"intersection");m(this,"viewState",null);m(this,"tweens",new Map);m(this,"clock",new cE(!0));m(this,"coords",{mouse:new Ee,rotateStart:new Ee,rotateEnd:new Ee,rotateDelta:new Ee,panStart:new Ce,panCameraStart:new Ce,panEnd:new Ce,panDelta:new Ce,initialShiftPos:new Ee,initialPedestal:0,floorAnchor:new Ce});m(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});m(this,"scrollTimer",null);m(this,"lastWheelTime",0);m(this,"resetZoom",!1);m(this,"zoomStart");m(this,"pedestalScaleFactor",1);m(this,"isUserZooming",!1);m(this,"stayInsideBounds",!0);m(this,"userInteracting",!1);m(this,"cameraMoving",!1);m(this,"lastCameraMoveTime",Date.now());m(this,"raycastToFloor",r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new Ce});m(this,"isUserInteracting",()=>this.userInteracting);m(this,"getPosition",()=>new Ce(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));m(this,"getPedestal",()=>this.orbit.position.z);m(this,"pan",(r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))});m(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"))});m(this,"isCameraMoving",()=>this.cameraMoving);m(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);m(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)});m(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});m(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")});m(this,"zoomIn",(r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},r,n,o)});m(this,"zoomOut",(r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},r,n,o)});m(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));m(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)});m(this,"animateCamera",(r,n,o,i,s,a)=>{let l={interruptible:!0,...a},u={},d={},f=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(u.x=f.x,d.x=r.position.x),r.position.y!==void 0&&(u.y=f.y,d.y=r.position.y),r.position.z!==void 0&&(u.z=f.z,d.z=r.position.z)),r.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.zoom=r.zoom:d.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:w,end:T}=t0(this.getRotation(),r.rotation);u.rotation=w,d.rotation=T}r.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.tilt=r.tilt:d.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let h=u.zoom!==d.zoom,b=u.rotation!==d.rotation,v=u.tilt!==d.tilt,I=new Io(u).to(d,g.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:b,tilting:v}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,I.state=7,this.publish("multi-start",{zooming:h,rotating:b,tilting:v})),this.publish("change")});this.rendererState.tweenGroup.add(I);let x=Array.from(this.tweens.entries()),C=x[x.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});m(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 u=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;u!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>Tb&&(this.camera.near=n-Tb,this.camera.far=n+Tb):(this.camera.near=n/zm,this.camera.far=n*zm),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 u=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;u!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=u,this.publish("tilt-updated"))}s&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)});m(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);m(this,"getZoomScaledMax",()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)});m(this,"setRotation",(r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=-(r%Q5);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});m(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/zm,this.camera.far=n*zm,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});m(this,"setZoomLevel",r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))});m(this,"getZoomAltitude",()=>this.camera.position.z);m(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));m(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});m(this,"getTilt",()=>this.elevation.rotation.x);m(this,"setCameraPlaneElevation",r=>{this.cameraPlane.position.z=r});m(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")});m(this,"getProjectionScaleFactor",(r,n,o)=>t3(r,n,o));m(this,"update",()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});m(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)});m(this,"dispose",()=>{for(let r of JI)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)});m(this,"createCameraPlane",()=>{let r=QI?2e3:1e10,n=QI?100:1,o=new Ti(r,r,n,n),i=new $r({color:0,wireframe:QI,visible:QI}),s=new Ve(o,i);return this.scene.add(s),s});m(this,"addEventListeners",()=>{let{domElement:r}=this.renderer;for(let n of JI)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)});m(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});m(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});m(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});m(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)});m(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});m(this,"onContextMenu",r=>{r.preventDefault()});m(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}});m(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)});m(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 ZI(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});m(this,"onTouchMove",r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n={...this.touch.inputs.first},o={...this.touch.inputs.second},i=new Ee(this.touch.touches[0].x,this.touch.touches[0].y),s=new Ee(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}});m(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}});m(this,"handleTouchMovePan",r=>{let n=Object.hasOwn(r,"x")?new Ee(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});m(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 Ee(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 Pb(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Pb(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")});m(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});m(this,"handleTouchStartTilt",r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});m(this,"handleTouchMovePedestal",r=>{this.handleMouseMovePedestal(r.touches[0])});m(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)});m(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)});m(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});m(this,"handleTouchStartPan",r=>{let n=Object.hasOwn(r,"x")?new Ee(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")});m(this,"handleTouchStartPedestal",r=>{this.handleMouseDownPedestal(r.touches[0])});m(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()}});m(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))});m(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-Y5(r)*n/eO*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")});m(this,"setCameraFromTransformMatrix",r=>{this.orbit.updateMatrixWorld();let n=new Ca;n.setFromRotationMatrix(r,"ZYX");let o=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),i=n.z,s=new Ce(0,0,1);s.applyEuler(n),s.setLength(o);let a=new Ce;a.setFromMatrixPosition(r),a.sub(s),this.enablePan&&this.setPosition(a.x,a.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-i)});m(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 u=r.viewCoordinate,d=n.viewCoordinate,f=s.x-i.x,h=s.y-i.y,b=Math.atan2(h,f),v=l.x-a.x,I=l.y-a.y,x=Math.atan2(I,v),C=fX(b,x),P=new Ci;P.makeRotationZ(-C);let w=P.clone();w.multiply(r.snapHolderMatrix);let T=(zY,HY,WY)=>zY.elements[(HY-1)*4+WY-1],O=T(o,1,1)*T(w,1,1)-u.x*T(o,3,4)*T(w,3,1),N=T(o,1,1)*T(w,1,2)-u.x*T(o,3,4)*T(w,3,2),k=T(o,1,1)*T(w,1,3)-u.x*T(o,3,4)*T(w,3,3),D=i.x*O+i.y*N+i.z*k,F=T(o,2,2)*T(w,2,1)-u.y*T(o,3,4)*T(w,3,1),z=T(o,2,2)*T(w,2,2)-u.y*T(o,3,4)*T(w,3,2),G=T(o,2,2)*T(w,2,3)-u.y*T(o,3,4)*T(w,3,3),j=i.x*F+i.y*z+i.z*G,K=T(o,1,1)*T(w,1,1)-d.x*T(o,3,4)*T(w,3,1),Z=T(o,1,1)*T(w,1,2)-d.x*T(o,3,4)*T(w,3,2),oe=T(o,1,1)*T(w,1,3)-d.x*T(o,3,4)*T(w,3,3),Q=s.x*K+s.y*Z+s.z*oe,ge=T(o,2,2)*T(w,2,1)-d.y*T(o,3,4)*T(w,3,1),be=T(o,2,2)*T(w,2,2)-d.y*T(o,3,4)*T(w,3,2),pe=T(o,2,2)*T(w,2,3)-d.y*T(o,3,4)*T(w,3,3),_e=s.x*ge+s.y*be+s.z*pe,yt=Math.abs(K-O),it=Math.abs(Z-N),Xe=Math.abs(oe-k),Ue=Math.abs(K-F),de=Math.abs(Z-z),me=Math.abs(oe-G),te=Math.abs(ge-O),ie=Math.abs(be-N),A=Math.abs(pe-k),Y=Math.abs(ge-F),L=Math.abs(be-z),le=Math.abs(pe-G),ne=Math.min(yt+it+Xe,Ue+de+me),ae=Math.min(te+ie+A,Y+L+le);ne<ae&&(K=ge,Z=be,oe=pe,Q=_e);let ve=F*k-O*G,ur=z*k-N*G,jn=j*k-D*G,rn=K*G-F*oe,xn=Z*G-z*oe,uu=Q*G-j*oe,US=(uu*ur-jn*xn)/(rn*ur-ve*xn),VS=(uu*ve-jn*rn)/(xn*ve-ur*rn),GO=z*O-N*F,GY=G*O-k*F,UY=j*O-D*F,UO=Z*F-z*K,VY=oe*F-G*K,VO=((Q*F-j*K)*GO-UY*UO)/(VY*GO-GY*UO),H1=w.clone();return H1.elements[12]=US,H1.elements[13]=VS,H1.elements[14]=VO,VO>0?H1:null});m(this,"updateTouchOrigin",()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top});m(this,"touchToScene",r=>{this.touch.touches=[];for(let n=0,o=r.touches.length;n<o;n++){let i=r.touches[n],s=mX(i,this.touch.origin);this.touch.touches.push(new Ee(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]});m(this,"canScrollZoom",r=>{let n=Y5(r),o=this.getZoomAltitude();return!(n<0&&o===this.getZoomScaledMax()||n>0&&o===this.getZoomScaledMin())});m(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});m(this,"getMousePos",r=>({x:r.offsetX,y:r.offsetY}));m(this,"handleMouseDownRotate",r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});m(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")});m(this,"handleMouseDownPedestal",r=>{let n=new Ee(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=t3(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});m(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)});m(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")});m(this,"publishUserZoomDebounced",Ed(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));m(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});m(this,"setCameraMoving",()=>{this.cameraMoving=!0});m(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});m(this,"setUserInteracting",()=>{this.userInteracting=!0});m(this,"unsetUserInteracting",()=>{this.userInteracting=!1});m(this,"publishPedestalChangeEvent",r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});m(this,"convertAltitudeToZoomLevel",r=>{let[,n]=this.center,i=r*2*Math.tan(Ye.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(Ye.degToRad(n))*2*Math.PI*zS/i;return Ye.clamp(Math.log2(s/512),YI,KI)});m(this,"convertZoomLevelToAltitude",r=>{let[,n]=this.center,o=Ye.clamp(r,YI,KI),i=Math.pow(2,o),s=Ye.clamp(n,K5,J5),a=i*512;return Math.cos(Ye.degToRad(s))*Math.PI*2*zS/a*this.options.canvasHeight/2/Math.tan(Ye.degToRad(this.camera.fov)/2)});m(this,"completeTween",r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)});m(this,"debugContainer",new Pa);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,eS)}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}=o0((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,u;let{x:o,y:i}=i0((a=(s=this.rendererState.center)==null?void 0:s[1])!=null?a:0,(u=(l=this.rendererState.center)==null?void 0:l[0])!=null?u:0,n,r);this.setPosition(o,i)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let o=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,i=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,s=this.options.canvasWidth,a=this.options.canvasHeight,l=this.getRotation(),u=this.getTilt(),d=this.getPosition();this.setRotation(n.rotation||l,!0),this.setTilt(n.tilt||u,!0);let f=yX(r,{canvasWidth:s,canvasHeight:a,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:o,maxZoom:i,position:d,camera:this.camera,orbit:this.orbit});return this.setRotation(l,!0),this.setTilt(u,!0),{center:f.position,zoomLevel:this.convertAltitudeToZoomLevel(f.zoom)}}focusOn(r,n){if(DCe){this.debugContainer&&mr(this.debugContainer);let x=new Pi(4,4,4),C=new $r({color:65280,depthTest:!1}),P=new zl(x,C,r.length),w=new Ci;r.forEach((T,O)=>{w.setPosition(T),P.setMatrixAt(O,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,u=this.options.canvasWidth,d=this.options.canvasHeight,f;n.duration!==void 0?f=n.duration:g.env.TESTING==="true"?f=0:f=tO;let h=n.padding,b=this.getRotation(),v=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let I=yX(r,{canvasHeight:d,paddingOption:h,canvasWidth:u,minZoom:a,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(b),this.setTilt(v),this.animateCamera({position:I.position,tilt:n.tilt,rotation:n.rotation,zoom:I.zoom},f,o,i,s,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};eS=new WeakMap,m(Qp,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function yX(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:o=0,canvasHeight:i,minZoom:s,maxZoom:a,camera:l,position:u}){let d={zoom:s,position:u};if(e.length===0)return d;for(let ve of Qp.CAMERA_FRAME_PADDING_SIDES)typeof n[ve]!="number"&&(n[ve]=0);let f=n.type==="portion"?{top:n.top*i,bottom:n.bottom*i,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(f.left+f.right>=t||f.top+f.bottom>=i)return d;r.updateMatrixWorld();let h=l.matrixWorldInverse,b=l.fov*(Math.PI/180)/2,v=b,x=Math.atan(Math.tan(b)*(t/i)),C=new Ce(1/0,1/0,1/0),P=new Ce(-1/0,-1/0,-1/0),w=new Xr,T=new Ce;for(let ve=0,ur=e.length;ve<ur;ve++)T.copy(e[ve]),w.expandByPoint(T),T.applyMatrix4(h),C.min(T),P.max(T),T.copy(e[ve]),T.z-=o,T.applyMatrix4(h),C.min(T),P.max(T),T.copy(e[ve]),T.z+=o,T.applyMatrix4(h),C.min(T),P.max(T);let O=P.x-C.x,N=P.y-C.y,k=t-f.left-f.right,D=i-f.top-f.bottom,F=(P.x+C.x)/2,z=(P.y+C.y)/2,G=O/k,j=N/D,K=s,Z=a,oe=K*Math.tan(x)*2,Q=Z*Math.tan(x)*2,ge=oe/t,be=Q/t,pe=Math.max(G,j);pe=Ye.clamp(pe,ge,be);let _e=k*pe,yt=D*pe,it={min:{x:F-_e/2-f.left*pe,y:z-yt/2-f.bottom*pe},max:{x:F+_e/2+f.right*pe,y:z+yt/2+f.top*pe}},Xe=(it.min.x+it.max.x)/2,Ue=(it.min.y+it.max.y)/2,de=w.getCenter(new Ce),me=Math.abs(Xe-it.min.x),te=Math.abs(Ue-it.min.y),ie=me/Math.tan(x),A=te/Math.tan(v),Y=new Ce;Y.set(Xe,Ue,P.z+Math.max(ie,A)),Y.applyMatrix4(l.matrixWorld);let L=new Ce;L.set(Xe,Ue,P.z),L.applyMatrix4(l.matrixWorld);let le=new Ce().subVectors(L,Y),ne=(de.z-Y.z)/le.z,ae=new Ce().copy(Y).add(le.clone().multiplyScalar(ne));return L.set(ae.x,ae.y,ae.z),Y.sub(L),{position:ae,zoom:Y.length()}}p();var FCe=300,wb,Mb,tS=class{constructor(t){m(this,"state");M(this,wb,new Ce);M(this,Mb,new Ce);this.state=t}update(t){var o;let r,n;this.state.cameraObject.getWorldPosition(c(this,Mb));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,wb));let s=c(this,Mb).distanceTo(c(this,wb));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:FCe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};wb=new WeakMap,Mb=new WeakMap;p();var rS=class{constructor(){m(this,"percentExpanded",0);m(this,"activeId","");m(this,"gap",20);m(this,"dirty",!0)}};p();var nS=class extends De{constructor(r,n){super();m(this,"state");m(this,"dirty",!0);m(this,"domTree");m(this,"observers",new Map);m(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 aa&&(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()}};p();var LCe=0,RCe=90,NCe=(g.env.NODE_ENV==="test",!1),Sl={linear:kr.Linear.None,"ease-in":kr.Quadratic.In,"ease-out":kr.Quadratic.Out,"ease-in-out":kr.Quadratic.InOut},BCe=-50,Pe,Ne,zc,Ob,Eb,oO,oS=class{constructor(t,r,n){M(this,Eb);M(this,Pe);M(this,Ne);M(this,zc);M(this,Ob);_(this,Pe,t),_(this,Ne,r),_(this,zc,n),c(this,Ne).cameraSystem.on("pedestal-change",({pedestal:o})=>{c(this,Pe).map&&(c(this,Pe).map.transform.elevation=o,c(this,Pe).map.transform.minElevationForCurrentTile=BCe,c(this,Pe).map.triggerRepaint()),c(this,Ne).cameraSystem.setCameraPlaneElevation(o)})}get center(){return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?c(this,Pe).map.getCenter().toArray():c(this,Ne).cameraSystem.center}setCenter(t){var r;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map){(r=c(this,Pe).map)==null||r.setCenter(t),c(this,Ne).interactionSystem.handleHover();return}c(this,Ne).cameraSystem.setCenter(t[0],t[1]),c(this,Ne).interactionSystem.handleHover()}get zoomLevel(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getZoom():c(this,Ne).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map&&((r=c(this,Pe).map)==null||r.setZoom(t)),c(this,Ne).cameraSystem.setZoomLevel(bs(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,Ne).cameraSystem.isAnimating}cancelAnimation(){c(this,Ne).cameraSystem.cancelAnimation()}get maxZoomLevel(){return c(this,Ne).cameraSystem.maxZoomLevel}get minZoomLevel(){return c(this,Ne).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){c(this,Ne).panBoundsSystem.autoMinZoomLevel=t,t&&(c(this,Ne).panBoundsSystem.dirty=!0,c(this,Ne).panBoundsSystem.update())}get autoMinZoomLevel(){return c(this,Ne).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var o;r&&this.setAutoMinZoomLevel(!1);let n=bs(t,Ii.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Ii.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));c(this,Ne).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(o=c(this,Pe).map)==null||o.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=bs(t,this.minZoomLevel,Ii.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Ii.MAX_MERCATOR_ZOOM_LEVEL,"."));c(this,Ne).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=c(this,Pe).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getMaxPitch():Ye.radToDeg(c(this,Ne).cameraSystem.maxTilt)}get minPitch(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getMinPitch():Ye.radToDeg(c(this,Ne).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(LCe,t);(n=c(this,Pe).map)==null||n.setMinPitch(r),c(this,Ne).cameraSystem.minTilt=Ye.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(RCe,t);(n=c(this,Pe).map)==null||n.setMaxPitch(r),c(this,Ne).cameraSystem.maxTilt=Ye.degToRad(r)}get bearing(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getBearing():Ye.radToDeg(c(this,Ne).cameraSystem.getRotation())}setBearing(t){var r;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map){(r=c(this,Pe).map)==null||r.setBearing(t);return}c(this,Ne).cameraSystem.setRotation(Ye.degToRad(t))}get pitch(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getPitch():Ye.radToDeg(c(this,Ne).cameraSystem.getTilt())}setPitch(t){var r;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map){(r=c(this,Pe).map)==null||r.setPitch(t);return}c(this,Ne).cameraSystem.setTilt(Ye.degToRad(bs(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,Ne).cameraSystem.getPedestal()}setElevation(t){c(this,Ne).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return c(this,Ob)&&c(this,Ob).stop(),new Promise(n=>{var i;let o=c(this,Ne).cameraSystem.getPosition();o.z=t,c(this,Ne).cameraSystem.animateCamera({position:o},(r==null?void 0:r.duration)||300,Sl[(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,zc).insetsPadding}get panMode(){return c(this,Ne).cameraSystem.enablePan===!1&&c(this,Ne).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,Ne).cameraSystem.enablePan=!0,c(this,Ne).cameraSystem.enablePedestal=!1):(c(this,Ne).cameraSystem.enablePan=!1,c(this,Ne).cameraSystem.enablePedestal=!0))}setInsetPadding(t){c(this,zc).insetsPadding=Object.assign({},xh,t)}animateTo(t){var s,a,l,u,d,f;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map)return(f=c(this,Pe).map)==null||f.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:(u=t.pitch)!=null?u:this.pitch,duration:(d=t.duration)!=null?d:600}),Promise.resolve();let r=t.center?c(this,Pe).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?c(this,Ne).cameraSystem.convertZoomLevelToAltitude(bs(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?Ye.degToRad(t.bearing):void 0,i=t.pitch!==void 0?Ye.degToRad(bs(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 b;c(this,Ne).cameraSystem.animateCamera({position:r,zoom:n,rotation:o,tilt:i},t.duration||0,Sl[t.easing||"ease-in-out"],()=>{c(this,Ne).interactionSystem.handleHover(),h()},h,{interruptible:(b=t==null?void 0:t.interruptible)!=null?b:!0})})}getCameraFrameForCoordinates(t,r){let n=ee(this,Eb,oO).call(this,r||{},()=>Promise.resolve()),{pointCloud:o}=gX(t,c(this,Pe),c(this,zc).geometry3DMap);if(o.length===0)return $.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:s}=c(this,Ne).cameraSystem.getCameraFrameForCoordinates(o,n);return{center:c(this,Pe).convert3DMapPositionToCoordinate(i),zoomLevel:s}}focusOn(t,r){var s,a,l,u;let{pointCloud:n,geoBounds:o,firstPosition:i}=gX(t,c(this,Pe),c(this,zc).geometry3DMap);return n.length===0?($.error("No valid coordinates found in targets:",t),Promise.resolve()):c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(n.length===1&&i?(s=c(this,Pe).map)==null||s.flyTo({center:[i[0],i[1]],duration:(r==null?void 0:r.duration)||c(this,Pe).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?c(this,Pe).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?c(this,Pe).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||c(this,Pe).map.getMaxZoom()}):(NCe&&$Ce(c(this,Pe),o),(u=c(this,Pe).map)==null||u.fitBounds(o,{duration:(a=r==null?void 0:r.duration)!=null?a:Ii.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?c(this,Pe).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?c(this,Pe).map.getPitch():r==null?void 0:r.pitch,maxZoom:(l=r==null?void 0:r.maxZoomLevel)!=null?l:c(this,Pe).map.getMaxZoom()})),c(this,Ne).interactionSystem.handleHover(),Promise.resolve()):new Promise(d=>{c(this,Ne).cameraSystem.focusOn(n,ee(this,Eb,oO).call(this,r||{},d))})}};Pe=new WeakMap,Ne=new WeakMap,zc=new WeakMap,Ob=new WeakMap,Eb=new WeakSet,oO=function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:c(this,Ne).cameraSystem.convertZoomLevelToAltitude(bs(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,Ne).cameraSystem.convertZoomLevelToAltitude(bs(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({},xh,t==null?void 0:t.padding):this.insetsPadding,curve:Sl[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Ye.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Ye.degToRad(bs(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,Ne).interactionSystem.handleHover(),r()},cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}};function nO(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 gX(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 u=r.get(l);if(!u){$.error("Entity not found with id:",l);continue}let d=new Xr;EE(t,"userData"in u&&(a=u.userData.entityId)!=null?a:u.id,n,d,u instanceof ct?u.position.z:void 0);let f=t.convert3DMapPositionToCoordinate(d.min),h=t.convert3DMapPositionToCoordinate(d.max);nO(o,f),nO(o,h),i||(i=t.convert3DMapPositionToCoordinate(d.getCenter(new Ce)))}else n.push(t.convertTo3DMapPosition(l[1],l[0],l[2]||0)),nO(o,l),i||(i=l);return{pointCloud:n,geoBounds:o,firstPosition:i}}function $Ce(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}})}p();var bX="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";var vX="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}";p();var xX=4.291666666666667,IX=15,SX=25,CX=43/60;p();var PX=["horizontal","icon"],UCe=new Map([[PX[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>'],[PX[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>']]),VCe=/<svg([^>]*)>/g;function TX(e,t,r,n){let o=UCe.get(e);return o?o.replace(VCe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var wX=!1,zt,Cl,Hm,Nn,ro,ed,rs,da,iS=class extends De{constructor(r,n,o){super();M(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});M(this,Cl);M(this,Hm);M(this,Nn);M(this,ro);M(this,ed);M(this,rs,0);M(this,da,0);m(this,"dirty",!0);m(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]);m(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)}),_(this,Hm,r),_(this,Cl,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?IX:75}get defaultWidth(){return c(this,zt).iconOnly?SX:150}get aspectRatio(){return c(this,zt).iconOnly?CX:xX}get options(){return{...c(this,zt)}}set options(r){var n;_(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:r.visible||c(this,zt).visible})}get icon(){return TX(this.iconName,this.color,c(this,rs)*c(this,Cl).pixelRatio,c(this,da)*c(this,Cl).pixelRatio)}setSize(r,n){c(this,ro)&&(c(this,ro).uniforms.uSize.value.x=r,c(this,ro).uniforms.uSize.value.y=n)}setXY(r,n){c(this,ro)&&(c(this,ro).uniforms.uSize.value.w=r,c(this,ro).uniforms.uSize.value.z=n)}get width(){return c(this,rs)}get height(){return c(this,da)}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,ed)!=null&&typeof c(this,zt).onClick=="function"&&c(this,zt).interactive&&r.insert(c(this,ed))}resize(r,n){if(c(this,zt).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(r,n),i=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(c(this,rs),c(this,da)),a=Math.min(r-c(this,rs),Math.max(0,o.x+i.x+s.x)),l=Math.min(n-c(this,da),Math.max(0,o.y+i.y+s.y));this.setSize(c(this,rs)/r,c(this,da)/n),this.setXY(a/r,l/n),_(this,ed,new Hr(a,l,c(this,rs),c(this,da),{entityId:"watermark"}))}update(){this.dirty&&c(this,zt).visible===!0&&(_(this,rs,Math.min(c(this,Cl).canvasWidth,Math.max(this.minWidth,this.defaultWidth*c(this,zt).scale))),_(this,da,c(this,rs)/this.aspectRatio),Uc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(_(this,ro,new pu({uniforms:{uTexture:{value:r},uSize:{value:new JO(0,0,0,0)},uOpacity:{value:.7}},vertexShader:bX,fragmentShader:vX,depthWrite:!1,depthTest:!1,defines:{debug:wX},wireframe:wX,transparent:!0,visible:!0})),c(this,Nn))c(this,Nn).material=c(this,ro),c(this,Nn).material.needsUpdate=!0;else{let n=new Ti(2,2,1,1);_(this,Nn,new Ve(n,c(this,ro))),c(this,Nn).position.set(0,0,-1),c(this,Nn).frustumCulled=!1,c(this,Nn).renderOrder=999;let o=new Pi(1,1,1),i=new Ve(o,new $r({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),c(this,Nn).add(i),c(this,Hm).add(c(this,Nn))}this.resize(c(this,Cl).canvasWidth,c(this,Cl).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){c(this,Nn)&&(c(this,Hm).remove(c(this,Nn)),mr(c(this,Nn))),_(this,Nn,void 0),c(this,ro)&&c(this,ro).dispose(),_(this,ro,void 0),_(this,ed,void 0)}};zt=new WeakMap,Cl=new WeakMap,Hm=new WeakMap,Nn=new WeakMap,ro=new WeakMap,ed=new WeakMap,rs=new WeakMap,da=new WeakMap;p();var sS=100,WCe=!1,lS=class extends De{constructor(r,n){super();m(this,"currentTotalBoundingBox");m(this,"state");m(this,"cameraSystem");m(this,"debugMesh",null);m(this,"dirty",!0);m(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Xr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new Ce(0,0,0),new Ce(sS*2,sS*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(sS)));let r=new Xr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new Ce),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=aS.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,sS)).getBoundingSphere(qCe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new Ce),min:aS.min,max:aS.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,WCe&&this.state.entityScene.parent instanceof Vl){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Pa,this.debugMesh.add(new Ve(new K1(this.cameraSystem.panBounds.radius),new $r({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let s=new Ce;aS.getSize(s);let a=new Pi(s.x,s.y,s.z),l=new $r({color:65280,wireframe:!0,transparent:!0,opacity:.5}),u=new Ve(a,l);u.position.copy(this.currentTotalBoundingBox.getCenter(new Ce)),this.debugMesh.add(u)}}}},aS=new Xr,qCe=new eE;p();var MX="\xA9 Mappedin",ZCe="https://info.mappedin.com/feedback",sO=["top-left","top-right","bottom-left","bottom-right"],XCe=640,YCe=()=>"<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>",iO={custom:[],position:"bottom-right",feedback:!0},cS=class{constructor(t){m(this,"controlContainerEl");m(this,"controlPositions");m(this,"compact");m(this,"attribContainerEl");m(this,"attribInnerEl");m(this,"attribButtonEl");m(this,"feedbackLinkEl");m(this,"attribHTML",MX);m(this,"customAttributions",[]);m(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=sO.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=iO){var o;let r=t.position&&sO.includes(t.position)?t.position:iO.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=YCe(),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:iO.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=ZCe,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=[MX],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<=XCe||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}};p();var _b,Wm=class{constructor(t,r){m(this,"mesh");m(this,"type","custom-geometry");m(this,"dirty",!0);m(this,"feature");m(this,"builder");m(this,"outline");m(this,"color",new Ft);M(this,_b,0);this.mesh=new Mi,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){$.warn("TODO: implement custom geometry opacity")}get opacity(){return $.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return c(this,_b)}set altitude(t){this.mesh&&(this.mesh.position.z=t,_(this,_b,t))}get renderOrder(){return $.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){$.warn("TODO: implement custom geometry render order")}};_b=new WeakMap;p();var uS=class{constructor(t,r){m(this,"state");m(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(n);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],r=o.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(i=>{i.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};p();p();function OX(e){return e.children.some(t=>t.userData.isOutline)}var QCe=80,td,qm,dS,fS,pS=class{constructor(t){m(this,"rendererState");m(this,"outlineOpacitiesDirty",!0);M(this,td,!0);M(this,qm,-1/0);M(this,dS,new Map);M(this,fS,new WS({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:q1}));this.rendererState=t}get geometries3DDirty(){return c(this,td)}set geometries3DDirty(t){_(this,td,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),n instanceof In&&n.components[0].outline&&n.visible&&!OX(n)&&n.userData.entities3D.size>0)for(let s of n.userData.entities3D.values()){let a=this.rendererState.geometry3DMap.get(s),l=[];if(a instanceof Tt&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].geometry!=null&&a.components[0].material!=null){let I=a.components[0].geometry;if(!I)return null;l.push([a.components[3],new qS(I,QCe)])}let u=Ho(l.map(I=>I[1]),!1);if(u==null)continue;let d=u.getAttribute("position"),f=new Float32Array(d.count*4),h=new Ta(f,4);u.setAttribute("color",h);let b=0;for(let I=0;I<l.length;I++){let[x,C]=l[I],P=C.getAttribute("position").count;x.edgeColors=h,x.geometry=u,x.ranges={count:P,start:b},b+=P,C.dispose()}let v=new Pd(u,c(this,fS));v.userData.isOutline=!0,n.add(v)}_(this,td,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let s=this.rendererState.geometry3DMap.get(i);if(s instanceof Tt&&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 u=l.edgeColors;if(!u)continue;let d=new Ft(l.color);for(let I=0;I<l.ranges.count;I++){let x=l.ranges.start+I;u.setXYZ(x,d.r,d.g,d.b)}let f=s.components[1].height,b=a.getAttribute("position").array,v=-1/0;for(let I=0;I<l.ranges.count;I++){let C=(l.ranges.start+I)*3,P=b[C+2];v=Math.max(v,P)}for(let I=0;I<l.ranges.count;I++){let C=(l.ranges.start+I)*3,P=b[C+2];Math.abs(P-v)<1e-4&&(b[C+2]=Math.max(f,2e-4))}a.attributes.color.needsUpdate=!0,a.attributes.position.needsUpdate=!0,l.dirty=!1}}let o=r?Ss(t,16,19,0,1):c(this,qm);if((o!==c(this,qm)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof yr){let s=n.components[3];if(s&&s.edgeColors&&s.geometry){let a=s.visible,l=Math.min(o,a?n.components[1].opacity*yu(n):0);if(s.currentOpacity!==l){for(let u=0;u<s.ranges.count;u++){let d=s.ranges.start+u;s.edgeColors.setW(d,l)}s.geometry.attributes.color.needsUpdate=!0}}}}_(this,qm,o),_(this,td,!1),this.outlineOpacitiesDirty=!1}destroy(){c(this,dS).clear()}};td=new WeakMap,qm=new WeakMap,dS=new WeakMap,fS=new WeakMap;p();p();var mS=class extends Ve{constructor(){super(...arguments);m(this,"userData",{entityId:""})}},ePe=B.object({flipImageToFaceCamera:B.boolean().optional(),url:B.string()}),tPe=B.object({type:B.enum(["Feature"]),properties:B.object({width:B.number(),height:B.number(),rotation:B.number().min(0).max(360).optional(),verticalOffset:B.number().optional()}),geometry:Um});function EX(e,t,r){B.union([B.number(),B.string()]).parse(e),tPe.parse(t),ePe.parse(r)}var hS=class{constructor(t){m(this,"mesh",new Mi);m(this,"imageMesh");m(this,"outline");m(this,"type","image");m(this,"instanceIndex",-1);m(this,"geometry");m(this,"material");m(this,"feature");m(this,"position",new Ce);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)}};p();function aO(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 rPe(e,t){return e.map(r=>aO(r,t))}function nPe(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 oPe(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 _X(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 iPe(e,t,r){let n=e.maxX-e.minX,o=e.maxY-e.minY,i,s,a={...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 sPe(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};oPe(l,e)&&(i[s][a]=1)}return i}function aPe(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)&&_X(e,o,n,s,s);s++)i=s;r[n][o]=i}return r}function lPe(e,t,r,n,o,i){let s=0,a=0,l=0;for(let u=0;u<n;u++)for(let d=0;d<n;d++)if(e[u][d]===1){let f=Math.pow(t[u][d],2),h=r.minX+d*o,b=r.minY+u*i;s+=f,a+=h*f,l+=b*f}return{x:a/s,y:l/s}}function cPe(e,t,r,n,o,i,s){let a=-1/0,l=null,u=e.length,d=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let f=0;f<u;f++)for(let h=0;h<u;h++)if(e[f][h]===1)for(let b=1;b<=u-h;b++){let v=b;if(!(v>u-f)&&_X(e,h,f,b,v)){let I=b*v,x=t.minX+(h+b/2)*r,C=t.minY+(f+v/2)*n,P={x,y:C},T=Math.sqrt(Math.pow(P.x-o.x,2)+Math.pow(P.y-o.y,2))/d,O=I*(1-i)-T*i*I;O>a&&(a=O,l={center:P,width:b*r*s,height:b*n*s})}}return l}function lO(e,t,r,n={}){let{scaleFactor:o=.9,centerPriority:i=.5,resolution:s=100,minimumSizeRatio:a=.5}=n,l=fE(r),u=e.width/e.height,d=rPe(t,l),f=nPe(d),{dx:h,dy:b,gridBounds:v}=iPe(f,u,s),I=sPe(d,v,s,h,b),x=aPe(I,s),C=lPe(I,x,v,s,h,b),P=cPe(I,v,h,b,C,i,o);return!P||P.width<e.width*a||P.height<e.height*a?e:{...P,center:aO(P.center,-l),rotation:r,polygonCenter:aO(C,-l)}}var Ab=Math.PI*2,uPe=Math.PI/2,pPe=Math.PI*1.5,dPe=wd(uPe,2),fPe=wd(pPe,2),mPe=.01,AX=!1,yS=class extends De{constructor(r,n,o=0,i=0,s={}){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"initialBearing",0);m(this,"naturalBearing",0);m(this,"imagePlacementOptions");m(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=o,this.naturalBearing=i,this.imagePlacementOptions=s}createImageMesh(r,n,o,i=0,s,a){var v,I,x;let l={width:o.width,height:o.height,center:this.convertTo3DMapPosition(s),rotation:(v=o.rotation)!=null?v:0},u=(I=this.imagePlacementOptions.mode)!=null?I:"default",d=(()=>{switch(u){case"fit-nearest-90":let C=(this.initialBearing-this.naturalBearing+360)%180;return C>=45&&C<=135?lO(l,a,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return lO(l,a,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if(AX&&d.polygonCenter){let C=new Ve(new K1(1),new wi({color:65280}));C.position.set(d.polygonCenter.x,d.polygonCenter.y,i),this.rendererState.entityScene.add(C)}let f=new wi({transparent:!0,depthWrite:!1,side:Ia}),h=new Ti(d.width,d.height),b=new mS(h);if(b.visible=!1,(x=this.getOrDownloadImage(n))==null||x.then(C=>{f.map=C,f.needsUpdate=!0,f.map.colorSpace=Sa,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=r,b.material=f,AX){let C=new Ve(new Ti(o.width,o.height),new wi({color:"gray"}));b.add(C);let P=new pE;b.add(P),P.scale.set(10,10,10)}return b.position.set(d.center.x,d.center.y,i+mPe),b.rotation.z=(-Ye.degToRad(d.rotation)+Ab)%Ab,b}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let o=new Promise(i=>{Uc.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=wd((i-o+Ab)%Ab,2);s>dPe&&s<fPe&&(r.imageMesh.rotation.z=(i+Math.PI)%Ab)}update(r){var s,a,l,u,d;let n,o,i;for(let f of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(f),(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),b={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,[b]),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)}o.imageMesh&&i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}else if((n==null?void 0:n.type)==="geometry"){if(o=n.components[0],i=n.components[1],i.showImage&&((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}}),b=this.createImageMesh(f,(l=o.feature.properties)==null?void 0:l.image.path,(u=o.feature.properties)==null?void 0:u.image,i.height,(d=o.feature.properties)==null?void 0:d.image.position,h);o.mesh.parent.add(b),o.imageMesh=b}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(i.showImage&&!o.imageMesh.visible)if(i.url){let 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)}}}};p();var hPe=250,Hc,gS=class extends De{constructor(r,n){super();m(this,"cameraDirty",!0);m(this,"focusablesDirty",!0);m(this,"state");m(this,"camera");m(this,"debugEl",null);m(this,"raycasters",[]);m(this,"collisions",new Map);m(this,"focusableEntities",new Set);m(this,"debugRaycasters",!1);M(this,Hc);m(this,"update",(r=!1,n=Date.now())=>{r||Date.now()-n>hPe||(c(this,Hc)&&cancelAnimationFrame(c(this,Hc)),_(this,Hc,requestAnimationFrame(()=>{this.updateRaf()})))});this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new Ee(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new Ee(r.x/1.2,r.y/1.2),o=new Ee(r.x+(r.x-n.x),n.y),i=new Ee(n.x,r.y+(r.y-n.y)),s=new Ee(o.x,i.y),a=new Ee(r.x,r.y/1.5),l=new Ee(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((u,d)=>{if(this.debugRaycasters){let I=document.createElement("div");I.style.position="absolute",I.style.top=u.y+"px",I.style.left=u.x+"px",I.style.width="10px",I.style.height="10px",I.style.backgroundColor="red",this.debugEl.append(I)}let f=u.x/this.state.canvasWidth*2-1,h=-(u.y/this.state.canvasHeight)*2+1,b=new Ee(f,h),v=new gs;return v.setFromCamera(b,this.camera),[v,b,d===0?10:d<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n;for(let o of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(o),n!=null){if(n.type==="group-container"&&n.components[2]!==void 0&&n.components[2]instanceof $m){let i=n.components[2];if(i.dirty===!0||i.focusMesh==null){i.focusMesh&&mr(i.focusMesh);let s=new Xr;s.setFromObject(n);let a=new Pi(s.max.x-s.min.x,s.max.y-s.min.y,s.max.z-s.min.z),l=new $r({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),u=new Ve(a,l);u.position.set((s.min.x+s.max.x)/2,(s.min.y+s.max.y)/2,(s.min.z+s.max.z)/2),u.userData={entityId:n.userData.entityId},i.focusMesh=u,n.add(u),n.components[2].dirty=!1}this.focusableEntities.add(i.focusMesh)}else if(n.components[0]&&n.components[0]instanceof yr&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof yr&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let i=new Ve(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 u=a.object.userData.entityId,d=(l=this.collisions.get(u))!=null?l:0;this.collisions.set(u,d+i)}});let r=Array.from(this.collisions,([n,o])=>({entityId:n,weight:o})).sort((n,o)=>o.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){c(this,Hc)&&cancelAnimationFrame(c(this,Hc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Hc=new WeakMap;p();p();p();p();function bS(e,t){t===void 0&&(t={});var r=jf(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return yPe(r,t);case"MultiPolygon":return gPe(r,t);default:throw new Error("invalid poly")}}function yPe(e,t){t===void 0&&(t={});var r=jf(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{};return kX(n,o)}function gPe(e,t){t===void 0&&(t={});var r=jf(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{},i=[];return n.forEach(function(s){i.push(kX(s,o))}),mu(i)}function kX(e,t){return e.length>1?gE(e,t):wa(e[0],t)}function bPe(e,t){var r=!0;return xs(e,function(n){xs(t,function(o){if(r===!1)return!1;r=vPe(n.geometry,o.geometry)})}),r}function vPe(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!CPe(e.coordinates,t.coordinates);case"LineString":return!DX(t,e);case"Polygon":return!cl(e,t)}break;case"LineString":switch(t.type){case"Point":return!DX(e,t);case"LineString":return!xPe(e,t);case"Polygon":return!FX(t,e)}break;case"Polygon":switch(t.type){case"Point":return!cl(t,e);case"LineString":return!FX(e,t);case"Polygon":return!IPe(t,e)}}return!1}function DX(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(SPe(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function xPe(e,t){var r=Jf(e,t);return r.features.length>0}function FX(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var o=n[r];if(cl(o,e))return!0}var i=Jf(t,bS(e));return i.features.length>0}function IPe(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var o=n[r];if(cl(o,t))return!0}for(var i=0,s=t.coordinates[0];i<s.length;i++){var a=s[i];if(cl(a,e))return!0}var l=Jf(bS(e),bS(t));return l.features.length>0}function SPe(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 CPe(e,t){return e[0]===t[0]&&e[1]===t[1]}var LX=bPe;function cO(e,t){var r=!1;return xs(e,function(n){xs(t,function(o){if(r===!0)return!0;r=!LX(n.geometry,o.geometry)})}),r}var RX=20,Wc,rd,nd,xS,kb,vS=class{constructor(t){m(this,"dirty",!0);m(this,"map");m(this,"stylesheetId","");m(this,"userHiddenLayers",new Set);m(this,"hiddenLayersInStyle",new Set);m(this,"centerPoint");m(this,"bbox");m(this,"polygons");m(this,"handleRender",async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(c(this,Wc)&&(c(this,xS).call(this),_(this,Wc,!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=[],_(this,Wc,!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){_(this,Wc,!0);for(let r=0;r<t.length;r+=RX){let n=t.slice(r,r+RX);c(this,rd).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=r0(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(i=bE(o.geometry.coordinates)),!i)continue;for(let s of this.polygons)if(cO(s,i)){this.expr.push(["!=",["id"],o.id]);continue}}})}c(this,kb).call(this)}}}});m(this,"expr",[]);M(this,Wc,!1);M(this,rd,[]);M(this,nd,null);M(this,xS,()=>{c(this,nd)&&(globalThis.cancelAnimationFrame(c(this,nd)),_(this,nd,null)),_(this,rd,[])});M(this,kb,()=>{let t=c(this,rd).pop();typeof t=="function"&&(t(),c(this,rd).length>0&&_(this,nd,globalThis.requestAnimationFrame(c(this,kb)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],_(this,Wc,!1)});m(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=r0(i.geometry.coordinates);o.push(s)}else i.geometry.type==="MultiPolygon"&&o.push(...i.geometry.coordinates.map(s=>r0(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))}};Wc=new WeakMap,rd=new WeakMap,nd=new WeakMap,xS=new WeakMap,kb=new WeakMap;p();p();p();var uO="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // `nearRadius` to `farRadius` when the camera is at `farZoom`.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";var pO='#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of `pathRadius`. Since we\'ve\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered "long", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered "short", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path\'s length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the `complete` value as it varies from 0.0 to 1.0.\n // Fragments that are at the `complete` value or past it will be fully\n // transparent, while fragments that are at `complete - completeLength`\n // or before it will be fully opaque. However, we adjust the `complete`\n // value here so that it overshoots by one full `completeLength`, so that\n // the entire path will be opaque when the `complete` value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at `arrowMargin` instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // "zooming off" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as `arrowAnimationTimer` goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a "looping sawtooth" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the "looping" design is preferred is because\n // it takes advantage of WebGL\'s `GL_REPEAT` texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from `pulse`\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the `pulse` value and whether it\'s covered by an arrow -- but if it\'s\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like "holes" when they\'re overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}';var NX="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 MPe=new Td;function BX(e,t,r){let{nearRadius:n,farRadius:o,accentColor:i,completeFraction:s,isVertical:a}=t,{color:l}=r,u=!0,d=0,f=1/0,h=t.displayArrowsOnPath,b=!a,v=!0,I=h,x=n/2+OPe,C=0;e[0].z+=x;for(let te=1;te<e.length;++te){e[te].z+=x;let ie=e[te].x-e[te-1].x,A=e[te].z-e[te-1].z;if(a)C+=Math.sqrt(ie*ie+A*A);else{let Y=e[te].y-e[te-1].y;C+=Math.sqrt(ie*ie+Y*Y+A*A)}}if(!a){let te=e[0],ie=e[e.length-1];e.push(ie.clone().setZ(ie.z-.01)),e.unshift(te.clone().setZ(te.z-.01))}let P=new KO;I&&(P=MPe.load(NX),P.colorSpace=Sa);let w=new Ft(l),T=new Ft(i),O={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Ee(1,1)},cameraParameters:{type:"v2",value:new Ee(d,0)},complete:{type:"f",value:u?0:1},color:{type:"c",value:w},pathLength:{type:"f",value:C},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:d},farZoom:{type:"f",value:f},pulseColor:{type:"c",value:T},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:a},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:P},displayArrowsOnPath:{type:"b",value:h},flattenFactor:{type:"f",value:b?.05:1},showPulse:{type:"b",value:v},opacityMultiplier:{type:"f",value:1}},N=new iE(e);N.curveType="catmullrom",N.tension=0;let k=30,D=8,F=k*e.length,z=new sE(N,F,n,D,!1),G=new Float32Array(z.attributes.position.count);for(let te=e.length;te<G.length;te++)G[te]=te;z.setAttribute("vertexIndex",new Ta(G,1));let j=new Float32Array(z.attributes.position.count),K=new Ta(j,1);for(let te=0;te<=F;te++)for(let ie=0;ie<=D;++ie)K.setX(te*(D+1)+ie,te/F);z.setAttribute("pathDistance",K);let Z=new Float32Array(z.attributes.normal.count*3),oe=new Ta(Z,3);for(let te=0;te<F;te++){let ie=z.tangents[te];for(let A=0;A<=D;++A)oe.setXYZ(te*(D+1)+A,ie.x,ie.y,ie.z)}z.setAttribute("pathTangent",oe);let Q=new Float32Array(z.attributes.normal.count*3),ge=new Ta(Q,3);for(let te=0;te<F;te++){let ie=z.tangents[te];var be,pe,_e;a?(be=ie.x*ie.y,pe=-1+ie.y*ie.y,_e=ie.z*ie.y):(be=-ie.x*ie.z,pe=-ie.y*ie.z,_e=1-ie.z*ie.z);let A=Math.sqrt(be*be+pe*pe+_e*_e);A===0&&(A=1);let Y=be/A,L=pe/A,le=_e/A;for(let ne=0;ne<=D;++ne)ge.setXYZ(te*(D+1)+ne,Y,L,le)}z.setAttribute("pathNormal",ge);let yt=new pu({uniforms:O,vertexShader:uO,fragmentShader:pO});yt.transparent=!0,yt.alphaTest=.5,O.resolution.value.x=1,O.resolution.value.y=1,O.vertexes.value=G.length,O.arrowTexture.value.wrapS=ms,O.arrowTexture.value.wrapT=ms,O.arrowTexture.value.anisotropy=16,O.complete.value=s;let it=new Ve(z,yt),Xe=it.clone(),Ue={...O,opacityMultiplier:{type:"f",value:.25}};Ue.complete.value=1,Xe.material=new pu({uniforms:Ue,vertexShader:uO,fragmentShader:pO}),Xe.material.transparent=!0,Xe.material.alphaTest=.5,Xe.material.depthWrite=!1,Xe.material.depthTest=!1,Xe.renderOrder=1,Ue.resolution.value.x=1,Ue.resolution.value.y=1,Ue.vertexes.value=G.length,Ue.arrowTexture.value.wrapS=ms,Ue.arrowTexture.value.wrapT=ms,Ue.arrowTexture.value.anisotropy=16,Ue.complete.value=s,it.userData=Xe.userData=t.mesh.userData;let de=t.mesh;de.add(it),de.add(Xe),z.computeBoundingBox();let me=new Ce;return z.boundingBox.getCenter(me),{mesh:de,material:yt,center:me}}var OPe=.15;var Db=class extends De{constructor(r,n,o,i){super();m(this,"rendererState");m(this,"altitudeDirty",!0);m(this,"convertTo3DMapPosition");m(this,"getParentContainer");m(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=o,this.convertZoomLevelToAltitude=i}update(r,n,o){let i,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],u=i.components[1],d=l.isVertical&&this.altitudeDirty;if(!(l instanceof Vc))continue;if(l.dirty||d){if(l.mesh.parent!=null)for(let h=l.mesh.children.length-1;h>=0;h--)mr(l.mesh.children[0]);let f=[];if(l.feature.features.forEach(h=>{let b=h.geometry.coordinates[2]||0,v;if(h.properties.parentId&&(v=this.getParentContainer(h.properties.parentId,!0),v!=null&&v.altitude!=null&&(b+=v.altitude,l.isVertical=!0)),!h.properties.parentId||v!=null&&v.visible){let I=this.convertTo3DMapPosition(h.geometry.coordinates[1],h.geometry.coordinates[0],b);f.push(I)}}),f.length>1){let{mesh:h,material:b,center:v}=BX(f,l,{color:u.color});l.mesh=h,l.material=b,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}u.dirty&&(l.mesh.children.forEach(f=>{f.material.uniforms.color.value.set(u.color),f.material.needsUpdate=!0}),l.mesh.position.z=u.altitude,u.dirty=!1),l.material&&(l.mesh.children.forEach(f=>{var b,v;let h=f.material.uniforms;h.nearZoom.value=(b=l.nearZoomAltitude)!=null?b: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),f.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(f=>{f.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,f.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};p();var Zr,Zm,Pl,IS=class{constructor(t){m(this,"rendererState");m(this,"dirty",!1);M(this,Zr);M(this,Zm);M(this,Pl);this.rendererState=t}updateOne(t){if(t instanceof Tt&&t.components[0]instanceof yr&&t.components[1]instanceof Is&&t.parentObject3D instanceof In&&(_(this,Zr,t.components[0]),_(this,Pl,t.components[1]),c(this,Zr).detached&&c(this,Zr).dirty&&c(this,Zr).geometry!=null&&c(this,Zr).material!=null)){_(this,Zm,t.parentObject3D),c(this,Zr).visible=!1;let r=new Ft(c(this,Pl).color),n=c(this,Pl).opacity*yu(t),o=new Wp({color:r,side:Ia,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,c(this,Zr).material.repeatYFactor),i=new n0(1,c(this,Zr).geometry.attributes.position.count||0,0,o),s=i.addGeometry(c(this,Zr).geometry);i.addInstance(s),i.userData={entities:{0:t.id},detached:!0},c(this,Zr).instanceIndex=s,c(this,Zr).material.setColor(c(this,Zr).instanceIndex,r,c(this,Pl).topColor?new Ft(c(this,Pl).topColor):r),c(this,Zr).mesh=i,c(this,Zr).material=o,c(this,Zm).add(i),c(this,Zr).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(){_(this,Zr,void 0),_(this,Zm,void 0),_(this,Pl,void 0)}};Zr=new WeakMap,Zm=new WeakMap,Pl=new WeakMap;p();p();function $X(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 od,qc,SS=class{constructor(t){m(this,"rendererState");m(this,"dirty",!1);M(this,od);M(this,qc);this.rendererState=t}updateOne(t){var r;t instanceof Tt&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(_(this,od,t.components[0]),_(this,qc,t.components[1]),t.type==="geometry"&&c(this,qc).height!==c(this,od).currentHeight&&$X(c(this,od),c(this,qc).height,c(this,qc).initialHeight))}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){_(this,od,void 0),_(this,qc,void 0)}};od=new WeakMap,qc=new WeakMap;p();var EPe={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},CS=class{constructor(t){m(this,"state",EPe);m(this,"core");this.core=t}update(t){let r={};for(let[n,o]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=o,r[n]=o);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};p();var Fb=9,_Pe=!1,jX=.1;function APe(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 PS=class{constructor(t,r,n){m(this,"state");m(this,"renderer");m(this,"renderService");m(this,"pickingTexture");m(this,"pickingMaterial");m(this,"pixelBuffer");m(this,"width",0);m(this,"height",0);m(this,"scale",1/2);m(this,"color",1);m(this,"convertTo3DMapPosition");m(this,"destroyed",!1);m(this,"enabled",!1);m(this,"backgroundId",16777215);m(this,"resize",()=>{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 QO(this.width,this.height,{format:Z1,type:qO,internalFormat:"RGBA"})});m(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});m(this,"activeOccluders",new Set);m(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 ct&&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=NI(t,this.convertTo3DMapPosition,{color:"white",height:jX});r=this.createOccluderMesh(s,i.userData.occluderId),i.add(r)}else if(t.geometry.type==="MultiPolygon"){let s=BI(t,this.convertTo3DMapPosition,{color:"white",height:jX});r=this.createOccluderMesh(s,i.userData.occluderId),i==null||i.add(r)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Ft(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(Fb),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(Fb),_Pe?this.renderService.enabledLayers.add(Fb):this.renderService.enabledLayers.delete(Fb),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),u=this.shouldShowByXY(a,l,i.occluderId);i.components[0].isOccluded=!u}}})});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 pu({glslVersion:YO,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);APe(o,n.count,r),t.setAttribute("color",new Ta(o,3))}createOccluderMesh(t,r){let n=new Ve(t,this.pickingMaterial);return n.layers.set(Fb),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 GX=new gs;var{DEFAULT_PITCH:yO,DEFAULT_BEARING:gO,DEFAULT_ZOOM_LEVEL:bO,DEFAULT_MIN_ZOOM_LEVEL:kPe,DEFAULT_MAX_ZOOM_LEVEL:DPe}=Ii,FPe=Ye.radToDeg(.6435011087932844),Tr,Ir,id,Lb,Xm,Zc,sd,Ym,bn,fO,V,jt,ns,Sr,fa,tn,U,Rb,Nr,Ht,UX,VX,zX,Xc,Nb,Bb,$b,jb,TS,Gb,Ub,Vb,Km,mO,ad,zb,no,oo,hO,Jm,Hb,dO=class extends De{constructor(r,n={}){var h,b,v,I,x,C,P,w,T,O,N;super();M(this,bn);m(this,"options");m(this,"container");m(this,"Debug");M(this,Tr);M(this,Ir);M(this,id);M(this,Lb);M(this,Xm);M(this,Zc);M(this,sd);M(this,Ym);m(this,"rendererDomElement");M(this,V,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new ct("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:xh,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new q5,cameraObject:new HS,naturalBearing:0,containerOffset:[0,0]});m(this,"camera");M(this,jt);M(this,ns);M(this,Sr);M(this,fa);M(this,tn);M(this,U,{});M(this,Rb,window.matchMedia("screen and (min-resolution: 2dppx)"));m(this,"map");M(this,Nr,()=>{c(this,U).renderSystem.twoDdirty=!0});M(this,Ht,()=>{c(this,U).renderSystem.threeDdirty=!0});M(this,Xc,"standalone");M(this,Nb,r=>Math.trunc(r*10)/10);M(this,Bb,()=>{c(this,U).twoDDrawSystem.dirty=!0,ee(this,bn,fO).call(this,Od()),c(this,U).watermarkSystem.dirty=!0,c(this,U).occlusion2DSystem.resize(),this.render()});M(this,$b,()=>{c(this,jb).call(this)});M(this,jb,(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,V).canvasWidth=o,c(this,V).canvasHeight=i,ee(this,bn,fO).call(this,Od()),c(this,Km).call(this),ee(this,bn,zX).call(this),c(this,U).cameraSystem.resize(this.canvasWidth,this.canvasHeight),c(this,U).cameraSystem.dirty=!0,c(this,U).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),c(this,U).htmlControlsSystem.resize(this.canvasWidth),c(this,U).geometryInFocusSystem.resize(),c(this,U).occlusion2DSystem.resize();let{top:s,left:a}=this.container.getBoundingClientRect();c(this,V).containerOffset=[s,a],this.publish("resize"),this.render()});M(this,TS,()=>{this.renderSync()});M(this,Gb,new Ce);M(this,Ub,(r,n)=>{let o=this.mode==="standalone"?c(this,Ir):this.viewCamera;if(c(this,Ir).position.z+this.camera.elevation>n.z){c(this,Gb).copy(n);let i=c(this,Gb).project(o),s=(i.x+1)/2*this.canvasWidth-0/2,a=(-i.y+1)/2*this.canvasHeight-0/2,l=c(this,Nb).call(this,s),u=c(this,Nb).call(this,a);r.x=l,r.y=u}else r.x=-1e3,r.y=-1e3});M(this,Vb,(r,n)=>{c(this,tn).setBufferSize(r,n),c(this,Ir).aspect=r/n,c(this,Ir).updateProjectionMatrix(),c(this,Ir).updateMatrixWorld(!0),c(this,Xm).x=r,c(this,Xm).y=n});M(this,Km,()=>{var s;let r=c(this,V).canvasWidth=this.rendererDomElement.clientWidth,n=c(this,V).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(r*this.resolutionScale),i=Math.floor(n*this.resolutionScale);c(this,Vb).call(this,o,i),(s=this.map)==null||s.resize(),c(this,V).shouldMeasureCanvas=!1});m(this,"getParentContainer",(r,n=!0)=>{if(!r)return n?c(this,V).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let o=c(this,V).geometry3DMap.get(r);return o instanceof ct?o:($.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?c(this,V).entityScene:void 0)}else if(r.type==="group-container"){let o=c(this,V).geometry3DMap.get(r.id);if(o instanceof ct)return o}return n?c(this,V).entityScene:void 0});m(this,"showCollisionBoxes",()=>{c(this,U).collisionSystem.showCollisionBoxes(),this.render()});m(this,"hideCollisionBoxes",()=>{c(this,U).collisionSystem.hideCollisionBoxes(),this.render()});m(this,"projectScreenXYToCoordinate",(r,n,o=!1)=>{var h,b;let i=c(this,V).containerOffset[0],s=c(this,V).containerOffset[1],a=(r-s)/c(this,V).canvasWidth*2-1,l=-((n-i)/c(this,V).canvasHeight)*2+1,u=new Ee(a,l),d,f;if(o)GX.setFromCamera(u,c(this,Ir)),d=(h=GX.intersectObject(c(this,Zc),!1)[0])==null?void 0:h.point;else{let v=c(this,U).interactionSystem.getThreeDIntersectsFromXY(u);d=(b=v==null?void 0:v[0])==null?void 0:b.point,f=c(this,U).interactionSystem.getGroupContainerIntersectsFromXY(u)}if(d)return{coordinate:this.convert3DMapPositionToCoordinate(d),groupContainers:f}});m(this,"projectCoordinateToScreenXY",r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),o=new Ee;return c(this,Ub).call(this,o,n),{x:o.x,y:o.y}});m(this,"convert3DMapPositionToCoordinate",r=>{var i,s,a,l;let{lat:n,lon:o}=o0((s=(i=c(this,V).center)==null?void 0:i[1])!=null?s:0,(l=(a=c(this,V).center)==null?void 0:a[0])!=null?l:0,r.x,r.y);return[o,n,r.z]});m(this,"setBackgroundColor",(r,n)=>{c(this,tn).setBackgroundColor(r,n)});m(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:e0(o.coordinate,i.coordinate)/r});m(this,"hideOutdoorLayersUnderPoint",(r,n)=>{!this.map||(n==null?void 0:n.length)===0||(c(this,U).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())});m(this,"hideOutdoorLayersIntersectingPolygons",(r,n,o)=>{c(this,U).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,o),this.render()});M(this,ad,new oE);M(this,zb,new Ci);m(this,"render",()=>{var r;if(((r=c(this,U))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return c(this,U).renderSystem.update()});m(this,"renderSync",()=>c(this,U).renderSystem.update(!0));M(this,no,Ed(()=>{this.publish("user-interaction-start",void 0)},0,!0));M(this,oo,Ed(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));m(this,"on",(r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&g.env.NODE_ENV!=="test"&&($.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))});m(this,"off",(r,n)=>{super.off(r,n)});m(this,"getCursor",()=>c(this,U).interactionSystem.getCursor());m(this,"destroy",()=>{var r;c(this,U)&&(c(this,U).cameraSystem.off("user-dolly-start",c(this,no)),c(this,U).cameraSystem.off("user-pan-start",c(this,no)),c(this,U).cameraSystem.off("user-rotate-start",c(this,no)),c(this,U).cameraSystem.off("user-zoom-start",c(this,no)),c(this,U).cameraSystem.off("user-tilt-start",c(this,no)),c(this,U).cameraSystem.off("user-pedestal-start",c(this,no)),c(this,U).cameraSystem.off("user-dolly-end",c(this,oo)),c(this,U).cameraSystem.off("user-pan-end",c(this,oo)),c(this,U).cameraSystem.off("user-rotate-end",c(this,oo)),c(this,U).cameraSystem.off("user-zoom-end",c(this,oo)),c(this,U).cameraSystem.off("user-tilt-end",c(this,oo)),c(this,U).cameraSystem.off("user-pedestal-end",c(this,oo)),c(this,U).renderSystem.off("measure-canvas",c(this,Km)),c(this,U).meshOptimizationSystem.off("geometry-2d-added",this.render),c(this,U).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),c(this,Nr).call(this),c(this,Ht).call(this),this.renderSync(),c(this,U).renderSystem.destroy(),c(this,U).cameraSystem.off("change",this.render),c(this,U).pathSystem.off("animate:path",this.render),c(this,U).cameraSystem.dispose(),c(this,U).exporterSystem.destroy(),c(this,U).outdoorLayersSystem.destroy(),c(this,U).drawSystem.destroy(),window.removeEventListener("resize",c(this,$b),!1),c(this,Rb).removeEventListener("change",c(this,Bb)),c(this,sd)&&c(this,sd).disconnect(),this._subscribers={},c(this,tn).destroy(),(r=c(this,Tr))==null||r.traverse(n=>{mr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),_(this,Tr,void 0),c(this,U).htmlControlsSystem.destroy(),c(this,U).collisionSystem.destroy(),c(this,U).interactionSystem.destroy(),c(this,U).domMutationSystem.destroy(),c(this,U).geometryInFocusSystem.destroy(),_(this,U,void 0),c(this,Xc)!=="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,fa)),this.container.removeChild(c(this,jt)),_(this,tn,void 0))});M(this,Jm,new Ce);M(this,Hb,new Ce);if(c(this,V).naturalBearing=(h=n.naturalBearing)!=null?h: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&&(_(this,Xc,n.mode),this.map=n.map),c(this,V).entityScene.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),c(this,V).entityScene.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),c(this,V).geometry3DMap.set(c(this,V).entityScene.userData.entityId,c(this,V).entityScene),n.center&&(c(this,V).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,ee(this,bn,UX).call(this),ee(this,bn,VX).call(this),c(this,U).htmlControlsSystem=new cS(this.container),c(this,Xc)!=="outdoors-overlay"&&c(this,U).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),g.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),_(this,tn,new eI({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(b=n.gl)==null?void 0:b.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:k=>{var D;(D=n.onWebGLContextRestored)==null||D.call(n,k),c(this,Nr).call(this),c(this,Ht).call(this),this.render()},onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(v=n.backgroundAlpha)!=null?v:1})),_(this,Tr,new Vl),c(this,Tr).add(c(this,V).entityScene);let o=window.__THREE_DEVTOOLS__;g.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:c(this,Tr)})),o.dispatchEvent(new CustomEvent("observe",{detail:c(this,tn)}))),_(this,Ir,new HS(FPe,this.aspect,50,1e5)),c(this,V).cameraObject=c(this,Ir),_(this,Lb,new rE),c(this,Ir).renderOrder=999;let i=new Pa;i.add(c(this,Ir)),_(this,Ym,new Pa),c(this,Ym).add(i),c(this,Tr).add(c(this,Ym)),c(this,Ir).updateProjectionMatrix(),c(this,Ir).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,tn).domElement(),_(this,Xm,new Ee);let s=new Ti(1e6,1e6),a=new $r({color:0,visible:!1});_(this,Zc,new Ve(s,a)),c(this,Zc).name="worldPlane",c(this,Tr).add(c(this,Zc)),(I=n.gl)!=null&&I.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",c(this,$b),!1),c(this,Rb).addEventListener("change",c(this,Bb)),typeof ResizeObserver=="function"&&((x=g.env)==null?void 0:x.NODE_ENV)!=="test"&&(_(this,sd,new ResizeObserver(wE(k=>{c(this,jb).call(this,k[0].contentRect.width,k[0].contentRect.height)},50))),(C=c(this,sd))==null||C.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(P=globalThis.MappedinDebug)!=null&&P.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1920px":"100%",g.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),c(this,V).canvasWidth=this.rendererDomElement.clientWidth,c(this,V).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,u=this.canvasHeight;c(this,U).watermarkSystem=new iS(c(this,Ir),c(this,V),n==null?void 0:n.watermark),c(this,U).watermarkSystem.on("texture-loaded",this.render),c(this,V).shouldMeasureCanvas=!0,c(this,V).pixelRatio=this.resolutionScale,c(this,Vb).call(this,Math.floor(l*this.resolutionScale),Math.floor(u*this.resolutionScale));let d=new J1(16777215,.3*Math.PI);d.position.set(-150,-150,350),c(this,Tr).add(d);let f=new lE(16777215,.741*Math.PI);c(this,Tr).add(f),c(this,U).cameraSystem=new Qp(c(this,Ir),c(this,Tr),c(this,tn).renderer,c(this,V),{mode:this.mode,canvasHeight:u,canvasWidth:l}),c(this,U).cameraSystem.on("user-dolly-start",c(this,no)),c(this,U).cameraSystem.on("user-pan-start",c(this,no)),c(this,U).cameraSystem.on("user-rotate-start",c(this,no)),c(this,U).cameraSystem.on("user-zoom-start",c(this,no)),c(this,U).cameraSystem.on("user-tilt-start",c(this,no)),c(this,U).cameraSystem.on("user-pedestal-start",c(this,no)),c(this,U).cameraSystem.on("user-dolly-end",c(this,oo)),c(this,U).cameraSystem.on("user-pan-end",c(this,oo)),c(this,U).cameraSystem.on("user-rotate-end",c(this,oo)),c(this,U).cameraSystem.on("user-zoom-end",c(this,oo)),c(this,U).cameraSystem.on("user-tilt-end",c(this,oo)),c(this,U).cameraSystem.on("user-pedestal-end",c(this,oo)),c(this,U).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),c(this,U).geometryInFocusSystem&&(c(this,U).geometryInFocusSystem.cameraDirty=!0),this.render()}),c(this,U).pathSystem=new Db(c(this,V),this.convertTo3DMapPosition,this.getParentContainer,c(this,U).cameraSystem.convertZoomLevelToAltitude),c(this,U).pathSystem.on("animate:path",this.render),c(this,U).panBoundsSystem=new lS(c(this,V),c(this,U).cameraSystem),c(this,U).panBoundsSystem.on("update",()=>{let{panBounds:k,fov:D,convertAltitudeToZoomLevel:F}=c(this,U).cameraSystem;if(c(this,U).panBoundsSystem.autoMinZoomLevel){if(k.radius<=0)return;let z=Math.min(c(this,V).canvasWidth/c(this,V).canvasHeight,1),G=D*Math.PI/180*z,j=Math.tan(G/2),{radius:K,center:Z}=c(this,U).cameraSystem.panBounds,oe=K/j,Q=this.getThreeCamera().getWorldPosition(new Ce),ge=Z.distanceTo(Q),be=Math.abs(Q.z-Z.z),pe=oe*be/ge,_e=F(pe);GE(_e,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(_e)}}),this.camera=new oS(this,c(this,U),c(this,V)),this.camera.setZoomLevel((T=n.zoomLevel)!=null?T:bO),this.camera.setBearing((O=n.bearing)!=null?O:gO),this.camera.setPitch((N=n.pitch)!=null?N:yO),this.camera.setMaxZoomLevel(DPe),this.camera.setMinZoomLevel(kPe),c(this,U).domVisiblitySystem=new GI(c(this,V),c(this,fa)),c(this,U).domMutationSystem=new nS(c(this,V),c(this,fa)),c(this,U).domMutationSystem.on("dimensions-update",()=>{c(this,U).collisionSystem.collidersDirty=!0,this.render()}),c(this,U).domDrawSystem=new tS(c(this,V)),c(this,U).collisionSystem=new tI(c(this,ns),c(this,V)),c(this,U).twoDDrawSystem=new VI(c(this,V),c(this,Sr),n.transformImageRequest),c(this,U).twoDDrawSystem.on("img:loaded",this.render),c(this,U).interactionSystem=new Xg(this.rendererDomElement,c(this,V),c(this,Ir),c(this,Zc),c(this,U).cameraSystem.isUserInteracting),c(this,U).interactionSystem.on("doubletap-with-onefinger",k=>{var D;this.camera.animateTo({center:(D=this.projectScreenXYToCoordinate(k.clientX,k.clientY))==null?void 0:D.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:QS,easing:"ease-out"})}),c(this,U).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:QS,easing:"ease-out"})}),c(this,U).interactionSystem.on("hover",this.render),c(this,U).interactionSystem.on("click",k=>{var D,F,z,G,j,K;if(((D=k.entity2D)==null?void 0:D.id)==="watermark"&&typeof c(this,U).watermarkSystem.options.onClick=="function"&&c(this,U).watermarkSystem.options.interactive){c(this,U).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(k.position),geometry:k.entity3D?[(F=k.entity3D)==null?void 0:F.id]:[],paths:((z=k.entity3D)==null?void 0:z.components[0])instanceof Vc?[k.entity3D.id]:[],markers:((G=k.entity2D)==null?void 0:G.components[0])instanceof aa?[k.entity2D.id]:[],models:((j=k.entity3D)==null?void 0:j.components[0])instanceof Gc?[k.entity3D.id]:[],labels:((K=k.entity2D)==null?void 0:K.components[0])instanceof la?[k.entity2D.id]:[],containers:Array.isArray(k.groupContainers)?k.groupContainers.map(Z=>Z.userData.entityId):[],pointerEvent:k.pointerEvent})}),c(this,U).interactionSystem.on("hover",k=>{var D,F,z,G,j,K;k.position&&((D=k.entity2D)==null?void 0:D.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(k.position),geometry:k.entity3D?[(F=k.entity3D)==null?void 0:F.id]:[],paths:((z=k.entity3D)==null?void 0:z.components[0])instanceof Vc?[k.entity3D.id]:[],markers:((G=k.entity2D)==null?void 0:G.components[0])instanceof aa?[k.entity2D.id]:[],models:((j=k.entity3D)==null?void 0:j.components[0])instanceof Gc?[k.entity3D.id]:[],labels:((K=k.entity2D)==null?void 0:K.components[0])instanceof la?[k.entity2D.id]:[],containers:Array.isArray(k.groupContainers)?k.groupContainers.map(Z=>Z.userData.entityId):[]})}),c(this,U).geometryInFocusSystem=new gS(c(this,V),c(this,Ir)),c(this,U).geometryInFocusSystem.on("geometry-in-focus",k=>{this.publish("geometry-in-focus",k)}),c(this,U).twoDVisiblitySystem=new HI(c(this,V)),c(this,U).drawSystem=new zI(c(this,V),this.convertTo3DMapPosition),c(this,U).drawSystem.on("texture-loaded",this.render),c(this,U).stackSystem=new qI(c(this,V)),c(this,U).twoDProjectionSystem=new UI(c(this,V),c(this,Ub)),c(this,U).exporterSystem=new cb(c(this,V)),c(this,U).meshOptimizationSystem=new jI(c(this,V),this.convertTo3DMapPosition),c(this,U).meshOptimizationSystem.on("model-loaded",this.render),c(this,U).meshOptimizationSystem.on("geometry-2d-added",this.render),c(this,U).meshDetachmentSystem=new IS(c(this,V)),c(this,U).meshModificationSystem=new SS(c(this,V)),c(this,U).customGeometrySystem=new uS(c(this,V),this.convertTo3DMapPosition),c(this,U).outlineInterpolationSystem=new pS(c(this,V)),c(this,U).renderSystem=new WI(c(this,tn),c(this,V),this.mode,c(this,Tr),c(this,Ir),this.viewCamera,c(this,U)),c(this,U).imageSystem=new yS(c(this,V),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),c(this,U).text3DSystem=new SI(c(this,V),this.convertTo3DMapPosition),c(this,U).text3DSystem.on("render",this.render),c(this,U).imageSystem.on("image-loaded",this.render),c(this,U).renderSystem.on("pre-render",()=>this.publish("pre-render")),c(this,U).renderSystem.on("post-render",()=>this.publish("post-render")),c(this,U).renderSystem.on("measure-canvas",c(this,Km)),c(this,U).outdoorLayersSystem=new vS(this.map),c(this,U).occlusion2DSystem=new PS(c(this,V),this.convertTo3DMapPosition,c(this,tn)),n.occlusionEnabled&&c(this,U).occlusion2DSystem.enable(),this.Debug=new CS(this),n.environment!==!1&&_(this,id,ee(this,bn,hO).call(this)),c(this,TS).call(this)}get viewCamera(){return c(this,Lb)}get canvasWidth(){return c(this,V).canvasWidth}get canvasHeight(){return c(this,V).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:Od()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return c(this,Xc)}addGroupContainer(r,n,o){if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let i=new ct(r);i.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),i.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&i.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&gn(i,n.interactive,c(this,V)),(n==null?void 0:n.focusable)!==void 0&&B5(i,n.focusable),c(this,V).geometry3DMap.set(r,i);let s=this.getParentContainer(o);s instanceof ct&&s.addEntity(i),c(this,Ht).call(this),this.render()}else $.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,V).geometry3DMap.has(r))$.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let i=new ct(r);i.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),i.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),i.components[0]=new rS,(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),c(this,V).geometry3DMap.set(r,i);let s=this.getParentContainer(o);s instanceof ct&&s.addEntity(i)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,o,i,s){if(c(this,V).geometry3DMap.has(r))$.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let a=new Wm(n,o),l=new Tt(a,new Is(i));(i==null?void 0:i.interactive)!==void 0&&gn(l,i.interactive,c(this,V)),l.id=r,a.mesh.userData={entityId:r,type:"custom-geometry"},c(this,V).geometry3DMap.set(l.id,l);let u=this.getParentContainer(s);u instanceof ct&&u.addEntity(l),c(this,Ht).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,o,i){var s,a;if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let l=new In(r,new KS(o));l.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),l.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),l.userData.dirty=!0,c(this,V).geometry3DMap.set(r,l);for(let d of n.features){if(d.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(d.geometry.type))continue;let f=(d==null?void 0:d.id)||((s=d==null?void 0:d.properties)==null?void 0:s.id)||Et(),{visible:h,...b}=o||{color:CE},v=c(this,U).meshOptimizationSystem.createEntityFromFeature(f,d,{...b,outline:!0});c(this,V).geometry3DMap.set(f,v),l.userData.entities3D.add(f)}l.setVisible((a=o==null?void 0:o.visible)!=null?a:!0),(o==null?void 0:o.altitude)!=null&&l.setAltitude(o.altitude);let u=this.getParentContainer(i);u instanceof ct&&u.addEntity(l),c(this,Ht).call(this),this.render()}else $.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return c(this,U).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let o=this.getParentContainer(n),i=c(this,U).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(r,i),i}addImage(r,n,o,i){try{EX(r,n,o)}catch(s){$.error(s);return}if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let s=new hS(n),a=new Tt(s,new Is(o));a.id=r||Et(),s.mesh.userData={entityId:a.id,type:"path"},c(this,V).geometry3DMap.set(a.id,a);let l=this.getParentContainer(i);l instanceof ct&&l.addEntity(a),c(this,Ht).call(this),this.render()}else $.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{aX(r,n,o)}catch(u){$.error(u);return}if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let u=new In(r,new KS({...o,outline:!1}));u.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),u.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Nr).call(this)}),c(this,V).geometry3DMap.set(r,u),u.userData.dirty=!0,u.userData.modelURL=o.url;for(let f of n.features){let h=f.id||f.properties.id||Et(),b=c(this,U).meshOptimizationSystem.createModelFromFeature(h,f,o);(f.properties.interactive!==void 0||o.interactive!=null)&&gn(b,(a=f.properties.interactive)!=null?a:o.interactive,c(this,V)),c(this,V).geometry3DMap.set(h,b),u.userData.entities3D.add(h)}let d=this.getParentContainer(i);d instanceof ct&&d.addEntity(u),c(this,Ht).call(this),(l=this.render())==null||l.then(s)}else $.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{Oq(r,n,o||{})}catch(l){$.error(l);return}if(s===void 0||!c(this,V).geometry2DMap.has(s)&&!c(this,V).geometry3DMap.has(s)){let l=ee(this,bn,mO).call(this,r,new aa(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,V));let u=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?c(this,V).geometry3DMap.get(o.attachTo):void 0;u instanceof Tt&&u.attach(l),(a=this.getParentContainer(i))==null||a.addEntity(l),this.render()}else $.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,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let s=new Nc({...n,properties:{...n.properties,id:r,content:n.properties.text}}),a=new Tt(s,new Sh(o==null?void 0:o.appearance));a.id=r,s.mesh.userData.entityId=r.toString(),s.mesh.userData.type="text3d",c(this,V).geometry3DMap.set(r,a);let l=this.getParentContainer(i);l instanceof ct&&l.addEntity(a),c(this,Ht).call(this),this.render()}else $.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,o={}){var u,d;try{if(!n||!r)throw new Error("content and meshGeometryId are required");IZ.parse(o)}catch(f){$.error(f);return}let i=c(this,V).geometry3DMap.get(r);if((i==null?void 0:i.type)!=="geometry"){$.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 f=c(this,V).geometry3DMap.get(s.textEntityId);if((f==null?void 0:f.type)!=="text3d"){$.error(".labelText3D failed: existing text3d not found");return}return{id:f.id,type:f.type}}let a=new Nc({type:"Feature",geometry:{coordinates:(u=s.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:n,id:Et()}});a.polygonEntityId=r;let l=new Tt(a,new Sh(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,V).geometry3DMap.set(l.id.toString(),l),o.parentId&&((d=this.getParentContainer(o.parentId))==null||d.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{yZ(r,n,o||{})}catch(l){$.error(l);return}if(s===void 0||!c(this,V).geometry2DMap.has(s)&&!c(this,V).geometry3DMap.has(s)){let l=ee(this,bn,mO).call(this,r,new la(n,o||{},c(this,V)),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,V));let u=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?c(this,V).geometry3DMap.get(o.attachTo):void 0;u instanceof Tt&&u.attach(l),(a=this.getParentContainer(i))==null||a.addEntity(l),c(this,Nr).call(this),this.render()}else $.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{pX(r,n||{})}catch(u){$.error(u);return}let i=new Vc(r,$5(n)),s=new Tt(i,new Is({color:(l=n==null?void 0:n.color)!=null?l:"#ff834c"}));s.id=(n==null?void 0:n.id)||Et(),i.mesh.userData={entityId:s.id,type:"path"},c(this,V).geometry3DMap.set(s.id,s),(n==null?void 0:n.interactive)!=null&&gn(s,n==null?void 0:n.interactive,c(this,V));let a=this.getParentContainer(o);return a instanceof ct&&a.addEntity(s),c(this,Ht).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(r){c(this,U).watermarkSystem.options=r,c(this,U).watermarkSystem.dirty=!0,c(this,U).collisionSystem.collidersDirty=!0,this.render()}remove(r){var o;let n;if(typeof r=="string"||typeof r=="number"?(n=c(this,V).geometry2DMap.get(r),n==null&&(n=c(this,V).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=c(this,V).geometry2DMap.get(r.id),n==null&&(n=c(this,V).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")c(this,V).geometry3DMap.delete(n.id),n.object3d&&mr(n.object3d);else if(n.type==="group-container"){c(this,V).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&&mr(i.focusMesh),mr(n)}else if(n.type==="geometry-group"){c(this,V).geometry3DMap.delete(n.userData.entityId);for(let i of n.userData.entities3D.values())this.remove(i),n.userData.entities3D.delete(i);mr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let i=n.components[0];if(n.entities2D.size>0){for(let 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),mr(n.object3d)),n.type==="geometry"){let s=n.components[3];s&&(s.visible=!1,s.dirty=!0)}"focusMesh"in i&&i.focusMesh!=null&&mr(i.focusMesh),"textMesh"in i&&i.textMesh!=null&&this.remove(i.textMesh.userData.entityId),c(this,V).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let i=n.attachedTo;if(i){let s=c(this,V).geometry3DMap.get(i);s instanceof Tt&&s.detach(n)}n.object3d&&mr(n.object3d),n.type==="label"&&delete c(this,U).twoDDrawSystem.textCache[n.id],c(this,V).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&mr(n.object3d),c(this,V).geometry3DMap.delete(n.id);else if(n.type==="text3d"){mr(n.object3d);let{batchedText:i,textMesh:s,polygonEntityId:a}=n.components[0];if(s&&(i&&i.removeText(s),mr(s)),a){c(this,U).text3DSystem.remove(a);let l=c(this,V).geometry3DMap.get(a);(l==null?void 0:l.type)==="geometry"&&(l.components[0].textMesh=void 0,l.components[0].textEntityId=void 0)}c(this,V).geometry3DMap.delete(n.id)}c(this,Ht).call(this),c(this,Nr).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return c(this,Tr)}getThreeCamera(){return c(this,Ir)}async setEnvironment(r){if(c(this,Tr))if(r==="basic"){c(this,id)||_(this,id,ee(this,bn,hO).call(this));let n=await c(this,id);c(this,Tr).environment=n}else c(this,Tr).environment=null}getEnvironment(){var r;return(r=c(this,Tr))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return c(this,U).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(c(this,U).renderSystem.threeDdirty||c(this,U).renderSystem.twoDdirty)&&this.renderSync();let n=new Xr;if(r==null)n.setFromObject(c(this,V).entityScene);else{let o=Ih(c(this,V),r);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let i=o.components[0],s=i instanceof yr?i.geometry:void 0;i.mesh instanceof X1&&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(du(n))return OE(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var o,i,s,a,l,u,d,f,h,b;if(r==null)return{type:"map-view",hoverColor:c(this,V).hoverColor,text3dHoverColor:c(this,V).text3dHoverColor};let n=Ih(c(this,V),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 x of n.userData.entities3D.values()){let C=this.getState(x);((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(x=>c(this,V).geometry3DMap.get(x)).every(x=>x&&x.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(x=>this.getState(x)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(v=>this.getState(v)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let v=n.components[0],I=n.object3d.parent,x=I==null?void 0:I.userData.entityId;return{id:n.id,type:"label",text:v.text||"",parent:{id:x,type:I==null?void 0:I.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:v.enabled,visible:v.visible,initialRank:qg(v.initialRank),options:{rank:qg(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,x=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:x,type:I==null?void 0:I.type},position:this.convert3DMapPositionToCoordinate(n.position),element:v.containerEl,initialRank:qg(v.initialRank),options:{rank:qg(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:x,initialTopColor:C,topColor:P}=n.components[1],w=n.components[0],T=n.components[1],O=n.components[2],N=n.components[3],k=n.parentObject3D;return{id:n.id,type:"geometry",opacity:T.opacity,initialColor:x,color:v,focusable:w.focusable,initialTopColor:C,topColor:P,hoverColor:I,hovered:!!(O!=null&&O.hover),height:T.height,visible:T.visible,outline:N==null?void 0:N.visible,showImage:T.showImage,texture:T.texture,topTexture:T.topTexture,flipImageToFaceCamera:T.flipImageToFaceCamera,parent:{id:k==null?void 0:k.userData.entityId,type:k==null?void 0:k.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],x=n.components[2];return{id:n.id,type:"model",position:v.mesh?this.convert3DMapPositionToCoordinate((i=v.mesh)==null?void 0:i.getWorldPosition(new Ce)):this.convert3DMapPositionToCoordinate(v.position),interactive:x!=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:kd,scale:(l=I.scale)!=null?l:Ad}}else if((n==null?void 0:n.type)==="path"){let v=n.components[0],I=n.components[2],x=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(v.position),visible:x.visible,interactive:I!=null,completeFraction:v.completeFraction,color:x.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:(u=v.feature.properties.verticalOffset)!=null?u:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof Nc&&"textArea"in n.components[0].feature.properties){GZ(n);let v=n.components[0],I=n.components[1],{textMesh:x}=v,C=(d=v.mesh)==null?void 0:d.parent;C instanceof ct&&((f=C.children.find(T=>T.type==="batchedtext"))==null||f.getWorldPosition(c(this,Hb))),c(this,Jm).set(0,0,0);let P=x?x.getWorldPosition(c(this,Jm)):c(this,Jm);return Object.assign({},_d,I.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(P.add(c(this,Hb))),visible:(h=v.visible)!=null?h:!1,content:(b=v.feature.properties.content)!=null?b:""})}else return}}setState(r,n){var i,s;if(typeof r=="object"&&n==null){"hoverColor"in r&&(c(this,V).hoverColor=(i=r.hoverColor)!=null?i:c(this,V).hoverColor),"text3dHoverColor"in r&&(c(this,V).text3dHoverColor=(s=r.text3dHoverColor)!=null?s:c(this,V).text3dHoverColor);return}let o=Ih(c(this,V),r);if(o!=null){if(o.type==="custom-geometry"){let a=c(this,V).geometry3DMap.get(o.id);if(a instanceof Tt&&a.components[0]instanceof Wm){let l=n;ca(o,c(this,V),l.visible),TI(o,l.altitude),F5(o,l.position,this.convertTo3DMapPosition),L5(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let a=n;gn(o,a.interactive,c(this,V))&&c(this,Ht).call(this),TI(o,a.altitude),jZ(o,c(this,V),a)}else if(o.type==="model"){let a=n;gn(o,a.interactive,c(this,V))&&c(this,Ht).call(this),ca(o,c(this,V),a.visible),VZ(o,a)}else if(o.type==="group-container"){let a=n;ca(o,c(this,V),a.visible)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0,c(this,U).pathSystem.altitudeDirty=!0),TI(o,a.altitude)&&(c(this,U).pathSystem.altitudeDirty=!0),gn(o,a.interactive,c(this,V))&&c(this,Ht).call(this),N5(o,c(this,V),a.opacity)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0)}else if(o.type==="geometry-group"){let a=n;ca(o,c(this,V),a.visible)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wZ(o,c(this,V),a),wI(o,c(this,V),a.outline),a.height!=null&&k5(o,c(this,V),a.height),a.altitude!=null&&o.setAltitude(a.altitude),RZ(o,a),MZ(o,a.shading),N5(o,c(this,V),a.opacity)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),gn(o,a.interactive,c(this,V))&&(c(this,Ht).call(this),c(this,Nr).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof yr){let a=n;ca(o,c(this,V),a.visible)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wI(o,c(this,V),a.outline),OZ(o,a),B5(o,a.focusable)&&(c(this,U).geometryInFocusSystem.focusablesDirty=!0),$Z(o,a.renderOrder)&&(c(this,U).meshDetachmentSystem.dirty=!0),BZ(o,a.opacity)&&(c(this,U).meshDetachmentSystem.dirty=!0,c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),R5(o,a.flipImageToFaceCamera),a.height!=null&&k5(o,c(this,V),a.height),NZ(o,a)&&(c(this,U).meshDetachmentSystem.dirty=!0),D5(o,a),DZ(o,a.hoverColor),gn(o,a.interactive,c(this,V)),FZ(o,a.hovered)}c(this,Ht).call(this)}else if(o.type==="label"||o.type==="marker"){let a=n;kZ(o,n,c(this,V)),_Z(o,n,c(this,V))&&(c(this,Nr).call(this),c(this,U).domMutationSystem.dirty=!0),F5(o,a.position,this.convertTo3DMapPosition),L5(o,this.getParentContainer(a.parent,!1))&&(c(this,Nr).call(this),c(this,U).panBoundsSystem.dirty=!0),EZ(o,a.enabled),ca(o,c(this,V),a.visible)}else if(o.type==="image"){let a=n;ca(o,c(this,V),a.visible),R5(o,a.flipImageToFaceCamera)}else if(o.type==="text3d"){let a=n;UZ(o,c(this,V),a)}this.render()}}convertTo3DMapPosition(r,n,o=0,i){var l,u,d,f,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}=i0((d=(u=c(this,V).center)==null?void 0:u[1])!=null?d:0,(h=(f=c(this,V).center)==null?void 0:f[0])!=null?h:0,r,n);return i?(i.set(s,a,o),i):new Ce(s,a,o)}get backgroundColor(){return typeof c(this,tn).backgroundColor=="string"?c(this,tn).backgroundColor:"#".concat(c(this,tn).backgroundColor.getHexString())}get backgroundAlpha(){return c(this,tn).backgroundAlpha}getThreeRenderer(){return c(this,tn)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?jE(n):void 0}isInView(r){let n=Ih(c(this,V),r);if(c(this,zb).identity().multiply(c(this,Ir).projectionMatrix).multiply(c(this,Ir).matrixWorldInverse),c(this,ad).setFromProjectionMatrix(c(this,zb)),n instanceof hu)return c(this,ad).containsPoint(n.position);if(n instanceof Tt){let o=n==null?void 0:n.components[0];if(o instanceof Wm||o instanceof Gc)return c(this,ad).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof yr){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,ad).intersectsBox(i)}}return!1}getSystems(){return c(this,U)}getInternalState(){return c(this,V)}getTweenGroup(){return c(this,V).tweenGroup}};Tr=new WeakMap,Ir=new WeakMap,id=new WeakMap,Lb=new WeakMap,Xm=new WeakMap,Zc=new WeakMap,sd=new WeakMap,Ym=new WeakMap,bn=new WeakSet,fO=function(r){var n;c(this,Xc)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),c(this,V).pixelRatio=this.resolutionScale},V=new WeakMap,jt=new WeakMap,ns=new WeakMap,Sr=new WeakMap,fa=new WeakMap,tn=new WeakMap,U=new WeakMap,Rb=new WeakMap,Nr=new WeakMap,Ht=new WeakMap,UX=function(){_(this,jt,document.createElement("div")),c(this,jt).classList.add("mappedin__smart-collision-engine__container"),_(this,ns,document.createElement("canvas")),c(this,ns).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(c(this,jt)),_(this,Sr,document.createElement("canvas")),c(this,Sr).classList.add("mappedin__smart-collision-engine__container"),c(this,Sr).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Sr).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Sr).style.width=c(this,jt).clientWidth+"px",c(this,Sr).style.height=c(this,jt).clientHeight+"px",c(this,jt).appendChild(c(this,ns)),c(this,jt).appendChild(c(this,Sr)),c(this,ns).width=c(this,jt).clientWidth,c(this,ns).height=c(this,jt).clientHeight,c(this,Sr).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Sr).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Sr).style.width=c(this,jt).clientWidth+"px",c(this,Sr).style.height=c(this,jt).clientHeight+"px"},VX=function(){_(this,fa,document.createElement("div")),c(this,fa).classList.add("mappedin-2d-entities"),Object.assign(c(this,fa).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(c(this,fa))},zX=function(){c(this,Sr).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Sr).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Sr).style.width=c(this,jt).clientWidth+"px",c(this,Sr).style.height=c(this,jt).clientHeight+"px",c(this,ns).width=c(this,jt).clientWidth,c(this,ns).height=c(this,jt).clientHeight,c(this,Sr).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Sr).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Sr).style.width=c(this,jt).clientWidth+"px",c(this,Sr).style.height=c(this,jt).clientHeight+"px",c(this,U).collisionSystem.collidersDirty=!0},Xc=new WeakMap,Nb=new WeakMap,Bb=new WeakMap,$b=new WeakMap,jb=new WeakMap,TS=new WeakMap,Gb=new WeakMap,Ub=new WeakMap,Vb=new WeakMap,Km=new WeakMap,mO=function(r,n,o,i){let s=new hu(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i);return s.occluderId=o!=null?o:c(this,U).occlusion2DSystem.backgroundId,c(this,V).geometry2DMap.set(s.id,s),s},ad=new WeakMap,zb=new WeakMap,no=new WeakMap,oo=new WeakMap,hO=async function(){return Uc.load(NW).then(r=>{var n;return c(this,Tr)&&((n=c(this,Tr).environment)==null||n.dispose(),r.mapping=WO,c(this,Tr).environment=r,this.render()),r})},Jm=new WeakMap,Hb=new WeakMap;var Wb=dO;p();function LPe(e,t){RPe(e,t)(e.getScene(),t),NPe(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 u=window.URL.createObjectURL(a);l.href=u,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(u)}},"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 RPe(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 u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(o,{height:l})},set flipImageToFaceCamera(l){let u=e.getState(o.id);(u==null?void 0:u.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 u=e.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&e.setState(o,{visible: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 u=e.getState(o.id);(u==null?void 0:u.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 u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(u,{opacity:l})},get color(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?Se(l.color).toHexString():"#ffffff"},set color(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(u,{color:l})},set interactive(l){let u=e.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(e.setState(o,{interactive:l}),r.controllersRecursive().forEach(d=>d.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 u=e.getState(o.id);(u==null?void 0:u.type)==="path"&&e.setState(u,{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 u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="marker"?(u=l.options)==null?void 0:u.interactive:!1},set interactive(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="marker"&&(e.setState(u,{options:{interactive:l}}),r.controllersRecursive().forEach(d=>d.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 u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(u=l.options)==null?void 0:u.interactive:!1},set interactive(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&(e.setState(u,{options:{interactive:l}}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get text(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l})},get"Text Color"(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:d.foregroundColor:"#000000"},set"Text Color"(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(o.id,{text:a.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:d.size:10},set"Text Size"(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.iconSize:10},set"Icon Size"(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:f.active:"#000000"},set"Active Foreground Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{foregroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:f.inactive:"#000000"},set"Inactive Foreground Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{foregroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:f.active:"#000000"},set"Active Background Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{backgroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:f.inactive:"#000000"},set"Inactive Background Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{backgroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.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 u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{opacity:l})},set visible(l){let u=e.getState(o.id);(u==null?void 0:u.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 u=e.getState(o.id);(u==null?void 0:u.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 u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&(e.setState(o,{interactive:l}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(u=l.shading)==null?void 0:u.start)!=null?d:0},set shadingStart(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{start:l}})},get shadingEnd(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(u=l.shading)==null?void 0:u.end)!=null?d:0},set shadingEnd(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{end:l}})},get shadingIntensity(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(u=l.shading)==null?void 0:u.intensity)!=null?d:0},set shadingIntensity(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{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 u=e.getState(o.id);(u==null?void 0:u.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 u=e.getState(o.id);(u==null?void 0:u.type)==="group-container"&&(e.setState(u,{interactive:l}),r.controllersRecursive().forEach(d=>d.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 NPe(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 HX="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",BPe="https://auth.mappedin.com/oauth2/token";async function WX(e,t){var r,n,o,i,s;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:a,MercatorCoordinate:l}=await import("./outdoor-context-v4-6CUOE2HW.js"),u=t.outdoorView.headers;u==null&&(u=await RE(BPe));let d=t.center||[0,0],f=new a({container:e,style:t.outdoorView.style||HX,center:d,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:bO,pitch:(o=t.pitch)!=null?o:yO,bearing:(i=t.bearing)!=null?i:gO,transformRequest:kE(u),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Od(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),h=f.painter.context.gl,b=new Wb(e,{center:d,zoomLevel:f.getZoom(),pitch:f.getPitch(),bearing:f.getBearing(),gl:h,map:f,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}),v={center:f.getCenter().toArray(),zoom:f.getZoom(),bearing:f.getBearing(),pitch:f.getPitch()};f.setMinZoom(b.camera.minZoomLevel),f.setMaxZoom(b.camera.maxZoomLevel),b.on("camera-change",T=>{v.center=T.center,v.zoom=T.zoomLevel,v.bearing=T.bearing,v.pitch=T.pitch,f.jumpTo(v)});let I=l.fromLngLat(d,0),x=s0(I,b.viewCamera,b.camera,()=>{b.renderSync()});f.on("style.load",async()=>{f&&(f.addLayer(x),b.renderSync())});let C=!1,P=!1;f.on("idle",()=>{f&&(C||(b.publish("outdoor-view-loaded"),C=!0),P||(P=!0,b.publish("outdoor-style-loaded")))});let w=T=>{T&&(T.sourceDataType==="metadata"||T.sourceDataType==="visibility"||T.dataType==="style"||T.type==="terrain")&&b.getSystems().htmlControlsSystem.updateData(f)};return f.on("styledata",T=>{f&&T&&T.dataType==="style"&&T.type==="styledata"&&(P=!1),w(T)}),f.on("sourcedata",w),f.on("terrain",w),f.on("error",T=>{var O;if(((O=T.error)==null?void 0:O.url)===HX){$.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}$.warn(T)}),b}else return new Wb(e,t)}p();p();p();var G2=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(G2||{}),U2=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(U2||{});p();p();var qb=class qb{constructor(t,r,n){m(this,"id");m(this,"text");m(this,"target");m(this,"__type",qb.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===qb.__type}get focusTarget(){return this.target.anchorTarget}};m(qb,"__type","Label");var Yc=qb;p();var ld,Zb=class Zb{constructor(t,r,n){m(this,"id");M(this,ld);m(this,"__type",Zb.__type);m(this,"contentEl");this.id=t,this.contentEl=r,_(this,ld,n)}get target(){return c(this,ld)}get coordinate(){return c(this,ld).anchorTarget}static is(t){return t.__type===Zb.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){_(this,ld,t)}};ld=new WeakMap,m(Zb,"__type","Marker");var Tl=Zb;p();var Kb,Jb,Xb=class Xb{constructor(t,r,n){M(this,Kb);M(this,Jb);m(this,"target");m(this,"__type",Xb.__type);_(this,Kb,t),_(this,Jb,r),this.target=n}static is(t){return t.__type===Xb.__type}get id(){return c(this,Kb)}get url(){return c(this,Jb)}};Kb=new WeakMap,Jb=new WeakMap,m(Xb,"__type","Image");var Yb=Xb;p();var Qm,Qb=class Qb{constructor(t,r,n){m(this,"id");m(this,"groupId");m(this,"__type",Qb.__type);M(this,Qm);this.id=t,this.groupId=r,_(this,Qm,n)}get target(){return c(this,Qm)}static is(t){return t.__type===Qb.__type}updateTarget(t){_(this,Qm,t)}};Qm=new WeakMap,m(Qb,"__type","Model");var cd=Qb;p();var e1=class e1{constructor(t,r){m(this,"id");m(this,"coordinates");m(this,"__type",e1.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===e1.__type}get focusTarget(){return this.coordinates}};m(e1,"__type","PathSegment");var eh=e1,t1=class t1{constructor(t,r,n,o){m(this,"id");m(this,"animation");m(this,"coordinates");m(this,"segments");m(this,"__type",t1.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=o.map(({id:i,coordinates:s})=>new eh(i.toString(),s))}static is(t){return t.__type===t1.__type}get focusTarget(){return this.coordinates}};m(t1,"__type","Path");var os=t1;p();var Kc,r1=class{constructor(t){M(this,Kc);_(this,Kc,t)}get center(){return c(this,Kc).center}get bearing(){return c(this,Kc).bearing}get pitch(){return c(this,Kc).pitch}get zoomLevel(){return c(this,Kc).zoomLevel}};Kc=new WeakMap;p();var n1=class n1{constructor(t){m(this,"id");m(this,"__type",n1.__type);this.id=t}static is(t){return t.__type===n1.__type}get focusTarget(){return this}};m(n1,"__type","Shape");var Jc=n1;p();var wS=class wS{constructor(t,r){m(this,"id");m(this,"target");m(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===wS.__type}};m(wS,"__type","Text3D");var Qc=wS;p();p();p();var $Pe=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>']]),jPe=/<svg([^>]*)>/g;function qX(e,t,r){let n=$Pe.get(e);return n?n.replace(jPe,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}var GPe=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 '),UPe=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 '),vO="#722ED1",xO="#1890FF",ZX=({type:e="departure",color:t=xO})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?GPe(t):UPe(t),"\n </div>"),VPe=e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},XX=({type:e="stairs",color:t=vO,direction:r="up"})=>{let n=VPe("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(qX("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>")};p();var YX=async e=>new Promise(t=>setTimeout(t,e));var zPe={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},HPe={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},eu={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:zPe,inactivePathOptions:HPe,markerOptions:{departureColor:xO,destinationColor:vO},animatePathDrawing:!0},wl,is,Ml,lt,i1,Ol,ud,Br,ss,So,as,tu,wr,KX,JX,IO,MS,th,SO,rh,o1=class{constructor(t,r,n){M(this,wr);M(this,wl,new Map);M(this,is);M(this,Ml);M(this,lt,eu);M(this,i1);M(this,Ol);M(this,ud);M(this,Br,[]);M(this,ss);M(this,So,new Map);M(this,as,new Map);M(this,tu,new Map);M(this,rh,t=>{var r;if((r=c(this,lt).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=c(this,wl).get(t.markers[0]);n!=null&&n.action.toFloor&&(c(this,lt).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}))}});_(this,is,t),_(this,i1,n),_(this,Ml,r)}get currentMap(){return c(this,i1).call(this)}get isMultiFloor(){if(!c(this,Br).length)return!1;let t=new Set;for(let r of c(this,Br))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return c(this,So).get(t)}getMarkerById(t){return c(this,wl).get(t)}get paths(){let t=new Set;return c(this,So).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return c(this,tu).get(c(this,ss))}get activePath(){var t;if(c(this,ss))return(t=c(this,So).get(c(this,ss).id))==null?void 0:t.path}get floorStacks(){let t=c(this,Ml).getMapData();if(!c(this,Br).length||!t)return[];let r=new Set;for(let n of c(this,Br))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i.floorStack)}return Array.from(r)}get floors(){let t=c(this,Ml).getMapData();if(!c(this,Br).length||!t)return[];let r=new Set;for(let n of c(this,Br))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i)}return Array.from(r)}setActivePathByIndex(t){let r=c(this,Br)[t];if(!c(this,Br).length){$.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!c(this,Br)[t]){$.warn("Direction #".concat(t," does not exist"));return}let n=c(this,as).get(r);if(!n){$.warn("The direction is not a part of muli-direcional path");return}ee(this,wr,MS).call(this,n)}setActivePath(t){if(!c(this,Br).length){$.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!c(this,tu).get(t)){$.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}ee(this,wr,MS).call(this,t)}setActivePathByDirections(t){if(!c(this,Br).length){$.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=c(this,as).get(t);if(!r){$.warn("The direction is not a part of muli-direcional path");return}ee(this,wr,MS).call(this,r)}drawSync(t,r={}){var a,l,u;c(this,ud)&&this.clear(),_(this,ud,!0),ee(this,wr,IO).call(this,r);let n=Array.isArray(t)?t:[t],o=n[0],i=n[n.length-1],s=o.coordinates[0];_(this,Br,n),s.floorId&&c(this,lt).setMapToDeparture&&this.currentMap.setFloor(s.floorId),(a=c(this,lt).createMarkers)!=null&&a.departure&&ee(this,wr,th).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let d=0;d<n.length;d++){let f=n[d],h=d?{...c(this,lt).inactivePathOptions}:{...c(this,lt).pathOptions};if(f.coordinates.length<2){$.warn("Directions must have at least 2 coordinates");return}let b=this.currentMap.Paths.add(f.coordinates,{...h,animateDrawing:c(this,lt).animatePathDrawing}),v=b.paths.map(x=>x.id.toString()),I=new os(Et(),b.animation,f.coordinates,b.paths);for(let x of v){c(this,So).set(x,{path:I,entityIds:v});let C=d?{...c(this,lt).inactivePathOptions,altitude:0}:{...c(this,lt).pathOptions,altitude:.05};c(this,is).setState(x,C)}c(this,So).set(I.id,{path:I,entityIds:v}),c(this,as).set(f,I),c(this,tu).set(I,f),(l=c(this,lt).createMarkers)!=null&&l.connection&&ee(this,wr,SO).call(this,f.instructions,"connection"),d===0&&(_(this,ss,c(this,as).get(c(this,Br)[0])),c(this,is).on("click",c(this,rh)))}(u=c(this,lt).createMarkers)!=null&&u.destination&&ee(this,wr,th).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),c(this,Ml).mapObjects.forEach(d=>{d.processFloorChange(d.currentFloorId)})}async draw(t,r={}){c(this,Ol)&&this.clear(),ee(this,wr,IO).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0].coordinates[0];return _(this,Br,n),i.floorId&&c(this,lt).setMapToDeparture&&this.currentMap.setFloor(i.floorId),ee(this,wr,JX).call(this,n)}clear(){c(this,wl).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),c(this,wl).clear(),c(this,So).forEach(({path:t,entityIds:r})=>{c(this,So).delete(t.id),r.forEach(n=>c(this,So).delete(n)),this.currentMap.Paths.remove(r)}),c(this,Ol)&&(c(this,Ol).cancel(),_(this,Ol,void 0)),c(this,ud)&&_(this,ud,!1),_(this,Br,[]),c(this,as).clear(),c(this,tu).clear(),_(this,ss,void 0),c(this,is).off("click",c(this,rh)),c(this,Ml).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};wl=new WeakMap,is=new WeakMap,Ml=new WeakMap,lt=new WeakMap,i1=new WeakMap,Ol=new WeakMap,ud=new WeakMap,Br=new WeakMap,ss=new WeakMap,So=new WeakMap,as=new WeakMap,tu=new WeakMap,wr=new WeakSet,KX=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},JX=function(t){let r=t[0],n=t[t.length-1],o=!1;return _(this,Ol,{promise:new Promise(async i=>{var s,a,l;if(g.env.NODE_ENV!=="test"&&await YX(500),o||!t.length){i();return}(s=c(this,lt).createMarkers)!=null&&s.departure&&ee(this,wr,th).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let u=0;u<t.length;u++){let d=t[u],f=u?{...c(this,lt).inactivePathOptions}:{...c(this,lt).pathOptions};if(d.coordinates.length<2){$.warn("Directions must have at least 2 coordinates"),i();return}let h=this.currentMap.Paths.add(d.coordinates,{...f,animateDrawing:c(this,lt).animatePathDrawing}),b=h.paths.map(I=>I.id.toString()),v=new os(Et(),h.animation,d.coordinates,h.paths);for(let I of b){c(this,So).set(I,{path:v,entityIds:b});let x=u?{...c(this,lt).inactivePathOptions,altitude:0}:{...c(this,lt).pathOptions,altitude:.05};c(this,is).setState(I,x)}if(c(this,So).set(v.id,{path:v,entityIds:b}),c(this,as).set(d,v),c(this,tu).set(v,d),g.env.NODE_ENV!=="test"&&await h.animation,o){i();return}(a=c(this,lt).createMarkers)!=null&&a.connection&&ee(this,wr,SO).call(this,d.instructions,"connection"),u===0&&(_(this,ss,c(this,as).get(c(this,Br)[0])),c(this,is).on("click",c(this,rh)))}if((l=c(this,lt).createMarkers)!=null&&l.destination&&ee(this,wr,th).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),o){i();return}c(this,Ml).mapObjects.forEach(u=>{u.processFloorChange(u.currentFloorId)}),i()}),cancel:()=>{o=!0}}),c(this,Ol).promise},IO=function(t){var r,n,o;_(this,lt,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:eu.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:eu.setMapToDeparture,pathOptions:{...eu.pathOptions,...t.pathOptions},inactivePathOptions:{...eu.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...eu.createMarkers,...t.createMarkers},markerOptions:{...eu.markerOptions,...t.markerOptions},animatePathDrawing:(o=t.animatePathDrawing)!=null?o:eu.animatePathDrawing})},MS=function(t){_(this,ss,t),c(this,Br).forEach(r=>{let n=c(this,as).get(r);if(n){let o=c(this,So).get(n.id),i=o.path.id===c(this,ss).id?{...c(this,lt).pathOptions,altitude:.05}:{...c(this,lt).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{c(this,is).setState(s,i)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},th=function(t,r,n){var o,i,s,a,l;if(r==="connection"&&n){let u=n.action.type==="ExitConnection"?c(this,lt).markerOptions.departureColor:c(this,lt).markerOptions.destinationColor,d;if(typeof((o=c(this,lt).createMarkers)==null?void 0:o.connection)=="function"){let h=c(this,lt).createMarkers.connection(n);c(this,is).setState(h.id.toString(),{options:{interactive:!0}}),d={id:h.id,type:"marker"}}else d=this.currentMap.Markers.add(n.coordinate,XX({type:(s=(i=n.action.connection)==null?void 0:i.type)!=null?s:n.action.connectionType,color:u,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let f=this.currentMap.Markers.getContentEl(d.id.toString());if(!f)throw new Error("marker component should exist");c(this,wl).set(d.id,{instruction:n,marker:new Tl(d.id.toString(),f,n.coordinate)})}else{let u=r==="departure"?c(this,lt).markerOptions.departureColor:c(this,lt).markerOptions.destinationColor,d;typeof((a=c(this,lt).createMarkers)==null?void 0:a.departure)=="function"&&r==="departure"?d={id:c(this,lt).createMarkers.departure(n).id,type:"marker"}:typeof((l=c(this,lt).createMarkers)==null?void 0:l.destination)=="function"&&r==="destination"?d={id:c(this,lt).createMarkers.destination(n).id,type:"marker"}:d=this.currentMap.Markers.add(t,ZX({type:r,color:u}),{anchor:"top",rank:"always-visible"}),c(this,wl).set(d.id,void 0)}},SO=function(t,r){t.filter(o=>ee(this,wr,KX).call(this,o.action)).forEach(o=>{ee(this,wr,th).call(this,o.coordinate,r,o)})},rh=new WeakMap;p();p();p();var WPe=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>']]),qPe=/<svg([^>]*)>/g;function QX(e,t,r){let n=WPe.get(e);return n?n.replace(qPe,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}var pd,nh,Co,CO,eY,tY,PO,rY,OS=class{constructor(t,r){M(this,Co);M(this,pd);M(this,nh);m(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});_(this,pd,t),_(this,nh,r)}auto(){let t=[],r=c(this,nh)[Object.keys(c(this,nh))[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,pd).Labels.add(o,i,ee(this,Co,CO).call(this,n));t.push(s)}});else{n.__type==="space"&&n.name!==""&&c(this,pd).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let o=n.name;if(o){let i=c(this,pd).Labels.add(n,o,ee(this,Co,CO).call(this,n));t.push(i)}}}),{labels:t}}};pd=new WeakMap,nh=new WeakMap,Co=new WeakSet,CO=function(t){let r=QX(ee(this,Co,eY).call(this,t),"white",12);return{appearance:{text:{foregroundColor:ee(this,Co,PO).call(this,t)},marker:{foregroundColor:{active:ee(this,Co,PO).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:ee(this,Co,rY).call(this,t)}},eY=function(t){return t.__type==="connection"?ee(this,Co,tY).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},tY=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},PO=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},rY=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var ES=class{constructor(t,r){m(this,"Labels");m(this,"auto",()=>this.Labels.auto());this.Labels=new OS(t,r)}};p();var $e,a1,El,_S,TO,s1=class{constructor(t){M(this,El);M(this,$e);M(this,a1);m(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(c(this,$e).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(c(this,$e).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(c(this,$e).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{c(this,$e).getSystems().cameraSystem.enablePan=!0,c(this,$e).getSystems().cameraSystem.enableZoom=!0,c(this,$e).getSystems().cameraSystem.enableRotate=!0},disable:()=>{c(this,$e).getSystems().cameraSystem.enablePan=!1,c(this,$e).getSystems().cameraSystem.enableZoom=!1,c(this,$e).getSystems().cameraSystem.enableRotate=!1}});m(this,"setMinPitch",t=>{c(this,$e).camera.setMinPitch(t)});m(this,"setMaxPitch",t=>{c(this,$e).camera.setMaxPitch(t)});m(this,"setMinZoomLevel",t=>{c(this,$e).camera.setMinZoomLevel(t,!0)});m(this,"setMaxZoomLevel",t=>{c(this,$e).camera.setMaxZoomLevel(t)});_(this,a1,t),_(this,$e,t.core)}setScreenOffsets(t){c(this,$e).camera.setInsetPadding(t)}get screenOffsets(){return c(this,$e).camera.insetsPadding}get panMode(){return c(this,$e).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&c(this,$e).camera.setPanMode(t)}getFocusOnTransform(t,r){var o;let n=c(this,$e).camera.getCameraFrameForCoordinates(ee(this,El,TO).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(o=r==null?void 0:r.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new Le(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return c(this,$e).camera.focusOn(ee(this,El,TO).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,$e).camera.animateTo({center:n!=null?[a.longitude,a.latitude,c(this,$e).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,$e).camera.setCenter(s),c(this,$e).camera.setZoomLevel(n),c(this,$e).camera.setBearing(o),c(this,$e).camera.setPitch(i)}get center(){let t=c(this,$e).camera.center;return new Le(t[1],t[0],void 0)}setAutoMinZoomLevel(t){c(this,$e).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return c(this,$e).camera.autoMinZoomLevel}get zoomLevel(){return c(this,$e).camera.zoomLevel}get pitch(){return c(this,$e).camera.pitch}get minPitch(){return c(this,$e).camera.minPitch}get maxPitch(){return c(this,$e).camera.maxPitch}get bearing(){let t=c(this,$e).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return c(this,$e).camera.minZoomLevel}get maxZoomLevel(){return c(this,$e).camera.maxZoomLevel}setElevation(t){c(this,$e).camera.setElevation(t)}get elevation(){return c(this,$e).camera.elevation}animateElevation(t,r){return c(this,$e).camera.animateElevation(t,r)}updateFacadesInView(){c(this,$e).getSystems().geometryInFocusSystem.raycast()}};$e=new WeakMap,a1=new WeakMap,El=new WeakSet,_S=function(t){var n,o,i,s,a,l;let r=c(this,$e).camera.elevation;return Le.is(t)&&t.floorId!=null?(o=(n=c(this,$e).getState(t.floorId))==null?void 0:n.altitude)!=null?o:r:No.is(t)?(s=(i=c(this,$e).getState(t.id))==null?void 0:i.altitude)!=null?s:r:"floor"in t&&No.is(t.floor)&&(l=(a=c(this,$e).getState(t.floor.id))==null?void 0:a.altitude)!=null?l:r},TO=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(Le.is(s)){let a=ee(this,El,_S).call(this,s);r.push([s.longitude,s.latitude,a])}else if((s==null?void 0:s.id)!=null){let a=ee(this,El,_S).call(this,s);if(No.is(s)&&((i=c(this,a1).getMapDataInternal())!=null&&i.enterpriseMode)){r.push(s.id);continue}else if("geoJSON"in s&&s.geoJSON.geometry.coordinates.length>0){IE(s.geoJSON,u=>{r.push([u[0],u[1],a])});continue}let l=c(this,$e).getBoundingArea(s.id);if(l)r.push(...l.map(u=>[u[0],u[1],a]));else if("geoJSONBoundingBox"in s){let u=ee(this,El,_S).call(this,s);if(s.geoJSONBoundingBox!=null){let d=[[s.geoJSONBoundingBox[0],s.geoJSONBoundingBox[1],u],[s.geoJSONBoundingBox[2],s.geoJSONBoundingBox[3],u]];r.push(...d)}}}else f4(s)&&r.push(s);return r};p();var oh,l1=class{constructor({currentMapGetter:t}){M(this,oh);_(this,oh,t)}get currentMap(){return c(this,oh).call(this)}async getCurrentSceneGLTF(t){let r=c(this,oh).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):($.error("There is no map to export. Please load a map first."),new Blob)}};oh=new WeakMap;p();var ma,u1,c1=class{constructor({currentMapGetter:t}){M(this,ma,new Map);M(this,u1);_(this,u1,t)}get currentMap(){return c(this,u1).call(this)}getById(t){return c(this,ma).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,{...n,attachTo:dm(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank}),a=new Yc(s.id.toString(),r,t);return c(this,ma).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 Yc(o.toString(),i,s);c(this,ma).set(a.id,{label:a,entityId:a.id}),r.push(a)},labelOptions:t}),r}remove(t){var n;let r=c(this,ma).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),c(this,ma).delete(t.id.toString()))}removeAll(){let t=[];return c(this,ma).forEach(({label:r})=>{this.remove(r),t.push(r),c(this,ma).delete(r.id.toString())}),t}};ma=new WeakMap,u1=new WeakMap;p();p();var wO={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},nY={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},oY=.5,_l=class{constructor(t,r,n=new Map){m(this,"containerId");m(this,"layers");m(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}},dd,p1=class{constructor(t,r,n,o,i,s,a,l){m(this,"id");m(this,"name");m(this,"elevation");m(this,"containerId");m(this,"externalId");m(this,"metadata");m(this,"shortName");m(this,"subtitle");m(this,"occluderId");m(this,"loaded",!1);m(this,"styleMap",{});m(this,"obstructions");m(this,"entrances");m(this,"spaces");m(this,"floorImages");m(this,"floorText");m(this,"renderer");m(this,"options");m(this,"layers",new Map);m(this,"footprint");m(this,"floorStackId");m(this,"multiFloorView");m(this,"mapDataInternal");m(this,"facadesByStyleId",new Map);M(this,dd);m(this,"load",()=>{var o,i,s,a,l,u,d,f,h,b,v,I,x,C;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(al,"-").concat(this.id),{},this.id);this.layers.set(al,new _l(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(Qs,"-").concat(this.id),{},this.id);this.layers.set(Qs,new _l(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(_r,"-").concat(this.id),{},this.id);if(this.layers.set(_r,new _l(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=wO;if(this.obstructions!=null&&this.obstructions.features.length>0){let O=this.obstructions.features.filter(N=>N.geometry.type==="LineString"&&N.properties.kind==="Wall"&&N.properties.footprintComponent===!0);O!=null&&O.length>0&&(P=this.styleMap[(s=O[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)}}]},{...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(hg,new _l(this.renderer,w.id.toString()));let T=this.renderer.addGroupContainer("".concat(im,"-").concat(this.id),{},this.id);this.layers.set(im,new _l(this.renderer,T.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,T.id)}if(this.spaces!=null&&this.spaces.features.length>0){let P=[],w=new Map;this.spaces.features.filter(k=>{var D;return k.geometry.type==="Polygon"&&((D=k.properties.kind)==null?void 0:D.toLowerCase())!=="void"}).forEach(k=>{var F;let D=(F=this.mapDataInternal)==null?void 0:F.facadesBySpaceId[k.properties.id];if(D){let z=w.get(D.id)||[];w.set(D.id,[...z,k])}else P.push(k)});let T=$2(P,this.styleMap),O=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),N=0;for(let[k,D]of T){let F=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(N),{features:D},pm(k,this.options),O);N++;let z=O.id.toString();this.layers.get(_r).layers.set(k.id||z,F.id.toString())}if(w.size>0){let k=this.renderer.addGroupContainer("".concat(up,"-").concat(this.id),{},this.id);this.layers.set(up,new _l(this.renderer,k.id.toString()));for(let[D,F]of w){let z=this.renderer.addGroupContainer(D,{focusable:!0},k),G=this.renderer.addGroupContainer("".concat(D,"-geometry"),{},z),j=$2(F,this.styleMap),K=0;for(let[Z,oe]of j){let Q=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(D,"-").concat(K),{features:oe},{...pm(Z,this.options),renderOrder:3},G);K++;let ge=Z.id||Q.id.toString();this.layers.get(up).layers.set("".concat(D,"-").concat(ge),Q.id.toString()),this.facadesByStyleId.has(ge)?(u=this.facadesByStyleId.get(ge))==null||u.push(D):this.facadesByStyleId.set(ge,[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=$2(P,this.styleMap),T=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),O=0;for(let[G,j]of w){let K=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(O),{features:j},pm(G,this.options),T);O++;let Z=T.id.toString();this.layers.get(_r).layers.set(G.id||Z,K.id.toString())}let N=this.obstructions.features.filter(G=>G.geometry.type==="LineString"&&G.properties.kind==="Wall"&&G.properties.footprintComponent===!1),k=this.obstructions.features.filter(G=>G.geometry.type==="LineString"&&G.properties.kind==="Wall"&&G.properties.footprintComponent===!0),D=this.entrances,F=wO,z=wO;if(N!=null&&N.length>0){let G=this.styleMap[(d=N[0].properties)==null?void 0:d.id];G!=null&&(F={...G}),z=F;let{walls:j,entrances:K}=B4(N,(D==null?void 0:D.features)||[]),Z=Math.max(F.height-.11,oY),oe={...nY,height:Z},Q=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),K,oe,n);this.layers.get(_r).layers.set(nm,Q.id.toString());let ge=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[j]},pm(F,this.options),n);this.layers.get(_r).layers.set(Tc,ge.id.toString())}if(k!=null&&k.length>0){let G=this.styleMap[(f=k[0].properties)==null?void 0:f.id];G!=null&&(z={...G,id:Js});let{walls:j,entrances:K}=B4(k,(D==null?void 0:D.features)||[]),Z=Math.max(z.height-.11,oY),oe={...nY,height:Z},Q=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),K,oe,n);this.layers.get(_r).layers.set(om,Q.id.toString());let ge=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[j]},pm(z,this.options),n);this.layers.get(_r).layers.set(Js,ge.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(Et(),w,{url:w.properties.path,flipImageToFaceCamera:(b=this.options.flipImagesToFaceCamera)!=null?b:!0},P);this.layers.set(AH,new _l(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=(x=P.properties.verticalOffset)!=null?x:0,this.renderer.addText3D(Et(),{...P,properties:{...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 d,f,h,b;this.id=r.id,this.options=i;let u=n.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=u.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,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=(d=s.floorImages)==null?void 0:d[this.id],this.floorText=(h=(f=s.enterprise)==null?void 0:f.floorText)==null?void 0:h[this.id],this.footprint=(b=s["floor.geojson"])==null?void 0:b.features.find(v=>v.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=o,this.mapDataInternal=l}get geoJSONBoundingBox(){if(c(this,dd))return c(this,dd);if(!this.footprint){$.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return _(this,dd,j2(this.footprint)),c(this,dd)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};dd=new WeakMap;p();var OO=50,EO=!1,ZPe=1e3,hr,ih,ha,ls,vn,f1,nu,sh,fd,Po,AO,md,m1,h1,y1,g1,Al,lY,b1,ou,kO,cY,uY,hd,d1=class extends De{constructor({currentMapGetter:r}){super();M(this,Po);M(this,hr);M(this,ih,0);M(this,ha);M(this,ls,!1);M(this,vn,[]);M(this,f1,0);M(this,nu,OO);M(this,sh,!1);M(this,fd,"collapsed");m(this,"expandedFactor",0);M(this,md,"all-floors");M(this,m1,()=>{let r=c(this,hr).call(this);if(c(this,f1)===this.expandedFactor||r==null||!c(this,ls))return;_(this,f1,this.expandedFactor);let n=Ss(this.expandedFactor,0,1,0,this.distanceBetweenFloors),i=Ss(this.expandedFactor,0,.1,0,1)===0;c(this,vn).forEach((s,a)=>{r.api.updateState(s.containerId,{visible:i?s.id===r.currentFloorId:!0,altitude:n*a})}),this.expandedFactor===0?(_(this,ls,!1),r.renderer.camera.setPanMode("default"),c(this,ou)&&c(this,ou).call(this)):this.expandedFactor===1&&(_(this,ls,!1),c(this,ou)&&c(this,ou).call(this))});M(this,h1,()=>{var r,n,o;this.expanded&&_(this,ih,(n=(r=c(this,hr).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(o=c(this,hr).call(this))==null||o.renderer.on("user-interaction-end",c(this,g1))});M(this,y1,()=>{var n;let r=c(this,hr).call(this);if(r!=null&&this.expanded&&c(this,sh)&&!c(this,ls)){let o=r.currentFloorId,i=[1/0,r.currentFloorId];for(let s=0;s<c(this,vn).length;s++){let a=c(this,vn)[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,vn).forEach(s=>{r.api.updateState(s.containerId,{visible:c(this,md)==="all-floors"?!0:r.currentFloor.id===s.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:o}))}});M(this,g1,()=>{var n,o;let r=c(this,hr).call(this);if(this.expanded&&r&&c(this,ih)!==((n=r.renderer.camera.elevation)!=null?n:0)){let i=[1/0,r.currentFloorId,0];for(let s=0;s<c(this,vn).length;s++){let a=c(this,vn)[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,sh)&&ee(this,Po,lY).call(this,i[2]),_(this,ih,0),r.renderer.off("user-interaction-end",c(this,g1))}});M(this,Al,null);M(this,b1,null);M(this,ou);M(this,hd);_(this,hr,r);let n=c(this,hr).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",c(this,h1)),n.renderer.on("camera-change",c(this,y1)),n.renderer.on("pre-render",c(this,m1)))}get state(){return c(this,fd)}get expanded(){return c(this,fd)!=="collapsed"}get distanceBetweenFloors(){if(c(this,nu)==="auto"){if(c(this,hd)!=null)return c(this,hd);let r=ee(this,Po,uY).call(this);if(r)return _(this,hd,r),r}return typeof c(this,nu)=="number"?c(this,nu):OO}clearCachedFloorSeparationDistance(){_(this,hd,void 0)}get includedFloors(){var r;return(r=c(this,Po,AO))!=null&&r.api.mapData?c(this,vn).map(n=>{var o,i;return(i=(o=c(this,Po,AO))==null?void 0:o.api.mapData)==null?void 0:i.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return c(this,md)}setFloorVisiblityMode(r){_(this,md,r);let n=c(this,hr).call(this);n!=null&&c(this,vn).forEach(o=>{n.api.updateState(o.containerId,{visible:c(this,md)==="all-floors"?!0:n.currentFloor.id===o.id})})}changeFloorOnElevationChanges(r){_(this,sh,r)}async expand(r){var o,i,s;let n=c(this,hr).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?_(this,nu,"auto"):_(this,nu,(o=r==null?void 0:r.distanceBetweenFloors)!=null?o:OO),_(this,vn,(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,vn).sort((a,l)=>a.elevation-l.elevation),c(this,vn).length<=1||this.expanded===!0?Promise.resolve():(_(this,ls,!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,Po,kO).call(this,"expand",r).then(()=>{_(this,fd,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{_(this,ls,!1)}))}async collapse(r){let n=c(this,hr).call(this);if(n!=null)return this.expanded===!0?(_(this,ls,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),ee(this,Po,kO).call(this,"collapse",r).then(()=>{_(this,fd,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{_(this,ls,!1)})):Promise.resolve()}destroy(){let r=c(this,hr).call(this);r!=null&&(r.renderer.off("user-interaction-start",c(this,h1)),r.renderer.off("camera-change",c(this,y1)),r.renderer.off("pre-render",c(this,m1)))}};hr=new WeakMap,ih=new WeakMap,ha=new WeakMap,ls=new WeakMap,vn=new WeakMap,f1=new WeakMap,nu=new WeakMap,sh=new WeakMap,fd=new WeakMap,Po=new WeakSet,AO=function(){return c(this,hr).call(this)},md=new WeakMap,m1=new WeakMap,h1=new WeakMap,y1=new WeakMap,g1=new WeakMap,Al=new WeakMap,lY=function(r){var o,i,s;c(this,Al)&&c(this,Al).stop();let n=c(this,hr).call(this);n!=null&&(_(this,Al,new Io({elevation:(o=n.renderer.camera.elevation)!=null?o:0}).to({elevation:r},150).easing(kr.Quadratic.Out).onComplete(()=>{var a;c(this,Al)&&((a=c(this,hr).call(this))==null||a.renderer.getTweenGroup().remove(c(this,Al)))}).onUpdate(({elevation:a})=>{n.renderer.camera.setElevation(a)}).start()),(i=c(this,hr).call(this))==null||i.renderer.getTweenGroup().add(c(this,Al)),(s=c(this,hr).call(this))==null||s.renderer.render())},b1=new WeakMap,ou=new WeakMap,kO=function(r,n){var a,l,u,d;c(this,ha)&&c(this,ha).stop();let o=c(this,hr).call(this);if(o==null)return Promise.reject(new Error("No current map"));let i=c(this,vn).indexOf(o.currentFloor),s=(a=o.renderer.camera.elevation)!=null?a:0;return _(this,b1,new Promise(f=>{_(this,ou,f)})),_(this,ha,new Io({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(l=n==null?void 0:n.duration)!=null?l:ZPe).easing(Sl[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:f})=>{this.expandedFactor=f;let h=i*this.distanceBetweenFloors;o.renderer.camera.setElevation(r==="expand"?h*f:s*f)}).onComplete(()=>{var f;c(this,ha)&&((f=c(this,hr).call(this))==null||f.renderer.getTweenGroup().remove(c(this,ha)))}).start()),c(this,ha).cameraAnimation=!0,(u=c(this,hr).call(this))==null||u.renderer.getTweenGroup().add(c(this,ha)),(d=c(this,hr).call(this))==null||d.renderer.render(),c(this,b1)},cY=function(r,n,o,i){let s=_O(r,o),a=n.clone(),l=_O(a,o);if(!du(s)||!du(l))return-1;let u=0,d;EO&&i.querySelectorAll(".debug-box").forEach(h=>h.remove());do{if(u>1e4)return-1;if(u+=20,a.position.z=u,a.updateMatrixWorld(),l.makeEmpty(),_O(a,o,l),d=s.intersectsBox(l),EO){let f=aY(s,"blue",i),h=aY(l,d?"red":"green",i);f.classList.add("debug-box"),h.classList.add("debug-box")}}while(d);return u},uY=function(){let r=c(this,hr).call(this);if(!r)return;let n=r.renderer,o=n.getThreeScene();if(!r.api.mapData||!o)return;let s=c(this,vn).length>0?c(this,vn):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(ZS(a,"group-container"),ZS(l,"group-container"),EO){let d=new Xr;d.setFromObject(a);let f=new Xr;if(f.setFromObject(l),a.children.forEach(P=>{P instanceof Ve&&P.userData.debugBox&&mr(P)}),l.children.forEach(P=>{P instanceof Ve&&P.userData.debugBox&&mr(P)}),!du(d)||!du(f))return;let h=new Pi(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),b=new $r({color:255,transparent:!0,opacity:.5}),v=new Ve(h,b);v.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),v.userData.debugBox=!0;let I=new Pi(f.max.x-f.min.x,f.max.y-f.min.y,f.max.z-f.min.z),x=new $r({color:"cyan",transparent:!0,opacity:.5}),C=new Ve(I,x);C.position.set((f.min.x+f.max.x)/2,(f.min.y+f.max.y)/2,(f.min.z+f.max.z)/2),C.userData.debugBox=!0,a.add(v),l.add(C)}let u=ee(this,Po,cY).call(this,a,l,n.getThreeCamera(),n.container);if(u!==-1)return u},hd=new WeakMap;var ru=new Ce,iY=new Ee;function _O(e,t,r=new uE){return e.traverse(n=>{if(n instanceof Ve){let i=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let a=0;a<i.count;a++)ru.fromBufferAttribute(i,a),ru.applyMatrix4(n.matrixWorld),ru.applyMatrix4(t.matrixWorldInverse),ru.applyMatrix4(t.projectionMatrix),ru.z<1&&ru.z>0&&(iY.set(ru.x,ru.y),r.expandByPoint(iY))}}),r}function sY(e,t){let r=t.clientWidth,n=t.clientHeight;return new Ee((e.x+1)*r/2,(1-e.y)*n/2)}function aY(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=sY(new Ee(e.min.x,e.min.y),r),i=sY(new Ee(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}p();p();function XPe(e,t){return"".concat(t," ").concat(e)}var Bn=class extends Error{constructor(t,r=zO){super(XPe(t,r)),this.name="MappedinError"}};var ah,v1=class{constructor(t,r,n,o){m(this,"id");m(this,"externalId");m(this,"name");m(this,"type");m(this,"floorIds");m(this,"defaultFloorId");m(this,"floorObjects",[]);m(this,"floorObjectsByElevation",new Map);m(this,"metadata");m(this,"containerId");m(this,"facade");m(this,"renderer");M(this,ah);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,ah)==null){if(this.floorObjects.length===0)throw new Bn("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),_(this,ah,t)}return c(this,ah)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){$.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})})}};ah=new WeakMap;p();function pY(e,t,r,n){let o={outdoorOpacity:1,floorStates:[]},i=e.sort((d,f)=>d.elevation-f.elevation),s=Math.min(0,i[0].elevation),a=i[i.length-1].elevation,l,u;for(let d=s;d<=a;d++){let f=i.find(x=>x.elevation===d);if(f==null){d>=0&&(l==null?l=d:u=d);continue}let h=0,b=d<0?Math.abs(f.elevation)*r:r,v=!1;if(l===0&&u!=null){let x=r*u;h=-x,b=x,v=!0}else if(l!=null&&u!=null){let x=l,C=e.find(w=>w.elevation===x-1),P=o.floorStates.find(w=>w.floor===C);if(P){let w=r*(u-l+2);P.state.footprint={...P.state.footprint,altitude:0,height:w,visible:!0}}}l=void 0,u=void 0;let I={floor:f,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};o.floorStates.push(I),f.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,(f.elevation<0||v)&&(f.elevation<0&&(o.outdoorOpacity=.2),I.state.footprint.height=b,I.state.footprint.altitude=h,I.state.footprint.visible=!0)):n.includes(f.id)&&f.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,f.elevation<0?(I.state.footprint.height=b,I.state.footprint.altitude=h,o.outdoorOpacity=.2):(I.state.footprint.height=b,I.state.footprint.altitude=h)):t.elevation>0&&f.elevation<t.elevation&&f.elevation>=0&&(I.state.visible=!0,I.state.footprint.visible=!0,I.state.footprint.height=r,I.state.footprint.altitude=h)}return o}var YPe={linear:kr.Linear.None,easeIn:kr.Quadratic.In,easeOut:kr.Quadratic.Out,easeInOut:kr.Quadratic.InOut},ya,x1=class extends De{constructor(r,n,o,i){var u,d,f,h;super();m(this,"floorStacksById",new Map);m(this,"floorsById",new Map);m(this,"currentFloorId","");m(this,"currentFloorStackId","");m(this,"outdoorFloorStacks",new Set);m(this,"id");m(this,"renderer");m(this,"api");m(this,"mvf");m(this,"options",{});m(this,"styleMap");m(this,"StackedMaps");m(this,"animations",new Map);m(this,"Models",{add:(r,n,o)=>{let{floorId:i,scale:s,...a}=o,l=i?this.floorsById.get(i):this.currentFloor,u={...a};s!=null&&(u.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let d=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(f=>{var h;return{type:"Feature",properties:{id:Et(),rotation:o.rotation,scale:u.scale,interactive:o.interactive,verticalOffset:f.verticalOffset+((h=o.verticalOffset)!=null?h:0)},geometry:{type:"Point",coordinates:yi(f)}}})},u,{parent:l.id});if(d==null)throw new Bn("error creating model");return this.renderer.getState(d).children},remove:(r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)}});m(this,"Images",{add:(r,n,o)=>{let{floorId:i,flipImageToFaceCamera:s,...a}=o,l=i?this.floorsById.get(i):this.currentFloor,u={type:"Feature",properties:a,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(Et(),u,{url:n,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:r=>{this.renderer.remove(r)},removeAll:()=>{}});m(this,"Markers",{add:(r,n,o)=>{let i=G4(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:s,...a}=o,l=a;a.rank==="initial"&&(l.rank="medium");let u=i.layers.get(Qs),d=this.renderer.addMarker2D(yi(r),n,{...l,occluderId:i==null?void 0:i.occluderId,attachTo:s},u==null?void 0:u.containerId);if(!d)throw new Bn("Failed to create Marker");return d},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){$.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(i.type!=="marker"){$.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(Qs))==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 $.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(s.type!=="marker")return $.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...i};this.cancelAnimation(r);let u=new Io({lon:s.position[0],lat:s.position[1]}).to({lon:n[0],lat:n[1]},l.duration).easing(YPe[l.easing]).onUpdate(({lon:d,lat:f})=>{var b;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let v=(b=a==null?void 0:a.layers.get(Qs))==null?void 0:b.containerId;v&&this.Markers.setPosition(r,[d,f],v)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(r,u),j4(u).then(()=>{this.animations.delete(r)})}});m(this,"Exporter",{getCurrentSceneGLTF:async r=>this.renderer.getCurrentSceneGLTF(r)});m(this,"Shapes",{add:(r,n,o)=>{let i=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=Et();return this.renderer.addGeometryGroup(s,r,n,i.id),s},remove:r=>(this.renderer.remove(r.id),r.id)});m(this,"Text3D",{label:(r,n,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){$.warn("Enterprise mode is not enabled, skipping label creation");return}let i=dY(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 $.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 u=dY(this.renderer,s,(l=(a=s.locations[0])==null?void 0:a.name)!=null?l:s.name,r);u&&o.push({textInfo:u,target:s})}}),o},remove:r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){$.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r}});m(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,x,C,P,w;let l=(I=this.api.getMapData())==null?void 0:I.getById("space",a.properties.id);if(!l)return;let u=(x=this.styleMap[a.properties.id])==null?void 0:x.showImage,d=(C=a.properties.details)==null?void 0:C.images,h={marker:{...u&&((P=d==null?void 0:d[0])!=null&&P.url)?{icon:d[0].url}:{},...(w=n.appearance)==null?void 0:w.marker},...n.appearance},v=(i?this.floorsById.get(i):this.currentFloor).layers.get(al);if(a.properties.center&&l.name!==""){let T=this.renderer.addLabel2D(a.properties.center,l.name,{id:a.properties.id+"-label",...n,appearance:h,rank:n.rank,attachTo:dm(l)},Qr.is(l)?l.id:v==null?void 0:v.containerId);T&&r(T.id,l.name,l)}})}},add:(r,n,o={})=>{let{attachTo:i,...s}=o,a=G4(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),l=a.layers.get(al),u=this.renderer.addLabel2D(yi(r),n,{...s,occluderId:a.occluderId,attachTo:i},l==null?void 0:l.containerId);if(!u)throw new Bn("label creating failed");return u},remove:({entityId:r})=>{this.renderer.remove(r)},removeAll:()=>{}});m(this,"Paths",{add:(r,n)=>{var u;let o=(u=n==null?void 0:n.animateDrawing)!=null?u:!0,i=[],s=r[0].floorId||"root",a=0;for(let d of r){let{floorId:f="root",latitude:h,longitude:b}=d;f!==s&&(a++,s=f),i[a]==null&&i.push({floorId:f,coordinates:[]});let v=f===d.floorId?d:new Le({longitude:b,latitude:h,floorId:f});i[a].coordinates.push(v)}let l=i.reduce((d,{floorId:f,coordinates:h},b)=>{if(b!==0){let I=i[b-1],x=I.coordinates[I.coordinates.length-1],C=h[0],P=yi(x),w=yi(C),T=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:I.floorId},geometry:{type:"Point",coordinates:P}},{type:"Feature",properties:{parentId:f},geometry:{type:"Point",coordinates:w}}]},n,this.id);T&&(n!=null&&n.animateDrawing&&this.renderer.setState(T.id,{completeFraction:0}),d.push({...T,coordinates:[x,C]}))}let v=this.renderer.addPath({type:"FeatureCollection",features:h.map(I=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:yi(I)}}))},n,f);return v&&(n!=null&&n.animateDrawing&&this.renderer.setState(v.id,{completeFraction:0}),d.push({...v,coordinates:h})),d},[]);if(o){let d=[],f=this.api.getMapData();return l.forEach(h=>{var v;let b=rW(h,f,this.api);d.push(new Io({fraction:0}).to({fraction:1},b===!1?0:(v=n==null?void 0:n.drawDuration)!=null?v:1500).onUpdate(I=>{this.renderer.setState(h.id,{completeFraction:I.fraction})}))}),d.forEach((h,b)=>{b<d.length-1&&h.chain(d[b+1]),this.renderer.getTweenGroup().add(h)}),d[0].start(),this.renderer.render(),this.animations.set(l[0].id.toString(),d[0]),{paths:l,animation:j4(d[d.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)})}});M(this,ya,{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 d1({currentMapGetter:()=>this}),this.mvf=(u=n==null?void 0:n.mvf)!=null?u:{};let s=JH(this.mvf["styles.json"]||{});if(this.styleMap=s,_(this,ya,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!n){this.id!=="outdoors-container"&&$.warn("Map (".concat(this.id,") created with no data."));let b=new v1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(b.id,b),this.currentFloorStackId=b.id;let v=new p1(b.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,c(this,ya),o!=null?o:{});b.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 Bn("MVF does not contain any Floor Stacks.");for(let b of a){let v=new v1(b,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[b.id]);if(v.floorIds.length!==0){for(let I of v.floorIds){let x=n.getMVFFeatureById("floor",I);if(x!=null){let C=this.mvf.space[x.id],P=this.mvf.obstruction[x.id];if((C==null||C.features.length===0)&&(P==null||P.features.length===0))continue;let w=new p1(v.id,x,this.renderer,c(this,ya),o!=null?o:{},this.mvf,s,n);v.addFloor(w),this.floorsById.set(w.id,w)}}this.floorStacksById.set(b.id,v),this.currentFloorStackId||(this.currentFloorStackId=b.id)}}for(let[b]of Object.entries(n.facadesBySpaceId)){let v=n.getById("space",b);v&&(this.outdoorFloorStacks.add(v.floor.floorStack.id),(f=this.floorsById.get(v.floor.id))==null||f.setVisible(!0))}let l=(h=this.mvf.enterprise)==null?void 0:h.venue.defaultMap;if(o!=null&&o.initialFloor){let b=sg(o.initialFloor);b&&this.floorsById.has(b)?l=b:$.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 Bn('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let o=this.floorStacksById.get(r);if(o==null){$.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){$.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(o.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Bn('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var i,s,a,l,u;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),o=this.floorStacksById.get(this.currentFloorStackId);if(n&&o)if(!((i=c(this,ya))!=null&&i.enabled)||n.floorStackId!==(o==null?void 0:o.id))for(let d of this.floorStacksById.values())d.floorObjects.forEach(f=>{f.id!==r&&f.setVisible(!1)});else{let d=pY(this.currentFloorStack.floorObjects,n,c(this,ya).floorHeight,((a=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:a.map(f=>f.id))||[]);(u=(l=this.api)==null?void 0:l.Outdoor)==null||u.setOpacity(d.outdoorOpacity),d.floorStates.forEach(f=>{f.floor&&this.api.updateState(f.floor.id,f.state)}),c(this,ya).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*c(this,ya).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){$.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))}};ya=new WeakMap;function dY(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,{...n,parentId:t.floor.id})}p();var cs,S1,I1=class{constructor({currentMapGetter:t}){M(this,cs,new Map);M(this,S1);_(this,S1,t)}get currentMap(){return c(this,S1).call(this)}getById(t){return c(this,cs).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,{...n,rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:dm(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 Tl(s.id.toString(),a,t);return c(this,cs).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var n;let r=c(this,cs).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),c(this,cs).delete(t.id.toString()))}removeAll(){let t=[];return c(this,cs).forEach(({marker:r})=>{this.remove(r),t.push(r),c(this,cs).delete(r.id.toString())}),t}setPosition(t,r){var s;let n=r.anchorTarget;if(!n){$.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){$.error("Cannot determine the current map.");return}let i=c(this,cs).get(t.id);if(!i){$.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(i.entityId,yi(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 $.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return $.error("Cannot determine the current map."),Promise.resolve();let s=c(this,cs).get(t.id);return s?(s.marker.updateTarget(r),i.Markers.animateTo(s.entityId,yi(o),(a=o.floorId)!=null?a:i.currentFloorId,n)):($.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};cs=new WeakMap,S1=new WeakMap;p();var kl,P1,C1=class{constructor({currentMapGetter:t}){M(this,kl,new Map);M(this,P1);_(this,P1,t)}get currentMap(){return c(this,P1).call(this)}getById(t){return c(this,kl).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(yi(o),r,{...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 Yb(s.id.toString(),r,t);return c(this,kl).set(a.id,{image:a,entityId:s.id.toString()}),a}remove(t){var n;let r=c(this,kl).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),c(this,kl).delete(t.id.toString()))}removeAll(){let t=[];return c(this,kl).forEach(({image:r})=>{this.remove(r),t.push(r),c(this,kl).delete(r.id.toString())}),t}};kl=new WeakMap,P1=new WeakMap;p();var ga,w1,T1=class{constructor({currentMapGetter:t}){M(this,ga,new Map);M(this,w1);_(this,w1,t)}get currentMap(){return c(this,w1).call(this)}getById(t){return c(this,ga).get(t)}add(t,r,n){let o=[t],i=o.reduce((l,u)=>{var d;return u?(l.has(u.floorId)||l.set(u.floorId,[]),(d=l.get(u.floorId))==null||d.push(u),l):($.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,u)=>{let d=Et();s.Models.add(d,l,{...n,url:r,floorId:u}).forEach(({id:h})=>{let b=new cd(h.toString(),d,l[0]);c(this,ga).set(b.id,{model:b,entityId:h.toString(),groupId:d}),a.push(b)})}),a[0]}remove(t){var n;let r=c(this,ga).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),c(this,ga).delete(t.id.toString()))}removeAll(){let t=[];return c(this,ga).forEach(({model:r})=>{var o;let n=c(this,ga).get(r.id);n&&(t.push(r),(o=this.currentMap)==null||o.Models.remove(n.entityId,n.groupId),c(this,ga).delete(r.id.toString()))}),t}};ga=new WeakMap,w1=new WeakMap;p();var ba,O1,M1=class{constructor({currentMapGetter:t}){M(this,ba,new Map);M(this,O1);_(this,O1,t)}get currentMap(){return c(this,O1).call(this)}getById(t){return c(this,ba).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 os(Et(),o.animation,t,o.paths);for(let a of i)c(this,ba).set(a,{path:s,entityIds:i});return c(this,ba).set(s.id,{path:s,entityIds:i}),s}remove(t){var n;let r=c(this,ba).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),c(this,ba).delete(t.id),r.entityIds.forEach(o=>c(this,ba).delete(o)))}removeAll(){let t=[];return c(this,ba).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};ba=new WeakMap,O1=new WeakMap;p();var PY=fs(C5(),1);p();var DO="#2266ff",KPe="#808080",fY="#f5f5f5";var mY={radius:10,color:DO,inactiveColor:KPe,heading:{color:DO,opacity:.7},accuracyRing:{color:DO,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};p();var hY="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";p();var yY=(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 hs;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 ys(a,{depth:.1,bevelEnabled:!1,UVGenerator:QPe(t)})},FO=(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 Ee(0,o)},QPe=e=>({generateTopUV:(t,r,n,o,i)=>{let s=r[n*3],a=r[n*3+1],l=r[o*3],u=r[o*3+1],d=r[i*3],f=r[i*3+1];return[FO(s,a,e),FO(l,u,e),FO(d,f,e)]},generateSideWallUV:()=>[new Ee(0,1),new Ee(0,1),new Ee(0,1),new Ee(0,1)]});function gY(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 eTe([e,t],[r,n],[o,i]){let s=r-e,a=n-t,l=s**2+a**2;if(l===0)return;let u=((o-e)*s+(i-t)*a)/l,d;u<=0?d=[e,t]:u>=1?d=[r,n]:d=[e+u*s,t+u*a];let f=e0([o,i],d);return{proportion:Math.max(0,Math.min(1,u)),intersection:d,distance:f}}function bY(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],u=eTe(a,l,t);u!=null&&u.distance<r&&(r=u.distance,n=u.intersection,o=s,i=u.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:o,proportion:i}}function vY(e,t){let r=new wi({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,o=.35*4,i=yY(Math.PI/6,o,n);new Td().load(hY,a=>{r.alphaMap=a,r.needsUpdate=!0});let s=new Ve(i,r);return s.position.z=-.05,s.renderOrder=0,s}function xY(e,t){let r=new Y1(1,1,.05,32),n=new wi({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),o=new Ve(r,n);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}function IY(e){let t=new Y1(.35,.35,.07,32),r=new wi({transparent:!0,color:fY,depthTest:!1,depthWrite:!1}),n=new Ve(t,r);n.renderOrder=2;let o=new Y1(.35*.8,.35*.8,.01,32),i=new wi({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),s=new Ve(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 TY=fs(SY(),1);var FS="blue-dot",yd,Dl,Vo,zo,Fl,gd,bd,vd,Dr,To,E1,Ll,_1,A1,k1,D1,kS,va,Rl,DS,xd,F1,xa,ch=class extends De{constructor(r,n){super();this.core=r;this.geoJSONApi=n;M(this,yd,null);m(this,"geometry");M(this,Dl);M(this,Vo);M(this,zo);M(this,Fl);M(this,gd);M(this,bd);M(this,vd);M(this,Dr,mY);M(this,To,1);M(this,E1);M(this,Ll);m(this,"state","disabled");m(this,"following",!1);M(this,_1,r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)});M(this,A1,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,_1).call(this,i.id):void 0}return n});M(this,k1,r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,o,i,s]=r.children;if(c(this,kS).call(this),o.scale.set(c(this,To),c(this,To),c(this,To)),o.position.z=.07/2*c(this,To),i.scale.set(c(this,To),c(this,To),c(this,To)),i.position.z=.07*c(this,To),this.state==="active"){i.material.color.set(c(this,Dr).color);let a=this.accuracy;a!=null?(n.visible=!0,c(this,bd)&&c(this,bd).stop(),_(this,bd,new Io({scale:n.scale.x}).to({scale:a/2},150).onUpdate(({scale:u})=>{n.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(c(this,bd))):n.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,c(this,vd)&&c(this,vd).stop();let{start:u,end:d}=t0(s.rotation.z,-Ye.degToRad(l));_(this,vd,new Io({rotation:u}).to({rotation:d},150).onUpdate(({rotation:f})=>{s.rotation.z=f}).start()),this.core.getTweenGroup().add(c(this,vd)),s.scale.set(c(this,To),c(this,To),1)}else s.visible=!1}else this.state==="inactive"&&(i.material.color.set(c(this,Dr).inactiveColor),s.visible=!1,n.visible=!1)});M(this,D1,r=>{var s,a;let n;try{n=iTe.parse(gY(r,c(this,Vo)))}catch(l){c(this,va).call(this,"error"),$.error("BlueDot: Position parse failed",l instanceof B.ZodError?l.message:String(l)),this.publish("error");return}c(this,Dr).debug&&$.log("BlueDot: Parsed position",n),_(this,zo,n),c(this,va).call(this,"position-update"),c(this,Fl)&&clearTimeout(c(this,Fl)),typeof c(this,Dr).timeout=="number"&&c(this,Dr).timeout<1/0&&_(this,Fl,setTimeout(()=>{c(this,Dr).debug&&$.log("BlueDot: Position timed out after ".concat(c(this,Dr).timeout,"ms")),c(this,va).call(this,"timeout"),this.core.render()},c(this,Dr).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:"outdoors-container",i=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(FS,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}},{setup:l=>{let u=xY(c(this,Dr).accuracyRing.color,c(this,Dr).accuracyRing.opacity),{outerMesh:d,innerMesh:f}=IY(c(this,Dr).color),h=vY(c(this,Dr).heading.color,c(this,Dr).heading.opacity);l.add(u),u.visible=!1,l.add(d),l.add(f),l.add(h),h.visible=!1,c(this,k1).call(this,l)},update:c(this,k1)},{visible:!0,interactive:!0},o);else{let l=this.core.getState(this.geometry);i=[l.position[0],l.position[1]]}c(this,gd)&&c(this,gd).stop(),_(this,gd,new Io(i).to([n.longitude,n.latitude],1e3).easing(kr.Cubic.Out).onUpdate(l=>{if(this.geometry){let u={position:[l[0],l[1]]};u.parent=o,this.core.setState(this.geometry,u)}}).start()),this.core.getTweenGroup().add(c(this,gd)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});m(this,"onPositionUpdate",r=>{var n,o,i,s,a;if(this.state!=="disabled"){try{oTe.parse(r)}catch(l){c(this,va).call(this,"error"),$.error("BlueDot: Browser sent invalid position",l instanceof B.ZodError?l.message:String(l)),this.publish("error");return}_(this,Dl,{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,A1).call(this,(a=r.coords)==null?void 0:a.floorLevel)}),c(this,D1).call(this,c(this,Dl))}});m(this,"onPositionError",r=>{var n;switch(c(this,va).call(this,"error"),r.code){case r.PERMISSION_DENIED:$.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:$.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:$.error("Geolocation request timed out.",r);break;default:$.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)});M(this,kS,()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==c(this,E1)){_(this,E1,r);let o=(n=this.core.getMetresPerPixel())!=null?n:1;_(this,To,Math.max(c(this,Dr).radius/(.35/o),1))}});M(this,va,r=>{let n=nTe[this.state].actions[r];if(n){switch(c(this,Dr).debug&&$.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 $.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))});M(this,Rl);M(this,DS,()=>{if(c(this,Rl)==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);_(this,Rl,(0,TY.default)(n.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return c(this,Rl)});M(this,xd,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),c(this,xa)&&(this.off("position-update",c(this,xa)),_(this,xa,void 0)),this.following=!1,_(this,Rl,void 0),this.core.off("user-interaction-start",c(this,xd)),this.geoJSONApi.currentMap.off("navigation-active-path-change",c(this,F1)),this.publish("follow-change",{following:!1})});M(this,F1,()=>{_(this,Rl,void 0)});M(this,xa);m(this,"follow",(r,n)=>{var i,s,a,l;if(r===!1){c(this,xd).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&$.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,xa)&&this.off("position-update",c(this,xa)):(this.following=!0,this.core.on("user-interaction-start",c(this,xd)),this.geoJSONApi.currentMap.on("navigation-active-path-change",c(this,F1))),_(this,xa,u=>{let{coordinate:d,heading:f,floor:h}=u;if(o.center=[d.longitude,d.latitude],h!=null&&h.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(h.id),_(this,Rl,void 0)),r==="position-and-heading")o.bearing=f!=null?f:void 0;else if(r==="position-and-path-direction"){let b=c(this,DS).call(this);if(b!=null){let v=bY(b,[d.longitude,d.latitude]);if(v!=null){let I=b[v.segmentIndex],x=b[v.segmentIndex+1];o.bearing=mE(I,x)}}}this.core.camera.animateTo(o)}),this.on("position-update",c(this,xa)),this.publish("follow-change",{following:!0,mode:r})})}get heading(){var r;return(r=c(this,zo))==null?void 0:r.heading}get accuracy(){var r;return(r=c(this,zo))==null?void 0:r.accuracy}get coordinate(){var r,n;if(c(this,zo)!=null)return(c(this,Ll)==null||((r=this.floor)==null?void 0:r.id)!==c(this,Ll).floorId||c(this,zo).latitude!==c(this,Ll).latitude||c(this,zo).longitude!==c(this,Ll).longitude)&&_(this,Ll,new Le(c(this,zo).latitude,c(this,zo).longitude,(n=this.floor)==null?void 0:n.id)),c(this,Ll)}get floor(){var r;return(r=c(this,zo))==null?void 0:r.floor}enable(r){_(this,Dr,(0,PY.default)({},r,c(this,Dr))),c(this,va).call(this,"enable"),this.watchDevicePosition(c(this,Dr).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),c(this,Fl)&&(clearTimeout(c(this,Fl)),_(this,Fl,void 0)),this.following&&c(this,xd).call(this),this.watchDevicePosition(!1),_(this,zo,void 0),_(this,Vo,void 0),c(this,va).call(this,"disable")}watchDevicePosition(r){if(c(this,yd)&&(navigator.geolocation.clearWatch(c(this,yd)),_(this,yd,null)),c(this,Dl)&&_(this,Dl,void 0),r){if(this.state==="disabled"){$.warn("BlueDot must be enabled before watching browser position.");return}_(this,yd,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var o,i;r==null?_(this,Vo,void 0):"coords"in r?_(this,Vo,Object.assign({},c(this,Vo),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:c(this,A1).call(this,r.coords.floorLevel)})):(_(this,Vo,Object.assign({},c(this,Vo),r)),"floorOrFloorId"in r&&(c(this,Vo).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?c(this,_1).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((o=c(this,Vo))==null?void 0:o.latitude)!=null&&((i=c(this,Vo))==null?void 0:i.longitude)!=null||c(this,Dl)!=null)&&c(this,D1).call(this,c(this,Dl))}};yd=new WeakMap,Dl=new WeakMap,Vo=new WeakMap,zo=new WeakMap,Fl=new WeakMap,gd=new WeakMap,bd=new WeakMap,vd=new WeakMap,Dr=new WeakMap,To=new WeakMap,E1=new WeakMap,Ll=new WeakMap,_1=new WeakMap,A1=new WeakMap,k1=new WeakMap,D1=new WeakMap,kS=new WeakMap,va=new WeakMap,Rl=new WeakMap,DS=new WeakMap,xd=new WeakMap,F1=new WeakMap,xa=new WeakMap;var nTe={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"}}},oTe=B.object({coords:B.object({latitude:B.number(),longitude:B.number(),accuracy:B.number(),altitude:B.number().optional().nullable(),altitudeAccuracy:B.number().optional().nullable(),heading:B.number().optional().nullable(),speed:B.number().optional().nullable(),floorLevel:B.number().optional().nullable()}),timestamp:B.number()}),iTe=B.object({latitude:B.number(),longitude:B.number(),floor:B.custom().optional(),accuracy:B.number().optional(),heading:B.number().optional().nullable()});p();var Nl,R1,L1=class{constructor({currentMapGetter:t}){M(this,Nl,new Map);M(this,R1);_(this,R1,t)}get currentMap(){return c(this,R1).call(this)}getById(t){return c(this,Nl).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 Jc(i);return c(this,Nl).set(s.id,s),s}remove(t){var n;c(this,Nl).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),c(this,Nl).delete(t.id.toString()))}removeAll(){let t=[];return c(this,Nl).forEach(r=>{this.remove(r),t.push(r.id),c(this,Nl).delete(r.id.toString())}),t}};Nl=new WeakMap,R1=new WeakMap;p();var B1,N1=class{constructor({currentMapGetter:t}){M(this,B1);_(this,B1,t)}get currentMap(){return c(this,B1).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(_r))continue;let l=a.layers.get(_r);if(l!=null&&l.layers.has(s)&&"color"in t[s]){let f=l.layers.get(s);f&&((n=this.currentMap)==null||n.renderer.setState(f,{color:t[s].color}))}if(l&&s===Tc&&!(Js in t)){let f=l.layers.get(Js);f&&"color"in t[s]&&((o=this.currentMap)==null||o.renderer.setState(f,{color:t[s].color}))}if(!a.layers.has(up))continue;let u=a.layers.get(up),d=a.facadesByStyleId.get(s);if(d&&d.length>0)for(let f of d){let h=u.layers.get("".concat(f,"-").concat(s));h&&"color"in t[s]&&((i=this.currentMap)==null||i.renderer.setState(h,{color:t[s].color}))}}}};B1=new WeakMap;p();var LO={opacity:1},$n,$1,j1,su,Bl,Id,RO,wY,uh=class{constructor(t,r){M(this,Id);M(this,$n);M(this,$1,[]);M(this,j1,{opacity:"initial"});M(this,su,{opacity:new Map});M(this,Bl,new Set);_(this,$n,t),_(this,$1,r||[]);let n=c(this,$n).map;n&&n.on("idle",()=>{c(this,su).opacity.size||ee(this,Id,RO).call(this,n)})}setStyle(t){var r,n;if(c(this,$n).map){(r=c(this,$n).map)==null||r.setStyle(t),c(this,Bl).size&&(c(this,Bl).clear(),this.hide()),ee(this,Id,wY).call(this),ee(this,Id,RO).call(this,c(this,$n).map),this.setOpacity(c(this,j1).opacity),(n=c(this,$n).map)==null||n.moveLayer(JS);for(let[o,i,s]of c(this,$1)||[])c(this,$n).hideOutdoorLayersIntersectingPolygons(o,i,s)}}get map(){return c(this,$n).map}get enabled(){return!!c(this,$n).map}get visible(){return c(this,Bl).size===0}show(){let t=c(this,$n).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{c(this,Bl).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),c(this,Bl).clear())}hide(t=[]){let r=c(this,$n).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(o=>{let i=r.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&i!=="none"&&(r.setLayoutProperty(o.id,"visibility","none"),c(this,Bl).add(o.id))})}setOpacity(t,r=[]){var i,s;let n=c(this,$n).map;if(!n)return;let o=(s=(i=c(this,$n).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 u=c(this,su).opacity.get(a.id);u!==void 0&&(a.id==="background"||(a.type==="symbol"?(n.setPaintProperty(a.id,"icon-opacity",t==="initial"?u[0]:t),n.setPaintProperty(a.id,"text-opacity",t==="initial"?u[1]:t)):n.setPaintProperty(a.id,"".concat(a.type,"-opacity"),t==="initial"?u[0]:t)),c(this,j1).opacity=t)}catch(u){$.warn("Error setting opacity:",u)}})})}};$n=new WeakMap,$1=new WeakMap,j1=new WeakMap,su=new WeakMap,Bl=new WeakMap,Id=new WeakSet,RO=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,su).opacity.set(n.id,[(i=t.getPaintProperty(n.id,"icon-opacity"))!=null?i:LO.opacity,(s=t.getPaintProperty(n.id,"text-opacity"))!=null?s:LO.opacity]):c(this,su).opacity.set(n.id,[(a=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?a:LO.opacity,void 0])))})},wY=function(){Object.values(c(this,su)).forEach(t=>t.clear())};p();function sTe(){E5(!1)}var $l,jl,au,LS=class{constructor({currentMapGetter:t}){M(this,$l);M(this,jl,new Map);M(this,au,new Map);_(this,$l,t)}labelAll(t={}){var o,i;let r=[],n=new Set;return(i=(o=c(this,$l).call(this))==null?void 0:o.Text3D.labelAll(t))==null||i.forEach(({textInfo:s,target:a})=>{let l=s.id.toString(),u=c(this,au).get(l);if(u){n.has(l)||r.push(u.text3DView),n.add(l);return}n.add(l);let d=new Qc(l,a);c(this,jl).set(d.id,{targetId:a.id,text3d:l,text3DView:d}),c(this,au).set(l,{text3DView:d}),r.push(d)}),r}label(t,r,n={}){var i;if(c(this,$l).call(this))if(Qr.is(t)){let s=(i=c(this,$l).call(this))==null?void 0:i.Text3D.label(t,r,n);if(!s)return;let a=s.textInfo.id.toString(),l=c(this,au).get(a);if(l)return l.text3DView;let u=new Qc(a,s.target);return c(this,jl).set(u.id,{targetId:s.target.id,text3d:a,text3DView:u}),c(this,au).set(a,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var o;let r=typeof t=="string"?t:t.id,n=c(this,jl).get(r);n&&((o=c(this,$l).call(this))==null||o.Text3D.remove(n.text3d),c(this,jl).delete(r),c(this,au).delete(n.text3d))}removeAll(){c(this,jl).forEach(t=>{var r;(r=c(this,$l).call(this))==null||r.Text3D.remove(t.text3d)}),c(this,jl).clear()}};$l=new WeakMap,jl=new WeakMap,au=new WeakMap;var RS=.05,G1=class{constructor(t,r){m(this,"core");m(this,"mapObjects",[]);m(this,"id");m(this,"mapDataExternal",{});m(this,"mapsByFloorId",{});m(this,"mapData");m(this,"currentMap");m(this,"hiddenOutdoorGeometries",[]);m(this,"lastFacadeIntersected");m(this,"manualFloorVisibility",!1);m(this,"mapView");m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"Outdoor");m(this,"BlueDot");m(this,"Shapes");m(this,"Style");m(this,"Images");m(this,"update",()=>{this.core.render()});this.core=t,this.mapView=r,this.Camera=new s1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new x1("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(u=>{var d;return(d=this.getMapDataInternal())==null?void 0:d.facadesById[u]}).filter(u=>u!=null)})});let o=new r1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let i=l=>u=>{var N,k,D;let d=[],f=[],h=[],b=[];u.labels.forEach(F=>{let z=this.Labels.getById(F.toString());z&&d.push(z.label)}),u.markers.forEach(F=>{let z=this.Markers.getById(F.toString())||this.Navigation.getMarkerById(F.toString());z&&f.push(z.marker)}),u.models.forEach(F=>{let z=this.Models.getById(F.toString());z&&h.push(z.model)}),u.paths.forEach(F=>{let z=this.Paths.getById(F.toString())||this.Navigation.getPathById(F.toString());z&&b.push(z.path)});let v=u.geometry.includes(FS),I=u.geometry.filter(F=>F!==FS)[0],x;I&&(x=(N=this.getMapDataInternal())==null?void 0:N.getById("space",I)),x||(x=(k=this.getMapDataInternal())==null?void 0:k.getById("object",I));let C=u.containers.reduce((F,z)=>{var j;let G=(j=this.getMapDataInternal())==null?void 0:j.getById("floor",z);return G&&No.is(G)&&F.push(G),F},[]),P,w=0;if(C.length>0){P=C[0].id;let F=this.core.getState(P);w=u.coordinate[2]?u.coordinate[2]-F.altitude:w}let T;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!1})}),x&&Qr.is(x)&&(T=(D=this.getMapDataInternal())==null?void 0:D.facadesBySpaceId[I],T&&T.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!0})})),this.lastFacadeIntersected=T;let O={coordinate:new Le({latitude:u.coordinate[1],longitude:u.coordinate[0],floorId:P,verticalOffset:w}),spaces:x&&Qr.is(x)?[x]:[],objects:x&&Bo.is(x)?[x]:[],markers:f,labels:d,models:h,paths:b,blueDot:v,floors:C,facades:T?[T]:[]};"pointerEvent"in u&&(O.pointerEvent=u.pointerEvent),this.mapView.publish(l,O)};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 I1(s),this.Models=new T1(s),this.Labels=new c1(s),this.Text3D=new LS(s),this.Exporter=new l1(s),this.Paths=new M1(s),this.Navigation=new o1(this.core,this,s.currentMapGetter),this.BlueDot=new ch(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 uh(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 C1(s),this.Shapes=new L1(s),this.Style=new N1(s);let a=new ES(r,this.mapDataExternal);this.auto=a.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(_r);if(i){let s=i.layers.get(Tc);s&&this.core.setState(s,$4(r,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(_r);if(i){let s=i.layers.get(Js);s&&this.core.setState(s,$4(r,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(_r);if(i){let s=i.layers.get(nm);s&&this.core.setState(s,B2(r,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(_r);if(i){let s=i.layers.get(om);s&&this.core.setState(s,B2(r,this.core.getState(s)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(Yc.is(n))return this.core.setState(n.id,qH({...r,type:"label"},this.core.getState(n.id)));if(Tl.is(n))return this.core.setState(n.id,ZH({...r,type:"marker"},this.core.getState(n.id)));if((Qr.is(n)||Bo.is(n))&&this.core.setState(n.id,XH({...r,type:"geometry"},this.core.getState(n.id))),Ys.is(n)&&this.core.setState(n.id,B2({...r,type:"doors"},this.core.getState(n.id))),Jc.is(n)&&this.core.setState(n.id,wo(r,["altitude","color","opacity"])),cd.is(n)){let{position:o,scale:i,...s}=r,a=s;o&&(a.position=[o.longitude,o.latitude,o.verticalOffset]),i!=null&&(Array.isArray(i)?a.scale=i:a.scale=[i,i,i]),o&&n.updateTarget(o),this.core.setState(n.id,a)}if(No.is(n)){let o=this.currentMap.floorsById.get(n.id);if(o==null)return;this.core.setState(n.id,wo(r,["visible","altitude"]));let i=o.layers.get(_r);i!=null&&"geometry"in r&&this.core.setState(i.containerId,wo(r.geometry,["opacity","visible"]));let s=o.layers.get(al);s!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&s.setVisible(r.labels.enabled);let a=o.layers.get(Qs);a!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&a.setVisible(r.markers.enabled);let l=o.layers.get(hg);l!=null&&"footprint"in r&&this.core.setState(l.containerId,wo(r.footprint,["visible","height","opacity","side","color","altitude"]));let u=o.layers.get(im);u!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&u.setVisible(r.occlusion.enabled)}if(Xi.is(n)){let o=this.core.getState(n.id);for(let i of o.children)i.type==="group-container"&&this.core.setState(i.id,wo(r,["opacity","visible"]))}if(Qc.is(n)&&this.core.setState(n.id,wo(r,MI)),os.is(n))for(let o of n.segments)this.core.setState(o.id,wo(r,["color","nearRadius","farRadius","visible","completeFraction"]));eh.is(n)&&this.core.setState(n.id,wo(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Eh(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var f,h,b,v;let o;try{o=Eh(t)}catch(I){$.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 Le(s[1],s[0])});let a=i["manifest.geojson"].features[0].properties.name,l=new x1("mapObject-".concat(a),o,r,this),u=this.core.getBoundingArea(l.currentFloor.id);u==null&&$.error("Could not determine bounding box for map:",l.currentFloor.id);let d=(h=(f=r==null?void 0:r.outdoorView)==null?void 0:f.layersHiddenByGeometry)!=null?h:[];if(d.length>0){let I,x=[];for(let C of l.floorStacksById.values())if(C.defaultFloor.footprint&&C.defaultFloor.footprint.geometry!=null&&((b=C.defaultFloor.footprint.geometry)==null?void 0:b.coordinates.length)>0){let P=C.defaultFloor.footprint,w=j2(P);I==null?I=w:eW(I,w),x.push(P)}x.length>0&&I!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(I,x,d),this.hiddenOutdoorGeometries.push([I,x,d]))}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 x,C,P,w;this.mapView.publish("floor-change-start",{reason:I.reason,floor:(C=(x=this.getMapDataInternal())==null?void 0:x.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 x,C;this.mapView.publish("floor-change",{reason:I.reason,floor:this.currentFloor,previousFloor:(C=(x=this.getMapDataInternal())==null?void 0:x.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"&&u){let I=(v=r==null?void 0:r.screenOffsets)!=null?v:{top:RS*this.core.canvasHeight,left:RS*this.core.canvasWidth,right:RS*this.core.canvasWidth,bottom:RS*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:_H,padding:I}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(sg(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(sg(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Bn("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Bn("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Bn("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Bn("Missing currentFloor");return r}getState(t){var o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w,T,O,N,k;typeof t=="object"&&os.is(t)&&$.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=QH(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:D,topColor:F,texture:z,topTexture:G,visible:j,height:K,opacity:Z}=n;return{type:"walls",visible:j,color:D,topColor:F,texture:z?{url:z}:void 0,topTexture:G?{url:G}:void 0,height:K,opacity:Z}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:D,topColor:F,texture:z,topTexture:G,visible:j,opacity:K}=n;return{type:"doors",visible:j,color:D,topColor:F,opacity:K,texture:z?{url:z}: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()),z=F!=null&&F.marker.target?F==null?void 0:F.marker.target.anchorTarget:void 0;return z==null&&(z=new Le(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,{...n,position:new Le({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"&&Jc.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"&&No.is(t)){let D=(a=this.currentMap.floorsById.get(t.id))==null?void 0:a.layers.get(_r),F=D?this.core.getState(D.containerId):void 0,z=(l=this.currentMap.floorsById.get(t.id))==null?void 0:l.layers.get(al),G=(u=this.currentMap.floorsById.get(t.id))==null?void 0:u.layers.get(Qs),j=(d=this.currentMap.floorsById.get(t.id))==null?void 0:d.layers.get(hg),K=j?this.core.getState(j.containerId):void 0,Z=(f=this.currentMap.floorsById.get(t.id))==null?void 0:f.layers.get(im),oe=Z?this.core.getState(Z.containerId):void 0;return{type:"floor",geometry:{opacity:(h=F==null?void 0:F.opacity)!=null?h:0,visible:(b=F==null?void 0:F.visible)!=null?b:!0},labels:{enabled:(v=z==null?void 0:z.visible)!=null?v:!1},markers:{enabled:(I=G==null?void 0:G.visible)!=null?I:!1},footprint:{altitude:(x=K==null?void 0:K.altitude)!=null?x:0,visible:(C=K==null?void 0:K.visible)!=null?C:!1,height:(P=K==null?void 0:K.height)!=null?P:0,opacity:(w=K==null?void 0:K.opacity)!=null?w:0,side:(T=K==null?void 0:K.side)!=null?T:"double",color:(O=K==null?void 0:K.color)!=null?O:"white"},occlusion:{enabled:(N=oe==null?void 0:oe.visible)!=null?N:!1},visible:n.visible,altitude:(k=n.altitude)!=null?k:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Xi.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 u=this.core.projectScreenXYToCoordinate(t,r,!0);return u?new Le(u.coordinate[1],u.coordinate[0],n.id):void 0}let o=this.core.projectScreenXYToCoordinate(t,r);if(o==null||o.coordinate==null)return;let{coordinate:i,groupContainers:s}=o,a=(l=s==null?void 0:s.find(u=>{let d=u.userData.entityId.toString();return d.includes("f_")||d.includes("m_")}))==null?void 0:l.userData.entityId.toString();return new Le(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 Io(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 aTe(e){ME("".concat(e,"/maplibre-worker.csp.js")),K4("".concat(e,"/collision-worker.csp.js"))}p();p();var NS=class{constructor(t){m(this,"state");m(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};p();var MY=B.object({environment:B.union([B.literal("basic"),B.literal(!1)]).optional(),text3d:B.object({hoverColor:B.string().optional()}).optional(),geometry:B.object({hoverColor:B.string().optional()}).optional(),backgroundColor:B.string().optional(),backgroundAlpha:B.number().optional()}).strict();p();var BS=fs(c5(),1);var OY=e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||NO(e).some(r=>r<1)?!0:(console.warn=t,!1)},NO=e=>{let t=new Ft(e);return[t.r,t.g,t.b]},lTe=e=>{let t=new Ft;return t.setRGB(e[0],e[1],e[2],Sa),"#"+t.getHexString()},EY=(e,t)=>{let r=(0,BS.default)({},e),n=(0,BS.default)({},e,t),o=(i,s,a)=>{for(let l in s){let u=i[l],d=s[l];if(typeof d=="number"&&typeof u=="number")i[l]=u+(d-u)*a;else if(typeof d=="string"&&typeof u=="string"){if(OY(u)&&OY(d)){let f=NO(u),h=NO(d);f&&h?i[l]=lTe([f[0]+(h[0]-f[0])*a,f[1]+(h[1]-f[1])*a,f[2]+(h[2]-f[2])*a]):$.warn('Color "'.concat(l,'" could not be animated!'))}}else typeof d=="object"&&d!==null&&typeof u=="object"&&u!==null?o(u,d,a):$.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,BS.default)({},r);return o(s,t,i),s}};var U1,Ie,Gl,ph=class extends De{constructor(r){super();M(this,U1,{});M(this,Ie);M(this,Gl);m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Images");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"BlueDot");m(this,"Style");m(this,"Shapes");m(this,"Outdoor");m(this,"update",()=>{c(this,Ie).core.render()});m(this,"getDirections",(r,n,o)=>{var i;return(i=c(this,Ie).getMapData())==null?void 0:i.getDirections(r,n,o)});m(this,"getDirectionsMultiDestination",(r,n,o)=>{var i;return(i=c(this,Ie).getMapData())==null?void 0:i.getDirectionsMultiDestination(r,n,o)});m(this,"on",(r,n)=>{super.on(r,n)});m(this,"off",(r,n)=>{super.off(r,n)});m(this,"Debug");_(this,Gl,r);let n=new G1(r,this);_(this,Ie,n),this.Camera=c(this,Ie).Camera,_(this,U1,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,Gl).container.dataset.version=g.env.npm_package_version,this.Debug=new NS(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 u;let i=c(this,Ie).getState(r);if(i==null)return $.warn("Cannot animate state of ".concat(r,".")),new Promise(f=>f());let s=EY(i,n),a=c(this,Ie).tween({percent:0}).to({percent:1},(u=o==null?void 0:o.duration)!=null?u:1e3).onUpdate(({percent:d})=>{c(this,Ie).updateState(r,s(d))});o!=null&&o.easing&&o.easing in Sl&&a.easing(Sl[o.easing]);let l=new Promise(d=>{a.onComplete(()=>{c(this,Ie).removeTween(a),d()}).onStop(()=>{c(this,Ie).removeTween(a),d()}),a.start()});return l.cancel=()=>{a.stop(),c(this,Ie).updateState(r,s(0))},l}updateGlobalState(r){var n,o,i,s;try{MY.parse(r)}catch(a){$.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,u=(s=r.backgroundAlpha)!=null?s:c(this,Ie).core.backgroundAlpha;c(this,Ie).core.setBackgroundColor(l,u)}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,U1)}getDimensions(){return{width:c(this,Gl).canvasWidth,height:c(this,Gl).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)}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 Le(r):new Le(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(g.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-KJE2KP6V.js");await new n(this,c(this,Ie)).enable(r)}async takeScreenshot(){return await c(this,Gl).renderSync(),c(this,Gl).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return c(this,Ie).manualFloorVisibility}set manualFloorVisibility(r){c(this,Ie).manualFloorVisibility=r}};U1=new WeakMap,Ie=new WeakMap,Gl=new WeakMap;p();p();var $S=class extends De{constructor(r){super();m(this,"gl");m(this,"el",document.createElement("div"));m(this,"core");m(this,"origin");m(this,"map");m(this,"layer");m(this,"handleStyleChange",()=>{!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()))});m(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(Ye.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Ye.degToRad(this.map.getPitch()))});m(this,"handleError",r=>{$.warn(r)});this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new Wb(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=TE.fromLngLat(this.origin,0);return this.layer=s0(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 Sd,dh,lu,Cd,jS=class jS extends De{constructor(r,n,o){super();M(this,Sd);M(this,dh);M(this,lu);M(this,Cd);m(this,"on",(r,n)=>{super.on(r,n)});m(this,"off",(r,n)=>{super.off(r,n)});_(this,Cd,new $S(r)),_(this,Sd,n),_(this,dh,o)}onAdd(r){var i,s;let n=c(this,Cd).onAdd(r),o={...cp,...(i=c(this,dh))!=null?i:{},outdoorView:{token:c(this,Sd).outdoorViewToken,...(s=c(this,dh))==null?void 0:s.outdoorView}};return _(this,lu,new ph(c(this,Cd).core)),c(this,lu).addMap(c(this,Sd),o).then(()=>{this.publish("loaded",{mapView:c(this,lu),mapData:c(this,Sd)})}),n}onRemove(){c(this,lu)&&c(this,lu).clear(),jS.instance=null,c(this,Cd).onRemove()}};Sd=new WeakMap,dh=new WeakMap,lu=new WeakMap,Cd=new WeakMap,m(jS,"instance");var fh=jS;p();var cTe=1e3*60*60*2,cu,hh,er,us,ps,Si,ds,yh,gh,z1,cr,_Y,AY,mh,GS,BO,$O,jO,V1=class{constructor(t,r){M(this,cr);M(this,cu,new De);M(this,hh);M(this,er);M(this,us);M(this,ps);M(this,Si);M(this,ds);M(this,yh);M(this,gh);M(this,z1,()=>{"key"in c(this,er)&&"secret"in c(this,er)&&ee(this,cr,mh).call(this),ee(this,cr,GS).call(this)});m(this,"on",(t,r)=>c(this,cu).on(t,r));m(this,"off",(t,r)=>c(this,cu).off(t,r));_(this,hh,t),_(this,er,r)}setMapIds(t){_(this,hh,t)}setEnterprise(t){c(this,er).enterprise=t}async readySync(){if((!("key"in c(this,er))||!("secret"in c(this,er)))&&!("accessToken"in c(this,er))){$.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[ee(this,cr,mh).call(this),null];c(this,er).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);ee(this,cr,jO).call(this),ee(this,cr,BO).call(this,r),n!=null&&ee(this,cr,$O).call(this,n),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",c(this,z1))}async refreshing(){let t=[];return c(this,us)!=null&&t.push(c(this,us)),c(this,ps)!=null&&t.push(c(this,ps)),Promise.all(t)}getAccessTokenAsync(){return ee(this,cr,mh).call(this)}getSasTokensAsync(){return ee(this,cr,GS).call(this)}getAccessToken(){return c(this,Si)==null?($.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):c(this,Si)}getSasToken(t){return this.isEnterpriseMode()?($.error("SAS tokens are not available in the enterprise mode!"),{token:""}):c(this,ds)==null?($.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in c(this,ds).tokens?c(this,ds).tokens[t]:($.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=c(this,er).enterprise)!=null?t:!1}destroy(){ee(this,cr,jO).call(this),c(this,cu).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",c(this,z1))}};cu=new WeakMap,hh=new WeakMap,er=new WeakMap,us=new WeakMap,ps=new WeakMap,Si=new WeakMap,ds=new WeakMap,yh=new WeakMap,gh=new WeakMap,z1=new WeakMap,cr=new WeakSet,_Y=function(t){var n;let r=t.token!==((n=c(this,Si))==null?void 0:n.token);_(this,Si,t),r&&c(this,cu).publish("access-token-refreshed",{accessToken:t})},AY=function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=c(this,ds))==null?void 0:n.tokens);_(this,ds,t),r&&c(this,cu).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},mh=async function(t=!1){var r;if("accessToken"in c(this,er)&&typeof c(this,er).accessToken=="string"){let n={token:c(this,er).accessToken,expires:Date.now()+72e5};return _(this,Si,n),n}if(!("key"in c(this,er))||!("secret"in c(this,er))||typeof c(this,er).key!="string"||typeof c(this,er).secret!="string")throw new Error("No API keys or access token provided!");return c(this,us)!=null?c(this,us):c(this,Si)!=null&&c(this,Si).expires!=null&&c(this,Si).expires>Date.now()&&!t?c(this,Si):(_(this,us,By({...c(this,er),key:c(this,er).key,secret:c(this,er).secret},(r=c(this,er).enterprise)!=null?r:!1).then(n=>{let o={token:n.accessToken,expires:n.expiresTimestamp*1e3};return ee(this,cr,_Y).call(this,o),o})),c(this,us).finally(()=>{_(this,us,void 0)}),c(this,us))},GS=async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:c(this,ps)!=null?c(this,ps):c(this,ds)!=null&&c(this,ds).expires>Date.now()&&!t?c(this,ds):(_(this,ps,new Promise((r,n)=>{ee(this,cr,mh).call(this).then(o=>{let i={},s=c(this,hh).map(a=>uw({...c(this,er),mapId:a},o.token).then(l=>{i[a]={token:l.token,expires:l.expires}}).catch(l=>{$.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 u;return(u=l.expires)!=null?u:1/0}))};ee(this,cr,AY).call(this,a),r(a)})}).catch(o=>{n(o)})})),c(this,ps).catch(r=>{throw r}).finally(()=>{_(this,ps,void 0)}),c(this,ps))},BO=function(t){if(!("key"in c(this,er))||!("secret"in c(this,er)))return;let r=t.expires!=null?t.expires-Date.now():cTe;isFinite(r)&&_(this,yh,setTimeout(()=>{ee(this,cr,mh).call(this,!0).then(n=>{ee(this,cr,BO).call(this,n)})},r-lj))},$O=function(t){let r=t.expires-Date.now();isFinite(r)&&_(this,gh,setTimeout(()=>{ee(this,cr,GS).call(this,!0).then(n=>{ee(this,cr,$O).call(this,n)})},r-pj))},jO=function(){c(this,yh)!=null&&clearTimeout(c(this,yh)),c(this,gh)!=null&&clearTimeout(c(this,gh))};p();var kY=(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 DY=":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 FY='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var LY=".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 RY=".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 NY=".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 BY='.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 yTe=[DY,FY,LY,RY,NY,BY],$Y;function gSt(e){$Y=e}var bSt=async(e,t)=>{let r,n=Xu();t&&n.updateByUserOption(t);try{t&&(r=(await By({...t,baseAuthUri:n.getBaseAuthUri()})).accessToken)}catch(s){$.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new Pm(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new c0(o)},jY=!1;function vSt(e){jY=e}var xSt=async(e,t)=>{var b,v,I,x,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((b=e.options)!=null?b:{})?(v=e.options)==null?void 0:v.version:void 0,n={...t||{},mvfVersion:r},o,i=Xu();i.updateByUserOption(n);let s={};if("type"in e&&typeof e.type=="string"){if(s.enterprise=(x=e.options)==null?void 0:x.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){o=await bw(e.main,n.mvfVersion),s.languagePacks=[];for(let T of(C=e.languagePacks)!=null?C:[])T.localePack instanceof Uint8Array&&s.languagePacks.push({language:T.language,localePack:await $f(T.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=gw(o),l=a.length>0?a:[n.mapId],u=new V1(l,{...n,enterprise:s.enterprise}),d;if("accessToken"in n)d=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=i.getBaseAuthUri(s.enterprise);let T=await u.getAccessTokenAsync();d=(T==null?void 0:T.token)||""}s.outdoorViewToken=d,s.env=i,s.getMapDataOptions=n;try{await u.readySync()}catch(T){$.error("Failed to ready token manager!",T)}let f=new Pm(o,s);d&&f.Analytics.init({accessToken:d,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(w=n.analytics)==null?void 0:w.context});let h=new c0(f);if("language"in n)try{await h.changeLanguage(n.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(o),h},gTe=async e=>{var I;let t=jY,r,n=Xu();n.updateByUserOption(e);let o={...e},i=new V1([o.mapId],o);if("accessToken"in o){r=o.accessToken;let{aud:x,sub:C}=Q1(r);(kH.some(P=>x.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"&&$.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):$.warn("layoutId is currently unsupported!")),o.baseUri=n.getBaseUri(t);let s=performance.now(),a,l;if(t){let x={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},C=await fw(x);a=C.compressed,l=C.localePacks}else a=await mw(o,r);let u=performance.now(),d=await bw(a,o.mvfVersion),f=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(d);let h=gw(d);h.length>0?i.setMapIds(h):i.setMapIds([o.mapId]);try{await i.readySync()}catch(x){$.error("Failed to ready token manager!",x)}let b=new Pm(d,{env:n,outdoorViewToken:r,tokenManager:i,enterprise:t,localePacksUrls:l,binaryBundle:a,getMapDataOptions:o}),v=new c0(b,{search:e.search});if(b.Analytics.init({accessToken:r,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:n.getAnalyticsBaseUri(),context:(I=o.analytics)==null?void 0:I.context}),b.Analytics.sendGetMapDataEvent({parseDuration:f-u,downloadDuration:u-s,viewId:o.viewId}),"language"in o)try{await v.changeLanguage(o.language)}catch{}return v},ISt=gTe,SSt=(e,t)=>{fh.instance!=null&&$.warn("Only a single map venue is supported at this time.");let r=new fh([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return fh.instance=r,r},bTe=async(e,t,r)=>{var u,d,f,h,b,v,I,x,C,P,w,T,O;let n=performance.now(),o=I4(r,t);o&&x4(o),((u=o.injectStyles)==null||u)&&kY(yTe,{id:"mappedin__styles"});let i=DH((d=t.outdoorViewToken)!=null?d:""),s=Eh(t);(f=o.outdoorView)!=null&&f.style&&s.envControl.updateTileServerBaseUrl((h=o.outdoorView)==null?void 0:h.style);let a=await WX(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(b=o.style)==null?void 0:b.backgroundAlpha,backgroundColor:(v=o.style)==null?void 0:v.backgroundColor,outdoorView:(I=o.outdoorView)!=null&&I.token?{headers:{"x-mappedin-tiles-key":(x=o.outdoorView)==null?void 0:x.token},style:t.getEnv().tileServerUri,enabled:!!((C=o.outdoorView)!=null&&C.enabled),lowDpi:(P=o.outdoorView)==null?void 0:P.lowDpi}:void 0,watermark:{...o.watermark,visible:((w=o.watermark)==null?void 0:w.visible)||!s.enterpriseMode&&!i.remove_watermark,onClick:$Y||void 0},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((T=o.antialiasing)!=null&&T.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(O=o.occlusion)==null?void 0:O.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}),l=new ph(a);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:l.getDimensions()}),l},CSt=bTe;export{Le as a,vc as b,tp as c,np as d,Ic as e,Ys as f,Qr as g,No as h,o1e as i,pp as j,Bo as k,Cc as l,Pc as m,k2 as n,Xi as o,sl as p,D2 as q,D4 as r,hw as s,yw as t,B as u,cm as v,F2 as w,C5 as x,$W as y,bZ as z,LPe as A,G2 as B,U2 as C,sTe as D,aTe as E,gSt as F,bSt as G,vSt as H,xSt as I,gTe as J,ISt as K,SSt as L,bTe as M,CSt as N};
|