@mappedin/react-sdk 6.0.1-beta.4 → 6.0.1-beta.41
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/README.md +5 -5
- package/THIRD_PARTY_LICENSES.txt +756 -641
- package/lib/esm/GLTFExporter-QKYHLXBT.js +1 -0
- package/lib/esm/GLTFLoader-IIKQJ4CZ.js +1 -0
- package/lib/esm/browser-QRMTGKD7.js +1 -0
- package/lib/esm/chunk-33GECCQ3.js +1 -0
- package/lib/esm/chunk-BYMKRV3A.js +1 -0
- package/lib/esm/chunk-FQV3UGRQ.js +1 -0
- package/lib/esm/chunk-JU7JJ6GL.js +1 -0
- package/lib/esm/chunk-RNI5HW3A.js +1 -0
- package/lib/esm/chunk-UCZ4R6AM.js +1 -0
- package/lib/esm/chunk-WMOC43MI.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +11286 -4769
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-D2RCHDOY.css +1 -0
- package/lib/esm/inspector-DWRMN5WW.js +1 -0
- package/lib/esm/internal-55777EMI.css +1 -0
- package/lib/esm/internal-CY2P6V5F.js +1 -0
- package/lib/esm/outdoor-context-v4-TQU664W2.js +1 -0
- package/lib/esm/roboto-regular-E5TUWU5Q.js +1 -0
- package/lib/esm/text3d-NWMFUROS.js +1 -0
- package/lib/esm/text3d-Q7FFP3YS.css +1 -0
- package/package.json +3 -6
- package/lib/esm/GLTFExporter-BMU6LTDX.js +0 -1
- package/lib/esm/GLTFLoader-5SLMAWGO.js +0 -1
- package/lib/esm/browser-KZQSYQMW.js +0 -1
- package/lib/esm/chunk-DFTJP4RV.js +0 -1
- package/lib/esm/chunk-JLMM7TY3.js +0 -1
- package/lib/esm/chunk-LOZUNJVL.js +0 -1
- package/lib/esm/chunk-QGSOXOSP.js +0 -1
- package/lib/esm/chunk-UO4RCD3E.js +0 -1
- package/lib/esm/inspector-6MGWZVYQ.js +0 -1
- package/lib/esm/inspector-XYNFPRUR.css +0 -1
- package/lib/esm/outdoor-context-v4-LAP7PEM5.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as wl,$a as Au,A as kt,Aa,B as Tb,Ba as Ou,C as pf,Ca as Fa,D as Vr,Da as ka,E as wb,Ea as zb,F as Ea,Fa as yf,G,Ga as qb,H as J7,Ha as Lu,I as Db,Ia as Qt,J as jr,Ja as $b,K as Eb,Ka as Jb,L as Ct,La as Qb,M as uf,Ma as bf,N as Ob,Na as Kb,O as Lb,Oa as vf,P as Ml,Pa as Cf,Q as Ab,Qa as ev,R as ao,Ra as tv,S as Fb,Sa as rv,T as so,Ta as iv,U as df,Ua as ov,V as lo,Va as Sf,W as Le,Wa as po,X as Tl,Xa as xf,Y as hf,Ya as nv,Z as ff,Za as av,_ as _b,_a as sv,a as $0,aa as Rb,ab as If,b as J0,ba as Oa,bb as lv,c as A,ca as La,cb as cv,d as nf,da as Nb,db as pv,e as Iu,ea as Dl,eb as uv,f as vb,fa as Gb,fb as dv,g as Da,gb as Pf,h as Pu,ha as wu,hb as hv,i as Cb,ia as Du,ib as fv,j as Mu,ja as Vb,jb as mv,k as dn,ka as jb,kb as gv,l as Sb,la as Eu,lb as yv,m as lf,ma as Ub,mb as bv,n as Ce,na as Hb,nb as Ne,o as te,oa as Wb,ob as vv,p as hn,pa as Xb,pb as fr,q as cf,qa as co,qb as Pe,r as Gr,ra as mf,s as Tu,sa as Yb,t as bi,ta as Zb,u as fn,ua as gf,v as xb,w as Ib,x as Pb,y as Mb,z as Pl,za as El}from"./chunk-UCZ4R6AM.js";import{j as kb,u as Bb}from"./chunk-33GECCQ3.js";import{a as Ur}from"./chunk-WMOC43MI.js";import{$ as lb,$a as gb,Aa as gi,Ba as Su,C as tb,Ca as db,D as ae,Da as hb,E as ee,Fa as yi,I as rb,J as ib,K as ob,L as nb,M as q,N as dt,O as ab,P as ln,Pa as wa,Q as Ta,R as cn,S as et,Ta as xu,U as vt,Ua as fb,V as pn,W as sb,X as ne,Y as mi,Ya as mb,_ as un,_a as Nr,aa as af,ab as yb,b as yu,ca as io,cb as bb,e as sn,f as Q0,g as Il,ka as oo,la as cb,ma as vu,na as pb,p as K0,pa as sf,r as eb,ua as ub,va as no,wa as Cu,ya as _r,z as bu,za as Rr}from"./chunk-RNI5HW3A.js";import{a as m,b as P}from"./chunk-JU7JJ6GL.js";import{a as p,c as U,d as q0,e as gu,f as d,g as a,h as I,i as M,j as R}from"./chunk-BYMKRV3A.js";var qv=U((nm,am)=>{m();(function(r,t){typeof nm=="object"&&typeof am<"u"?am.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(nm,function(){"use strict";function r(C,x,T,D,w){p(function E(k,L,_,B,V){for(;B>_;){if(B-_>600){var j=B-_+1,Y=L-_+1,ie=Math.log(j),H=.5*Math.exp(2*ie/3),oe=.5*Math.sqrt(ie*H*(j-H)/j)*(Y-j/2<0?-1:1),z=Math.max(_,Math.floor(L-Y*H/j+oe)),De=Math.min(B,Math.floor(L+(j-Y)*H/j+oe));E(k,L,z,De,V)}var de=k[L],ye=_,Ie=B;for(t(k,_,L),V(k[B],de)>0&&t(k,_,B);ye<Ie;){for(t(k,ye,Ie),ye++,Ie--;V(k[ye],de)<0;)ye++;for(;V(k[Ie],de)>0;)Ie--}V(k[_],de)===0?t(k,_,Ie):t(k,++Ie,B),Ie<=L&&(_=Ie+1),L<=Ie&&(B=Ie-1)}},"t")(C,x,T||0,D||C.length-1,w||e)}p(r,"t");function t(C,x,T){var D=C[x];C[x]=C[T],C[T]=D}p(t,"i");function e(C,x){return C<x?-1:C>x?1:0}p(e,"n");var i=p(function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function o(C,x,T){if(!T)return x.indexOf(C);for(var D=0;D<x.length;D++)if(T(C,x[D]))return D;return-1}p(o,"e");function n(C,x){s(C,0,C.children.length,x,C)}p(n,"a");function s(C,x,T,D,w){w||(w=b(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var E=x;E<T;E++){var k=C.children[E];c(w,C.leaf?D(k):k)}return w}p(s,"h");function c(C,x){return C.minX=Math.min(C.minX,x.minX),C.minY=Math.min(C.minY,x.minY),C.maxX=Math.max(C.maxX,x.maxX),C.maxY=Math.max(C.maxY,x.maxY),C}p(c,"o");function l(C,x){return C.minX-x.minX}p(l,"s");function u(C,x){return C.minY-x.minY}p(u,"l");function h(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}p(h,"f");function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}p(g,"u");function y(C,x){return C.minX<=x.minX&&C.minY<=x.minY&&x.maxX<=C.maxX&&x.maxY<=C.maxY}p(y,"m");function v(C,x){return x.minX<=C.maxX&&x.minY<=C.maxY&&x.maxX>=C.minX&&x.maxY>=C.minY}p(v,"c");function b(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}p(b,"p");function S(C,x,T,D,w){for(var E=[x,T];E.length;)if(!((T=E.pop())-(x=E.pop())<=D)){var k=x+Math.ceil((T-x)/D/2)*D;r(C,k,x,T,w),E.push(x,k,k,T)}}return p(S,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(C){var x=this.data,T=[];if(!v(C,x))return T;for(var D=this.toBBox,w=[];x;){for(var E=0;E<x.children.length;E++){var k=x.children[E],L=x.leaf?D(k):k;v(C,L)&&(x.leaf?T.push(k):y(C,L)?this._all(k,T):w.push(k))}x=w.pop()}return T},i.prototype.collides=function(C){var x=this.data;if(!v(C,x))return!1;for(var T=[];x;){for(var D=0;D<x.children.length;D++){var w=x.children[D],E=x.leaf?this.toBBox(w):w;if(v(C,E)){if(x.leaf||y(C,E))return!0;T.push(w)}}x=T.pop()}return!1},i.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var x=0;x<C.length;x++)this.insert(C[x]);return this}var T=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var D=this.data;this.data=T,T=D}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},i.prototype.clear=function(){return this.data=b([]),this},i.prototype.remove=function(C,x){if(!C)return this;for(var T,D,w,E=this.data,k=this.toBBox(C),L=[],_=[];E||L.length;){if(E||(E=L.pop(),D=L[L.length-1],T=_.pop(),w=!0),E.leaf){var B=o(C,E.children,x);if(B!==-1)return E.children.splice(B,1),L.push(E),this._condense(L),this}w||E.leaf||!y(E,k)?D?(T++,E=D.children[T],w=!1):E=null:(L.push(E),_.push(T),T=0,D=E,E=E.children[0])}return this},i.prototype.toBBox=function(C){return C},i.prototype.compareMinX=function(C,x){return C.minX-x.minX},i.prototype.compareMinY=function(C,x){return C.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(C){return this.data=C,this},i.prototype._all=function(C,x){for(var T=[];C;)C.leaf?x.push.apply(x,C.children):T.push.apply(T,C.children),C=T.pop();return x},i.prototype._build=function(C,x,T,D){var w,E=T-x+1,k=this._maxEntries;if(E<=k)return n(w=b(C.slice(x,T+1)),this.toBBox),w;D||(D=Math.ceil(Math.log(E)/Math.log(k)),k=Math.ceil(E/Math.pow(k,D-1))),(w=b([])).leaf=!1,w.height=D;var L=Math.ceil(E/k),_=L*Math.ceil(Math.sqrt(k));S(C,x,T,_,this.compareMinX);for(var B=x;B<=T;B+=_){var V=Math.min(B+_-1,T);S(C,B,V,L,this.compareMinY);for(var j=B;j<=V;j+=L){var Y=Math.min(j+L-1,V);w.children.push(this._build(C,j,Y,D-1))}}return n(w,this.toBBox),w},i.prototype._chooseSubtree=function(C,x,T,D){for(;D.push(x),!x.leaf&&D.length-1!==T;){for(var w=1/0,E=1/0,k=void 0,L=0;L<x.children.length;L++){var _=x.children[L],B=h(_),V=(j=C,Y=_,(Math.max(Y.maxX,j.maxX)-Math.min(Y.minX,j.minX))*(Math.max(Y.maxY,j.maxY)-Math.min(Y.minY,j.minY))-B);V<E?(E=V,w=B<w?B:w,k=_):V===E&&B<w&&(w=B,k=_)}x=k||x.children[0]}var j,Y;return x},i.prototype._insert=function(C,x,T){var D=T?C:this.toBBox(C),w=[],E=this._chooseSubtree(D,this.data,x,w);for(E.children.push(C),c(E,D);x>=0&&w[x].children.length>this._maxEntries;)this._split(w,x),x--;this._adjustParentBBoxes(D,w,x)},i.prototype._split=function(C,x){var T=C[x],D=T.children.length,w=this._minEntries;this._chooseSplitAxis(T,w,D);var E=this._chooseSplitIndex(T,w,D),k=b(T.children.splice(E,T.children.length-E));k.height=T.height,k.leaf=T.leaf,n(T,this.toBBox),n(k,this.toBBox),x?C[x-1].children.push(k):this._splitRoot(T,k)},i.prototype._splitRoot=function(C,x){this.data=b([C,x]),this.data.height=C.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(C,x,T){for(var D,w,E,k,L,_,B,V=1/0,j=1/0,Y=x;Y<=T-x;Y++){var ie=s(C,0,Y,this.toBBox),H=s(C,Y,T,this.toBBox),oe=(w=ie,E=H,k=void 0,L=void 0,_=void 0,B=void 0,k=Math.max(w.minX,E.minX),L=Math.max(w.minY,E.minY),_=Math.min(w.maxX,E.maxX),B=Math.min(w.maxY,E.maxY),Math.max(0,_-k)*Math.max(0,B-L)),z=h(ie)+h(H);oe<V?(V=oe,D=Y,j=z<j?z:j):oe===V&&z<j&&(j=z,D=Y)}return D||T-x},i.prototype._chooseSplitAxis=function(C,x,T){var D=C.leaf?this.compareMinX:l,w=C.leaf?this.compareMinY:u;this._allDistMargin(C,x,T,D)<this._allDistMargin(C,x,T,w)&&C.children.sort(D)},i.prototype._allDistMargin=function(C,x,T,D){C.children.sort(D);for(var w=this.toBBox,E=s(C,0,x,w),k=s(C,T-x,T,w),L=g(E)+g(k),_=x;_<T-x;_++){var B=C.children[_];c(E,C.leaf?w(B):B),L+=g(E)}for(var V=T-x-1;V>=x;V--){var j=C.children[V];c(k,C.leaf?w(j):j),L+=g(k)}return L},i.prototype._adjustParentBBoxes=function(C,x,T){for(var D=T;D>=0;D--)c(x[D],C)},i.prototype._condense=function(C){for(var x=C.length-1,T=void 0;x>=0;x--)C[x].children.length===0?x>0?(T=C[x-1].children).splice(T.indexOf(C[x]),1):this.clear():n(C[x],this.toBBox)},i})});var um=U(J=>{"use strict";m();Object.defineProperty(J,"__esModule",{value:!0});J.earthRadius=63710088e-1;J.factors={centimeters:J.earthRadius*100,centimetres:J.earthRadius*100,degrees:J.earthRadius/111325,feet:J.earthRadius*3.28084,inches:J.earthRadius*39.37,kilometers:J.earthRadius/1e3,kilometres:J.earthRadius/1e3,meters:J.earthRadius,metres:J.earthRadius,miles:J.earthRadius/1609.344,millimeters:J.earthRadius*1e3,millimetres:J.earthRadius*1e3,nauticalmiles:J.earthRadius/1852,radians:1,yards:J.earthRadius*1.0936};J.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/J.earthRadius,yards:1.0936133};J.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 Io(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}p(Io,"feature");J.feature=Io;function Z6(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return sm(t).geometry;case"LineString":return cm(t).geometry;case"Polygon":return lm(t).geometry;case"MultiPoint":return Jv(t).geometry;case"MultiLineString":return $v(t).geometry;case"MultiPolygon":return Qv(t).geometry;default:throw new Error(r+" is invalid")}}p(Z6,"geometry");J.geometry=Z6;function sm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Nu(r[0])||!Nu(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Io(i,t,e)}p(sm,"point");J.point=sm;function z6(r,t,e){return e===void 0&&(e={}),Gu(r.map(function(i){return sm(i,t)}),e)}p(z6,"points");J.points=z6;function lm(r,t,e){e===void 0&&(e={});for(var i=0,o=r;i<o.length;i++){var n=o[i];if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<n[n.length-1].length;s++)if(n[n.length-1][s]!==n[0][s])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return Io(c,t,e)}p(lm,"polygon");J.polygon=lm;function q6(r,t,e){return e===void 0&&(e={}),Gu(r.map(function(i){return lm(i,t)}),e)}p(q6,"polygons");J.polygons=q6;function cm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return Io(i,t,e)}p(cm,"lineString");J.lineString=cm;function $6(r,t,e){return e===void 0&&(e={}),Gu(r.map(function(i){return cm(i,t)}),e)}p($6,"lineStrings");J.lineStrings=$6;function Gu(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}p(Gu,"featureCollection");J.featureCollection=Gu;function $v(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return Io(i,t,e)}p($v,"multiLineString");J.multiLineString=$v;function Jv(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return Io(i,t,e)}p(Jv,"multiPoint");J.multiPoint=Jv;function Qv(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return Io(i,t,e)}p(Qv,"multiPolygon");J.multiPolygon=Qv;function J6(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return Io(i,t,e)}p(J6,"geometryCollection");J.geometryCollection=J6;function Q6(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}p(Q6,"round");J.round=Q6;function Kv(r,t){t===void 0&&(t="kilometers");var e=J.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}p(Kv,"radiansToLength");J.radiansToLength=Kv;function pm(r,t){t===void 0&&(t="kilometers");var e=J.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}p(pm,"lengthToRadians");J.lengthToRadians=pm;function K6(r,t){return e2(pm(r,t))}p(K6,"lengthToDegrees");J.lengthToDegrees=K6;function eI(r){var t=r%360;return t<0&&(t+=360),t}p(eI,"bearingToAzimuth");J.bearingToAzimuth=eI;function e2(r){var t=r%(2*Math.PI);return t*180/Math.PI}p(e2,"radiansToDegrees");J.radiansToDegrees=e2;function tI(r){var t=r%360;return t*Math.PI/180}p(tI,"degreesToRadians");J.degreesToRadians=tI;function rI(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Kv(pm(r,t),e)}p(rI,"convertLength");J.convertLength=rI;function iI(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=J.areaFactors[t];if(!i)throw new Error("invalid original units");var o=J.areaFactors[e];if(!o)throw new Error("invalid final units");return r/i*o}p(iI,"convertArea");J.convertArea=iI;function Nu(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}p(Nu,"isNumber");J.isNumber=Nu;function oI(r){return!!r&&r.constructor===Object}p(oI,"isObject");J.isObject=oI;function nI(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!Nu(t))throw new Error("bbox must only contain numbers")})}p(nI,"validateBBox");J.validateBBox=nI;function aI(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}p(aI,"validateId");J.validateId=aI});var n2=U(Ye=>{"use strict";m();Object.defineProperty(Ye,"__esModule",{value:!0});var ht=um();function ec(r,t,e){if(r!==null)for(var i,o,n,s,c,l,u,h=0,g=0,y,v=r.type,b=v==="FeatureCollection",S=v==="Feature",C=b?r.features.length:1,x=0;x<C;x++){u=b?r.features[x].geometry:S?r.geometry:r,y=u?u.type==="GeometryCollection":!1,c=y?u.geometries.length:1;for(var T=0;T<c;T++){var D=0,w=0;if(s=y?u.geometries[T]:u,s!==null){l=s.coordinates;var E=s.type;switch(h=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(l,g,x,D,w)===!1)return!1;g++,D++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],g,x,D,w)===!1)return!1;g++,E==="MultiPoint"&&D++}E==="LineString"&&D++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-h;o++){if(t(l[i][o],g,x,D,w)===!1)return!1;g++}E==="MultiLineString"&&D++,E==="Polygon"&&w++}E==="Polygon"&&D++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-h;n++){if(t(l[i][o][n],g,x,D,w)===!1)return!1;g++}w++}D++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(ec(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}p(ec,"coordEach");function sI(r,t,e,i){var o=e;return ec(r,function(n,s,c,l,u){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,u)},i),o}p(sI,"coordReduce");function t2(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}p(t2,"propEach");function lI(r,t,e){var i=e;return t2(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(lI,"propReduce");function r2(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}p(r2,"featureEach");function cI(r,t,e){var i=e;return r2(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(cI,"featureReduce");function pI(r){var t=[];return ec(r,function(e){t.push(e)}),t}p(pI,"coordAll");function dm(r,t){var e,i,o,n,s,c,l,u,h,g,y=0,v=r.type==="FeatureCollection",b=r.type==="Feature",S=v?r.features.length:1;for(e=0;e<S;e++){for(c=v?r.features[e].geometry:b?r.geometry:r,u=v?r.features[e].properties:b?r.properties:{},h=v?r.features[e].bbox:b?r.bbox:void 0,g=v?r.features[e].id:b?r.id:void 0,l=c?c.type==="GeometryCollection":!1,s=l?c.geometries.length:1,o=0;o<s;o++){if(n=l?c.geometries[o]:c,n===null){if(t(null,y,u,h,g)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,y,u,h,g)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],y,u,h,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}p(dm,"geomEach");function uI(r,t,e){var i=e;return dm(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}p(uI,"geomReduce");function Vu(r,t){dm(r,function(e,i,o,n,s){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(ht.feature(e,o,{bbox:n,id:s}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var h=e.coordinates[u],g={type:l,coordinates:h};if(t(ht.feature(g,o),i,u)===!1)return!1}})}p(Vu,"flattenEach");function dI(r,t,e){var i=e;return Vu(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}p(dI,"flattenReduce");function i2(r,t){Vu(r,function(e,i,o){var n=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var c,l=0,u=0,h=0;if(ec(e,function(g,y,v,b,S){if(c===void 0||i>l||b>u||S>h){c=g,l=i,u=b,h=S,n=0;return}var C=ht.lineString([c,g],e.properties);if(t(C,i,o,S,n)===!1)return!1;n++,c=g})===!1)return!1}}})}p(i2,"segmentEach");function hI(r,t,e){var i=e,o=!1;return i2(r,function(n,s,c,l,u){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,u),o=!0}),i}p(hI,"segmentReduce");function o2(r,t){if(!r)throw new Error("geojson is required");Vu(r,function(e,i,o){if(e.geometry!==null){var n=e.geometry.type,s=e.geometry.coordinates;switch(n){case"LineString":if(t(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<s.length;c++)if(t(ht.lineString(s[c],e.properties),i,o,c)===!1)return!1;break}}})}p(o2,"lineEach");function fI(r,t,e){var i=e;return o2(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}p(fI,"lineReduce");function mI(r,t){if(t=t||{},!ht.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.segmentIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return n<0&&(n=l.length+n-1),ht.lineString([l[n],l[n+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n-1),ht.lineString([l[o][n],l[o][n+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n-1),ht.lineString([l[i][n],l[i][n+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n-1),ht.lineString([l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}p(mI,"findSegment");function gI(r,t){if(t=t||{},!ht.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.coordIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return ht.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),ht.point(l[i],s,t);case"LineString":return n<0&&(n=l.length+n),ht.point(l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),ht.point(l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),ht.point(l[i][n],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n),ht.point(l[i][o][n],s,t)}throw new Error("geojson is invalid")}p(gI,"findPoint");Ye.coordAll=pI;Ye.coordEach=ec;Ye.coordReduce=sI;Ye.featureEach=r2;Ye.featureReduce=cI;Ye.findPoint=gI;Ye.findSegment=mI;Ye.flattenEach=Vu;Ye.flattenReduce=dI;Ye.geomEach=dm;Ye.geomReduce=uI;Ye.lineEach=o2;Ye.lineReduce=fI;Ye.propEach=t2;Ye.propReduce=lI;Ye.segmentEach=i2;Ye.segmentReduce=hI});var hm=U((GF,s2)=>{"use strict";m();var a2=Object.prototype.toString;s2.exports=p(function(t){var e=a2.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&a2.call(t.callee)==="[object Function]"),i},"isArguments")});var g2=U((UF,m2)=>{"use strict";m();var f2;Object.keys||(tc=Object.prototype.hasOwnProperty,fm=Object.prototype.toString,l2=hm(),mm=Object.prototype.propertyIsEnumerable,c2=!mm.call({toString:null},"toString"),p2=mm.call(function(){},"prototype"),rc=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ju=p(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),u2={$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},d2=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!u2["$"+r]&&tc.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{ju(window[r])}catch{return!0}}catch{return!0}return!1}(),h2=p(function(r){if(typeof window>"u"||!d2)return ju(r);try{return ju(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),f2=p(function(t){var e=t!==null&&typeof t=="object",i=fm.call(t)==="[object Function]",o=l2(t),n=e&&fm.call(t)==="[object String]",s=[];if(!e&&!i&&!o)throw new TypeError("Object.keys called on a non-object");var c=p2&&i;if(n&&t.length>0&&!tc.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 h in t)!(c&&h==="prototype")&&tc.call(t,h)&&s.push(String(h));if(c2)for(var g=h2(t),y=0;y<rc.length;++y)!(g&&rc[y]==="constructor")&&tc.call(t,rc[y])&&s.push(rc[y]);return s},"keys"));var tc,fm,l2,mm,c2,p2,rc,ju,u2,d2,h2;m2.exports=f2});var Hu=U((XF,v2)=>{"use strict";m();var yI=Array.prototype.slice,bI=hm(),y2=Object.keys,Uu=y2?p(function(t){return y2(t)},"keys"):g2(),b2=Object.keys;Uu.shim=p(function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=p(function(i){return bI(i)?b2(yI.call(i)):b2(i)},"keys"))}else Object.keys=Uu;return Object.keys||Uu},"shimObjectKeys");v2.exports=Uu});var S2=U((zF,C2)=>{"use strict";m();C2.exports=Error});var I2=U(($F,x2)=>{"use strict";m();x2.exports=EvalError});var M2=U((QF,P2)=>{"use strict";m();P2.exports=RangeError});var w2=U((ek,T2)=>{"use strict";m();T2.exports=ReferenceError});var gm=U((rk,D2)=>{"use strict";m();D2.exports=SyntaxError});var Oi=U((ok,E2)=>{"use strict";m();E2.exports=TypeError});var L2=U((ak,O2)=>{"use strict";m();O2.exports=URIError});var ic=U((lk,A2)=>{"use strict";m();A2.exports=p(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;t[e]=o;for(e 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 n=Object.getOwnPropertySymbols(t);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},"hasSymbols")});var Wu=U((uk,k2)=>{"use strict";m();var F2=typeof Symbol<"u"&&Symbol,vI=ic();k2.exports=p(function(){return typeof F2!="function"||typeof Symbol!="function"||typeof F2("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vI()},"hasNativeSymbols")});var _2=U((fk,B2)=>{"use strict";m();var ym={__proto__:null,foo:{}},CI=Object;B2.exports=p(function(){return{__proto__:ym}.foo===ym.foo&&!(ym instanceof CI)},"hasProto")});var G2=U((yk,N2)=>{"use strict";m();var SI="Function.prototype.bind called on incompatible ",xI=Object.prototype.toString,II=Math.max,PI="[object Function]",R2=p(function(t,e){for(var i=[],o=0;o<t.length;o+=1)i[o]=t[o];for(var n=0;n<e.length;n+=1)i[n+t.length]=e[n];return i},"concatty"),MI=p(function(t,e){for(var i=[],o=e||0,n=0;o<t.length;o+=1,n+=1)i[n]=t[o];return i},"slicy"),TI=p(function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e},"joiny");N2.exports=p(function(t){var e=this;if(typeof e!="function"||xI.apply(e)!==PI)throw new TypeError(SI+e);for(var i=MI(arguments,1),o,n=p(function(){if(this instanceof o){var h=e.apply(this,R2(i,arguments));return Object(h)===h?h:this}return e.apply(t,R2(i,arguments))},"binder"),s=II(0,e.length-i.length),c=[],l=0;l<s;l++)c[l]="$"+l;if(o=Function("binder","return function ("+TI(c,",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var u=p(function(){},"Empty");u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},"bind")});var Xu=U((Ck,V2)=>{"use strict";m();var wI=G2();V2.exports=Function.prototype.bind||wI});var bm=U((xk,j2)=>{"use strict";m();var DI=Function.prototype.call,EI=Object.prototype.hasOwnProperty,OI=Xu();j2.exports=OI.call(DI,EI)});var xr=U((Pk,Y2)=>{"use strict";m();var pe,LI=S2(),AI=I2(),FI=M2(),kI=w2(),fs=gm(),hs=Oi(),BI=L2(),X2=Function,vm=p(function(r){try{return X2('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Bn=Object.getOwnPropertyDescriptor;if(Bn)try{Bn({},"")}catch{Bn=null}var Cm=p(function(){throw new hs},"throwTypeError"),_I=Bn?function(){try{return arguments.callee,Cm}catch{try{return Bn(arguments,"callee").get}catch{return Cm}}}():Cm,us=Wu()(),RI=_2()(),tt=Object.getPrototypeOf||(RI?function(r){return r.__proto__}:null),ds={},NI=typeof Uint8Array>"u"||!tt?pe:tt(Uint8Array),_n={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":us&&tt?tt([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":ds,"%AsyncGenerator%":ds,"%AsyncGeneratorFunction%":ds,"%AsyncIteratorPrototype%":ds,"%Atomics%":typeof Atomics>"u"?pe:Atomics,"%BigInt%":typeof BigInt>"u"?pe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":LI,"%eval%":eval,"%EvalError%":AI,"%Float32Array%":typeof Float32Array>"u"?pe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pe:FinalizationRegistry,"%Function%":X2,"%GeneratorFunction%":ds,"%Int8Array%":typeof Int8Array>"u"?pe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":us&&tt?tt(tt([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map>"u"?pe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!us||!tt?pe:tt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pe:Promise,"%Proxy%":typeof Proxy>"u"?pe:Proxy,"%RangeError%":FI,"%ReferenceError%":kI,"%Reflect%":typeof Reflect>"u"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!us||!tt?pe:tt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":us&&tt?tt(""[Symbol.iterator]()):pe,"%Symbol%":us?Symbol:pe,"%SyntaxError%":fs,"%ThrowTypeError%":_I,"%TypedArray%":NI,"%TypeError%":hs,"%Uint8Array%":typeof Uint8Array>"u"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pe:Uint32Array,"%URIError%":BI,"%WeakMap%":typeof WeakMap>"u"?pe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pe:WeakSet};if(tt)try{null.error}catch(r){U2=tt(tt(r)),_n["%Error.prototype%"]=U2}var U2,GI=p(function r(t){var e;if(t==="%AsyncFunction%")e=vm("async function () {}");else if(t==="%GeneratorFunction%")e=vm("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=vm("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&tt&&(e=tt(o.prototype))}return _n[t]=e,e},"doEval"),H2={__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"]},oc=Xu(),Yu=bm(),VI=oc.call(Function.call,Array.prototype.concat),jI=oc.call(Function.apply,Array.prototype.splice),W2=oc.call(Function.call,String.prototype.replace),Zu=oc.call(Function.call,String.prototype.slice),UI=oc.call(Function.call,RegExp.prototype.exec),HI=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,WI=/\\(\\)?/g,XI=p(function(t){var e=Zu(t,0,1),i=Zu(t,-1);if(e==="%"&&i!=="%")throw new fs("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new fs("invalid intrinsic syntax, expected opening `%`");var o=[];return W2(t,HI,function(n,s,c,l){o[o.length]=c?W2(l,WI,"$1"):s||n}),o},"stringToPath"),YI=p(function(t,e){var i=t,o;if(Yu(H2,i)&&(o=H2[i],i="%"+o[0]+"%"),Yu(_n,i)){var n=_n[i];if(n===ds&&(n=GI(i)),typeof n>"u"&&!e)throw new hs("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:n}}throw new fs("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Y2.exports=p(function(t,e){if(typeof t!="string"||t.length===0)throw new hs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new hs('"allowMissing" argument must be a boolean');if(UI(/^%?[^%]*%?$/,t)===null)throw new fs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=XI(t),o=i.length>0?i[0]:"",n=YI("%"+o+"%",e),s=n.name,c=n.value,l=!1,u=n.alias;u&&(o=u[0],jI(i,VI([0,1],u)));for(var h=1,g=!0;h<i.length;h+=1){var y=i[h],v=Zu(y,0,1),b=Zu(y,-1);if((v==='"'||v==="'"||v==="`"||b==='"'||b==="'"||b==="`")&&v!==b)throw new fs("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(l=!0),o+="."+y,s="%"+o+"%",Yu(_n,s))c=_n[s];else if(c!=null){if(!(y in c)){if(!e)throw new hs("base intrinsic for "+t+" exists, but the property is not available.");return}if(Bn&&h+1>=i.length){var S=Bn(c,y);g=!!S,g&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[y]}else g=Yu(c,y),c=c[y];g&&!l&&(_n[s]=c)}}return c},"GetIntrinsic")});var qu=U((wk,Z2)=>{"use strict";m();var ZI=xr(),zu=ZI("%Object.defineProperty%",!0)||!1;if(zu)try{zu({},"a",{value:1})}catch{zu=!1}Z2.exports=zu});var Ju=U((Ek,z2)=>{"use strict";m();var zI=xr(),$u=zI("%Object.getOwnPropertyDescriptor%",!0);if($u)try{$u([],"length")}catch{$u=null}z2.exports=$u});var Qu=U((Lk,J2)=>{"use strict";m();var q2=qu(),qI=gm(),ms=Oi(),$2=Ju();J2.exports=p(function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new ms("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new ms("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ms("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ms("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ms("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ms("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!$2&&$2(t,e);if(q2)q2(t,e,{configurable:s===null&&l?l.configurable:!s,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:n===null&&l?l.writable:!n});else if(c||!o&&!n&&!s)t[e]=i;else throw new qI("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Ku=U((kk,K2)=>{"use strict";m();var Sm=qu(),Q2=p(function(){return!!Sm},"hasPropertyDescriptors");Q2.hasArrayLengthDefineBug=p(function(){if(!Sm)return null;try{return Sm([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");K2.exports=Q2});var Po=U((Rk,i3)=>{"use strict";m();var $I=Hu(),JI=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",QI=Object.prototype.toString,KI=Array.prototype.concat,e3=Qu(),eP=p(function(r){return typeof r=="function"&&QI.call(r)==="[object Function]"},"isFunction"),t3=Ku()(),tP=p(function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!eP(i)||!i())return}t3?e3(r,t,e,!0):e3(r,t,e)},"defineProperty"),r3=p(function(r,t){var e=arguments.length>2?arguments[2]:{},i=$I(t);JI&&(i=KI.call(i,Object.getOwnPropertySymbols(t)));for(var o=0;o<i.length;o+=1)tP(r,i[o],t[i[o]],e[i[o]])},"defineProperties");r3.supportsDescriptors=!!t3;i3.exports=r3});var l3=U((Vk,s3)=>{"use strict";m();var rP=xr(),o3=Qu(),iP=Ku()(),n3=Ju(),a3=Oi(),oP=rP("%Math.floor%");s3.exports=p(function(t,e){if(typeof t!="function")throw new a3("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||oP(e)!==e)throw new a3("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,n=!0;if("length"in t&&n3){var s=n3(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(n=!1)}return(o||n||!i)&&(iP?o3(t,"length",e,!0,!0):o3(t,"length",e)),t},"setFunctionLength")});var Rn=U((Hk,ed)=>{"use strict";m();var xm=Xu(),td=xr(),nP=l3(),aP=Oi(),u3=td("%Function.prototype.apply%"),d3=td("%Function.prototype.call%"),h3=td("%Reflect.apply%",!0)||xm.call(d3,u3),c3=qu(),sP=td("%Math.max%");ed.exports=p(function(t){if(typeof t!="function")throw new aP("a function is required");var e=h3(xm,d3,arguments);return nP(e,1+sP(0,t.length-(arguments.length-1)),!0)},"callBind");var p3=p(function(){return h3(xm,u3,arguments)},"applyBind");c3?c3(ed.exports,"apply",{value:p3}):ed.exports.apply=p3});var Zt=U((Yk,g3)=>{"use strict";m();var f3=xr(),m3=Rn(),lP=m3(f3("String.prototype.indexOf"));g3.exports=p(function(t,e){var i=f3(t,!!e);return typeof i=="function"&&lP(t,".prototype.")>-1?m3(i):i},"callBoundIntrinsic")});var Im=U((qk,S3)=>{"use strict";m();var cP=Hu(),v3=ic()(),C3=Zt(),y3=Object,pP=C3("Array.prototype.push"),b3=C3("Object.prototype.propertyIsEnumerable"),uP=v3?Object.getOwnPropertySymbols:null;S3.exports=p(function(t,e){if(t==null)throw new TypeError("target must be an object");var i=y3(t);if(arguments.length===1)return i;for(var o=1;o<arguments.length;++o){var n=y3(arguments[o]),s=cP(n),c=v3&&(Object.getOwnPropertySymbols||uP);if(c)for(var l=c(n),u=0;u<l.length;++u){var h=l[u];b3(n,h)&&pP(s,h)}for(var g=0;g<s.length;++g){var y=s[g];if(b3(n,y)){var v=n[y];i[y]=v}}}return i},"assign")});var Mm=U((Qk,x3)=>{"use strict";m();var Pm=Im(),dP=p(function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},i=0;i<t.length;++i)e[t[i]]=t[i];var o=Object.assign({},e),n="";for(var s in o)n+=s;return r!==n},"lacksProperEnumerationOrder"),hP=p(function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1},"assignHasPendingExceptions");x3.exports=p(function(){return!Object.assign||dP()||hP()?Pm:Object.assign},"getPolyfill")});var P3=U((tB,I3)=>{"use strict";m();var fP=Po(),mP=Mm();I3.exports=p(function(){var t=mP();return fP(Object,{assign:t},{assign:p(function(){return Object.assign!==t},"assign")}),t},"shimAssign")});var D3=U((oB,w3)=>{"use strict";m();var gP=Po(),yP=Rn(),bP=Im(),M3=Mm(),vP=P3(),CP=yP.apply(M3()),T3=p(function(t,e){return CP(Object,arguments)},"assign");gP(T3,{getPolyfill:M3,implementation:bP,shim:vP});w3.exports=T3});var O3=U((sB,E3)=>{"use strict";m();var ac=p(function(){return typeof p(function(){},"f").name=="string"},"functionsHaveNames"),nc=Object.getOwnPropertyDescriptor;if(nc)try{nc([],"length")}catch{nc=null}ac.functionsHaveConfigurableNames=p(function(){if(!ac()||!nc)return!1;var t=nc(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var SP=Function.prototype.bind;ac.boundFunctionsHaveNames=p(function(){return ac()&&typeof SP=="function"&&p(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");E3.exports=ac});var F3=U((pB,A3)=>{"use strict";m();var L3=Qu(),xP=Ku()(),IP=O3().functionsHaveConfigurableNames(),PP=Oi();A3.exports=p(function(t,e){if(typeof t!="function")throw new PP("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||IP)&&(xP?L3(t,"name",e,!0,!0):L3(t,"name",e)),t},"setFunctionName")});var Tm=U((hB,k3)=>{"use strict";m();var MP=F3(),TP=Oi(),wP=Object;k3.exports=MP(p(function(){if(this==null||this!==wP(this))throw new TP("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var wm=U((gB,B3)=>{"use strict";m();var DP=Tm(),EP=Po().supportsDescriptors,OP=Object.getOwnPropertyDescriptor;B3.exports=p(function(){if(EP&&/a/mig.flags==="gim"){var t=OP(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:p(function(){e+="d"},"get")}),Object.defineProperty(i,"sticky",{get:p(function(){e+="y"},"get")}),e==="dy")return t.get}}return DP},"getPolyfill")});var N3=U((vB,R3)=>{"use strict";m();var LP=Po().supportsDescriptors,AP=wm(),FP=Object.getOwnPropertyDescriptor,kP=Object.defineProperty,BP=TypeError,_3=Object.getPrototypeOf,_P=/a/;R3.exports=p(function(){if(!LP||!_3)throw new BP("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=AP(),e=_3(_P),i=FP(e,"flags");return(!i||i.get!==t)&&kP(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var U3=U((xB,j3)=>{"use strict";m();var RP=Po(),NP=Rn(),GP=Tm(),G3=wm(),VP=N3(),V3=NP(G3());RP(V3,{getPolyfill:G3,implementation:GP,shim:VP});j3.exports=V3});var Mo=U((PB,H3)=>{"use strict";m();var jP=ic();H3.exports=p(function(){return jP()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Em=U((wB,X3)=>{"use strict";m();var UP=Mo()(),HP=Zt(),Dm=HP("Object.prototype.toString"),rd=p(function(t){return UP&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Dm(t)==="[object Arguments]"},"isArguments"),W3=p(function(t){return rd(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Dm(t)!=="[object Array]"&&Dm(t.callee)==="[object Function]"},"isArguments"),WP=function(){return rd(arguments)}();rd.isLegacyArguments=W3;X3.exports=WP?rd:W3});var Y3=U(()=>{m()});var d4=U((FB,u4)=>{m();var Gm=typeof Map=="function"&&Map.prototype,Om=Object.getOwnPropertyDescriptor&&Gm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,od=Gm&&Om&&typeof Om.get=="function"?Om.get:null,Z3=Gm&&Map.prototype.forEach,Vm=typeof Set=="function"&&Set.prototype,Lm=Object.getOwnPropertyDescriptor&&Vm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,nd=Vm&&Lm&&typeof Lm.get=="function"?Lm.get:null,z3=Vm&&Set.prototype.forEach,XP=typeof WeakMap=="function"&&WeakMap.prototype,lc=XP?WeakMap.prototype.has:null,YP=typeof WeakSet=="function"&&WeakSet.prototype,cc=YP?WeakSet.prototype.has:null,ZP=typeof WeakRef=="function"&&WeakRef.prototype,q3=ZP?WeakRef.prototype.deref:null,zP=Boolean.prototype.valueOf,qP=Object.prototype.toString,$P=Function.prototype.toString,JP=String.prototype.match,jm=String.prototype.slice,wo=String.prototype.replace,QP=String.prototype.toUpperCase,$3=String.prototype.toLowerCase,n4=RegExp.prototype.test,J3=Array.prototype.concat,$r=Array.prototype.join,KP=Array.prototype.slice,Q3=Math.floor,km=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Am=Object.getOwnPropertySymbols,Bm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,gs=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ft=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===gs||!0)?Symbol.toStringTag:null,a4=Object.prototype.propertyIsEnumerable,K3=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function e4(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||n4.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Q3(-r):Q3(r);if(i!==r){var o=String(i),n=jm.call(t,o.length+1);return wo.call(o,e,"$&_")+"."+wo.call(wo.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return wo.call(t,e,"$&_")}p(e4,"addNumericSeparator");var _m=Y3(),t4=_m.custom,r4=l4(t4)?t4:null;u4.exports=p(function r(t,e,i,o){var n=e||{};if(To(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(To(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=To(n,"customInspect")?n.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(To(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(To(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=n.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 p4(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return c?e4(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return c?e4(t,u):u}var h=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=h&&h>0&&typeof t=="object")return Rm(t)?"[Array]":"[Object]";var g=y9(n,i);if(typeof o>"u")o=[];else if(c4(o,t)>=0)return"[Circular]";function y(ie,H,oe){if(H&&(o=KP.call(o),o.push(H)),oe){var z={depth:n.depth};return To(n,"quoteStyle")&&(z.quoteStyle=n.quoteStyle),r(ie,z,i+1,o)}return r(ie,n,i+1,o)}if(p(y,"inspect"),typeof t=="function"&&!i4(t)){var v=l9(t),b=id(t,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(b.length>0?" { "+$r.call(b,", ")+" }":"")}if(l4(t)){var S=gs?wo.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Bm.call(t);return typeof t=="object"&&!gs?sc(S):S}if(f9(t)){for(var C="<"+$3.call(String(t.nodeName)),x=t.attributes||[],T=0;T<x.length;T++)C+=" "+x[T].name+"="+s4(e9(x[T].value),"double",n);return C+=">",t.childNodes&&t.childNodes.length&&(C+="..."),C+="</"+$3.call(String(t.nodeName))+">",C}if(Rm(t)){if(t.length===0)return"[]";var D=id(t,y);return g&&!g9(D)?"["+Nm(D,g)+"]":"[ "+$r.call(D,", ")+" ]"}if(r9(t)){var w=id(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!a4.call(t,"cause")?"{ ["+String(t)+"] "+$r.call(J3.call("[cause]: "+y(t.cause),w),", ")+" }":w.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+$r.call(w,", ")+" }"}if(typeof t=="object"&&s){if(r4&&typeof t[r4]=="function"&&_m)return _m(t,{depth:h-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(c9(t)){var E=[];return Z3&&Z3.call(t,function(ie,H){E.push(y(H,t,!0)+" => "+y(ie,t))}),o4("Map",od.call(t),E,g)}if(d9(t)){var k=[];return z3&&z3.call(t,function(ie){k.push(y(ie,t))}),o4("Set",nd.call(t),k,g)}if(p9(t))return Fm("WeakMap");if(h9(t))return Fm("WeakSet");if(u9(t))return Fm("WeakRef");if(o9(t))return sc(y(Number(t)));if(a9(t))return sc(y(km.call(t)));if(n9(t))return sc(zP.call(t));if(i9(t))return sc(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!t9(t)&&!i4(t)){var L=id(t,y),_=K3?K3(t)===Object.prototype:t instanceof Object||t.constructor===Object,B=t instanceof Object?"":"null prototype",V=!_&&ft&&Object(t)===t&&ft in t?jm.call(Do(t),8,-1):B?"Object":"",j=_||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Y=j+(V||B?"["+$r.call(J3.call([],V||[],B||[]),": ")+"] ":"");return L.length===0?Y+"{}":g?Y+"{"+Nm(L,g)+"}":Y+"{ "+$r.call(L,", ")+" }"}return String(t)},"inspect_");function s4(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}p(s4,"wrapQuotes");function e9(r){return wo.call(String(r),/"/g,""")}p(e9,"quote");function Rm(r){return Do(r)==="[object Array]"&&(!ft||!(typeof r=="object"&&ft in r))}p(Rm,"isArray");function t9(r){return Do(r)==="[object Date]"&&(!ft||!(typeof r=="object"&&ft in r))}p(t9,"isDate");function i4(r){return Do(r)==="[object RegExp]"&&(!ft||!(typeof r=="object"&&ft in r))}p(i4,"isRegExp");function r9(r){return Do(r)==="[object Error]"&&(!ft||!(typeof r=="object"&&ft in r))}p(r9,"isError");function i9(r){return Do(r)==="[object String]"&&(!ft||!(typeof r=="object"&&ft in r))}p(i9,"isString");function o9(r){return Do(r)==="[object Number]"&&(!ft||!(typeof r=="object"&&ft in r))}p(o9,"isNumber");function n9(r){return Do(r)==="[object Boolean]"&&(!ft||!(typeof r=="object"&&ft in r))}p(n9,"isBoolean");function l4(r){if(gs)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Bm)return!1;try{return Bm.call(r),!0}catch{}return!1}p(l4,"isSymbol");function a9(r){if(!r||typeof r!="object"||!km)return!1;try{return km.call(r),!0}catch{}return!1}p(a9,"isBigInt");var s9=Object.prototype.hasOwnProperty||function(r){return r in this};function To(r,t){return s9.call(r,t)}p(To,"has");function Do(r){return qP.call(r)}p(Do,"toStr");function l9(r){if(r.name)return r.name;var t=JP.call($P.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}p(l9,"nameOf");function c4(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}p(c4,"indexOf");function c9(r){if(!od||!r||typeof r!="object")return!1;try{od.call(r);try{nd.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}p(c9,"isMap");function p9(r){if(!lc||!r||typeof r!="object")return!1;try{lc.call(r,lc);try{cc.call(r,cc)}catch{return!0}return r instanceof WeakMap}catch{}return!1}p(p9,"isWeakMap");function u9(r){if(!q3||!r||typeof r!="object")return!1;try{return q3.call(r),!0}catch{}return!1}p(u9,"isWeakRef");function d9(r){if(!nd||!r||typeof r!="object")return!1;try{nd.call(r);try{od.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}p(d9,"isSet");function h9(r){if(!cc||!r||typeof r!="object")return!1;try{cc.call(r,cc);try{lc.call(r,lc)}catch{return!0}return r instanceof WeakSet}catch{}return!1}p(h9,"isWeakSet");function f9(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}p(f9,"isElement");function p4(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return p4(jm.call(r,0,t.maxStringLength),t)+i}var o=wo.call(wo.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,m9);return s4(o,"single",t)}p(p4,"inspectString");function m9(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+QP.call(t.toString(16))}p(m9,"lowbyte");function sc(r){return"Object("+r+")"}p(sc,"markBoxed");function Fm(r){return r+" { ? }"}p(Fm,"weakCollectionOf");function o4(r,t,e,i){var o=i?Nm(e,i):$r.call(e,", ");return r+" ("+t+") {"+o+"}"}p(o4,"collectionOf");function g9(r){for(var t=0;t<r.length;t++)if(c4(r[t],"\n")>=0)return!1;return!0}p(g9,"singleLineValues");function y9(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=$r.call(Array(r.indent+1)," ");else return null;return{base:e,prev:$r.call(Array(t+1),e)}}p(y9,"getIndent");function Nm(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+$r.call(r,","+e)+"\n"+t.prev}p(Nm,"indentedJoin");function id(r,t){var e=Rm(r),i=[];if(e){i.length=r.length;for(var o=0;o<r.length;o++)i[o]=To(r,o)?t(r[o],r):""}var n=typeof Am=="function"?Am(r):[],s;if(gs){s={};for(var c=0;c<n.length;c++)s["$"+n[c]]=n[c]}for(var l in r)To(r,l)&&(e&&String(Number(l))===l&&l<r.length||gs&&s["$"+l]instanceof Symbol||(n4.call(/[^\w$]/,l)?i.push(t(l,r)+": "+t(r[l],r)):i.push(l+": "+t(r[l],r))));if(typeof Am=="function")for(var u=0;u<n.length;u++)a4.call(r,n[u])&&i.push("["+t(n[u])+"]: "+t(r[n[u]],r));return i}p(id,"arrObjKeys")});var Hm=U((_B,f4)=>{"use strict";m();var h4=xr(),ys=Zt(),b9=d4(),v9=Oi(),ad=h4("%WeakMap%",!0),sd=h4("%Map%",!0),C9=ys("WeakMap.prototype.get",!0),S9=ys("WeakMap.prototype.set",!0),x9=ys("WeakMap.prototype.has",!0),I9=ys("Map.prototype.get",!0),P9=ys("Map.prototype.set",!0),M9=ys("Map.prototype.has",!0),Um=p(function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),T9=p(function(r,t){var e=Um(r,t);return e&&e.value},"listGet"),w9=p(function(r,t,e){var i=Um(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},"listSet"),D9=p(function(r,t){return!!Um(r,t)},"listHas");f4.exports=p(function(){var t,e,i,o={assert:p(function(n){if(!o.has(n))throw new v9("Side channel does not contain "+b9(n))},"assert"),get:p(function(n){if(ad&&n&&(typeof n=="object"||typeof n=="function")){if(t)return C9(t,n)}else if(sd){if(e)return I9(e,n)}else if(i)return T9(i,n)},"get"),has:p(function(n){if(ad&&n&&(typeof n=="object"||typeof n=="function")){if(t)return x9(t,n)}else if(sd){if(e)return M9(e,n)}else if(i)return D9(i,n);return!1},"has"),set:p(function(n,s){ad&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new ad),S9(t,n,s)):sd?(e||(e=new sd),P9(e,n,s)):(i||(i={key:{},next:null}),w9(i,n,s))},"set")};return o},"getSideChannel")});var g4=U((GB,m4)=>{"use strict";m();var E9=bm(),pc=Hm()(),Li=Oi(),Wm={assert:p(function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof t!="string")throw new Li("`slot` must be a string");if(pc.assert(r),!Wm.has(r,t))throw new Li("`"+t+"` is not present on `O`")},"assert"),get:p(function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof t!="string")throw new Li("`slot` must be a string");var e=pc.get(r);return e&&e["$"+t]},"get"),has:p(function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof t!="string")throw new Li("`slot` must be a string");var e=pc.get(r);return!!e&&E9(e,"$"+t)},"has"),set:p(function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Li("`O` is not an object");if(typeof t!="string")throw new Li("`slot` must be a string");var i=pc.get(r);i||(i={},pc.set(r,i)),i["$"+t]=e},"set")};Object.freeze&&Object.freeze(Wm);m4.exports=Wm});var v4=U((UB,b4)=>{"use strict";m();var uc=g4(),O9=SyntaxError,y4=typeof StopIteration=="object"?StopIteration:null;b4.exports=p(function(t){if(!y4)throw new O9("this environment lacks StopIteration");uc.set(t,"[[Done]]",!1);var e={next:p(function(){var o=uc.get(this,"[[Iterator]]"),n=uc.get(o,"[[Done]]");try{return{done:n,value:n?void 0:o.next()}}catch(s){if(uc.set(o,"[[Done]]",!0),s!==y4)throw s;return{done:!0,value:void 0}}},"next")};return uc.set(e,"[[Iterator]]",t),e},"getStopIterationIterator")});var Xm=U((XB,C4)=>{m();var L9={}.toString;C4.exports=Array.isArray||function(r){return L9.call(r)=="[object Array]"}});var Ym=U((ZB,S4)=>{"use strict";m();var A9=String.prototype.valueOf,F9=p(function(t){try{return A9.call(t),!0}catch{return!1}},"tryStringObject"),k9=Object.prototype.toString,B9="[object String]",_9=Mo()();S4.exports=p(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:_9?F9(t):k9.call(t)===B9},"isString")});var zm=U(($B,P4)=>{"use strict";m();var Zm=typeof Map=="function"&&Map.prototype?Map:null,R9=typeof Set=="function"&&Set.prototype?Set:null,ld;Zm||(ld=p(function(t){return!1},"isMap"));var I4=Zm?Map.prototype.has:null,x4=R9?Set.prototype.has:null;!ld&&!I4&&(ld=p(function(t){return!1},"isMap"));P4.exports=ld||p(function(t){if(!t||typeof t!="object")return!1;try{if(I4.call(t),x4)try{x4.call(t)}catch{return!0}return t instanceof Zm}catch{}return!1},"isMap")});var $m=U((KB,w4)=>{"use strict";m();var N9=typeof Map=="function"&&Map.prototype?Map:null,qm=typeof Set=="function"&&Set.prototype?Set:null,cd;qm||(cd=p(function(t){return!1},"isSet"));var M4=N9?Map.prototype.has:null,T4=qm?Set.prototype.has:null;!cd&&!T4&&(cd=p(function(t){return!1},"isSet"));w4.exports=cd||p(function(t){if(!t||typeof t!="object")return!1;try{if(T4.call(t),M4)try{M4.call(t)}catch{return!0}return t instanceof qm}catch{}return!1},"isSet")});var G4=U((r_,dd)=>{"use strict";m();var D4=Em(),E4=v4();Wu()()||ic()()?(pd=Symbol.iterator,dd.exports=p(function(t){if(t!=null&&typeof t[pd]<"u")return t[pd]();if(D4(t))return Array.prototype[pd].call(t)},"getIterator")):(O4=Xm(),L4=Ym(),Jm=xr(),A4=Jm("%Map%",!0),F4=Jm("%Set%",!0),ar=Zt(),Qm=ar("Array.prototype.push"),Km=ar("String.prototype.charCodeAt"),k4=ar("String.prototype.slice"),B4=p(function(t,e){var i=t.length;if(e+1>=i)return e+1;var o=Km(t,e);if(o<55296||o>56319)return e+1;var n=Km(t,e+1);return n<56320||n>57343?e+1:e+2},"advanceStringIndex"),ud=p(function(t){var e=0;return{next:p(function(){var o=e>=t.length,n;return o||(n=t[e],e+=1),{done:o,value:n}},"next")}},"getArrayIterator"),eg=p(function(t,e){if(O4(t)||D4(t))return ud(t);if(L4(t)){var i=0;return{next:p(function(){var n=B4(t,i),s=k4(t,i,n);return i=n,{done:n>t.length,value:s}},"next")}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},"getNonCollectionIterator"),!A4&&!F4?dd.exports=p(function(t){if(t!=null)return eg(t,!0)},"getIterator"):(_4=zm(),R4=$m(),tg=ar("Map.prototype.forEach",!0),rg=ar("Set.prototype.forEach",!0),(typeof P>"u"||!P.versions||!P.versions.node)&&(ig=ar("Map.prototype.iterator",!0),og=ar("Set.prototype.iterator",!0)),ng=ar("Map.prototype.@@iterator",!0)||ar("Map.prototype._es6-shim iterator_",!0),ag=ar("Set.prototype.@@iterator",!0)||ar("Set.prototype._es6-shim iterator_",!0),N4=p(function(t){if(_4(t)){if(ig)return E4(ig(t));if(ng)return ng(t);if(tg){var e=[];return tg(t,function(o,n){Qm(e,[n,o])}),ud(e)}}if(R4(t)){if(og)return E4(og(t));if(ag)return ag(t);if(rg){var i=[];return rg(t,function(o){Qm(i,o)}),ud(i)}}},"getCollectionIterator"),dd.exports=p(function(t){return N4(t)||eg(t)},"getIterator")));var pd,O4,L4,Jm,A4,F4,ar,Qm,Km,k4,B4,ud,eg,_4,R4,tg,rg,ig,og,ng,ag,N4});var sg=U((n_,j4)=>{"use strict";m();var V4=p(function(r){return r!==r},"numberIsNaN");j4.exports=p(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||V4(t)&&V4(e))},"is")});var lg=U((l_,U4)=>{"use strict";m();var G9=sg();U4.exports=p(function(){return typeof Object.is=="function"?Object.is:G9},"getPolyfill")});var W4=U((u_,H4)=>{"use strict";m();var V9=lg(),j9=Po();H4.exports=p(function(){var t=V9();return j9(Object,{is:t},{is:p(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var z4=U((f_,Z4)=>{"use strict";m();var U9=Po(),H9=Rn(),W9=sg(),X4=lg(),X9=W4(),Y4=H9(X4(),Object);U9(Y4,{getPolyfill:X4,implementation:W9,shim:X9});Z4.exports=Y4});var pg=U((g_,Q4)=>{"use strict";m();var Y9=Rn(),J4=Zt(),Z9=xr(),cg=Z9("%ArrayBuffer%",!0),hd=J4("ArrayBuffer.prototype.byteLength",!0),z9=J4("Object.prototype.toString"),q4=!!cg&&!hd&&new cg(0).slice,$4=!!q4&&Y9(q4);Q4.exports=p(hd||$4?function(t){if(!t||typeof t!="object")return!1;try{return hd?hd(t):$4(t,0),!0}catch{return!1}}:cg?function(t){return z9(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var eC=U((v_,K4)=>{"use strict";m();var q9=Date.prototype.getDay,$9=p(function(t){try{return q9.call(t),!0}catch{return!1}},"tryDateGetDayCall"),J9=Object.prototype.toString,Q9="[object Date]",K9=Mo()();K4.exports=p(function(t){return typeof t!="object"||t===null?!1:K9?$9(t):J9.call(t)===Q9},"isDateObject")});var nC=U((x_,oC)=>{"use strict";m();var ug=Zt(),tC=Mo()(),rC,iC,dg,hg;tC&&(rC=ug("Object.prototype.hasOwnProperty"),iC=ug("RegExp.prototype.exec"),dg={},fd=p(function(){throw dg},"throwRegexMarker"),hg={toString:fd,valueOf:fd},typeof Symbol.toPrimitive=="symbol"&&(hg[Symbol.toPrimitive]=fd));var fd,e8=ug("Object.prototype.toString"),t8=Object.getOwnPropertyDescriptor,r8="[object RegExp]";oC.exports=p(tC?function(t){if(!t||typeof t!="object")return!1;var e=t8(t,"lastIndex"),i=e&&rC(e,"value");if(!i)return!1;try{iC(t,hg)}catch(o){return o===dg}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:e8(t)===r8},"isRegex")});var lC=U((M_,sC)=>{"use strict";m();var i8=Zt(),aC=i8("SharedArrayBuffer.prototype.byteLength",!0);sC.exports=p(aC?function(t){if(!t||typeof t!="object")return!1;try{return aC(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var pC=U((D_,cC)=>{"use strict";m();var o8=Number.prototype.toString,n8=p(function(t){try{return o8.call(t),!0}catch{return!1}},"tryNumberObject"),a8=Object.prototype.toString,s8="[object Number]",l8=Mo()();cC.exports=p(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:l8?n8(t):a8.call(t)===s8},"isNumberObject")});var hC=U((L_,dC)=>{"use strict";m();var uC=Zt(),c8=uC("Boolean.prototype.toString"),p8=uC("Object.prototype.toString"),u8=p(function(t){try{return c8(t),!0}catch{return!1}},"booleanBrandCheck"),d8="[object Boolean]",h8=Mo()();dC.exports=p(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:h8&&Symbol.toStringTag in t?u8(t):p8(t)===d8},"isBoolean")});var yC=U((k_,fg)=>{"use strict";m();var f8=Object.prototype.toString,m8=Wu()();m8?(fC=Symbol.prototype.toString,mC=/^Symbol\(.*\)$/,gC=p(function(t){return typeof t.valueOf()!="symbol"?!1:mC.test(fC.call(t))},"isRealSymbolObject"),fg.exports=p(function(t){if(typeof t=="symbol")return!0;if(f8.call(t)!=="[object Symbol]")return!1;try{return gC(t)}catch{return!1}},"isSymbol")):fg.exports=p(function(t){return!1},"isSymbol");var fC,mC,gC});var CC=U((R_,vC)=>{"use strict";m();var bC=typeof BigInt<"u"&&BigInt;vC.exports=p(function(){return typeof bC=="function"&&typeof BigInt=="function"&&typeof bC(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var IC=U((V_,mg)=>{"use strict";m();var g8=CC()();g8?(SC=BigInt.prototype.valueOf,xC=p(function(t){try{return SC.call(t),!0}catch{}return!1},"tryBigIntObject"),mg.exports=p(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:xC(t)},"isBigInt")):mg.exports=p(function(t){return!1},"isBigInt");var SC,xC});var MC=U((H_,PC)=>{"use strict";m();var y8=Ym(),b8=pC(),v8=hC(),C8=yC(),S8=IC();PC.exports=p(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(y8(t))return"String";if(b8(t))return"Number";if(v8(t))return"Boolean";if(C8(t))return"Symbol";if(S8(t))return"BigInt"},"whichBoxedPrimitive")});var DC=U((Y_,wC)=>{"use strict";m();var md=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,TC=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,gd;md||(gd=p(function(t){return!1},"isWeakMap"));var yg=md?md.prototype.has:null,gg=TC?TC.prototype.has:null;!gd&&!yg&&(gd=p(function(t){return!1},"isWeakMap"));wC.exports=gd||p(function(t){if(!t||typeof t!="object")return!1;try{if(yg.call(t,yg),gg)try{gg.call(t,gg)}catch{return!0}return t instanceof md}catch{}return!1},"isWeakMap")});var OC=U((q_,vg)=>{"use strict";m();var x8=xr(),EC=Zt(),I8=x8("%WeakSet%",!0),bg=EC("WeakSet.prototype.has",!0);bg?(yd=EC("WeakMap.prototype.has",!0),vg.exports=p(function(t){if(!t||typeof t!="object")return!1;try{if(bg(t,bg),yd)try{yd(t,yd)}catch{return!0}return t instanceof I8}catch{}return!1},"isWeakSet")):vg.exports=p(function(t){return!1},"isWeakSet");var yd});var AC=U((Q_,LC)=>{"use strict";m();var P8=zm(),M8=$m(),T8=DC(),w8=OC();LC.exports=p(function(t){if(t&&typeof t=="object"){if(P8(t))return"Map";if(M8(t))return"Set";if(T8(t))return"WeakMap";if(w8(t))return"WeakSet"}return!1},"whichCollection")});var _C=U((tR,BC)=>{"use strict";m();var kC=Function.prototype.toString,bs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Sg,bd;if(typeof bs=="function"&&typeof Object.defineProperty=="function")try{Sg=Object.defineProperty({},"length",{get:p(function(){throw bd},"get")}),bd={},bs(function(){throw 42},null,Sg)}catch(r){r!==bd&&(bs=null)}else bs=null;var D8=/^\s*class\b/,xg=p(function(t){try{var e=kC.call(t);return D8.test(e)}catch{return!1}},"isES6ClassFunction"),Cg=p(function(t){try{return xg(t)?!1:(kC.call(t),!0)}catch{return!1}},"tryFunctionToStr"),vd=Object.prototype.toString,E8="[object Object]",O8="[object Function]",L8="[object GeneratorFunction]",A8="[object HTMLAllCollection]",F8="[object HTML document.all class]",k8="[object HTMLCollection]",B8=typeof Symbol=="function"&&!!Symbol.toStringTag,_8=!(0 in[,]),Ig=p(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(FC=document.all,vd.call(FC)===vd.call(document.all)&&(Ig=p(function(t){if((_8||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=vd.call(t);return(e===A8||e===F8||e===k8||e===E8)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var FC;BC.exports=p(bs?function(t){if(Ig(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{bs(t,null,Sg)}catch(e){if(e!==bd)return!1}return!xg(t)&&Cg(t)}:function(t){if(Ig(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(B8)return Cg(t);if(xg(t))return!1;var e=vd.call(t);return e!==O8&&e!==L8&&!/^\[object HTML/.test(e)?!1:Cg(t)},"isCallable")});var GC=U((oR,NC)=>{"use strict";m();var R8=_C(),N8=Object.prototype.toString,RC=Object.prototype.hasOwnProperty,G8=p(function(t,e,i){for(var o=0,n=t.length;o<n;o++)RC.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},"forEachArray"),V8=p(function(t,e,i){for(var o=0,n=t.length;o<n;o++)i==null?e(t.charAt(o),o,t):e.call(i,t.charAt(o),o,t)},"forEachString"),j8=p(function(t,e,i){for(var o in t)RC.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},"forEachObject"),U8=p(function(t,e,i){if(!R8(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=i),N8.call(t)==="[object Array]"?G8(t,e,o):typeof t=="string"?V8(t,e,o):j8(t,e,o)},"forEach");NC.exports=U8});var jC=U((sR,VC)=>{"use strict";m();VC.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var HC=U((cR,UC)=>{"use strict";m();var Pg=jC(),H8=typeof globalThis>"u"?global:globalThis;UC.exports=p(function(){for(var t=[],e=0;e<Pg.length;e++)typeof H8[Pg[e]]=="function"&&(t[t.length]=Pg[e]);return t},"availableTypedArrays")});var zC=U((dR,ZC)=>{"use strict";m();var Sd=GC(),W8=HC(),WC=Rn(),wg=Zt(),Cd=Ju(),X8=wg("Object.prototype.toString"),YC=Mo()(),XC=typeof globalThis>"u"?global:globalThis,Tg=W8(),Dg=wg("String.prototype.slice"),Mg=Object.getPrototypeOf,Y8=wg("Array.prototype.indexOf",!0)||p(function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},"indexOf"),xd={__proto__:null};YC&&Cd&&Mg?Sd(Tg,function(r){var t=new XC[r];if(Symbol.toStringTag in t){var e=Mg(t),i=Cd(e,Symbol.toStringTag);if(!i){var o=Mg(e);i=Cd(o,Symbol.toStringTag)}xd["$"+r]=WC(i.get)}}):Sd(Tg,function(r){var t=new XC[r],e=t.slice||t.set;e&&(xd["$"+r]=WC(e))});var Z8=p(function(t){var e=!1;return Sd(xd,function(i,o){if(!e)try{"$"+i(t)===o&&(e=Dg(o,1))}catch{}}),e},"tryAllTypedArrays"),z8=p(function(t){var e=!1;return Sd(xd,function(i,o){if(!e)try{i(t),e=Dg(o,1)}catch{}}),e},"tryAllSlices");ZC.exports=p(function(t){if(!t||typeof t!="object")return!1;if(!YC){var e=Dg(X8(t),8,-1);return Y8(Tg,e)>-1?e:e!=="Object"?!1:z8(t)}return Cd?Z8(t):null},"whichTypedArray")});var JC=U((mR,$C)=>{"use strict";m();var q8=Zt(),qC=q8("ArrayBuffer.prototype.byteLength",!0),$8=pg();$C.exports=p(function(t){return $8(t)?qC?qC(t):t.byteLength:NaN},"byteLength")});var x5=U((bR,S5)=>{"use strict";m();var b5=D3(),Jr=Zt(),QC=U3(),J8=xr(),vs=G4(),Q8=Hm(),KC=z4(),e5=Em(),t5=Xm(),r5=pg(),i5=eC(),o5=nC(),n5=lC(),a5=Hu(),s5=MC(),l5=AC(),c5=zC(),p5=JC(),u5=Jr("SharedArrayBuffer.prototype.byteLength",!0),d5=Jr("Date.prototype.getTime"),Eg=Object.getPrototypeOf,h5=Jr("Object.prototype.toString"),Pd=J8("%Set%",!0),Og=Jr("Map.prototype.has",!0),Md=Jr("Map.prototype.get",!0),f5=Jr("Map.prototype.size",!0),Td=Jr("Set.prototype.add",!0),v5=Jr("Set.prototype.delete",!0),wd=Jr("Set.prototype.has",!0),Id=Jr("Set.prototype.size",!0);function m5(r,t,e,i){for(var o=vs(r),n;(n=o.next())&&!n.done;)if(Ir(t,n.value,e,i))return v5(r,n.value),!0;return!1}p(m5,"setHasEqualElement");function C5(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}p(C5,"findLooseMatchingPrimitives");function K8(r,t,e,i,o,n){var s=C5(e);if(s!=null)return s;var c=Md(t,s),l=b5({},o,{strict:!1});return typeof c>"u"&&!Og(t,s)||!Ir(i,c,l,n)?!1:!Og(r,s)&&Ir(i,c,l,n)}p(K8,"mapMightHaveLoosePrim");function eM(r,t,e){var i=C5(e);return i!=null?i:wd(t,i)&&!wd(r,i)}p(eM,"setMightHaveLoosePrim");function g5(r,t,e,i,o,n){for(var s=vs(r),c,l;(c=s.next())&&!c.done;)if(l=c.value,Ir(e,l,o,n)&&Ir(i,Md(t,l),o,n))return v5(r,l),!0;return!1}p(g5,"mapHasEqualEntry");function Ir(r,t,e,i){var o=e||{};if(o.strict?KC(r,t):r===t)return!0;var n=s5(r),s=s5(t);if(n!==s)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return o.strict?KC(r,t):r==t;var c=i.has(r),l=i.has(t),u;if(c&&l){if(i.get(r)===i.get(t))return!0}else u={};return c||i.set(r,u),l||i.set(t,u),iM(r,t,o,i)}p(Ir,"internalDeepEqual");function y5(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}p(y5,"isBuffer");function tM(r,t,e,i){if(Id(r)!==Id(t))return!1;for(var o=vs(r),n=vs(t),s,c,l;(s=o.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new Pd),Td(l,s.value);else if(!wd(t,s.value)){if(e.strict||!eM(r,t,s.value))return!1;l||(l=new Pd),Td(l,s.value)}if(l){for(;(c=n.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!m5(l,c.value,e.strict,i))return!1}else if(!e.strict&&!wd(r,c.value)&&!m5(l,c.value,e.strict,i))return!1;return Id(l)===0}return!0}p(tM,"setEquiv");function rM(r,t,e,i){if(f5(r)!==f5(t))return!1;for(var o=vs(r),n=vs(t),s,c,l,u,h,g;(s=o.next())&&!s.done;)if(u=s.value[0],h=s.value[1],u&&typeof u=="object")l||(l=new Pd),Td(l,u);else if(g=Md(t,u),typeof g>"u"&&!Og(t,u)||!Ir(h,g,e,i)){if(e.strict||!K8(r,t,u,h,e,i))return!1;l||(l=new Pd),Td(l,u)}if(l){for(;(c=n.next())&&!c.done;)if(u=c.value[0],g=c.value[1],u&&typeof u=="object"){if(!g5(l,r,u,g,e,i))return!1}else if(!e.strict&&(!r.has(u)||!Ir(Md(r,u),g,e,i))&&!g5(l,r,u,g,b5({},e,{strict:!1}),i))return!1;return Id(l)===0}return!0}p(rM,"mapEquiv");function iM(r,t,e,i){var o,n;if(typeof r!=typeof t||r==null||t==null||h5(r)!==h5(t)||e5(r)!==e5(t))return!1;var s=t5(r),c=t5(t);if(s!==c)return!1;var l=r instanceof Error,u=t instanceof Error;if(l!==u||(l||u)&&(r.name!==t.name||r.message!==t.message))return!1;var h=o5(r),g=o5(t);if(h!==g||(h||g)&&(r.source!==t.source||QC(r)!==QC(t)))return!1;var y=i5(r),v=i5(t);if(y!==v||(y||v)&&d5(r)!==d5(t)||e.strict&&Eg&&Eg(r)!==Eg(t))return!1;var b=c5(r),S=c5(t);if(b!==S)return!1;if(b||S){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var C=y5(r),x=y5(t);if(C!==x)return!1;if(C||x){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var T=r5(r),D=r5(t);if(T!==D)return!1;if(T||D)return p5(r)!==p5(t)?!1:typeof Uint8Array=="function"&&Ir(new Uint8Array(r),new Uint8Array(t),e,i);var w=n5(r),E=n5(t);if(w!==E)return!1;if(w||E)return u5(r)!==u5(t)?!1:typeof Uint8Array=="function"&&Ir(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var k=a5(r),L=a5(t);if(k.length!==L.length)return!1;for(k.sort(),L.sort(),o=k.length-1;o>=0;o--)if(k[o]!=L[o])return!1;for(o=k.length-1;o>=0;o--)if(n=k[o],!Ir(r[n],t[n],e,i))return!1;var _=l5(r),B=l5(t);return _!==B?!1:_==="Set"||B==="Set"?tM(r,t,e,i):_==="Map"?rM(r,t,e,i):!0}p(iM,"objEquiv");S5.exports=p(function(t,e,i){return Ir(t,e,i,Q8())},"deepEqual")});var N5=U(me=>{"use strict";m();Object.defineProperty(me,"__esModule",{value:!0});function oM(r){return r&&r.__esModule?r:{default:r}}p(oM,"_interopRequireDefault");var nM=Object.defineProperty,be=p((r,t)=>nM(r,"name",{value:t,configurable:!0}),"__name"),aM=x5(),sM=oM(aM),Cs,I5=(Cs=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,i,o;this.precision=10**-((e=t==null?void 0:t.precision)!=null?e:17),this.direction=(i=t==null?void 0:t.direction)!=null?i:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,e){if(t.type!==e.type||!dc(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){let i=Lg(t),o=Lg(e);return i.every(n=>o.some(s=>this.compare(n,s)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((i,o)=>Math.abs(i-e[o])<this.precision)}compareLine(t,e,i=0,o=!1){if(!dc(t,e))return!1;let n=t,s=e;if(o&&!this.compareCoord(n[0],s[0])){let l=this.fixStartIndex(s,n);if(l)s=l;else return!1}let c=this.compareCoord(n[i],s[i]);return this.direction||c?this.comparePath(n,s):this.compareCoord(n[i],s[s.length-(1+i)])?this.comparePath(n.slice().reverse(),s):!1}fixStartIndex(t,e){let i,o=-1;for(let n=0;n<t.length;n++)if(this.compareCoord(t[n],e[0])){o=n;break}return o>=0&&(i=[].concat(t.slice(o,t.length),t.slice(1,o+1))),i}comparePath(t,e){return t.every((i,o)=>this.compareCoord(i,e[o]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){let i=t.coordinates.slice(1,t.coordinates.length),o=e.coordinates.slice(1,e.coordinates.length);return i.every(n=>o.some(s=>this.compareLine(n,s,1,!0)))}return!1}compareGeometryCollection(t,e){return dc(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((i,o)=>this.compare(i,e.geometries[o]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?sM.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return dc(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((i,o)=>this.compare(i,e.features[o]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}},p(Cs,"_GeojsonEquality"),Cs);be(I5,"GeojsonEquality");var lM=I5;function dc(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}p(dc,"sameLength");be(dc,"sameLength");function Lg(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}p(Lg,"explode");be(Lg,"explode");var Nt=63710088e-1,Fg={centimeters:Nt*100,centimetres:Nt*100,degrees:360/(2*Math.PI),feet:Nt*3.28084,inches:Nt*39.37,kilometers:Nt/1e3,kilometres:Nt/1e3,meters:Nt,metres:Nt,miles:Nt/1609.344,millimeters:Nt*1e3,millimetres:Nt*1e3,nauticalmiles:Nt/1852,radians:1,yards:Nt*1.0936},Ag={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 Ai(r,t,e={}){let i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}p(Ai,"feature");be(Ai,"feature");function P5(r,t,e={}){switch(r){case"Point":return Dd(t).geometry;case"LineString":return Od(t).geometry;case"Polygon":return Ed(t).geometry;case"MultiPoint":return Bg(t).geometry;case"MultiLineString":return kg(t).geometry;case"MultiPolygon":return _g(t).geometry;default:throw new Error(r+" is invalid")}}p(P5,"geometry");be(P5,"geometry");function Dd(r,t,e={}){if(!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hc(r[0])||!hc(r[1]))throw new Error("coordinates must contain numbers");return Ai({type:"Point",coordinates:r},t,e)}p(Dd,"point");be(Dd,"point");function M5(r,t,e={}){return fc(r.map(i=>Dd(i,t)),e)}p(M5,"points");be(M5,"points");function Ed(r,t,e={}){for(let o of r){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 n=0;n<o[o.length-1].length;n++)if(o[o.length-1][n]!==o[0][n])throw new Error("First and last Position are not equivalent.")}return Ai({type:"Polygon",coordinates:r},t,e)}p(Ed,"polygon");be(Ed,"polygon");function T5(r,t,e={}){return fc(r.map(i=>Ed(i,t)),e)}p(T5,"polygons");be(T5,"polygons");function Od(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Ai({type:"LineString",coordinates:r},t,e)}p(Od,"lineString");be(Od,"lineString");function w5(r,t,e={}){return fc(r.map(i=>Od(i,t)),e)}p(w5,"lineStrings");be(w5,"lineStrings");function fc(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}p(fc,"featureCollection");be(fc,"featureCollection");function kg(r,t,e={}){return Ai({type:"MultiLineString",coordinates:r},t,e)}p(kg,"multiLineString");be(kg,"multiLineString");function Bg(r,t,e={}){return Ai({type:"MultiPoint",coordinates:r},t,e)}p(Bg,"multiPoint");be(Bg,"multiPoint");function _g(r,t,e={}){return Ai({type:"MultiPolygon",coordinates:r},t,e)}p(_g,"multiPolygon");be(_g,"multiPolygon");function D5(r,t,e={}){return Ai({type:"GeometryCollection",geometries:r},t,e)}p(D5,"geometryCollection");be(D5,"geometryCollection");function E5(r,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let e=Math.pow(10,t||0);return Math.round(r*e)/e}p(E5,"round");be(E5,"round");function Rg(r,t="kilometers"){let e=Fg[t];if(!e)throw new Error(t+" units is invalid");return r*e}p(Rg,"radiansToLength");be(Rg,"radiansToLength");function Ld(r,t="kilometers"){let e=Fg[t];if(!e)throw new Error(t+" units is invalid");return r/e}p(Ld,"lengthToRadians");be(Ld,"lengthToRadians");function O5(r,t){return Ng(Ld(r,t))}p(O5,"lengthToDegrees");be(O5,"lengthToDegrees");function L5(r){let t=r%360;return t<0&&(t+=360),t}p(L5,"bearingToAzimuth");be(L5,"bearingToAzimuth");function Ng(r){return r%(2*Math.PI)*180/Math.PI}p(Ng,"radiansToDegrees");be(Ng,"radiansToDegrees");function A5(r){return r%360*Math.PI/180}p(A5,"degreesToRadians");be(A5,"degreesToRadians");function F5(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Rg(Ld(r,t),e)}p(F5,"convertLength");be(F5,"convertLength");function k5(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=Ag[t];if(!i)throw new Error("invalid original units");let o=Ag[e];if(!o)throw new Error("invalid final units");return r/i*o}p(k5,"convertArea");be(k5,"convertArea");function hc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}p(hc,"isNumber");be(hc,"isNumber");function B5(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}p(B5,"isObject");be(B5,"isObject");function _5(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(t=>{if(!hc(t))throw new Error("bbox must only contain numbers")})}p(_5,"validateBBox");be(_5,"validateBBox");function R5(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}p(R5,"validateId");be(R5,"validateId");me.GeojsonEquality=lM;me.areaFactors=Ag;me.bearingToAzimuth=L5;me.convertArea=k5;me.convertLength=F5;me.degreesToRadians=A5;me.earthRadius=Nt;me.factors=Fg;me.feature=Ai;me.featureCollection=fc;me.geometry=P5;me.geometryCollection=D5;me.isNumber=hc;me.isObject=B5;me.lengthToDegrees=O5;me.lengthToRadians=Ld;me.lineString=Od;me.lineStrings=w5;me.multiLineString=kg;me.multiPoint=Bg;me.multiPolygon=_g;me.point=Dd;me.points=M5;me.polygon=Ed;me.polygons=T5;me.radiansToDegrees=Ng;me.radiansToLength=Rg;me.round=E5;me.validateBBox=_5;me.validateId=R5});var q5=U(Ze=>{"use strict";m();Object.defineProperty(Ze,"__esModule",{value:!0});var cM=Object.defineProperty,at=p((r,t)=>cM(r,"name",{value:t,configurable:!0}),"__name"),mt=N5();function Ss(r,t,e){if(r!==null)for(var i,o,n,s,c,l,u,h=0,g=0,y,v=r.type,b=v==="FeatureCollection",S=v==="Feature",C=b?r.features.length:1,x=0;x<C;x++){u=b?r.features[x].geometry:S?r.geometry:r,y=u?u.type==="GeometryCollection":!1,c=y?u.geometries.length:1;for(var T=0;T<c;T++){var D=0,w=0;if(s=y?u.geometries[T]:u,s!==null){l=s.coordinates;var E=s.type;switch(h=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(l,g,x,D,w)===!1)return!1;g++,D++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],g,x,D,w)===!1)return!1;g++,E==="MultiPoint"&&D++}E==="LineString"&&D++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-h;o++){if(t(l[i][o],g,x,D,w)===!1)return!1;g++}E==="MultiLineString"&&D++,E==="Polygon"&&w++}E==="Polygon"&&D++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-h;n++){if(t(l[i][o][n],g,x,D,w)===!1)return!1;g++}w++}D++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(Ss(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}p(Ss,"coordEach");at(Ss,"coordEach");function G5(r,t,e,i){var o=e;return Ss(r,function(n,s,c,l,u){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,u)},i),o}p(G5,"coordReduce");at(G5,"coordReduce");function Gg(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}p(Gg,"propEach");at(Gg,"propEach");function V5(r,t,e){var i=e;return Gg(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(V5,"propReduce");at(V5,"propReduce");function Vg(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}p(Vg,"featureEach");at(Vg,"featureEach");function j5(r,t,e){var i=e;return Vg(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(j5,"featureReduce");at(j5,"featureReduce");function U5(r){var t=[];return Ss(r,function(e){t.push(e)}),t}p(U5,"coordAll");at(U5,"coordAll");function Ad(r,t){var e,i,o,n,s,c,l,u,h,g,y=0,v=r.type==="FeatureCollection",b=r.type==="Feature",S=v?r.features.length:1;for(e=0;e<S;e++){for(c=v?r.features[e].geometry:b?r.geometry:r,u=v?r.features[e].properties:b?r.properties:{},h=v?r.features[e].bbox:b?r.bbox:void 0,g=v?r.features[e].id:b?r.id:void 0,l=c?c.type==="GeometryCollection":!1,s=l?c.geometries.length:1,o=0;o<s;o++){if(n=l?c.geometries[o]:c,n===null){if(t(null,y,u,h,g)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,y,u,h,g)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],y,u,h,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}p(Ad,"geomEach");at(Ad,"geomEach");function H5(r,t,e){var i=e;return Ad(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}p(H5,"geomReduce");at(H5,"geomReduce");function mc(r,t){Ad(r,function(e,i,o,n,s){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(mt.feature.call(void 0,e,o,{bbox:n,id:s}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var h=e.coordinates[u],g={type:l,coordinates:h};if(t(mt.feature.call(void 0,g,o),i,u)===!1)return!1}})}p(mc,"flattenEach");at(mc,"flattenEach");function W5(r,t,e){var i=e;return mc(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}p(W5,"flattenReduce");at(W5,"flattenReduce");function jg(r,t){mc(r,function(e,i,o){var n=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var c,l=0,u=0,h=0;if(Ss(e,function(g,y,v,b,S){if(c===void 0||i>l||b>u||S>h){c=g,l=i,u=b,h=S,n=0;return}var C=mt.lineString.call(void 0,[c,g],e.properties);if(t(C,i,o,S,n)===!1)return!1;n++,c=g})===!1)return!1}}})}p(jg,"segmentEach");at(jg,"segmentEach");function X5(r,t,e){var i=e,o=!1;return jg(r,function(n,s,c,l,u){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,u),o=!0}),i}p(X5,"segmentReduce");at(X5,"segmentReduce");function Ug(r,t){if(!r)throw new Error("geojson is required");mc(r,function(e,i,o){if(e.geometry!==null){var n=e.geometry.type,s=e.geometry.coordinates;switch(n){case"LineString":if(t(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<s.length;c++)if(t(mt.lineString.call(void 0,s[c],e.properties),i,o,c)===!1)return!1;break}}})}p(Ug,"lineEach");at(Ug,"lineEach");function Y5(r,t,e){var i=e;return Ug(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}p(Y5,"lineReduce");at(Y5,"lineReduce");function Z5(r,t){if(t=t||{},!mt.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.segmentIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return n<0&&(n=l.length+n-1),mt.lineString.call(void 0,[l[n],l[n+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n-1),mt.lineString.call(void 0,[l[o][n],l[o][n+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n-1),mt.lineString.call(void 0,[l[i][n],l[i][n+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n-1),mt.lineString.call(void 0,[l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}p(Z5,"findSegment");at(Z5,"findSegment");function z5(r,t){if(t=t||{},!mt.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.coordIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return mt.point.call(void 0,l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),mt.point.call(void 0,l[i],s,t);case"LineString":return n<0&&(n=l.length+n),mt.point.call(void 0,l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),mt.point.call(void 0,l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),mt.point.call(void 0,l[i][n],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n),mt.point.call(void 0,l[i][o][n],s,t)}throw new Error("geojson is invalid")}p(z5,"findPoint");at(z5,"findPoint");Ze.coordAll=U5;Ze.coordEach=Ss;Ze.coordReduce=G5;Ze.featureEach=Vg;Ze.featureReduce=j5;Ze.findPoint=z5;Ze.findSegment=Z5;Ze.flattenEach=mc;Ze.flattenReduce=W5;Ze.geomEach=Ad;Ze.geomReduce=H5;Ze.lineEach=Ug;Ze.lineReduce=Y5;Ze.propEach=Gg;Ze.propReduce=V5;Ze.segmentEach=jg;Ze.segmentReduce=X5});var $5=U(Fd=>{"use strict";m();Object.defineProperty(Fd,"__esModule",{value:!0});var pM=Object.defineProperty,uM=p((r,t)=>pM(r,"name",{value:t,configurable:!0}),"__name"),dM=q5();function Hg(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return dM.coordEach.call(void 0,r,i=>{e[0]>i[0]&&(e[0]=i[0]),e[1]>i[1]&&(e[1]=i[1]),e[2]<i[0]&&(e[2]=i[0]),e[3]<i[1]&&(e[3]=i[1])}),e}p(Hg,"bbox");uM(Hg,"bbox");var hM=Hg;Fd.bbox=Hg;Fd.default=hM});var tS=U((AR,Wg)=>{m();var Qr=qv(),Q5=um(),K5=n2(),xs=$5().default,fM=K5.featureEach,OR=K5.coordEach,LR=Q5.polygon,J5=Q5.featureCollection;function eS(r){var t=new Qr(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:xs(e),Qr.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:xs(o),i.push(o)}):fM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:xs(o),i.push(o)}),Qr.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:xs(e),Qr.prototype.remove.call(this,e,i)},t.clear=function(){return Qr.prototype.clear.call(this)},t.search=function(e){var i=Qr.prototype.search.call(this,this.toBBox(e));return J5(i)},t.collides=function(e){return Qr.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Qr.prototype.all.call(this);return J5(e)},t.toJSON=function(){return Qr.prototype.toJSON.call(this)},t.fromJSON=function(e){return Qr.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=xs(e);else if(e.type==="FeatureCollection")i=xs(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}p(eS,"geojsonRbush");Wg.exports=eS;Wg.exports.default=eS});var jS=U((Yj,Dc)=>{"use strict";m();var OM=!1,Hn=!1,kS=!0,BS=!1,f={},_S=!1;typeof Dc<"u"&&Dc.exports?(Dc.exports=f,_S=!0):typeof document<"u"?window.ClipperLib=f:self.ClipperLib=f;var Zd;_S?(qe="chrome",Zd="Netscape"):(qe=navigator.userAgent.toString().toLowerCase(),Zd=navigator.appName);var qe,ce={};qe.indexOf("chrome")!=-1&&qe.indexOf("chromium")==-1?ce.chrome=1:ce.chrome=0;qe.indexOf("chromium")!=-1?ce.chromium=1:ce.chromium=0;qe.indexOf("safari")!=-1&&qe.indexOf("chrome")==-1&&qe.indexOf("chromium")==-1?ce.safari=1:ce.safari=0;qe.indexOf("firefox")!=-1?ce.firefox=1:ce.firefox=0;qe.indexOf("firefox/17")!=-1?ce.firefox17=1:ce.firefox17=0;qe.indexOf("firefox/15")!=-1?ce.firefox15=1:ce.firefox15=0;qe.indexOf("firefox/3")!=-1?ce.firefox3=1:ce.firefox3=0;qe.indexOf("opera")!=-1?ce.opera=1:ce.opera=0;qe.indexOf("msie 10")!=-1?ce.msie10=1:ce.msie10=0;qe.indexOf("msie 9")!=-1?ce.msie9=1:ce.msie9=0;qe.indexOf("msie 8")!=-1?ce.msie8=1:ce.msie8=0;qe.indexOf("msie 7")!=-1?ce.msie7=1:ce.msie7=0;qe.indexOf("msie ")!=-1?ce.msie=1:ce.msie=0;f.biginteger_used=null;var Ao,LM=0xdeadbeefcafe,AS=(LM&16777215)==15715070;function N(r,t,e){f.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}p(N,"BigInteger");function ue(){return new N(null)}p(ue,"nbi");function AM(r,t,e,i,o,n){for(;--n>=0;){var s=t*this[r++]+e[i]+o;o=Math.floor(s/67108864),e[i++]=s&67108863}return o}p(AM,"am1");function FM(r,t,e,i,o,n){for(var s=t&32767,c=t>>15;--n>=0;){var l=this[r]&32767,u=this[r++]>>15,h=c*l+u*s;l=s*l+((h&32767)<<15)+e[i]+(o&1073741823),o=(l>>>30)+(h>>>15)+c*u+(o>>>30),e[i++]=l&1073741823}return o}p(FM,"am2");function kM(r,t,e,i,o,n){for(var s=t&16383,c=t>>14;--n>=0;){var l=this[r]&16383,u=this[r++]>>14,h=c*l+u*s;l=s*l+((h&16383)<<14)+e[i]+o,o=(l>>28)+(h>>14)+c*u,e[i++]=l&268435455}return o}p(kM,"am3");AS&&Zd=="Microsoft Internet Explorer"?(N.prototype.am=FM,Ao=30):AS&&Zd!="Netscape"?(N.prototype.am=AM,Ao=26):(N.prototype.am=kM,Ao=28);N.prototype.DB=Ao;N.prototype.DM=(1<<Ao)-1;N.prototype.DV=1<<Ao;var hy=52;N.prototype.FV=Math.pow(2,hy);N.prototype.F1=hy-Ao;N.prototype.F2=2*Ao-hy;var BM="0123456789abcdefghijklmnopqrstuvwxyz",qd=new Array,Ts,lr;Ts=48;for(lr=0;lr<=9;++lr)qd[Ts++]=lr;Ts=97;for(lr=10;lr<36;++lr)qd[Ts++]=lr;Ts=65;for(lr=10;lr<36;++lr)qd[Ts++]=lr;function FS(r){return BM.charAt(r)}p(FS,"int2char");function RS(r,t){var e=qd[r.charCodeAt(t)];return e==null?-1:e}p(RS,"intAt");function _M(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}p(_M,"bnpCopyTo");function RM(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}p(RM,"bnpFromInt");function Lo(r){var t=ue();return t.fromInt(r),t}p(Lo,"nbv");function NM(r,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(r,t);return}this.t=0,this.s=0;for(var i=r.length,o=!1,n=0;--i>=0;){var s=e==8?r[i]&255:RS(r,i);if(s<0){r.charAt(i)=="-"&&(o=!0);continue}o=!1,n==0?this[this.t++]=s:n+e>this.DB?(this[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this[this.t++]=s>>this.DB-n):this[this.t-1]|=s<<n,n+=e,n>=this.DB&&(n-=this.DB)}e==8&&(r[0]&128)!=0&&(this.s=-1,n>0&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&N.ZERO.subTo(this,this)}p(NM,"bnpFromString");function GM(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}p(GM,"bnpClamp");function VM(r){if(this.s<0)return"-"+this.negate().toString(r);var t;if(r==16)t=4;else if(r==8)t=3;else if(r==2)t=1;else if(r==32)t=5;else if(r==4)t=2;else return this.toRadix(r);var e=(1<<t)-1,i,o=!1,n="",s=this.t,c=this.DB-s*this.DB%t;if(s-- >0)for(c<this.DB&&(i=this[s]>>c)>0&&(o=!0,n=FS(i));s>=0;)c<t?(i=(this[s]&(1<<c)-1)<<t-c,i|=this[--s]>>(c+=this.DB-t)):(i=this[s]>>(c-=t)&e,c<=0&&(c+=this.DB,--s)),i>0&&(o=!0),o&&(n+=FS(i));return o?n:"0"}p(VM,"bnToString");function jM(){var r=ue();return N.ZERO.subTo(this,r),r}p(jM,"bnNegate");function UM(){return this.s<0?this.negate():this}p(UM,"bnAbs");function HM(r){var t=this.s-r.s;if(t!=0)return t;var e=this.t;if(t=e-r.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-r[e])!=0)return t;return 0}p(HM,"bnCompareTo");function $d(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}p($d,"nbits");function WM(){return this.t<=0?0:this.DB*(this.t-1)+$d(this[this.t-1]^this.s&this.DM)}p(WM,"bnBitLength");function XM(r,t){var e;for(e=this.t-1;e>=0;--e)t[e+r]=this[e];for(e=r-1;e>=0;--e)t[e]=0;t.t=this.t+r,t.s=this.s}p(XM,"bnpDLShiftTo");function YM(r,t){for(var e=r;e<this.t;++e)t[e-r]=this[e];t.t=Math.max(this.t-r,0),t.s=this.s}p(YM,"bnpDRShiftTo");function ZM(r,t){var e=r%this.DB,i=this.DB-e,o=(1<<i)-1,n=Math.floor(r/this.DB),s=this.s<<e&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+n+1]=this[c]>>i|s,s=(this[c]&o)<<e;for(c=n-1;c>=0;--c)t[c]=0;t[n]=s,t.t=this.t+n+1,t.s=this.s,t.clamp()}p(ZM,"bnpLShiftTo");function zM(r,t){t.s=this.s;var e=Math.floor(r/this.DB);if(e>=this.t){t.t=0;return}var i=r%this.DB,o=this.DB-i,n=(1<<i)-1;t[0]=this[e]>>i;for(var s=e+1;s<this.t;++s)t[s-e-1]|=(this[s]&n)<<o,t[s-e]=this[s]>>i;i>0&&(t[this.t-e-1]|=(this.s&n)<<o),t.t=this.t-e,t.clamp()}p(zM,"bnpRShiftTo");function qM(r,t){for(var e=0,i=0,o=Math.min(r.t,this.t);e<o;)i+=this[e]-r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i-=r[e],t[e++]=i&this.DM,i>>=this.DB;i-=r.s}t.s=i<0?-1:0,i<-1?t[e++]=this.DV+i:i>0&&(t[e++]=i),t.t=e,t.clamp()}p(qM,"bnpSubTo");function $M(r,t){var e=this.abs(),i=r.abs(),o=e.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+e.t]=e.am(0,i[o],t,o,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&N.ZERO.subTo(t,t)}p($M,"bnpMultiplyTo");function JM(r){for(var t=this.abs(),e=r.t=2*t.t;--e>=0;)r[e]=0;for(e=0;e<t.t-1;++e){var i=t.am(e,t[e],r,2*e,0,1);(r[e+t.t]+=t.am(e+1,2*t[e],r,2*e+1,i,t.t-e-1))>=t.DV&&(r[e+t.t]-=t.DV,r[e+t.t+1]=1)}r.t>0&&(r[r.t-1]+=t.am(e,t[e],r,2*e,0,1)),r.s=0,r.clamp()}p(JM,"bnpSquareTo");function QM(r,t,e){var i=r.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=ue());var n=ue(),s=this.s,c=r.s,l=this.DB-$d(i[i.t-1]);l>0?(i.lShiftTo(l,n),o.lShiftTo(l,e)):(i.copyTo(n),o.copyTo(e));var u=n.t,h=n[u-1];if(h!=0){var g=h*(1<<this.F1)+(u>1?n[u-2]>>this.F2:0),y=this.FV/g,v=(1<<this.F1)/g,b=1<<this.F2,S=e.t,C=S-u,x=t==null?ue():t;for(n.dlShiftTo(C,x),e.compareTo(x)>=0&&(e[e.t++]=1,e.subTo(x,e)),N.ONE.dlShiftTo(u,x),x.subTo(n,n);n.t<u;)n[n.t++]=0;for(;--C>=0;){var T=e[--S]==h?this.DM:Math.floor(e[S]*y+(e[S-1]+b)*v);if((e[S]+=n.am(0,T,e,C,0,u))<T)for(n.dlShiftTo(C,x),e.subTo(x,e);e[S]<--T;)e.subTo(x,e)}t!=null&&(e.drShiftTo(u,t),s!=c&&N.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),s<0&&N.ZERO.subTo(e,e)}}}p(QM,"bnpDivRemTo");function KM(r){var t=ue();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(N.ZERO)>0&&r.subTo(t,t),t}p(KM,"bnMod");function Wn(r){this.m=r}p(Wn,"Classic");function eT(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}p(eT,"cConvert");function tT(r){return r}p(tT,"cRevert");function rT(r){r.divRemTo(this.m,null,r)}p(rT,"cReduce");function iT(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(iT,"cMulTo");function oT(r,t){r.squareTo(t),this.reduce(t)}p(oT,"cSqrTo");Wn.prototype.convert=eT;Wn.prototype.revert=tT;Wn.prototype.reduce=rT;Wn.prototype.mulTo=iT;Wn.prototype.sqrTo=oT;function nT(){if(this.t<1)return 0;var r=this[0];if((r&1)==0)return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}p(nT,"bnpInvDigit");function Xn(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}p(Xn,"Montgomery");function aT(r){var t=ue();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(N.ZERO)>0&&this.m.subTo(t,t),t}p(aT,"montConvert");function sT(r){var t=ue();return r.copyTo(t),this.reduce(t),t}p(sT,"montRevert");function lT(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var t=0;t<this.m.t;++t){var e=r[t]&32767,i=e*this.mpl+((e*this.mph+(r[t]>>15)*this.mpl&this.um)<<15)&r.DM;for(e=t+this.m.t,r[e]+=this.m.am(0,i,r,t,0,this.m.t);r[e]>=r.DV;)r[e]-=r.DV,r[++e]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}p(lT,"montReduce");function cT(r,t){r.squareTo(t),this.reduce(t)}p(cT,"montSqrTo");function pT(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(pT,"montMulTo");Xn.prototype.convert=aT;Xn.prototype.revert=sT;Xn.prototype.reduce=lT;Xn.prototype.mulTo=pT;Xn.prototype.sqrTo=cT;function uT(){return(this.t>0?this[0]&1:this.s)==0}p(uT,"bnpIsEven");function dT(r,t){if(r>4294967295||r<1)return N.ONE;var e=ue(),i=ue(),o=t.convert(this),n=$d(r)-1;for(o.copyTo(e);--n>=0;)if(t.sqrTo(e,i),(r&1<<n)>0)t.mulTo(i,o,e);else{var s=e;e=i,i=s}return t.revert(e)}p(dT,"bnpExp");function hT(r,t){var e;return r<256||t.isEven()?e=new Wn(t):e=new Xn(t),this.exp(r,e)}p(hT,"bnModPowInt");N.prototype.copyTo=_M;N.prototype.fromInt=RM;N.prototype.fromString=NM;N.prototype.clamp=GM;N.prototype.dlShiftTo=XM;N.prototype.drShiftTo=YM;N.prototype.lShiftTo=ZM;N.prototype.rShiftTo=zM;N.prototype.subTo=qM;N.prototype.multiplyTo=$M;N.prototype.squareTo=JM;N.prototype.divRemTo=QM;N.prototype.invDigit=nT;N.prototype.isEven=uT;N.prototype.exp=dT;N.prototype.toString=VM;N.prototype.negate=jM;N.prototype.abs=UM;N.prototype.compareTo=HM;N.prototype.bitLength=WM;N.prototype.mod=KM;N.prototype.modPowInt=hT;N.ZERO=Lo(0);N.ONE=Lo(1);function fT(){var r=ue();return this.copyTo(r),r}p(fT,"bnClone");function mT(){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]}p(mT,"bnIntValue");function gT(){return this.t==0?this.s:this[0]<<24>>24}p(gT,"bnByteValue");function yT(){return this.t==0?this.s:this[0]<<16>>16}p(yT,"bnShortValue");function bT(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}p(bT,"bnpChunkSize");function vT(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}p(vT,"bnSigNum");function CT(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var t=this.chunkSize(r),e=Math.pow(r,t),i=Lo(e),o=ue(),n=ue(),s="";for(this.divRemTo(i,o,n);o.signum()>0;)s=(e+n.intValue()).toString(r).substr(1)+s,o.divRemTo(i,o,n);return n.intValue().toString(r)+s}p(CT,"bnpToRadix");function ST(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),o=!1,n=0,s=0,c=0;c<r.length;++c){var l=RS(r,c);if(l<0){r.charAt(c)=="-"&&this.signum()==0&&(o=!0);continue}s=t*s+l,++n>=e&&(this.dMultiply(i),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),o&&N.ZERO.subTo(this,this)}p(ST,"bnpFromRadix");function xT(r,t,e){if(typeof t=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,e),this.testBit(r-1)||this.bitwiseTo(N.ONE.shiftLeft(r-1),fy,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(N.ONE.shiftLeft(r-1),this);else{var i=new Array,o=r&7;i.length=(r>>3)+1,t.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}}p(xT,"bnpFromNumber");function IT(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,o=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[o++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),(i&128)!=0&&(i|=-256),o==0&&(this.s&128)!=(i&128)&&++o,(o>0||i!=this.s)&&(t[o++]=i);return t}p(IT,"bnToByteArray");function PT(r){return this.compareTo(r)==0}p(PT,"bnEquals");function MT(r){return this.compareTo(r)<0?this:r}p(MT,"bnMin");function TT(r){return this.compareTo(r)>0?this:r}p(TT,"bnMax");function wT(r,t,e){var i,o,n=Math.min(r.t,this.t);for(i=0;i<n;++i)e[i]=t(this[i],r[i]);if(r.t<this.t){for(o=r.s&this.DM,i=n;i<this.t;++i)e[i]=t(this[i],o);e.t=this.t}else{for(o=this.s&this.DM,i=n;i<r.t;++i)e[i]=t(o,r[i]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}p(wT,"bnpBitwiseTo");function DT(r,t){return r&t}p(DT,"op_and");function ET(r){var t=ue();return this.bitwiseTo(r,DT,t),t}p(ET,"bnAnd");function fy(r,t){return r|t}p(fy,"op_or");function OT(r){var t=ue();return this.bitwiseTo(r,fy,t),t}p(OT,"bnOr");function NS(r,t){return r^t}p(NS,"op_xor");function LT(r){var t=ue();return this.bitwiseTo(r,NS,t),t}p(LT,"bnXor");function GS(r,t){return r&~t}p(GS,"op_andnot");function AT(r){var t=ue();return this.bitwiseTo(r,GS,t),t}p(AT,"bnAndNot");function FT(){for(var r=ue(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}p(FT,"bnNot");function kT(r){var t=ue();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}p(kT,"bnShiftLeft");function BT(r){var t=ue();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}p(BT,"bnShiftRight");function _T(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}p(_T,"lbit");function RT(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+_T(this[r]);return this.s<0?this.t*this.DB:-1}p(RT,"bnGetLowestSetBit");function NT(r){for(var t=0;r!=0;)r&=r-1,++t;return t}p(NT,"cbit");function GT(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=NT(this[e]^t);return r}p(GT,"bnBitCount");function VT(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}p(VT,"bnTestBit");function jT(r,t){var e=N.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}p(jT,"bnpChangeBit");function UT(r){return this.changeBit(r,fy)}p(UT,"bnSetBit");function HT(r){return this.changeBit(r,GS)}p(HT,"bnClearBit");function WT(r){return this.changeBit(r,NS)}p(WT,"bnFlipBit");function XT(r,t){for(var e=0,i=0,o=Math.min(r.t,this.t);e<o;)i+=this[e]+r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i+=r[e],t[e++]=i&this.DM,i>>=this.DB;i+=r.s}t.s=i<0?-1:0,i>0?t[e++]=i:i<-1&&(t[e++]=this.DV+i),t.t=e,t.clamp()}p(XT,"bnpAddTo");function YT(r){var t=ue();return this.addTo(r,t),t}p(YT,"bnAdd");function ZT(r){var t=ue();return this.subTo(r,t),t}p(ZT,"bnSubtract");function zT(r){var t=ue();return this.multiplyTo(r,t),t}p(zT,"bnMultiply");function qT(){var r=ue();return this.squareTo(r),r}p(qT,"bnSquare");function $T(r){var t=ue();return this.divRemTo(r,t,null),t}p($T,"bnDivide");function JT(r){var t=ue();return this.divRemTo(r,null,t),t}p(JT,"bnRemainder");function QT(r){var t=ue(),e=ue();return this.divRemTo(r,t,e),new Array(t,e)}p(QT,"bnDivideAndRemainder");function KT(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}p(KT,"bnpDMultiply");function ew(r,t){if(r!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=r;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}p(ew,"bnpDAddOffset");function Ec(){}p(Ec,"NullExp");function VS(r){return r}p(VS,"nNop");function tw(r,t,e){r.multiplyTo(t,e)}p(tw,"nMulTo");function rw(r,t){r.squareTo(t)}p(rw,"nSqrTo");Ec.prototype.convert=VS;Ec.prototype.revert=VS;Ec.prototype.mulTo=tw;Ec.prototype.sqrTo=rw;function iw(r){return this.exp(r,new Ec)}p(iw,"bnPow");function ow(r,t,e){var i=Math.min(this.t+r.t,t);for(e.s=0,e.t=i;i>0;)e[--i]=0;var o;for(o=e.t-this.t;i<o;++i)e[i+this.t]=this.am(0,r[i],e,i,0,this.t);for(o=Math.min(r.t,t);i<o;++i)this.am(0,r[i],e,i,0,t-i);e.clamp()}p(ow,"bnpMultiplyLowerTo");function nw(r,t,e){--t;var i=e.t=this.t+r.t-t;for(e.s=0;--i>=0;)e[i]=0;for(i=Math.max(t-this.t,0);i<r.t;++i)e[this.t+i-t]=this.am(t-i,r[i],e,0,0,this.t+i-t);e.clamp(),e.drShiftTo(1,e)}p(nw,"bnpMultiplyUpperTo");function ws(r){this.r2=ue(),this.q3=ue(),N.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}p(ws,"Barrett");function aw(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var t=ue();return r.copyTo(t),this.reduce(t),t}p(aw,"barrettConvert");function sw(r){return r}p(sw,"barrettRevert");function lw(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}p(lw,"barrettReduce");function cw(r,t){r.squareTo(t),this.reduce(t)}p(cw,"barrettSqrTo");function pw(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(pw,"barrettMulTo");ws.prototype.convert=aw;ws.prototype.revert=sw;ws.prototype.reduce=lw;ws.prototype.mulTo=pw;ws.prototype.sqrTo=cw;function uw(r,t){var e=r.bitLength(),i,o=Lo(1),n;if(e<=0)return o;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?n=new Wn(t):t.isEven()?n=new ws(t):n=new Xn(t);var s=new Array,c=3,l=i-1,u=(1<<i)-1;if(s[1]=n.convert(this),i>1){var h=ue();for(n.sqrTo(s[1],h);c<=u;)s[c]=ue(),n.mulTo(h,s[c-2],s[c]),c+=2}var g=r.t-1,y,v=!0,b=ue(),S;for(e=$d(r[g])-1;g>=0;){for(e>=l?y=r[g]>>e-l&u:(y=(r[g]&(1<<e+1)-1)<<l-e,g>0&&(y|=r[g-1]>>this.DB+e-l)),c=i;(y&1)==0;)y>>=1,--c;if((e-=c)<0&&(e+=this.DB,--g),v)s[y].copyTo(o),v=!1;else{for(;c>1;)n.sqrTo(o,b),n.sqrTo(b,o),c-=2;c>0?n.sqrTo(o,b):(S=o,o=b,b=S),n.mulTo(b,s[y],o)}for(;g>=0&&(r[g]&1<<e)==0;)n.sqrTo(o,b),S=o,o=b,b=S,--e<0&&(e=this.DB-1,--g)}return n.revert(o)}p(uw,"bnModPow");function dw(r){var t=this.s<0?this.negate():this.clone(),e=r.s<0?r.negate():r.clone();if(t.compareTo(e)<0){var i=t;t=e,e=i}var o=t.getLowestSetBit(),n=e.getLowestSetBit();if(n<0)return t;for(o<n&&(n=o),n>0&&(t.rShiftTo(n,t),e.rShiftTo(n,e));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return n>0&&e.lShiftTo(n,e),e}p(dw,"bnGCD");function hw(r){if(r<=0)return 0;var t=this.DV%r,e=this.s<0?r-1:0;if(this.t>0)if(t==0)e=this[0]%r;else for(var i=this.t-1;i>=0;--i)e=(t*e+this[i])%r;return e}p(hw,"bnpModInt");function fw(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return N.ZERO;for(var e=r.clone(),i=this.clone(),o=Lo(1),n=Lo(0),s=Lo(0),c=Lo(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!o.isEven()||!n.isEven())&&(o.addTo(this,o),n.subTo(r,n)),o.rShiftTo(1,o)):n.isEven()||n.subTo(r,n),n.rShiftTo(1,n);for(;i.isEven();)i.rShiftTo(1,i),t?((!s.isEven()||!c.isEven())&&(s.addTo(this,s),c.subTo(r,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(r,c),c.rShiftTo(1,c);e.compareTo(i)>=0?(e.subTo(i,e),t&&o.subTo(s,o),n.subTo(c,n)):(i.subTo(e,i),t&&s.subTo(o,s),c.subTo(n,c))}if(i.compareTo(N.ONE)!=0)return N.ZERO;if(c.compareTo(r)>=0)return c.subtract(r);if(c.signum()<0)c.addTo(r,c);else return c;return c.signum()<0?c.add(r):c}p(fw,"bnModInverse");var It=[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],mw=(1<<26)/It[It.length-1];function gw(r){var t,e=this.abs();if(e.t==1&&e[0]<=It[It.length-1]){for(t=0;t<It.length;++t)if(e[0]==It[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<It.length;){for(var i=It[t],o=t+1;o<It.length&&i<mw;)i*=It[o++];for(i=e.modInt(i);t<o;)if(i%It[t++]==0)return!1}return e.millerRabin(r)}p(gw,"bnIsProbablePrime");function yw(r){var t=this.subtract(N.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>It.length&&(r=It.length);for(var o=ue(),n=0;n<r;++n){o.fromInt(It[Math.floor(Math.random()*It.length)]);var s=o.modPow(i,this);if(s.compareTo(N.ONE)!=0&&s.compareTo(t)!=0){for(var c=1;c++<e&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(N.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}p(yw,"bnpMillerRabin");N.prototype.chunkSize=bT;N.prototype.toRadix=CT;N.prototype.fromRadix=ST;N.prototype.fromNumber=xT;N.prototype.bitwiseTo=wT;N.prototype.changeBit=jT;N.prototype.addTo=XT;N.prototype.dMultiply=KT;N.prototype.dAddOffset=ew;N.prototype.multiplyLowerTo=ow;N.prototype.multiplyUpperTo=nw;N.prototype.modInt=hw;N.prototype.millerRabin=yw;N.prototype.clone=fT;N.prototype.intValue=mT;N.prototype.byteValue=gT;N.prototype.shortValue=yT;N.prototype.signum=vT;N.prototype.toByteArray=IT;N.prototype.equals=PT;N.prototype.min=MT;N.prototype.max=TT;N.prototype.and=ET;N.prototype.or=OT;N.prototype.xor=LT;N.prototype.andNot=AT;N.prototype.not=FT;N.prototype.shiftLeft=kT;N.prototype.shiftRight=BT;N.prototype.getLowestSetBit=RT;N.prototype.bitCount=GT;N.prototype.testBit=VT;N.prototype.setBit=UT;N.prototype.clearBit=HT;N.prototype.flipBit=WT;N.prototype.add=YT;N.prototype.subtract=ZT;N.prototype.multiply=zT;N.prototype.divide=$T;N.prototype.remainder=JT;N.prototype.divideAndRemainder=QT;N.prototype.modPow=uw;N.prototype.modInverse=fw;N.prototype.pow=iw;N.prototype.gcd=dw;N.prototype.isProbablePrime=gw;N.prototype.square=qT;var le=N;le.prototype.IsNegative=function(){return this.compareTo(le.ZERO)==-1};le.op_Equality=function(r,t){return r.compareTo(t)==0};le.op_Inequality=function(r,t){return r.compareTo(t)!=0};le.op_GreaterThan=function(r,t){return r.compareTo(t)>0};le.op_LessThan=function(r,t){return r.compareTo(t)<0};le.op_Addition=function(r,t){return new le(r).add(new le(t))};le.op_Subtraction=function(r,t){return new le(r).subtract(new le(t))};le.Int128Mul=function(r,t){return new le(r).multiply(new le(t))};le.op_Division=function(r,t){return r.divide(t)};le.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof zd>"u"&&(zd=p(function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var i=Object.getOwnPropertyNames(t.prototype),o=0;o<i.length;o++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[o])>"u"&&Object.defineProperty(r.prototype,i[o],Object.getOwnPropertyDescriptor(t.prototype,i[o]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}},"Inherit"));var zd;f.Path=function(){return[]};f.Paths=function(){return[]};f.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};f.DoublePoint0=function(){this.X=0,this.Y=0};f.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};f.DoublePoint2=function(r,t){this.X=r,this.Y=t};f.PolyNode=function(){this.m_Parent=null,this.m_polygon=new f.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};f.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};f.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};f.PolyNode.prototype.Contour=function(){return this.m_polygon};f.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};f.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};f.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]};f.PolyNode.prototype.Childs=function(){return this.m_Childs};f.PolyNode.prototype.Parent=function(){return this.m_Parent};f.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};f.PolyTree=function(){this.m_AllPolys=[],f.PolyNode.call(this)};f.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};f.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};f.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};zd(f.PolyTree,f.PolyNode);f.Math_Abs_Int64=f.Math_Abs_Int32=f.Math_Abs_Double=function(r){return Math.abs(r)};f.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};ce.msie||ce.opera||ce.safari?f.Cast_Int32=function(r){return r|0}:f.Cast_Int32=function(r){return~~r};ce.chrome?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:ce.firefox&&typeof Number.toInteger=="function"?f.Cast_Int64=function(r){return Number.toInteger(r)}:ce.msie7||ce.msie8?f.Cast_Int64=function(r){return parseInt(r,10)}:ce.msie?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:f.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};f.Clear=function(r){r.length=0};f.PI=3.141592653589793;f.PI2=2*3.141592653589793;f.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,Hn)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof f.DoublePoint){var e=r[0];this.X=f.Clipper.Round(e.X),this.Y=f.Clipper.Round(e.Y),this.Z=0}else{var i=r[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof f.DoublePoint){var e=r[0];this.X=f.Clipper.Round(e.X),this.Y=f.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};f.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};f.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};Hn?(f.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y),this.Z=0},f.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},f.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(f.IntPoint0=function(){this.X=0,this.Y=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y)},f.IntPoint2=function(r,t){this.X=r,this.Y=t});f.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[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)};f.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};f.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};f.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};f.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};f.PolyType={ptSubject:0,ptClip:1};f.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};f.JoinType={jtSquare:0,jtRound:1,jtMiter:2};f.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};BS&&(f.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});f.EdgeSide={esLeft:0,esRight:1};f.Direction={dRightToLeft:0,dLeftToRight:1};f.TEdge=function(){this.Bot=new f.IntPoint,this.Curr=new f.IntPoint,this.Top=new f.IntPoint,this.Delta=new f.IntPoint,this.Dx=0,this.PolyTyp=f.PolyType.ptSubject,this.Side=f.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};f.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new f.IntPoint};f.MyIntersectNodeSort=function(){};f.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};f.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};f.Scanbeam=function(){this.Y=0,this.Next=null};f.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};f.OutPt=function(){this.Idx=0,this.Pt=new f.IntPoint,this.Next=null,this.Prev=null};f.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new f.IntPoint};f.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};f.ClipperBase.horizontal=-9007199254740992;f.ClipperBase.Skip=-2;f.ClipperBase.Unassigned=-1;f.ClipperBase.tolerance=1e-20;OM?(f.ClipperBase.loRange=46340,f.ClipperBase.hiRange=46340):(f.ClipperBase.loRange=47453132,f.ClipperBase.hiRange=0xfffffffffffff);f.ClipperBase.near_zero=function(r){return r>-f.ClipperBase.tolerance&&r<f.ClipperBase.tolerance};f.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};f.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(f.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};f.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,i){return i?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&le.op_Equality(le.Int128Mul(r.X-t.X,e.Y-t.Y),le.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};f.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var i=t;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,e))return!0;if(i=i.Next,i==t)break}return!1};f.ClipperBase.prototype.SlopesEqual=f.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,o,n,s,c,l;return t==3?(e=r[0],i=r[1],l=r[2],l?le.op_Equality(le.Int128Mul(e.Delta.Y,i.Delta.X),le.Int128Mul(e.Delta.X,i.Delta.Y)):f.Cast_Int64(e.Delta.Y*i.Delta.X)==f.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(o=r[0],n=r[1],s=r[2],l=r[3],l?le.op_Equality(le.Int128Mul(o.Y-n.Y,n.X-s.X),le.Int128Mul(o.X-n.X,n.Y-s.Y)):f.Cast_Int64((o.Y-n.Y)*(n.X-s.X))-f.Cast_Int64((o.X-n.X)*(n.Y-s.Y))===0):(o=r[0],n=r[1],s=r[2],c=r[3],l=r[4],l?le.op_Equality(le.Int128Mul(o.Y-n.Y,s.X-c.X),le.Int128Mul(o.X-n.X,s.Y-c.Y)):f.Cast_Int64((o.Y-n.Y)*(s.X-c.X))-f.Cast_Int64((o.X-n.X)*(s.Y-c.Y))===0)};f.ClipperBase.SlopesEqual3=function(r,t,e){return e?le.op_Equality(le.Int128Mul(r.Delta.Y,t.Delta.X),le.Int128Mul(r.Delta.X,t.Delta.Y)):f.Cast_Int64(r.Delta.Y*t.Delta.X)==f.Cast_Int64(r.Delta.X*t.Delta.Y)};f.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?le.op_Equality(le.Int128Mul(r.Y-t.Y,t.X-e.X),le.Int128Mul(r.X-t.X,t.Y-e.Y)):f.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-f.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};f.ClipperBase.SlopesEqual5=function(r,t,e,i,o){return o?le.op_Equality(le.Int128Mul(r.Y-t.Y,e.X-i.X),le.Int128Mul(r.X-t.X,e.Y-i.Y)):f.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-f.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};f.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,i=this.m_edges[r].length;e<i;++e)this.m_edges[r][e]=null;f.Clear(this.m_edges[r])}f.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};f.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};f.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>f.ClipperBase.hiRange||r.Y>f.ClipperBase.hiRange||-r.X>f.ClipperBase.hiRange||-r.Y>f.ClipperBase.hiRange)&&f.Error("Coordinate outside allowed range in RangeTest()."):(r.X>f.ClipperBase.loRange||r.Y>f.ClipperBase.loRange||-r.X>f.ClipperBase.loRange||-r.Y>f.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};f.ClipperBase.prototype.InitEdge=function(r,t,e,i){r.Next=t,r.Prev=e,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};f.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};f.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;f.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||f.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=f.ClipperBase.horizontal&&r.Prev.Dx!=f.ClipperBase.horizontal)break;for(;r.Prev.Dx==f.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==f.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};f.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,o,n;if(r.Dx==f.ClipperBase.horizontal&&(t?n=r.Prev.Bot.X:n=r.Next.Bot.X,r.Bot.X!=n&&this.ReverseHorizontal(r)),i.OutIdx!=f.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=f.ClipperBase.Skip;)i=i.Next;if(i.Dx==f.ClipperBase.horizontal&&i.Next.OutIdx!=f.ClipperBase.Skip){for(o=i;o.Prev.Dx==f.ClipperBase.horizontal;)o=o.Prev;o.Prev.Top.X==i.Next.Top.X?t||(i=o.Prev):o.Prev.Top.X>i.Next.Top.X&&(i=o.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=f.ClipperBase.Skip;)i=i.Prev;if(i.Dx==f.ClipperBase.horizontal&&i.Prev.OutIdx!=f.ClipperBase.Skip){for(o=i;o.Next.Dx==f.ClipperBase.horizontal;)o=o.Next;o.Next.Top.X==i.Prev.Top.X?t||(i=o.Next):o.Next.Top.X>i.Prev.Top.X&&(i=o.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==f.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==f.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var s=new f.LocalMinima;s.Next=null,s.Y=r.Bot.Y,s.LeftBound=null,s.RightBound=r,s.RightBound.WindDelta=0,i=this.ProcessBound(s.RightBound,t),this.InsertLocalMinima(s)}}return i};f.ClipperBase.prototype.AddPath=function(r,t,e){kS?!e&&t==f.PolyType.ptClip&&f.Error("AddPath: Open paths must be subject."):e||f.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&f.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&f.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var o=new Array,n=0;n<=i;n++)o.push(new f.TEdge);var s=!0;o[1].Curr.X=r[1].X,o[1].Curr.Y=r[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(r[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(r[i],c),this.m_UseFullRange=c.Value,this.InitEdge(o[0],o[1],o[i],r[0]),this.InitEdge(o[i],o[0],o[i-1],r[i]);for(var n=i-1;n>=1;--n)c.Value=this.m_UseFullRange,this.RangeTest(r[n],c),this.m_UseFullRange=c.Value,this.InitEdge(o[n],o[n+1],o[n-1],r[n]);for(var l=o[0],u=l,h=l;;){if(f.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==l&&(l=u.Next),u=this.RemoveEdge(u),h=u;continue}if(u.Prev==u.Next)break;if(e&&f.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,h=u;continue}if(u=u.Next,u==h)break}if(!e&&u==u.Next||e&&u.Prev==u.Next)return!1;e||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=f.ClipperBase.Skip);var g=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(e)return!1;u.Prev.OutIdx=f.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var y=new f.LocalMinima;for(y.Next=null,y.Y=u.Bot.Y,y.LeftBound=null,y.RightBound=u,y.RightBound.Side=f.EdgeSide.esRight,y.RightBound.WindDelta=0;u.Next.OutIdx!=f.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(y),this.m_edges.push(o),!0}this.m_edges.push(o);for(var v,b=null;u=this.FindNextLocMin(u),u!=b;){b==null&&(b=u);var y=new f.LocalMinima;y.Next=null,y.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(y.LeftBound=u.Prev,y.RightBound=u,v=!1):(y.LeftBound=u,y.RightBound=u.Prev,v=!0),y.LeftBound.Side=f.EdgeSide.esLeft,y.RightBound.Side=f.EdgeSide.esRight,e?y.LeftBound.Next==y.RightBound?y.LeftBound.WindDelta=-1:y.LeftBound.WindDelta=1:y.LeftBound.WindDelta=0,y.RightBound.WindDelta=-y.LeftBound.WindDelta,u=this.ProcessBound(y.LeftBound,v);var S=this.ProcessBound(y.RightBound,!v);y.LeftBound.OutIdx==f.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==f.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),v||(u=S)}return!0};f.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,o=0,n=r.length;o<n;++o)this.AddPath(r[o],t,e)&&(i=!0);return i};f.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return f.IntPoint.op_Equality(r,e)||f.IntPoint.op_Equality(r,t)||f.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};f.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};f.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=f.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};f.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};f.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};f.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,Hn&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};f.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=f.EdgeSide.esLeft,t.OutIdx=f.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=f.EdgeSide.esRight,t.OutIdx=f.ClipperBase.Unassigned),r=r.Next}};f.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=f.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=f.PolyFillType.pftEvenOdd,this.m_SubjFillType=f.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,f.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=f.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&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,Hn&&(this.ZFillFunction=null)};f.Clipper.ioReverseSolution=1;f.Clipper.ioStrictlySimple=2;f.Clipper.ioPreserveCollinear=4;f.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),f.ClipperBase.prototype.Clear.call(this))};f.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};f.Clipper.prototype.Reset=function(){f.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};f.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new f.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new f.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new f.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};f.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof f.PolyTree;if(t==4&&!e){var i=r[0],o=r[1],n=r[2],s=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&f.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,f.Clear(o),this.m_SubjFillType=n,this.m_ClipFillType=s,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&e){var i=r[0],l=r[1],n=r[2],s=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=n,this.m_ClipFillType=s,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==2&&!e){var i=r[0],o=r[1];return this.Execute(i,o,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],l=r[1];return this.Execute(i,l,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}};f.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};f.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),f.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts===null||o.IsOpen||(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts!==null&&!o.IsOpen&&this.FixupOutPolygon(o)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{f.Clear(this.m_Joins),f.Clear(this.m_GhostJoins)}};f.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};f.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);f.Clear(this.m_PolyOuts)};f.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};f.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};f.Clipper.prototype.AddJoin=function(r,t,e){var i=new f.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};f.Clipper.prototype.AddGhostJoin=function(r,t){var e=new f.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};Hn&&(f.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});f.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(i=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(f.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&f.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var o=0,n=this.m_GhostJoins.length;o<n;o++){var s=this.m_GhostJoins[o];this.HorzSegmentsOverlap(s.OutPt1.Pt,s.OffPt,e.Bot,e.Top)&&this.AddJoin(s.OutPt1,i,s.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&f.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,c,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&f.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,c,e.Top)}var l=t.NextInAEL;if(l!==null)for(;l!=e;)this.IntersectEdges(e,l,t.Curr,!1),l=l.NextInAEL}}}};f.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};f.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<f.Clipper.TopX(r,t.Top.Y):r.Top.X>f.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};f.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_SubjFillType==f.PolyFillType.pftEvenOdd:this.m_ClipFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_ClipFillType==f.PolyFillType.pftEvenOdd:this.m_SubjFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==f.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case f.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case f.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case f.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case f.ClipType.ctIntersection:switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctUnion:switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case f.ClipType.ctDifference:if(r.PolyTyp==f.PolyType.ptSubject)switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctXor:if(r.WindDelta===0)switch(e){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};f.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=f.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,i=t.PrevInAEL;i!==null;)i.PolyTyp==t.PolyTyp&&i.WindDelta!==0&&(e=!e),i=i.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};f.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};f.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};f.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};f.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};f.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};f.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,o,n;if(f.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=f.EdgeSide.esLeft,t.Side=f.EdgeSide.esRight,o=r,o.PrevInAEL==t?n=t.PrevInAEL:n=o.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=f.EdgeSide.esRight,t.Side=f.EdgeSide.esLeft,o=t,o.PrevInAEL==r?n=r.PrevInAEL:n=o.PrevInAEL),n!==null&&n.OutIdx>=0&&f.Clipper.TopX(n,e.Y)==f.Clipper.TopX(o,e.Y)&&f.ClipperBase.SlopesEqual(o,n,this.m_UseFullRange)&&o.WindDelta!==0&&n.WindDelta!==0){var s=this.AddOutPt(n,e);this.AddJoin(i,s,o.Top)}return i};f.Clipper.prototype.CreateOutRec=function(){var r=new f.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};f.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==f.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var o=new f.OutPt;return i.Pts=o,o.Idx=i.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=o,o.Prev=o,i.IsOpen||this.SetHoleState(r,i),Hn&&(f.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):f.IntPoint.op_Equality(t,r.Top)?(o.Pt.X=r.Top.X,o.Pt.Y=r.Top.Y,o.Pt.Z=r.Top.Z):this.SetZ(o.Pt,r)),r.OutIdx=i.Idx,o}else{var i=this.m_PolyOuts[r.OutIdx],n=i.Pts;if(e&&f.IntPoint.op_Equality(t,n.Pt))return n;if(!e&&f.IntPoint.op_Equality(t,n.Prev.Pt))return n.Prev;var o=new f.OutPt;return o.Idx=i.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=n,o.Prev=n.Prev,o.Prev.Next=o,n.Prev=o,e&&(i.Pts=o),Hn&&(f.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):f.IntPoint.op_Equality(t,r.Top)?(o.Pt.X=r.Top.X,o.Pt.Y=r.Top.Y,o.Pt.Z=r.Top.Z):this.SetZ(o.Pt,r)),o}};f.Clipper.prototype.SwapPoints=function(r,t){var e=new f.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};f.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,i){return r.X>e.X==r.X<i.X||t.X>e.X==t.X<i.X||e.X>r.X==e.X<t.X||i.X>r.X==i.X<t.X||r.X==e.X&&t.X==i.X?!0:r.X==i.X&&t.X==e.X};f.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new f.OutPt;return i.Pt.X=e.X,i.Pt.Y=e.Y,t==r.Next?(r.Next=i,t.Prev=i,i.Next=t,i.Prev=r):(t.Next=i,r.Prev=i,i.Next=r,i.Prev=t),i};f.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;e&&(t.IsHole=!0)};f.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?f.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};f.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;f.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;f.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var o=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;f.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var n=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;f.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var s=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=n&&i>=s||o>=n&&o>=s};f.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;f.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};f.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,i=t.BottomPt;return e.Pt.Y>i.Pt.Y?r:e.Pt.Y<i.Pt.Y?t:e.Pt.X<i.Pt.X?r:e.Pt.X>i.Pt.X||e.Next==e?t:i.Next==i||this.FirstIsBottomPt(e,i)?r:t};f.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};f.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};f.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],o;this.Param1RightOfParam2(e,i)?o=i:this.Param1RightOfParam2(i,e)?o=e:o=this.GetLowermostRec(e,i);var n=e.Pts,s=n.Prev,c=i.Pts,l=c.Prev,u;r.Side==f.EdgeSide.esLeft?(t.Side==f.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=n,n.Prev=c,s.Next=l,l.Prev=s,e.Pts=l):(l.Next=n,n.Prev=l,c.Prev=s,s.Next=c,e.Pts=c),u=f.EdgeSide.esLeft):(t.Side==f.EdgeSide.esRight?(this.ReversePolyPtLinks(c),s.Next=l,l.Prev=s,c.Next=n,n.Prev=c):(s.Next=c,c.Prev=s,n.Prev=l,l.Next=n),u=f.EdgeSide.esRight),e.BottomPt=null,o==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var h=r.OutIdx,g=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==g){y.OutIdx=h,y.Side=u;break}y=y.NextInAEL}i.Idx=e.Idx};f.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};f.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};f.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};f.Clipper.prototype.IntersectEdges=function(r,t,e,i){var o=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,n=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,s=r.OutIdx>=0,c=t.OutIdx>=0;if(kS&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(o||n)&&s&&c&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==f.ClipType.ctUnion?r.WindDelta===0?c&&(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):s&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1))),o&&(r.OutIdx<0?this.DeleteFromAEL(r):f.Error("Error intersecting polylines")),n&&(t.OutIdx<0?this.DeleteFromAEL(t):f.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var l=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=l}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var u,h,g,y;r.PolyTyp==f.PolyType.ptSubject?(u=this.m_SubjFillType,g=this.m_ClipFillType):(u=this.m_ClipFillType,g=this.m_SubjFillType),t.PolyTyp==f.PolyType.ptSubject?(h=this.m_SubjFillType,y=this.m_ClipFillType):(h=this.m_ClipFillType,y=this.m_SubjFillType);var v,b;switch(u){case f.PolyFillType.pftPositive:v=r.WindCnt;break;case f.PolyFillType.pftNegative:v=-r.WindCnt;break;default:v=Math.abs(r.WindCnt);break}switch(h){case f.PolyFillType.pftPositive:b=t.WindCnt;break;case f.PolyFillType.pftNegative:b=-t.WindCnt;break;default:b=Math.abs(t.WindCnt);break}if(s&&c)o||n||v!==0&&v!=1||b!==0&&b!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=f.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if(s)(b===0||b==1)&&(this.AddOutPt(r,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if(c)(v===0||v==1)&&(this.AddOutPt(t,e),f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t));else if((v===0||v==1)&&(b===0||b==1)&&!o&&!n){var S,C;switch(g){case f.PolyFillType.pftPositive:S=r.WindCnt2;break;case f.PolyFillType.pftNegative:S=-r.WindCnt2;break;default:S=Math.abs(r.WindCnt2);break}switch(y){case f.PolyFillType.pftPositive:C=t.WindCnt2;break;case f.PolyFillType.pftNegative:C=-t.WindCnt2;break;default:C=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(v==1&&b==1)switch(this.m_ClipType){case f.ClipType.ctIntersection:S>0&&C>0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctUnion:S<=0&&C<=0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctDifference:(r.PolyTyp==f.PolyType.ptClip&&S>0&&C>0||r.PolyTyp==f.PolyType.ptSubject&&S<=0&&C<=0)&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else f.Clipper.SwapSides(r,t)}o!=n&&(o&&r.OutIdx>=0||n&&t.OutIdx>=0)&&(f.Clipper.SwapSides(r,t),f.Clipper.SwapPolyIndexes(r,t)),o&&this.DeleteFromAEL(r),n&&this.DeleteFromAEL(t)};f.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};f.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};f.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&f.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,f.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};f.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};f.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=f.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=f.Direction.dRightToLeft)};f.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=f.EdgeSide.esLeft&&(e=e.Prev),t&&(f.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};f.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,o=e.Left,n=e.Right,s=r,c=null;s.NextInLML!==null&&f.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(c=this.GetMaximaPair(s));;){for(var l=r==s,u=this.GetNextInAEL(r,i);u!==null&&!(u.Curr.X==r.Top.X&&r.NextInLML!==null&&u.Dx<r.NextInLML.Dx);){var h=this.GetNextInAEL(u,i);if(i==f.Direction.dLeftToRight&&u.Curr.X<=n||i==f.Direction.dRightToLeft&&u.Curr.X>=o){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),u==c&&l){i==f.Direction.dLeftToRight?this.IntersectEdges(r,u,u.Top,!1):this.IntersectEdges(u,r,u.Top,!1),c.OutIdx>=0&&f.Error("ProcessHorizontal error");return}else if(i==f.Direction.dLeftToRight){var g=new f.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(r,u,g,!0)}else{var g=new f.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(u,r,g,!0)}this.SwapPositionsInAEL(r,u)}else if(i==f.Direction.dLeftToRight&&u.Curr.X>=n||i==f.Direction.dRightToLeft&&u.Curr.X<=o)break;u=h}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&f.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:o,Right:n};this.GetHorzDirection(r,e),i=e.Dir,o=e.Left,n=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var y=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var v=r.PrevInAEL,h=r.NextInAEL;if(v!==null&&v.Curr.X==r.Bot.X&&v.Curr.Y==r.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&f.ClipperBase.SlopesEqual(r,v,this.m_UseFullRange)){var b=this.AddOutPt(v,r.Bot);this.AddJoin(y,b,r.Top)}else if(h!==null&&h.Curr.X==r.Bot.X&&h.Curr.Y==r.Bot.Y&&h.WindDelta!==0&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&f.ClipperBase.SlopesEqual(r,h,this.m_UseFullRange)){var b=this.AddOutPt(h,r.Bot);this.AddJoin(y,b,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else c!==null?c.OutIdx>=0?(i==f.Direction.dLeftToRight?this.IntersectEdges(r,c,r.Top,!1):this.IntersectEdges(c,r,r.Top,!1),c.OutIdx>=0&&f.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(c)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};f.Clipper.prototype.GetNextInAEL=function(r,t){return t==f.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};f.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};f.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};f.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};f.Clipper.prototype.GetMaximaPair=function(r){var t=null;return f.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:f.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!f.ClipperBase.IsHorizontal(t))?null:t};f.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,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,f.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};f.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=f.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var o=e.NextInSEL,n=new f.IntPoint;if(e.Curr.X>o.Curr.X){!this.IntersectPoint(e,o,n)&&e.Curr.X>o.Curr.X+1&&f.Error("Intersection error"),n.Y>r&&(n.Y=r,Math.abs(e.Dx)>Math.abs(o.Dx)?n.X=f.Clipper.TopX(o,r):n.X=f.Clipper.TopX(e,r));var s=new f.IntersectNode;s.Edge1=e,s.Edge2=o,s.Pt.X=n.X,s.Pt.Y=n.Y,this.m_IntersectList.push(s),this.SwapPositionsInSEL(e,o),i=!0}else e=o}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};f.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};f.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};f.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var i=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=i}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};f.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var bw=p(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),vw=p(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),Cw=p(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),Sw=p(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");ce.msie?f.Clipper.Round=bw:ce.chromium?f.Clipper.Round=Cw:ce.safari?f.Clipper.Round=Sw:f.Clipper.Round=vw;f.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+f.Clipper.Round(r.Dx*(t-r.Bot.Y))};f.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,o;if(f.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,f.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,e.Y=f.Clipper.Round(e.X/t.Dx+o));else if(t.Delta.X===0)e.X=t.Bot.X,f.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=f.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,o=t.Bot.X-t.Bot.Y*t.Dx;var n=(o-i)/(r.Dx-t.Dx);e.Y=f.Clipper.Round(n),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=f.Clipper.Round(r.Dx*n+i):e.X=f.Clipper.Round(t.Dx*n+o)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=f.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=f.Clipper.TopX(r,e.Y):e.X=f.Clipper.TopX(t,e.Y)}return!0};f.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var i=this.GetMaximaPair(t);e=i===null||!f.ClipperBase.IsHorizontal(i)}if(e){var o=t.PrevInAEL;this.DoMaxima(t),o===null?t=this.m_ActiveEdges:t=o.NextInAEL}else{if(this.IsIntermediate(t,r)&&f.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=f.Clipper.TopX(t,r),t.Curr.Y=r),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 n=this.AddOutPt(o,t.Curr),s=this.AddOutPt(t,t.Curr);this.AddJoin(n,s,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var n=null;t.OutIdx>=0&&(n=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var o=t.PrevInAEL,c=t.NextInAEL;if(o!==null&&o.Curr.X==t.Bot.X&&o.Curr.Y==t.Bot.Y&&n!==null&&o.OutIdx>=0&&o.Curr.Y>o.Top.Y&&f.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var s=this.AddOutPt(o,t.Bot);this.AddJoin(n,s,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&n!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&f.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var s=this.AddOutPt(c,t.Bot);this.AddJoin(n,s,t.Top)}}t=t.NextInAEL}};f.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,i=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):f.Error("DoMaxima error")};f.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};f.Clipper.Orientation=function(r){return f.Clipper.Area(r)>=0};f.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};f.Clipper.prototype.BuildResult=function(r){f.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];if(i.Pts!==null){var o=i.Pts.Prev,n=this.PointCount(o);if(!(n<2)){for(var s=new Array(n),c=0;c<n;c++)s[c]=o.Pt,o=o.Prev;r.push(s)}}}};f.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t],o=this.PointCount(i.Pts);if(!(i.IsOpen&&o<2||!i.IsOpen&&o<3)){this.FixHoleLinkage(i);var n=new f.PolyNode;r.m_AllPolys.push(n),i.PolyNode=n,n.m_polygon.length=o;for(var s=i.Pts.Prev,c=0;c<o;c++)n.m_polygon[c]=s.Pt,s=s.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};f.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(f.IntPoint.op_Equality(e.Pt,e.Next.Pt)||f.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||f.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var i=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,i=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};f.Clipper.prototype.DupOutPt=function(r,t){var e=new f.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};f.Clipper.prototype.GetOverlap=function(r,t,e,i,o){return r<t?e<i?(o.Left=Math.max(r,e),o.Right=Math.min(t,i)):(o.Left=Math.max(r,i),o.Right=Math.min(t,e)):e<i?(o.Left=Math.max(t,e),o.Right=Math.min(r,i)):(o.Left=Math.max(t,i),o.Right=Math.min(r,e)),o.Left<o.Right};f.Clipper.prototype.JoinHorz=function(r,t,e,i,o,n){var s=r.Pt.X>t.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight,c=e.Pt.X>i.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight;if(s==c)return!1;if(s==f.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;n&&r.Pt.X!=o.X&&(r=r.Next),t=this.DupOutPt(r,!n),f.IntPoint.op_Inequality(t.Pt,o)&&(r=t,r.Pt.X=o.X,r.Pt.Y=o.Y,t=this.DupOutPt(r,!n))}else{for(;r.Next.Pt.X>=o.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;!n&&r.Pt.X!=o.X&&(r=r.Next),t=this.DupOutPt(r,n),f.IntPoint.op_Inequality(t.Pt,o)&&(r=t,r.Pt.X=o.X,r.Pt.Y=o.Y,t=this.DupOutPt(r,n))}if(c==f.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;n&&e.Pt.X!=o.X&&(e=e.Next),i=this.DupOutPt(e,!n),f.IntPoint.op_Inequality(i.Pt,o)&&(e=i,e.Pt.X=o.X,e.Pt.Y=o.Y,i=this.DupOutPt(e,!n))}else{for(;e.Next.Pt.X>=o.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;!n&&e.Pt.X!=o.X&&(e=e.Next),i=this.DupOutPt(e,n),f.IntPoint.op_Inequality(i.Pt,o)&&(e=i,e.Pt.X=o.X,e.Pt.Y=o.Y,i=this.DupOutPt(e,n))}return s==f.Direction.dLeftToRight==n?(r.Prev=e,e.Next=r,t.Next=i,i.Prev=t):(r.Next=e,e.Prev=r,t.Prev=i,i.Next=t),!0};f.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,o=new f.OutPt,n=r.OutPt2,s=new f.OutPt,c=r.OutPt1.Pt.Y==r.OffPt.Y;if(c&&f.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&f.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(o=r.OutPt1.Next;o!=i&&f.IntPoint.op_Equality(o.Pt,r.OffPt);)o=o.Next;var l=o.Pt.Y>r.OffPt.Y;for(s=r.OutPt2.Next;s!=n&&f.IntPoint.op_Equality(s.Pt,r.OffPt);)s=s.Next;var u=s.Pt.Y>r.OffPt.Y;return l==u?!1:l?(o=this.DupOutPt(i,!1),s=this.DupOutPt(n,!0),i.Prev=n,n.Next=i,o.Next=s,s.Prev=o,r.OutPt1=i,r.OutPt2=o,!0):(o=this.DupOutPt(i,!0),s=this.DupOutPt(n,!1),i.Next=n,n.Prev=i,o.Prev=s,s.Next=o,r.OutPt1=i,r.OutPt2=o,!0)}else if(c){for(o=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=o&&i.Prev!=n;)i=i.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=i&&o.Next!=n;)o=o.Next;if(o.Next==i||o.Next==n)return!1;for(s=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=s&&n.Prev!=o;)n=n.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=n&&s.Next!=i;)s=s.Next;if(s.Next==n||s.Next==i)return!1;var h={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,o.Pt.X,n.Pt.X,s.Pt.X,h))return!1;var g=h.Left,y=h.Right,v=new f.IntPoint,b;return i.Pt.X>=g&&i.Pt.X<=y?(v.X=i.Pt.X,v.Y=i.Pt.Y,b=i.Pt.X>o.Pt.X):n.Pt.X>=g&&n.Pt.X<=y?(v.X=n.Pt.X,v.Y=n.Pt.Y,b=n.Pt.X>s.Pt.X):o.Pt.X>=g&&o.Pt.X<=y?(v.X=o.Pt.X,v.Y=o.Pt.Y,b=o.Pt.X>i.Pt.X):(v.X=s.Pt.X,v.Y=s.Pt.Y,b=s.Pt.X>n.Pt.X),r.OutPt1=i,r.OutPt2=n,this.JoinHorz(i,o,n,s,v,b)}else{for(o=i.Next;f.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Next;var S=o.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange);if(S){for(o=i.Prev;f.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Prev;if(o.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange))return!1}for(s=n.Next;f.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Next;var C=s.Pt.Y>n.Pt.Y||!f.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange);if(C){for(s=n.Prev;f.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Prev;if(s.Pt.Y>n.Pt.Y||!f.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange))return!1}return o==i||s==n||o==s||t==e&&S==C?!1:S?(o=this.DupOutPt(i,!1),s=this.DupOutPt(n,!0),i.Prev=n,n.Next=i,o.Next=s,s.Prev=o,r.OutPt1=i,r.OutPt2=o,!0):(o=this.DupOutPt(i,!0),s=this.DupOutPt(n,!1),i.Next=n,n.Prev=i,o.Prev=s,s.Next=o,r.OutPt1=i,r.OutPt2=o,!0)}};f.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new f.IntRect(0,0,0,0);var i=new f.IntRect;for(i.left=r[t][0].X,i.right=i.left,i.top=r[t][0].Y,i.bottom=i.top;t<e;t++)for(var o=0,n=r[t].length;o<n;o++)r[t][o].X<i.left?i.left=r[t][o].X:r[t][o].X>i.right&&(i.right=r[t][o].X),r[t][o].Y<i.top?i.top=r[t][o].Y:r[t][o].Y>i.bottom&&(i.bottom=r[t][o].Y);return i};f.Clipper.prototype.GetBounds2=function(r){var t=r,e=new f.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};f.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var o=t[0],n=1;n<=i;++n){var s=n==i?t[0]:t[n];if(s.Y==r.Y&&(s.X==r.X||o.Y==r.Y&&s.X>r.X==o.X<r.X))return-1;if(o.Y<r.Y!=s.Y<r.Y){if(o.X>=r.X)if(s.X>r.X)e=1-e;else{var c=(o.X-r.X)*(s.Y-r.Y)-(s.X-r.X)*(o.Y-r.Y);if(c==0)return-1;c>0==s.Y>o.Y&&(e=1-e)}else if(s.X>r.X){var c=(o.X-r.X)*(s.Y-r.Y)-(s.X-r.X)*(o.Y-r.Y);if(c==0)return-1;c>0==s.Y>o.Y&&(e=1-e)}}o=s}return e};f.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var o=t.Pt.X,n=t.Pt.Y,s=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==r.Y&&(s==r.X||n==r.Y&&s>r.X==o<r.X))return-1;if(n<r.Y!=c<r.Y){if(o>=r.X)if(s>r.X)e=1-e;else{var l=(o-r.X)*(c-r.Y)-(s-r.X)*(n-r.Y);if(l==0)return-1;l>0==c>n&&(e=1-e)}else if(s>r.X){var l=(o-r.X)*(c-r.Y)-(s-r.X)*(n-r.Y);if(l==0)return-1;l>0==c>n&&(e=1-e)}}if(t=t.Next,i==t)break}return e};f.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var i=this.PointInPolygon(e.Pt,t);if(i>=0)return i!=0;e=e.Next}while(e!=r);return!0};f.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts!==null&&o.FirstLeft==r&&this.Poly2ContainsPoly1(o.Pts,t.Pts)&&(o.FirstLeft=t)}};f.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,o=i.length,n=i[e];e<o;e++,n=i[e])n.FirstLeft==r&&(n.FirstLeft=t)};f.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};f.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],i=this.GetOutRec(e.OutPt1.Idx),o=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||o.Pts==null)){var n;if(i==o?n=i:this.Param1RightOfParam2(i,o)?n=o:this.Param1RightOfParam2(o,i)?n=i:n=this.GetLowermostRec(i,o),!!this.JoinPoints(e,i,o))if(i==o){if(i.Pts=e.OutPt1,i.BottomPt=null,o=this.CreateOutRec(),o.Pts=e.OutPt2,this.UpdateOutPtIdxs(o),this.m_UsingPolyTree)for(var s=0,c=this.m_PolyOuts.length;s<c-1;s++){var l=this.m_PolyOuts[s];l.Pts==null||f.Clipper.ParseFirstLeft(l.FirstLeft)!=i||l.IsHole==i.IsHole||this.Poly2ContainsPoly1(l.Pts,e.OutPt2)&&(l.FirstLeft=o)}this.Poly2ContainsPoly1(o.Pts,i.Pts)?(o.IsHole=!i.IsHole,o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i),(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)):this.Poly2ContainsPoly1(i.Pts,o.Pts)?(o.IsHole=i.IsHole,i.IsHole=!o.IsHole,o.FirstLeft=i.FirstLeft,i.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,o),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(o.IsHole=i.IsHole,o.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,o))}else o.Pts=null,o.BottomPt=null,o.Idx=i.Idx,i.IsHole=n.IsHole,n==o&&(i.FirstLeft=o.FirstLeft),o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i)}}};f.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};f.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var i=e.Next;i!=t.Pts;){if(f.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var o=e.Prev,n=i.Prev;e.Prev=n,n.Next=e,i.Prev=o,o.Next=i,t.Pts=e;var s=this.CreateOutRec();s.Pts=i,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),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};f.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,o=t-1;i<t;++i)e+=(r[o].X+r[i].X)*(r[o].Y-r[i].Y),o=i;return-e*.5};f.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};BS&&(f.Clipper.OffsetPaths=function(r,t,e,i,o){var n=new f.Paths,s=new f.ClipperOffset(o,o);return s.AddPaths(r,e,i),s.Execute(n,t),n});f.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,e,t,t),e};f.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=f.PolyFillType.pftEvenOdd);var e=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,e,t,t),e};f.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};f.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,o=e.X-t.X,n=i*t.X+o*t.Y;return n=i*r.X+o*r.Y-n,n*n/(i*i+o*o)};f.Clipper.SlopesNearCollinear=function(r,t,e,i){return f.Clipper.DistanceFromLineSqrd(t,r,e)<i};f.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,o=r.Y-t.Y;return i*i+o*o<=e};f.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};f.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var i=new Array(e),o=0;o<e;++o)i[o]=new f.OutPt;for(var o=0;o<e;++o)i[o].Pt=r[o],i[o].Next=i[(o+1)%e],i[o].Next.Prev=i[o],i[o].Idx=0;for(var n=t*t,s=i[0];s.Idx==0&&s.Next!=s.Prev;)f.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,n)?(s=f.Clipper.ExcludeOp(s),e--):f.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,n)?(f.Clipper.ExcludeOp(s.Next),s=f.Clipper.ExcludeOp(s),e-=2):f.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,n)?(s=f.Clipper.ExcludeOp(s),e--):(s.Idx=1,s=s.Next);e<3&&(e=0);for(var c=new Array(e),o=0;o<e;++o)c[o]=new f.IntPoint(s.Pt),s=s.Next;return i=null,c};f.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,o=r.length;i<o;i++)e[i]=f.Clipper.CleanPolygon(r[i],t);return e};f.Clipper.Minkowski=function(r,t,e,i){var o=i?1:0,n=r.length,s=t.length,c=new Array;if(e)for(var l=0;l<s;l++){for(var u=new Array(n),h=0,g=r.length,y=r[h];h<g;h++,y=r[h])u[h]=new f.IntPoint(t[l].X+y.X,t[l].Y+y.Y);c.push(u)}else for(var l=0;l<s;l++){for(var u=new Array(n),h=0,g=r.length,y=r[h];h<g;h++,y=r[h])u[h]=new f.IntPoint(t[l].X-y.X,t[l].Y-y.Y);c.push(u)}for(var v=new Array,l=0;l<s-1+o;l++)for(var h=0;h<n;h++){var b=new Array;b.push(c[l%s][h%n]),b.push(c[(l+1)%s][h%n]),b.push(c[(l+1)%s][(h+1)%n]),b.push(c[l%s][(h+1)%n]),f.Clipper.Orientation(b)||b.reverse(),v.push(b)}var S=new f.Clipper(0);return S.AddPaths(v,f.PolyType.ptSubject,!0),S.Execute(f.ClipType.ctUnion,c,f.PolyFillType.pftNonZero,f.PolyFillType.pftNonZero),c};f.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],o=r[2];return f.Clipper.Minkowski(e,i,!0,o)}else if(t==4){for(var e=r[0],n=r[1],s=r[2],o=r[3],c=new f.Clipper,l,u=0,h=n.length;u<h;++u){var l=f.Clipper.Minkowski(e,n[u],!0,o);c.AddPaths(l,f.PolyType.ptSubject,!0)}o&&c.AddPaths(n,f.PolyType.ptClip,!0);var g=new f.Paths;return c.Execute(f.ClipType.ctUnion,g,s,s),g}};f.Clipper.MinkowskiDiff=function(r,t,e){return f.Clipper.Minkowski(r,t,!1,e)};f.Clipper.PolyTreeToPaths=function(r){var t=new Array;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntAny,t),t};f.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case f.Clipper.NodeType.ntOpen:return;case f.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var o=0,n=r.Childs(),s=n.length,c=n[o];o<s;o++,c=n[o])f.Clipper.AddPolyNodeToPaths(c,t,e)};f.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new f.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};f.Clipper.ClosedPathsFromPolyTree=function(r){var t=new f.Paths;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntClosed,t),t};zd(f.Clipper,f.ClipperBase);f.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};f.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=f.ClipperOffset.def_arc_tolerance),this.m_destPolys=new f.Paths,this.m_srcPoly=new f.Path,this.m_destPoly=new f.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 f.IntPoint,this.m_polyNodes=new f.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};f.ClipperOffset.two_pi=6.28318530717959;f.ClipperOffset.def_arc_tolerance=.25;f.ClipperOffset.prototype.Clear=function(){f.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};f.ClipperOffset.Round=f.Clipper.Round;f.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var o=new f.PolyNode;if(o.m_jointype=t,o.m_endtype=e,e==f.EndType.etClosedLine||e==f.EndType.etClosedPolygon)for(;i>0&&f.IntPoint.op_Equality(r[0],r[i]);)i--;o.m_polygon.push(r[0]);for(var n=0,s=0,c=1;c<=i;c++)f.IntPoint.op_Inequality(o.m_polygon[n],r[c])&&(n++,o.m_polygon.push(r[c]),(r[c].Y>o.m_polygon[s].Y||r[c].Y==o.m_polygon[s].Y&&r[c].X<o.m_polygon[s].X)&&(s=n));if(!(e==f.EndType.etClosedPolygon&&n<2||e!=f.EndType.etClosedPolygon&&n<0)&&(this.m_polyNodes.AddChild(o),e==f.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new f.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 f.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};f.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,o=r.length;i<o;i++)this.AddPath(r[i],t,e)};f.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!f.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==f.EndType.etClosedPolygon||t.m_endtype==f.EndType.etClosedLine&&f.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==f.EndType.etClosedLine&&!f.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};f.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new f.DoublePoint(0,0);var o=1/Math.sqrt(e*e+i*i);return e*=o,i*=o,new f.DoublePoint(i,-e)};f.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,f.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==f.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=f.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*f.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*f.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(f.ClipperOffset.two_pi/o),this.m_cos=Math.cos(f.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/f.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var n=this.m_srcPoly.length;if(!(n==0||r<=0&&(n<3||e.m_endtype!=f.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,n==1){if(e.m_jointype==f.JoinType.jtRound)for(var s=1,c=0,l=1;l<=o;l++){this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r)));var u=s;s=s*this.m_cos-this.m_sin*c,c=u*this.m_sin+c*this.m_cos}else for(var s=-1,c=-1,l=0;l<4;++l)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r))),s<0?s=1:c<0?c=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<n-1;l++)this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(e.m_endtype==f.EndType.etClosedLine||e.m_endtype==f.EndType.etClosedPolygon?this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[n-1],this.m_srcPoly[0])):this.m_normals.push(new f.DoublePoint(this.m_normals[n-2])),e.m_endtype==f.EndType.etClosedPolygon){for(var h=n-1,l=0;l<n;l++)h=this.OffsetPoint(l,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==f.EndType.etClosedLine){for(var h=n-1,l=0;l<n;l++)h=this.OffsetPoint(l,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var g=this.m_normals[n-1],l=n-1;l>0;l--)this.m_normals[l]=new f.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new f.DoublePoint(-g.X,-g.Y),h=0;for(var l=n-1;l>=0;l--)h=this.OffsetPoint(l,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var h=0,l=1;l<n-1;++l)h=this.OffsetPoint(l,h,e.m_jointype);var y;if(e.m_endtype==f.EndType.etOpenButt){var l=n-1;y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*r),f.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*r)),this.m_destPoly.push(y),y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*r),f.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*r)),this.m_destPoly.push(y)}else{var l=n-1;h=n-2,this.m_sinA=0,this.m_normals[l]=new f.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),e.m_endtype==f.EndType.etOpenSquare?this.DoSquare(l,h):this.DoRound(l,h)}for(var l=n-1;l>0;l--)this.m_normals[l]=new f.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new f.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),h=n-1;for(var l=h-1;l>0;--l)h=this.OffsetPoint(l,h,e.m_jointype);e.m_endtype==f.EndType.etOpenButt?(y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(y),y=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(y)):(h=1,this.m_sinA=0,e.m_endtype==f.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};f.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof f.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var o=new f.Clipper(0);if(o.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)o.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var n=f.Clipper.GetBounds(this.m_destPolys),s=new f.Path;if(s.push(new f.IntPoint(n.left-10,n.bottom+10)),s.push(new f.IntPoint(n.right+10,n.bottom+10)),s.push(new f.IntPoint(n.right+10,n.top-10)),s.push(new f.IntPoint(n.left-10,n.top-10)),o.AddPath(s,f.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var c=e.Childs()[0];e.Childs()[0]=c.Childs()[0];for(var l=1;l<c.ChildCount();l++)e.AddChild(c.Childs()[l])}else e.Clear()}}else{var e=r[0],i=r[1];f.Clear(e),this.FixOrientations(),this.DoOffset(i);var o=new f.Clipper(0);if(o.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)o.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var n=f.Clipper.GetBounds(this.m_destPolys),s=new f.Path;s.push(new f.IntPoint(n.left-10,n.bottom+10)),s.push(new f.IntPoint(n.right+10,n.bottom+10)),s.push(new f.IntPoint(n.right+10,n.top-10)),s.push(new f.IntPoint(n.left-10,n.top-10)),o.AddPath(s,f.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(f.ClipType.ctUnion,e,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};f.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].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 f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new f.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case f.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);i>=this.m_miterLim?this.DoMiter(r,t,i):this.DoSquare(r,t);break}case f.JoinType.jtSquare:this.DoSquare(r,t);break;case f.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};f.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};f.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),f.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};f.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),i=f.Cast_Int32(f.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),o=this.m_normals[t].X,n=this.m_normals[t].Y,s,c=0;c<i;++c)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+o*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+n*this.m_delta))),s=o,o=o*this.m_cos-this.m_sin*n,n=s*this.m_sin+n*this.m_cos;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};f.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};f.JS={};f.JS.AreaOfPolygon=function(r,t){return t||(t=1),f.Clipper.Area(r)/(t*t)};f.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=f.Clipper.Area(r[i]);return e/(t*t)};f.JS.BoundsOfPath=function(r,t){return f.JS.BoundsOfPaths([r],t)};f.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=f.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};f.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=f.JS.Clone(i);if(typeof t!="number"||t===null)return f.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||t<0)return i;e||(i=[i]);for(var o=i.length,n,s,c,l,u,h,g,y=[],v=0;v<o;v++)if(s=i[v],n=s.length,n!==0){if(n<3){c=s,y.push(c);continue}for(c=s,l=t*t,u=s[0],h=1,g=1;g<n;g++)(s[g].X-u.X)*(s[g].X-u.X)+(s[g].Y-u.Y)*(s[g].Y-u.Y)<=l||(c[h]=s[g],u=s[g],h++);u=s[h-1],(s[0].X-u.X)*(s[0].X-u.X)+(s[0].Y-u.Y)*(s[0].Y-u.Y)<=l&&h--,h<n&&c.splice(h,n-h),c.length&&y.push(c)}return!e&&y.length?y=y[0]:!e&&y.length===0?y=[]:e&&y.length===0&&(y=[[]]),y};f.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,o,n,s,c=new Array(e);for(o=0;o<e;o++){for(i=r[o].length,s=new Array(i),n=0;n<i;n++)s[n]={X:r[o][n].X,Y:r[o][n].Y};c[o]=s}return t||(c=c[0]),c};f.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return f.Error("Tolerance is not a number in Lighten()."),f.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return f.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,o,n,s,c,l,u,h,g,y,v,b,S,C,x,T,D=r.length,w=t*t,E=[];for(e=0;e<D;e++)if(o=r[e],c=o.length,c!=0){for(n=0;n<1e6;n++){for(s=[],c=o.length,o[c-1].X!=o[0].X||o[c-1].Y!=o[0].Y?(v=1,o.push({X:o[0].X,Y:o[0].Y}),c=o.length):v=0,y=[],i=0;i<c-2;i++)l=o[i],h=o[i+1],u=o[i+2],x=l.X,T=l.Y,b=u.X-x,S=u.Y-T,(b!==0||S!==0)&&(C=((h.X-x)*b+(h.Y-T)*S)/(b*b+S*S),C>1?(x=u.X,T=u.Y):C>0&&(x+=b*C,T+=S*C)),b=h.X-x,S=h.Y-T,g=b*b+S*S,g<=w&&(y[i+1]=1,i++);for(s.push({X:o[0].X,Y:o[0].Y}),i=1;i<c-1;i++)y[i]||s.push({X:o[i].X,Y:o[i].Y});if(s.push({X:o[c-1].X,Y:o[c-1].Y}),v&&o.pop(),y.length)o=s;else break}c=s.length,s[c-1].X==s[0].X&&s[c-1].Y==s[0].Y&&s.pop(),s.length>2&&E.push(s)}return!r[0]instanceof Array&&(E=E[0]),typeof E>"u"&&(E=[[]]),E};f.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,o=0,n,s,c=0,l=0,u=0,h=0,g=r.length;if(g<2)return 0;for(t&&(r[g]=r[0],g++);--g;)n=r[g],c=n.X,l=n.Y,s=r[g-1],u=s.X,h=s.Y,o+=i((c-u)*(c-u)+(l-h)*(l-h));return t&&r.pop(),o/e};f.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,o=0;o<r.length;o++)i+=f.JS.PerimeterOfPath(r[o],t,e);return i};f.JS.ScaleDownPath=function(r,t){var e,i;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=i.X/t,i.Y=i.Y/t};f.JS.ScaleDownPaths=function(r,t){var e,i,o,n=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)o=r[e][i],o.X=o.X/t,o.Y=o.Y/t};f.JS.ScaleUpPath=function(r,t){var e,i,o=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=o(i.X*t),i.Y=o(i.Y*t)};f.JS.ScaleUpPaths=function(r,t){var e,i,o,n=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)o=r[e][i],o.X=n(o.X*t),o.Y=n(o.Y*t)};f.ExPolygons=function(){return[]};f.ExPolygon=function(){this.outer=null,this.holes=null};f.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new f.ExPolygon;e.outer=r.Contour();var i=r.Childs(),o=i.length;e.holes=new Array(o);var n,s,c,l,u,h;for(c=0;c<o;c++)for(n=i[c],e.holes[c]=n.Contour(),l=0,u=n.Childs(),h=u.length;l<h;l++)s=u[l],f.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(e)};f.JS.ExPolygonsToPaths=function(r){var t,e,i,o,n=new f.Paths;for(t=0,i=r.length;t<i;t++)for(n.push(r[t].outer),e=0,o=r[t].holes.length;e<o;e++)n.push(r[t].holes[e]);return n};f.JS.PolyTreeToExPolygons=function(r){var t=new f.ExPolygons,e,i,o,n;for(i=0,o=r.Childs(),n=o.length;i<n;i++)e=o[i],f.JS.AddOuterPolyNodeToExPolygons(e,t);return t};Dc.exports=f});var l7=U((HQ,Uh)=>{m();(function(){"use strict";function r(s,c){var l=s.x-c.x,u=s.y-c.y;return l*l+u*u}p(r,"getSqDist");function t(s,c,l){var u=c.x,h=c.y,g=l.x-u,y=l.y-h;if(g!==0||y!==0){var v=((s.x-u)*g+(s.y-h)*y)/(g*g+y*y);v>1?(u=l.x,h=l.y):v>0&&(u+=g*v,h+=y*v)}return g=s.x-u,y=s.y-h,g*g+y*y}p(t,"getSqSegDist");function e(s,c){for(var l=s[0],u=[l],h,g=1,y=s.length;g<y;g++)h=s[g],r(h,l)>c&&(u.push(h),l=h);return l!==h&&u.push(h),u}p(e,"simplifyRadialDist");function i(s,c,l,u,h){for(var g=u,y,v=c+1;v<l;v++){var b=t(s[v],s[c],s[l]);b>g&&(y=v,g=b)}g>u&&(y-c>1&&i(s,c,y,u,h),h.push(s[y]),l-y>1&&i(s,y,l,u,h))}p(i,"simplifyDPStep");function o(s,c){var l=s.length-1,u=[s[0]];return i(s,0,l,c,u),u.push(s[l]),u}p(o,"simplifyDouglasPeucker");function n(s,c,l){if(s.length<=2)return s;var u=c!==void 0?c*c:1;return s=l?s:e(s,u),s=o(s,u),s}p(n,"simplify"),typeof define=="function"&&define.amd?define(function(){return n}):typeof Uh<"u"?(Uh.exports=n,Uh.exports.default=n):typeof self<"u"?self.simplify=n:window.simplify=n})()});m();m();var Ba=class Ba{constructor(t,e,i){d(this,"__type",Ba.__type);d(this,"id",Ce());d(this,"latitude");d(this,"longitude");d(this,"floorId");d(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(e==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=e,this.floorId=i,this.verticalOffset=0}}static is(t){return t.__type===Ba.__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(){}};p(Ba,"Coordinate"),d(Ba,"__type","coordinate");var Mf=Ba,Q=Mf;m();var Tf=class Tf{constructor(t){d(this,"id");this.id=t}};p(Tf,"BaseMetaData");var Xe=Tf;var Hr,St,mn,uo,_a=class _a extends Xe{constructor(e,i){super(i.mvfData.properties.id);d(this,"__type",_a.__type);I(this,Hr);I(this,St,{});I(this,mn);I(this,uo);M(this,Hr,e),M(this,mn,i.floorId),M(this,uo,i.mvfData)}static is(e){return e.__type===_a.__type}get locations(){return a(this,St).locations?a(this,St).locations:(a(this,St).locations=(a(this,Hr).locationIdsByNodeId[this.id]||[]).map(e=>a(this,Hr).getById("enterprise-location",e)).filter(Boolean),a(this,St).locations)}get space(){var e;return a(this,Hr).getById("space",(e=a(this,Hr).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=a(this,Hr).getById("floor",a(this,mn));if(e==null)throw new Error("Floor ".concat(a(this,mn)," not found!"));return e}get coordinate(){if(a(this,St).coordinate==null){let[e,i]=a(this,uo).geometry.coordinates;a(this,St).coordinate=new Q(i,e,a(this,mn))}return a(this,St).coordinate}get externalId(){var e;return(e=a(this,uo).properties.externalId)!=null?e:""}get neighbors(){if(a(this,St).neighbours==null){let e=a(this,uo).properties.neighbors.map(i=>{let o=a(this,Hr).getById("node",i.id);if(o==null)throw new Error("Node ".concat(i.id," not found!"));return o});a(this,St).neighbours=e}return a(this,St).neighbours}get geoJSON(){return{...a(this,uo),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(e=>e.id)}}destroy(){for(let e of Object.keys(a(this,St)))delete a(this,St)[e]}};Hr=new WeakMap,St=new WeakMap,mn=new WeakMap,uo=new WeakMap,p(_a,"Node"),d(_a,"__type","node");var wf=_a,vi=wf;m();m();var gn,Df=class Df{constructor(t,e){d(this,"id");I(this,gn);this.id=t}get geoJSONBoundingBox(){return a(this,gn)?a(this,gn):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(M(this,gn,Ea(this.geoJSON)),a(this,gn))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};gn=new WeakMap,p(Df,"BaseMapData");var mr=Df;var ho,Kt,gr,Na,Ol,Of,Ra=class Ra extends mr{constructor(e,i){super(i.mvfData.id,e);I(this,Ol);d(this,"__type",Ra.__type);I(this,ho);I(this,Kt,{});I(this,gr);I(this,Na);M(this,ho,e),M(this,gr,i.mvfData),M(this,Na,i.facadeId)}static is(e){return e.__type===Ra.__type}get type(){return a(this,gr).type}get name(){var e;return(e=R(this,Ol,Of).call(this,"name"))!=null?e:""}get shortName(){var e;return(e=R(this,Ol,Of).call(this,"shortName"))!=null?e:""}get externalId(){var e;return(e=a(this,gr).externalId)!=null?e:""}get floors(){var e,i;if(a(this,Kt).floors==null){let o=((i=(e=a(this,gr).floors)!=null?e:a(this,gr).maps)!=null?i:[]).reduce((n,s)=>{let c=a(this,ho).floorsById[s];return c&&n.push(c),n},[]);o.length===0&&A.error("Floor stack ".concat(this.id," has no floors")),a(this,Kt).floors=o}return a(this,Kt).floors}get defaultFloor(){if(a(this,Kt).defaultFloor!=null)return a(this,Kt).defaultFloor;let e=a(this,gr).defaultFloor?a(this,ho).getById("floor",a(this,gr).defaultFloor):void 0;return a(this,Kt).defaultFloor=e||this.floors.reduce((i,o)=>Math.abs(o.elevation)<Math.abs(i.elevation)?o:i),a(this,Kt).defaultFloor}get facade(){return a(this,Na)?a(this,ho).facadesById[a(this,Na)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,Kt)))delete a(this,Kt)[e]}};ho=new WeakMap,Kt=new WeakMap,gr=new WeakMap,Na=new WeakMap,Ol=new WeakSet,Of=p(function(e){return a(this,ho).getPropTranslation(this.__type,e,this.id,a(this,gr)[e])},"#translate"),p(Ra,"FloorStack"),d(Ra,"__type","floor-stack");var Ef=Ra,Ll=Ef;m();m();m();m();m();m();var Fl,Ci,Al=class Al extends Xe{constructor(e){super(String(Ce()));I(this,Fl,{});I(this,Ci);M(this,Ci,e.mvfData)}static is(e){return e.__type===Al.__type}get url(){return a(this,Ci).url}get name(){if("displayName"in a(this,Ci))return a(this,Ci).displayName;if("label"in a(this,Ci))return a(this,Ci).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Fl)))delete a(this,Fl)[e]}};Fl=new WeakMap,Ci=new WeakMap,p(Al,"Hyperlink"),d(Al,"__type","hyperlink");var Lf=Al,fo=Lf;m();var Bl,yn,kl=class kl extends Xe{constructor(e){super(String(Ce()));I(this,Bl,{});I(this,yn);M(this,yn,e.mvfData)}static is(e){return e.__type===kl.__type}get url(){return a(this,yn).url}get name(){return a(this,yn).altText}get altText(){return a(this,yn).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Bl)))delete a(this,Bl)[e]}};Bl=new WeakMap,yn=new WeakMap,p(kl,"Image"),d(kl,"__type","image");var Af=kl,bn=Af;var vn,yr,Si,Ff=class Ff extends mr{constructor(e,i){super(i.properties.id,e);I(this,vn);I(this,yr);I(this,Si,{});M(this,vn,e),M(this,yr,i)}get externalId(){var e;return(e=a(this,yr).properties.externalId)!=null?e:""}get name(){var i,o,n,s,c;let e="";return"details"in a(this,yr).properties||(e=(i=a(this,yr).properties.externalId)!=null?i:""),e===""&&(e=(n=(o=a(this,yr).properties.details)==null?void 0:o.name)!=null?n:""),e===""&&(e=(c=(s=this.locationProfiles.find(l=>l.name&&l.name.length>0))==null?void 0:s.name)!=null?c:""),e}get description(){var i,o,n,s;let e=(o=(i=a(this,yr).properties.details)==null?void 0:i.description)!=null?o:"";return e===""&&(e=(s=(n=this.locationProfiles.find(c=>c.description&&c.description.length>0))==null?void 0:n.description)!=null?s:""),e}get images(){var i,o,n,s,c;if(a(this,Si).images!=null)return a(this,Si).images;let e=(n=(o=(i=a(this,yr).properties.details)==null?void 0:i.images)==null?void 0:o.map(l=>new bn({mvfData:{...l,url:a(this,vn).sasToken?l.url+"?".concat(a(this,vn).sasToken):l.url}})))!=null?n:[];return(e==null||e.length===0)&&(e=(c=(s=this.locationProfiles.find(l=>l.images.length>0))==null?void 0:s.images)!=null?c:[]),a(this,Si).images=e,e}get links(){var i,o,n,s,c;if(a(this,Si).links!=null)return a(this,Si).links;let e=(n=(o=(i=a(this,yr).properties.details)==null?void 0:i.links)==null?void 0:o.map(l=>new fo({mvfData:l})))!=null?n:[];return(e==null||e.length===0)&&(e=(c=(s=this.locationProfiles.find(l=>l.links.length>0))==null?void 0:s.links)!=null?c:[]),a(this,Si).links=e,e}get locationProfiles(){var e;return(e=a(this,vn).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}};vn=new WeakMap,yr=new WeakMap,Si=new WeakMap,p(Ff,"DetailedMapData");var nt=Ff;var _l,Cn,Va,ja,Ga=class Ga extends nt{constructor(e,i){super(e,i.mvfData);d(this,"__type",Ga.__type);I(this,_l);I(this,Cn);I(this,Va,{});I(this,ja);M(this,_l,e),M(this,Cn,i.floorId),M(this,ja,i.mvfData)}static is(e){return e.__type===Ga.__type}get center(){var e;if(a(this,Va).center==null){let[i,o]=(e=a(this,ja).properties.center)!=null?e:[0,0];a(this,Va).center=new Q(o,i,a(this,Cn))}return a(this,Va).center}get floor(){let e=a(this,_l).getById("floor",a(this,Cn));if(e==null)throw new Error("Floor ".concat(a(this,Cn)," not found!"));return e}get geoJSON(){return{...a(this,ja),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};_l=new WeakMap,Cn=new WeakMap,Va=new WeakMap,ja=new WeakMap,p(Ga,"Area"),d(Ga,"__type","area");var kf=Ga,xi=kf;m();var Sn,Ii,xn,Ha,Ua=class Ua extends nt{constructor(e,i){super(e,i.mvfData);d(this,"__type",Ua.__type);I(this,Sn);I(this,Ii);I(this,xn);I(this,Ha);M(this,Ii,{}),M(this,Ha,i.mvfData),M(this,Sn,e),M(this,xn,i.floorId)}static is(e){return e.__type===Ua.__type}get floor(){let e=a(this,Sn).getById("floor",a(this,xn));if(e==null)throw new Error("Floor ".concat(a(this,xn)," not found!"));return e}get center(){if(a(this,Ii).center==null){let[[e,i],[o,n]]=a(this,Ha).geometry.coordinates,s=(e+o)/2,c=(i+n)/2;a(this,Ii).center=new Q(c,s,a(this,xn))}return a(this,Ii).center}get isExterior(){var o;let e=a(this,Sn).obstructionIdByEntranceId[this.id],i=a(this,Sn).getMVFFeatureById("obstruction",e);return(o=i==null?void 0:i.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...a(this,Ha),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 e of Object.keys(a(this,Ii)))delete a(this,Ii)[e]}};Sn=new WeakMap,Ii=new WeakMap,xn=new WeakMap,Ha=new WeakMap,p(Ua,"Door"),d(Ua,"__type","door");var Bf=Ua,br=Bf;m();var mo,In,Xt,Wr,Wa=class Wa extends nt{constructor(e,i){super(e,i.mvfData);d(this,"__type",Wa.__type);I(this,mo);I(this,In);I(this,Xt,{});I(this,Wr);M(this,mo,e),M(this,In,i.floorId),M(this,Wr,i.mvfData)}getMvfData(){return a(this,Wr)}static is(e){return e.__type===Wa.__type}get type(){return K7(a(this,Wr).properties.kind)}get locations(){if(a(this,Xt).locations)return a(this,Xt).locations;a(this,Xt).locations=[];let e=a(this,mo).mvfLocationsBySpaceId[a(this,Wr).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let o=a(this,mo).getById("enterprise-location",i.id);o&&a(this,Xt).locations.push(o)}return a(this,Xt).locations}get floor(){let e=a(this,mo).getById("floor",a(this,In));if(e==null)throw new Error("Floor ".concat(a(this,In)," not found!"));return e}get doors(){return a(this,Wr).properties.destinationNodes.reduce((e,i)=>{let o=a(this,mo).doorsByNodeId[i];return o&&e.push(o),e},[])}get center(){var e;if(a(this,Xt).center==null){let[i,o]=(e=a(this,Wr).properties.center)!=null?e:[0,0];a(this,Xt).center=new Q(o,i,a(this,In))}return a(this,Xt).center}get geoJSON(){return{...a(this,Wr),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 e of Object.keys(a(this,Xt)))delete a(this,Xt)[e]}};mo=new WeakMap,In=new WeakMap,Xt=new WeakMap,Wr=new WeakMap,p(Wa,"Space"),d(Wa,"__type","space");var _f=Wa,Q7=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function K7(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return Q7.includes(t)?t:"room"}p(K7,"validateSpaceType");var Ge=_f;m();var er,Te,tr,Rl,Nf,Xa=class Xa extends mr{constructor(e,i){super(i.mvfData.properties.id,e);I(this,Rl);d(this,"__type",Xa.__type);I(this,er);I(this,Te,{});I(this,tr);M(this,er,e),M(this,tr,i.mvfData)}static is(e){return e.__type===Xa.__type}get focusTarget(){return this}get name(){var e,i;return"name"in a(this,tr).properties?(i=R(this,Rl,Nf).call(this,"name"))!=null?i:"":(e=a(this,tr).properties.externalId)!=null?e:""}get shortName(){var e,i;return"shortName"in a(this,tr).properties?(i=R(this,Rl,Nf).call(this,"shortName"))!=null?i:"":(e=a(this,tr).properties.externalId)!=null?e:""}get externalId(){var e;return(e=a(this,tr).properties.externalId)!=null?e:""}get elevation(){return a(this,tr).properties.elevation}get spaces(){if(a(this,Te).spaces==null){let e=a(this,er).spaces.filter(i=>i.floor.id===this.id);a(this,Te).spaces=e}return a(this,Te).spaces}get geoJSON(){var e;return{type:"Feature",properties:null,geometry:(e=a(this,tr).geometry)!=null?e:{type:"Polygon",coordinates:[]}}}get objects(){if(a(this,Te).objects==null){let e=a(this,er).objects.filter(i=>i.floor.id===this.id);a(this,Te).objects=e}return a(this,Te).objects}get connections(){if(a(this,Te).connections==null){let e=a(this,er).connections.filter(i=>i.floors.includes(this));a(this,Te).connections=e}return a(this,Te).connections}get doors(){if(a(this,Te).doors==null){let e=a(this,er).doors.filter(i=>i.floor.id===this.id);a(this,Te).doors=e}return a(this,Te).doors}get annotations(){if(a(this,Te).annotations==null){let e=a(this,er).annotations.filter(i=>i.floor.id===this.id);a(this,Te).annotations=e}return a(this,Te).annotations}get pois(){if(a(this,Te).pois==null){let e=a(this,er).pointsOfInterest.filter(i=>i.floor.id===this.id);a(this,Te).pois=e}return a(this,Te).pois}get floorStack(){if(a(this,Te).floorStack==null){let e=a(this,er).floorStacks.find(i=>i.floors.includes(this));a(this,Te).floorStack=e}return a(this,Te).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,Te)))delete a(this,Te)[e]}};er=new WeakMap,Te=new WeakMap,tr=new WeakMap,Rl=new WeakSet,Nf=p(function(e){let i=a(this,tr).properties[e];return a(this,er).getPropTranslation(this.__type,e,this.id,i)},"#translate"),p(Xa,"Floor"),d(Xa,"__type","floor");var Rf=Xa,Bt=Rf;m();m();m();var Nl=p(r=>r!=null,"notNull");m();function Gl(r){return typeof r=="string"?r:r.id}p(Gl,"getId");function Vf(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}p(Vf,"isPosition");var Gf=8,Xr=p(r=>typeof r=="number"?r.toFixed(Gf):Vf(r)?r[1].toFixed(Gf)+"-"+r[0].toFixed(Gf):r.map(t=>Xr(t)).join("-"),"serializeCoords");m();function Vl(r){let t;if(Ge.is(r)||br.is(r)||_t.is(r)||xi.is(r)||rr.is(r))t=r.center;else if(Pi.is(r)||Mi.is(r))t=r.coordinate;else if(Q.is(r))t=r;else if(vi.is(r))t=r.coordinate;else if(Yr.is(r))t=r.coordinates[0];else return;return t}p(Vl,"getCoordinateFromStuffs");m();m();var Pn={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}},Zr="ExteriorWalls",go="Walls",Cv=0,Ya="InteriorDoors",Za="ExteriorDoors",we="GeometryLayer",Ti="LabelsLayer",zr="MarkersLayer",za="FootprintLayer",qa="OcclusionLayer",Sv="ImagesLayer";var xv=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],Iv={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function jf(r){var t,e;(t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)&&A.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}p(jf,"validateOptions");function Uf(r,t){var o,n,s,c,l,u;let e=((o=r==null?void 0:r.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,i={...Pn,...r,outdoorView:{enabled:((n=r==null?void 0:r.outdoorView)==null?void 0:n.enabled)===void 0?!!e:(s=r==null?void 0:r.outdoorView)==null?void 0:s.enabled,layersHiddenByGeometry:(c=Pn.outdoorView)==null?void 0:c.layersHiddenByGeometry,...r==null?void 0:r.outdoorView},bearing:(u=(l=r==null?void 0:r.bearing)!=null?l:t.naturalBearing)!=null?u:0,imagePlacementOptions:{...Pn.imagePlacementOptions,...r==null?void 0:r.imagePlacementOptions},multiFloorView:{...Pn.multiFloorView,...r==null?void 0:r.multiFloorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}p(Uf,"handleShow3DMapOptionDefault");function Pv(r){let t={remove_watermark:!1};if(r)try{let e=Iu(r);Object.assign(t,e.capabilities)}catch(e){A.error("Error decoding capabilities from token",e)}return t}p(Pv,"handleTokenCapabilities");var yo,or,wi,$a=class $a extends nt{constructor(e,i){let o=Object.values(i.mvfDataByFloorId)[0];super(e,o);d(this,"__type",$a.__type);I(this,yo);I(this,or);I(this,wi);M(this,or,{}),M(this,yo,e),M(this,wi,i.mvfDataByFloorId)}static is(e){return e.__type===$a.__type}get accessible(){var e;return(e=Object.values(a(this,wi))[0].properties.accessible)!=null?e:!1}get type(){var e,i;return(i=(e=Object.values(a(this,wi))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get extra(){return Object.values(a(this,wi))[0].properties.extra}get coordinates(){return a(this,or).coordinates==null&&(a(this,or).coordinates=Object.entries(a(this,wi)).map(([e,i])=>new Q(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),a(this,or).coordinates}get nodes(){return Object.values(a(this,wi))[0].properties.nodes.map(e=>a(this,yo).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?a(this,yo).getById("floor",e.floorId):void 0).filter(Nl)}get locationProfiles(){var i,o,n,s,c;if(a(this,or).locationProfiles!=null)return a(this,or).locationProfiles;let e=super.locationProfiles;if(e==null||e.length===0){let l=[(o=(i=this.coordinates[0])==null?void 0:i.longitude)!=null?o:0,(s=(n=this.coordinates[0])==null?void 0:n.latitude)!=null?s:0],u=Xr(l),h=(c=a(this,yo).mvfConnectionIdsByLatLon[u])!=null?c:[];for(let g of h){let y=a(this,yo).locationProfilesByAttachedFeatureId[g];if(y!=null){e=y;break}}}return a(this,or).locationProfiles=e!=null?e:[],e}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id),extra:this.extra}}destroy(){for(let e of Object.keys(a(this,or)))delete a(this,or)[e]}};yo=new WeakMap,or=new WeakMap,wi=new WeakMap,p($a,"Connection"),d($a,"__type","connection");var Hf=$a,bo=Hf;m();var jl,Mn,vo,Tn,Ja=class Ja extends nt{constructor(e,i){super(e,i.mvfData);d(this,"__type",Ja.__type);I(this,jl);I(this,Mn);I(this,vo,{});I(this,Tn);M(this,jl,e),M(this,Mn,i.floorId),M(this,Tn,i.mvfData)}static is(e){return e.__type===Ja.__type}get type(){let e=a(this,Tn).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=a(this,jl).getById("floor",a(this,Mn));if(e==null)throw new Error("Floor ".concat(a(this,Mn)," not found!"));return e}get center(){var e;if(a(this,vo).center==null){let[i,o]=(e=a(this,Tn).properties.center)!=null?e:[0,0];a(this,vo).center=new Q(o,i,a(this,Mn))}return a(this,vo).center}get geoJSON(){return{...a(this,Tn),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 e of globalThis.Object.keys(a(this,vo)))a(this,vo)[e]=null}};jl=new WeakMap,Mn=new WeakMap,vo=new WeakMap,Tn=new WeakMap,p(Ja,"MapObject"),d(Ja,"__type","object");var Wf=Ja,_t=Wf;m();var Ul,wn,Co,Ka,Qa=class Qa extends nt{constructor(e,i){super(e,i.mvfData);d(this,"__type",Qa.__type);I(this,Ul);I(this,wn);I(this,Co,{});I(this,Ka);M(this,Ul,e),M(this,Ka,i.mvfData),M(this,wn,i.floorId)}static is(e){return e.__type===Qa.__type}get floor(){let e=a(this,Ul).getById("floor",a(this,wn));if(e==null)throw new Error("Floor ".concat(a(this,wn)," not found!"));return e}get coordinate(){var e;if(a(this,Co).coordinate==null){let[i,o]=(e=a(this,Ka).geometry.coordinates)!=null?e:[0,0];a(this,Co).coordinate=new Q(o,i,a(this,wn))}return a(this,Co).coordinate}get geoJSON(){return{...a(this,Ka),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 e in a(this,Co))a(this,Co)[e]=null}};Ul=new WeakMap,wn=new WeakMap,Co=new WeakMap,Ka=new WeakMap,p(Qa,"PointOfInterest"),d(Qa,"__type","point-of-interest");var Xf=Qa,Pi=Xf;m();var Hl,Dn,So,En,Wl,Zf,es=class es extends nt{constructor(e,i){super(e,i.mvfData);I(this,Wl);d(this,"__type",es.__type);I(this,Hl);I(this,Dn);I(this,So,{});I(this,En);M(this,Hl,e),M(this,Dn,i.floorId),M(this,En,i.mvfData)}static is(e){return e.__type===es.__type}get group(){return R(this,Wl,Zf).call(this).group}get type(){return R(this,Wl,Zf).call(this).type}get coordinate(){if(a(this,So).coordinate==null){let[e,i]=a(this,En).geometry.coordinates;a(this,So).coordinate=new Q(i,e,a(this,Dn))}return a(this,So).coordinate}get floor(){let e=a(this,Hl).getById("floor",a(this,Dn));if(e==null)throw new Error("Floor ".concat(a(this,Dn)," not found!"));return e}get geoJSON(){return{...a(this,En),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 e of Object.keys(a(this,So)))delete a(this,So)[e]}};Hl=new WeakMap,Dn=new WeakMap,So=new WeakMap,En=new WeakMap,Wl=new WeakSet,Zf=p(function(){let[e,i]=a(this,En).properties.symbolId.split("--");return{group:e,type:i}},"#getGroupAndTypeFromSymbolId"),p(es,"Annotation"),d(es,"__type","annotation");var Yf=es,Mi=Yf;m();var e6=p((r,t)=>{var l,u,h,g,y,v,b,S,C,x,T;let e={},i={},o={},n={},s={},c={};for(let D of r["location.json"]||[]){let w=new On(t,{mvfData:D});if(e[D.id]=w,D.externalId&&(n[D.externalId]==null&&(n[D.externalId]=[]),n[D.externalId].push(w)),D.categories)for(let k of D.categories)s[k]==null&&(s[k]=[]),s[k].push(w);let E=[...(u=(l=D.obstructions)==null?void 0:l.map(k=>k.id))!=null?u:[],...(g=(h=D.spaces)==null?void 0:h.map(k=>k.id))!=null?g:[],...(v=(y=D.annotations)==null?void 0:y.map(k=>k.id))!=null?v:[],...(b=D.connections)!=null?b:[],...(C=(S=D.entrances)==null?void 0:S.map(k=>k.id))!=null?C:[],...(T=(x=D.areas)==null?void 0:x.map(k=>k.id))!=null?T:[]];for(let k of E)k&&(c[k]==null&&(c[k]=[]),c[k].push(w))}for(let D of r["category.json"]||[]){let w=new Yl(t,{mvfData:D});i[D.id]=w,D.parent&&(o[D.parent]==null&&(o[D.parent]=[]),o[D.parent].push(w))}return{locationCategoriesByParentId:o,locationProfilesById:e,locationCategoriesById:i,locationProfilesByExternalId:n,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:c}},"processMVFLocationProfilesAndCategories"),t6=p((r,t,e)=>{var C,x;let i={},o={},n={},s={},c={},l={},u={},h={},g={},y={},v={},b={},S=globalThis.Object.keys(r.space);for(let T of S){let D=r.space[T];if(D!=null)for(let w of D.features){b[w.properties.id]=T,u[w.properties.id]=w;for(let E of w.properties.destinationNodes)c[E]==null&&(c[E]=[]),c[E].push(w.properties.id);if(w.properties.kind==="desk-entrance"&&(l[w.properties.externalId]==null&&(l[w.properties.externalId]=[]),l[w.properties.externalId].push(...w.properties.destinationNodes)),!["void","desk-entrance"].includes((C=w.properties.kind)!=null?C:"")){if((x=w.properties.kind)!=null&&x.includes("connection")){let E=Xr(w.geometry.coordinates);y[E]==null&&(y[E]=[]),y[E].push(w.properties.id);continue}if(w.properties.kind==="poi"){let E=new Pi(e,{floorId:T,mvfData:w});n[w.properties.id]=E,g[T]||(g[T]=[]),g[T].push(w),w.properties.externalId&&(s[w.properties.externalId]==null&&(s[w.properties.externalId]=[]),s[w.properties.externalId].push(E))}else{let E=new Ge(e,{floorId:T,mvfData:w});i[w.properties.id]=E,w.properties.externalId&&(o[w.properties.externalId]==null&&(o[w.properties.externalId]=[]),o[w.properties.externalId].push(E)),h[T]||(h[T]=[]),h[T].push(w)}}}}for(let T in y){let D=y[T],w={};for(let k of D){let L=b[k],_=u[k],B=t==null?void 0:t["n_"+_.properties.id.split("s_")[1]];w[L]={..._,properties:{..._.properties,accessible:(B==null?void 0:B.accessible)===!0}}}let E=new bo(e,{mvfDataByFloorId:w});v[E.id]=E}return{spacesById:i,spacesByExternalId:o,poisById:n,poisByExternalId:s,connectionsById:v,spaceIdsByDestinationNodeId:c,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:u,connectionIdsByLatLon:y,mvfSpacesByFloorId:h,mvfPoisByFloorId:g}},"processMVFSpaces"),r6=p((r,t)=>{var s,c;let e={},i={},o={},n={};for(let l of r["node.geojson"].features){o[l.properties.id]=l;let u=new vi(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});e[l.properties.id]=u,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(u));let h=(c=l.properties.floor)!=null?c:l.properties.map;n[h]||(n[h]=[]),n[h].push(l)}return{nodesById:e,nodesByExternalId:i,mvfNodesById:o,mvfNodesByFloorId:n}},"processMVFNodes"),i6=p((r,t)=>{let e={},i={},o={},n={},s=globalThis.Object.keys(r.obstruction);for(let c of s){let l=r.obstruction[c];if(l!=null)for(let u of l.features){o[u.properties.id]=u;for(let g of u.properties.entrances)n[g]=u.properties.id;if(u.properties.kind==="Wall")continue;let h=new _t(t,{floorId:c,mvfData:u});e[u.properties.id]=h,u.properties.externalId&&(i[u.properties.externalId]==null&&(i[u.properties.externalId]=[]),i[u.properties.externalId].push(h))}}return{objectsById:e,objectsByExternalId:i,mvfObstructionById:o,obstructionIdByEntranceId:n}},"processMVFObstructions"),o6=p((r,t)=>{let e={},i={},o={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){o[n.properties.id]=n.properties;let s=new Bt(t,{mvfData:n});e[n.properties.id]=s,n.properties.externalId&&(i[n.properties.externalId]==null&&(i[n.properties.externalId]=[]),i[n.properties.externalId].push(s))}else for(let n of r["map.geojson"]){o[n.id]=n;let s=new Bt(t,{mvfData:{properties:n}});e[n.id]=s}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:o}},"processMVFFloors"),n6=p((r,t)=>{var l;let e={},i={},o={},n={},s={},c=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(c!=null)for(let u of c){let h=(l=r.facade)==null?void 0:l[u.id],g=new Ll(t,{mvfData:u,facadeId:h==null?void 0:h.id});if(e[u.id]=g,u.externalId&&(i[u.externalId]==null&&(i[u.externalId]=[]),i[u.externalId].push(g)),o[u.id]=u,h){let y=new rr(t,{mvfData:h,floorStackId:u.id});n[h.id]=y;for(let v of h.spaces)s[v.spaceId]=y}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:o,facadesById:n,facadesBySpaceId:s}},"processMVFFloorStacks"),a6=p((r,t)=>{let e={},i={},o=r["connection.json"].reduce((n,s)=>{s.nodes.forEach(l=>n[l]=s),e[s.id]=s;let c=t==null?void 0:t[s.nodes[0]];if(c!=null){let l=Xr(c.geometry.coordinates);i[l]==null&&(i[l]=[]),i[l].push(s.id)}return n},{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:i}},"processMVFConnections"),s6=p((r,t)=>{let e={},i={},o={},n={},s={},c=globalThis.Object.keys(r.entrance);for(let l of c){let u=r.entrance[l];if(u!=null)for(let h of u.features){n[h.properties.id]=h;let g=new br(t,{floorId:l,mvfData:h});h.properties.node&&(o[h.properties.node]=g),e[h.properties.id]=g,h.properties.externalId&&(i[h.properties.externalId]==null&&(i[h.properties.externalId]=[]),i[h.properties.externalId].push(g)),s[l]||(s[l]=[]),s[l].push(h)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:o,mvfEntrancesById:n,mvfEntrancesByFloorId:s}},"processMVFEntrances"),l6=p((r,t,e)=>{var i;if(r.textAreas!=null)for(let o in r.textAreas){let n=(i=r.textAreas[o])==null?void 0:i.features;if(n!=null){for(let s of n)if("anchorId"in s.properties){let c=s==null?void 0:s.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let u=l.properties;u.textArea=c,u.textArea&&(u.textArea.position=s.geometry.coordinates)}}}}},"processMVFTextAreas"),c6=p((r,t,e)=>{var i;if(r.floorImages!=null)for(let o in r.floorImages){let n=(i=r.floorImages[o])==null?void 0:i.features;if(n!=null){for(let s of n)if("anchorId"in s.properties){let c=s==null?void 0:s.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let u=l.properties;u.image=c,u.image&&(u.image.position=s.geometry.coordinates)}}}}},"processMVFPolygonImages"),p6=p((r,t)=>{var i,o;if(((i=r.enterprise)==null?void 0:i.enterpriseStyles)==null)return;let e=(o=r.enterprise)==null?void 0:o.enterpriseStyles;for(let n in e){let s=e[n];s.geometryAnchors.forEach(c=>{let l=t[c.geometryId];if(l!=null){let u=l.properties;u.style={styleId:n,edgeOffset:s.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),u6=p((r,t,e)=>{if(!(r.enterprise==null||r.enterprise.textures==null))for(let i of r.enterprise.textures)for(let o of i.geometryAnchors){let n=t[o.geometryId]||e[o.geometryId];if(n!=null){let s=n.properties;s.textures==null&&(s.textures=[]),s.textures.push(i)}}},"processMVFEnterpriseTextures"),d6=p((r,t)=>{let e={},i={},o={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o};let n=globalThis.Object.keys(r.annotation);for(let s of n){let c=r.annotation[s];if(c!=null)for(let l of c.features){i[l.properties.id]=l;let u=new Mi(t,{floorId:s,mvfData:l});e[l.properties.id]=u,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o}},"processMVFAnnotations"),h6=p((r,t)=>{let e={},i={},o={};if(r.area==null)return{areasById:e,areasByExternalId:i,mvfAreasById:o};let n=globalThis.Object.keys(r.area);for(let s of n){let c=r.area[s];if(c!=null)for(let l of c.features){o[l.properties.id]=l;let u=new xi(t,{floorId:s,mvfData:l});e[l.properties.id]=u,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(u))}}return{areasById:e,areasByExternalId:i,mvfAreasById:o}},"processMVFAreas"),Mv=p((r,t)=>{var x,T,D,w,E,k,L,_,B,V,j,Y,ie;let e={},i={},o={},n={},s=((T=(x=r.enterprise)==null?void 0:x.locations)!=null?T:[]).reduce((H,oe)=>(H[oe.id]=oe,H),{}),c={},l={},u={},h={},g={},y={},v=((D=r.enterprise)==null?void 0:D.venue)||{},b={},S={};for(let H of(E=(w=r.enterprise)==null?void 0:w.categories)!=null?E:[]){let oe=new Xl(t,{mvfData:H});c[H.id]=oe,H.externalId&&(l[H.externalId]==null&&(l[H.externalId]=[]),l[H.externalId].push(oe)),u[H.id]=H,H.locations.forEach(z=>{g[z]==null&&(g[z]=[]),g[z].push(H.id)})}let C={};for(let H of(L=(k=r.enterprise)==null?void 0:k.locationInstances)!=null?L:[]){let oe=s[H.parent],z=Object.keys(oe),De={};for(let ye of z)De[ye]=void 0;let de={...De,polygons:[],nodes:[],...H};C[de.parent]==null&&(C[de.parent]=[]),C[de.parent].push(new Yr(t,{mvfData:de,categoryIds:((B=(_=r.enterprise)==null?void 0:_.categoryPriorities)==null?void 0:B[de.id])||g[de.id],parentId:H.parent})),b[de.id]=H}for(let H in r.space){let oe=r.space[H];if(oe!=null)for(let z of oe.features)for(let De of z.properties.destinationNodes)S[De]==null&&(S[De]=[]),S[De].push(z.properties.id)}for(let H of(j=(V=r.enterprise)==null?void 0:V.locations)!=null?j:[]){let oe=new Yr(t,{mvfData:H,categoryIds:((ie=(Y=r.enterprise)==null?void 0:Y.categoryPriorities)==null?void 0:ie[H.id])||g[H.id],locationInstances:C[H.id]});o[H.id]=oe,H.externalId&&(n[H.externalId]==null&&(n[H.externalId]=[]),n[H.externalId].push(oe)),H.nodes.forEach(z=>{y[z.id]==null&&(y[z.id]=[]),y[z.id].push(H.id)});for(let z of H.polygons)h[z.id]==null&&(h[z.id]=[]),h[z.id].push(H)}if(t.enterpriseMode===!0){for(let H in t.mvfConnectionsById){let oe={},z=t.mvfConnectionsById[H];for(let De of t.mvfConnectionsById[H].nodes){let de=t.nodesById[De];de!=null&&(oe[de.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[de.coordinate.longitude,de.coordinate.latitude]},properties:{id:H,externalId:z.externalId,kind:"enterprise."+z.type,destinationNodes:[],flags:"",type:z.type,nodes:z.nodes,accessible:z.accessible,extra:z.extra,details:z.details}})}Object.keys(oe).length>0&&(e[H]=new bo(t,{mvfDataByFloorId:oe}),z.externalId&&(i[z.externalId]==null&&(i[z.externalId]=[]),i[z.externalId].push(e[H])))}t.connectionsById=e}return{spaceIdsByNodeId:S,connectionsByExternalId:i,locationIdsByNodeId:y,mvfLocationsBySpaceId:h,mvfLocationsById:s,mvfCategoriesById:u,locationsById:o,locationsByExternalId:n,locationInstancesById:b,categoriesById:c,categoriesByExternalId:l,venue:v}},"createEnterpriseDataFromMVF"),Tv=p((r,t)=>{let{nodesById:e,nodesByExternalId:i,mvfNodesById:o,mvfNodesByFloorId:n}=r6(r,t),{mvfConnectionsById:s,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:l}=a6(r,o),{spacesById:u,spacesByExternalId:h,spaceIdsByDestinationNodeId:g,poisById:y,poisByExternalId:v,mvfSpacesById:b,objectEntranceNodeIdsByObstructionId:S,connectionsById:C,connectionIdsByLatLon:x,mvfSpacesByFloorId:T,mvfPoisByFloorId:D}=t6(r,c,t),{objectsById:w,objectsByExternalId:E,mvfObstructionById:k,obstructionIdByEntranceId:L}=i6(r,t),{floorsById:_,floorsByExternalId:B,mvfFloorsById:V}=o6(r,t),{floorStacksById:j,floorStacksByExternalId:Y,mvfFloorStacksById:ie,facadesById:H,facadesBySpaceId:oe}=n6(r,t),{doorsById:z,doorsByExternalId:De,doorsByNodeId:de,mvfEntrancesById:ye,mvfEntrancesByFloorId:Ie}=s6(r,t),{annotationsById:dr,mvfAnnotationsById:Ft,mvfAnnotationsByFloorId:pt}=d6(r,t),{areasById:ot,areasByExternalId:fi,mvfAreasById:to}=h6(r,t);c6(r,b,k),l6(r,b,k),p6(r,b),u6(r,b,k);let{locationCategoriesByParentId:se,locationProfilesById:he,locationCategoriesById:Ue,locationProfilesByExternalId:ut,locationProfilesByCategoryId:hr,locationProfilesByAttachedFeatureId:ro}=e6(r,t);return{spacesById:u,spacesByExternalId:h,nodesById:e,nodesByExternalId:i,objectsById:w,objectsByExternalId:E,floorsById:_,floorsByExternalId:B,floorStacksById:j,floorStacksByExternalId:Y,facadesById:H,facadesBySpaceId:oe,connectionsById:C,doorsById:z,doorsByExternalId:De,doorsByNodeId:de,poisById:y,poisByExternalId:v,annotationsById:dr,areasById:ot,areasByExternalId:fi,spaceIdsByDestinationNodeId:g,objectEntranceNodeIdsByObstructionId:S,obstructionIdByEntranceId:L,connectionIdsByLatLon:x,locationProfilesById:he,locationCategoriesById:Ue,locationProfilesByExternalId:ut,locationProfilesByCategoryId:hr,locationCategoriesByParentId:se,mvfSpacesById:b,mvfNodesById:o,mvfObstructionById:k,mvfFloorsById:V,mvfFloorStacksById:ie,mvfConnectionsById:s,mvfConnectionsByNodeId:c,mvfEntrancesById:ye,mvfAnnotationsById:Ft,mvfNodesByFloorId:n,mvfSpacesByFloorId:T,mvfPoisByFloorId:D,mvfAreasById:to,mvfEntrancesByFloorId:Ie,mvfAnnotationsByFloorId:pt,locationProfilesByAttachedFeatureId:ro,mvfConnectionIdsByLatLon:l}},"createDataFromMVF");m();m();m();var f6=p(function(){let t=globalThis.fetch;return{fetch(...e){if(!Nl(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(...e)},setFetch(e){t=e}}},"createFetchControl")(),wv=f6.fetch;var Lv=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],Dv=Lv[0],Av="https://api-gateway.mappedin.com/track-analytics/a/",Fv="deny-watchposition",kv="load-mapview",Bv="load-mapdata",_v="change-language",Rv="query-directions";var Di,vr,ts,Fu,qf=class qf{constructor(){I(this,ts);I(this,Di,Object.freeze({}));I(this,vr);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",Sb((t,e)=>this.sendAnalyticEvent(Rv,{start:t,end:e,type:"location_to_location"}),2500));M(this,vr,R(this,ts,Fu).call(this,a(this,Di)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){M(this,Di,{}),M(this,vr,R(this,ts,Fu).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return M(this,Di,Object.freeze(Object.assign({},a(this,Di),t))),M(this,vr,R(this,ts,Fu).call(this,t)),a(this,vr)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=zf({...a(this,vr),mapId:e.mapId})),e.context&&(e.context=Ov(e.context)),e.baseUri&&(e.analyticsBaseUrl=zf({baseUri:e.baseUri,mapId:a(this,vr).mapId})),Object.assign(a(this,vr),e),this.handleStateUpdate(t)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:i}=this.getState();return!!(t&&e)||!!i}getState(){return a(this,vr)}getContext(){return this.getState().context||a(this,Di).context||Dv}getSessionId(){return this.getState().sessionId||a(this,Di).sessionId||Ev()}sendAnalyticEvent(t,e={}){let i=this.getState(),o=g6(i.analyticsBaseUrl,t),n={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&A.log("Analytics.track",o,n),!i.sendEvents)return Promise.resolve();if(!this.authReady)return A.warn("Auth needs to be ready to send analytics.");let s={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(s,i.userPosition),n["Content-Type"]="application/json",i.accessToken?n.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(n["x-mappedin-key"]=btoa(i.key),n["x-mappedin-secret"]=btoa(i.secret)),wv(o,{method:"POST",mode:"cors",headers:n,body:JSON.stringify(s)})}capture(t,e){if(b6.includes(t))return A.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=y6.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(Bv,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(_v,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(Fv)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(kv,{type:"3d",firstRenderDuration:t,width:e.width,height:e.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)}};Di=new WeakMap,vr=new WeakMap,ts=new WeakSet,Fu=p(function(t){var i,o,n,s;let e=(i=t.baseUri)!=null?i:Av;return{baseUri:e,analyticsBaseUrl:zf({...t,baseUri:e}),version:((o=P==null?void 0:P.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||m6(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||Ev(),platformString:t.platformString||"",context:Ov(t.context)||Dv,geolocationMode:!1,sendEvents:(n=t.sendEvents)!=null?n:!0,logEvents:(s=t.logEvents)!=null?s:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),p(qf,"AnalyticsInternal");var rs=qf;function zf({mapId:r,baseUri:t=Av}){return"".concat(t).concat(r,"/")}p(zf,"getBaseUrl");function m6(){return hn.getInstance().loadLocalData("deviceId")}p(m6,"getDeviceIDFromStorage");function Ev(){return hn.getInstance().loadSessionData("id")}p(Ev,"getSessionIDFromStorage");function g6(r,t){return r+t}p(g6,"buildUrl");function Ov(r){return Lv.find(t=>t===r)}p(Ov,"getValidContext");var y6=["$select-location","$select-category","$query-suggest","$query-search"],b6=[kv,Bv,Rv,Fv,_v],JL=new rs,Ei,$f=class $f{constructor(t){I(this,Ei);d(this,"capture");d(this,"updateState");M(this,Ei,t),this.capture=a(this,Ei).capture.bind(a(this,Ei)),this.updateState=a(this,Ei).updateState.bind(a(this,Ei))}getState(){return Object.assign({},a(this,Ei).getState())}};Ei=new WeakMap,p($f,"Analytics");var Zl=$f;m();var v6=new Set(["polygons"]),Cr,Ee,Rt,zl,is=class is extends Xe{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",is.__type);d(this,"description");d(this,"name","");d(this,"amenity");d(this,"externalId","");d(this,"extra");d(this,"gallery");d(this,"instances");d(this,"logo");d(this,"operationHours");d(this,"phone");d(this,"picture");d(this,"shortName");d(this,"showFloatingLabelWhenImagePresent");d(this,"showLogo");d(this,"siblingGroups");d(this,"social");d(this,"sortOrder",-1);d(this,"states");d(this,"tags");d(this,"type","");I(this,Cr);I(this,Ee,{});I(this,Rt);I(this,zl);M(this,Cr,e),M(this,Rt,i.mvfData),M(this,zl,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let o in i.mvfData)!v6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(i.parentId){let n=a(this,Cr).locationsById[i.parentId];return a(this,Rt)[o]!=null?a(this,Cr).getPropTranslation(this.__type,o,a(this,Rt).id,a(this,Rt)[o]):a(this,Cr).getPropTranslation(this.__type,o,a(this,Rt).id,n[o])}return a(this,Cr).getPropTranslation(this.__type,o,a(this,Rt).id,a(this,Rt)[o])}})}static is(e){return e.__type===is.__type}get focusTarget(){return this.spaces}get categories(){return a(this,Ee).categories?a(this,Ee).categories:(a(this,Ee).categories=(a(this,zl).map(e=>a(this,Cr).getById("enterprise-category",e))||[]).filter(Boolean),a(this,Ee).categories)}get coordinates(){if(a(this,Ee).coordinates)return a(this,Ee).coordinates;a(this,Ee).coordinates=[];for(let e=0;e<this.nodes.length;e++)a(this,Ee).coordinates.push(this.nodes[e].coordinate);return a(this,Ee).coordinates}get nodes(){if(a(this,Ee).nodes)return a(this,Ee).nodes;a(this,Ee).nodes=[];for(let e=0;e<a(this,Rt).nodes.length;e++){let i=a(this,Cr).getById("node",a(this,Rt).nodes[e].id);i&&a(this,Ee).nodes.push(i)}return a(this,Ee).nodes}get spaces(){if(a(this,Ee).spaces)return a(this,Ee).spaces;a(this,Ee).spaces=[];for(let e=0;e<a(this,Rt).polygons.length;e++){let i=a(this,Cr).getById("space",a(this,Rt).polygons[e].id);i&&a(this,Ee).spaces.push(i)}return a(this,Ee).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,Ee)))delete a(this,Ee)[e]}};Cr=new WeakMap,Ee=new WeakMap,Rt=new WeakMap,zl=new WeakMap,p(is,"EnterpriseLocation"),d(is,"__type","enterprise-location");var Jf=is,Yr=Jf;m();var C6=new Set,Ln,xt,qr,os=class os extends Xe{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",os.__type);d(this,"name","");d(this,"color");d(this,"externalId","");d(this,"extra");d(this,"icon");d(this,"iconFromDefaultList");d(this,"sortOrder",-1);d(this,"picture");I(this,Ln);I(this,xt,{});I(this,qr);M(this,Ln,e),M(this,qr,i.mvfData);for(let o in i.mvfData)!C6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return a(this,Ln).getPropTranslation(this.__type,o,a(this,qr).id,a(this,qr)[o])}})}static is(e){return e.__type===os.__type}get children(){if(a(this,xt).children)return a(this,xt).children;a(this,xt).children=[];for(let e=0;e<a(this,qr).children.length;e++){let i=a(this,Ln).getById("enterprise-category",a(this,qr).children[e]);i&&a(this,xt).children.push(i)}return a(this,xt).children}get locations(){if(a(this,xt).locations)return a(this,xt).locations;a(this,xt).locations=[];for(let e=0;e<a(this,qr).locations.length;e++){let i=a(this,Ln).getById("enterprise-location",a(this,qr).locations[e]);i&&a(this,xt).locations.push(i)}return a(this,xt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,xt)))delete a(this,xt)[e]}};Ln=new WeakMap,xt=new WeakMap,qr=new WeakMap,p(os,"EnterpriseCategory"),d(os,"__type","enterprise-category");var Qf=os,Xl=Qf;m();var S6=new Set,ql,$l,ns=class ns extends Xe{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",ns.__type);d(this,"countrycode");d(this,"externalId","");d(this,"defaultLanguage",{code:"en",name:"English"});d(this,"defaultMap");d(this,"extra");d(this,"icon");d(this,"languages",[]);d(this,"links",[]);d(this,"logo");d(this,"mappedinWebUrl");d(this,"slug","");d(this,"topLocations");d(this,"tzid");I(this,ql,{});I(this,$l);M(this,$l,i.mvfData);for(let o in i.mvfData)!S6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=i.mvfData[o])}static is(e){return e.__type===ns.__type}get name(){var e;return(e=a(this,$l).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,ql)))delete a(this,ql)[e]}};ql=new WeakMap,$l=new WeakMap,p(ns,"EnterpriseVenue"),d(ns,"__type","enterprise-venue");var Kf=ns,ku=Kf;m();m();function as(r){return r.endsWith("/")?r:"".concat(r,"/")}p(as,"normalizeUrl");m();var ss="https://app.mappedin.com/",Nv="https://auth.mappedin.com/";m();var Gv="accessTokens";async function An(r,t=!1){let e="".concat(r.key),i=hn.getInstance(),o=(i==null?void 0:i.loadSessionData(Gv))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expiresTimestamp)return o[e];let s=t?await x6(r,n):await I6(r,n),c={...o,[e]:s};return i==null||i.saveSessionData(Gv,c),s}p(An,"getAccessToken");async function x6(r,t){var n;let e="".concat((n=r.baseAuthUri)!=null?n:Nv,"oauth2/token"),i=await Sr()(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:r.key,client_secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let o=await i.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}p(x6,"fetchAccessTokenEnterprise");async function I6(r,t){let e="".concat(r.baseAuthUri?as(r.baseAuthUri):ss,"api/api-key/token"),i=await Sr()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:r.key,secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let o=await i.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}p(I6,"fetchAccessToken");m();var Vv="miSasTokens";async function ls(r,t){let e="".concat(t,"__").concat(r.mapId),i=hn.getInstance(),o=(i==null?void 0:i.loadSessionData(Vv))||{},n=Date.now();if(o[e]&&n<o[e].expires)return o[e];let s=await P6(r,t),c={...o,[e]:{token:s.token,expires:new Date(s.expires).getTime()}};return i==null||i.saveSessionData(Vv,c),s}p(ls,"getSasToken");async function P6(r,t){let e="".concat(r.baseUri?as(r.baseUri):ss,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await Sr()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));return await i.json()}p(P6,"fetchSasToken");var jv=globalThis.fetch,Hv,M6=(Hv=P==null?void 0:P.env)==null?void 0:Hv.npm_package_version;function Sr(){if(jv==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return jv}p(Sr,"isomorphicFetch");var em={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Wv(r){var e;let t={...em,...r};return t.headers={...t.headers,"mappedin-sdk-version":M6},t.things=[],"platformString"in r&&(t.headers={...t.headers,"mappedin-platform-version":r.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=(e=t.language)==null?void 0:e.toLowerCase(),t}p(Wv,"parseOptions");function T6(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete i.language;let{headers:o}=r;o["Content-Type"]=o["Content-Type"]||"text/json",r.accessToken?o.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(o["x-mappedin-key"]=btoa(r.clientId),o["x-mappedin-secret"]=btoa(r.clientSecret));let n={method:"GET",headers:o};return r.secure&&(t+="&withcdntoken"),{req:n,url:t}}p(T6,"constructParamsForRequest");async function w6(r,t,e=!1){let i=T6(r,t,e),o=await Sr()(i.url,i.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}p(w6,"generateAPIRequest");var D6=p(r=>{let t=r!=null&&typeof r=="object"&&"perspectives"in r&&r.perspectives!=null&&typeof r.perspectives=="object"?r.perspectives:null;if(t==null||Object.keys(t).length===0)return A.warn("No perspectives available in response!"),null;let e={};for(let[i,o]of Object.entries(t)){let n="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(n==null||s==null){A.warn("Perspective ".concat(i," is missing url or locale_packs!"));continue}e[i]={url:n,locale_packs:s}}return e},"getPerspectivesFromResponse");async function E6(r,t="exports/mvf/1/bundle"){var u,h;let e=Wv({baseUri:"https://api-gateway.mappedin.com/",...em,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((u=e.version)!=null?u:"2.0.0");e.headers["Content-Type"]="application/zip";let o=await w6(e,i),n=o.url,s=o.locale_packs,c=(h=e.perspective)!=null?h:em.perspective,l=D6(o);if(c!=null&&c!==""&&l!=null){let g=l[c];g==null?A.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(A.log('Loading perspective "'.concat(c,'"')),n=g.url,s=g.locale_packs)}return{url:n,localePacks:s,updated_at:o.updated_at}}p(E6,"getVenueMVFURL");var Jl=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function tm(r,{signal:t}){let e=await(await Sr()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}p(tm,"getLanguagePackUnitArray");async function cs(r){let e=(await import("./browser-QRMTGKD7.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let o=e["enterprise/locations.json"];o&&(i.enterprise.locations=JSON.parse(Jl().decode(o)));let n=e["enterprise/categories.json"];n&&(i.enterprise.categories=JSON.parse(Jl().decode(n)))}return e["floorstack.json"]&&(i["floorstack.json"]=JSON.parse(Jl().decode(e["floorstack.json"]))),e["floor.geojson"]&&(i["floor.geojson"]=JSON.parse(Jl().decode(e["floor.geojson"]))),e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Jl().decode(e["manifest.json"]))),i}p(cs,"parseLanguagePack");async function Xv(r,{signal:t}){try{let e=await(await Sr()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await cs(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}p(Xv,"downloadLanguagePack");async function rm(r){return new Promise(async(t,e)=>{try{let i=r.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:o,localePacks:n}=await E6(r,i),s=await Sr()(o).then(l=>l.arrayBuffer()),c=new Uint8Array(s);t({compressed:c,localePacks:n})}catch(i){e(i)}})}p(rm,"downloadVenueBundleMVFAPIGateway");async function im(r,t){return new Promise(async(e,i)=>{try{let{url:o}=await O6(r,t),n=await Sr()(o).then(c=>c.arrayBuffer()),s=new Uint8Array(n);e(s)}catch(o){i(o)}})}p(im,"downloadMVF");async function O6(r,t){let e="".concat(r.baseUri?as(r.baseUri):ss,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await Sr()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}p(O6,"getMakerBundleURL");function Ql(r){var i,o,n,s,c,l,u,h,g,y,v,b,S,C,x,T,D,w;let t=new TextDecoder,e=t.decode.bind(t);try{let E={"connection.json":JSON.parse(e(r["connection.json"])),"manifest.geojson":JSON.parse(e(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(e(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(e(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(e(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":r["tileset.json"]?JSON.parse(e(r["tileset.json"])):void 0};if(r.enterprise!=null&&(E.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(E.enterprise.locations=JSON.parse(e((o=r.enterprise)==null?void 0:o["locations.json"]))),(n=r.enterprise)!=null&&n["categories.json"]&&(E.enterprise.categories=JSON.parse(e((s=r.enterprise)==null?void 0:s["categories.json"]))),(c=r.enterprise)!=null&&c["venue.json"]&&(E.enterprise.venue=JSON.parse(e((l=r.enterprise)==null?void 0:l["venue.json"]))),(u=r.enterprise)!=null&&u["layers.json"]&&(E.enterprise.layers=JSON.parse(e((h=r.enterprise)==null?void 0:h["layers.json"]))),(g=r.enterprise)!=null&&g["locationInstances.json"]&&(E.enterprise.locationInstances=JSON.parse(e((y=r.enterprise)==null?void 0:y["locationInstances.json"]))),(v=r.enterprise)!=null&&v["enterpriseStyles.json"]&&(E.enterprise.enterpriseStyles=JSON.parse(e((b=r.enterprise)==null?void 0:b["enterpriseStyles.json"]))),(S=r.enterprise)!=null&&S["textures.json"]&&(E.enterprise.textures=JSON.parse(e((C=r.enterprise)==null?void 0:C["textures.json"]))),(x=r.enterprise)!=null&&x["floorText.json"]&&(E.enterprise.floorText=JSON.parse(e((T=r.enterprise)==null?void 0:T["floorText.json"]))),(D=r.enterprise)!=null&&D["categoryPriorities.json"]&&(E.enterprise.categoryPriorities=JSON.parse(e((w=r.enterprise)==null?void 0:w["categoryPriorities.json"])))),r["floorstack.json"]!=null?E["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(E["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),E["floorstack.json"]==null&&E["mapstack.json"]==null&&E["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(E["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),E["floor.geojson"]==null&&E["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(E["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(E["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(E["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(E["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){E.annotation={};let L=Object.keys(r.annotation);for(let _ of L){let B=_.replace(/\.json|\.geojson/g,"");E.annotation[B]=JSON.parse(e(r.annotation[_]))}}let k=Object.keys(r.space);for(let L of k){let _=L.replace(/\.json|\.geojson/g,"");E.space[_]=JSON.parse(e(r.space[L]))}if(r.obstruction!=null){let L=Object.keys(r.obstruction);for(let _ of L){let B=_.replace(/\.json|\.geojson/g,"");E.obstruction[B]=JSON.parse(e(r.obstruction[_]))}}else E.obstruction={};if(r.entrance!=null){let L=Object.keys(r.entrance);for(let _ of L){let B=_.replace(/\.json|\.geojson/g,"");E.entrance[B]=JSON.parse(e(r.entrance[_]))}}else E.entrance={};if("floorImages"in r&&r.floorImages!=null){E.floorImages={};for(let L of Object.keys(r.floorImages)){let _=L.replace(/\.json|\.geojson/g,"");E.floorImages[_]=JSON.parse(e(r.floorImages[L]))}}if("textAreas"in r&&r.textAreas!=null){E.textAreas={};for(let L of Object.keys(r.textAreas)){let _=L.replace(/\.json|\.geojson/g,"");E.textAreas[_]=JSON.parse(e(r.textAreas[L]))}}if("facade"in r&&r.facade!=null){E.facade={};for(let L of Object.keys(r.facade)){let _=L.replace(/\.json|\.geojson/g,"");E.facade[_]=JSON.parse(e(r.facade[L]))}}if("area"in r&&r.area!=null){E.area={};for(let L of Object.keys(r.area)){let _=L.replace(/\.json|\.geojson/g,"");E.area[_]=JSON.parse(e(r.area[L]))}}return E}catch(E){throw A.error(E),new Error("MVF parsing failed! Probably encountered a bad file.")}}p(Ql,"parseMVF");function L6(r){if(r==null||typeof r!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&t.push("styles.json"),"shapes.json"in r&&t.push("shapes.json");for(let e of t)if(r[e]==null||r[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}p(L6,"validateStaticMVFFiles");async function Kl(r){return new Promise(async(t,e)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let o=(await import("./browser-QRMTGKD7.js")).unzipSync(r);if(!L6(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let n={},s=Object.keys(o);for(let c of s){if(o[c].length===0)continue;let l=c.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){n[l[0]]=o[c];continue}if(l[0]==="image"){A.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else n[l[0]]==null&&(n[l[0]]={}),n[l[0]][l[1]]=o[c]}t(n)}catch(i){e(i)}})}p(Kl,"unzipMVF");function Fn(){let r="us",t={};function e(){return B6(R6(r),t)}return p(e,"getState"),{updateByUserOption(i){var o,n;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(o=i.analytics)!=null&&o.baseUri&&(t.analyticsBaseUri=(n=i.analytics)==null?void 0:n.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?Uv.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?Uv.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}p(Fn,"createEnvControl");var Yv=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"}),Uv=Object.freeze({...Yv,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),A6=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"}),F6=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"}),k6=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 B6(r,t){return{...r,...t}}p(B6,"getAuthStateByEnvironment");var _6={eu:A6,us:Yv,"us-staging-enterprise":F6,"us-staging-self-serve":k6};function R6(r){return _6[r]}p(R6,"getEnvironmentAuthState");m();m();m();m();m();m();function nr(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}p(nr,"getCoord");function Yt(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}p(Yt,"getCoords");function ps(r){return r.type==="Feature"?r.geometry:r}p(ps,"getGeom");function Zv(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}p(Zv,"getType");function N6(r,t,e){e===void 0&&(e={});for(var i=nr(r),o=Yt(t),n=0;n<o.length-1;n++){var s=!1;if(e.ignoreEndVertices&&(n===0&&(s="start"),n===o.length-2&&(s="end"),n===0&&n+1===o.length-1&&(s="both")),G6(o[n],o[n+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}p(N6,"booleanPointOnLine");function G6(r,t,e,i,o){var n=e[0],s=e[1],c=r[0],l=r[1],u=t[0],h=t[1],g=e[0]-c,y=e[1]-l,v=u-c,b=h-l,S=g*b-y*v;if(o!==null){if(Math.abs(S)>o)return!1}else if(S!==0)return!1;if(i){if(i==="start")return Math.abs(v)>=Math.abs(b)?v>0?c<n&&n<=u:u<=n&&n<c:b>0?l<s&&s<=h:h<=s&&s<l;if(i==="end")return Math.abs(v)>=Math.abs(b)?v>0?c<=n&&n<u:u<n&&n<=c:b>0?l<=s&&s<h:h<s&&s<=l;if(i==="both")return Math.abs(v)>=Math.abs(b)?v>0?c<n&&n<u:u<n&&n<c:b>0?l<s&&s<h:h<s&&s<l}else return Math.abs(v)>=Math.abs(b)?v>0?c<=n&&n<=u:u<=n&&n<=c:b>0?l<=s&&s<=h:h<=s&&s<=l;return!1}p(G6,"isPointOnLineSegment");var zv=N6;m();function V6(r,t){t===void 0&&(t={});var e=Ea(r),i=(e[0]+e[2])/2,o=(e[1]+e[3])/2;return Gr([i,o],t.properties,t)}p(V6,"center");var Bu=V6;m();m();function j6(r,t,e){e===void 0&&(e={});var i=nr(r),o=nr(t),n=kt(o[1]-i[1]),s=kt(o[0]-i[0]),c=kt(i[1]),l=kt(o[1]),u=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(c)*Math.cos(l);return Pb(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}p(j6,"distance");var xo=j6;function _u(r,t){return t===void 0&&(t={}),wb(r,function(e,i){var o=i.geometry.coordinates;return e+xo(o[0],o[1],t)},0)}p(_u,"length");m();m();m();function Ru(r,t,e){if(e===void 0&&(e={}),e.final===!0)return U6(r,t);var i=nr(r),o=nr(t),n=kt(i[0]),s=kt(o[0]),c=kt(i[1]),l=kt(o[1]),u=Math.sin(s-n)*Math.cos(l),h=Math.cos(c)*Math.sin(l)-Math.sin(c)*Math.cos(l)*Math.cos(s-n);return Pl(Math.atan2(u,h))}p(Ru,"bearing");function U6(r,t){var e=Ru(t,r);return e=(e+180)%360,e}p(U6,"calculateFinalBearing");m();function kn(r,t,e,i){i===void 0&&(i={});var o=nr(r),n=kt(o[0]),s=kt(o[1]),c=kt(e),l=Mb(t,i.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(c)),h=n+Math.atan2(Math.sin(c)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u)),g=Pl(h),y=Pl(u);return Gr([g,y],i.properties)}p(kn,"destination");m();m();function H6(r){if(!r)throw new Error("geojson is required");var t=[];return Vr(r,function(e){W6(e,t)}),fn(t)}p(H6,"lineSegment");function W6(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=Yt(i);break;case"LineString":e=[Yt(i)]}e.forEach(function(o){var n=X6(o,r.properties);n.forEach(function(s){s.id=t.length,t.push(s)})})}}p(W6,"lineSegmentFeature");function X6(r,t){var e=[];return r.reduce(function(i,o){var n=bi([i,o],t);return n.bbox=Y6(i,o),e.push(n),o}),e}p(X6,"createSegments");function Y6(r,t){var e=r[0],i=r[1],o=t[0],n=t[1],s=e<o?e:o,c=i<n?i:n,l=e>o?e:o,u=i>n?i:n;return[s,c,l,u]}p(Y6,"bbox");var om=H6;var iS=gu(tS(),1);function mM(r,t){var e={},i=[];if(r.type==="LineString"&&(r=cf(r)),t.type==="LineString"&&(t=cf(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=rS(r,t);return o&&i.push(o),fn(i)}var n=(0,iS.default)();return n.load(om(t)),pf(om(r),function(s){pf(n.search(s),function(c){var l=rS(s,c);if(l){var u=Yt(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),fn(i)}p(mM,"lineIntersect");function rS(r,t){var e=Yt(r),i=Yt(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],n=e[0][1],s=e[1][0],c=e[1][1],l=i[0][0],u=i[0][1],h=i[1][0],g=i[1][1],y=(g-u)*(s-o)-(h-l)*(c-n),v=(h-l)*(n-u)-(g-u)*(o-l),b=(s-o)*(n-u)-(c-n)*(o-l);if(y===0)return null;var S=v/y,C=b/y;if(S>=0&&S<=1&&C>=0&&C<=1){var x=o+S*(s-o),T=n+S*(c-n);return Gr([x,T])}return null}p(rS,"intersects");var Is=mM;function gM(r,t,e){e===void 0&&(e={});var i=Gr([1/0,1/0],{dist:1/0}),o=0;return Vr(r,function(n){for(var s=Yt(n),c=0;c<s.length-1;c++){var l=Gr(s[c]);l.properties.dist=xo(t,l,e);var u=Gr(s[c+1]);u.properties.dist=xo(t,u,e);var h=xo(l,u,e),g=Math.max(l.properties.dist,u.properties.dist),y=Ru(l,u),v=kn(t,g,y+90,e),b=kn(t,g,y-90,e),S=Is(bi([v.geometry.coordinates,b.geometry.coordinates]),bi([l.geometry.coordinates,u.geometry.coordinates])),C=null;S.features.length>0&&(C=S.features[0],C.properties.dist=xo(t,C,e),C.properties.location=o+xo(l,C,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=c,i.properties.location=o),u.properties.dist<i.properties.dist&&(i=u,i.properties.index=c+1,i.properties.location=o+h),C&&C.properties.dist<i.properties.dist&&(i=C,i.properties.index=c),o+=h}}),i}p(gM,"nearestPointOnLine");var gc=gM;function yM(r,t,e){var i=Yt(e);if(Zv(e)!=="LineString")throw new Error("line must be a LineString");var o=gc(e,r),n=gc(e,t),s;o.properties.index<=n.properties.index?s=[o,n]:s=[n,o];for(var c=[s[0].geometry.coordinates],l=s[0].properties.index+1;l<s[1].properties.index+1;l++)c.push(i[l]);return c.push(s[1].geometry.coordinates),bi(c,e.properties)}p(yM,"lineSlice");var Xg=yM;var bM=1e-7;function Yg(r){return{type:"Point",coordinates:r}}p(Yg,"point");function vM(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,o=e.map(n=>gc(r,Yg(n)));return i.reduce((n,s)=>{let c=Xg(Yg(s),o[0],r),l=Xg(Yg(s),o[1],r),u=_u(c)<_u(l)?c:l;return u.properties={...r.properties,entrances:[]},n.concat([u])},[])}p(vM,"splitObstructionByEntrance");function Zg(r,t){return t.reduce((e,i)=>{let o={epsilon:bM},n=e.obstructions.findIndex(c=>zv(Bu(i),c,o)),s=e.obstructions[n];if(s){let[c,l]=vM(s,i);e.entrances.push(i),e.obstructions.splice(n,1,c,l)}return e},{obstructions:[r],entrances:[]})}p(Zg,"findAndSplitObstructionByAllEntrances");m();function zg(r){var o,n,s,c,l,u;let t=((n=(o=r.enterprise)==null?void 0:o.locations)==null?void 0:n.reduce((h,g)=>(h[g.id]=g,h),{}))||{};for(let h of((s=r.enterprise)==null?void 0:s.locationInstances)||[])t[h.id]=h;let e={};for(let h of r["floorstack.json"]||[])e[h.id]=h;let i={};for(let h of((c=r["floor.geojson"])==null?void 0:c.features)||[])h.properties&&h.properties.id&&(i[h.properties.id]=h.properties);return{type:"downloaded",data:r,optimized:{"enterprise-location":t,"enterprise-category":((u=(l=r.enterprise)==null?void 0:l.categories)==null?void 0:u.reduce((h,g)=>(h[g.id]=g,h),{}))||{},"floor-stack":e,floor:i}}}p(zg,"parseLocalePackToLanguagePack");function oS(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}p(oS,"isMappedinCdnUrl");m();m();m();m();m();m();m();var qg=class qg{constructor({origin:t,destination:e,distance:i=0,angle:o=0,pathWeight:n=0,multiplicativeDistanceWeightScaling:s=!0}){d(this,"origin");d(this,"destination");d(this,"distance");d(this,"angle");d(this,"weight");if(this.origin=t,this.destination=e,this.distance=i,this.angle=o,this.weight=n||0,s?t.properties.floor===e.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===e.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(qg,"Edge");var Nn=qg;m();m();m();function Fi(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=nr(r),o=ps(t),n=o.type,s=t.bbox,c=o.coordinates;if(s&&CM(i,s)===!1)return!1;n==="Polygon"&&(c=[c]);for(var l=!1,u=0;u<c.length&&!l;u++)if(nS(i,c[u][0],e.ignoreBoundary)){for(var h=!1,g=1;g<c[u].length&&!h;)nS(i,c[u][g],!e.ignoreBoundary)&&(h=!0),g++;h||(l=!0)}return l}p(Fi,"booleanPointInPolygon");function nS(r,t,e){var i=!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,n=t.length-1;o<t.length;n=o++){var s=t[o][0],c=t[o][1],l=t[n][0],u=t[n][1],h=r[1]*(s-l)+c*(l-r[0])+u*(r[0]-s)===0&&(s-r[0])*(l-r[0])<=0&&(c-r[1])*(u-r[1])<=0;if(h)return!e;var g=c>r[1]!=u>r[1]&&r[0]<(l-s)*(r[1]-c)/(u-c)+s;g&&(i=!i)}return i}p(nS,"inRing");function CM(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}p(CM,"inBBox");m();m();function ki([r,t],[e,i]){let o=t-i,n=r-e;return(Math.atan2(n,o)+Math.PI*3)%(Math.PI*2)}p(ki,"getAngle");m();var SM=63710088e-1;function Pr(r,t){let[e,i]=r.map(h=>h*Math.PI/180),[o,n]=t.map(h=>h*Math.PI/180),s=n-i,c=o-e,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*Math.cos(n)*Math.sin(c/2)*Math.sin(c/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return SM*u}p(Pr,"getDistance");m();m();function kd(r,t,e,i){let[o,n]=r,[s,c]=t,[l,u]=e,[h,g]=i;if(n===c&&o===s||u===g&&l===h)return null;let y=(h-l)*(c-n)-(g-u)*(s-o);if(y===0)return null;let v=((g-u)*(o-l)-(h-l)*(n-u))/y,b=((c-n)*(o-l)-(s-o)*(n-u))/y;if(v<0||v>1||b<0||b>1)return null;let S=n+v*(c-n);return[o+v*(s-o),S]}p(kd,"getLineIntersection");m();function $g(r,t,e,i){let o=kn(r,e/1e3,i),n=kn(t,e/1e3,i);return[o.geometry.coordinates,n.geometry.coordinates]}p($g,"getOffsetLine");m();function Jg(r){let t=r*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}p(Jg,"radToDegNormalized");var aS=111e3;function sS(r,t,e=[],i=0){let o=!0,n=r.geometry.coordinates,s=t.geometry.coordinates,c=Jg(ki(n,s)-Math.PI/2),l=Jg(ki(n,s)+Math.PI/2),u=i/aS,h=i/(aS*Math.cos(n[1]*Math.PI/180)),g=Math.min(n[1],s[1])-u,y=Math.max(n[1],s[1])+u,v=Math.min(n[0],s[0])-h,b=Math.max(n[0],s[0])+h;for(let S of e)if(!(Math.max(S[0][1],S[1][1])<g||Math.min(S[0][1],S[1][1])>y||Math.max(S[0][0],S[1][0])<v||Math.min(S[0][0],S[1][0])>b)){if(i>0){let C=$g(n,s,i,c),x=$g(n,s,i,l);if(kd(C[0],C[1],S[0],S[1])||kd(x[0],x[1],S[0],S[1])){o=!1;return}}else if(kd(n,s,S[0],S[1])){o=!1;return}}return o}p(sS,"hasLineOfSight");var Gn,st,Qg,lS,cS,pS,uS,dS,hS,_d,Kg=class Kg{constructor({nodes:t,groupBy:e,multiplicativeDistanceWeightScaling:i}){I(this,st);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);I(this,Gn);I(this,_d,p((t,e)=>{let i=0;for(let o of e)(!o[a(this,Gn)]||o[a(this,Gn)]===t.properties[a(this,Gn)])&&Fi(t.geometry.coordinates,o.geometry.geometry)&&(i+=Math.max(0,o.cost));return i},"#getZonalCost"));M(this,Gn,e);let{features:o}=t;this.nodesById=R(this,st,lS).call(this,o),R(this,st,cS).call(this),R(this,st,pS).call(this,o,e,{multiplicativeDistanceWeightScaling:i})}getShortestEuclideanDistance(t,e){return e.reduce((i,o)=>{let n=Pr(t.geometry.coordinates,o.geometry.coordinates);return Math.min(i,n)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,disabledConnectionNodeIds:o,zones:n}){let s=R(this,st,Qg).call(this,t),c=R(this,st,Qg).call(this,e);if(s.length===0||c.length===0)return[];let{frontier:l,cameFrom:u,costSoFar:h}=R(this,st,uS).call(this,s,c);for(;l.length>0;){let g=l.shift();if(!g)break;if(R(this,st,dS).call(this,g.origin,c))return R(this,st,hS).call(this,u,g.origin.properties.id);for(let y of this.edges[g.origin.properties.id]){if(o!=null&&o.has(y.origin.properties.id)&&y.destination.properties.map!==y.origin.properties.map)continue;let v=h[g.origin.properties.id]+y.weight+a(this,_d).call(this,y.destination,n);if(!(v===1/0||i!=null&&i.has(y.destination.properties.id))&&(h[y.destination.properties.id]==null||v<h[y.destination.properties.id])){let b=v+this.getShortestEuclideanDistance(y.destination,c);h[y.destination.properties.id]=v,u[y.destination.properties.id]=y,l.push({origin:y.destination,priority:b})}}l.sort((y,v)=>y.priority-v.priority)}return[]}};Gn=new WeakMap,st=new WeakSet,Qg=p(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),lS=p(function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},"#createNodesById"),cS=p(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},"#removeInvalidNeighbors"),pS=p(function(t,e,i){t.forEach(o=>{let n=e==="default"?e:o.properties[e];this.nodesByGroup.has(n)||this.nodesByGroup.set(n,[]),this.nodesByGroup.get(n).push(o),this.edges[o.properties.id]=o.properties.neighbors.map(({id:s,weight:c})=>{let l=this.nodesById[s],u=Pr(o.geometry.coordinates,l.geometry.coordinates),h=ki(o.geometry.coordinates,l.geometry.coordinates);return new Nn({origin:o,destination:l,pathWeight:c,distance:u,angle:h,multiplicativeDistanceWeightScaling:i==null?void 0:i.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),uS=p(function(t,e){let i=[],o={},n={};return t.forEach(s=>{let c=this.getShortestEuclideanDistance(s,e);i.push({origin:s,priority:c}),o[s.properties.id]=null,n[s.properties.id]=0}),i.sort((s,c)=>s.priority-c.priority),{frontier:i,cameFrom:o,costSoFar:n}},"#initializeSearch"),dS=p(function(t,e){return e.some(i=>i.properties.id===t.properties.id)},"#isDestinationNode"),hS=p(function(t,e){let i=[],o=t[e];for(;o;)i.push(o),o=t[o.origin.properties.id];return i.reverse()},"#reconstructPath"),_d=new WeakMap,p(Kg,"NavigationGraph");var Bd=Kg;var xM=.4,ey=class ey{constructor({nodes:t,geojsonCollection:e,groupBy:i="default",multiplicativeDistanceWeightScaling:o}){d(this,"groupBy");d(this,"graph");d(this,"geometryEdgesByMapId",new Map);d(this,"generatePath",p(t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let n=0;n<t.length;n++){let{origin:s,destination:c}=t[n],l={id:s.properties.id,angle:t[n].angle,distance:t[n].distance,destination:c.properties.id,edges:this.graph.edges[s.properties.id]};this.groupBy!=="default"&&(l.groupBy=s.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:l})}let o={id:e.properties.id,edges:this.graph.edges[e.properties.id]};return this.groupBy!=="default"&&(o.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:o}),i},"generatePath"));d(this,"getDistance",p((t,e)=>Pr(t,e),"getDistance"));d(this,"getAngle",p((t,e)=>ki(t,e),"getAngle"));this.groupBy=i,this.graph=new Bd({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o}),((e==null?void 0:e.features)||[]).forEach(s=>{let c=null;if(s.geometry.type==="LineString"?c=s.geometry.coordinates:s.geometry.type==="Polygon"&&(c=s.geometry.coordinates.flat()),c){let l=this.groupBy==="default"?this.groupBy:s.properties[this.groupBy];this.geometryEdgesByMapId.has(l)||this.geometryEdgesByMapId.set(l,[]),c.forEach((u,h)=>{this.geometryEdgesByMapId.get(l).push([u,c[h+1]||c[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:o,disabledConnectionNodeIds:n,simplify:s,multiplicativeDistanceWeightScaling:c}){var g,y;let l=(g=s==null?void 0:s.enabled)!=null?g:!0,u=t!=null?t:[],h=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:u,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(n)});return h.length===0?{type:"FeatureCollection",features:[]}:(l&&(h=this.simplifyAllSteps(h,(y=s==null?void 0:s.bufferRadius)!=null?y:xM,c)),this.generatePath(h))}simplifyAllSteps(t,e,i){var u,h;let o=[],n=[t[0]];for(let g=1;g<t.length;g++)if(this.groupBy!=="default"&&t[g].origin.properties[this.groupBy]!==t[g-1].origin.properties[this.groupBy]){let y=t[g-1].origin.properties[this.groupBy],v=(u=this.geometryEdgesByMapId.get(y))!=null?u:[];o.push(...this.simplifySteps(n,v,e,i)),n=[t[g]]}else n.push(t[g]);let s=t[t.length-1],c=this.groupBy==="default"?this.groupBy:s.origin.properties[this.groupBy],l=(h=this.geometryEdgesByMapId.get(c))!=null?h:[];return o.push(...this.simplifySteps(n,l,e,i)),o}simplifySteps(t,e,i,o){if(t.length<3)return t;let n=[t[0]],s=1;for(let c=s+2;c<t.length;c++)if(t[s].origin.properties.preventSmoothing||!sS(t[s].origin,t[c].origin,e,i)){let l=c-1;n.push(new Nn({...t[s],destination:t[l].origin,distance:Pr(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:ki(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),s=l}return n.push(new Nn({...t[s],destination:t[t.length-1].origin,distance:Pr(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:ki(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),n}};p(ey,"Navigator");var Ps=ey;m();var GE={};q0(GE,{Annotation:()=>Mi,Area:()=>xi,Connection:()=>bo,Coordinate:()=>Q,DOORS:()=>lp,Door:()=>br,E_SDK_LOG_LEVEL:()=>$0,EnterpriseCategory:()=>Xl,EnterpriseLocation:()=>Yr,EnterpriseVenue:()=>ku,Facade:()=>rr,Floor:()=>Bt,FloorStack:()=>Ll,Hyperlink:()=>fo,ImageData:()=>bn,LocationCategory:()=>Yl,LocationProfile:()=>On,MAPPEDIN_COLORS:()=>Iv,MapObject:()=>_t,Node:()=>vi,PointOfInterest:()=>Pi,Space:()=>Ge,WALLS:()=>sp,__setWatermarkOnClickFn:()=>AE,createMapLibreOverlay:()=>RE,enableTestMode:()=>oy,getMapData:()=>D7,getMapDataEnterprise:()=>_E,hydrateMapData:()=>BE,hydrateMapDataFromMVF:()=>FE,parseMVF:()=>Ql,preloadFont:()=>yf,setLoggerLevel:()=>J0,setUseEnterpriseAPI:()=>kE,show3dMap:()=>E7,show3dMapGeojson:()=>NE,unzipMVF:()=>Kl});m();m();m();m();var bc,vc,Cc,ty=class ty{constructor(t,e,{enabled:i=!1}={}){I(this,bc);d(this,"searchInstance");I(this,vc);I(this,Cc);d(this,"enabled",!1);M(this,bc,t),M(this,vc,e),M(this,Cc,()=>{var o;(o=this.searchInstance)==null||o.then(n=>n.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return A.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return A.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return A.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-CY2P6V5F.js").then(({InternalSearch:t})=>new t(a(this,bc)))),a(this,vc).on("language-change",a(this,Cc)),await this.searchInstance)}};bc=new WeakMap,vc=new WeakMap,Cc=new WeakMap,p(ty,"Search");var yc=ty;var fS=new WeakMap,Ae,iy=class iy extends te{constructor(e,{search:i}={}){super();I(this,Ae);d(this,"Analytics");d(this,"Search");d(this,"Query");d(this,"getDirections",p((e,i,o)=>a(this,Ae).getDirections(e,i,o),"getDirections"));d(this,"getDirectionsMultiDestination",p((e,i,o)=>a(this,Ae).getDirectionsMultiDestination(e,i,o),"getDirectionsMultiDestination"));M(this,Ae,e),fS.set(this,e),this.Analytics=new Zl(e.Analytics),this.Query=e.Query,this.Search=new yc(this,e,{enabled:i==null?void 0:i.enabled}),a(this,Ae).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return a(this,Ae).getEnv()}getAccessToken(){return a(this,Ae).getAccessToken()}getSasToken(){return a(this,Ae).getSasToken()}get mapName(){return a(this,Ae).mapName}get mapCenter(){return a(this,Ae).mapCenter}get organizationId(){return a(this,Ae).organizationId}get outdoorViewToken(){return a(this,Ae).outdoorViewToken}getByType(e){return a(this,Ae).getByType(e)}getById(e,i){return a(this,Ae).getById(e,i)}getByExternalId(e,i){return a(this,Ae).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return a(this,Ae).changeLanguage(e)}get currentLanguage(){return a(this,Ae).currentLanguage}get naturalBearing(){var e;return(e=a(this,Ae).naturalBearing)!=null?e:0}getDistance(e,i){return a(this,Ae).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return a(this,Ae).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return a(this,Ae).toJSONBundle({downloadLanguagePacks:e})}};Ae=new WeakMap,p(iy,"MapData");var ry=iy,Rd=ry;function Sc(r){let t=fS.get(r);if(!t)throw new Error("MapDataInternal not found");return t}p(Sc,"getMapDataInternal");m();m();m();m();m();m();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:p(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var mS="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=";m();m();var gS=!1;function oy(){gS=!0}p(oy,"enableTestMode");function yS(){return gS}p(yS,"isTestMode");var ny=class ny{constructor(t){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new et);d(this,"width",0);d(this,"height",0);d(this,"options",{});d(this,"renderer");d(this,"enabledLayers",new Set([0,1]));d(this,"handleWebGLContextCreationError",p(t=>{var e,i;(i=(e=this.options).onWebGLContextCreationError)==null||i.call(e,t)},"handleWebGLContextCreationError"));d(this,"handleWebGLContextLost",p(t=>{var e,i;(i=(e=this.options).onWebGLContextLost)==null||i.call(e,t)},"handleWebGLContextLost"));d(this,"handleWebGLContextRestored",p(t=>{var e,i;(i=(e=this.options).onWebGLContextRestored)==null||i.call(e,t)},"handleWebGLContextRestored"));var e,i,o,n,s;try{this.options=t,yS()?(this.renderer={setSize:p(()=>{},"setSize"),state:{reset:p(()=>{},"reset")},properties:{get:p(()=>{},"get")},getSize:p(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:p(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:p(()=>1,"getClearAlpha"),getClearColor:p(()=>new et,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:p(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:p(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:p(()=>{},"setRenderTarget"),setClearColor:p(()=>{},"setClearColor"),clear:p(()=>{},"clear"),render:p(()=>{},"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 bb({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 et((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(i=t.backgroundAlpha)!=null?i:1}catch(c){A.error(c),t.onWebGLRendererError&&t.onWebGLRendererError(c)}(o=this.domElement())==null||o.addEventListener("webglcontextlost",this.handleWebGLContextLost),(n=this.domElement())==null||n.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(s=this.domElement())==null||s.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,e,i,o,n;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t)),(i=this.domElement())==null||i.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(n=this.domElement())==null||n.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,e){if(this.renderer){this.renderer.state.reset();for(let i of this.enabledLayers.values())e.layers.enable(i);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){P.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=e,this.renderer.setSize(t,e,!1))}setBackgroundColor(t,e){this.backgroundColor=t,this.backgroundAlpha=e}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};p(ny,"Renderer");var Nd=ny;m();m();var bS='"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';m();m();m();m();m();function vS(r,t){return t.x+t.w<r.x+r.w&&t.x>r.x&&t.y>r.y&&t.y+t.h<r.y+r.h}p(vS,"contains");m();function CS(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}p(CS,"intersectPoint");m();function SS(r,t){let e=t.x,i=t.y,o=t.x+t.w,n=t.y+t.h,s=r.x,c=r.y,l=r.x+r.w,u=r.y+r.h;return e<l&&s<o&&i<u&&c<n}p(SS,"intersects");m();function Bi(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}p(Bi,"appendItems");m();var ay=class ay{constructor(t,e,i,o,n){d(this,"x");d(this,"y");d(this,"w");d(this,"h");d(this,"userData");this.userData=typeof n>"u"?null:n,this.x=t,this.y=e,this.w=i,this.h=o}contains(t){return t===this?!1:vS(this,t)}intersects(t){return SS(this,t)}intersectsPoint(t){return CS(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};p(ay,"Rectangle");var ze=ay;var Vn=class Vn{constructor(t,e){d(this,"topLeft");d(this,"topRight");d(this,"bottomLeft");d(this,"bottomRight");d(this,"divided",!1);d(this,"boundary");d(this,"capacity",16);d(this,"objects",[]);d(this,"parent");this.parent=e,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:e,w:i,h:o}=this.boundary;this.topLeft=new Vn(new ze(t,e,i/2,o/2),this),this.topRight=new Vn(new ze(t+i/2,e,i/2,o/2),this),this.bottomLeft=new Vn(new ze(t,e+o/2,i/2,o/2),this),this.bottomRight=new Vn(new ze(t+i/2,e+o/2,i/2,o/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(Bi(e,this.topLeft.queryRect(t)),Bi(e,this.topRight.queryRect(t)),Bi(e,this.bottomLeft.queryRect(t)),Bi(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(Bi(e,this.topLeft.queryPoint(t)),Bi(e,this.topRight.queryPoint(t)),Bi(e,this.bottomLeft.queryPoint(t)),Bi(e,this.bottomRight.queryPoint(t))),e}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(e=>e.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(Vn,"QuadTree");var Kr=Vn;m();function IS(r,t,e){let i,o,n,s=null,c=0;e||(e={});let l=p(function(){c=e.leading===!1?0:Date.now(),s=null,n=r.apply(i,o),s||(i=o=null)},"later");return function(){let u=Date.now();!c&&e.leading===!1&&(c=u);let h=t-(u-c);return i=globalThis,o=arguments,h<=0||h>t?(s&&(clearTimeout(s),s=null),c=u,n=r.apply(i,o),s||(i=o=null)):!s&&e.trailing!==!1&&(s=setTimeout(l,h)),n}}p(IS,"throttle");var jn=!1,PM=150,sy=class sy extends te{constructor(e,i,o=new Worker(URL.createObjectURL(new Blob([bS],{type:"text/javascript"})))){super();d(this,"worker");d(this,"debugContext");d(this,"debugCanvas");d(this,"collidersDirty",!0);d(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);d(this,"visibleCollidersQTree",new Kr(new ze(0,0,0,0)));d(this,"interactiveCollidersQTree",new Kr(new ze(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",p(()=>{jn=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",p(()=>{jn=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));d(this,"currentMsgId","");d(this,"working",!1);d(this,"_postMessage",p(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));d(this,"componentArray",[]);d(this,"update",p((e,i,o="bottom-left",n=!1)=>{let s=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let l of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(l);u&&(c=u.components[0],this.componentArray.push(c))}this.resize(e,i,o),this.collidersDirty=!1,s=!0}else s=this.componentArray.some(c=>c.collisionDirty===!0);s&&this.componentArray.sort((c,l)=>l.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let l=this.componentArray[c].toPackedMessage(n&&!s);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=l.bboxes,this.packedMessage[0][c][1]=l.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=l.rank===5?1:0,this.packedMessage[0][c][3]=l.x,this.packedMessage[0][c][4]=l.y,this.packedMessage[0][c][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=l.lockedToStrategyIndex}this.working||this.postMessage()},"update"));d(this,"resolve",p(e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,o=-1,n,s,c;jn&&(this.visibleCollidersQTree=new Kr(new ze(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Kr(new ze(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let u=this.componentArray[l];i[l]!=null&&(o=i[l][0],n=i[l][2],u.offscreen=i[l][1]===1,o!==-1&&n!=null?(c=new ze(n.x,n.y,n.w,n.h,{entityId:u.id}),jn&&this.visibleCollidersQTree.insert(c),s=this.coreState.geometry2DMap.get(u.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new ze(n.x,n.y,n.w,n.h,{entityId:u.id})),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),o!==-1&&o!==u.currentStrategyIndex&&(u.activeBoundingBox=c,u.onStrategySelected(o))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),o!==-1&&o!==u.currentStrategyIndex&&u.onStrategySelected(o)))}jn&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",p(()=>{jn&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));d(this,"destroy",p(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=o,this.worker.onmessage=n=>this.resolve(n),this.postMessage=IS(this._postMessage,PM,!1),jn?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,i,o){this.packedMessage[6]=o,this.packedMessage[5]=i,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};p(sy,"CollisionSystem");var Gd=sy;m();m();m();m();var cy=class cy{constructor(t){d(this,"type");d(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};p(cy,"Tap");var Vd=cy,py=class py{constructor(){d(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,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};p(py,"TapsController");var jd=py;m();function MS(r){let t=new Set;for(let e of r){let i=e.object;for(;i.parent&&!t.has(i.parent);)i=i.parent,i instanceof Pe&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}p(MS,"getUniqueIntersectedGroupContainers");function TS(r,t){if(r==null||t==null)return r===t;if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}p(TS,"arraysEqual");var Ms,uy=class uy extends te{constructor(e,i,o,n,s){super();d(this,"raycaster",new Nr);d(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});d(this,"coreState");d(this,"camera");d(this,"worldPlane");d(this,"_quadtree",new Kr(new ze(0,0,0,0)));d(this,"_container");d(this,"lastPointerEvent");d(this,"cursor","grab");d(this,"touchesCount",0);d(this,"isUserInteracting");d(this,"hasTouched",!1);I(this,Ms);d(this,"onPointerMoveRaf",p(e=>{this.lastPointerEvent=e,a(this,Ms)&&cancelAnimationFrame(a(this,Ms)),M(this,Ms,requestAnimationFrame(()=>{this.onPointerMove(e)}))},"onPointerMoveRaf"));d(this,"onPointerMove",p(e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()},"onPointerMove"));d(this,"tapsControl",new jd);d(this,"onPointerDown",p(e=>{e.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:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new Vd(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));d(this,"clickTimeout");d(this,"onPointerUp",p(e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,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(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));d(this,"dirty3D",!0);d(this,"cachedHitBoxes",{entities:[],groups:[]});d(this,"ndcPoint",new ee);d(this,"debugPanel");this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=e,this.coreState=i,this.worldPlane=n,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}getThreeDIntersectsFromXY(e){return this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(o=>{var n,s;return((n=o.object)==null?void 0:n.name)==="worldPlane"||((s=o.object)==null?void 0:s.visible)})}getGroupContainerIntersectsFromXY(e){this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0);let i=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(n=>n.object.visible),o;return i!=null&&i.length>0&&(o=MS(i)),o}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:o,entity2D:n,position:s,groupContainers:c}=this.intersect(i);(this.detect3DEntityHover(o)||this.detect2DEntityHover(n)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=n,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:s,groupContainers:c})),this.handleCursor()}handleCursor(){var s;let e=!!(this.state.hovered3DEntity&&((s=this.state.hovered3DEntity)!=null&&s.components[2])||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,n=wM(e,o,i);this.cursor!==n&&(this.cursor=n,n==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),(e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path"||(e==null?void 0:e.type)==="custom-geometry"?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var C,x,T,D,w;let i=[e.offsetX,e.offsetY],o=this._quadtree.queryPoint(i),[n]=o.filter(E=>E.intersectsPoint(i)),s=this.coreState.containerOffset[0],c=this.coreState.containerOffset[1];this.ndcPoint.x=(e.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-s)/this._container.clientHeight)*2+1;let l=this.getThreeDIntersectsFromXY(this.ndcPoint),u=(C=l[0])==null?void 0:C.point,h=[],g=[];for(let E of l.filter(k=>k.object.name!=="worldPlane"))E.object instanceof ne&&E.object.material.depthTest===!1?h.push(E):g.push(E);let y=(T=(x=h[0])!=null?x:g[0])!=null?T:void 0,v,b;if(y!=null){if(v=EM(y.object,this.coreState.geometry3DMap),!v){let E=(D=y==null?void 0:y.instanceId)!=null?D:y==null?void 0:y.batchId;v=E!=null&&(y!=null&&y.object.userData.entities)?this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entities[E]):this.coreState.geometry3DMap.get(y==null?void 0:y.object.userData.entityId)}v!=null&&v.components[2]&&(b=v)}let S=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((w=n==null?void 0:n.userData)==null?void 0:w.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(n==null?void 0:n.userData.entityId),entity3D:b,position:u,groupContainers:S}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&DS(this.state.lastHover,!1,this.coreState),e&&DS(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!TS(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.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 e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,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",i=>{var o,n,s;this.queueDebugMessage("CLICK \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var o,n,s;this.queueDebugMessage("HOVER \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var n;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=i,o.textContent=e,(n=this.debugPanel)==null||n.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};Ms=new WeakMap,p(uy,"InteractionSystem");var xc=uy;function DS(r,t,e){var s;let i=r.components[2];i&&i.hover!==!0&&(i.hover=t?"user-interaction":!1,i.dirty=!0);let o=(s=r.components[0].textMesh)==null?void 0:s.userData.entityId;if(!o)return;let n=e.geometry3DMap.get(o);(n==null?void 0:n.type)==="text3d"&&(n.components[1].hoverByPolygon=t,n.components[1].dirty=!0)}p(DS,"updateHover");function wM(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}p(wM,"processCursor");function DM(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof io)return;if(t.userData.isSingleModel)return t;t=t.parent}}p(DM,"findModelParent");function EM(r,t){let e=DM(r);return e?t.get(e.userData.entityId):void 0}p(EM,"findModelParentEntity");m();m();var Un,ei,Ud,Oo,ES,Pc,Hd,OS,LS,Mc,Wd,Tc,wc,Xd,dy=class dy{constructor(t){I(this,Oo);I(this,Un,null);I(this,ei);d(this,"getCurrentSceneGLTF",p(async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await R(this,Oo,ES).call(this),o=a(this,Ud).call(this,e),n=await i.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),s;if(n instanceof ArrayBuffer)s=new Blob([n],{type:"application/octet-stream"});else{let c=JSON.stringify(n,null,2);s=new Blob([c],{type:"text/plain"})}return s},"getCurrentSceneGLTF"));I(this,Ud,p(t=>{let{scale:e,light:i,onlyVisible:o}=t,n=new io,s=new dt().setFromObject(a(this,ei).entityScene);if(a(this,Pc).call(this,a(this,ei).entityScene,n,o),i){let c=new xu(16777215,.3*Math.PI);c.position.set(0,Math.max(s.max.x,s.max.y)*e*.5,s.max.y*e*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),n.add(c)}return n},"#getExportedScene"));I(this,Pc,p((t,e,i)=>{t.material&&(t instanceof vu?R(this,Oo,OS).call(this,t).forEach(o=>e.add(o)):t instanceof sf&&e.add(R(this,Oo,LS).call(this,t))),t.children.forEach(o=>{(!i||o.visible)&&a(this,Pc).call(this,o,e,i)})},"#processObject3D"));I(this,Hd,p((t,e,i)=>{let o=new hb({color:new et(t),metalness:0});return o.opacity=e,o.transparent=i,o},"#createStandardMaterial"));I(this,Mc,p(t=>{let{geometry:e,material:i,position:o,rotation:n,quaternion:s,scale:c}=t;if(!(e!=null&&e.isBufferGeometry))return t;let l=e.attributes.position,u=e.attributes.normal,h=e.attributes.uv;return a(this,Wd).call(this,l,u),a(this,wc).call(this,o,c,n,s),h&&a(this,Xd).call(this,h),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=sn),t},"#convertGeometry"));I(this,Wd,p((t,e)=>{let i=new q,o=new q;for(let n=0;n<t.count;n++)i.fromBufferAttribute(t,n),a(this,Tc).call(this,i),t.setXYZ(n,i.x,i.y,i.z),e&&(o.fromBufferAttribute(e,n),a(this,Tc).call(this,o),e.setXYZ(n,o.x,o.y,o.z))},"#convertAttributes"));I(this,Tc,p(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));I(this,wc,p((t,e,i,o)=>{let n=t.y;t.y=t.z,t.z=-n;let s=e.y;if(e.y=e.z,e.z=s,i instanceof Ta)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let c=o.y;o.set(o.x,o.z,-c,o.w)}},"#convertObjectProperties"));I(this,Xd,p(t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),o=t.getY(e);t.setXY(e,i,o)}},"#convertUVs"));M(this,ei,t),a(this,ei).entityScene=t.entityScene,a(this,ei).geometry3DMap=t.geometry3DMap}destroy(){M(this,Un,null)}};Un=new WeakMap,ei=new WeakMap,Ud=new WeakMap,Oo=new WeakSet,ES=p(async function(){if(!a(this,Un)){let{GLTFExporter:t}=await import("./GLTFExporter-QKYHLXBT.js");M(this,Un,new t)}return a(this,Un)},"#getGLTFExporter"),Pc=new WeakMap,Hd=new WeakMap,OS=p(function(t){var s,c;let e=[],o=((s=t.userData)!=null&&s.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(l=>a(this,ei).geometry3DMap.get(l)),n=new Map;return o.forEach(l=>{var v;if(!l||!(l instanceof Le))return;let u=l.components[1],h=l.components[2];if(!u.visible||u instanceof jr&&u.opacity===0||u instanceof El||u instanceof Ou)return;let g=h!=null&&h.hover?u.hoverColor||a(this,ei).hoverColor:u.color,y="".concat(g,"-").concat(u.opacity,"-").concat(Number(u.visible));n.has(y)||n.set(y,[]),(v=n.get(y))==null||v.push(l)}),n.forEach((l,u)=>{let[h,g,y]=u.split("-"),v=l.reduce((x,T)=>{if(T.type==="custom-geometry")return x;let D=T.components[0];return"geometry"in D&&D.geometry instanceof sb&&x.push(D.geometry),x},[]),b=a(this,Hd).call(this,h,Number(g),t.material.transparent),S=Ur(v,!0),C=new ne(S,b);C.position.copy(t.position),C.rotation.copy(t.rotation),C.scale.copy(t.scale),C.visible=!!y,a(this,wc).call(this,C.position,C.scale,C.rotation,C.quaternion),e.push(a(this,Mc).call(this,C))}),e},"#processBatchedMesh"),LS=p(function(t){let e=t.geometry.clone(),i=t.material,o=new vt({color:i.color,side:sn});o.opacity=i.opacity,o.transparent=i.transparent;let n=new sf(e,o);return n.position.copy(t.position),n.rotation.copy(t.rotation),n.scale.copy(t.scale),n.visible=t.visible,a(this,Mc).call(this,n)},"#processLineSegments"),Mc=new WeakMap,Wd=new WeakMap,Tc=new WeakMap,wc=new WeakMap,Xd=new WeakMap,p(dy,"ExporterSystem");var Ic=dy;m();m();m();var my=gu(jS());function US(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}p(US,"JSClipperError");US.prototype=Error.prototype;my.default.Error=function(r){throw new US(r)};var $e=my.default;var xw="gray",Iw=.1,Oc=100,gy=new $e.ClipperOffset;function Pw(r,t){gy.Clear(),t/=2;let e=r.map(o=>({X:o.x*Oc,Y:o.y*Oc}));gy.AddPath(e,$e.JoinType.jtMiter,$e.EndType.etClosedPolygon);let i=new $e.Paths;return gy.Execute(i,t*Oc),i.length?i.map(n=>n.map(s=>({x:s.X/Oc,y:s.Y/Oc}))):[r]}p(Pw,"offset");function Jd(r,t,e){var y,v,b,S,C;let{color:i=xw,opacity:o=1,altitude:n=0,height:s=Iw}=e||{};Array.isArray(o)&&(o=1);let c={min:{x:1/0,y:1/0,z:n},max:{x:-1/0,y:-1/0,z:s+n},center:{x:0,y:0,z:(s+n)/2}},u=r.geometry.coordinates[0].map(x=>{let T=t(x[1],x[0]);return c.min.x=Math.min(c.min.x,T.x),c.min.y=Math.min(c.min.y,T.y),c.max.x=Math.max(c.max.x,T.x),c.max.y=Math.max(c.max.y,T.y),T});((v=(y=r.properties)==null?void 0:y.style)==null?void 0:v.edgeOffset)!=null&&r.properties.style.edgeOffset!==0||((b=r.properties)==null?void 0:b.image)!=null?u=Pw(u,((C=(S=r.properties)==null?void 0:S.style)==null?void 0:C.edgeOffset)||0):u=[u];let h=[];for(let x of u){let T=new _r;T.moveTo(x[0].x,x[0].y),x.slice(1).forEach(k=>T.lineTo(k.x,k.y)),T.lineTo(x[0].x,x[0].y);let D=r.geometry.coordinates.slice(1);T.holes=D.map(k=>{let L=k.map(B=>t(B[1],B[0])),_=new no;return _.moveTo(L[0].x,L[0].y),L.slice(1).forEach(B=>_.lineTo(B.x,B.y)),_.lineTo(L[0].x,L[0].y),_});let w={bevelEnabled:!1,depth:s},E=new Rr(T,w);E.userData={style:{color:i,opacity:o}},h.push(E)}if(h.length===1)return h[0];let g=Ur(h);return g.userData={style:{color:i,opacity:o},_split:!0},g}p(Jd,"renderPolygonGeometry");m();var Mw="gray",Tw=.1;function Qd(r,t,e){let{color:i=Mw,opacity:o=1,altitude:n=0,height:s=Tw}=e||{};Array.isArray(o)&&(o=1);let c={min:{x:1/0,y:1/0,z:n},max:{x:-1/0,y:-1/0,z:s+n}},l={bevelEnabled:!1,depth:s},u=[];r.geometry.coordinates.forEach(g=>{let y=new _r,v=g[0].map(C=>{let x=t(C[1],C[0]);return c.min.x=Math.min(c.min.x,x.x),c.min.y=Math.min(c.min.y,x.y),c.max.x=Math.max(c.max.x,x.x),c.max.y=Math.max(c.max.y,x.y),x});y.moveTo(v[0].x,v[0].y),v.slice(1).forEach(C=>y.lineTo(C.x,C.y)),y.lineTo(v[0].x,v[0].y);let b=g.slice(1);y.holes=b.map(C=>{let x=C.map(D=>t(D[1],D[0])),T=new no;return T.moveTo(x[0].x,x[0].y),x.slice(1).forEach(D=>T.lineTo(D.x,D.y)),T.lineTo(x[0].x,x[0].y),T});let S=new Rr(y,l);u.push(S)});let h=Ur(u);return h.translate(0,0,n||0),h.userData={style:{color:i,opacity:o}},h}p(Qd,"renderMultiPolygonGeometry");m();var ww="gray",yy=new $e.ClipperOffset,Pt=100;function HS(r,t,e){let{color:i=ww,opacity:o=1,width:n=1,join:s="round",cap:c="round",height:l=.01,altitude:u=0}=e||{};Array.isArray(o)&&(o=0);let h=[];for(let S=0;S<r.geometry.coordinates.length-1;S++){let C=t(r.geometry.coordinates[S][1],r.geometry.coordinates[S][0]),x=t(r.geometry.coordinates[S+1][1],r.geometry.coordinates[S+1][0]);h.push([C,x])}yy.AddPaths(h.map(S=>S.map(C=>({X:C.x*Pt,Y:C.y*Pt}))),s==="round"?$e.JoinType.jsRound:s==="miter"?$e.JoinType.jsMiter:$e.JoinType.jsSquare,c==="round"?$e.EndType.etOpenRound:c==="butt"?$e.EndType.etOpenButt:$e.EndType.etOpenSquare);let g=new $e.PolyTree;yy.Execute(g,n/2*Pt);let y=[],v={bevelEnabled:!1,depth:l};for(let S of g.m_AllPolys){let C=new _r;if(S.IsHole())continue;let x=S.m_polygon;C.moveTo(x[0].X/Pt,x[0].Y/Pt),x.slice(1).forEach(T=>C.lineTo(T.X/Pt,T.Y/Pt)),C.lineTo(x[0].X/Pt,x[0].Y/Pt),C.holes=S.m_Childs.map(T=>{let D=new no,w=T.m_polygon;return D.moveTo(w[0].X/Pt,w[0].Y/Pt),w.slice(1).forEach(E=>D.lineTo(E.X/Pt,E.Y/Pt)),D.lineTo(w[0].X/Pt,w[0].Y/Pt),D}),y.push(new Rr(C,v))}let b=Ur(y);return b.translate(0,0,u||0),b.userData={style:{color:i,opacity:o}},yy.Clear(),b}p(HS,"renderLineStringGeometry");m();var Mt=100,Dw=.22,Ew=.01;function WS(r,t,e={}){let{width:i=Dw,height:o=Ew,color:n="gray",opacity:s=1,altitude:c=0}=e,l={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+o}},u={bevelEnabled:!1,depth:o},h=new $e.ClipperOffset,g=r.geometry.coordinates.map(S=>S.map(C=>t(C[1],C[0])));h.AddPaths(g.map(S=>S.map(C=>({X:C.x*Mt,Y:C.y*Mt}))),$e.JoinType.jsMiter,$e.EndType.etOpenRound);let y=new $e.PolyTree;h.Execute(y,i/2*Mt);let v=[];for(let S of y.m_AllPolys){let C=new _r;if(S.IsHole())continue;l.min.x=Math.min(l.min.x,S.m_polygon[0].X),l.min.y=Math.min(l.min.y,S.m_polygon[0].Y),l.max.x=Math.max(l.max.x,S.m_polygon[0].X),l.max.y=Math.max(l.max.y,S.m_polygon[0].Y);let x=S.m_polygon;C.moveTo(x[0].X/Mt,x[0].Y/Mt),x.slice(1).forEach(T=>C.lineTo(T.X/Mt,T.Y/Mt)),C.lineTo(x[0].X/Mt,x[0].Y/Mt),C.holes=S.m_Childs.map(T=>{let D=new no,w=T.m_polygon;return D.moveTo(w[0].X/Mt,w[0].Y/Mt),w.slice(1).forEach(E=>D.lineTo(E.X/Mt,E.Y/Mt)),D.lineTo(w[0].X/Mt,w[0].Y/Mt),D}),v.push(new Rr(C,u))}let b=Ur(v);return b.translate(0,0,c||0),b.userData={style:{color:n,opacity:s}},h.Clear(),b}p(WS,"renderMultiLineStringGeometry");m();m();var Ds=G.object({type:G.enum(["Point"]),coordinates:G.array(G.number()).min(2).max(3)});var Ow=G.object({rotation:G.array(G.number()).length(3).optional(),altitude:G.number().optional(),scale:G.array(G.number()).length(3).optional(),interactive:G.boolean().optional(),verticalOffset:G.number().optional(),id:G.union([G.number(),G.string()]).optional()}),Lw=G.object({type:G.enum(["Feature"]),geometry:Ds,properties:Ow}),Aw=G.object({type:G.enum(["FeatureCollection"]),features:G.array(Lw)}),Fw=G.object({color:G.string()}),kw=G.object({url:G.string(),color:G.string().optional(),opacity:G.number().optional(),material:G.record(G.string(),Fw).optional()});function YS(r,t,e){G.union([G.number(),G.string()]).parse(r),Aw.parse(t),kw.parse(e)}p(YS,"validateModelGroup");var Lc,Ac,by=class by{constructor(t){d(this,"mesh");d(this,"type","model");d(this,"positionDirty",!0);d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new et);d(this,"position",new q);I(this,Lc,0);I(this,Ac,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return a(this,Lc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,Lc,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(ae.degToRad(t[0]),ae.degToRad(t[1]),ae.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 a(this,Ac)}set opacity(t){var e,i,o;if(this.mesh){if(this.mesh.children[0]instanceof oo){for(let n of this.mesh.children)if(n instanceof oo){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let s=co(t,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=s,n.material.transparent=s<1,n.material.needsUpdate=!0}}else(o=this.mesh)==null||o.traverse(n=>{n instanceof ne&&n.material&&(Array.isArray(n.material)?n.material.forEach(s=>{XS(s,t)}):XS(n.material,t))});M(this,Ac,t)}}};Lc=new WeakMap,Ac=new WeakMap,p(by,"ModelComponent");var Fo=by;function XS(r,t){r.opacity!==t&&(t===1?(r.opacity=1,r.transparent=!1):(r.opacity=t,r.transparent=!0),r.needsUpdate=!0)}p(XS,"updateMaterialOpacity");m();function Kd(r){var c,l;let t=r.components[0],e=r.components[1];e.opacity!=null&&e.opacity!==t.opacity&&(t.opacity=e.opacity);let i=e.material,o=e.color;if(i||o){let u=Bw(o,i);(c=t.mesh)==null||c.traverse(h=>{h instanceof ne&&h.material&&(Array.isArray(h.material)?h.material.forEach(g=>{u[g.name]?g.color.set(u[g.name].color):g.color.set(o)}):u[h.material.name]?h.material.color.set(u[h.material.name].color):h.material.color.set(o))})}let n=(l=t.feature.geometry.coordinates[2])!=null?l:0,s=e.verticalOffset+n;t.altitude!==s&&(t.altitude=s),e.visible!==t.visible&&(t.visible=e.visible),e.rotation&&t.setRotation(e.rotation),e.scale&&t.setScale(e.scale)}p(Kd,"applyModelGeometryStyle");function Bw(r,t){let e={};if(r&&Object.assign(e,{Default:{color:r},Fabric:{color:r},Mpdn_Logo:{color:r},CouchLogo:{color:r}}),t)for(let i in t)t[i].color&&(e[i]?e[i].color=t[i].color:e[i]={color:t[i].color});return e}p(Bw,"consolidateColorAndMaterial");function ZS(r,t){var s,c;let e=r.components[0],o=(s=r.components[1].verticalOffset)!=null?s:0,n=e.feature.geometry.coordinates.slice();n[2]=((c=n[2])!=null?c:0)+o,e.mesh?e.mesh.position.copy(t(n)):e.position.copy(t(n))}p(ZS,"applyModelPosition");function _w(r){let{color:t,opacity:e,topColor:i,texture:o,topTexture:n}=r;return"".concat(t).concat(e).concat(i||"").concat(o||"").concat(n||"")}p(_w,"generateIndex");var Rw=1e4,vy=class vy extends te{constructor(e,i){super();d(this,"state");d(this,"convertTo3DMapPosition");d(this,"loader");d(this,"optimizePromise",[]);this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:e}=await import("./GLTFLoader-IIKQJ4CZ.js");return this.loader=new e,this.loader}createEntityFromFeature(e,i,o){var c,l;let n=new Ct(i),s=new Le(n,new jr({...o,url:(l=(c=i.properties)==null?void 0:c.image)==null?void 0:l.path}));return s.id=e,s}createModelFromFeature(e,i,o){let n=new Fo(i),s={...o};i.properties.verticalOffset!=null&&(s.verticalOffset=i.properties.verticalOffset),i.properties.rotation!=null&&(s.rotation=i.properties.rotation),i.properties.scale!=null&&(s.scale=i.properties.scale);let c=new Ou(s),l=new Le(n,c);return l.id=e,l}populateEntityMesh(e,i){let o=e.components[0];o.geometry=i,o.currentHeight=e.components[1].height,o.dirty=!1}async populateModelGroup(e,i,o){let n=new ln,s=new Ta,c=new nb,l=new q,u=new lo,h=await this.getGLTFLoader(),g=new Promise(y=>{h.load(i,v=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?v.scene.traverse(b=>{let S=b;if("isMesh"in S&&S.isMesh===!0){let C=new oo(S.geometry,S.material,e.size);C.userData={entities:{}},u.add(C),o.add(u)}}):(v.scene.traverse(b=>{"isMesh"in b&&b.isMesh===!0&&(b.position.set(0,0,0),b.rotation.set(0,0,0),b.scale.set(1,1,1),b.updateMatrix())}),u.add(v.scene),o.add(u),u.userData.isSingleModel=!0,u.userData.entityId=e.values().next().value,u.userData.type="model")),y()})});return this.optimizePromise.push(g.then(()=>{var b,S,C,x,T,D,w,E,k,L,_,B;let y=0,v;for(let V of e.values()){if(v=this.state.geometry3DMap.get(V),!v||(v==null?void 0:v.type)!=="model")continue;let j=v.components[0],Y=v.components[1],ie=v.components[0].feature;j.mesh=u,j.instanceIndex=y,Kd(v),v.components[1].dirty=!1;let{x:H,y:oe}=this.convertTo3DMapPosition(ie.geometry.coordinates[1],ie.geometry.coordinates[0],0);j.position.set(H,oe,j.altitude),s.set(ae.degToRad((S=(b=Y.rotation)==null?void 0:b[0])!=null?S:ka[0]),ae.degToRad((x=(C=Y.rotation)==null?void 0:C[1])!=null?x:ka[1]),ae.degToRad((D=(T=Y.rotation)==null?void 0:T[2])!=null?D:ka[2])),l.set((E=(w=Y.scale)==null?void 0:w[0])!=null?E:Fa[0],(L=(k=Y.scale)==null?void 0:k[1])!=null?L:Fa[1],(B=(_=Y.scale)==null?void 0:_[2])!=null?B:Fa[2]),c.setFromEuler(s),n.compose(j.position,c,l),u.children.forEach(z=>{!v||(v==null?void 0:v.type)!=="model"||!(z instanceof oo)||(z.setMatrixAt(y,n),z.userData.entities[y]=v.id)}),j.mesh.userData.isSingleModel&&(j.mesh.matrix.copy(n),j.mesh.matrix.decompose(j.mesh.position,j.mesh.quaternion,j.mesh.scale)),y++}this.publish("model-loaded")})),u}populateEntityGroup(e){var c;let i,o,n,s;for(let l of e.values())s=this.state.geometry3DMap.get(l),s.components[0]instanceof Ct&&(o=s.components[0].feature,n=s.components[1],o.geometry.type==="Polygon"?(i=Jd(o,this.convertTo3DMapPosition,n),(c=o.properties)!=null&&c.textures&&o.properties.textures.length>0&&bv(i,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(s,i)):o.geometry.type==="MultiPolygon"?(i=Qd(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="LineString"?(i=HS(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiLineString"&&(i=WS(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof fr||e instanceof Pe)){for(let s of e.children)this.optimize(s);if(e instanceof Pe||e.userData.dirty===!1)return;let o={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(s){A.warn(s)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let n=0;if(e.userData.dirty){let s=0,c;for(let l of e.userData.entities3D.values()){c=this.state.geometry3DMap.get(l);let u=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let h=c.components[1];s++,s>=Rw&&(s=0,n++);let g=_w(h)+n;o[g]===void 0&&(o[g]={style:h,entities:[]}),o[g].entities.push(c)}else u&&"mesh"in u&&u.mesh&&((i=u.mesh)==null?void 0:i.parent)!==e&&e.add(u.mesh)}for(let l in o){let u=gv(o[l].entities,o[l].style);e.add(u),e.userData.outlineDirty=!0,e.userData.dirty=!1}for(let l of e.userData.entities3D.values())if(c=this.state.geometry3DMap.get(l),c!=null&&c.entities2D.size>0)for(let u of c.entities2D.values())u&&(c.addEntity(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(vy,"MeshCreationAndOptimizationSystem");var eh=vy;m();var Cy=class Cy{constructor(t,e){d(this,"state");d(this,"dirty",!0);d(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let i=t.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let i=t.components[0];i instanceof so&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:t.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};p(Cy,"DOMVisibilitySystem");var th=Cy;m();var Sy=class Sy{constructor(t,e){d(this,"state");d(this,"project");this.state=t,this.project=e}update(){let t,e=0,i=0,o=!0,n,s;for(let c of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(c),t){let l=this.state.geometry3DMap.get(t.object3d.userData.parentEntityId);l instanceof Le&&(n=l.components[1],(n.dirty||t.components[0].parentDirty)&&(e=n.height,i=n.opacity,o=n.visible,s=t.components[0],(i===0||o===!1)&&s.visible===!0?t.components[0].visible=!1:s.visible===!1&&(t.components[0].visible=!0),t.setAltitude(e))),this.project(t.components[0].projection,t.position),t.components[0].parentDirty=!1}}};p(Sy,"TwoDProjectionSystem");var rh=Sy;m();m();var Nw=p(function(){let t,e;return i=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*i,t.height=500*i,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}},"createMeasureCanvasContext")(),zS=p(({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:o=2,lineHeight:n=1.2,options:s={strokeText:!0}})=>{let c="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=Nw(i);l.font=c;let u=[],h=r.split(" "),g=0,y=0,v=0;for(;y<h.length;){let x=h[y];if(g===o&&g>0){u[g-1]+="...";break}if(u[g]==null&&(u[g]=x,y++),h.length===1){u[g]=x;break}if(h[y]==null)break;let{width:T}=l.measureText(u[g]+" "+h[y]);T<=e*i?(u[g]+=" "+h[y],y++):g++}u.forEach(x=>{let{width:T}=l.measureText(x);v=Math.max(T,v)});let b=t*i*n,S=u.length*b;return{maxWidth:v,maxHeight:S,lines:u.length,draw:p((x,T,D)=>{u.length===1?(s.strokeText&&x.strokeText(u[0],T,D),x.fillText(u[0],T,D)):(s.strokeText&&(x.strokeText(u[0],T,D-b/2),x.strokeText(u[1],T,D+b/2)),x.fillText(u[0],T,D-b/2),x.fillText(u[1],T,D+b/2))},"draw")}},"shaveText");m();function qS(r){let t=new Image;return r&&(/<svg[\s\S]*>/i.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}p(qS,"createImage");var Gw=3.5,Vw=2.5,jw=2,Uw=5,Fc=2.5;var xy=class xy extends te{constructor(e,i,o){super();d(this,"dirty",!1);d(this,"state");d(this,"colliderContext");d(this,"colliderCanvas");d(this,"transformRequestFunc");d(this,"transformRequest",p(async e=>this.transformRequestFunc?await this.transformRequestFunc(e):{url:e},"transformRequest"));d(this,"pinCache",{});d(this,"imageCache",{});d(this,"imagePromiseCache",{});d(this,"imageDimensionsCache",{});d(this,"textCache",{});d(this,"update",p(e=>{let i=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let o,n,s,c,l,u,h;for(let g of this.state.geometry2DIdsInScene)if(h=this.state.geometry2DMap.get(g),h!=null&&(u=h.components[0],u instanceof ao&&!h.disposed)){if(l=u.appearance.marker.iconVisibleAtZoomLevel,u.appearance.marker.icon!=null&&l&&e>=l!==u.iconVisible&&(u.iconVisible=e>=l,u.dirty=!0),(u.dirty||this.dirty)&&u.calculateMarkerSize(),n=u.appearance.marker.foregroundColor,s=u.appearance.marker.backgroundColor,c=Da(u.markerSize,2),o="".concat(n.active,"-").concat(n.inactive,"-").concat(s.active,"-").concat(s.inactive,"-").concat(c,"-").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:y,width:v,height:b}=this.processText(u.text,u.appearance.text.size,u.appearance.text.maxWidth,u.appearance.text.numLines,u.appearance.text.lineHeight);["left","center","right"].forEach(C=>{this.textCache[u.id][C]=this.textToCanvas(y,u.appearance.text.size,C,v,b,u.appearance.text.foregroundColor,u.appearance.text.backgroundColor)}),u.dimensions={width:Math.ceil(v/i),height:Math.ceil(b/i)},u.currentStrategyIndex===-1&&(u.currentStrategyIndex=0);let S=u.strategies[u.currentStrategyIndex];if(S){S.onStrategySelected(u);let C=u.style;u.style=u.newStyle,u.newStyle=C}}u.canShow&&u.visible&&(u.enabled||u.visibilityNeedsUpdate!==!1)&&this.draw(u,o,this.colliderContext),u.dirty=!1}this.dirty=!1},"update"));d(this,"processText",p((e,i,o,n,s)=>{let c=this.state.pixelRatio,{draw:l,maxWidth:u,maxHeight:h}=zS({text:e,size:i,pixelRatio:c,maxWidth:o,maxLines:n,lineHeight:s});return{textDrawFn:l,width:u+Fc*c*2,height:h+Fc*c*2}},"processText"));d(this,"textToCanvas",p((e,i,o,n,s,c,l)=>{let u=this.state.pixelRatio,h,g=n,y=s;window.OffscreenCanvas!=null&&!Nb()?h=new OffscreenCanvas(g,y):(h=document.createElement("canvas"),h.width=g,h.height=y,h.style.width=g+"px",h.style.height=y+"px");let v=h.getContext("2d",{willReadFrequently:!0});if(!v)return;v.textAlign=o,v.font="bold ".concat(i*u,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),v.textBaseline="middle",v.lineJoin="miter",v.miterLimit=2,v.strokeStyle="white",v.lineWidth=Fc*u,v.fillStyle=c,v.strokeStyle=l;let b=o==="left"?0:o==="center"?g/2:g-Fc*u/2;return e(v,b,(y+Fc*u/2)/2),h},"textToCanvas"));d(this,"cacheImage",p(e=>{if(!e.appearance.marker.icon)return;let i=Hb(e.appearance.marker.icon);this.imagePromiseCache[i]||(this.imagePromiseCache[i]=new Promise(o=>{this.transformRequest(e.appearance.marker.icon).then(n=>{let s=qS(n.url);s.onload=()=>{this.imageCache[i]=s,this.publish("img:loaded"),o(s)}})})),e.imageHash!==i&&(e.imageHash=i,this.imagePromiseCache[i].then(()=>{e.dirty=!0}))},"cacheImage"));d(this,"createPinCanvas",p((e,i,o,n)=>{let s,c=this.state.pixelRatio,l=e.totalMarkerSize*2*c;window.OffscreenCanvas!=null?s=new OffscreenCanvas(l,l):(s=document.createElement("canvas"),s.width=l,s.height=l,s.style.width=l/c+"px",s.style.height=l/c+"px");let u=s.getContext("2d");return u.shadowColor="rgba(0,0,0,0.3)",u.shadowOffsetY=jw*c,u.shadowBlur=Uw*c,u.beginPath(),u.arc(l/2,l/2,i/2+Vw*c/2,0,2*Math.PI),u.fillStyle=o,u.fill(),u.beginPath(),u.arc(l/2,l/2,i/2,0,2*Math.PI),u.shadowColor="transparent",u.fillStyle=n,u.fill(),s},"createPinCanvas"));d(this,"prepare",p((e,i,o)=>{let n=this.state.pixelRatio;o.lineWidth=4*n;let s=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active),c=this.createPinCanvas(e,e.iconVisible?e.markerSize:Gw*n,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[i]=[s,c]},"prepare"));this.state=e,this.colliderCanvas=i,this.colliderContext=i.getContext("2d"),this.transformRequestFunc=o}draw(e,i,o){var u,h;if(!e.canShow||!e.visible)return;o.save(),o.globalAlpha=e.opacity;let n=this.state.pixelRatio,s=e.projection.x*n,c=e.projection.y*n,l=e.style.pinVisibility===1?this.pinCache[i][0]:this.pinCache[i][1];if(o.drawImage(l,s-e.totalMarkerSize*n,c-e.totalMarkerSize*n),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imageCache[e.imageHash]){let g=this.imageCache[e.imageHash],y=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*n,v=e.appearance.marker.iconFit,b=y,S=y,C="".concat(e.imageHash,"_").concat(v);if(this.imageDimensionsCache[C])b=this.imageDimensionsCache[C].width,S=this.imageDimensionsCache[C].height;else{let x=g.width*n,T=g.height*n;if(v==="contain"){let D=Math.sqrt(x**2+T**2),w=y/D;b=x*w,S=T*w}if(v==="cover"){let D=y/x,w=y/T,E=Math.max(D,w);b=x*E,S=T*E}}o.save(),o.beginPath(),o.arc(s,c,y/2,0,2*Math.PI),o.closePath(),((h=(u=e==null?void 0:e.appearance)==null?void 0:u.marker)==null?void 0:h.iconOverflow)!=="visible"&&o.clip(),o.drawImage(g,s-b/2,c-S/2,b,S),o.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left&&e.style.top&&o.drawImage(this.textCache[e.id][e.style.textAlign],s+e.style.left*n,c+e.style.top*n),o.restore()}};p(xy,"TwoDDrawSystem");var ih=xy;m();m();var ko=class ko{constructor(){d(this,"loader");this.loader=new wa}static getInstance(){return ko.instance||(ko.instance=new ko),ko.instance}getLoader(){return this.loader}load(t){return new Promise((e,i)=>{this.loader.load(t,e,void 0,i)})}};p(ko,"TextureLoaderSingleton"),d(ko,"instance");var Iy=ko,Bo=Iy.getInstance();function Ww(r,t){let e=r.components[2],i=r.components[1];return e!=null&&e.hover?[i.hoverColor||t,i.hoverColor||t]:[i.color,i.topColor||i.color]}p(Ww,"processColor");var Yn,kc,Py=class Py extends te{constructor(e,i){super();I(this,Yn);d(this,"state");d(this,"convertTo3DMapPosition");d(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=i,this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,o){var n;if(i.texture!==e.texture&&i.texture!==""&&R(this,Yn,kc).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&R(this,Yn,kc).call(this,i.topTexture,e,"topTexture"),(e.texture==null||e.topTexture==null)&&Array.isArray((n=e.feature.properties)==null?void 0:n.textures)&&e.feature.properties.textures.length>0)for(let s of e.feature.properties.textures)s.face==="top"&&e.topTexture!==s.path?R(this,Yn,kc).call(this,s.path,e,"topTexture"):s.face==="side"&&e.texture!==s.path&&R(this,Yn,kc).call(this,s.path,e,"texture"),e.blendTexture=!0;(e.texture!=null||e.topTexture!=null)&&(o!=null&&o.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var n,s,c,l,u,h,g,y;let e,i,o;for(let v of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(v),o instanceof fr&&o.type==="geometry-group"){let b=o.components[0];if(o.userData.shadingDirty){let S=o.userData.entities3D.values().next().value;if(S==null)continue;let C=this.state.geometry3DMap.get(S);C instanceof Le&&(C.type==="geometry"||C.type==="custom-geometry")&&(e=C.components[0],o.userData.shadingDirty&&b.shading&&this.setShading(e,b.shading));let x,T;for(let D of o.userData.entities3D.values())x=this.state.geometry3DMap.get(D),T=x.components[0],x.type==="geometry"&&T.detached&&o.userData.shadingDirty&&b.shading&&this.setShading(T,b.shading);o.userData.shadingDirty=!1}if(b.dirty){let S=Ob(o);S&&S.material instanceof pb&&(S.material.color.set(yv(b.color)),S.material.needsUpdate=!0);let C=o.getfirstChildEntityId();if(C){let T=this.state.geometry3DMap.get(C),D=T==null?void 0:T.components[0];D instanceof Ct&&this.processTextures(D,b)}let x=b.opacity*gf(o);o.getOpacity()!==x&&o.setOpacity(x),b.dirty=!1}}else if(o&&(o.type==="geometry"||o.type==="custom-geometry")&&((n=o.components[1])!=null&&n.dirty||(s=o.components[2])!=null&&s.dirty)){let b=o.components[0],S=o.components[1];i=o.components[2];let C=Ww(o,this.state.hoverColor);if(b.setColor(C[0],C[1]),S.visible!==b.visible&&(b.visible=S.visible,b instanceof Ct&&b.textMesh)){let T=this.state.geometry3DMap.get(b.textMesh.userData.entityId);(T==null?void 0:T.type)==="text3d"&&T.components[0].polygonEntityId!=null&&(T.components[0].visible=S.visible)}S.altitude!==b.altitude&&(b.altitude=S.altitude);let x=S.opacity*gf(o);x!==b.opacity&&(b.opacity=x),S.renderOrder!==b.renderOrder&&(b.renderOrder=S.renderOrder),S.dirty=!1,b instanceof Ct&&this.processTextures(b,S,i),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(Kd(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(ZS(o,this.convertTo3DMapPosition),o.components[0].positionDirty=!1);else if((o==null?void 0:o.type)==="image"&&((c=o.components[1])!=null&&c.dirty)){e=o.components[0];let b=o.components[1];b.visible!==e.visible&&(e.visible=b.visible),b.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((l=o.components[1])!=null&&l.dirty)&&o.components[0].polygonEntityId!=null){e=o.components[0];let b=o.components[1];b.visible!=null&&b.visible!==e.visible&&(e.visible=b.visible);let{textMesh:S}=e;if(S){Object.assign(S,b.getState());let C=(u=b.hoverColor)!=null?u:this.state.text3dHoverColor;S.color=b.hoverByPolygon?C:(h=b.color)!=null?h:Aa.color,S.outlineColor=b.hoverByPolygon?C:(g=b.outlineColor)!=null?g:Aa.outlineColor,S.strokeColor=b.hoverByPolygon?C:(y=b.strokeColor)!=null?y:Aa.strokeColor}b.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};Yn=new WeakSet,kc=p(async function(e,i,o){if(!(!e||!i.showTextures))if(this.textureLoadingCache.has(e)){o==="topTexture"?i.topTexture=await this.textureLoadingCache.get(e):i.texture=await this.textureLoadingCache.get(e),i.showTextures();return}else{let n=new Promise((s,c)=>{Bo.getLoader().load(e,l=>{o==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{A.error("Failed to load texture: ".concat(e)),c("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,n)}},"#loadTexture"),p(Py,"DrawSystem");var oh=Py;m();var My=class My extends te{constructor(e){super();d(this,"state");d(this,"animating",new Map);d(this,"isAnimating",!1);d(this,"startTime",-1);d(this,"showDuration",300);d(this,"hideDuration",250);d(this,"update",p(()=>{this.animating.clear();let e,i;for(let o of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i instanceof ao&&(i.visibilityNeedsUpdate==="show"?(i.canShow=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));d(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[o,n]]of this.animating.entries()){let s=n===1?this.showDuration:this.hideDuration,c=(e-this.startTime)/s;i.opacity=co(c,0,1,o,n,n===0?Wb:Xb),e-this.startTime>=s&&(n===1?i.canShow=!0:n===0&&(i.canShow=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};p(My,"TwoDVisibilitySystem");var nh=My;m();var Ty=class Ty extends te{constructor(e,i,o,n,s,c,l){super();d(this,"state");d(this,"renderer");d(this,"mode");d(this,"scene");d(this,"cameraObject");d(this,"viewCamera");d(this,"systems");d(this,"needs2DRecompute",!1);d(this,"twoDdirty",!0);d(this,"threeDdirty",!0);d(this,"frameId",null);d(this,"twoDFrameId",null);d(this,"animationFrameId",null);d(this,"nextFrame",null);d(this,"update",p((e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)==null)return Promise.resolve();if(e){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise(o=>{this.frameId=requestAnimationFrame(()=>{var n,s;return((n=this.renderer)==null?void 0:n.renderer)==null?o():this.mode==="standalone"?(s=this.commitRenderState())==null?void 0:s.then(()=>{this.paint(),o()}):o()})})},"update"));d(this,"animate2D",p(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));d(this,"drawEntities2D",p(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));d(this,"updateEntities2D",p(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));d(this,"commitRenderState",p(()=>{try{let e=[];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(),jb(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(),Vb(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 i=this.systems.meshOptimizationSystem.update();i&&e.push(i),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.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(e)}catch(e){A.error("Render failed: ",e)}},"commitRenderState"));this.renderer=e,this.state=i,this.mode=o,this.scene=n,this.cameraObject=s,this.viewCamera=c,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 e;(e=this.renderer)!=null&&e.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(Ty,"RenderSystem");var ah=Ty;m();var Xw=G.object({interactive:G.boolean().optional(),id:G.string().optional(),nearRadius:G.number().optional(),farRadius:G.number().optional(),accentColor:G.string().optional(),displayArrowsOnPath:G.boolean().optional(),animateArrowsOnPath:G.boolean().optional(),nearZoomLevel:G.number().optional(),farZoomLevel:G.number().optional()}),Yw=G.object({type:G.enum(["Feature"]),geometry:Ds,properties:G.object({parentId:G.any().optional()})});function $S(r,t){G.object({features:G.array(Yw)}).parse(r),Xw.parse(t)}p($S,"validatePath");var Bc,wy=class wy{constructor(t,e){d(this,"type","path");d(this,"mesh",new lo);d(this,"material");d(this,"geometry");d(this,"outline");d(this,"feature");d(this,"options");d(this,"nearRadius",.2);d(this,"farRadius",.4);d(this,"nearZoomLevel");d(this,"farZoomLevel");d(this,"nearZoomAltitude");d(this,"farZoomAltitude");d(this,"accentColor","blue");d(this,"completeFraction",1);d(this,"altitudeAdjustment",1);d(this,"displayArrowsOnPath",!1);d(this,"animateArrowsOnPath",!1);d(this,"isVertical",!1);d(this,"dirty",!0);d(this,"materialDirty",!0);d(this,"position",new q);I(this,Bc,0);var i,o,n,s,c;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(o=e==null?void 0:e.nearRadius)!=null?o:this.nearRadius,this.farRadius=(n=e==null?void 0:e.farRadius)!=null?n:this.farRadius,this.nearZoomLevel=e==null?void 0:e.nearZoomLevel,this.farZoomLevel=e==null?void 0:e.farZoomLevel,this.displayArrowsOnPath=(s=e==null?void 0:e.displayArrowsOnPath)!=null?s:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=e==null?void 0:e.animateArrowsOnPath)!=null?c: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 a(this,Bc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,Bc,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Bc=new WeakMap,p(wy,"PathComponent");var _o=wy;m();var Dy=class Dy{constructor(t){d(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Pe&&t.components[0]){let i=t.components[0];if(i.dirty){for(let o of t.children)(o instanceof fr||o instanceof Pe)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));i.dirty=!1}}}};p(Dy,"StackSystem");var sh=Dy;m();m();m();var Fe=Object.freeze({Linear:Object.freeze({None:p(function(r){return r},"None"),In:p(function(r){return r},"In"),Out:p(function(r){return r},"Out"),InOut:p(function(r){return r},"InOut")}),Quadratic:Object.freeze({In:p(function(r){return r*r},"In"),Out:p(function(r){return r*(2-r)},"Out"),InOut:p(function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},"InOut")}),Cubic:Object.freeze({In:p(function(r){return r*r*r},"In"),Out:p(function(r){return--r*r*r+1},"Out"),InOut:p(function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},"InOut")}),Quartic:Object.freeze({In:p(function(r){return r*r*r*r},"In"),Out:p(function(r){return 1- --r*r*r*r},"Out"),InOut:p(function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},"InOut")}),Quintic:Object.freeze({In:p(function(r){return r*r*r*r*r},"In"),Out:p(function(r){return--r*r*r*r*r+1},"Out"),InOut:p(function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},"InOut")}),Sinusoidal:Object.freeze({In:p(function(r){return 1-Math.sin((1-r)*Math.PI/2)},"In"),Out:p(function(r){return Math.sin(r*Math.PI/2)},"Out"),InOut:p(function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))},"InOut")}),Exponential:Object.freeze({In:p(function(r){return r===0?0:Math.pow(1024,r-1)},"In"),Out:p(function(r){return r===1?1:1-Math.pow(2,-10*r)},"Out"),InOut:p(function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},"InOut")}),Circular:Object.freeze({In:p(function(r){return 1-Math.sqrt(1-r*r)},"In"),Out:p(function(r){return Math.sqrt(1- --r*r)},"Out"),InOut:p(function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},"InOut")}),Elastic:Object.freeze({In:p(function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},"In"),Out:p(function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},"Out"),InOut:p(function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:p(function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},"In"),Out:p(function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},"Out"),InOut:p(function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},"InOut")}),Bounce:Object.freeze({In:p(function(r){return 1-Fe.Bounce.Out(1-r)},"In"),Out:p(function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},"Out"),InOut:p(function(r){return r<.5?Fe.Bounce.In(r*2)*.5:Fe.Bounce.Out(r*2-1)*.5+.5},"InOut")}),generatePow:p(function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:p(function(t){return Math.pow(t,r)},"In"),Out:p(function(t){return 1-Math.pow(1-t,r)},"Out"),InOut:p(function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5},"InOut")}},"generatePow")}),_c=p(function(){return performance.now()},"now"),Oy=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return p(r,"Group"),r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var o=0,n=e;o<n.length;o++){var s=n[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,o=t;i<o.length;i++){var n=o[i];n._group=void 0,delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=_c()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var n=this._tweens[i[o]],s=!e;n&&n.update(t,s)===!1&&!e&&this.remove(n)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),Es={Linear:p(function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=Es.Utils.Linear;return t<0?n(r[0],r[1],i):t>1?n(r[e],r[e-1],e-i):n(r[o],r[o+1>e?e:o+1],i-o)},"Linear"),Bezier:p(function(r,t){for(var e=0,i=r.length-1,o=Math.pow,n=Es.Utils.Bernstein,s=0;s<=i;s++)e+=o(1-t,i-s)*o(t,s)*r[s]*n(i,s);return e},"Bezier"),CatmullRom:p(function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=Es.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(o=Math.floor(i=e*(1+t))),n(r[(o-1+e)%e],r[o],r[(o+1)%e],r[(o+2)%e],i-o)):t<0?r[0]-(n(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(n(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):n(r[o?o-1:0],r[o],r[e<o+1?e:o+1],r[e<o+2?e:o+2],i-o)},"CatmullRom"),Utils:{Linear:p(function(r,t,e){return(t-r)*e+r},"Linear"),Bernstein:p(function(r,t){var e=Es.Utils.Factorial;return e(r)/e(t)/e(r-t)},"Bernstein"),Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:p(function(r,t,e,i,o){var n=(e-r)*.5,s=(i-t)*.5,c=o*o,l=o*c;return(2*t-2*e+n+s)*l+(-3*t+3*e-2*n-s)*c+n*o+t},"CatmullRom")}},JS=function(){function r(){}return p(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),Ey=new Oy,Gt=function(){function r(t,e){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=Fe.Linear.None,this._interpolationFunction=Es.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=JS.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=Ey,Ey.add(this))}return p(r,"Tween"),r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=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=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=_c()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}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||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var n in this._valuesEnd)o[n]=this._valuesEnd[n];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,o,n){for(var s in i){var c=t[s],l=Array.isArray(c),u=l?"array":typeof c,h=!l&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(h){var g=i[s];if(g.length===0)continue;for(var y=[c],v=0,b=g.length;v<b;v+=1){var S=this._handleRelativeValue(c,g[v]);if(isNaN(S)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(S)}h&&(i[s]=y)}if((u==="object"||l)&&c&&!h){e[s]=l?[]:{};var C=c;for(var x in C)e[s][x]=C[x];o[s]=l?[]:{};var g=i[s];if(!this._isDynamic){var T={};for(var x in g)T[x]=g[x];i[s]=g=T}this._setupProperties(C,e[s],g,o[s],n)}else(typeof e[s]>"u"||n)&&(e[s]=c),l||(e[s]*=1),h?o[s]=i[s].slice().reverse():o[s]=e[s]||0}}},r.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},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=_c()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=_c()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.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)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=Fe.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=Es.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,o;if(t===void 0&&(t=_c()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var n;if(!this._goToEnd&&!this._isPlaying)if(e)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,c=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*c,u=p(function(){if(i._duration===0||s>l)return 1;var S=Math.trunc(s/c),C=s-S*c,x=Math.min(C/i._duration,1);return x===0&&s===i._duration?1:x},"calculateElapsedPortion"),h=u(),g=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,g),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((s-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,b=this._chainedTweens.length;v<b;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,o){for(var n in i)if(e[n]!==void 0){var s=e[n]||0,c=i[n],l=Array.isArray(t[n]),u=Array.isArray(c),h=!l&&u;h?t[n]=this._interpolationFunction(c,o):typeof c=="object"&&c?this._updateProperties(t[n],s,c,o):(c=this._handleRelativeValue(s,c),typeof c=="number"&&(t[n]=s+(c-s)*o))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var cW=JS.nextId,ti=Ey,pW=ti.getAll.bind(ti),uW=ti.removeAll.bind(ti),dW=ti.add.bind(ti),hW=ti.remove.bind(ti),fW=ti.update.bind(ti);m();m();m();var QS=p((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),KS=p((r,t)=>new ee(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),Ly=p((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),Rc=p((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),Ay=p((r,t)=>new ee((r.x+t.x)/2,(r.y+t.y)/2),"average"),Fy=p(r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t},"getScrollDelta");var ky=class ky{constructor(t,e){d(this,"input1");d(this,"input2");d(this,"lastAngle");d(this,"lastDistance");d(this,"totalDistance");d(this,"first");d(this,"second");this.input1=t,this.input2=e,this.lastAngle=Ly(t,e),this.lastDistance=Rc(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=Rc(t,e);this.input1=t,this.input2=e;let o=Ly(t,e);this.lastAngle=o,this.lastDistance=i,this.totalDistance+=(Rc(this.first,t)+Rc(this.second,e))/2,this.first=Ay(this.first,t),this.second=Ay(this.second,e)}};p(ky,"InputSet");var lh=ky;m();var By=class By{constructor(t,e,i){d(this,"touch");d(this,"camera");d(this,"cameraPlane");d(this,"viewCoordinate");d(this,"snapHolderMatrix");d(this,"snapCamera");d(this,"cameraPosition");d(this,"raycaster");d(this,"worldCoordinate");d(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=i,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 Nr,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=e&&e.length>0?e[0].point:null,this.snapshotted=!0}updateAnchorState(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var i,o;let t=new ee(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(t,this.snapCamera);let e=(o=this.raycaster)==null?void 0:o.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};p(By,"TouchAnchor");var Nc=By;var cr={};q0(cr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>zw,CLIPPING_RADIUS:()=>Gc,CONTROL_OPTIONS:()=>Zw,DEFAULT_ANIMATION_DURATION:()=>Vy,DEFAULT_BEARING:()=>Kw,DEFAULT_MAX_ZOOM_LEVEL:()=>Jw,DEFAULT_MIN_ZOOM_LEVEL:()=>jy,DEFAULT_PITCH:()=>Qw,DEFAULT_ZOOM_LEVEL:()=>$w,EVENTS:()=>dh,MAPLIBRE_TILE_SIZE:()=>ch,MAX_LAT:()=>Ry,MAX_MERCATOR_ZOOM_LEVEL:()=>uh,MIN_LAT:()=>_y,MIN_MERCATOR_ZOOM_LEVEL:()=>ph,ROOM_MERCATOR_ZOOM_LEVEL:()=>qw,TWO_PI:()=>Ny,WHEEL_ZOOM_MULTIPLIER:()=>Gy,ZRANGE:()=>Os});m();var ch=512,_y=-85.051129,Ry=85.051129,Gc=1e4,Zw={chain:"chain",cancel:"cancel"},Ny=Math.PI*2,Os=100,Gy=1e4,ph=0,uh=24,zw=17,qw=20,Vy=200,dh=["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"],$w=18,jy=12,Jw=22,Qw=0,Kw=0;var hh=!1,eD=!1;var fh,mh=class mh extends te{constructor(e,i,o,n,s){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);d(this,"rotationDirty",!1);d(this,"panDirty",!1);I(this,fh,jy);d(this,"zoomSpeed",5);d(this,"rotateSpeed",100);d(this,"enabled",!0);d(this,"enableZoom",!0);d(this,"enablePan",!0);d(this,"enablePedestal",!1);d(this,"maxPedestal",1/0);d(this,"minPedestal",0);d(this,"enableRotate",!0);d(this,"minZoomAltitude",0);d(this,"maxZoomAltitude",1/0);d(this,"ignoreZoomLimits",!1);d(this,"zoomFactor",1);d(this,"panBounds",{min:new q(1/0,1/0),max:new q(-1/0,-1/0),center:new q(0,0,0),radius:1/0});d(this,"minTilt",0);d(this,"maxTilt",1.2);d(this,"MOUSE_BUTTONS",{ORBIT:yu.RIGHT,ZOOM:yu.MIDDLE,PAN:yu.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new Nr);d(this,"rendererState");d(this,"options");d(this,"state",-1);d(this,"intersection");d(this,"viewState",null);d(this,"tweens",new Map);d(this,"clock",new mb(!0));d(this,"coords",{mouse:new ee,rotateStart:new ee,rotateEnd:new ee,rotateDelta:new ee,panStart:new q,panCameraStart:new q,panEnd:new q,panDelta:new q,initialShiftPos:new ee,initialPedestal:0,floorAnchor:new q});d(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});d(this,"scrollTimer",null);d(this,"lastWheelTime",0);d(this,"resetZoom",!1);d(this,"zoomStart");d(this,"pedestalScaleFactor",1);d(this,"isUserZooming",!1);d(this,"stayInsideBounds",!0);d(this,"userInteracting",!1);d(this,"cameraMoving",!1);d(this,"lastCameraMoveTime",Date.now());d(this,"raycastToFloor",p(e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new q},"raycastToFloor"));d(this,"isUserInteracting",p(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",p(()=>new q(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));d(this,"getPedestal",p(()=>this.orbit.position.z,"getPedestal"));d(this,"pan",p((e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));d(this,"postRender",p(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));d(this,"isCameraMoving",p(()=>this.cameraMoving,"isCameraMoving"));d(this,"lastCameraStoppedMovingTime",p(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));d(this,"setPosition",p((e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));d(this,"updateCameraPosition",p((e,i)=>{let o=e-this.panBounds.center.x,n=i-this.panBounds.center.y,s=Math.sqrt(o*o+n*n);if(this.stayInsideBounds&&s>this.panBounds.radius){let c=Math.atan2(n,o),l={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=e,this.orbit.position.y=i},"updateCameraPosition"));d(this,"tilt",p(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));d(this,"zoomIn",p((e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n/1.5},e,i,o)},"zoomIn"));d(this,"zoomOut",p((e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n*1.5},e,i,o)},"zoomOut"));d(this,"getRotation",p(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));d(this,"cancelAnimation",p(()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));d(this,"animateCamera",p((e,i,o,n,s,c)=>{let l={interruptible:!0,...c},u={},h={},g=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(u.x=g.x,h.x=e.position.x),e.position.y!==void 0&&(u.y=g.y,h.y=e.position.y),e.position.z!==void 0&&(u.z=g.z,h.z=e.position.z)),e.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?h.zoom=e.zoom:h.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:D,end:w}=Mu(this.getRotation(),e.rotation);u.rotation=D,h.rotation=w}e.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.tilt=e.tilt:h.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let y=u.zoom!==h.zoom,v=u.rotation!==h.rotation,b=u.tilt!==h.tilt,S=new Gt(u).to(h,P.env.TESTING?0:i).onUpdate(D=>{this.setMulti({x:D.x,y:D.y,z:D.z},D.zoom,D.rotation,D.tilt)}).onComplete(()=>{this.completeTween(S),this.publish("multi-end",{zooming:y,rotating:v,tilting:b}),n&&n()}).onStart(()=>{this.state!==7&&(this.state=7,S.state=7,this.publish("multi-start",{zooming:y,rotating:v,tilting:b})),this.publish("change")});this.rendererState.tweenGroup.add(S);let C=Array.from(this.tweens.entries()),x=C[C.length-1],T=!1;return x!=null&&(x[1].interruptible?(typeof x[1].cancelledCallback=="function"&&x[1].cancelledCallback(),this.completeTween(x[0])):(T=!0,x[0].chain(S))),this.tweens.set(S,{cancelledCallback:s,interruptible:l.interruptible}),o?S.easing(o):S.easing(Fe.Quadratic.In),!e.doNotAutoStart&&!T&&(S.start(),this.publish("change")),S.cameraAnimation=!0,S},"animateCamera"));d(this,"setMulti",p((e,i,o,n,s=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),c=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),c=!0)),c&&this.publish("position-updated");let l={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let u=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;u!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Gc&&(this.camera.near=i-Gc,this.camera.far=i+Gc):(this.camera.near=i/Os,this.camera.far=i*Os),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(l.rotating=!0,this.orbit.rotation.z=-o,this.publish("rotation-updated")),n!==void 0&&!isNaN(n)){let u=this.stayInsideBounds?Math.max(Math.min(n,this.maxTilt),this.minTilt):n;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)},"setMulti"));d(this,"getZoomScaledMin",p(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));d(this,"getZoomScaledMax",p(()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)},"getZoomScaledMax"));d(this,"setRotation",p((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=-(e%Ny);o!==this.orbit.rotation.z&&(this.orbit.rotation.z=o,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));d(this,"setZoomAltitude",p(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(e,this.getZoomScaledMin()),this.getZoomScaledMax()):e;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/Os,this.camera.far=i*Os,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));d(this,"setZoomLevel",p(e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))},"setZoomLevel"));d(this,"getZoomAltitude",p(()=>this.camera.position.z,"getZoomAltitude"));d(this,"getZoomLevel",p(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));d(this,"setTilt",p((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));d(this,"getTilt",p(()=>this.elevation.rotation.x,"getTilt"));d(this,"setCameraPlaneElevation",p(e=>{this.cameraPlane.position.z=e},"setCameraPlaneElevation"));d(this,"zoom",p(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));d(this,"getProjectionScaleFactor",p((e,i,o)=>mf(e,i,o),"getProjectionScaleFactor"));d(this,"update",p(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));d(this,"setPedestal",p((e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)},"setPedestal"));d(this,"dispose",p(()=>{for(let e of dh)e.endsWith("start")?(this.off(e,this.setCameraMoving),e.startsWith("user")&&this.off(e,this.setUserInteracting)):(e.endsWith("end")||e.endsWith("cancel"))&&(this.off(e,this.unsetCameraMoving),e.startsWith("user")&&this.off(e,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));d(this,"createCameraPlane",p(()=>{let e=hh?2e3:1e10,i=hh?100:1,o=new gi(e,e,i,i),n=new vt({color:0,wireframe:hh,visible:hh}),s=new ne(o,n);return this.scene.add(s),s},"createCameraPlane"));d(this,"addEventListeners",p(()=>{let{domElement:e}=this.renderer;for(let i of dh)i.endsWith("start")?(this.on(i,this.setCameraMoving),i.startsWith("user")&&this.on(i,this.setUserInteracting)):(i.endsWith("end")||i.endsWith("cancel"))&&(this.on(i,this.unsetCameraMoving),i.startsWith("user")&&this.on(i,this.unsetUserInteracting));e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));d(this,"addMouseEventListeners",p(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));d(this,"addMouseMoveEventListeners",p(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));d(this,"removeMouseMoveEventListeners",p(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));d(this,"removeEventListeners",p(()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));d(this,"removeMouseUpEventListeners",p(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));d(this,"onContextMenu",p(e=>{e.preventDefault()},"onContextMenu"));d(this,"onMouseUp",p(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}},"onMouseUp"));d(this,"onMouseMove",p(e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}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(e)},"onMouseMove"));d(this,"onTouchStart",p(e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new lh(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));d(this,"onTouchMove",p(e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let i={...this.touch.inputs.first},o={...this.touch.inputs.second},n=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(e);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=i.y<n.y&&o.y<s.y,l=i.y>n.y&&o.y>s.y;this.enableRotate&&this.state!==4&&(l||c)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}},"onTouchMove"));d(this,"onTouchEnd",p(e=>{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}e.touches.length?this.onTouchStart(e):this.state=-1}},"onTouchEnd"));d(this,"handleTouchMovePan",p(e=>{let i=Object.hasOwn(e,"x")?new ee(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panEnd.set(o.x,o.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleTouchMovePan"));d(this,"handleTouchStartDolly",p(()=>{let e=this.touch.touches[0].x-this.touch.touches[1].x,i=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let o=new ee(this.touch.touches[0].x-e/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(o),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Nc(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Nc(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));d(this,"handleMouseMovePan",p(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));d(this,"handleTouchStartTilt",p(e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));d(this,"handleTouchMovePedestal",p(e=>{this.handleMouseMovePedestal(e.touches[0])},"handleTouchMovePedestal"));d(this,"handleTouchMoveTilt",p(e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));d(this,"handleTouchMoveDolly",p(()=>{let e=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let o=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);o&&this.setCameraFromTransformMatrix(o),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));d(this,"handleTouchEnd",p(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));d(this,"handleTouchStartPan",p(e=>{let i=Object.hasOwn(e,"x")?new ee(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panStart.set(o.x,o.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));d(this,"handleTouchStartPedestal",p(e=>{this.handleMouseDownPedestal(e.touches[0])},"handleTouchStartPedestal"));d(this,"onMouseDown",p(e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));d(this,"onMouseWheel",p(e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(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(e))},"onMouseWheel"));d(this,"handleMouseWheel",p(e=>{if(this.publish("zoom-start"),!this.canScrollZoom(e)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),o=i-Fy(e)*i/Gy*this.zoomSpeed;if(this.setZoomAltitude(o),this.enablePan){let n=o/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-n),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));d(this,"setCameraFromTransformMatrix",p(e=>{this.orbit.updateMatrixWorld();let i=new Ta;i.setFromRotationMatrix(e,"ZYX");let o=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),n=i.z,s=new q(0,0,1);s.applyEuler(i),s.setLength(o);let c=new q;c.setFromMatrixPosition(e),c.sub(s),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-n)},"setCameraFromTransformMatrix"));d(this,"makeTransformFromTouchAnchors",p((e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),n=e.worldCoordinate,s=i.worldCoordinate,c=e.reUnproject(),l=i.reUnproject();if(!c||!l||!n||!s)return null;let u=e.viewCoordinate,h=i.viewCoordinate,g=s.x-n.x,y=s.y-n.y,v=Math.atan2(y,g),b=l.x-c.x,S=l.y-c.y,C=Math.atan2(S,b),x=QS(v,C),T=new ln;T.makeRotationZ(-x);let D=T.clone();D.multiply(e.snapHolderMatrix);let w=p((z7,q7,$7)=>z7.elements[(q7-1)*4+$7-1],"m"),E=w(o,1,1)*w(D,1,1)-u.x*w(o,3,4)*w(D,3,1),k=w(o,1,1)*w(D,1,2)-u.x*w(o,3,4)*w(D,3,2),L=w(o,1,1)*w(D,1,3)-u.x*w(o,3,4)*w(D,3,3),_=n.x*E+n.y*k+n.z*L,B=w(o,2,2)*w(D,2,1)-u.y*w(o,3,4)*w(D,3,1),V=w(o,2,2)*w(D,2,2)-u.y*w(o,3,4)*w(D,3,2),j=w(o,2,2)*w(D,2,3)-u.y*w(o,3,4)*w(D,3,3),Y=n.x*B+n.y*V+n.z*j,ie=w(o,1,1)*w(D,1,1)-h.x*w(o,3,4)*w(D,3,1),H=w(o,1,1)*w(D,1,2)-h.x*w(o,3,4)*w(D,3,2),oe=w(o,1,1)*w(D,1,3)-h.x*w(o,3,4)*w(D,3,3),z=s.x*ie+s.y*H+s.z*oe,De=w(o,2,2)*w(D,2,1)-h.y*w(o,3,4)*w(D,3,1),de=w(o,2,2)*w(D,2,2)-h.y*w(o,3,4)*w(D,3,2),ye=w(o,2,2)*w(D,2,3)-h.y*w(o,3,4)*w(D,3,3),Ie=s.x*De+s.y*de+s.z*ye,dr=Math.abs(ie-E),Ft=Math.abs(H-k),pt=Math.abs(oe-L),ot=Math.abs(ie-B),fi=Math.abs(H-V),to=Math.abs(oe-j),se=Math.abs(De-E),he=Math.abs(de-k),Ue=Math.abs(ye-L),ut=Math.abs(De-B),hr=Math.abs(de-V),ro=Math.abs(ye-j),an=Math.min(dr+Ft+pt,ot+fi+to),Ma=Math.min(se+he+Ue,ut+hr+ro);an<Ma&&(ie=De,H=de,oe=ye,z=Ie);let Jt=B*L-E*j,xl=V*L-k*j,W0=Y*L-_*j,rf=ie*j-B*oe,of=H*j-V*oe,X0=z*j-Y*oe,H7=(X0*xl-W0*of)/(rf*xl-Jt*of),W7=(X0*Jt-W0*rf)/(of*Jt-xl*rf),Y0=V*E-k*B,X7=j*E-L*B,Y7=Y*E-_*B,Z0=H*B-V*ie,Z7=oe*B-j*ie,z0=((z*B-Y*ie)*Y0-Y7*Z0)/(Z7*Y0-X7*Z0),mu=D.clone();return mu.elements[12]=H7,mu.elements[13]=W7,mu.elements[14]=z0,z0>0?mu:null},"makeTransformFromTouchAnchors"));d(this,"updateTouchOrigin",p(()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top},"updateTouchOrigin"));d(this,"touchToScene",p(e=>{this.touch.touches=[];for(let i=0,o=e.touches.length;i<o;i++){let n=e.touches[i],s=KS(n,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]},"touchToScene"));d(this,"canScrollZoom",p(e=>{let i=Fy(e),o=this.getZoomAltitude();return!(i<0&&o===this.getZoomScaledMax()||i>0&&o===this.getZoomScaledMin())},"canScrollZoom"));d(this,"mouseToScene",p(e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));d(this,"getMousePos",p(e=>({x:e.offsetX,y:e.offsetY}),"getMousePos"));d(this,"handleMouseDownRotate",p(e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));d(this,"handleMouseDownPan",p(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));d(this,"handleMouseDownPedestal",p(e=>{let i=new ee(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=mf(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));d(this,"handleMouseMovePedestal",p(e=>{let i={x:e.clientX,y:e.clientY},o=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(o<this.minPedestal?o=Math.max(o,this.minPedestal):o>this.maxPedestal&&(o=Math.min(o,this.maxPedestal))),o!==this.getPedestal()&&this.setPedestal(o,!0)},"handleMouseMovePedestal"));d(this,"handleMouseMoveRotate",p(e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));d(this,"publishUserZoomDebounced",La(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));d(this,"publishUserZoomEvent",p(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));d(this,"setCameraMoving",p(()=>{this.cameraMoving=!0},"setCameraMoving"));d(this,"unsetCameraMoving",p(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));d(this,"setUserInteracting",p(()=>{this.userInteracting=!0},"setUserInteracting"));d(this,"unsetUserInteracting",p(()=>{this.userInteracting=!1},"unsetUserInteracting"));d(this,"publishPedestalChangeEvent",p(e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));d(this,"convertAltitudeToZoomLevel",p(e=>{let[,i]=this.center,n=e*2*Math.tan(ae.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(ae.degToRad(i))*2*Math.PI*nf/n;return ae.clamp(Math.log2(s/512),ph,uh)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",p(e=>{let[,i]=this.center,o=ae.clamp(e,ph,uh),n=Math.pow(2,o),s=ae.clamp(i,_y,Ry),c=n*512;return Math.cos(ae.degToRad(s))*Math.PI*2*nf/c*this.options.canvasHeight/2/Math.tan(ae.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));d(this,"completeTween",p(e=>{e.isPlaying()&&e.stop(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)},"completeTween"));d(this,"debugContainer",new cn);this.camera=e,this.renderer=o,this.rendererState=n,this.scene=i,this.options=s,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,s.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return a(this,fh)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,i),o=Math.max(o,e),(o-e)/(i-e)*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 n,s,c,l;let e=this.getPosition(),{lat:i,lon:o}=wu((s=(n=this.rendererState.center)==null?void 0:n[1])!=null?s:0,(l=(c=this.rendererState.center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[o,i]}setCenter(e,i){var s,c,l,u;let{x:o,y:n}=Du((c=(s=this.rendererState.center)==null?void 0:s[1])!=null?c:0,(u=(l=this.rendererState.center)==null?void 0:l[0])!=null?u:0,i,e);this.setPosition(o,n)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}getCameraFrameForCoordinates(e,i){let o=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,n=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,s=this.options.canvasWidth,c=this.options.canvasHeight,l=this.getRotation(),u=this.getTilt(),h=this.getPosition();this.setRotation(i.rotation||l,!0),this.setTilt(i.tilt||u,!0);let g=ex(e,{canvasWidth:s,canvasHeight:c,paddingOption:i.padding,verticalPadding:i.verticalPadding,minZoom:o,maxZoom:n,position:h,camera:this.camera,orbit:this.orbit});return this.setRotation(l,!0),this.setTilt(u,!0),{center:g.position,zoomLevel:this.convertAltitudeToZoomLevel(g.zoom)}}focusOn(e,i){if(eD){this.debugContainer&&Ne(this.debugContainer);let C=new mi(4,4,4),x=new vt({color:65280,depthTest:!1}),T=new oo(C,x,e.length),D=new ln;e.forEach((w,E)=>{D.setPosition(w),T.setMatrixAt(E,D)}),T.instanceMatrix.needsUpdate=!0,this.debugContainer.add(T),this.scene.add(this.debugContainer)}let o=i.curve,n=i.callback,s=i.cancelledCallback,c=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,l=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,h=this.options.canvasHeight,g;i.duration!==void 0?g=i.duration:P.env.TESTING==="true"?g=0:g=Vy;let y=i.padding,v=this.getRotation(),b=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let S=ex(e,{canvasHeight:h,paddingOption:y,canvasWidth:u,minZoom:c,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:i.verticalPadding});this.setRotation(v),this.setTilt(b),this.animateCamera({position:S.position,tilt:i.tilt,rotation:i.rotation,zoom:S.zoom},g,o,n,s,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};fh=new WeakMap,p(mh,"CameraSystem"),d(mh,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Ls=mh;function ex(r,{canvasWidth:t,orbit:e,paddingOption:i,verticalPadding:o=0,canvasHeight:n,minZoom:s,maxZoom:c,camera:l,position:u}){let h={zoom:s,position:u};if(r.length===0)return h;for(let Jt of Ls.CAMERA_FRAME_PADDING_SIDES)typeof i[Jt]!="number"&&(i[Jt]=0);let g=i.type==="portion"?{top:i.top*n,bottom:i.bottom*n,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(g.left+g.right>=t||g.top+g.bottom>=n)return h;e.updateMatrixWorld();let y=l.matrixWorldInverse,v=l.fov*(Math.PI/180)/2,b=v,C=Math.atan(Math.tan(v)*(t/n)),x=new q(1/0,1/0,1/0),T=new q(-1/0,-1/0,-1/0),D=new dt,w=new q;for(let Jt=0,xl=r.length;Jt<xl;Jt++)w.copy(r[Jt]),D.expandByPoint(w),w.applyMatrix4(y),x.min(w),T.max(w),w.copy(r[Jt]),w.z-=o,w.applyMatrix4(y),x.min(w),T.max(w),w.copy(r[Jt]),w.z+=o,w.applyMatrix4(y),x.min(w),T.max(w);let E=T.x-x.x,k=T.y-x.y,L=t-g.left-g.right,_=n-g.top-g.bottom,B=(T.x+x.x)/2,V=(T.y+x.y)/2,j=E/L,Y=k/_,ie=s,H=c,oe=ie*Math.tan(C)*2,z=H*Math.tan(C)*2,De=oe/t,de=z/t,ye=Math.max(j,Y);ye=ae.clamp(ye,De,de);let Ie=L*ye,dr=_*ye,Ft={min:{x:B-Ie/2-g.left*ye,y:V-dr/2-g.bottom*ye},max:{x:B+Ie/2+g.right*ye,y:V+dr/2+g.top*ye}},pt=(Ft.min.x+Ft.max.x)/2,ot=(Ft.min.y+Ft.max.y)/2,fi=D.getCenter(new q),to=Math.abs(pt-Ft.min.x),se=Math.abs(ot-Ft.min.y),he=to/Math.tan(C),Ue=se/Math.tan(b),ut=new q;ut.set(pt,ot,T.z+Math.max(he,Ue)),ut.applyMatrix4(l.matrixWorld);let hr=new q;hr.set(pt,ot,T.z),hr.applyMatrix4(l.matrixWorld);let ro=new q().subVectors(hr,ut),an=(fi.z-ut.z)/ro.z,Ma=new q().copy(ut).add(ro.clone().multiplyScalar(an));return hr.set(Ma.x,Ma.y,Ma.z),ut.sub(hr),{position:Ma,zoom:ut.length()}}p(ex,"getCameraFrameForPoints");m();var tD=300,Vc,jc,Uy=class Uy{constructor(t){d(this,"state");I(this,Vc,new q);I(this,jc,new q);this.state=t}update(t){var o;let e,i;this.state.cameraObject.getWorldPosition(a(this,jc));for(let n of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if(i.visibilityNeedsUpdate!==!1&&(i.visibilityNeedsUpdate==="show"?i.canShow=!0:i.canShow=!1),(i.canShow&&i.visible===!0||((o=i.animation)==null?void 0:o.pending)===!0)&&!i.offscreen)if(i.options.zIndex!=null)i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.options.zIndex,"px)");else{e.object3d.getWorldPosition(a(this,Vc));let s=a(this,jc).distanceTo(a(this,Vc));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-s,"px)")}if(i.canShow===!0&&i.visible===!0?i.containerEl.style.pointerEvents=t?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.currentStrategyIndex===-1&&i.visible&&i.visibilityNeedsUpdate==="show")continue;i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.visibilityNeedsUpdate==="show"&&(i.containerEl.style.opacity="0"),i.animation&&i.animation.cancel(),i.animation=i.containerEl.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:tD,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};Vc=new WeakMap,jc=new WeakMap,p(Uy,"DOMDrawSystem");var gh=Uy;m();var Hy=class Hy{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};p(Hy,"StackComponent");var yh=Hy;m();var Wy=class Wy extends te{constructor(e,i){super();d(this,"state");d(this,"dirty",!0);d(this,"domTree");d(this,"observers",new Map);d(this,"updateDimensions",p(e=>{e.forEach(i=>{let o=i.target,n=o.getAttribute("data-marker-id");if(n){let s=this.state.geometry2DMap.get(n);s&&s.components[0]instanceof so&&o.firstElementChild&&(s.components[0].updateDimensions(),s.components[0].collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=e,this.domTree=i}setupObserver(){var i;if(this.observers){for(let o of this.observers.values())o.disconnect();this.observers.clear()}let e;for(let o of this.domTree.children){let n=o.getAttribute("data-marker-id");if(n!=null&&(e=this.state.geometry2DMap.get(n),(i=e.components[0].options)!=null&&i.dynamicResize)){let s=new ResizeObserver(this.updateDimensions);s.observe(o),this.observers.set(o.userData.entityId,s)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};p(Wy,"DOMResizeSystem");var bh=Wy;m();var rD=0,iD=90,oD=(P.env.NODE_ENV==="test",!1);function _i(r,t,e,i){return(r<t||r>e)&&A.warn(i),Math.min(e,Math.max(t,r))}p(_i,"clampWithWarning");var As={linear:Fe.Linear.None,"ease-in":Fe.Quadratic.In,"ease-out":Fe.Quadratic.Out,"ease-in-out":Fe.Quadratic.InOut},nD=-50,X,K,Ro,Uc,Hc,Yy,Zy=class Zy{constructor(t,e,i){I(this,Hc);I(this,X);I(this,K);I(this,Ro);I(this,Uc);M(this,X,t),M(this,K,e),M(this,Ro,i),a(this,K).cameraSystem.on("pedestal-change",({pedestal:o})=>{a(this,X).map&&(a(this,X).map.transform.elevation=o,a(this,X).map.transform.minElevationForCurrentTile=nD,a(this,X).map.triggerRepaint()),a(this,K).cameraSystem.setCameraPlaneElevation(o)})}get center(){return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?a(this,X).map.getCenter().toArray():a(this,K).cameraSystem.center}setCenter(t){var e;if(a(this,X).mode==="outdoors-overlay"&&a(this,X).map){(e=a(this,X).map)==null||e.setCenter(t),a(this,K).interactionSystem.handleHover();return}a(this,K).cameraSystem.setCenter(t[0],t[1]),a(this,K).interactionSystem.handleHover()}get zoomLevel(){var t;return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(t=a(this,X).map)==null?void 0:t.getZoom():a(this,K).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;a(this,X).mode==="outdoors-overlay"&&a(this,X).map&&((e=a(this,X).map)==null||e.setZoom(t)),a(this,K).cameraSystem.setZoomLevel(_i(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 a(this,K).cameraSystem.isAnimating}cancelAnimation(){a(this,K).cameraSystem.cancelAnimation()}get maxZoomLevel(){return a(this,K).cameraSystem.maxZoomLevel}get minZoomLevel(){return a(this,K).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){a(this,K).panBoundsSystem.autoMinZoomLevel=t,t&&(a(this,K).panBoundsSystem.dirty=!0,a(this,K).panBoundsSystem.update())}get autoMinZoomLevel(){return a(this,K).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var o;e&&this.setAutoMinZoomLevel(!1);let i=_i(t,cr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(cr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));a(this,K).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(o=a(this,X).map)==null||o.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=_i(t,this.minZoomLevel,cr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(cr.MAX_MERCATOR_ZOOM_LEVEL,"."));a(this,K).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=a(this,X).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(t=a(this,X).map)==null?void 0:t.getMaxPitch():ae.radToDeg(a(this,K).cameraSystem.maxTilt)}get minPitch(){var t;return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(t=a(this,X).map)==null?void 0:t.getMinPitch():ae.radToDeg(a(this,K).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(rD,t);(i=a(this,X).map)==null||i.setMinPitch(e),a(this,K).cameraSystem.minTilt=ae.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(iD,t);(i=a(this,X).map)==null||i.setMaxPitch(e),a(this,K).cameraSystem.maxTilt=ae.degToRad(e)}get bearing(){var t;return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(t=a(this,X).map)==null?void 0:t.getBearing():ae.radToDeg(a(this,K).cameraSystem.getRotation())}setBearing(t){var e;if(a(this,X).mode==="outdoors-overlay"&&a(this,X).map){(e=a(this,X).map)==null||e.setBearing(t);return}a(this,K).cameraSystem.setRotation(ae.degToRad(t))}get pitch(){var t;return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(t=a(this,X).map)==null?void 0:t.getPitch():ae.radToDeg(a(this,K).cameraSystem.getTilt())}setPitch(t){var e;if(a(this,X).mode==="outdoors-overlay"&&a(this,X).map){(e=a(this,X).map)==null||e.setPitch(t);return}a(this,K).cameraSystem.setTilt(ae.degToRad(_i(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 a(this,K).cameraSystem.getPedestal()}setElevation(t){a(this,K).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return a(this,Uc)&&a(this,Uc).stop(),new Promise(i=>{var n;let o=a(this,K).cameraSystem.getPosition();o.z=t,a(this,K).cameraSystem.animateCamera({position:o},(e==null?void 0:e.duration)||300,As[(e==null?void 0:e.easing)||"ease-in-out"],i,i,{interruptible:(n=e==null?void 0:e.interruptible)!=null?n:!0})})}get insetsPadding(){return a(this,Ro).insetsPadding}get panMode(){return a(this,K).cameraSystem.enablePan===!1&&a(this,K).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(a(this,K).cameraSystem.enablePan=!0,a(this,K).cameraSystem.enablePedestal=!1):(a(this,K).cameraSystem.enablePan=!1,a(this,K).cameraSystem.enablePedestal=!0))}setInsetPadding(t){a(this,Ro).insetsPadding=Object.assign({},Tl,t)}animateTo(t){var s,c,l,u,h,g;if(a(this,X).mode==="outdoors-overlay"&&a(this,X).map)return(g=a(this,X).map)==null||g.flyTo({center:(s=t.center)!=null?s:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(l=t.bearing)!=null?l:this.bearing,pitch:(u=t.pitch)!=null?u:this.pitch,duration:(h=t.duration)!=null?h:600}),Promise.resolve();let e=t.center?a(this,X).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?a(this,K).cameraSystem.convertZoomLevelToAltitude(_i(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?ae.degToRad(t.bearing):void 0,n=t.pitch!==void 0?ae.degToRad(_i(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(y=>{var v;a(this,K).cameraSystem.animateCamera({position:e,zoom:i,rotation:o,tilt:n},t.duration||0,As[t.easing||"ease-in-out"],()=>{a(this,K).interactionSystem.handleHover(),y()},y,{interruptible:(v=t==null?void 0:t.interruptible)!=null?v:!0})})}getCameraFrameForCoordinates(t,e){let i=R(this,Hc,Yy).call(this,e||{},()=>Promise.resolve()),{pointCloud:o}=tx(t,a(this,X),a(this,Ro).geometry3DMap);if(o.length===0)return A.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:n,zoomLevel:s}=a(this,K).cameraSystem.getCameraFrameForCoordinates(o,i);return{center:a(this,X).convert3DMapPositionToCoordinate(n),zoomLevel:s}}focusOn(t,e){var s,c,l,u;let{pointCloud:i,geoBounds:o,firstPosition:n}=tx(t,a(this,X),a(this,Ro).geometry3DMap);return i.length===0?(A.error("No valid coordinates found in targets:",t),Promise.resolve()):a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(i.length===1&&n?(s=a(this,X).map)==null||s.flyTo({center:[n[0],n[1]],duration:(e==null?void 0:e.duration)||a(this,X).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?a(this,X).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,X).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||a(this,X).map.getMaxZoom()}):(oD&&aD(a(this,X),o),(u=a(this,X).map)==null||u.fitBounds(o,{duration:(c=e==null?void 0:e.duration)!=null?c:cr.DEFAULT_ANIMATION_DURATION,bearing:(e==null?void 0:e.bearing)===void 0?a(this,X).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,X).map.getPitch():e==null?void 0:e.pitch,maxZoom:(l=e==null?void 0:e.maxZoomLevel)!=null?l:a(this,X).map.getMaxZoom()})),a(this,K).interactionSystem.handleHover(),Promise.resolve()):new Promise(h=>{a(this,K).cameraSystem.focusOn(i,R(this,Hc,Yy).call(this,e||{},h))})}};X=new WeakMap,K=new WeakMap,Ro=new WeakMap,Uc=new WeakMap,Hc=new WeakSet,Yy=p(function(t,e){var i;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:a(this,K).cameraSystem.convertZoomLevelToAltitude(_i(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:a(this,K).cameraSystem.convertZoomLevelToAltitude(_i(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({},Tl,t==null?void 0:t.padding):this.insetsPadding,curve:As[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ae.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ae.degToRad(_i(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:p(()=>{a(this,K).interactionSystem.handleHover(),e()},"callback"),cancelledCallback:e,interruptible:(i=t==null?void 0:t.interruptible)!=null?i:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),p(Zy,"Camera");var vh=Zy;function Xy(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}p(Xy,"updateBounds");function tx(r,t,e){var c;let i=[],o=[1/0,1/0,-1/0,-1/0],n=null;if(!r||!Array.isArray(r)||r.length===0)return{pointCloud:i,geoBounds:o,firstPosition:n};let s=t.getSystems().renderSystem;(s.threeDdirty||s.twoDdirty)&&t.renderSync();for(let l of r)if(typeof l=="string"){let u=e.get(l);if(!u){A.error("Entity not found with id:",l);continue}let h=new dt;Rb(t,"userData"in u&&(c=u.userData.entityId)!=null?c:u.id,i,h,u instanceof Pe?u.position.z:void 0);let g=t.convert3DMapPositionToCoordinate(h.min),y=t.convert3DMapPositionToCoordinate(h.max);Xy(o,g),Xy(o,y),n||(n=t.convert3DMapPositionToCoordinate(h.getCenter(new q)))}else i.push(t.convertTo3DMapPosition(l[1],l[0],l[2]||0)),Xy(o,l),n||(n=l);return{pointCloud:i,geoBounds:o,firstPosition:n}}p(tx,"processTargets");function aD(r,t){var i,o,n,s;let e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(i=r.map)!=null&&i.getLayer("bounds-outline")&&r.map.removeLayer("bounds-outline"),(o=r.map)!=null&&o.getSource("bounds-source")&&r.map.removeSource("bounds-source"),(n=r.map)==null||n.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}}),(s=r.map)==null||s.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}p(aD,"drawBounds");m();var rx="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 ix="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}";m();var ox=4.291666666666667,nx=15,ax=25,sx=43/60;m();var lx=["horizontal","icon"],cD=new Map([[lx[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>'],[lx[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>']]),pD=/<svg([^>]*)>/g;function cx(r,t,e,i){let o=cD.get(r);return o?o.replace(pD,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}p(cx,"getLogoIcon");var px=!1,Se,Ri,Fs,gt,Tt,Zn,Mr,ri,zy=class zy extends te{constructor(e,i,o){super();I(this,Se,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:p(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});I(this,Ri);I(this,Fs);I(this,gt);I(this,Tt);I(this,Zn);I(this,Mr,0);I(this,ri,0);d(this,"dirty",!0);d(this,"getPositionAlignedCanvasCoordinates",p((e,i)=>({"top-left":{x:0,y:0},"top-right":{x:e,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:e,y:i},center:{x:e/2,y:i/2},top:{x:e/2,y:0},bottom:{x:e/2,y:i},left:{x:0,y:i/2},right:{x:e,y:i/2}})[a(this,Se).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",p(()=>{var o,n,s,c;let e=a(this,Se).padding;if(typeof e=="number")return{"top-left":{x:e,y:e},"top-right":{x:-e,y:e},"bottom-left":{x:e,y:-e},"bottom-right":{x:-e,y:-e},center:{x:0,y:0},top:{x:0,y:e},bottom:{x:0,y:-e},left:{x:e,y:0},right:{x:-e,y:0}}[a(this,Se).position];let i={top:(o=e.top)!=null?o:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(c=e.left)!=null?c:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));o&&Object.entries(o).forEach(([n,s])=>{s!==void 0&&(a(this,Se)[n]=s)}),M(this,Fs,e),M(this,Ri,i)}get color(){return a(this,Se).color==="light"?"white":"#293136"}get iconName(){return a(this,Se).iconOnly?"icon":"horizontal"}get minWidth(){return a(this,Se).iconOnly?nx:75}get defaultWidth(){return a(this,Se).iconOnly?ax:150}get aspectRatio(){return a(this,Se).iconOnly?sx:ox}get options(){return{...a(this,Se)}}set options(e){var i;M(this,Se,{padding:e.padding||a(this,Se).padding,position:e.position||a(this,Se).position,iconOnly:e.iconOnly||a(this,Se).iconOnly,color:e.color||a(this,Se).color,scale:e.scale||a(this,Se).scale,onClick:a(this,Se).onClick,interactive:(i=e.interactive)!=null?i:a(this,Se).interactive,visible:e.visible||a(this,Se).visible})}get icon(){return cx(this.iconName,this.color,a(this,Mr)*a(this,Ri).pixelRatio,a(this,ri)*a(this,Ri).pixelRatio)}setSize(e,i){a(this,Tt)&&(a(this,Tt).uniforms.uSize.value.x=e,a(this,Tt).uniforms.uSize.value.y=i)}setXY(e,i){a(this,Tt)&&(a(this,Tt).uniforms.uSize.value.w=e,a(this,Tt).uniforms.uSize.value.z=i)}get width(){return a(this,Mr)}get height(){return a(this,ri)}getPositionAlignedOffset(e,i){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-e,y:-i},center:{x:-(e/2),y:-(i/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-e,y:-(i/2)}}[a(this,Se).position]}insertIntoQuadTree(e){a(this,Zn)!=null&&typeof a(this,Se).onClick=="function"&&a(this,Se).interactive&&e.insert(a(this,Zn))}resize(e,i){if(a(this,Se).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(e,i),n=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(a(this,Mr),a(this,ri)),c=Math.min(e-a(this,Mr),Math.max(0,o.x+n.x+s.x)),l=Math.min(i-a(this,ri),Math.max(0,o.y+n.y+s.y));this.setSize(a(this,Mr)/e,a(this,ri)/i),this.setXY(c/e,l/i),M(this,Zn,new ze(c,l,a(this,Mr),a(this,ri),{entityId:"watermark"}))}update(){this.dirty&&a(this,Se).visible===!0&&(M(this,Mr,Math.min(a(this,Ri).canvasWidth,Math.max(this.minWidth,this.defaultWidth*a(this,Se).scale))),M(this,ri,a(this,Mr)/this.aspectRatio),Bo.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(M(this,Tt,new un({uniforms:{uTexture:{value:e},uSize:{value:new ib(0,0,0,0)},uOpacity:{value:.7}},vertexShader:rx,fragmentShader:ix,depthWrite:!1,depthTest:!1,defines:{debug:px},wireframe:px,transparent:!0,visible:!0})),a(this,gt))a(this,gt).material=a(this,Tt),a(this,gt).material.needsUpdate=!0;else{let i=new gi(2,2,1,1);M(this,gt,new ne(i,a(this,Tt))),a(this,gt).position.set(0,0,-1),a(this,gt).frustumCulled=!1,a(this,gt).renderOrder=999;let o=new mi(1,1,1),n=new ne(o,new vt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));n.frustumCulled=!1,n.layers.set(1),a(this,gt).add(n),a(this,Fs).add(a(this,gt))}this.resize(a(this,Ri).canvasWidth,a(this,Ri).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){a(this,gt)&&(a(this,Fs).remove(a(this,gt)),Ne(a(this,gt))),M(this,gt,void 0),a(this,Tt)&&a(this,Tt).dispose(),M(this,Tt,void 0),M(this,Zn,void 0)}};Se=new WeakMap,Ri=new WeakMap,Fs=new WeakMap,gt=new WeakMap,Tt=new WeakMap,Zn=new WeakMap,Mr=new WeakMap,ri=new WeakMap,p(zy,"WatermarkSystem");var Ch=zy;m();var Sh=100,hD=!1,qy=class qy extends te{constructor(e,i){super();d(this,"currentTotalBoundingBox");d(this,"state");d(this,"cameraSystem");d(this,"debugMesh",null);d(this,"dirty",!0);d(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new dt,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new q(0,0,0),new q(Sh*2,Sh*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Sh)));let e=new dt().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(e);let i=e.getSize(new q),o=Math.max(i.x,i.y,i.z);for(let s of this.state.geometry2DMap.values())s.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(s.position),s.positionDirty=!1);let n=xh.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,Sh)).getBoundingSphere(fD).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new q),min:xh.min,max:xh.max,radius:n},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,hD&&this.state.entityScene.parent instanceof io){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new cn,this.debugMesh.add(new ne(new Su(this.cameraSystem.panBounds.radius),new vt({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let s=new q;xh.getSize(s);let c=new mi(s.x,s.y,s.z),l=new vt({color:65280,wireframe:!0,transparent:!0,opacity:.5}),u=new ne(c,l);u.position.copy(this.currentTotalBoundingBox.getCenter(new q)),this.debugMesh.add(u)}}}};p(qy,"PanBoundsSystem");var Ih=qy,xh=new dt,fD=new ab;m();var ux="\xA9 Mappedin",mD="https://info.mappedin.com/feedback",Jy=["top-left","top-right","bottom-left","bottom-right"],gD=640,yD=p(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),$y={custom:[],position:"bottom-right",feedback:!0},Qy=class Qy{constructor(t){d(this,"controlContainerEl");d(this,"controlPositions");d(this,"compact");d(this,"attribContainerEl");d(this,"attribInnerEl");d(this,"attribButtonEl");d(this,"feedbackLinkEl");d(this,"attribHTML",ux);d(this,"customAttributions",[]);d(this,"toggleAttribution",p(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Jy.reduce((e,i)=>{let o=document.createElement("div");return o.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(o),e[i]=o,e},{})}addAttributionControl(t=$y){var o;let e=t.position&&Jy.includes(t.position)?t.position:$y.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(e)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[e].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=yD(),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:$y.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=mD,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 e=[ux],i=t.style.sourceCaches;for(let o in i){let n=i[o];if(n.used||n.usedForTerrain){let s=n.getSource();s.attribution&&e.indexOf(s.attribution)<0&&e.push(s.attribution)}}e=e.filter(o=>String(o).trim()),e=e.filter((o,n)=>{for(let s=n+1;s<e.length;s++)if(e[s].indexOf(o)>=0)return!1;return!0}),this.attribHTML=e.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<=gD||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(Qy,"HTMLControlsSystem");var Ph=Qy;m();var Wc,Ky=class Ky{constructor(t,e){d(this,"mesh");d(this,"type","custom-geometry");d(this,"dirty",!0);d(this,"feature");d(this,"builder");d(this,"outline");d(this,"color",new et);I(this,Wc,0);this.mesh=new lo,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){A.warn("TODO: implement custom geometry opacity")}get opacity(){return A.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return a(this,Wc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,M(this,Wc,t))}get renderOrder(){return A.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){A.warn("TODO: implement custom geometry render order")}};Wc=new WeakMap,p(Ky,"CustomGeometryComponent");var ks=Ky;m();var e1=class e1{constructor(t,e){d(this,"state");d(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(i);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],e=o.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(n=>{n.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};p(e1,"CustomGeometrySystem");var Mh=e1;m();m();var t1=class t1 extends ne{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};p(t1,"EntityMesh");var Th=t1,bD=G.object({flipImageToFaceCamera:G.boolean().optional(),url:G.string()}),vD=G.object({type:G.enum(["Feature"]),properties:G.object({width:G.number(),height:G.number(),rotation:G.number().min(0).max(360).optional(),verticalOffset:G.number().optional()}),geometry:Ds});function dx(r,t,e){G.union([G.number(),G.string()]).parse(r),vD.parse(t),bD.parse(e)}p(dx,"validateImage");var r1=class r1{constructor(t){d(this,"mesh",new lo);d(this,"imageMesh");d(this,"outline");d(this,"type","image");d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"position",new q);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};p(r1,"ImageComponent");var wh=r1;m();function i1(r,t){return{x:r.x*Math.cos(t)-r.y*Math.sin(t),y:r.x*Math.sin(t)+r.y*Math.cos(t)}}p(i1,"rotatePoint");function CD(r,t){return r.map(e=>i1(e,t))}p(CD,"rotatePoints");function SD(r){let t=1/0,e=1/0,i=-1/0,o=-1/0;for(let n of r)t=Math.min(t,n.x),e=Math.min(e,n.y),i=Math.max(i,n.x),o=Math.max(o,n.y);return{minX:t,minY:e,maxX:i,maxY:o}}p(SD,"getBounds");function xD(r,t){let e=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let n=t[i].x,s=t[i].y,c=t[o].x,l=t[o].y;s>r.y!=l>r.y&&r.x<(c-n)*(r.y-s)/(l-s)+n&&(e=!e)}return e}p(xD,"pointInPolygon");function hx(r,t,e,i,o){for(let n=0;n<o;n++)for(let s=0;s<i;s++)if(r[e+n][t+s]!==1)return!1;return!0}p(hx,"isValidRectangle");function ID(r,t,e){let i=r.maxX-r.minX,o=r.maxY-r.minY,n,s,c={...r};return i/o>t?(s=o/e,n=s*t,c.minX+=(i-n*e)/2):(n=i/e,s=n/t,c.minY+=(o-s*e)/2),{dx:n,dy:s,gridBounds:c}}p(ID,"calculateGridDimensions");function PD(r,t,e,i,o){let n=Array(e).fill(0).map(()=>Array(e).fill(0));for(let s=0;s<e;s++)for(let c=0;c<e;c++){let l={x:t.minX+c*i,y:t.minY+s*o};xD(l,r)&&(n[s][c]=1)}return n}p(PD,"createAndFillGrid");function MD(r,t){let e=Array(t).fill(0).map(()=>Array(t).fill(0));for(let i=0;i<t;i++)for(let o=0;o<t;o++)if(r[i][o]===1){let n=0;for(let s=1;s<=Math.min(t-o,t-i)&&hx(r,o,i,s,s);s++)n=s;e[i][o]=n}return e}p(MD,"calculateRectSizes");function TD(r,t,e,i,o,n){let s=0,c=0,l=0;for(let u=0;u<i;u++)for(let h=0;h<i;h++)if(r[u][h]===1){let g=Math.pow(t[u][h],2),y=e.minX+h*o,v=e.minY+u*n;s+=g,c+=y*g,l+=v*g}return{x:c/s,y:l/s}}p(TD,"calculatePolygonCenter");function wD(r,t,e,i,o,n,s){let c=-1/0,l=null,u=r.length,h=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let g=0;g<u;g++)for(let y=0;y<u;y++)if(r[g][y]===1)for(let v=1;v<=u-y;v++){let b=v;if(!(b>u-g)&&hx(r,y,g,v,b)){let S=v*b,C=t.minX+(y+v/2)*e,x=t.minY+(g+b/2)*i,T={x:C,y:x},w=Math.sqrt(Math.pow(T.x-o.x,2)+Math.pow(T.y-o.y,2))/h,E=S*(1-n)-w*n*S;E>c&&(c=E,l={center:T,width:v*e*s,height:v*i*s})}}return l}p(wD,"findBestRectangle");function o1(r,t,e,i={}){let{scaleFactor:o=.9,centerPriority:n=.5,resolution:s=100,minimumSizeRatio:c=.5}=i,l=vb(e),u=r.width/r.height,h=CD(t,l),g=SD(h),{dx:y,dy:v,gridBounds:b}=ID(g,u,s),S=PD(h,b,s,y,v),C=MD(S,s),x=TD(S,C,b,s,y,v),T=wD(S,b,y,v,x,n,o);return!T||T.width<r.width*c||T.height<r.height*c?r:{...T,center:i1(T.center,-l),rotation:e,polygonCenter:i1(x,-l)}}p(o1,"findLargestInteriorRectangle");var Xc=Math.PI*2,DD=Math.PI/2,ED=Math.PI*1.5,OD=Da(DD,2),LD=Da(ED,2),AD=.01,fx=!1,n1=class n1 extends te{constructor(e,i,o=0,n=0,s={}){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"initialBearing",0);d(this,"naturalBearing",0);d(this,"imagePlacementOptions");d(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i,this.initialBearing=o,this.naturalBearing=n,this.imagePlacementOptions=s}createImageMesh(e,i,o,n=0,s,c){var b,S,C;let l={width:o.width,height:o.height,center:this.convertTo3DMapPosition(s),rotation:(b=o.rotation)!=null?b:0},u=(S=this.imagePlacementOptions.mode)!=null?S:"default",h=(()=>{switch(u){case"fit-nearest-90":let x=(this.initialBearing-this.naturalBearing+360)%180;return x>=45&&x<=135?o1(l,c,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return o1(l,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if(fx&&h.polygonCenter){let x=new ne(new Su(1),new yi({color:65280}));x.position.set(h.polygonCenter.x,h.polygonCenter.y,n),this.rendererState.entityScene.add(x)}let g=new yi({transparent:!0,depthWrite:!1,side:sn}),y=new gi(h.width,h.height),v=new Th(y);if(v.visible=!1,(C=this.getOrDownloadImage(i))==null||C.then(x=>{g.map=x,g.needsUpdate=!0,g.map.colorSpace=bu,v.visible=!0,this.publish("image-loaded")}),v.userData.entityId=e,v.material=g,fx){let x=new ne(new gi(o.width,o.height),new yi({color:"gray"}));v.add(x);let T=new yb;v.add(T),T.scale.set(10,10,10)}return v.position.set(h.center.x,h.center.y,n+AD),v.rotation.z=(-ae.degToRad(h.rotation)+Xc)%Xc,v}getOrDownloadImage(e){var i;if(this.imageLoadingCache.has(e))return(i=this.imageLoadingCache.get(e))==null?void 0:i.promise;{let o=new Promise(n=>{Bo.getLoader().load(e,s=>{let c=this.imageLoadingCache.get(e);c&&!c.loaded&&(c.loaded=!0),n(s)})});return this.imageLoadingCache.set(e,{loaded:!1,promise:o}),o}}flipIfNeeded(e,i){if(e.imageMesh==null)return;let o=-i,n=e.imageMesh.rotation.z,s=Da((n-o+Xc)%Xc,2);s>OD&&s<LD&&(e.imageMesh.rotation.z=(n+Math.PI)%Xc)}update(e){var s,c,l,u,h;let i,o,n;for(let g of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(g),(i==null?void 0:i.type)==="image"){if(o=i.components[0],n=i.components[1],n.url&&o.imageMesh==null){let y=this.convertTo3DMapPosition(o.feature.geometry.coordinates),v={x:y.x,y:y.y};o.imageMesh=this.createImageMesh(i.id,n.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates,[v]),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)}o.imageMesh&&n.flipImageToFaceCamera&&this.flipIfNeeded(o,e)}else if((i==null?void 0:i.type)==="geometry"){if(o=i.components[0],n=i.components[1],n.showImage&&((s=o.feature.properties)!=null&&s.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((c=o.feature.properties)==null?void 0:c.image.position)!=null&&o.feature.geometry.coordinates!=null&&o.feature.geometry.coordinates.length>0){let y=o.feature.geometry.coordinates[0].map(b=>{let S=this.convertTo3DMapPosition(b);return{x:S.x,y:S.y}}),v=this.createImageMesh(g,(l=o.feature.properties)==null?void 0:l.image.path,(u=o.feature.properties)==null?void 0:u.image,n.height,(h=o.feature.properties)==null?void 0:h.image.position,y);o.mesh.parent.add(v),o.imageMesh=v}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(n.showImage&&!o.imageMesh.visible)if(n.url){let y=this.imageLoadingCache.get(n.url);y&&y.loaded&&(o.imageMesh.visible=!0)}else o.imageMesh.visible=!0;else!n.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1);n.flipImageToFaceCamera&&this.flipIfNeeded(o,e)}}}};p(n1,"ImageSystem");var Dh=n1;m();var FD=250,No,a1=class a1 extends te{constructor(e,i){super();d(this,"cameraDirty",!0);d(this,"focusablesDirty",!0);d(this,"state");d(this,"camera");d(this,"debugEl",null);d(this,"raycasters",[]);d(this,"collisions",new Map);d(this,"focusableEntities",new Set);d(this,"debugRaycasters",!1);I(this,No);d(this,"update",p((e=!1,i=Date.now())=>{e||Date.now()-i>FD||(a(this,No)&&cancelAnimationFrame(a(this,No)),M(this,No,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new ee(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new ee(e.x/1.2,e.y/1.2),o=new ee(e.x+(e.x-i.x),i.y),n=new ee(i.x,e.y+(e.y-i.y)),s=new ee(o.x,n.y),c=new ee(e.x,e.y/1.5),l=new ee(e.x,e.y+(e.y-c.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=[e,c,l,i,o,n,s].map((u,h)=>{if(this.debugRaycasters){let S=document.createElement("div");S.style.position="absolute",S.style.top=u.y+"px",S.style.left=u.x+"px",S.style.width="10px",S.style.height="10px",S.style.backgroundColor="red",this.debugEl.append(S)}let g=u.x/this.state.canvasWidth*2-1,y=-(u.y/this.state.canvasHeight)*2+1,v=new ee(g,y),b=new Nr;return b.setFromCamera(v,this.camera),[b,v,h===0?10:h<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let o of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(o),i!=null&&(e=i.components[0],e instanceof Ct&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let n=new ne(e.geometry);n.userData={entityId:i.id},e.focusMesh=n}this.focusableEntities.add(e.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.collisions.clear();for(let[i,o]of this.raycasters)i.setFromCamera(o,this.camera);for(let[i,o,n]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var l;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let u=c.object.userData.entityId,h=(l=this.collisions.get(u))!=null?l:0;this.collisions.set(u,h+n)}});let e=Array.from(this.collisions,([i,o])=>({entityId:i,weight:o})).sort((i,o)=>o.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){a(this,No)&&cancelAnimationFrame(a(this,No)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};No=new WeakMap,p(a1,"GeometryInFocusSystem");var Eh=a1;m();m();m();m();function Yc(r,t){t===void 0&&(t={});var e=ps(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return kD(e,t);case"MultiPolygon":return BD(e,t);default:throw new Error("invalid poly")}}p(Yc,"default");function kD(r,t){t===void 0&&(t={});var e=ps(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{};return mx(i,o)}p(kD,"polygonToLine");function BD(r,t){t===void 0&&(t={});var e=ps(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{},n=[];return i.forEach(function(s){n.push(mx(s,o))}),fn(n)}p(BD,"multiPolygonToLine");function mx(r,t){return r.length>1?xb(r,t):bi(r[0],t)}p(mx,"coordsToLine");function _D(r,t){var e=!0;return Vr(r,function(i){Vr(t,function(o){if(e===!1)return!1;e=RD(i.geometry,o.geometry)})}),e}p(_D,"booleanDisjoint");function RD(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!jD(r.coordinates,t.coordinates);case"LineString":return!gx(t,r);case"Polygon":return!Fi(r,t)}break;case"LineString":switch(t.type){case"Point":return!gx(r,t);case"LineString":return!ND(r,t);case"Polygon":return!yx(t,r)}break;case"Polygon":switch(t.type){case"Point":return!Fi(t,r);case"LineString":return!yx(r,t);case"Polygon":return!GD(t,r)}}return!1}p(RD,"disjoint");function gx(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(VD(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}p(gx,"isPointOnLine");function ND(r,t){var e=Is(r,t);return e.features.length>0}p(ND,"isLineOnLine");function yx(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var o=i[e];if(Fi(o,r))return!0}var n=Is(t,Yc(r));return n.features.length>0}p(yx,"isLineInPoly");function GD(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var o=i[e];if(Fi(o,t))return!0}for(var n=0,s=t.coordinates[0];n<s.length;n++){var c=s[n];if(Fi(c,r))return!0}var l=Is(Yc(r),Yc(t));return l.features.length>0}p(GD,"isPolyInPoly");function VD(r,t,e){var i=e[0]-r[0],o=e[1]-r[1],n=t[0]-r[0],s=t[1]-r[1],c=i*s-o*n;return c!==0?!1:Math.abs(n)>=Math.abs(s)?n>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:s>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}p(VD,"isPointOnLineSegment");function jD(r,t){return r[0]===t[0]&&r[1]===t[1]}p(jD,"compareCoords");var bx=_D;function s1(r,t){var e=!1;return Vr(r,function(i){Vr(t,function(o){if(e===!0)return!0;e=!bx(i.geometry,o.geometry)})}),e}p(s1,"booleanIntersects");var l1=class l1{constructor(t){d(this,"dirty",!0);d(this,"map");d(this,"stylesheetId","");d(this,"userHiddenLayers",new Set);d(this,"hiddenLayersInStyle",new Set);d(this,"centerPoint");d(this,"bbox");d(this,"polygons");d(this,"handleRender",p(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let t=[];if(this.centerPoint){let i=this.map.project(this.centerPoint),o=this.map.queryRenderedFeatures(i,{layers:Array.from(this.hiddenLayersInStyle)});for(var e of o)t.push(["!=",["id"],e.id])}else if(this.bbox&&this.polygons){let i=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(i.length>0){for(let o of i)if(o.geometry!=null&&"coordinates"in o.geometry){let n;if(o.geometry.type==="Polygon"?n=Tu(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(n=Ib(o.geometry.coordinates)),!n)continue;for(let s of this.polygons)if(s1(s,n)){t.push(["!=",["id"],o.id]);break}}}}t.length>0&&(this.hiddenLayersInStyle.forEach(i=>{this.map.setFilter(i,["all",...t])}),this.dirty=!1)},"handleRender"));d(this,"handleStyleChange",p(t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let o=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!o||o!==this.stylesheetId)&&(this.stylesheetId=o,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,e,i){this.bbox=t,this.polygons=e.reduce((o,n)=>{if(n.geometry.type==="Polygon"){let s=Tu(n.geometry.coordinates);o.push(s)}else n.geometry.type==="MultiPolygon"&&o.push(...n.geometry.coordinates.map(s=>Tu(s)));return o},[]);for(let o of i)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))}};p(l1,"OutdoorLayers");var Oh=l1;m();m();m();var c1="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 p1='#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 vx="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 XD=new wa;function Cx(r,t,e){let{nearRadius:i,farRadius:o,accentColor:n,completeFraction:s,isVertical:c}=t,{color:l}=e,u=!0,h=0,g=1/0,y=t.displayArrowsOnPath,v=!c,b=!0,S=y,C=i/2+YD,x=0;r[0].z+=C;for(let se=1;se<r.length;++se){r[se].z+=C;let he=r[se].x-r[se-1].x,Ue=r[se].z-r[se-1].z;if(c)x+=Math.sqrt(he*he+Ue*Ue);else{let ut=r[se].y-r[se-1].y;x+=Math.sqrt(he*he+ut*ut+Ue*Ue)}}if(!c){let se=r[0],he=r[r.length-1];r.push(he.clone().setZ(he.z-.01)),r.unshift(se.clone().setZ(se.z-.01))}let T=new rb;S&&(T=XD.load(vx),T.colorSpace=bu);let D=new et(l),w=new et(n),E={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new ee(1,1)},cameraParameters:{type:"v2",value:new ee(h,0)},complete:{type:"f",value:u?0:1},color:{type:"c",value:D},pathLength:{type:"f",value:x},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:g},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:T},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:b},opacityMultiplier:{type:"f",value:1}},k=new ub(r);k.curveType="catmullrom",k.tension=0;let L=30,_=8,B=L*r.length,V=new db(k,B,i,_,!1),j=new Float32Array(V.attributes.position.count);for(let se=r.length;se<j.length;se++)j[se]=se;V.setAttribute("vertexIndex",new pn(j,1));let Y=new Float32Array(V.attributes.position.count),ie=new pn(Y,1);for(let se=0;se<=B;se++)for(let he=0;he<=_;++he)ie.setX(se*(_+1)+he,se/B);V.setAttribute("pathDistance",ie);let H=new Float32Array(V.attributes.normal.count*3),oe=new pn(H,3);for(let se=0;se<B;se++){let he=V.tangents[se];for(let Ue=0;Ue<=_;++Ue)oe.setXYZ(se*(_+1)+Ue,he.x,he.y,he.z)}V.setAttribute("pathTangent",oe);let z=new Float32Array(V.attributes.normal.count*3),De=new pn(z,3);for(let se=0;se<B;se++){let he=V.tangents[se];var de,ye,Ie;c?(de=he.x*he.y,ye=-1+he.y*he.y,Ie=he.z*he.y):(de=-he.x*he.z,ye=-he.y*he.z,Ie=1-he.z*he.z);let Ue=Math.sqrt(de*de+ye*ye+Ie*Ie);Ue===0&&(Ue=1);let ut=de/Ue,hr=ye/Ue,ro=Ie/Ue;for(let an=0;an<=_;++an)De.setXYZ(se*(_+1)+an,ut,hr,ro)}V.setAttribute("pathNormal",De);let dr=new un({uniforms:E,vertexShader:c1,fragmentShader:p1});dr.transparent=!0,dr.alphaTest=.5,E.resolution.value.x=1,E.resolution.value.y=1,E.vertexes.value=j.length,E.arrowTexture.value.wrapS=Il,E.arrowTexture.value.wrapT=Il,E.arrowTexture.value.anisotropy=16,E.complete.value=s;let Ft=new ne(V,dr),pt=Ft.clone(),ot={...E,opacityMultiplier:{type:"f",value:.25}};ot.complete.value=1,pt.material=new un({uniforms:ot,vertexShader:c1,fragmentShader:p1}),pt.material.transparent=!0,pt.material.alphaTest=.5,pt.material.depthWrite=!1,pt.material.depthTest=!1,pt.renderOrder=1,ot.resolution.value.x=1,ot.resolution.value.y=1,ot.vertexes.value=j.length,ot.arrowTexture.value.wrapS=Il,ot.arrowTexture.value.wrapT=Il,ot.arrowTexture.value.anisotropy=16,ot.complete.value=s,Ft.userData=pt.userData=t.mesh.userData;let fi=t.mesh;fi.add(Ft),fi.add(pt),V.computeBoundingBox();let to=new q;return V.boundingBox.getCenter(to),{mesh:fi,material:dr,center:to}}p(Cx,"buildPath");var YD=.15;var u1=class u1 extends te{constructor(e,i,o,n){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");d(this,"convertZoomLevelToAltitude");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=o,this.convertZoomLevelToAltitude=n}update(e,i,o){let n,s=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="path"&&n.components[0].type==="path"){let l=n.components[0],u=n.components[1],h=l.isVertical&&this.altitudeDirty;if(!(l instanceof _o))continue;if(l.dirty||h){if(l.mesh.parent!=null)for(let y=l.mesh.children.length-1;y>=0;y--)Ne(l.mesh.children[0]);let g=[];if(l.feature.features.forEach(y=>{let v=y.geometry.coordinates[2]||0,b;if(y.properties.parentId&&(b=this.getParentContainer(y.properties.parentId,!0),b!=null&&b.altitude!=null&&(v+=b.altitude,l.isVertical=!0)),!y.properties.parentId||b!=null&&b.visible){let S=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],v);g.push(S)}}),g.length>1){let{mesh:y,material:v,center:b}=Cx(g,l,{color:u.color});l.mesh=y,l.material=v,l.position=b}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(g=>{g.material.uniforms.color.value.set(u.color),g.material.needsUpdate=!0}),l.mesh.position.z=u.altitude,u.dirty=!1),l.material&&(l.mesh.children.forEach(g=>{var v,b;let y=g.material.uniforms;y.nearZoom.value=(v=l.nearZoomAltitude)!=null?v:e,y.farZoom.value=(b=l.farZoomAltitude)!=null?b:i,y.cameraParameters.value.x=o,l.materialDirty&&(y.nearRadius.value=l.nearRadius,y.displayArrowsOnPath.value=l.displayArrowsOnPath,y.farRadius.value=l.farRadius,y.pulseColor.value.set(l.accentColor),y.complete.value=l.completeFraction),g.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(g=>{g.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,g.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};p(u1,"PathSystem");var Zc=u1;m();var Je,Bs,Tr,d1=class d1{constructor(t){d(this,"rendererState");d(this,"dirty",!1);I(this,Je);I(this,Bs);I(this,Tr);this.rendererState=t}updateOne(t){if(t instanceof Le&&t.components[0]instanceof Ct&&t.components[1]instanceof jr&&t.parentObject3D instanceof fr&&(M(this,Je,t.components[0]),M(this,Tr,t.components[1]),a(this,Je).detached&&a(this,Je).dirty&&a(this,Je).geometry!=null&&a(this,Je).material!=null)){M(this,Bs,t.parentObject3D),a(this,Je).visible=!1;let e=new et(a(this,Tr).color),i=new mv({color:e,side:sn,opacity:a(this,Tr).opacity||1,transparent:a(this,Tr).opacity!==void 0?a(this,Tr).opacity<1:!1},1,a(this,Je).material.repeatYFactor),o=new Eb(1,a(this,Je).geometry.attributes.position.count||0,0,i),n=o.addGeometry(a(this,Je).geometry);o.addInstance(n),o.userData={entities:{0:t.id},detached:!0},a(this,Je).instanceIndex=n,a(this,Je).material.setColor(a(this,Je).instanceIndex,e,a(this,Tr).topColor?new et(a(this,Tr).topColor):e),a(this,Je).mesh=o,a(this,Je).material=i,a(this,Bs).add(o),a(this,Je).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){M(this,Je,void 0),M(this,Bs,void 0),M(this,Tr,void 0)}};Je=new WeakMap,Bs=new WeakMap,Tr=new WeakMap,p(d1,"MeshDetachmentSystem");var Lh=d1;m();m();function Sx(r,t,e){var i;if(r.geometry!=null){let o=t||1e-4,n=o/r.currentHeight,s=o/e;r.geometry.scale(1,1,n),r.material&&(r.material.repeatYFactor=s),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=o}}p(Sx,"updateHeight");var zn,Go,h1=class h1{constructor(t){d(this,"rendererState");d(this,"dirty",!1);I(this,zn);I(this,Go);this.rendererState=t}updateOne(t){var e;t instanceof Le&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(M(this,zn,t.components[0]),M(this,Go,t.components[1]),t.type==="geometry"&&a(this,Go).height!==a(this,zn).currentHeight&&Sx(a(this,zn),a(this,Go).height,a(this,Go).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){M(this,zn,void 0),M(this,Go,void 0)}};zn=new WeakMap,Go=new WeakMap,p(h1,"MeshModificationSystem");var Ah=h1;m();var ZD={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1},f1=class f1{constructor(t){d(this,"state",ZD);d(this,"core");this.core=t}update(t){let e={};for(let[i,o]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=o,e[i]=o);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1))}};p(f1,"Debug");var Fh=f1;m();var zc=9,zD=!1,xx=.1;function qD(r,t,e){for(let i=0;i<t;i++){let o=(e&16711680)>>16,n=(e&65280)>>8,s=e&255;r[i*3]=o/255,r[i*3+1]=n/255,r[i*3+2]=s/255}}p(qD,"fillArrayWithColor");var m1=class m1{constructor(t,e,i){d(this,"state");d(this,"renderer");d(this,"renderService");d(this,"pickingTexture");d(this,"pickingMaterial");d(this,"pixelBuffer");d(this,"width",0);d(this,"height",0);d(this,"scale",1/2);d(this,"color",1);d(this,"convertTo3DMapPosition");d(this,"destroyed",!1);d(this,"enabled",!1);d(this,"backgroundId",16777215);d(this,"resize",p(()=>{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 ob(this.width,this.height,{format:eb,type:K0,internalFormat:"RGBA"})},"resize"));d(this,"shouldShowByXY",p((t,e,i)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-e-1)*this.width,n=this.pixelBuffer[o*4],s=this.pixelBuffer[o*4+1],c=this.pixelBuffer[o*4+2],l=n<<16|s<<8|c;return l===i||l===this.backgroundId},"shouldShowByXY"));d(this,"activeOccluders",new Set);d(this,"update",p(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,e;for(let o of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(o);if(n&&n instanceof Pe&&n.userData.occluderFeature!=null&&n.userData.occluderId!=null&&(this.activeOccluders.add(n.userData.occluderId),n.userData.occluderDirty)){if(t=n.userData.occluderFeature,t.geometry.type==="Polygon"){let s=Jd(t,this.convertTo3DMapPosition,{color:"white",height:xx});e=this.createOccluderMesh(s,n.userData.occluderId),n.add(e)}else if(t.geometry.type==="MultiPolygon"){let s=Qd(t,this.convertTo3DMapPosition,{color:"white",height:xx});e=this.createOccluderMesh(s,n.userData.occluderId),n==null||n.add(e)}n.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let i=new et(this.backgroundId);this.renderer.setClearColor(i),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(zc),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(zc),zD?this.renderService.enabledLayers.add(zc):this.renderService.enabledLayers.delete(zc),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 n=this.state.geometry2DMap.get(o);if(n&&(n==null?void 0:n.occluderId)!=null&&this.activeOccluders.has(n==null?void 0:n.occluderId)){let s=n.components[0].projection,c=Math.floor(s.x*this.scale),l=Math.floor(s.y*this.scale),u=this.shouldShowByXY(c,l,n.occluderId);n.components[0].isOccluded=!u}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=e,(i==null?void 0:i.renderer)==null)throw new Error("No Renderer");this.renderService=i,this.renderer=i.renderer,this.resize(),this.pickingMaterial=new un({glslVersion:tb,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,e){let i=t.attributes.position,o=new Float32Array(i.count*3);qD(o,i.count,e),t.setAttribute("color",new pn(o,3))}createOccluderMesh(t,e){let i=new ne(t,this.pickingMaterial);return i.layers.set(zc),this.applyId(i.geometry,e),i.userData.occluderId=e,i}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}};p(m1,"Occlusion2DSystem");var kh=m1;var Ix=new Nr;var{DEFAULT_PITCH:C1,DEFAULT_BEARING:S1,DEFAULT_ZOOM_LEVEL:x1,DEFAULT_MIN_ZOOM_LEVEL:$D,DEFAULT_MAX_ZOOM_LEVEL:JD}=cr,QD=ae.radToDeg(.6435011087932844),_e,ke,qn,qc,_s,Vo,$n,Rs,lt,y1,F,ve,wr,Be,ii,rt,O,$c,He,xe,Px,Mx,Tx,jo,Jc,Qc,Kc,ep,Bh,tp,rp,ip,Ns,b1,Jn,op,wt,Dt,v1,Gs,np,I1=class I1 extends te{constructor(e,i={}){var y,v,b,S,C,x,T,D,w,E,k;super();I(this,lt);d(this,"options");d(this,"container");d(this,"Debug");I(this,_e);I(this,ke);I(this,qn);I(this,qc);I(this,_s);I(this,Vo);I(this,$n);I(this,Rs);d(this,"rendererDomElement");I(this,F,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Pe("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Tl,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new Oy,cameraObject:new af,naturalBearing:0,containerOffset:[0,0]});d(this,"camera");I(this,ve);I(this,wr);I(this,Be);I(this,ii);I(this,rt);I(this,O,{});I(this,$c,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");I(this,He,p(()=>{a(this,O).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));I(this,xe,p(()=>{a(this,O).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));I(this,jo,"standalone");I(this,Jc,p(e=>Math.trunc(e*10)/10,"#round10"));I(this,Qc,p(()=>{a(this,O).twoDDrawSystem.dirty=!0,R(this,lt,y1).call(this,Oa()),a(this,O).watermarkSystem.dirty=!0,a(this,O).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));I(this,Kc,p(()=>{a(this,ep).call(this)},"#handleWindowResizeWithEvent"));I(this,ep,p((e,i)=>{let o=e!=null?e:this.rendererDomElement.clientWidth,n=i!=null?i:this.rendererDomElement.clientHeight;if(o===0||n===0)return;a(this,F).canvasWidth=o,a(this,F).canvasHeight=n,R(this,lt,y1).call(this,Oa()),a(this,Ns).call(this),R(this,lt,Tx).call(this),a(this,O).cameraSystem.resize(this.canvasWidth,this.canvasHeight),a(this,O).cameraSystem.dirty=!0,a(this,O).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),a(this,O).htmlControlsSystem.resize(this.canvasWidth),a(this,O).geometryInFocusSystem.resize(),a(this,O).occlusion2DSystem.resize();let{top:s,left:c}=this.container.getBoundingClientRect();a(this,F).containerOffset=[s,c],this.publish("resize"),this.render()},"#handleWindowResize"));I(this,Bh,p(()=>{this.renderSync()},"#renderFull"));I(this,tp,new q);I(this,rp,p((e,i)=>{let o=this.mode==="standalone"?a(this,ke):this.viewCamera;if(a(this,ke).position.z+this.camera.elevation>i.z){a(this,tp).copy(i);let n=a(this,tp).project(o),s=(n.x+1)/2*this.canvasWidth-0/2,c=(-n.y+1)/2*this.canvasHeight-0/2,l=a(this,Jc).call(this,s),u=a(this,Jc).call(this,c);e.x=l,e.y=u}else e.x=-1e3,e.y=-1e3},"#project"));I(this,ip,p((e,i)=>{a(this,rt).setBufferSize(e,i),a(this,ke).aspect=e/i,a(this,ke).updateProjectionMatrix(),a(this,ke).updateMatrixWorld(!0),a(this,_s).x=e,a(this,_s).y=i},"#setBufferSize"));I(this,Ns,p(()=>{var s;let e=a(this,F).canvasWidth=this.rendererDomElement.clientWidth,i=a(this,F).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(e*this.resolutionScale),n=Math.floor(i*this.resolutionScale);a(this,ip).call(this,o,n),(s=this.map)==null||s.resize(),a(this,F).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",p((e,i=!0)=>{if(!e)return i?a(this,F).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let o=a(this,F).geometry3DMap.get(e);return o instanceof Pe?o:(A.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?a(this,F).entityScene:void 0)}else if(e.type==="group-container"){let o=a(this,F).geometry3DMap.get(e.id);if(o instanceof Pe)return o}return i?a(this,F).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",p(()=>{a(this,O).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",p(()=>{a(this,O).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",p((e,i,o=!1)=>{var y,v;let n=a(this,F).containerOffset[0],s=a(this,F).containerOffset[1],c=(e-s)/a(this,F).canvasWidth*2-1,l=-((i-n)/a(this,F).canvasHeight)*2+1,u=new ee(c,l),h,g;if(o)Ix.setFromCamera(u,a(this,ke)),h=(y=Ix.intersectObject(a(this,Vo),!1)[0])==null?void 0:y.point;else{let b=a(this,O).interactionSystem.getThreeDIntersectsFromXY(u);h=(v=b==null?void 0:b[0])==null?void 0:v.point,g=a(this,O).interactionSystem.getGroupContainerIntersectsFromXY(u)}if(h)return{coordinate:this.convert3DMapPositionToCoordinate(h),groupContainers:g}},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",p(e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o=new ee;return a(this,rp).call(this,o,i),{x:o.x,y:o.y}},"projectCoordinateToScreenXY"));d(this,"convert3DMapPositionToCoordinate",p(e=>{var n,s,c,l;let{lat:i,lon:o}=wu((s=(n=a(this,F).center)==null?void 0:n[1])!=null?s:0,(l=(c=a(this,F).center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[o,i,e.z]},"convert3DMapPositionToCoordinate"));d(this,"setBackgroundColor",p((e,i)=>{a(this,rt).setBackgroundColor(e,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",p(()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,i,!0),n=this.projectScreenXYToCoordinate(e,i,!0);return o==null||n==null?void 0:Pu(o.coordinate,n.coordinate)/e},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",p((e,i)=>{!this.map||(i==null?void 0:i.length)===0||(a(this,O).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())},"hideOutdoorLayersUnderPoint"));d(this,"hideOutdoorLayersIntersectingPolygons",p((e,i,o)=>{a(this,O).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,o),this.render()},"hideOutdoorLayersIntersectingPolygons"));I(this,Jn,new cb);I(this,op,new ln);d(this,"render",p(()=>{var e;if(((e=a(this,O))==null?void 0:e.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return a(this,O).renderSystem.update()},"render"));d(this,"renderSync",p(()=>a(this,O).renderSystem.update(!0),"renderSync"));I(this,wt,La(()=>{this.publish("user-interaction-start",void 0)},0,!0));I(this,Dt,La(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));d(this,"on",p((e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&P.env.NODE_ENV!=="test"&&(A.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))},"on"));d(this,"off",p((e,i)=>{super.off(e,i)},"off"));d(this,"getCursor",p(()=>a(this,O).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",p(()=>{var e;a(this,O)&&(a(this,O).cameraSystem.off("user-dolly-start",a(this,wt)),a(this,O).cameraSystem.off("user-pan-start",a(this,wt)),a(this,O).cameraSystem.off("user-rotate-start",a(this,wt)),a(this,O).cameraSystem.off("user-zoom-start",a(this,wt)),a(this,O).cameraSystem.off("user-tilt-start",a(this,wt)),a(this,O).cameraSystem.off("user-pedestal-start",a(this,wt)),a(this,O).cameraSystem.off("user-dolly-end",a(this,Dt)),a(this,O).cameraSystem.off("user-pan-end",a(this,Dt)),a(this,O).cameraSystem.off("user-rotate-end",a(this,Dt)),a(this,O).cameraSystem.off("user-zoom-end",a(this,Dt)),a(this,O).cameraSystem.off("user-tilt-end",a(this,Dt)),a(this,O).cameraSystem.off("user-pedestal-end",a(this,Dt)),a(this,O).renderSystem.off("measure-canvas",a(this,Ns)),a(this,O).meshOptimizationSystem.off("geometry-2d-added",this.render),a(this,O).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),a(this,He).call(this),a(this,xe).call(this),this.renderSync(),a(this,O).renderSystem.destroy(),a(this,O).cameraSystem.off("change",this.render),a(this,O).pathSystem.off("animate:path",this.render),a(this,O).cameraSystem.dispose(),a(this,O).exporterSystem.destroy(),a(this,O).outdoorLayersSystem.destroy(),a(this,O).drawSystem.destroy(),window.removeEventListener("resize",a(this,Kc),!1),a(this,$c).removeEventListener("change",a(this,Qc)),a(this,$n)&&a(this,$n).disconnect(),this._subscribers={},a(this,rt).destroy(),(e=a(this,_e))==null||e.traverse(i=>{Ne(i),"dispose"in i&&typeof i.dispose=="function"&&i.dispose()}),M(this,_e,void 0),a(this,O).htmlControlsSystem.destroy(),a(this,O).collisionSystem.destroy(),a(this,O).interactionSystem.destroy(),a(this,O).domMutationSystem.destroy(),a(this,O).geometryInFocusSystem.destroy(),M(this,O,void 0),a(this,jo)!=="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(a(this,ii)),this.container.removeChild(a(this,ve)),M(this,rt,void 0))},"destroy"));I(this,Gs,new q);I(this,np,new q);if(a(this,F).naturalBearing=(y=i.naturalBearing)!=null?y:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(M(this,jo,i.mode),this.map=i.map),a(this,F).entityScene.addEventListener("childadded",()=>{a(this,xe).call(this),a(this,He).call(this)}),a(this,F).entityScene.addEventListener("childremoved",()=>{a(this,xe).call(this),a(this,He).call(this)}),a(this,F).geometry3DMap.set(a(this,F).entityScene.userData.entityId,a(this,F).entityScene),i.center&&(a(this,F).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,R(this,lt,Px).call(this),R(this,lt,Mx).call(this),a(this,O).htmlControlsSystem=new Ph(this.container),a(this,jo)!=="outdoors-overlay"&&a(this,O).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),P.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),M(this,rt,new Nd({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(v=i.gl)==null?void 0:v.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:p(L=>{var _;(_=i.onWebGLContextRestored)==null||_.call(i,L),a(this,He).call(this),a(this,xe).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(b=i.backgroundAlpha)!=null?b:1})),M(this,_e,new io),a(this,_e).add(a(this,F).entityScene);let o=window.__THREE_DEVTOOLS__;P.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:a(this,_e)})),o.dispatchEvent(new CustomEvent("observe",{detail:a(this,rt)}))),M(this,ke,new af(QD,this.aspect,50,1e5)),a(this,F).cameraObject=a(this,ke),M(this,qc,new lb),a(this,ke).renderOrder=999;let n=new cn;n.add(a(this,ke)),M(this,Rs,new cn),a(this,Rs).add(n),a(this,_e).add(a(this,Rs)),a(this,ke).updateProjectionMatrix(),a(this,ke).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:p(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=a(this,rt).domElement(),M(this,_s,new ee);let s=new gi(1e6,1e6),c=new vt({color:0,visible:!1});M(this,Vo,new ne(s,c)),a(this,Vo).name="worldPlane",a(this,_e).add(a(this,Vo)),(S=i.gl)!=null&&S.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",a(this,Kc),!1),a(this,$c).addEventListener("change",a(this,Qc)),typeof ResizeObserver=="function"&&((C=P.env)==null?void 0:C.NODE_ENV)!=="test"&&(M(this,$n,new ResizeObserver(Bb(L=>{a(this,ep).call(this,L[0].contentRect.width,L[0].contentRect.height)},50))),(x=a(this,$n))==null||x.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(T=globalThis.MappedinDebug)!=null&&T.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(D=globalThis.MappedinDebug)!=null&&D.TEST_IOS?"1920px":"100%",P.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),a(this,F).canvasWidth=this.rendererDomElement.clientWidth,a(this,F).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,u=this.canvasHeight;a(this,O).watermarkSystem=new Ch(a(this,ke),a(this,F),i==null?void 0:i.watermark),a(this,O).watermarkSystem.on("texture-loaded",this.render),a(this,F).shouldMeasureCanvas=!0,a(this,F).pixelRatio=this.resolutionScale,a(this,ip).call(this,Math.floor(l*this.resolutionScale),Math.floor(u*this.resolutionScale));let h=new xu(16777215,.3*Math.PI);h.position.set(-150,-150,350),a(this,_e).add(h);let g=new fb(16777215,.741*Math.PI);a(this,_e).add(g),a(this,O).cameraSystem=new Ls(a(this,ke),a(this,_e),a(this,rt).renderer,a(this,F),{mode:this.mode,canvasHeight:u,canvasWidth:l}),a(this,O).cameraSystem.on("user-dolly-start",a(this,wt)),a(this,O).cameraSystem.on("user-pan-start",a(this,wt)),a(this,O).cameraSystem.on("user-rotate-start",a(this,wt)),a(this,O).cameraSystem.on("user-zoom-start",a(this,wt)),a(this,O).cameraSystem.on("user-tilt-start",a(this,wt)),a(this,O).cameraSystem.on("user-pedestal-start",a(this,wt)),a(this,O).cameraSystem.on("user-dolly-end",a(this,Dt)),a(this,O).cameraSystem.on("user-pan-end",a(this,Dt)),a(this,O).cameraSystem.on("user-rotate-end",a(this,Dt)),a(this,O).cameraSystem.on("user-zoom-end",a(this,Dt)),a(this,O).cameraSystem.on("user-tilt-end",a(this,Dt)),a(this,O).cameraSystem.on("user-pedestal-end",a(this,Dt)),a(this,O).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),a(this,O).geometryInFocusSystem&&(a(this,O).geometryInFocusSystem.cameraDirty=!0),this.render()}),a(this,O).pathSystem=new Zc(a(this,F),this.convertTo3DMapPosition,this.getParentContainer,a(this,O).cameraSystem.convertZoomLevelToAltitude),a(this,O).pathSystem.on("animate:path",this.render),a(this,O).panBoundsSystem=new Ih(a(this,F),a(this,O).cameraSystem),a(this,O).panBoundsSystem.on("update",()=>{let{panBounds:L,fov:_,convertAltitudeToZoomLevel:B}=a(this,O).cameraSystem;if(a(this,O).panBoundsSystem.autoMinZoomLevel){if(L.radius<=0)return;let V=Math.min(a(this,F).canvasWidth/a(this,F).canvasHeight,1),j=_*Math.PI/180*V,Y=Math.tan(j/2),{radius:ie,center:H}=a(this,O).cameraSystem.panBounds,oe=ie/Y,z=this.getThreeCamera().getWorldPosition(new q),De=H.distanceTo(z),de=Math.abs(z.z-H.z),ye=oe*de/De,Ie=B(ye);Zb(Ie,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Ie)}}),this.camera=new vh(this,a(this,O),a(this,F)),this.camera.setZoomLevel((w=i.zoomLevel)!=null?w:x1),this.camera.setBearing((E=i.bearing)!=null?E:S1),this.camera.setPitch((k=i.pitch)!=null?k:C1),this.camera.setMaxZoomLevel(JD),this.camera.setMinZoomLevel($D),a(this,O).domVisiblitySystem=new th(a(this,F),a(this,ii)),a(this,O).domMutationSystem=new bh(a(this,F),a(this,ii)),a(this,O).domMutationSystem.on("dimensions-update",()=>{a(this,O).collisionSystem.collidersDirty=!0,this.render()}),a(this,O).domDrawSystem=new gh(a(this,F)),a(this,O).collisionSystem=new Gd(a(this,wr),a(this,F)),a(this,O).twoDDrawSystem=new ih(a(this,F),a(this,Be),i.transformImageRequest),a(this,O).twoDDrawSystem.on("img:loaded",this.render),a(this,O).interactionSystem=new xc(this.rendererDomElement,a(this,F),a(this,ke),a(this,Vo),a(this,O).cameraSystem.isUserInteracting),a(this,O).interactionSystem.on("doubletap-with-onefinger",L=>{var _;this.camera.animateTo({center:(_=this.projectScreenXYToCoordinate(L.clientX,L.clientY))==null?void 0:_.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:ff,easing:"ease-out"})}),a(this,O).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:ff,easing:"ease-out"})}),a(this,O).interactionSystem.on("hover",this.render),a(this,O).interactionSystem.on("click",L=>{var _,B,V,j,Y,ie;if(((_=L.entity2D)==null?void 0:_.id)==="watermark"&&typeof a(this,O).watermarkSystem.options.onClick=="function"&&a(this,O).watermarkSystem.options.interactive){a(this,O).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(L.position),geometry:L.entity3D?[(B=L.entity3D)==null?void 0:B.id]:[],paths:((V=L.entity3D)==null?void 0:V.components[0])instanceof _o?[L.entity3D.id]:[],markers:((j=L.entity2D)==null?void 0:j.components[0])instanceof so?[L.entity2D.id]:[],models:((Y=L.entity3D)==null?void 0:Y.components[0])instanceof Fo?[L.entity3D.id]:[],labels:((ie=L.entity2D)==null?void 0:ie.components[0])instanceof ao?[L.entity2D.id]:[],containers:Array.isArray(L.groupContainers)?L.groupContainers.map(H=>H.userData.entityId):[],pointerEvent:L.pointerEvent})}),a(this,O).interactionSystem.on("hover",L=>{var _,B,V,j,Y,ie;L.position&&((_=L.entity2D)==null?void 0:_.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(L.position),geometry:L.entity3D?[(B=L.entity3D)==null?void 0:B.id]:[],paths:((V=L.entity3D)==null?void 0:V.components[0])instanceof _o?[L.entity3D.id]:[],markers:((j=L.entity2D)==null?void 0:j.components[0])instanceof so?[L.entity2D.id]:[],models:((Y=L.entity3D)==null?void 0:Y.components[0])instanceof Fo?[L.entity3D.id]:[],labels:((ie=L.entity2D)==null?void 0:ie.components[0])instanceof ao?[L.entity2D.id]:[],containers:Array.isArray(L.groupContainers)?L.groupContainers.map(H=>H.userData.entityId):[]})}),a(this,O).geometryInFocusSystem=new Eh(a(this,F),a(this,ke)),a(this,O).geometryInFocusSystem.on("geometry-in-focus",L=>{this.publish("geometry-in-focus",L)}),a(this,O).twoDVisiblitySystem=new nh(a(this,F)),a(this,O).drawSystem=new oh(a(this,F),this.convertTo3DMapPosition),a(this,O).drawSystem.on("texture-loaded",this.render),a(this,O).stackSystem=new sh(a(this,F)),a(this,O).twoDProjectionSystem=new rh(a(this,F),a(this,rp)),a(this,O).exporterSystem=new Ic(a(this,F)),a(this,O).meshOptimizationSystem=new eh(a(this,F),this.convertTo3DMapPosition),a(this,O).meshOptimizationSystem.on("model-loaded",this.render),a(this,O).meshOptimizationSystem.on("geometry-2d-added",this.render),a(this,O).meshDetachmentSystem=new Lh(a(this,F)),a(this,O).meshModificationSystem=new Ah(a(this,F)),a(this,O).customGeometrySystem=new Mh(a(this,F),this.convertTo3DMapPosition),a(this,O).outlineInterpolationSystem=new vv(a(this,F)),a(this,O).renderSystem=new ah(a(this,rt),a(this,F),this.mode,a(this,_e),a(this,ke),this.viewCamera,a(this,O)),a(this,O).imageSystem=new Dh(a(this,F),this.convertTo3DMapPosition,i.bearing,i.naturalBearing,i.imagePlacementOptions),a(this,O).text3DSystem=new zb(a(this,F),this.convertTo3DMapPosition),a(this,O).text3DSystem.on("render",this.render),a(this,O).imageSystem.on("image-loaded",this.render),a(this,O).renderSystem.on("pre-render",()=>this.publish("pre-render")),a(this,O).renderSystem.on("post-render",()=>this.publish("post-render")),a(this,O).renderSystem.on("measure-canvas",a(this,Ns)),a(this,O).outdoorLayersSystem=new Oh(this.map),a(this,O).occlusion2DSystem=new kh(a(this,F),this.convertTo3DMapPosition,a(this,rt)),i.occlusionEnabled&&a(this,O).occlusion2DSystem.enable(),this.Debug=new Fh(this),i.environment!==!1&&M(this,qn,R(this,lt,v1).call(this)),a(this,Bh).call(this)}get viewCamera(){return a(this,qc)}get canvasWidth(){return a(this,F).canvasWidth}get canvasHeight(){return a(this,F).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:Oa()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return a(this,jo)}addGroupContainer(e,i,o){if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let n=new Pe(e);n.addEventListener("childadded",()=>{a(this,xe).call(this),a(this,He).call(this)}),n.addEventListener("childremoved",()=>{a(this,xe).call(this),a(this,He).call(this)}),(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&n.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&Qt(n,i.interactive,a(this,F)),a(this,F).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Pe&&s.addEntity(n),a(this,xe).call(this),this.render()}else A.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,o){if(a(this,F).geometry3DMap.has(e))A.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let n=new Pe(e);n.addEventListener("childadded",()=>{a(this,xe).call(this),a(this,He).call(this)}),n.addEventListener("childremoved",()=>{a(this,xe).call(this),a(this,He).call(this)}),n.components[0]=new yh,(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),a(this,F).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Pe&&s.addEntity(n)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,o,n,s){if(a(this,F).geometry3DMap.has(e))A.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new ks(i,o),l=new Le(c,new jr(n));(n==null?void 0:n.interactive)!==void 0&&Qt(l,n.interactive,a(this,F)),l.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},a(this,F).geometry3DMap.set(l.id,l);let u=this.getParentContainer(s);u instanceof Pe&&u.addEntity(l),a(this,xe).call(this),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,o,n){var s,c;if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let l=new fr(e,new uf(o));l.addEventListener("childadded",()=>{a(this,xe).call(this),a(this,He).call(this)}),l.addEventListener("childremoved",()=>{a(this,xe).call(this),a(this,He).call(this)}),l.userData.dirty=!0,a(this,F).geometry3DMap.set(e,l);for(let h of i.features){if(h.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(h.geometry.type))continue;let g=(h==null?void 0:h.id)||((s=h==null?void 0:h.properties)==null?void 0:s.id)||Ce(),{visible:y,...v}=o||{color:Db},b=a(this,O).meshOptimizationSystem.createEntityFromFeature(g,h,v);a(this,F).geometry3DMap.set(g,b),l.userData.entities3D.add(g)}l.setVisible((c=o==null?void 0:o.visible)!=null?c:!0),(o==null?void 0:o.altitude)!=null&&l.setAltitude(o.altitude);let u=this.getParentContainer(n);u instanceof Pe&&u.addEntity(l),a(this,xe).call(this),this.render()}else A.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return a(this,O).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,i){let o=this.getParentContainer(i),n=a(this,O).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(e,n),n}addImage(e,i,o,n){try{dx(e,i,o)}catch(s){A.error(s);return}if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let s=new wh(i),c=new Le(s,new jr(o));c.id=e||Ce(),s.mesh.userData={entityId:c.id,type:"path"},a(this,F).geometry3DMap.set(c.id,c);let l=this.getParentContainer(n);l instanceof Pe&&l.addEntity(c),a(this,xe).call(this),this.render()}else A.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,o,{parent:n,onComplete:s}={}){var c,l;try{YS(e,i,o)}catch(u){A.error(u);return}if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let u=new fr(e,new uf(o));u.addEventListener("childadded",()=>{a(this,xe).call(this),a(this,He).call(this)}),u.addEventListener("childremoved",()=>{a(this,xe).call(this),a(this,He).call(this)}),a(this,F).geometry3DMap.set(e,u),u.userData.dirty=!0,u.userData.modelURL=o.url;for(let g of i.features){let y=g.id||g.properties.id||Ce(),v=a(this,O).meshOptimizationSystem.createModelFromFeature(y,g,o);(g.properties.interactive!==void 0||o.interactive!=null)&&Qt(v,(c=g.properties.interactive)!=null?c:o.interactive,a(this,F)),a(this,F).geometry3DMap.set(y,v),u.userData.entities3D.add(y)}let h=this.getParentContainer(n);h instanceof Pe&&h.addEntity(u),a(this,xe).call(this),(l=this.render())==null||l.then(s)}else A.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,o,n){var c;let s=o==null?void 0:o.id;try{Fb(e,i,o||{})}catch(l){A.error(l);return}if(s===void 0||!a(this,F).geometry2DMap.has(s)&&!a(this,F).geometry3DMap.has(s)){let l=R(this,lt,b1).call(this,e,new so(i,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"&&Qt(l,o==null?void 0:o.interactive,a(this,F)),(c=this.getParentContainer(n))==null||c.addEntity(l),this.render()}else A.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}addText3D(e,i,o,n){if(!a(this,F).geometry3DMap.has(e)&&!a(this,F).geometry2DMap.has(e)){let s=new Lu({...i,properties:{...i.properties,id:e,content:i.properties.text}}),c=new Le(s,new El(o==null?void 0:o.appearance));c.id=e,s.mesh.userData.entityId=e.toString(),s.mesh.userData.type="text3d",a(this,F).geometry3DMap.set(e,c);let l=this.getParentContainer(n);l instanceof Pe&&l.addEntity(c),a(this,xe).call(this),this.render()}else A.error("Text3D with ID '".concat(e,"' already exists. The text3d cannot be added."));return{id:e,type:"text3d"}}labelText3D(e,i,o={}){var u,h;try{if(!i||!e)throw new Error("content and meshGeometryId are required");qb.parse(o)}catch(g){A.error(g);return}let n=a(this,F).geometry3DMap.get(e);if((n==null?void 0:n.type)!=="geometry"){A.error(".labelText3D failed: target incorrect");return}let s=n==null?void 0:n.components[0];if(!s.feature.properties.textArea)return;if(s.textEntityId){let g=a(this,F).geometry3DMap.get(s.textEntityId);if((g==null?void 0:g.type)!=="text3d"){A.error(".labelText3D failed: existing text3d not found");return}return{id:g.id,type:g.type}}let c=new Lu({type:"Feature",geometry:{coordinates:(u=s.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:i,id:Ce()}});c.polygonEntityId=e;let l=new Le(c,new El(o==null?void 0:o.appearance));return s.textEntityId=l.id.toString(),c.mesh.userData.entityId=l.id.toString(),c.mesh.userData.type="text3d",a(this,F).geometry3DMap.set(l.id.toString(),l),o.parentId&&((h=this.getParentContainer(o.parentId))==null||h.addEntity(l)),this.render(),{id:l.id,type:"text3d"}}addLabel2D(e,i,o,n){var c;let s=o==null?void 0:o.id;try{Ab(e,i,o||{})}catch(l){A.error(l);return}if(s===void 0||!a(this,F).geometry2DMap.has(s)&&!a(this,F).geometry3DMap.has(s)){let l=R(this,lt,b1).call(this,e,new ao(i,o||{},a(this,F)),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&&Qt(l,o==null?void 0:o.interactive,a(this,F));let u=typeof n=="string"||typeof n=="number"?a(this,F).geometry3DMap.get(n):void 0;u instanceof Le?u.addEntity(l):(c=this.getParentContainer(n))==null||c.addEntity(l),a(this,He).call(this),this.render()}else A.error("Label2D with ID '".concat(s,"' already exists. The label cannot be added."));return{id:s,type:"label"}}addPath(e,i={},o){var l;try{$S(e,i||{})}catch(u){A.error(u);return}let n=new _o(e,uv(i)),s=new Le(n,new jr({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));s.id=(i==null?void 0:i.id)||Ce(),n.mesh.userData={entityId:s.id,type:"path"},a(this,F).geometry3DMap.set(s.id,s),(i==null?void 0:i.interactive)!=null&&Qt(s,i==null?void 0:i.interactive,a(this,F));let c=this.getParentContainer(o);return c instanceof Pe&&c.addEntity(s),a(this,xe).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(e){a(this,O).watermarkSystem.options=e,a(this,O).watermarkSystem.dirty=!0,a(this,O).collisionSystem.collidersDirty=!0,this.render()}remove(e){var o,n;let i;if(typeof e=="string"||typeof e=="number"?(i=a(this,F).geometry2DMap.get(e),i==null&&(i=a(this,F).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=a(this,F).geometry2DMap.get(e.id),i==null&&(i=a(this,F).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")a(this,F).geometry3DMap.delete(i.id),i.object3d&&Ne(i.object3d);else if(i.type==="group-container"){a(this,F).geometry3DMap.delete(i.userData.entityId);for(let s of i.childrenIds.values())this.remove(s),i.userData.entities2D.delete(s);Ne(i)}else if(i.type==="geometry-group"){a(this,F).geometry3DMap.delete(i.userData.entityId);for(let s of i.userData.entities3D.values())this.remove(s),i.userData.entities3D.delete(s);Ne(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let s=i.components[0];if(i.entities2D.size>0){for(let c of i.entities2D.values())this.remove(c);i.removeAllEntities()}i.object3d&&(((o=i.parentObject3D)==null?void 0:o.type)==="geometry-group"&&i.parentObject3D.userData.entities3D.delete(i.id),Ne(i.object3d)),"outline"in s&&s.outline&&Ne(s.outline),"focusMesh"in s&&s.focusMesh!=null&&Ne(s.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),a(this,F).geometry3DMap.delete(i.id)}else if(i.type==="marker"||i.type==="label"){if(((n=i.parentObject3D)==null?void 0:n.type)==="geometry-group"){let s=i.object3d.userData.parentEntityId;if(s){let c=a(this,F).geometry3DMap.get(s);c instanceof Le&&c.removeEntity(i)}}i.object3d&&Ne(i.object3d),i.type==="label"&&delete a(this,O).twoDDrawSystem.textCache[i.id],a(this,F).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&Ne(i.object3d),a(this,F).geometry3DMap.delete(i.id);else if(i.type==="text3d"){Ne(i.object3d);let{batchedText:s,textMesh:c,polygonEntityId:l}=i.components[0];if(c&&(s&&s.removeText(c),Ne(c)),l){a(this,O).text3DSystem.remove(l);let u=a(this,F).geometry3DMap.get(l);(u==null?void 0:u.type)==="geometry"&&(u.components[0].textMesh=void 0,u.components[0].textEntityId=void 0)}a(this,F).geometry3DMap.delete(i.id)}a(this,xe).call(this),a(this,He).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return a(this,_e)}getThreeCamera(){return a(this,ke)}async setEnvironment(e){if(a(this,_e))if(e==="basic"){a(this,qn)||M(this,qn,R(this,lt,v1).call(this));let i=await a(this,qn);a(this,_e).environment=i}else a(this,_e).environment=null}getEnvironment(){var e;return(e=a(this,_e))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return a(this,O).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(a(this,O).renderSystem.threeDdirty||a(this,O).renderSystem.twoDdirty)&&this.renderSync();let i=new dt;if(e==null)i.setFromObject(a(this,F).entityScene);else{let o=wl(a(this,F),e);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let n=o.components[0],s=n instanceof Ct?n.geometry:void 0;n.mesh instanceof vu&&s?(s.computeBoundingBox(),s.boundingBox&&i.union(s.boundingBox)):i.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&&i.setFromObject(o)}if(dn(i))return _b(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var o,n,s,c,l,u,h,g,y,v;if(e==null)return{type:"map-view",hoverColor:a(this,F).hoverColor,text3dHoverColor:a(this,F).text3dHoverColor};let i=wl(a(this,F),e);if((i==null?void 0:i.type)==="custom-geometry"){let b=i.components[0],S=i.components[1];return{id:i.id,type:"custom-geometry",visible:S.visible,altitude:S.altitude,parent:(o=i.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(b.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let b=[];for(let C of i.userData.entities3D.values()){let x=this.getState(C);((x==null?void 0:x.type)==="geometry"||(x==null?void 0:x.type)==="model")&&b.push(x)}let S=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:S.opacity,color:S.color,initialColor:S.initialColor,height:S.height,altitude:i.altitude,topColor:S.topColor,outline:S.outline,shading:S.shading,texture:S.texture,topTexture:S.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(C=>a(this,F).geometry3DMap.get(C)).every(C=>C&&C.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(C=>this.getState(C)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,opacity:i.opacity,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(b=>this.getState(b)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let b=i.components[0],S=i.object3d.parent,C=S==null?void 0:S.userData.entityId;return{id:i.id,type:"label",text:b.text||"",parent:{id:C,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:b.enabled,visible:b.visible,initialRank:Ml(b.initialRank),options:{rank:Ml(b.rank),appearance:b.appearance,interactive:i.components[1]!=null,verticalOffset:i.verticalOffset}}}else if((i==null?void 0:i.type)==="marker"){let b=i.components[0],S=i.object3d.parent,C=S==null?void 0:S.userData.entityId;return{id:i.id,type:"marker",enabled:b.enabled,visible:b.visible,anchor:b.options.anchor,dynamicResize:b.options.dynamicResize,parent:{id:C,type:S==null?void 0:S.type},position:this.convert3DMapPositionToCoordinate(i.position),element:b.containerEl,initialRank:Ml(b.initialRank),options:{rank:Ml(b.rank),interactive:i.components[1]!=null||!1,verticalOffset:i.verticalOffset}}}else if((i==null?void 0:i.type)==="geometry"){let{color:b,hoverColor:S,initialColor:C,initialTopColor:x,topColor:T}=i.components[1],D=i.components[0],w=i.components[1],E=i.components[2],k=i.parentObject3D;return{id:i.id,type:"geometry",opacity:w.opacity,initialColor:C,color:b,focusable:D.focusable,initialTopColor:x,topColor:T,hoverColor:S,hovered:!!(E!=null&&E.hover),height:w.height,visible:w.visible,outline:w.outline,showImage:w.showImage,texture:w.texture,topTexture:w.topTexture,flipImageToFaceCamera:w.flipImageToFaceCamera,parent:{id:k==null?void 0:k.userData.entityId,type:k==null?void 0:k.type},position:this.convert3DMapPositionToCoordinate(D.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let b=i.components[0],S=i.components[1],C=i.components[2];return{id:i.id,type:"model",position:b.mesh?this.convert3DMapPositionToCoordinate((n=b.mesh)==null?void 0:n.getWorldPosition(new q)):this.convert3DMapPositionToCoordinate(b.position),interactive:C!=null,material:S.material,parent:(s=i.parentObject3D)!=null&&s.parent?{id:i.parentObject3D.parent.userData.entityId,type:i.parentObject3D.parent.type}:void 0,visible:S.visible,verticalOffset:S.verticalOffset,color:S.color,opacity:S.opacity,rotation:(c=S.rotation)!=null?c:ka,scale:(l=S.scale)!=null?l:Fa}}else if((i==null?void 0:i.type)==="path"){let b=i.components[0],S=i.components[2],C=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(b.position),visible:C.visible,interactive:S!=null,completeFraction:b.completeFraction,color:C.color,accentColor:b.accentColor,nearRadius:b.nearRadius,farRadius:b.farRadius,animateArrowsOnPath:b.animateArrowsOnPath,displayArrowsOnPath:b.displayArrowsOnPath,nearZoomLevel:b.nearZoomLevel,farZoomLevel:b.farZoomLevel}}else if((i==null?void 0:i.type)==="image"){let b=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(b.position),visible:i.components[1].visible,verticalOffset:(u=b.feature.properties.verticalOffset)!=null?u:0,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"&&i.components[0]instanceof Lu&&"textArea"in i.components[0].feature.properties){dv(i);let b=i.components[0],S=i.components[1],{textMesh:C}=b,x=(h=b.mesh)==null?void 0:h.parent;x instanceof Pe&&((g=x.children.find(w=>w.type==="batchedtext"))==null||g.getWorldPosition(a(this,np))),a(this,Gs).set(0,0,0);let T=C?C.getWorldPosition(a(this,Gs)):a(this,Gs);return Object.assign({},Aa,S.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(T.add(a(this,np))),visible:(y=b.visible)!=null?y:!1,content:(v=b.feature.properties.content)!=null?v:""})}else return}}setState(e,i){var n,s;if(typeof e=="object"&&i==null){"hoverColor"in e&&(a(this,F).hoverColor=(n=e.hoverColor)!=null?n:a(this,F).hoverColor),"text3dHoverColor"in e&&(a(this,F).text3dHoverColor=(s=e.text3dHoverColor)!=null?s:a(this,F).text3dHoverColor);return}let o=wl(a(this,F),e);if(o!=null){if(o.type==="custom-geometry"){let c=a(this,F).geometry3DMap.get(o.id);if(c instanceof Le&&c.components[0]instanceof ks){let l=i;po(o,a(this,F),l.visible),Au(o,l.altitude),vf(o,l.position,this.convertTo3DMapPosition),Cf(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let c=i;Qt(o,c.interactive,a(this,F))&&a(this,xe).call(this),Au(o,c.altitude),pv(o,a(this,F),c)}else if(o.type==="model"){let c=i;Qt(o,c.interactive,a(this,F))&&a(this,xe).call(this),po(o,a(this,F),c.visible),fv(o,c)}else if(o.type==="group-container"){let c=i;po(o,a(this,F),c.visible)&&(a(this,O).outlineInterpolationSystem.dirty=!0,a(this,O).pathSystem.altitudeDirty=!0),Au(o,c.altitude)&&(a(this,O).pathSystem.altitudeDirty=!0),Qt(o,c.interactive,a(this,F))&&a(this,xe).call(this),xf(o,a(this,F),c.opacity)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0)}else if(o.type==="geometry-group"){let c=i;po(o,a(this,F),c.visible)&&(a(this,O).outlineInterpolationSystem.dirty=!0),$b(o,a(this,F),c)&&(a(this,O).outlineInterpolationSystem.dirty=!0),If(o,c.outline)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),c.height!=null&&(bf(o,a(this,F),c.height),a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),c.altitude!=null&&(o.setAltitude(c.altitude),o.userData.outlineDirty=!0),nv(o,c),Jb(o,c.shading),xf(o,a(this,F),c.opacity)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),Qt(o,c.interactive,a(this,F))&&(a(this,xe).call(this),a(this,He).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof Ct){let c=i;po(o,a(this,F),c.visible)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),If(o,c.outline)&&(a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),Qb(o,c),lv(o,c.focusable)&&(a(this,O).geometryInFocusSystem.focusablesDirty=!0),cv(o,c.renderOrder)&&(a(this,O).meshDetachmentSystem.dirty=!0),sv(o,c.opacity)&&(a(this,O).meshDetachmentSystem.dirty=!0,a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),Sf(o,c.flipImageToFaceCamera),c.height!=null&&(bf(o,a(this,F),c.height),a(this,O).outlineInterpolationSystem.geometries3DDirty=!0),av(o,c)&&(a(this,O).meshDetachmentSystem.dirty=!0),Kb(o,c),iv(o,c.hoverColor),Qt(o,c.interactive,a(this,F)),ov(o,c.hovered)}a(this,xe).call(this)}else if(o.type==="label"||o.type==="marker"){let c=i;rv(o,i,a(this,F)),tv(o,i,a(this,F))&&(a(this,He).call(this),a(this,O).domMutationSystem.dirty=!0),vf(o,c.position,this.convertTo3DMapPosition),Cf(o,this.getParentContainer(c.parent,!1))&&(a(this,He).call(this),a(this,O).panBoundsSystem.dirty=!0),ev(o,c.enabled),po(o,a(this,F),c.visible)}else if(o.type==="image"){let c=i;po(o,a(this,F),c.visible),Sf(o,c.flipImageToFaceCamera)}else if(o.type==="text3d"){let c=i;hv(o,a(this,F),c)}this.render()}}convertTo3DMapPosition(e,i,o=0,n){var l,u,h,g,y;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(l=e[2])!=null?l:o,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:s,y:c}=Du((h=(u=a(this,F).center)==null?void 0:u[1])!=null?h:0,(y=(g=a(this,F).center)==null?void 0:g[0])!=null?y:0,e,i);return n?(n.set(s,c,o),n):new q(s,c,o)}get backgroundColor(){return typeof a(this,rt).backgroundColor=="string"?a(this,rt).backgroundColor:"#".concat(a(this,rt).backgroundColor.getHexString())}get backgroundAlpha(){return a(this,rt).backgroundAlpha}getThreeRenderer(){return a(this,rt)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?Yb(i):void 0}isInView(e){let i=wl(a(this,F),e);if(a(this,op).identity().multiply(a(this,ke).projectionMatrix).multiply(a(this,ke).matrixWorldInverse),a(this,Jn).setFromProjectionMatrix(a(this,op)),i instanceof df)return a(this,Jn).containsPoint(i.position);if(i instanceof Le){let o=i==null?void 0:i.components[0];if(o instanceof ks||o instanceof Fo)return a(this,Jn).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof Ct){let n=new dt(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return a(this,Jn).intersectsBox(n)}}return!1}getSystems(){return a(this,O)}getInternalState(){return a(this,F)}getTweenGroup(){return a(this,F).tweenGroup}};_e=new WeakMap,ke=new WeakMap,qn=new WeakMap,qc=new WeakMap,_s=new WeakMap,Vo=new WeakMap,$n=new WeakMap,Rs=new WeakMap,lt=new WeakSet,y1=p(function(e){var i;a(this,jo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),a(this,F).pixelRatio=this.resolutionScale},"#setResolutionScale"),F=new WeakMap,ve=new WeakMap,wr=new WeakMap,Be=new WeakMap,ii=new WeakMap,rt=new WeakMap,O=new WeakMap,$c=new WeakMap,He=new WeakMap,xe=new WeakMap,Px=p(function(){M(this,ve,document.createElement("div")),a(this,ve).classList.add("mappedin__smart-collision-engine__container"),M(this,wr,document.createElement("canvas")),a(this,wr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(a(this,ve)),M(this,Be,document.createElement("canvas")),a(this,Be).classList.add("mappedin__smart-collision-engine__container"),a(this,Be).width=a(this,ve).clientWidth*this.resolutionScale,a(this,Be).height=a(this,ve).clientHeight*this.resolutionScale,a(this,Be).style.width=a(this,ve).clientWidth+"px",a(this,Be).style.height=a(this,ve).clientHeight+"px",a(this,ve).appendChild(a(this,wr)),a(this,ve).appendChild(a(this,Be)),a(this,wr).width=a(this,ve).clientWidth,a(this,wr).height=a(this,ve).clientHeight,a(this,Be).width=a(this,ve).clientWidth*this.resolutionScale,a(this,Be).height=a(this,ve).clientHeight*this.resolutionScale,a(this,Be).style.width=a(this,ve).clientWidth+"px",a(this,Be).style.height=a(this,ve).clientHeight+"px"},"#renderEntity2DContainer"),Mx=p(function(){M(this,ii,document.createElement("div")),a(this,ii).classList.add("mappedin-2d-entities"),Object.assign(a(this,ii).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(a(this,ii))},"#renderEntityDOMContainer"),Tx=p(function(){a(this,Be).width=a(this,ve).clientWidth*this.resolutionScale,a(this,Be).height=a(this,ve).clientHeight*this.resolutionScale,a(this,Be).style.width=a(this,ve).clientWidth+"px",a(this,Be).style.height=a(this,ve).clientHeight+"px",a(this,wr).width=a(this,ve).clientWidth,a(this,wr).height=a(this,ve).clientHeight,a(this,Be).width=a(this,ve).clientWidth*this.resolutionScale,a(this,Be).height=a(this,ve).clientHeight*this.resolutionScale,a(this,Be).style.width=a(this,ve).clientWidth+"px",a(this,Be).style.height=a(this,ve).clientHeight+"px",a(this,O).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),jo=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,Kc=new WeakMap,ep=new WeakMap,Bh=new WeakMap,tp=new WeakMap,rp=new WeakMap,ip=new WeakMap,Ns=new WeakMap,b1=p(function(e,i,o,n){let s=new df(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n);return s.occluderId=o!=null?o:a(this,O).occlusion2DSystem.backgroundId,a(this,F).geometry2DMap.set(s.id,s),s},"#createEntity2D"),Jn=new WeakMap,op=new WeakMap,wt=new WeakMap,Dt=new WeakMap,v1=p(async function(){return Bo.load(mS).then(e=>{var i;return a(this,_e)&&((i=a(this,_e).environment)==null||i.dispose(),e.mapping=Q0,a(this,_e).environment=e,this.render()),e})},"#loadEnvMap"),Gs=new WeakMap,np=new WeakMap,p(I1,"Core");var g1=I1,ap=g1;m();function KD(r,t){eE(r,t)(r.getScene(),t),tE(r,t),t.addFolder("Export").add({export:p(async()=>{let s=await r.getCurrentSceneGLTF({binary:!0}),c=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(c);l.href=u,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(u)},"export")},"export");let o=t.addFolder("Camera"),n={get bearing(){return r.camera.bearing},set bearing(s){r.camera.setBearing(s)},get pitch(){return r.camera.pitch},set pitch(s){r.camera.setPitch(s)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(s){r.camera.setZoomLevel(s)}};o.add(n,"bearing",-359,359,1),o.add(n,"pitch",r.camera.minPitch,r.camera.maxPitch,1),o.add(n,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}p(KD,"mountSceneGraphVisualizer");function eE(r,t){let e=t;return p(function i(o,n){let s=n.addFolder("".concat([o.type]," ").concat(o.id.slice(0,16)));if(n.close(),o.type==="geometry"||o.type==="model"||o.type==="path"||o.type==="image"){let c={get height(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(o,{height:l})},set flipImageToFaceCamera(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="image"&&r.setState(o,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let u=r.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&r.setState(o,{visible:l})},get visible(){let l=r.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=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(o,{outline:l})},get outline(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{opacity:l})},get color(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?Lb(l.color).toHexString():"#ffffff"},set color(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{color:l})},set interactive(l){let u=r.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.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=r.getState(o.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="path"&&r.setState(u,{completeFraction:l})},focus:p(()=>{},"focus")};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?r.camera.focusOn([l.position]):(l==null?void 0:l.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(l))}),s.add(c,"visible"),o.type==="image"?s.add(c,"flipImageToFaceCamera"):(s.add(c,"interactive"),o.type==="path"&&s.add(c,"completeFraction",0,1,.1),o.type!=="model"&&(s.addColor(c,"color"),s.add(c,"outline"))),o.type==="geometry"&&(s.add(c,"height"),s.add(c,"opacity",0,1,.1))}else if(o.type==="marker"){let c={get interactive(){var u;let l=r.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=r.getState(o.id);(u==null?void 0:u.type)==="marker"&&(r.setState(u,{options:{interactive:l}}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},focus:p(()=>{},"focus")};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="marker"&&r.camera.focusOn([l.position])}),s.add(c,"interactive")}else if(o.type==="label"){let c={get interactive(){var u;let l=r.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=r.getState(o.id);(u==null?void 0:u.type)==="label"&&(r.setState(u,{options:{interactive:l}}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get text(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:l})},get"Text Color"(){var u,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(h=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:h.foregroundColor:"#000000"},set"Text Color"(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(o.id,{text:c.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var u,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(h=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:h.size:10},set"Text Size"(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var u,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.iconSize:10},set"Icon Size"(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var u,h,g;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(g=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.foregroundColor)==null?void 0:g.active:"#000000"},set"Active Foreground Color"(l){var h,g;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(g=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:g.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var u,h,g;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(g=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.foregroundColor)==null?void 0:g.inactive:"#000000"},set"Inactive Foreground Color"(l){var h,g;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(g=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:g.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var u,h,g;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(g=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.backgroundColor)==null?void 0:g.active:"#000000"},set"Active Background Color"(l){var h,g;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(g=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:g.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var u,h,g;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(g=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.backgroundColor)==null?void 0:g.inactive:"#000000"},set"Inactive Background Color"(l){var h,g;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(g=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:g.backgroundColor,inactive:l}}}}})},focus:p(()=>{},"focus")};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="label"&&r.camera.focusOn([l.position])}),s.add(c,"interactive"),s.add(c,"text"),s.add(c,"Text Size",10,50),s.add(c,"Icon Size",10,50),s.addColor(c,"Text Color"),s.addColor(c,"Active Background Color"),s.addColor(c,"Inactive Background Color"),s.addColor(c,"Active Foreground Color"),s.addColor(c,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let c={get opacity(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(o,{opacity:l})},set visible(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(o,{outline:l})},get outline(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var u,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(h=(u=l.shading)==null?void 0:u.start)!=null?h:0},set shadingStart(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{start:l}})},get shadingEnd(){var u,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(h=(u=l.shading)==null?void 0:u.end)!=null?h:0},set shadingEnd(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{end:l}})},get shadingIntensity(){var u,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(h=(u=l.shading)==null?void 0:u.intensity)!=null?h:0},set shadingIntensity(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{intensity:l}})}};s.add(c,"visible"),s.add(c,"opacity",0,1,.1),s.add(c,"interactive"),s.add(c,"outline"),s.add(c,"shadingStart",0,1,.1),s.add(c,"shadingEnd",0,1,.1),s.add(c,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let c={set visible(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="group-container"&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let u=r.getState(o.id);(u==null?void 0:u.type)==="group-container"&&(r.setState(u,{interactive:l}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};s.add(c,"visible"),s.add(c,"interactive")}if(s.close(),o.children)for(let c of o.children.values())i(c,s)},"parseChild")}p(eE,"createParseChild");function tE(r,t){let e=t.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};e.add(i,"padding",0,100,1),e.add(i,"scale",.5,1.5,.1),e.add(i,"color",["dark","light"]),e.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),e.add(i,"iconOnly"),e.onChange(()=>{r.updateWatermark(i)})}p(tE,"createWatermarkChild");var wx="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",rE="https://auth.mappedin.com/oauth2/token";async function Dx(r,t){var e,i,o,n,s;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled){let{Map:c,MercatorCoordinate:l}=await import("./outdoor-context-v4-TQU664W2.js"),u=t.outdoorView.headers;u==null&&(u=await Ub(rE));let h=t.center||[0,0],g=new c({container:r,style:t.outdoorView.style||wx,center:h,attributionControl:!1,zoom:(i=t.zoomLevel)!=null?i:x1,pitch:(o=t.pitch)!=null?o:C1,bearing:(n=t.bearing)!=null?n:S1,transformRequest:Gb(u),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Oa(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),y=g.painter.context.gl,v=new ap(r,{center:h,zoomLevel:g.getZoom(),pitch:g.getPitch(),bearing:g.getBearing(),gl:y,map:g,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}),b={center:g.getCenter().toArray(),zoom:g.getZoom(),bearing:g.getBearing(),pitch:g.getPitch()};g.setMinZoom(v.camera.minZoomLevel),g.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",w=>{b.center=w.center,b.zoom=w.zoomLevel,b.bearing=w.bearing,b.pitch=w.pitch,g.jumpTo(b)});let S=l.fromLngLat(h,0),C=Eu(S,v.viewCamera,v.camera,()=>{v.renderSync()});g.on("style.load",async()=>{g&&(g.addLayer(C),v.renderSync())});let x=!1,T=!1;g.on("idle",()=>{g&&(x||(v.publish("outdoor-view-loaded"),x=!0),T||(T=!0,v.publish("outdoor-style-loaded")))});let D=p(w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(g)},"updateData");return g.on("styledata",w=>{g&&w&&w.dataType==="style"&&w.type==="styledata"&&(T=!1),D(w)}),g.on("sourcedata",D),g.on("terrain",D),g.on("error",w=>{var E;if(((E=w.error)==null?void 0:E.url)===wx){A.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}A.warn(w)}),v}else return new ap(r,t)}p(Dx,"createRenderer");m();var sp=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(sp||{}),lp=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(lp||{});m();m();var Vs=class Vs{constructor(t,e,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",Vs.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===Vs.__type}get focusTarget(){return this.target.anchorTarget}};p(Vs,"Label"),d(Vs,"__type","Label");var Uo=Vs;m();var Qn,js=class js{constructor(t,e,i){d(this,"id");I(this,Qn);d(this,"__type",js.__type);d(this,"contentEl");this.id=t,this.contentEl=e,M(this,Qn,i)}get target(){return a(this,Qn)}get coordinate(){return a(this,Qn).anchorTarget}static is(t){return t.__type===js.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){M(this,Qn,t)}};Qn=new WeakMap,p(js,"Marker"),d(js,"__type","Marker");var Ni=js;m();var pp,up,Us=class Us{constructor(t,e,i){I(this,pp);I(this,up);d(this,"target");d(this,"__type",Us.__type);M(this,pp,t),M(this,up,e),this.target=i}static is(t){return t.__type===Us.__type}get id(){return a(this,pp)}get url(){return a(this,up)}};pp=new WeakMap,up=new WeakMap,p(Us,"Image"),d(Us,"__type","Image");var cp=Us;m();var Ws,Hs=class Hs{constructor(t,e,i){d(this,"id");d(this,"groupId");d(this,"__type",Hs.__type);I(this,Ws);this.id=t,this.groupId=e,M(this,Ws,i)}get target(){return a(this,Ws)}static is(t){return t.__type===Hs.__type}updateTarget(t){M(this,Ws,t)}};Ws=new WeakMap,p(Hs,"Model"),d(Hs,"__type","Model");var Kn=Hs;m();var Xs=class Xs{constructor(t,e){d(this,"id");d(this,"coordinates");d(this,"__type",Xs.__type);this.id=t,this.coordinates=e}static is(t){return t.__type===Xs.__type}get focusTarget(){return this.coordinates}};p(Xs,"PathSegment"),d(Xs,"__type","PathSegment");var Zs=Xs,Ys=class Ys{constructor(t,e,i,o){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"segments");d(this,"__type",Ys.__type);this.id=t,this.animation=e,this.coordinates=i,this.segments=o.map(({id:n,coordinates:s})=>new Zs(n.toString(),s))}static is(t){return t.__type===Ys.__type}get focusTarget(){return this.coordinates}};p(Ys,"Path"),d(Ys,"__type","Path");var Dr=Ys;m();var Ho,P1=class P1{constructor(t){I(this,Ho);M(this,Ho,t)}get center(){return a(this,Ho).center}get bearing(){return a(this,Ho).bearing}get pitch(){return a(this,Ho).pitch}get zoomLevel(){return a(this,Ho).zoomLevel}};Ho=new WeakMap,p(P1,"CameraTransform");var dp=P1;m();var zs=class zs{constructor(t){d(this,"id");d(this,"__type",zs.__type);this.id=t}static is(t){return t.__type===zs.__type}get focusTarget(){return this}};p(zs,"Shape"),d(zs,"__type","Shape");var Wo=zs;m();var hp=class hp{constructor(t,e){d(this,"id");d(this,"target");d(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===hp.__type}};p(hp,"Text3D"),d(hp,"__type","Text3D");var Xo=hp;m();m();m();var iE=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>']]),oE=/<svg([^>]*)>/g;function Ex(r,t,e){let i=iE.get(r);return i?i.replace(oE,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}p(Ex,"getStyledIcon");var nE=p(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></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(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),aE=p(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></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(r,'"\n />\n </svg>\n '),"getDestinationPin"),M1="#722ED1",T1="#1890FF",Ox=p(({type:r="departure",color:t=T1})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?nE(t):aE(t),"\n </div>"),"DroppedPin"),sE=p(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),Lx=p(({type:r="stairs",color:t=M1,direction:e="up"})=>{let i=sE("default"),o=i/2+2,n=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(Ex("connection-"+r+"-16x16","white",o)||"","\n </div>\n ").concat(n?'<div style="margin-left: -'.concat(i*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(i,"px; height: ").concat(i,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(o,"px; height: ").concat(o,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");m();var Ax=p(async r=>new Promise(t=>setTimeout(t,r)),"ms");var lE={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},cE={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},ea={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:lE,inactivePathOptions:cE,markerOptions:{departureColor:T1,destinationColor:M1}},Gi,Er,Vi,fe,mp,ji,ta,We,Or,Vt,Lr,Yo,Re,Fx,kx,w1,_h,qs,D1,$s,E1=class E1{constructor(t,e,i){I(this,Re);I(this,Gi,new Map);I(this,Er);I(this,Vi);I(this,fe,ea);I(this,mp);I(this,ji);I(this,ta);I(this,We,[]);I(this,Or);I(this,Vt,new Map);I(this,Lr,new Map);I(this,Yo,new Map);I(this,$s,p(t=>{var e;if((e=a(this,fe).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=a(this,Gi).get(t.markers[0]);i!=null&&i.action.toFloor&&(a(this,fe).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}},"#handleClick"));M(this,Er,t),M(this,mp,i),M(this,Vi,e)}get currentMap(){return a(this,mp).call(this)}get isMultiFloor(){if(!a(this,We).length)return!1;let t=new Set;for(let e of a(this,We))for(let i of e.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return a(this,Vt).get(t)}getMarkerById(t){return a(this,Gi).get(t)}get paths(){let t=new Set;return a(this,Vt).forEach(({path:e})=>t.add(e)),Array.from(t)}get activeDirections(){return a(this,Yo).get(a(this,Or))}get activePath(){var t;if(a(this,Or))return(t=a(this,Vt).get(a(this,Or).id))==null?void 0:t.path}get floorStacks(){let t=a(this,Vi).getMapData();if(!a(this,We).length||!t)return[];let e=new Set;for(let i of a(this,We))for(let o of i.coordinates)if(o.floorId){let n=t.getById("floor",o.floorId);n&&e.add(n.floorStack)}return Array.from(e)}get floors(){let t=a(this,Vi).getMapData();if(!a(this,We).length||!t)return[];let e=new Set;for(let i of a(this,We))for(let o of i.coordinates)if(o.floorId){let n=t.getById("floor",o.floorId);n&&e.add(n)}return Array.from(e)}setActivePathByIndex(t){let e=a(this,We)[t];if(!a(this,We).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,We)[t]){A.warn("Direction #".concat(t," does not exist"));return}let i=a(this,Lr).get(e);if(!i){A.warn("The direction is not a part of muli-direcional path");return}R(this,Re,_h).call(this,i)}setActivePath(t){if(!a(this,We).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Yo).get(t)){A.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}R(this,Re,_h).call(this,t)}setActivePathByDirections(t){if(!a(this,We).length){A.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=a(this,Lr).get(t);if(!e){A.warn("The direction is not a part of muli-direcional path");return}R(this,Re,_h).call(this,e)}drawSync(t,e={}){var c,l,u;a(this,ta)&&this.clear(),M(this,ta,!0),R(this,Re,w1).call(this,e);let i=Array.isArray(t)?t:[t],o=i[0],n=i[i.length-1],s=o.coordinates[0];M(this,We,i),s.floorId&&a(this,fe).setMapToDeparture&&this.currentMap.setFloor(s.floorId),(c=a(this,fe).createMarkers)!=null&&c.departure&&R(this,Re,qs).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let h=0;h<i.length;h++){let g=i[h],y=h?{...a(this,fe).inactivePathOptions}:{...a(this,fe).pathOptions};if(g.coordinates.length<2){A.warn("Directions must have at least 2 coordinates");return}let v=this.currentMap.Paths.add(g.coordinates,y),b=v.paths.map(C=>C.id.toString()),S=new Dr(Ce(),v.animation,g.coordinates,v.paths);for(let C of b){a(this,Vt).set(C,{path:S,entityIds:b});let x=h?{...a(this,fe).inactivePathOptions,altitude:0}:{...a(this,fe).pathOptions,altitude:.05};a(this,Er).setState(C,x)}a(this,Vt).set(S.id,{path:S,entityIds:b}),a(this,Lr).set(g,S),a(this,Yo).set(S,g),(l=a(this,fe).createMarkers)!=null&&l.connection&&R(this,Re,D1).call(this,g.instructions,"connection"),h===0&&(M(this,Or,a(this,Lr).get(a(this,We)[0])),a(this,Er).on("click",a(this,$s)))}(u=a(this,fe).createMarkers)!=null&&u.destination&&R(this,Re,qs).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),a(this,Vi).mapObjects.forEach(h=>{h.processFloorChange(h.currentFloorId)})}async draw(t,e={}){a(this,ji)&&this.clear(),R(this,Re,w1).call(this,e);let i=Array.isArray(t)?t:[t],n=i[0].coordinates[0];return M(this,We,i),n.floorId&&a(this,fe).setMapToDeparture&&this.currentMap.setFloor(n.floorId),R(this,Re,kx).call(this,i)}clear(){a(this,Gi).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),a(this,Gi).clear(),a(this,Vt).forEach(({path:t,entityIds:e})=>{a(this,Vt).delete(t.id),e.forEach(i=>a(this,Vt).delete(i)),this.currentMap.Paths.remove(e)}),a(this,ji)&&(a(this,ji).cancel(),M(this,ji,void 0)),a(this,ta)&&M(this,ta,!1),M(this,We,[]),a(this,Lr).clear(),a(this,Yo).clear(),M(this,Or,void 0),a(this,Er).off("click",a(this,$s)),a(this,Vi).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};Gi=new WeakMap,Er=new WeakMap,Vi=new WeakMap,fe=new WeakMap,mp=new WeakMap,ji=new WeakMap,ta=new WeakMap,We=new WeakMap,Or=new WeakMap,Vt=new WeakMap,Lr=new WeakMap,Yo=new WeakMap,Re=new WeakSet,Fx=p(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),kx=p(function(t){let e=t[0],i=t[t.length-1],o=!1;return M(this,ji,{promise:new Promise(async n=>{var s,c,l;if(P.env.NODE_ENV!=="test"&&await Ax(500),o||!t.length){n();return}(s=a(this,fe).createMarkers)!=null&&s.departure&&R(this,Re,qs).call(this,e.coordinates[0],"departure",e.instructions[0]);for(let u=0;u<t.length;u++){let h=t[u],g=u?{...a(this,fe).inactivePathOptions}:{...a(this,fe).pathOptions};if(h.coordinates.length<2){A.warn("Directions must have at least 2 coordinates"),n();return}let y=this.currentMap.Paths.add(h.coordinates,g),v=y.paths.map(S=>S.id.toString()),b=new Dr(Ce(),y.animation,h.coordinates,y.paths);for(let S of v){a(this,Vt).set(S,{path:b,entityIds:v});let C=u?{...a(this,fe).inactivePathOptions,altitude:0}:{...a(this,fe).pathOptions,altitude:.05};a(this,Er).setState(S,C)}if(a(this,Vt).set(b.id,{path:b,entityIds:v}),a(this,Lr).set(h,b),a(this,Yo).set(b,h),P.env.NODE_ENV!=="test"&&await y.animation,o){n();return}(c=a(this,fe).createMarkers)!=null&&c.connection&&R(this,Re,D1).call(this,h.instructions,"connection"),u===0&&(M(this,Or,a(this,Lr).get(a(this,We)[0])),a(this,Er).on("click",a(this,$s)))}if((l=a(this,fe).createMarkers)!=null&&l.destination&&R(this,Re,qs).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),o){n();return}a(this,Vi).mapObjects.forEach(u=>{u.processFloorChange(u.currentFloorId)}),n()}),cancel:p(()=>{o=!0},"cancel")}),a(this,ji).promise},"#drawAsync"),w1=p(function(t){var e,i;M(this,fe,{setMapOnConnectionClick:(e=t.setMapOnConnectionClick)!=null?e:ea.setMapOnConnectionClick,setMapToDeparture:(i=t.setMapToDeparture)!=null?i:ea.setMapToDeparture,pathOptions:{...ea.pathOptions,...t.pathOptions},inactivePathOptions:{...ea.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...ea.createMarkers,...t.createMarkers},markerOptions:{...ea.markerOptions,...t.markerOptions}})},"#setupOptions"),_h=p(function(t){M(this,Or,t),a(this,We).forEach(e=>{let i=a(this,Lr).get(e);if(i){let o=a(this,Vt).get(i.id),n=o.path.id===a(this,Or).id?{...a(this,fe).pathOptions,altitude:.05}:{...a(this,fe).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{a(this,Er).setState(s,n)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),qs=p(function(t,e,i){var o,n,s,c,l;if(e==="connection"&&i){let u=i.action.type==="ExitConnection"?a(this,fe).markerOptions.departureColor:a(this,fe).markerOptions.destinationColor,h;if(typeof((o=a(this,fe).createMarkers)==null?void 0:o.connection)=="function"){let y=a(this,fe).createMarkers.connection(i);a(this,Er).setState(y.id.toString(),{options:{interactive:!0}}),h={id:y.id,type:"marker"}}else h=this.currentMap.Markers.add(i.coordinate,Lx({type:(s=(n=i.action.connection)==null?void 0:n.type)!=null?s:i.action.connectionType,color:u,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let g=this.currentMap.Markers.getContentEl(h.id.toString());if(!g)throw new Error("marker component should exist");a(this,Gi).set(h.id,{instruction:i,marker:new Ni(h.id.toString(),g,i.coordinate)})}else{let u=e==="departure"?a(this,fe).markerOptions.departureColor:a(this,fe).markerOptions.destinationColor,h;typeof((c=a(this,fe).createMarkers)==null?void 0:c.departure)=="function"&&e==="departure"?h={id:a(this,fe).createMarkers.departure(i).id,type:"marker"}:typeof((l=a(this,fe).createMarkers)==null?void 0:l.destination)=="function"&&e==="destination"?h={id:a(this,fe).createMarkers.destination(i).id,type:"marker"}:h=this.currentMap.Markers.add(t,Ox({type:e,color:u}),{anchor:"top",rank:"always-visible"}),a(this,Gi).set(h.id,void 0)}},"#addMarker"),D1=p(function(t,e){t.filter(o=>R(this,Re,Fx).call(this,o.action)).forEach(o=>{R(this,Re,qs).call(this,o.coordinate,e,o)})},"#addMarkers"),$s=new WeakMap,p(E1,"Navigation");var fp=E1;m();m();m();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 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>']]),uE=/<svg([^>]*)>/g;function Bx(r,t,e){let i=pE.get(r);return i?i.replace(uE,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}p(Bx,"getStyledIcon");var ra,Js,jt,O1,_x,Rx,L1,Nx,A1=class A1{constructor(t,e){I(this,jt);I(this,ra);I(this,Js);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});M(this,ra,t),M(this,Js,e)}auto(){let t=[],e=a(this,Js)[Object.keys(a(this,Js))[0]];return[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(i=>{if(i.__type==="connection")i.coordinates.forEach(o=>{let n=i.name||i.externalId;if(n){let s=a(this,ra).Labels.add(o,n,R(this,jt,O1).call(this,i));t.push(s)}});else{i.__type==="space"&&i.name!==""&&a(this,ra).updateState(i,{interactive:!0,hoverColor:"#F0F0F0"});let o=i.name||i.externalId;if(o){let n=a(this,ra).Labels.add(i,o,R(this,jt,O1).call(this,i));t.push(n)}}}),{labels:t}}};ra=new WeakMap,Js=new WeakMap,jt=new WeakSet,O1=p(function(t){let e=Bx(R(this,jt,_x).call(this,t),"white",12);return{appearance:{text:{foregroundColor:R(this,jt,L1).call(this,t)},marker:{foregroundColor:{active:R(this,jt,L1).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:R(this,jt,Nx).call(this,t)}},"#generatLabelAppearance"),_x=p(function(t){return t.__type==="connection"?R(this,jt,Rx).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),Rx=p(function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},"#attemptIconNameForConnection"),L1=p(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),Nx=p(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),p(A1,"Labels");var Rh=A1;var F1=class F1{constructor(t,e){d(this,"Labels");d(this,"auto",p(()=>this.Labels.auto(),"auto"));this.Labels=new Rh(t,e)}};p(F1,"DefaultTheme");var Nh=F1;m();var re,yp,Ui,Gh,k1,B1=class B1{constructor(t){I(this,Ui);I(this,re);I(this,yp);d(this,"interactions",{set:p(t=>{(t==null?void 0:t.pan)!=null&&(a(this,re).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(a(this,re).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(a(this,re).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:p(()=>{a(this,re).getSystems().cameraSystem.enablePan=!0,a(this,re).getSystems().cameraSystem.enableZoom=!0,a(this,re).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:p(()=>{a(this,re).getSystems().cameraSystem.enablePan=!1,a(this,re).getSystems().cameraSystem.enableZoom=!1,a(this,re).getSystems().cameraSystem.enableRotate=!1},"disable")});d(this,"setMinPitch",p(t=>{a(this,re).camera.setMinPitch(t)},"setMinPitch"));d(this,"setMaxPitch",p(t=>{a(this,re).camera.setMaxPitch(t)},"setMaxPitch"));d(this,"setMinZoomLevel",p(t=>{a(this,re).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",p(t=>{a(this,re).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));M(this,yp,t),M(this,re,t.core)}setScreenOffsets(t){a(this,re).camera.setInsetPadding(t)}get screenOffsets(){return a(this,re).camera.insetsPadding}get panMode(){return a(this,re).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&a(this,re).camera.setPanMode(t)}getFocusOnTransform(t,e){var o;let i=a(this,re).camera.getCameraFrameForCoordinates(R(this,Ui,k1).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,verticalPadding:(o=e==null?void 0:e.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing});return{center:new Q(i.center[1],i.center[0]),zoomLevel:i.zoomLevel}}focusOn(t,e){var i;return a(this,re).camera.focusOn(R(this,Ui,k1).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,verticalPadding:(i=e==null?void 0:e.axisAlignedPadding)==null?void 0:i.vertical,easing:e==null?void 0:e.easing})}animateTo(t,e){var l;let{center:i,zoomLevel:o,bearing:n,pitch:s}=t,c=i!=null?i:this.center;return a(this,re).camera.animateTo({center:i!=null?[c.longitude,c.latitude,a(this,re).camera.elevation]:void 0,zoomLevel:o,bearing:n,pitch:s,duration:(l=e==null?void 0:e.duration)!=null?l:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:i=this.zoomLevel,bearing:o=this.bearing,pitch:n=this.pitch}=t,s=[e.longitude,e.latitude];a(this,re).camera.setCenter(s),a(this,re).camera.setZoomLevel(i),a(this,re).camera.setBearing(o),a(this,re).camera.setPitch(n)}get center(){let t=a(this,re).camera.center;return new Q(t[1],t[0],void 0)}setAutoMinZoomLevel(t){a(this,re).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return a(this,re).camera.autoMinZoomLevel}get zoomLevel(){return a(this,re).camera.zoomLevel}get pitch(){return a(this,re).camera.pitch}get minPitch(){return a(this,re).camera.minPitch}get maxPitch(){return a(this,re).camera.maxPitch}get bearing(){let t=a(this,re).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return a(this,re).camera.minZoomLevel}get maxZoomLevel(){return a(this,re).camera.maxZoomLevel}setElevation(t){a(this,re).camera.setElevation(t)}get elevation(){return a(this,re).camera.elevation}animateElevation(t,e){return a(this,re).camera.animateElevation(t,e)}};re=new WeakMap,yp=new WeakMap,Ui=new WeakSet,Gh=p(function(t){var i,o,n,s,c,l;let e=a(this,re).camera.elevation;return Q.is(t)&&t.floorId!=null?(o=(i=a(this,re).getState(t.floorId))==null?void 0:i.altitude)!=null?o:e:Bt.is(t)?(s=(n=a(this,re).getState(t.id))==null?void 0:n.altitude)!=null?s:e:"floor"in t&&Bt.is(t.floor)&&(l=(c=a(this,re).getState(t.floor.id))==null?void 0:c.altitude)!=null?l:e},"#getFloorAltitude"),k1=p(function(t){var n;let e=[],o=(Array.isArray(t)?t:[t]).flatMap(s=>{var c;return(c=s==null?void 0:s.focusTarget)!=null?c:[s]});for(let s of o)if(s!=null)if(Q.is(s)){let c=R(this,Ui,Gh).call(this,s);e.push([s.longitude,s.latitude,c])}else if((s==null?void 0:s.id)!=null){let c=R(this,Ui,Gh).call(this,s);if(Bt.is(s)&&((n=a(this,yp).getMapDataInternal())!=null&&n.enterpriseMode)){e.push(s.id);continue}else if("geoJSON"in s&&s.geoJSON.geometry.coordinates.length>0){Tb(s.geoJSON,u=>{e.push([u[0],u[1],c])});continue}let l=a(this,re).getBoundingArea(s.id);if(l)e.push(...l.map(u=>[u[0],u[1],c]));else if("geoJSONBoundingBox"in s){let u=R(this,Ui,Gh).call(this,s);if(s.geoJSONBoundingBox!=null){let h=[[s.geoJSONBoundingBox[0],s.geoJSONBoundingBox[1],u],[s.geoJSONBoundingBox[2],s.geoJSONBoundingBox[3],u]];e.push(...h)}}}else Vf(s)&&e.push(s);return e},"#computeCoordinateCloud"),p(B1,"Camera");var gp=B1;m();var Qs,_1=class _1{constructor({currentMapGetter:t}){I(this,Qs);M(this,Qs,t)}get currentMap(){return a(this,Qs).call(this)}async getCurrentSceneGLTF(t){let e=a(this,Qs).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(A.error("There is no map to export. Please load a map first."),new Blob)}};Qs=new WeakMap,p(_1,"Exporter");var bp=_1;m();var oi,Cp,R1=class R1{constructor({currentMapGetter:t}){I(this,oi,new Map);I(this,Cp);M(this,Cp,t)}get currentMap(){return a(this,Cp).call(this)}getById(t){return a(this,oi).get(t)}add(t,e,i){let o=t.anchorTarget,n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Labels.add(o,e,{...i,parentId:Ge.is(t)||_t.is(t)?t.id:void 0,floorId:o.floorId,rank:(i==null?void 0:i.rank)==null||(i==null?void 0:i.rank)==="initial"?"medium":i.rank}),c=new Uo(s.id.toString(),e,t);return a(this,oi).set(c.id,{label:c,entityId:c.id}),c}all(t){var i;let e=[];return(i=this.currentMap)==null||i.Labels.all({onCreate:p((o,n,s)=>{let c=new Uo(o.toString(),n,s);a(this,oi).set(c.id,{label:c,entityId:c.id}),e.push(c)},"onCreate"),labelOptions:t}),e}remove(t){var i;let e=a(this,oi).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),a(this,oi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,oi).forEach(({label:e})=>{this.remove(e),t.push(e),a(this,oi).delete(e.id.toString())}),t}};oi=new WeakMap,Cp=new WeakMap,p(R1,"Labels");var vp=R1;m();m();var N1={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},Gx={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},Vx=.5,j1=class j1{constructor(t,e,i=new Map){d(this,"containerId");d(this,"labelIds",new Set);d(this,"layers");d(this,"renderer");this.containerId=e,this.layers=i,this.renderer=t}show(){this.renderer.setState(this.containerId,{visible:!0});for(let t of this.labelIds)this.renderer.setState(t,{visible:!0})}hide(){this.renderer.setState(this.containerId,{visible:!1});for(let t of this.labelIds)this.renderer.setState(t,{visible:!1})}};p(j1,"Layer");var Zo=j1,ia,U1=class U1{constructor(t,e,i,o,n,s,c){d(this,"id");d(this,"name");d(this,"elevation");d(this,"containerId");d(this,"externalId");d(this,"metadata");d(this,"shortName");d(this,"subtitle");d(this,"occluderId");d(this,"loaded",!1);d(this,"styleMap",{});d(this,"obstructions");d(this,"entrances");d(this,"spaces");d(this,"floorImages");d(this,"floorText");d(this,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"footprint");d(this,"floorStackId");d(this,"multiFloorView");I(this,ia);d(this,"load",p(()=>{var o,n,s,c,l,u,h,g,y,v;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Ti,"-").concat(this.id),{},this.id);this.layers.set(Ti,new Zo(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(zr,"-").concat(this.id),{},this.id);this.layers.set(zr,new Zo(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(we,"-").concat(this.id),{},this.id);if(this.layers.set(we,new Zo(this.renderer,i.id.toString())),((o=this.footprint)==null?void 0:o.geometry)!=null&&((n=this.footprint)==null?void 0:n.geometry.coordinates.length)!==0){let b=this.renderer.addGroupContainer("".concat(qa,"-").concat(this.id),{},this.id);this.layers.set(qa,new Zo(this.renderer,b.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,b.id)}if(this.spaces!=null&&this.spaces.features.length>0){let b=this.spaces.features.filter(T=>{var D;return T.geometry.type==="Polygon"&&((D=T.properties.kind)==null?void 0:D.toLowerCase())!=="void"}),S=V1(b,this.styleMap),C=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),x=0;for(let[T,D]of S){let w=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(x),{features:D},Sp(T,this.options),C);x++;let E=C.id.toString();this.layers.get(we).layers.set(T.id||E,w.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let b=this.obstructions.features.filter(L=>L.geometry.type==="Polygon"&&L.properties.kind==="object"),S=V1(b,this.styleMap),C=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),x=0;for(let[L,_]of S){let B=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(x),{features:_},Sp(L,this.options),C);x++;let V=C.id.toString();this.layers.get(we).layers.set(L.id||V,B.id.toString())}let T=this.obstructions.features.filter(L=>L.geometry.type==="LineString"&&L.properties.kind==="Wall"&&L.properties.footprintComponent===!1),D=this.obstructions.features.filter(L=>L.geometry.type==="LineString"&&L.properties.kind==="Wall"&&L.properties.footprintComponent===!0),w=this.entrances,E=N1,k=N1;if(T!=null&&T.length>0){let L=this.styleMap[(s=T[0].properties)==null?void 0:s.id];L!=null&&(E={...L}),k=E;let{walls:_,entrances:B}=G1(T,(w==null?void 0:w.features)||[]),V=Math.max(E.height-.11,Vx),j={...Gx,height:V},Y=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),B,j,i);this.layers.get(we).layers.set(Ya,Y.id.toString());let ie=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[_]},Sp(E,this.options),i);this.layers.get(we).layers.set(go,ie.id.toString())}if(D!=null&&D.length>0){let L=this.styleMap[(c=D[0].properties)==null?void 0:c.id];L!=null&&(k={...L,id:Zr});let{walls:_,entrances:B}=G1(D,(w==null?void 0:w.features)||[]),V=Math.max(k.height-.11,Vx),j={...Gx,height:V},Y=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),B,j,i);this.layers.get(we).layers.set(Za,Y.id.toString());let ie=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[_]},Sp(k,this.options),i);this.layers.get(we).layers.set(Zr,ie.id.toString())}}if(this.floorImages!=null){let b=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let S of this.floorImages.features||[])"anchorId"in S.properties||"anchorId"in S.properties&&((l=S.properties)==null?void 0:l.anchorId)==null||this.renderer.addImage(Ce(),S,{url:S.properties.path,flipImageToFaceCamera:(u=this.options.flipImagesToFaceCamera)!=null?u:!0},b);this.layers.set(Sv,new Zo(this.renderer,b.id.toString()))}if(this.floorText!=null)for(let b of this.floorText.features||[]){let S=0;"geometryId"in b.properties?S=(g=(h=this.renderer.getState(b.properties.geometryId))==null?void 0:h.height)!=null?g:0:S=(y=b.properties.verticalOffset)!=null?y:0,this.renderer.addText3D(Ce(),{...b,properties:{...b.properties,verticalOffset:S}},{},this.id)}return(v=this.multiFloorView)!=null&&v.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var u,h,g,y,v,b;this.id=e.id,this.options=n;let l=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);if(this.containerId=l.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,s!=null&&c!=null&&(this.styleMap=c,this.spaces=s.space[this.id],this.entrances=s.entrance[this.id],this.obstructions=s.obstruction[this.id],this.floorImages=(u=s.floorImages)==null?void 0:u[this.id],this.floorText=(g=(h=s.enterprise)==null?void 0:h.floorText)==null?void 0:g[this.id],this.footprint=(y=s["floor.geojson"])==null?void 0:y.features.find(S=>S.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=o,this.footprint&&((v=this.multiFloorView)!=null&&v.enabled)){let S=N1;if(this.obstructions!=null&&this.obstructions.features.length>0){let x=this.obstructions.features.filter(T=>T.geometry.type==="LineString"&&T.properties.kind==="Wall"&&T.properties.footprintComponent===!0);x!=null&&x.length>0&&(S=this.styleMap[(b=x[0].properties)==null?void 0:b.id])}let C=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...S,height:this.multiFloorView.floorHeight,altitude:0,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":S.color},this.id);this.layers.set(za,new Zo(this.renderer,C.id.toString()))}}get geoJSONBoundingBox(){if(a(this,ia))return a(this,ia);if(!this.footprint){A.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return M(this,ia,Vh(this.footprint)),a(this,ia)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};ia=new WeakMap,p(U1,"FloorObject");var xp=U1;m();var H1=50,W1=!1,dE=1e3,Oe,Ks,ni,Ar,ct,Pp,qo,el,oa,Ut,Y1,na,Mp,Tp,wp,Dp,Hi,Wx,Ep,$o,Z1,Xx,Yx,aa,z1=class z1 extends te{constructor({currentMapGetter:e}){super();I(this,Ut);I(this,Oe);I(this,Ks,0);I(this,ni);I(this,Ar,!1);I(this,ct,[]);I(this,Pp,0);I(this,qo,H1);I(this,el,!1);I(this,oa,"collapsed");d(this,"expandedFactor",0);I(this,na,"all-floors");I(this,Mp,p(()=>{let e=a(this,Oe).call(this);if(a(this,Pp)===this.expandedFactor||e==null||!a(this,Ar))return;M(this,Pp,this.expandedFactor);let i=co(this.expandedFactor,0,1,0,this.distanceBetweenFloors),n=co(this.expandedFactor,0,.1,0,1)===0;a(this,ct).forEach((s,c)=>{e.renderer.setState(s.containerId,{visible:n?s.id===e.currentFloorId:!0,altitude:i*c})}),this.expandedFactor===0?(M(this,Ar,!1),e.renderer.camera.setPanMode("default"),a(this,$o)&&a(this,$o).call(this)):this.expandedFactor===1&&(M(this,Ar,!1),a(this,$o)&&a(this,$o).call(this))},"#handlePreRender"));I(this,Tp,p(()=>{var e,i,o;this.expanded&&M(this,Ks,(i=(e=a(this,Oe).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(o=a(this,Oe).call(this))==null||o.renderer.on("user-interaction-end",a(this,Dp))},"#handleUserInteractionStart"));I(this,wp,p(()=>{var i;let e=a(this,Oe).call(this);if(e!=null&&this.expanded&&a(this,el)&&!a(this,Ar)){let o=e.currentFloorId,n=[1/0,e.currentFloorId];for(let s=0;s<a(this,ct).length;s++){let c=a(this,ct)[s],l=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-s*this.distanceBetweenFloors);l<this.distanceBetweenFloors/3&&(n[0]=l,n[1]=c.id)}n[1]!==e.currentFloorId&&(e.currentFloorId=n[1],a(this,ct).forEach(s=>{e.renderer.setState(s.containerId,{visible:a(this,na)==="all-floors"?!0:e.currentFloor.id===s.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId,previousFloorId:o}))}},"#determineCurrentMapBasedOnElevation"));I(this,Dp,p(()=>{var i,o;let e=a(this,Oe).call(this);if(this.expanded&&e&&a(this,Ks)!==((i=e.renderer.camera.elevation)!=null?i:0)){let n=[1/0,e.currentFloorId,0];for(let s=0;s<a(this,ct).length;s++){let c=a(this,ct)[s],l=Math.abs(((o=e.renderer.camera.elevation)!=null?o:0)-s*this.distanceBetweenFloors);l<n[0]&&(n[0]=l,n[1]=c.id,n[2]=s*this.distanceBetweenFloors)}a(this,el)&&R(this,Ut,Wx).call(this,n[2]),M(this,Ks,0),e.renderer.off("user-interaction-end",a(this,Dp))}},"#handleUserInteractionEnd"));I(this,Hi,null);I(this,Ep,null);I(this,$o);I(this,aa);M(this,Oe,e);let i=a(this,Oe).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",a(this,Tp)),i.renderer.on("camera-change",a(this,wp)),i.renderer.on("pre-render",a(this,Mp)))}get state(){return a(this,oa)}get expanded(){return a(this,oa)!=="collapsed"}get distanceBetweenFloors(){if(a(this,qo)==="auto"){if(a(this,aa)!=null)return a(this,aa);let e=R(this,Ut,Yx).call(this);if(e)return M(this,aa,e),e}return typeof a(this,qo)=="number"?a(this,qo):H1}clearCachedFloorSeparationDistance(){M(this,aa,void 0)}get includedFloors(){var e;return(e=a(this,Ut,Y1))!=null&&e.api.mapData?a(this,ct).map(i=>{var o,n;return(n=(o=a(this,Ut,Y1))==null?void 0:o.api.mapData)==null?void 0:n.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return a(this,na)}setFloorVisiblityMode(e){M(this,na,e);let i=a(this,Oe).call(this);i!=null&&a(this,ct).forEach(o=>{i.renderer.setState(o.containerId,{visible:a(this,na)==="all-floors"?!0:i.currentFloor.id===o.id})})}changeFloorOnElevationChanges(e){M(this,el,e)}async expand(e){var o,n,s;let i=a(this,Oe).call(this);if(i!=null)return(e==null?void 0:e.distanceBetweenFloors)==="auto"?M(this,qo,"auto"):M(this,qo,(o=e==null?void 0:e.distanceBetweenFloors)!=null?o:H1),M(this,ct,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(c=>i.floorsById.get(c.id)).filter(Boolean):i.currentFloorStack.floorObjects),a(this,ct).sort((c,l)=>c.elevation-l.elevation),a(this,ct).length<=1||this.expanded===!0?Promise.resolve():(M(this,Ar,!0),i.api.Camera.setPanMode((n=e==null?void 0:e.cameraPanMode)!=null?n:"elevation"),this.changeFloorOnElevationChanges((s=e==null?void 0:e.changeFloorOnElevationChanges)!=null?s:!0),R(this,Ut,Z1).call(this,"expand",e).then(()=>{M(this,oa,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{M(this,Ar,!1)}))}async collapse(e){let i=a(this,Oe).call(this);if(i!=null)return this.expanded===!0?(M(this,Ar,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),R(this,Ut,Z1).call(this,"collapse",e).then(()=>{M(this,oa,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{M(this,Ar,!1)})):Promise.resolve()}destroy(){let e=a(this,Oe).call(this);e!=null&&(e.renderer.off("user-interaction-start",a(this,Tp)),e.renderer.off("camera-change",a(this,wp)),e.renderer.off("pre-render",a(this,Mp)))}};Oe=new WeakMap,Ks=new WeakMap,ni=new WeakMap,Ar=new WeakMap,ct=new WeakMap,Pp=new WeakMap,qo=new WeakMap,el=new WeakMap,oa=new WeakMap,Ut=new WeakSet,Y1=p(function(){return a(this,Oe).call(this)},"#currentMap"),na=new WeakMap,Mp=new WeakMap,Tp=new WeakMap,wp=new WeakMap,Dp=new WeakMap,Hi=new WeakMap,Wx=p(function(e){var o,n,s;a(this,Hi)&&a(this,Hi).stop();let i=a(this,Oe).call(this);i!=null&&(M(this,Hi,new Gt({elevation:(o=i.renderer.camera.elevation)!=null?o:0}).to({elevation:e},150).easing(Fe.Quadratic.Out).onComplete(()=>{var c;a(this,Hi)&&((c=a(this,Oe).call(this))==null||c.renderer.getTweenGroup().remove(a(this,Hi)))}).onUpdate(({elevation:c})=>{i.renderer.camera.setElevation(c)}).start()),(n=a(this,Oe).call(this))==null||n.renderer.getTweenGroup().add(a(this,Hi)),(s=a(this,Oe).call(this))==null||s.renderer.render())},"#animateElevationTo"),Ep=new WeakMap,$o=new WeakMap,Z1=p(function(e,i){var c,l,u,h;a(this,ni)&&a(this,ni).stop();let o=a(this,Oe).call(this);if(o==null)return Promise.reject(new Error("No current map"));let n=a(this,ct).indexOf(o.currentFloor),s=(c=o.renderer.camera.elevation)!=null?c:0;return M(this,Ep,new Promise(g=>{M(this,$o,g)})),M(this,ni,new Gt({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:dE).easing(As[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:g})=>{this.expandedFactor=g;let y=n*this.distanceBetweenFloors;o.renderer.camera.setElevation(e==="expand"?y*g:s*g)}).onComplete(()=>{var g;a(this,ni)&&((g=a(this,Oe).call(this))==null||g.renderer.getTweenGroup().remove(a(this,ni)))}).start()),a(this,ni).cameraAnimation=!0,(u=a(this,Oe).call(this))==null||u.renderer.getTweenGroup().add(a(this,ni)),(h=a(this,Oe).call(this))==null||h.renderer.render(),a(this,Ep)},"#animate"),Xx=p(function(e,i,o,n){let s=X1(e,o),c=i.clone(),l=X1(c,o);if(!dn(s)||!dn(l))return-1;let u=0,h;W1&&n.querySelectorAll(".debug-box").forEach(y=>y.remove());do{if(u>1e4)return-1;if(u+=20,c.position.z=u,c.updateMatrixWorld(),l.makeEmpty(),X1(c,o,l),h=s.intersectsBox(l),W1){let g=Hx(s,"blue",n),y=Hx(l,h?"red":"green",n);g.classList.add("debug-box"),y.classList.add("debug-box")}}while(h);return u},"#computeMinZOffsetToSeparateFirstTwoFloors"),Yx=p(function(){let e=a(this,Oe).call(this);if(!e)return;let i=e.renderer,o=i.getThreeScene();if(!e.api.mapData||!o)return;let s=a(this,ct).length>0?a(this,ct):e.currentFloorStack.floorObjects;if(s.length<2)return;let c=i.getInternalState().geometry3DMap.get(s[0].id),l=i.getInternalState().geometry3DMap.get(s[1].id);if(!c||!l)return;if(lf(c,"group-container"),lf(l,"group-container"),W1){let h=new dt;h.setFromObject(c);let g=new dt;if(g.setFromObject(l),c.children.forEach(T=>{T instanceof ne&&T.userData.debugBox&&Ne(T)}),l.children.forEach(T=>{T instanceof ne&&T.userData.debugBox&&Ne(T)}),!dn(h)||!dn(g))return;let y=new mi(h.max.x-h.min.x,h.max.y-h.min.y,h.max.z-h.min.z),v=new vt({color:255,transparent:!0,opacity:.5}),b=new ne(y,v);b.position.set((h.min.x+h.max.x)/2,(h.min.y+h.max.y)/2,(h.min.z+h.max.z)/2),b.userData.debugBox=!0;let S=new mi(g.max.x-g.min.x,g.max.y-g.min.y,g.max.z-g.min.z),C=new vt({color:"cyan",transparent:!0,opacity:.5}),x=new ne(S,C);x.position.set((g.min.x+g.max.x)/2,(g.min.y+g.max.y)/2,(g.min.z+g.max.z)/2),x.userData.debugBox=!0,c.add(b),l.add(x)}let u=R(this,Ut,Xx).call(this,c,l,i.getThreeCamera(),i.container);if(u!==-1)return u},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),aa=new WeakMap,p(z1,"StackedMaps");var Ip=z1,zo=new q,jx=new ee;function X1(r,t,e=new gb){return r.traverse(i=>{if(i instanceof ne){let n=i.geometry.attributes.position;if(t.position.distanceTo(i.position)<t.near)return;for(let c=0;c<n.count;c++)zo.fromBufferAttribute(n,c),zo.applyMatrix4(i.matrixWorld),zo.applyMatrix4(t.matrixWorldInverse),zo.applyMatrix4(t.projectionMatrix),zo.z<1&&zo.z>0&&(jx.set(zo.x,zo.y),e.expandByPoint(jx))}}),e}p(X1,"projectToBox2D");function Ux(r,t){let e=t.clientWidth,i=t.clientHeight;return new ee((r.x+1)*e/2,(1-r.y)*i/2)}p(Ux,"ndcToScreen");function Hx(r,t,e){let i=document.createElement("div");i.style.position="absolute",i.style.border="2px solid ".concat(t),i.style.pointerEvents="none";let o=Ux(new ee(r.min.x,r.min.y),e),n=Ux(new ee(r.max.x,r.max.y),e);i.style.left="".concat(o.x,"px"),i.style.top="".concat(n.y,"px");let s=Math.abs(n.x-o.x),c=Math.abs(n.y-o.y);return i.style.width="".concat(s,"px"),i.style.height="".concat(c,"px"),e.appendChild(i),i}p(Hx,"drawProjectedBox");m();var tl,q1=class q1{constructor(t,e,i,o){d(this,"id");d(this,"externalId");d(this,"name");d(this,"type");d(this,"floorIds");d(this,"defaultFloorId");d(this,"floorObjects",[]);d(this,"floorObjectsByElevation",new Map);d(this,"metadata");d(this,"containerId");d(this,"facade");d(this,"renderer");I(this,tl);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=i;let n=i.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=n.id.toString(),this.facade=o}get defaultFloor(){if(a(this,tl)==null){this.floorObjects.length===0&&A.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),M(this,tl,t)}return a(this,tl)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){A.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 e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(o=>{this.renderer.setState(o.spaceId,{visible:t})})}};tl=new WeakMap,p(q1,"FloorStackObject");var Op=q1;m();function Zx(r,t,e,i){let o={outdoorOpacity:1,floorStates:[]};for(let n=0;n<r.length;n++){let s=r[n];o.floorStates.push({floor:s,visible:!1,visibleLayers:[],footprint:{height:0,altitude:0}}),s.id===t.id?(o.floorStates[n].visible=!0,o.floorStates[n].visibleLayers=[zr,we,Ti,qa],s.elevation<0&&(o.outdoorOpacity=.2,o.floorStates[n].footprint.height=Math.abs(s.elevation)*e,o.floorStates[n].footprint.altitude=0,o.floorStates[n].visibleLayers.push(za))):i.includes(s.id)&&s.elevation<t.elevation?(o.floorStates[n].visible=!0,o.floorStates[n].visibleLayers=[za,zr,we,qa],s.elevation<0?(o.floorStates[n].footprint.height=Math.abs(s.elevation)*e,o.floorStates[n].footprint.altitude=0,o.outdoorOpacity=.2):(o.floorStates[n].footprint.height=e,o.floorStates[n].footprint.altitude=0)):t.elevation>0&&s.elevation<t.elevation&&s.elevation>=0&&(o.floorStates[n].visible=!0,o.floorStates[n].visibleLayers=[za],o.floorStates[n].footprint.height=e,o.floorStates[n].footprint.altitude=0)}return o}p(Zx,"getVisiblityState");m();m();m();m();var rl,sa,Qe,Ap,la,Fp,kp,il,Et,$1=class $1{constructor(t,e,i){d(this,"id");I(this,rl);I(this,sa);I(this,Qe);I(this,Ap);I(this,la,[]);I(this,Fp,!1);I(this,kp,1);I(this,il,new Map);I(this,Et);this.id=t.id,M(this,rl,t),M(this,sa,e),M(this,Qe,i),this.setDefaultFloor(this.defaultFloor)}get floorStack(){return a(this,sa)}get defaultFloor(){var t;return(t=a(this,Ap))!=null?t:a(this,sa).defaultFloor}setDefaultFloor(t){a(this,la).forEach(e=>{a(this,Qe).setState(a(this,Qe).getState(e),{opacity:1})}),a(this,Et)&&(this.defaultFloor.setVisible(!1),t.setVisible(!0)),M(this,Ap,t),this.updateChildGeometryIds(t)}updateChildGeometryIds(t){M(this,la,[]);let e=a(this,Qe).getState(t.layers.get(we).containerId);for(let i of e.children){let o=a(this,Qe).getState(i);for(let n of o.children){let s=a(this,Qe).getState(n);s&&a(this,la).push(s.id.toString())}}}set focusable(t){M(this,Fp,t),a(this,rl).spaces.forEach(e=>{let i=a(this,Qe).getState(e.id);i&&a(this,Qe).setState(i,{focusable:t,renderOrder:t?2:0})})}get focusable(){return a(this,Fp)}set opacity(t){M(this,kp,t),a(this,rl).spaces.forEach(e=>{let i=a(this,Qe).getState(e.id);i&&(a(this,il).has(e.id)||a(this,il).set(e.id,i.opacity),a(this,Qe).setState(i,{opacity:Math.min(a(this,il).get(e.id),t)}))})}get opacity(){return a(this,kp)}animateOpacity(t,{duration:e=300,onEnd:i}={}){a(this,Et)&&a(this,Et).stop(),t<1&&this.defaultFloor.setVisible(!0),M(this,Et,new Gt({opacity:this.opacity}).easing(Fe.Quadratic.In).to({opacity:t},e).onUpdate(({opacity:o})=>{this.opacity=o,a(this,la).forEach(n=>{a(this,Qe).setState(a(this,Qe).getState(n),{opacity:1-o})})}).onStop(()=>{a(this,Et)&&(a(this,Qe).getTweenGroup().remove(a(this,Et)),M(this,Et,void 0)),i==null||i()}).onComplete(()=>{a(this,Et)&&(a(this,Qe).getTweenGroup().remove(a(this,Et)),M(this,Et,void 0)),this.opacity===1&&a(this,sa).floorObjects.forEach(o=>{o.setVisible(!1)}),i==null||i()})),a(this,Et).start(),a(this,Qe).getTweenGroup().add(a(this,Et)),a(this,Qe).render()}};rl=new WeakMap,sa=new WeakMap,Qe=new WeakMap,Ap=new WeakMap,la=new WeakMap,Fp=new WeakMap,kp=new WeakMap,il=new WeakMap,Et=new WeakMap,p($1,"FacadeObject");var Lp=$1;var qx=!1,Fr,ca,ol,Jo,Bp,pa,kr,ai,_p,ge,it,$x,J1,jh,Rp,Q1,Np,nl,al,K1=class K1 extends te{constructor(e,i,{currentMapGetter:o}){super();I(this,ge);I(this,Fr);I(this,ca,!1);I(this,ol,17);I(this,Jo,!1);I(this,Bp);I(this,pa);I(this,kr,new Map);I(this,ai,new Set);I(this,_p,new Set);I(this,Rp,p((e,i)=>{if(!a(this,ca)||e.length===0||!a(this,Jo))return;let o=-1/0,n,s=!1,c=new Set,l=new Map;e.forEach((u,h)=>{var b;let g=R(this,ge,J1).call(this,u);if(!g)return;let y=1-h/e.length,v=((b=l.get(g.id))!=null?b:0)+y;l.set(g.id,v),v>o&&(o=v,n=g),a(this,ai).has(g.id)||(R(this,ge,jh).call(this,g.id,0),s=!0),c.add(g.id)}),qx&&A.log("likelyInFocus:",[n==null?void 0:n.floorStack.name,o],"Weights:",e.flatMap(u=>{let h=R(this,ge,J1).call(this,u);return h?[h.floorStack.name,l.get(h.id)]:[]}));for(let u of a(this,ai))c.has(u)||(R(this,ge,jh).call(this,u,1),s=!0);M(this,ai,c),M(this,_p,new Set(e)),i&&n&&a(this,ge,it).currentFloorStackId!==n.floorStack.id&&(R(this,ge,$x).call(this,n.id),s=!0),s&&this.publish("focus-change",{facades:Array.from(a(this,ai)),spaces:e})},"#processFocusedEntities"));I(this,Np,p(e=>{a(this,Rp).call(this,e,!0)},"#handleGeometryInFocus"));I(this,nl,p(e=>{if(e.zoomLevel>=a(this,ol)&&!a(this,Jo))M(this,Jo,!0);else if(e.zoomLevel<a(this,ol)&&a(this,Jo)){M(this,Jo,!1);for(let i of a(this,kr).values())i.opacity<1&&R(this,ge,jh).call(this,i.id,1);a(this,ai).clear(),a(this,ge,it).outdoorFloorStacks.size>0&&!a(this,ge,it).outdoorFloorStacks.has(a(this,ge,it).currentFloorStackId)&&(a(this,ge,it).setFloorStack(a(this,ge,it).outdoorFloorStacks.values().next().value,"dynamic-focus"),this.publish("focus-change",{facades:[],spaces:[]}))}},"#handleCameraChange"));I(this,al,p(({floorId:e})=>{var n;let i=a(this,ge,it).floorsById.get(e);if(!i)return;let o=(n=a(this,ge,it).floorStacksById.get(i.floorStackId))==null?void 0:n.facade;if(o&&!a(this,ai).has(o.id)){let s=o.spaces.map(c=>c.spaceId);a(this,Rp).call(this,[...s,...a(this,_p)],!1)}},"#handleFloorChange"));M(this,Fr,e),M(this,Bp,o),M(this,pa,i)}get focusedFacades(){return Array.from(a(this,ai)).map(e=>{var i;return(i=a(this,pa).getMapDataInternal())==null?void 0:i.getById("facade",e)}).filter(e=>e!=null)}enable(e){var i;M(this,ol,(i=e==null?void 0:e.minZoomLevel)!=null?i:17),this.enabled||(a(this,Fr).on("geometry-in-focus",a(this,Np)),a(this,Fr).on("camera-change",a(this,nl)),a(this,ge,it).on("floor-change",a(this,al)),a(this,nl).call(this,a(this,Fr).camera),R(this,ge,Q1).call(this,!0),a(this,al).call(this,{floorId:a(this,ge,it).currentFloorId}),M(this,ca,!0)),qx&&a(this,Fr).getSystems().geometryInFocusSystem.showRaycasters()}disable(){M(this,ca,!1),a(this,Fr).off("geometry-in-focus",a(this,Np)),a(this,Fr).off("camera-change",a(this,nl)),a(this,ge,it).off("floor-change",a(this,al)),R(this,ge,Q1).call(this,!1)}get enabled(){return a(this,ca)}setDefaultFloorForStack(e,i){a(this,ge,it)==null&&A.throw("Current map does not exist.");let o=a(this,ge,it).floorsById.get(i.id);if(o==null){A.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(o.floorStackId!==e.id){A.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}let n=e.facade&&a(this,kr).get(e.facade.id);n&&n.setDefaultFloor(o)}resetDefaultFloorForStack(e){let i=e.facade&&a(this,kr).get(e.facade.id);i&&i.setDefaultFloor(i.floorStack.defaultFloor)}};Fr=new WeakMap,ca=new WeakMap,ol=new WeakMap,Jo=new WeakMap,Bp=new WeakMap,pa=new WeakMap,kr=new WeakMap,ai=new WeakMap,_p=new WeakMap,ge=new WeakSet,it=p(function(){return a(this,Bp).call(this)},"#currentMap"),$x=p(function(e){let i=a(this,kr).get(e);i&&a(this,ge,it).setFloor(i.defaultFloor.id,"dynamic-focus")},"#setFloorToFacadeDefault"),J1=p(function(e){var o;let i=(o=a(this,pa).getMapDataInternal())==null?void 0:o.facadesBySpaceId[e];return a(this,kr).get(i.id)},"#getFacadeBySpaceId"),jh=p(function(e,i){let o=a(this,kr).get(e);if(o)if(i<1){let n=o.defaultFloor,s=a(this,ge,it).floorsById.get(a(this,ge,it).currentFloorId);o.floorStack.id===(s==null?void 0:s.floorStackId)&&s.id!==o.defaultFloor.id&&o.setDefaultFloor(s),o.animateOpacity(i,{onEnd:p(()=>{o.defaultFloor!==n&&o.setDefaultFloor(n)},"onEnd")})}else o.animateOpacity(i)},"#setFacadeOpacity"),Rp=new WeakMap,Q1=p(function(e){var i;(i=a(this,pa).getMapDataInternal())==null||i.facades.forEach(o=>{let n=a(this,kr).get(o.id);n==null&&(n=new Lp(o,a(this,ge,it).floorStacksById.get(o.floorStack.id),a(this,Fr)),a(this,kr).set(o.id,n)),n.focusable=e})},"#setAllFacadesFocusable"),Np=new WeakMap,nl=new WeakMap,al=new WeakMap,p(K1,"DynamicFocus");var sl=K1;var mE={linear:Fe.Linear.None,easeIn:Fe.Quadratic.In,easeOut:Fe.Quadratic.Out,easeInOut:Fe.Quadratic.InOut},si,r0=class r0 extends te{constructor(e,i,o,n){var u,h,g,y;super();d(this,"floorStacksById",new Map);d(this,"floorsById",new Map);d(this,"currentFloorId","");d(this,"currentFloorStackId","");d(this,"outdoorFloorStacks",new Set);d(this,"id");d(this,"renderer");d(this,"api");d(this,"mvf");d(this,"options",{});d(this,"styleMap");d(this,"StackedMaps");d(this,"DynamicFocus");d(this,"animations",new Map);d(this,"Models",{add:p((e,i,o)=>{let{floorId:n,scale:s,...c}=o,l=n?this.floorsById.get(n):this.currentFloor,u={...c};s!=null&&(u.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let h=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(g=>{var y;return{type:"Feature",properties:{id:Ce(),rotation:o.rotation,scale:u.scale,interactive:o.interactive,verticalOffset:g.verticalOffset+((y=o.verticalOffset)!=null?y:0)},geometry:{type:"Point",coordinates:pr(g)}}})},u,{parent:l.id});if(h==null)throw new Error("error creating model");return this.renderer.getState(h).children},"add"),remove:p((e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)},"remove")});d(this,"Images",{add:p((e,i,o)=>{let{floorId:n,flipImageToFaceCamera:s,...c}=o,l=n?this.floorsById.get(n):this.currentFloor,u={type:"Feature",properties:c,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(Ce(),u,{url:i,flipImageToFaceCamera:s!=null?s:!1},l.id)},"add"),remove:p(e=>{this.renderer.remove(e)},"remove"),removeAll:p(()=>{},"removeAll")});d(this,"Markers",{add:p((e,i,o)=>{var c;let n=t0(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),s=o;return o.rank==="initial"&&(s.rank="medium"),this.renderer.addMarker2D(pr(e),i,{...s,occluderId:n==null?void 0:n.occluderId},(c=n==null?void 0:n.layers.get(zr))==null?void 0:c.containerId)},"add"),remove:p(e=>{this.renderer.remove(e)},"remove"),getContentEl:p(e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},"getContentEl"),removeAll:p(()=>{},"removeAll"),setPosition:p((e,i,o)=>{var c;let n=this.renderer.getState(e),s=o?this.floorsById.get(o):this.currentFloor;if(!n){A.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(n.type!=="marker"){A.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(n,{position:i,parent:(c=s==null?void 0:s.layers.get(zr))==null?void 0:c.containerId})},"setPosition"),animateTo:p((e,i,o,n)=>{let s=this.renderer.getState(e),c=o?this.floorsById.get(o):this.currentFloor;if(!s)return A.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(s.type!=="marker")return A.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...n};this.cancelAnimation(e);let u=new Gt({lon:s.position[0],lat:s.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(mE[l.easing]).onUpdate(({lon:h,lat:g})=>{var v;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let b=(v=c==null?void 0:c.layers.get(zr))==null?void 0:v.containerId;b&&this.Markers.setPosition(e,[h,g],b)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(e,u),e0(u).then(()=>{this.animations.delete(e)})},"animateTo")});d(this,"Exporter",{getCurrentSceneGLTF:p(async e=>this.renderer.getCurrentSceneGLTF(e),"getCurrentSceneGLTF")});d(this,"Shapes",{add:p((e,i,o)=>{let n=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=Ce();return this.renderer.addGeometryGroup(s,e,i,n.id),s},"add"),remove:p(e=>(this.renderer.remove(e.id),e.id),"remove")});d(this,"Text3D",{label:p((e,i,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){A.warn("Enterprise mode is not enabled, skipping label creation");return}let n=Jx(this.renderer,e,i,o);if(n)return{textInfo:n,target:e}},"label"),labelAll:p((e={})=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode))return A.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let o=[];return i.getByType("space").forEach(s=>{var c,l;if(s.locations[0]){let u=Jx(this.renderer,s,(l=(c=s.locations[0])==null?void 0:c.name)!=null?l:s.name,e);u&&o.push({textInfo:u,target:s})}}),o},"labelAll"),remove:p(e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){A.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e},"remove")});d(this,"Labels",{all:p(({onCreate:e,labelOptions:i={}})=>{for(let o of Object.entries(this.mvf.space)){let[n,s]=o;s&&s.features.forEach(c=>{var S,C,x,T,D;let l=(S=this.api.getMapData())==null?void 0:S.getById("space",c.properties.id);if(!l)return;let u=(C=this.styleMap[c.properties.id])==null?void 0:C.showImage,h=(x=c.properties.details)==null?void 0:x.images,y={marker:{...u&&((T=h==null?void 0:h[0])!=null&&T.url)?{icon:h[0].url}:{},...(D=i.appearance)==null?void 0:D.marker},...i.appearance},b=(n?this.floorsById.get(n):this.currentFloor).layers.get(Ti);if(c.properties.center&&c.properties.externalId!==""){let w=this.renderer.addLabel2D(c.properties.center,c.properties.externalId,{id:c.properties.id+"-label",...i,appearance:y,rank:i.rank},Ge.is(l)?l.id:b==null?void 0:b.containerId);w&&(Ge.is(l)&&b&&b.labelIds.add(w.id.toString()),e(w.id,c.properties.externalId,l))}})}},"all"),add:p((e,i,o={})=>{var h;let{floorId:n,...s}=o,c=t0(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),l=c.layers.get(Ti),u=this.renderer.addLabel2D(pr(e),i,{...s,occluderId:c.occluderId,verticalOffset:o.verticalOffset},(h=o==null?void 0:o.parentId)!=null?h:l==null?void 0:l.containerId);if(!u)throw new Error("label creating failed");return l&&l.labelIds.add(u.id.toString()),u},"add"),remove:p(({label:e,entityId:i})=>{var o;if(Ge.is(e.target)){let n=this.floorsById.get(e.target.floor.id);n&&((o=n.layers.get(Ti))==null||o.labelIds.delete(e.id.toString()))}this.renderer.remove(i)},"remove"),removeAll:p(()=>{},"removeAll")});d(this,"Paths",{add:p((e,i)=>{var u;let o=[],n=e[0].floorId||"root",s=0;for(let h of e){let{floorId:g="root",latitude:y,longitude:v}=h;g!==n&&(s++,n=g),o[s]==null&&o.push({floorId:g,coordinates:[]});let b=g===h.floorId?h:new Q({longitude:v,latitude:y,floorId:g});o[s].coordinates.push(b)}let c=o.reduce((h,{floorId:g,coordinates:y},v)=>{if(v!==0){let S=o[v-1],C=S.coordinates[S.coordinates.length-1],x=y[0],T=pr(C),D=pr(x),w=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:S.floorId},geometry:{type:"Point",coordinates:T}},{type:"Feature",properties:{parentId:g},geometry:{type:"Point",coordinates:D}}]},i,this.id);w&&h.push({...w,coordinates:[C,x]})}let b=this.renderer.addPath({type:"FeatureCollection",features:y.map(S=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:pr(S)}}))},i,g);return b&&h.push({...b,coordinates:y}),h},[]),l=new Gt({fraction:0}).to({fraction:1},(u=i==null?void 0:i.drawDuration)!=null?u:1e3).onUpdate(({fraction:h})=>{c.forEach(g=>{this.renderer.setState(g.id,{completeFraction:h})})}).start();return this.renderer.getTweenGroup().add(l),this.renderer.render(),this.animations.set(c[0].id.toString(),l),{paths:c,animation:e0(l).then(()=>{this.animations.delete(c[0].id.toString())})}},"add"),remove:p(e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})},"remove")});I(this,si,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=n.core,this.api=n,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new Ip({currentMapGetter:p(()=>this,"currentMapGetter")}),this.DynamicFocus=new sl(this.renderer,this.api,{currentMapGetter:p(()=>this,"currentMapGetter")}),this.mvf=(u=i==null?void 0:i.mvf)!=null?u:{};let s=Qx(this.mvf["styles.json"]||{});if(this.styleMap=s,M(this,si,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!i){this.id!=="outdoors-container"&&A.warn("Map (".concat(this.id,") created with no data."));let v=new Op({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(v.id,v),this.currentFloorStackId=v.id;let b=new xp(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,a(this,si),o!=null?o:{});v.addFloor(b),this.floorsById.set(b.id,b),this.setFloor(b.id);return}let c=i.getMVFFeatureByType("floor-stack");(c==null||c.length===0)&&A.throw("MVF does not contain any Floor Stacks.");for(let v of c){let b=new Op(v,this.id,this.renderer,(h=this.mvf.facade)==null?void 0:h[v.id]);if(b.floorIds.length!==0){for(let S of b.floorIds){let C=i.getMVFFeatureById("floor",S);if(C!=null){let x=this.mvf.space[C.id],T=this.mvf.obstruction[C.id];if((x==null||x.features.length===0)&&(T==null||T.features.length===0))continue;let D=new xp(b.id,C,this.renderer,a(this,si),o!=null?o:{},this.mvf,s);b.addFloor(D),this.floorsById.set(D.id,D)}}this.floorStacksById.set(v.id,b),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(i.facadesBySpaceId)){let b=i.getById("space",v);b&&(this.outdoorFloorStacks.add(b.floor.floorStack.id),(g=this.floorsById.get(b.floor.id))==null||g.setVisible(!0))}let l=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(o!=null&&o.initialFloor){let v=Gl(o.initialFloor);v&&this.floorsById.has(v)?l=v:A.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);return e||A.throw('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found')),e}setFloorStack(e,i){if(this.currentFloorStackId===e)return;let o=this.floorStacksById.get(e);if(o==null){A.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(o.floorObjects.length===0){A.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(o.defaultFloor.id,i)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);return e||A.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var n,s,c,l,u;if(this.StackedMaps.expandedFactor!==0)return;let i=this.floorsById.get(e),o=this.floorStacksById.get(this.currentFloorStackId);if(i&&o)if(!((n=a(this,si))!=null&&n.enabled)||i.floorStackId!==(o==null?void 0:o.id))for(let h of this.floorStacksById.values())this.options.keepOutdoorGeometryVisible&&this.outdoorFloorStacks.has(h.id)||h.floorObjects.forEach(g=>{g.id!==e&&(this.DynamicFocus.enabled&&this.DynamicFocus.focusedFacades.some(y=>y.floorStack.id!==o.id&&y.floorStack.defaultFloor.id===g.id)||g.setVisible(!1))});else{let h=Zx(this.currentFloorStack.floorObjects,i,a(this,si).floorHeight,((c=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:c.map(g=>g.id))||[]);(u=(l=this.api)==null?void 0:l.Outdoor)==null||u.setOpacity(h.outdoorOpacity),h.floorStates.forEach(g=>{g.floor.setVisible(g.visible);for(let[y,v]of g.floor.layers)g.visibleLayers.includes(y)?v.show():v.hide();this.renderer.setState("Footprint-".concat(g.floor.id),{height:g.footprint.height,altitude:g.footprint.altitude})}),a(this,si).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*a(this,si).floorHeight)}}setFloor(e,i){if(this.currentFloorId===e)return;let o=this.floorsById.get(e);if(!o){A.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let n=this.currentFloorId;if(this.publish("floor-change-start",{previousFloorId:n,floorId:e,reason:i}),this.DynamicFocus.enabled){let s=this.floorStacksById.get(o.floorStackId);if(s)for(let c of s.floorObjects)c.id!==e&&c.setVisible(!1)}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.DynamicFocus.enabled||this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.DynamicFocus.enabled||this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id,previousFloorId:n})}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};si=new WeakMap,p(r0,"GeojsonApiMapObject");var Gp=r0;function Jx(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}p(Jx,"labelSpace");m();var Br,jp,i0=class i0{constructor({currentMapGetter:t}){I(this,Br,new Map);I(this,jp);M(this,jp,t)}get currentMap(){return a(this,jp).call(this)}getById(t){return a(this,Br).get(t)}add(t,e,i){let o=t.anchorTarget;if(!o)throw new Error("get coordinate failed");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Markers.add(o,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(s==null)throw new Error("error creating marker");let c=n.Markers.getContentEl(s.id.toString());if(!c)throw new Error("marker component should exist");let l=new Ni(s.id.toString(),c,t);return a(this,Br).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var i;let e=a(this,Br).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),a(this,Br).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Br).forEach(({marker:e})=>{this.remove(e),t.push(e),a(this,Br).delete(e.id.toString())}),t}setPosition(t,e){var s;let i=e.anchorTarget;if(!i){A.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){A.error("Cannot determine the current map.");return}let n=a(this,Br).get(t.id);if(!n){A.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(n.entityId,pr(i),(s=i.floorId)!=null?s:o.currentFloorId),n.marker.updateTarget(e)}animateTo(t,e,i){var c;let o=e.anchorTarget;if(!o)return A.error("Cannot determine coordinate from target."),Promise.resolve();let n=this.currentMap;if(!n)return A.error("Cannot determine the current map."),Promise.resolve();let s=a(this,Br).get(t.id);return s?(s.marker.updateTarget(e),n.Markers.animateTo(s.entityId,pr(o),(c=o.floorId)!=null?c:n.currentFloorId,i)):(A.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Br=new WeakMap,jp=new WeakMap,p(i0,"Markers");var Vp=i0;m();var Wi,Hp,o0=class o0{constructor({currentMapGetter:t}){I(this,Wi,new Map);I(this,Hp);M(this,Hp,t)}get currentMap(){return a(this,Hp).call(this)}getById(t){return a(this,Wi).get(t)}add(t,e,i){var l;let o=t.anchorTarget;if(!o)throw new Error("Target does not implement IAnchorable.");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Images.add(pr(o),e,{...i,floorId:o.floorId,verticalOffset:o.verticalOffset+((l=i.verticalOffset)!=null?l:0)});if(!s)throw new Error("image component should exist");let c=new cp(s.id.toString(),e,t);return a(this,Wi).set(c.id,{image:c,entityId:s.id.toString()}),c}remove(t){var i;let e=a(this,Wi).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),a(this,Wi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Wi).forEach(({image:e})=>{this.remove(e),t.push(e),a(this,Wi).delete(e.id.toString())}),t}};Wi=new WeakMap,Hp=new WeakMap,p(o0,"Images");var Up=o0;m();var li,Xp,n0=class n0{constructor({currentMapGetter:t}){I(this,li,new Map);I(this,Xp);M(this,Xp,t)}get currentMap(){return a(this,Xp).call(this)}getById(t){return a(this,li).get(t)}add(t,e,i){let o=[t],n=o.reduce((l,u)=>{var h;return u?(l.has(u.floorId)||l.set(u.floorId,[]),(h=l.get(u.floorId))==null||h.push(u),l):(A.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 c=[];return n.forEach((l,u)=>{let h=Ce();s.Models.add(h,l,{...i,url:e,floorId:u}).forEach(({id:y})=>{let v=new Kn(y.toString(),h,l[0]);a(this,li).set(v.id,{model:v,entityId:y.toString(),groupId:h}),c.push(v)})}),c[0]}remove(t){var i;let e=a(this,li).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),a(this,li).delete(t.id.toString()))}removeAll(){let t=[];return a(this,li).forEach(({model:e})=>{var o;let i=a(this,li).get(e.id);i&&(t.push(e),(o=this.currentMap)==null||o.Models.remove(i.entityId,i.groupId),a(this,li).delete(e.id.toString()))}),t}};li=new WeakMap,Xp=new WeakMap,p(n0,"Models");var Wp=n0;m();var ci,Zp,a0=class a0{constructor({currentMapGetter:t}){I(this,ci,new Map);I(this,Zp);M(this,Zp,t)}get currentMap(){return a(this,Zp).call(this)}getById(t){return a(this,ci).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let o=i.Paths.add(t,e),n=o.paths.map(c=>c.id.toString()),s=new Dr(Ce(),o.animation,t,o.paths);for(let c of n)a(this,ci).set(c,{path:s,entityIds:n});return a(this,ci).set(s.id,{path:s,entityIds:n}),s}remove(t){var i;let e=a(this,ci).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),a(this,ci).delete(t.id),e.entityIds.forEach(o=>a(this,ci).delete(o)))}removeAll(){let t=[];return a(this,ci).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};ci=new WeakMap,Zp=new WeakMap,p(a0,"Paths");var Yp=a0;m();var p7=gu(J7(),1);m();var s0="#2266ff",gE="#808080",Kx="#f5f5f5";var e7={radius:10,color:s0,inactiveColor:gE,heading:{color:s0,opacity:.7},accuracyRing:{color:s0,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};m();var t7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var r7=p((r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=e/Math.tan(r/2),o=e/Math.sin(r/2),n=o+t,s=10,c=new _r;c.moveTo(-o*Math.sin(r/2),o*Math.cos(r/2)-i);for(let l=0;l<s;l++)c.lineTo(-(n*Math.sin(r/2-r/s*l)),n*Math.cos(r/2-r/s*l)-i);for(let l=0;l<s;l++)c.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/s*l)),e*Math.cos(Math.PI/-2+Math.PI/s*l));return new Rr(c,{depth:.1,bevelEnabled:!1,UVGenerator:bE(t)})},"createSectorGeometry"),l0=p((r,t,e)=>{let o=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return o>1?o=1:o<0&&(o=0),new ee(0,o)},"generateRadialUV"),bE=p(r=>({generateTopUV:p((t,e,i,o,n)=>{let s=e[i*3],c=e[i*3+1],l=e[o*3],u=e[o*3+1],h=e[n*3],g=e[n*3+1];return[l0(s,c,r),l0(l,u,r),l0(h,g,r)]},"generateTopUV"),generateSideWallUV:p(()=>[new ee(0,1),new ee(0,1),new ee(0,1),new ee(0,1)],"generateSideWallUV")}),"radialUVGenerator");function i7(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}p(i7,"getPositionWithOverrides");function vE([r,t],[e,i],[o,n]){let s=e-r,c=i-t,l=s**2+c**2;if(l===0)return;let u=((o-r)*s+(n-t)*c)/l,h;u<=0?h=[r,t]:u>=1?h=[e,i]:h=[r+u*s,t+u*c];let g=Pu([o,n],h);return{proportion:Math.max(0,Math.min(1,u)),intersection:h,distance:g}}p(vE,"getPointLineIntersection");function o7(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,i,o=0,n=0;for(let s=0;s<r.length-1;s++){let c=r[s],l=r[s+1],u=vE(c,l,t);u!=null&&u.distance<e&&(e=u.distance,i=u.intersection,o=s,n=u.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:o,proportion:n}}p(o7,"findBlueDotOnPath");function n7(r,t){let e=new yi({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,o=.35*4,n=r7(Math.PI/6,o,i);new wa().load(t7,c=>{e.alphaMap=c,e.needsUpdate=!0});let s=new ne(n,e);return s.position.z=-.05,s.renderOrder=0,s}p(n7,"createHeadingCone");function a7(r,t){let e=new Cu(1,1,.05,32),i=new yi({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),o=new ne(e,i);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}p(a7,"createAccuracyRing");function s7(r){let t=new Cu(.35,.35,.07,32),e=new yi({transparent:!0,color:Kx,depthTest:!1,depthWrite:!1}),i=new ne(t,e);i.renderOrder=2;let o=new Cu(.35*.8,.35*.8,.01,32),n=new yi({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),s=new ne(o,n);return s.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,s.rotation.x=Math.PI/2,s.position.z=.07,{outerMesh:i,innerMesh:s}}p(s7,"createBlueDot");var u7=gu(l7(),1);var Xh="blue-dot",ua,Xi,zt,qt,Yi,da,ha,fa,Ve,Ht,zp,Zi,qp,$p,Jp,Qp,Hh,pi,zi,Wh,ma,Kp,ui,c0=class c0 extends te{constructor(e,i){super();this.core=e;this.geoJSONApi=i;I(this,ua,null);d(this,"geometry");I(this,Xi);I(this,zt);I(this,qt);I(this,Yi);I(this,da);I(this,ha);I(this,fa);I(this,Ve,e7);I(this,Ht,1);I(this,zp);I(this,Zi);d(this,"state","disabled");d(this,"following",!1);I(this,qp,p(e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)},"#getFloorByFloorId"));I(this,$p,p(e=>{var o;let i;if(e!=null){let n=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(e);i=n?a(this,qp).call(this,n.id):void 0}return i},"#getFloorByFloorLevel"));I(this,Jp,p(e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,o,n,s]=e.children;if(a(this,Hh).call(this),o.scale.set(a(this,Ht),a(this,Ht),a(this,Ht)),o.position.z=.07/2*a(this,Ht),n.scale.set(a(this,Ht),a(this,Ht),a(this,Ht)),n.position.z=.07*a(this,Ht),this.state==="active"){n.material.color.set(a(this,Ve).color);let c=this.accuracy;c!=null?(i.visible=!0,a(this,ha)&&a(this,ha).stop(),M(this,ha,new Gt({scale:i.scale.x}).to({scale:c/2},150).onUpdate(({scale:u})=>{i.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(a(this,ha))):i.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,a(this,fa)&&a(this,fa).stop();let{start:u,end:h}=Mu(s.rotation.z,-ae.degToRad(l));M(this,fa,new Gt({rotation:u}).to({rotation:h},150).onUpdate(({rotation:g})=>{s.rotation.z=g}).start()),this.core.getTweenGroup().add(a(this,fa)),s.scale.set(a(this,Ht),a(this,Ht),1)}else s.visible=!1}else this.state==="inactive"&&(n.material.color.set(a(this,Ve).inactiveColor),s.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));I(this,Qp,p(e=>{var s,c;let i;try{i=PE.parse(i7(e,a(this,zt)))}catch(l){a(this,pi).call(this,"error"),A.error("BlueDot: Position parse failed",l instanceof G.ZodError?l.message:String(l)),this.publish("error");return}a(this,Ve).debug&&A.log("BlueDot: Parsed position",i),M(this,qt,i),a(this,pi).call(this,"position-update"),a(this,Yi)&&clearTimeout(a(this,Yi)),typeof a(this,Ve).timeout=="number"&&a(this,Ve).timeout<1/0&&M(this,Yi,setTimeout(()=>{a(this,Ve).debug&&A.log("BlueDot: Position timed out after ".concat(a(this,Ve).timeout,"ms")),a(this,pi).call(this,"timeout"),this.core.render()},a(this,Ve).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(s=i.floor)==null?void 0:s.elevation,accuracy:i.accuracy}});let o=i.floor!=null?i.floor.id:"outdoors-container",n=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(Xh,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:p(l=>{let u=a7(a(this,Ve).accuracyRing.color,a(this,Ve).accuracyRing.opacity),{outerMesh:h,innerMesh:g}=s7(a(this,Ve).color),y=n7(a(this,Ve).heading.color,a(this,Ve).heading.opacity);l.add(u),u.visible=!1,l.add(h),l.add(g),l.add(y),y.visible=!1,a(this,Jp).call(this,l)},"setup"),update:a(this,Jp)},{visible:!0,interactive:!0},o);else{let l=this.core.getState(this.geometry);n=[l.position[0],l.position[1]]}a(this,da)&&a(this,da).stop(),M(this,da,new Gt(n).to([i.longitude,i.latitude],1e3).easing(Fe.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(a(this,da)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));d(this,"onPositionUpdate",p(e=>{var i,o,n,s,c;if(this.state!=="disabled"){try{IE.parse(e)}catch(l){a(this,pi).call(this,"error"),A.error("BlueDot: Browser sent invalid position",l instanceof G.ZodError?l.message:String(l)),this.publish("error");return}M(this,Xi,{latitude:(i=e.coords)==null?void 0:i.latitude,longitude:(o=e.coords)==null?void 0:o.longitude,accuracy:(n=e.coords)==null?void 0:n.accuracy,heading:(s=e.coords)==null?void 0:s.heading,floor:a(this,$p).call(this,(c=e.coords)==null?void 0:c.floorLevel)}),a(this,Qp).call(this,a(this,Xi))}},"onPositionUpdate"));d(this,"onPositionError",p(e=>{var i;switch(a(this,pi).call(this,"error"),e.code){case e.PERMISSION_DENIED:A.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:A.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:A.error("Geolocation request timed out.",e);break;default:A.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)},"onPositionError"));I(this,Hh,p(()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==a(this,zp)){M(this,zp,e);let o=(i=this.core.getMetresPerPixel())!=null?i:1;M(this,Ht,Math.max(a(this,Ve).radius/(.35/o),1))}},"#updateScale"));I(this,pi,p(e=>{let i=xE[this.state].actions[e];if(i){switch(a(this,Ve).debug&&A.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(e)),i){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!==i&&(this.publish("state-change",{state:i,action:e}),this.state=i)}else A.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))},"#transitionAction"));I(this,zi);I(this,Wh,p(()=>{if(a(this,zi)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(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);M(this,zi,(0,u7.default)(i.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return a(this,zi)},"#getSimplifiedDirections"));I(this,ma,p(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),a(this,ui)&&(this.off("position-update",a(this,ui)),M(this,ui,void 0)),this.following=!1,M(this,zi,void 0),this.core.off("user-interaction-start",a(this,ma)),this.geoJSONApi.currentMap.off("navigation-active-path-change",a(this,Kp)),this.publish("follow-change",{following:!1})},"#cancelFollow"));I(this,Kp,p(()=>{M(this,zi,void 0)},"#pathChangeHandler"));I(this,ui);d(this,"follow",p((e,i)=>{var n,s,c,l;if(e===!1){a(this,ma).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&A.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(n=i==null?void 0:i.zoomLevel)!=null?n:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(s=i==null?void 0:i.pitch)!=null?s:45,duration:(c=i==null?void 0:i.duration)!=null?c:1e3,easing:(l=i==null?void 0:i.easing)!=null?l:"ease-in-out"};this.following?a(this,ui)&&this.off("position-update",a(this,ui)):(this.following=!0,this.core.on("user-interaction-start",a(this,ma)),this.geoJSONApi.currentMap.on("navigation-active-path-change",a(this,Kp))),M(this,ui,u=>{let{coordinate:h,heading:g,floor:y}=u;if(o.center=[h.longitude,h.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),M(this,zi,void 0)),e==="position-and-heading")o.bearing=g!=null?g:void 0;else if(e==="position-and-path-direction"){let v=a(this,Wh).call(this);if(v!=null){let b=o7(v,[h.longitude,h.latitude]);if(b!=null){let S=v[b.segmentIndex],C=v[b.segmentIndex+1];o.bearing=Cb(S,C)}}}this.core.camera.animateTo(o)}),this.on("position-update",a(this,ui)),this.publish("follow-change",{following:!0,mode:e})},"follow"))}get heading(){var e;return(e=a(this,qt))==null?void 0:e.heading}get accuracy(){var e;return(e=a(this,qt))==null?void 0:e.accuracy}get coordinate(){var e,i;if(a(this,qt)!=null)return(a(this,Zi)==null||((e=this.floor)==null?void 0:e.id)!==a(this,Zi).floorId||a(this,qt).latitude!==a(this,Zi).latitude||a(this,qt).longitude!==a(this,Zi).longitude)&&M(this,Zi,new Q(a(this,qt).latitude,a(this,qt).longitude,(i=this.floor)==null?void 0:i.id)),a(this,Zi)}get floor(){var e;return(e=a(this,qt))==null?void 0:e.floor}enable(e){M(this,Ve,(0,p7.default)({},e,a(this,Ve))),a(this,pi).call(this,"enable"),this.watchDevicePosition(a(this,Ve).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),a(this,Yi)&&(clearTimeout(a(this,Yi)),M(this,Yi,void 0)),this.following&&a(this,ma).call(this),this.watchDevicePosition(!1),M(this,qt,void 0),M(this,zt,void 0),a(this,pi).call(this,"disable")}watchDevicePosition(e){if(a(this,ua)&&(navigator.geolocation.clearWatch(a(this,ua)),M(this,ua,null)),a(this,Xi)&&M(this,Xi,void 0),e){if(this.state==="disabled"){A.warn("BlueDot must be enabled before watching browser position.");return}M(this,ua,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var o,n;e==null?M(this,zt,void 0):"coords"in e?M(this,zt,Object.assign({},a(this,zt),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:a(this,$p).call(this,e.coords.floorLevel)})):(M(this,zt,Object.assign({},a(this,zt),e)),"floorOrFloorId"in e&&(a(this,zt).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?a(this,qp).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((o=a(this,zt))==null?void 0:o.latitude)!=null&&((n=a(this,zt))==null?void 0:n.longitude)!=null||a(this,Xi)!=null)&&a(this,Qp).call(this,a(this,Xi))}};ua=new WeakMap,Xi=new WeakMap,zt=new WeakMap,qt=new WeakMap,Yi=new WeakMap,da=new WeakMap,ha=new WeakMap,fa=new WeakMap,Ve=new WeakMap,Ht=new WeakMap,zp=new WeakMap,Zi=new WeakMap,qp=new WeakMap,$p=new WeakMap,Jp=new WeakMap,Qp=new WeakMap,Hh=new WeakMap,pi=new WeakMap,zi=new WeakMap,Wh=new WeakMap,ma=new WeakMap,Kp=new WeakMap,ui=new WeakMap,p(c0,"BlueDot");var cl=c0,xE={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"}}},IE=G.object({coords:G.object({latitude:G.number(),longitude:G.number(),accuracy:G.number(),altitude:G.number().optional().nullable(),altitudeAccuracy:G.number().optional().nullable(),heading:G.number().optional().nullable(),speed:G.number().optional().nullable(),floorLevel:G.number().optional().nullable()}),timestamp:G.number()}),PE=G.object({latitude:G.number(),longitude:G.number(),floor:G.custom().optional(),accuracy:G.number().optional(),heading:G.number().optional().nullable()});m();var qi,tu,p0=class p0{constructor({currentMapGetter:t}){I(this,qi,new Map);I(this,tu);M(this,tu,t)}get currentMap(){return a(this,tu).call(this)}getById(t){return a(this,qi).get(t)}add(t,e,i){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let n=o.Shapes.add(t,e||{},{floorId:i==null?void 0:i.id}),s=new Wo(n);return a(this,qi).set(s.id,s),s}remove(t){var i;a(this,qi).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),a(this,qi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,qi).forEach(e=>{this.remove(e),t.push(e.id),a(this,qi).delete(e.id.toString())}),t}};qi=new WeakMap,tu=new WeakMap,p(p0,"Shapes");var eu=p0;m();var iu,u0=class u0{constructor({currentMapGetter:t}){I(this,iu);M(this,iu,t)}get currentMap(){return a(this,iu).call(this)}setFromStyleCollection(t){var e,i,o;for(let n in t)for(let s of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[n]==null||!s.layers.has(we))continue;let c=s.layers.get(we);if(c!=null&&c.layers.has(n)&&"color"in t[n]){let l=c.layers.get(n);(i=this.currentMap)==null||i.renderer.setState(l,{color:t[n].color})}if(c&&n===go&&!(Zr in t)){let l=c.layers.get(Zr);l&&"color"in t[n]&&((o=this.currentMap)==null||o.renderer.setState(l,{color:t[n].color}))}}}};iu=new WeakMap,p(u0,"Style");var ru=u0;m();var d0={opacity:1},yt,ou,nu,Ko,$i,ga,h0,d7,f0=class f0{constructor(t,e){I(this,ga);I(this,yt);I(this,ou,[]);I(this,nu,{opacity:"initial"});I(this,Ko,{opacity:new Map});I(this,$i,new Set);M(this,yt,t),M(this,ou,e||[]);let i=a(this,yt).map;i&&i.on("idle",()=>{a(this,Ko).opacity.size||R(this,ga,h0).call(this,i)})}setStyle(t){var e,i;if(a(this,yt).map){(e=a(this,yt).map)==null||e.setStyle(t),a(this,$i).size&&(a(this,$i).clear(),this.hide()),R(this,ga,d7).call(this),R(this,ga,h0).call(this,a(this,yt).map),this.setOpacity(a(this,nu).opacity),(i=a(this,yt).map)==null||i.moveLayer(hf);for(let[o,n,s]of a(this,ou)||[])a(this,yt).hideOutdoorLayersIntersectingPolygons(o,n,s)}}get map(){return a(this,yt).map}get enabled(){return!!a(this,yt).map}get visible(){return a(this,$i).size===0}show(){let t=a(this,yt).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{a(this,$i).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),a(this,$i).clear())}hide(t=[]){let e=a(this,yt).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(o=>{let n=e.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&n!=="none"&&(e.setLayoutProperty(o.id,"visibility","none"),a(this,$i).add(o.id))})}setOpacity(t,e=[]){var n,s;let i=a(this,yt).map;if(!i)return;let o=(s=(n=a(this,yt).map)==null?void 0:n.getStyle())==null?void 0:s.layers;o&&i.once("idle",()=>{o.forEach(c=>{let l=i.getLayoutProperty(c.id,"visibility");if(!e.includes(c.id)&&l!=="none")try{let u=a(this,Ko).opacity.get(c.id);u!==void 0&&(c.id==="background"||(c.type==="symbol"?(i.setPaintProperty(c.id,"icon-opacity",t==="initial"?u[0]:t),i.setPaintProperty(c.id,"text-opacity",t==="initial"?u[1]:t)):i.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?u[0]:t)),a(this,nu).opacity=t)}catch(u){A.warn("Error setting opacity:",u)}})})}};yt=new WeakMap,ou=new WeakMap,nu=new WeakMap,Ko=new WeakMap,$i=new WeakMap,ga=new WeakSet,h0=p(function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var n,s,c;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?a(this,Ko).opacity.set(i.id,[(n=t.getPaintProperty(i.id,"icon-opacity"))!=null?n:d0.opacity,(s=t.getPaintProperty(i.id,"text-opacity"))!=null?s:d0.opacity]):a(this,Ko).opacity.set(i.id,[(c=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?c:d0.opacity,void 0])))})},"#setInitialStyle"),d7=p(function(){Object.values(a(this,Ko)).forEach(t=>t.clear())},"#clearInitialStyle"),p(f0,"Outdoor");var pl=f0;m();var Ji,Qi,en,m0=class m0{constructor({currentMapGetter:t}){I(this,Ji);I(this,Qi,new Map);I(this,en,new Map);M(this,Ji,t)}labelAll(t={}){var o,n;let e=[],i=new Set;return(n=(o=a(this,Ji).call(this))==null?void 0:o.Text3D.labelAll(t))==null||n.forEach(({textInfo:s,target:c})=>{let l=s.id.toString(),u=a(this,en).get(l);if(u){i.has(l)||e.push(u.text3DView),i.add(l);return}i.add(l);let h=new Xo(l,c);a(this,Qi).set(h.id,{targetId:c.id,text3d:l,text3DView:h}),a(this,en).set(l,{text3DView:h}),e.push(h)}),e}label(t,e,i={}){var n;if(a(this,Ji).call(this))if(Ge.is(t)){let s=(n=a(this,Ji).call(this))==null?void 0:n.Text3D.label(t,e,i);if(!s)return;let c=s.textInfo.id.toString(),l=a(this,en).get(c);if(l)return l.text3DView;let u=new Xo(c,s.target);return a(this,Qi).set(u.id,{targetId:s.target.id,text3d:c,text3DView:u}),a(this,en).set(c,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var o;let e=typeof t=="string"?t:t.id,i=a(this,Qi).get(e);i&&((o=a(this,Ji).call(this))==null||o.Text3D.remove(i.text3d),a(this,Qi).delete(e),a(this,en).delete(i.text3d))}removeAll(){a(this,Qi).forEach(t=>{var e;(e=a(this,Ji).call(this))==null||e.Text3D.remove(t.text3d)}),a(this,Qi).clear()}};Ji=new WeakMap,Qi=new WeakMap,en=new WeakMap,p(m0,"Text3D");var Yh=m0;var Zh=.05,b0=class b0{constructor(t,e){d(this,"core");d(this,"mapObjects",[]);d(this,"id");d(this,"mapDataExternal",{});d(this,"mapsByFloorId",{});d(this,"mapData");d(this,"currentMap");d(this,"hiddenOutdoorGeometries",[]);d(this,"lastFacadeIntersected");d(this,"mapView");d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"Outdoor");d(this,"BlueDot");d(this,"Shapes");d(this,"Style");d(this,"Images");d(this,"update",p(()=>{this.core.render()},"update"));this.core=t,this.mapView=e,this.Camera=new gp(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new Gp("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,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")});let o=new dp(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let n=p(l=>u=>{var k,L,_;let h=[],g=[],y=[],v=[];u.labels.forEach(B=>{let V=this.Labels.getById(B.toString());V&&h.push(V.label)}),u.markers.forEach(B=>{let V=this.Markers.getById(B.toString())||this.Navigation.getMarkerById(B.toString());V&&g.push(V.marker)}),u.models.forEach(B=>{let V=this.Models.getById(B.toString());V&&y.push(V.model)}),u.paths.forEach(B=>{let V=this.Paths.getById(B.toString())||this.Navigation.getPathById(B.toString());V&&v.push(V.path)});let b=u.geometry.includes(Xh),S=u.geometry.filter(B=>B!==Xh)[0],C;S&&(C=(k=this.getMapDataInternal())==null?void 0:k.getById("space",S)),C||(C=(L=this.getMapDataInternal())==null?void 0:L.getById("object",S));let x=u.containers.reduce((B,V)=>{var Y;let j=(Y=this.getMapDataInternal())==null?void 0:Y.getById("floor",V);return j&&Bt.is(j)&&B.push(j),B},[]),T,D=0;if(x.length>0){T=x[0].id;let B=this.core.getState(T);D=u.coordinate[2]?u.coordinate[2]-B.altitude:D}let w;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(B=>{this.core.setState(B.id,{hovered:!1})}),C&&Ge.is(C)&&(w=(_=this.getMapDataInternal())==null?void 0:_.facadesBySpaceId[S],w&&w.spaces.forEach(B=>{this.core.setState(B.id,{hovered:!0})})),this.lastFacadeIntersected=w;let E={coordinate:new Q({latitude:u.coordinate[1],longitude:u.coordinate[0],floorId:T,verticalOffset:D}),spaces:C&&Ge.is(C)?[C]:[],objects:C&&_t.is(C)?[C]:[],markers:g,labels:h,models:y,paths:v,blueDot:b,floors:x,facades:w?[w]:[]};"pointerEvent"in u&&(E.pointerEvent=u.pointerEvent),this.mapView.publish(l,E)},"createHandler");this.core.on("hover",n("hover")),this.core.on("click",n("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:p(()=>this.currentMap,"currentMapGetter")};this.Markers=new Vp(s),this.Models=new Wp(s),this.Labels=new vp(s),this.Text3D=new Yh(s),this.Exporter=new bp(s),this.Paths=new Yp(s),this.Navigation=new fp(this.core,this,s.currentMapGetter),this.BlueDot=new cl(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 pl(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 Up(s),this.Shapes=new eu(s),this.Style=new ru(s);let c=new Nh(e,this.mapDataExternal);this.auto=c.auto}get DynamicFocus(){return this.currentMap.DynamicFocus}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(we);if(n){let s=n.layers.get(go);s&&this.core.setState(s,g0(e,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(we);if(n){let s=n.layers.get(Zr);s&&this.core.setState(s,g0(e,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(we);if(n){let s=n.layers.get(Ya);s&&this.core.setState(s,zh(e,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(we);if(n){let s=n.layers.get(Za);s&&this.core.setState(s,zh(e,this.core.getState(s)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(Uo.is(i))return this.core.setState(i.id,h7({...e,type:"label"},this.core.getState(i.id)));if(Ni.is(i))return this.core.setState(i.id,f7({...e,type:"marker"},this.core.getState(i.id)));if((Ge.is(i)||_t.is(i))&&this.core.setState(i.id,y0({...e,type:"geometry"},this.core.getState(i.id))),br.is(i)&&this.core.setState(i.id,zh({...e,type:"doors"},this.core.getState(i.id))),Wo.is(i)&&this.core.setState(i.id,Dl(e,["altitude","color","opacity"])),Kn.is(i)){let{position:o,scale:n,...s}=e,c=s;o&&(c.position=[o.longitude,o.latitude,o.verticalOffset]),n!=null&&(Array.isArray(n)?c.scale=n:c.scale=[n,n,n]),o&&i.updateTarget(o),this.core.setState(i.id,c)}if(Bt.is(i)){let o=this.currentMap.floorsById.get(i.id);if(o==null)return;let n=o.layers.get(we);n!=null&&"geometry"in e&&this.core.setState(n.containerId,m7(e.geometry))}if(rr.is(i))for(let o of i.spaces)this.core.setState(o.id,y0({...e,type:"geometry"},this.core.getState(o.id)));if(Xo.is(i)&&this.core.setState(i.id,Dl(e,Pf)),Dr.is(i))for(let o of i.segments)this.core.setState(o.id,Dl(e,["color"]));Zs.is(i)&&this.core.setState(i.id,Dl(e,["color"]))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Sc(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var g,y,v,b;let o;try{o=Sc(t)}catch(S){A.error("Error adding map",S),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:n}=o,s=n["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new Q(s[1],s[0])});let c=n["manifest.geojson"].features[0].properties.name,l=new Gp("mapObject-".concat(c),o,e,this),u=this.core.getBoundingArea(l.currentFloor.id);u==null&&A.error("Could not determine bounding box for map:",l.currentFloor.id);let h=(y=(g=e==null?void 0:e.outdoorView)==null?void 0:g.layersHiddenByGeometry)!=null?y:[];if(h.length>0){let S,C=[];for(let x of l.floorStacksById.values())if(x.defaultFloor.footprint&&x.defaultFloor.footprint.geometry!=null&&((v=x.defaultFloor.footprint.geometry)==null?void 0:v.coordinates.length)>0){let T=x.defaultFloor.footprint,D=Vh(T);S==null?S=D:y7(S,D),C.push(T)}C.length>0&&S!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(S,C,h),this.hiddenOutdoorGeometries.push([S,C,h]))}if(this.mapObjects.push(l),o.getMVFFeatureByType("floor").forEach(S=>{this.mapsByFloorId[S.id]=l}),l.on("navigation-connection-click",S=>{this.mapView.publish("navigation-connection-click",S)}),l.on("navigation-active-path-change",S=>{this.mapView.publish("navigation-active-path-change",S)}),l.StackedMaps.on("stacked-maps-state-change",({state:S})=>{this.mapView.publish("stacked-maps-state-change",{state:S})}),l.on("floor-change-start",S=>{var C,x,T,D;this.mapView.publish("floor-change-start",{reason:S.reason,floor:(x=(C=this.getMapDataInternal())==null?void 0:C.getById("floor",S.floorId))!=null?x:this.currentFloor,previousFloor:(D=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",S.previousFloorId))!=null?D:this.currentFloor})}),l.on("floor-change",S=>{var C,x;this.mapView.publish("floor-change",{reason:S.reason,floor:this.currentFloor,previousFloor:(x=(C=this.getMapDataInternal())==null?void 0:C.getById("floor",S.previousFloorId))!=null?x:this.currentFloor})}),l.DynamicFocus.on("focus-change",S=>{this.mapView.publish("dynamic-focus-change",{facades:S.facades.map(C=>{var x;return(x=this.getMapDataInternal())==null?void 0:x.getById("facade",C)}).filter(C=>C!=null)})}),this.currentMap=l,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null)this.core.camera.setZoomLevel(e.zoomLevel),i(t);else if(this.core.mode!=="outdoors-overlay"&&u){let S=(b=e==null?void 0:e.screenOffsets)!=null?b:{top:Zh*this.core.canvasHeight,left:Zh*this.core.canvasWidth,right:Zh*this.core.canvasWidth,bottom:Zh*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:Cv,padding:S}).then(()=>{i(t)})}else i(t)})}setFloor(t,e){return this.currentMap.setFloor(Gl(t),e)}setFloorStack(t){return this.currentMap.setFloorStack(Gl(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw A.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw A.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw A.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw A.throw("Missing currentFloor");return e}getState(t){var o,n,s,c;if(typeof t=="object"&&rr.is(t)){A.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}typeof t=="object"&&Dr.is(t)&&A.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let e=g7(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:l,topColor:u,texture:h,topTexture:g,visible:y,height:v,opacity:b}=i;return{type:"walls",visible:y,color:l,topColor:u,texture:h?{url:h}:void 0,topTexture:g?{url:g}:void 0,height:v,opacity:b}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:l,topColor:u,texture:h,topTexture:g,visible:y,opacity:v}=i;return{type:"doors",visible:y,color:l,topColor:u,opacity:v,texture:h?{url:h}:void 0,topTexture:g?{url:g}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0,flipImageToFaceCamera:i.flipImageToFaceCamera,topColor:i.topColor};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((o=i.options)==null?void 0:o.rank)!==void 0&&i.options.interactive!==void 0){let l=typeof i.parent=="object"?i.parent.id:i.parent,u=this.Markers.getById(i.id.toString()),h=u!=null&&u.marker.target?u==null?void 0:u.marker.target.anchorTarget:void 0;return h==null&&(h=new Q(i.position[1],i.position[0],l.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize}}else if(i.type==="model"){let l=i!=null&&typeof i.parent=="object"?i.parent.id.toString():(n=i.parent)==null?void 0:n.toString();return delete i.parent,{...i,position:new Q({latitude:i.position[1],longitude:i.position[0],verticalOffset:i.position[2],floorId:l}),type:"model"}}else{if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&Wo.is(t)){let[l]=i.children;if(l.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(s=i.altitude)!=null?s:0,visible:i.visible,color:i.color,height:l.height,opacity:i.opacity}}else{if(i.type==="path")return{type:"path",color:i.color};if(i.type==="group-container"&&typeof t!="string"&&Bt.is(t)){let l=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(we);if(l)return{type:"floor",geometry:{opacity:this.core.getState(l.containerId).opacity}}}}}}}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,e,i){var l;if(i!=null){let u=this.core.projectScreenXYToCoordinate(t,e,!0);return u?new Q(u.coordinate[1],u.coordinate[0],i.id):void 0}let o=this.core.projectScreenXYToCoordinate(t,e);if(o==null||o.coordinate==null)return;let{coordinate:n,groupContainers:s}=o,c=(l=s==null?void 0:s.find(u=>{let h=u.userData.entityId.toString();return h.includes("f_")||h.includes("m_")}))==null?void 0:l.userData.entityId.toString();return new Q(n[1],n[0],c)}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()}}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()}};p(b0,"GeoJsonApi");var au=b0;m();m();var v0=class v0{constructor(t){d(this,"state");d(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};p(v0,"Debug");var $h=v0;m();var b7=G.object({environment:G.union([G.literal("basic"),G.literal(!1)]).optional(),text3d:G.object({hoverColor:G.string().optional()}).optional(),geometry:G.object({hoverColor:G.string().optional()}).optional(),backgroundColor:G.string().optional(),backgroundAlpha:G.number().optional()}).strict();var su,Z,Ki,C0=class C0 extends te{constructor(e){super();I(this,su,{});I(this,Z);I(this,Ki);d(this,"Camera");d(this,"Labels");d(this,"Text3D");d(this,"Markers");d(this,"Images");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"BlueDot");d(this,"Style");d(this,"Shapes");d(this,"Outdoor");d(this,"update",p(()=>{a(this,Z).core.render()},"update"));d(this,"getDirections",p((e,i,o)=>{var n;return(n=a(this,Z).getMapData())==null?void 0:n.getDirections(e,i,o)},"getDirections"));d(this,"getDirectionsMultiDestination",p((e,i,o)=>{var n;return(n=a(this,Z).getMapData())==null?void 0:n.getDirectionsMultiDestination(e,i,o)},"getDirectionsMultiDestination"));d(this,"on",p((e,i)=>{super.on(e,i)},"on"));d(this,"off",p((e,i)=>{super.off(e,i)},"off"));d(this,"Debug");M(this,Ki,e);let i=new au(e,this);M(this,Z,i),this.Camera=a(this,Z).Camera,M(this,su,a(this,Z).mapDataExternal),this.Markers=a(this,Z).Markers,this.Models=a(this,Z).Models,this.Labels=a(this,Z).Labels,this.Text3D=a(this,Z).Text3D,this.Exporter=a(this,Z).Exporter,this.Paths=a(this,Z).Paths,this.Navigation=a(this,Z).Navigation,this.BlueDot=a(this,Z).BlueDot,this.Shapes=a(this,Z).Shapes,this.Style=a(this,Z).Style,this.auto=a(this,Z).auto,this.Outdoor=a(this,Z).Outdoor,this.Images=a(this,Z).Images,a(this,Ki).container.dataset.version=P.env.npm_package_version,this.Debug=new $h(a(this,Z).core)}get StackedMaps(){return a(this,Z).currentMap.StackedMaps}get DynamicFocus(){return a(this,Z).currentMap.DynamicFocus}updateState(e,i){return a(this,Z).updateState(e,i)}updateGlobalState(e){var i,o,n,s;try{b7.parse(e)}catch(c){A.error("updateGlobalState",c);return}if(typeof e=="object"){let c={};if((i=e.text3d)!=null&&i.hoverColor&&(c.text3dHoverColor=e.text3d.hoverColor),(o=e.geometry)!=null&&o.hoverColor&&(c.hoverColor=e.geometry.hoverColor),e.backgroundColor||e.backgroundAlpha!==void 0){let l=(n=e.backgroundColor)!=null?n:a(this,Z).core.backgroundColor,u=(s=e.backgroundAlpha)!=null?s:a(this,Z).core.backgroundAlpha;a(this,Z).core.setBackgroundColor(l,u)}e.environment!=null&&a(this,Z).core.setEnvironment(e.environment),a(this,Z).core.setState(c)}}getGlobalState(){let e=a(this,Z).core.getState();return{backgroundColor:a(this,Z).core.backgroundColor,backgroundAlpha:a(this,Z).core.backgroundAlpha,environment:a(this,Z).core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return a(this,su)}getDimensions(){return{width:a(this,Ki).canvasWidth,height:a(this,Ki).canvasHeight}}expand(e){var i;return(i=a(this,Z).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=a(this,Z).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return a(this,Z).addMap(e,i)}setFloor(e){return a(this,Z).setFloor(e)}setFloorStack(e){return a(this,Z).setFloorStack(e)}get currentFloorStack(){return a(this,Z).currentFloorStack}get currentFloor(){return a(this,Z).currentFloor}updateWatermark(e){a(this,Z).updateWatermark(e)}getState(e){return a(this,Z).getState(e)}setHoverColor(e){a(this,Z).setHoverColor(e)}getHoverColor(){return a(this,Z).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return a(this,Z).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return a(this,Z).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return a(this,Z).isInView(e)}getDistance(e,i){var o;return(o=a(this,Z).getMapData())==null?void 0:o.getDistance(e,i)}createCoordinate(e,i,o){return typeof e=="object"?new Q(e):new Q(e,i,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(e,i,o){return a(this,Z).createCoordinateFromScreenCoordinate(e,i,o)}getScreenCoordinateFromCoordinate(e){return a(this,Z).getScreenCoordinateFromCoordinate(e)}auto(){return{labels:this.Labels.all()}}get __core(){if(P.env.INTERNAL==="true")return a(this,Z).core;throw new Error("__core is not available.")}clear(){a(this,Z).clear()}destroy(){a(this,Z).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-DWRMN5WW.js");await new i(this,a(this,Z)).enable(e)}async takeScreenshot(){return await a(this,Ki).renderSync(),a(this,Ki).rendererDomElement.toDataURL("image/png")}};su=new WeakMap,Z=new WeakMap,Ki=new WeakMap,p(C0,"MapView");var ul=C0;m();m();var S0=class S0 extends te{constructor(e){super();d(this,"gl");d(this,"el",document.createElement("div"));d(this,"core");d(this,"origin");d(this,"map");d(this,"layer");d(this,"handleStyleChange",p(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));d(this,"handleMove",p(()=>{if(!this.map)return;let[e,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(e,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ae.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ae.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",p(e=>{A.warn(e)},"handleError"));this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new ap(e._container,{center:this.origin,zoomLevel:e.getZoom(),pitch:e.getPitch(),bearing:e.getBearing(),gl:this.gl,map:e,mode:"outdoors-overlay"}),this.map=e,this.core.camera.setMinZoomLevel(e.getMinZoom()),this.core.camera.setMaxZoomLevel(e.getMaxZoom()),this.core.camera.setMinPitch(e.getMinPitch()),this.core.camera.setMaxPitch(e.getMaxPitch()),this.map.on("error",this.handleError);let i=kb.fromLngLat(this.origin,0);return this.layer=Eu(i,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}};p(S0,"MapLibreOverlay");var Jh=S0;var ya,dl,tn,ba,lu=class lu extends te{constructor(e,i,o){super();I(this,ya);I(this,dl);I(this,tn);I(this,ba);d(this,"on",p((e,i)=>{super.on(e,i)},"on"));d(this,"off",p((e,i)=>{super.off(e,i)},"off"));M(this,ba,new Jh(e)),M(this,ya,i),M(this,dl,o)}onAdd(e){var n,s;let i=a(this,ba).onAdd(e),o={...Pn,...(n=a(this,dl))!=null?n:{},outdoorView:{token:a(this,ya).outdoorViewToken,...(s=a(this,dl))==null?void 0:s.outdoorView}};return M(this,tn,new ul(a(this,ba).core)),a(this,tn).addMap(a(this,ya),o).then(()=>{this.publish("loaded",{mapView:a(this,tn),mapData:a(this,ya)})}),i}onRemove(){a(this,tn)&&a(this,tn).clear(),lu.instance=null,a(this,ba).onRemove()}};ya=new WeakMap,dl=new WeakMap,tn=new WeakMap,ba=new WeakMap,p(lu,"MappedinMapLibreOverlay"),d(lu,"instance");var hl=lu;m();var v7=p((r,{id:t}={})=>{let e=Array.isArray(r)?r:[r];if(!e.every(n=>typeof n=="string"))return;let i=e.join(""),o=null;if(t){let n=document.getElementById(t);n instanceof HTMLStyleElement&&(o=n)}o==null&&(o=document.createElement("style")),t&&t!==""&&(o.id=t),o.textContent=i,document.head.appendChild(o)},"injectCSS");var C7=":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 S7=".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";var x7=".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 I7=".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 P7=".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 M7='.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 LE=[C7,S7,x7,I7,P7,M7],T7;function AE(r){T7=r}p(AE,"__setWatermarkOnClickFn");var FE=p(async(r,t)=>{let e,i=Fn();t&&i.updateByUserOption(t);try{t&&(e=(await An({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(s){A.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new fl(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new Rd(o)},"hydrateMapDataFromMVF"),w7=!1;function kE(r){w7=r}p(kE,"setUseEnterpriseAPI");var BE=p(async(r,t)=>{var u,h,g,y;let e={...t||{}},i,o=Fn();o.updateByUserOption(e);let n={};if("type"in r&&typeof r.type=="string"){if(n.enterprise=(u=r.options)==null?void 0:u.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let v=await Kl(r.main);i=Ql(v),n.languagePacks=[];for(let b of(h=r.languagePacks)!=null?h:[])b.localePack instanceof Uint8Array&&n.languagePacks.push({language:b.language,localePack:await cs(b.localePack)})}else if(r.type==="json")i=r.main,n.languagePacks=(g=r.languagePacks)!=null?g:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(n.binaryBundle=r.main)}else i=r,n.enterprise=i.enterprise!=null;let s;if("accessToken"in e)s=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=o.getBaseAuthUri(n.enterprise);let v=await An(e,n.enterprise);s=(v==null?void 0:v.accessToken)||""}if(n.outdoorViewToken=s,n.env=o,s&&!n.enterprise)try{n.sasToken=(await ls(e,s)).token}catch(v){A.error("Failed to fetch SAS token.",v)}n.getMapDataOptions=e;let c=new fl(i,n);s&&c.Analytics.init({accessToken:s,mapId:e.mapId,key:"key"in e?e.key:void 0,secret:"secret"in e?e.secret:void 0,...e.analytics,baseUri:o.getAnalyticsBaseUri(),context:(y=e.analytics)==null?void 0:y.context});let l=new Rd(c);if("language"in e)try{await l.changeLanguage(e.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),l},"hydrateMapData"),D7=p(async r=>{var S;let t=w7,e,i=Fn();i.updateByUserOption(r);let o={...r};if("accessToken"in o){e=o.accessToken;let{aud:C,sub:x}=Iu(e);(xv.some(T=>C.includes(T))||x&&x.startsWith("client"))&&(t=!0)}else if("key"in o&&"secret"in o)o.key.startsWith("mik_")||(t=!0),o.baseAuthUri=i.getBaseAuthUri(t),e=(await An(o,t)).accessToken;else throw new Error("Missing key or secret.");o.layoutId!=null&&(t?o.layoutId!=="draft"&&A.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):A.warn("layoutId is currently unsupported!")),o.baseUri=i.getBaseUri(t);let n=performance.now(),s,c;if(t){let C={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},x=await rm(C);s=x.compressed,c=x.localePacks}else s=await im(o,e);let l=performance.now(),u=await Kl(s),h=Ql(u),g=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(h);let y;if(!t)try{y=(await ls(o,e)).token}catch(C){A.error("Failed to fetch SAS token.",C)}let v=new fl(h,{env:i,outdoorViewToken:e,sasToken:y,enterprise:t,localePacksUrls:c,binaryBundle:s,getMapDataOptions:o}),b=new Rd(v,{search:r.search});if(v.Analytics.init({accessToken:e,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:i.getAnalyticsBaseUri(),context:(S=o.analytics)==null?void 0:S.context}),v.Analytics.sendGetMapDataEvent({parseDuration:g-l,downloadDuration:l-n,viewId:o.viewId}),"language"in o)try{await b.changeLanguage(o.language)}catch{}return b},"getMapData"),_E=D7,RE=p((r,t)=>{hl.instance!=null&&A.warn("Only a single map venue is supported at this time.");let e=new hl([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return hl.instance=e,e},"createMapLibreOverlay"),E7=p(async(r,t,e)=>{var u,h,g,y,v,b,S,C,x,T,D,w,E;let i=performance.now(),o=Uf(e,t);o&&jf(o),((u=o.injectStyles)==null||u)&&v7(LE,{id:"mappedin__styles"});let n=Pv((h=t.outdoorViewToken)!=null?h:""),s=Sc(t);(g=o.outdoorView)!=null&&g.style&&s.envControl.updateTileServerBaseUrl((y=o.outdoorView)==null?void 0:y.style);let c=await Dx(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(v=o.style)==null?void 0:v.backgroundAlpha,backgroundColor:(b=o.style)==null?void 0:b.backgroundColor,outdoorView:(S=o.outdoorView)!=null&&S.token?{headers:{"x-mappedin-tiles-key":(C=o.outdoorView)==null?void 0:C.token},style:t.getEnv().tileServerUri,enabled:!!((x=o.outdoorView)!=null&&x.enabled),lowDpi:(T=o.outdoorView)==null?void 0:T.lowDpi}:void 0,watermark:{...o.watermark,visible:((D=o.watermark)==null?void 0:D.visible)||!s.enterpriseMode&&!n.remove_watermark,onClick:T7||void 0},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((w=o.antialiasing)!=null&&w.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(E=o.occlusion)==null?void 0:E.enabled,transformImageRequest: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 ul(c);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},"show3dMap"),NE=E7;function pr(r){return r.verticalOffset===0?[r.longitude,r.latitude]:[r.longitude,r.latitude,r.verticalOffset]}p(pr,"convertCoordinateToPosition");function VE(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}p(VE,"getEntranceMap");var G1=p((r,t)=>{let e=VE(t),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let o of r){let n=[o.geometry.coordinates],s=(o.properties.entrances||[]).reduce((c,l)=>(e.has(l)&&c.push(e.get(l)),c),[]);if(s.length){let{entrances:c,obstructions:l}=Zg(o,s);n=l.map(u=>u.geometry.coordinates),i.entrances.features.push(...c)}i.walls.geometry.coordinates.push(...n)}return i},"cutEntrancesFromLineStrings");function h7(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}p(h7,"translateLabelStateToGeojsonCore");function f7(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}p(f7,"translateMarkerStateToGeojsonCore");function zh(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}p(zh,"translateDoorsStateToGeojsonCore");function g0(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}p(g0,"translateWallsStateToGeojsonCore");function y0(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity),r.flipImageToFaceCamera!==void 0&&(e.flipImageToFaceCamera=r.flipImageToFaceCamera)),e}p(y0,"translateSpaceStateToGeojsonCore");function m7(r){let t={};return r.opacity!==void 0&&(t.opacity=r.opacity),t}p(m7,"translateFloorGeometryStateToGeojsonCore");function O7(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}p(O7,"differenceBetweenAngles");function L7(r,t){let e="Left";return r<=-Math.PI/4?e="Right":r<=-t?e="SlightRight":r<=t?e="Straight":r<=Math.PI/4?e="SlightLeft":e="Left",e}p(L7,"getRelativeBearing");function Qx(r){let t={};for(let e in r){let i=r[e];if(i!=null){if(i.id=e,"polygons"in i)for(let o of i.polygons)t[o]=i;else if("lineStrings"in i)for(let o of i.lineStrings)t[o]=i;else if("points"in i)for(let o of i.points)t[o]=i}}return t}p(Qx,"extractStyleMap");function V1(r,t){return r.reduce((e,i)=>{let o=t[i.properties.id];if(o==null)return e;if("textures"in i.properties&&Array.isArray(i.properties.textures)&&i.properties.textures.length>0){let n={...o,id:o.id+"-textures"};e.set(n,[i])}else e.has(o)||e.set(o,[]),e.get(o).push(i);return e},new Map)}p(V1,"groupGeometryByStyle");function Sp(r,t={}){var o,n,s,c,l,u,h;let e={...r,flipImageToFaceCamera:(o=t==null?void 0:t.flipImagesToFaceCamera)!=null?o:!0},i=(s=(n=t==null?void 0:t.style)==null?void 0:n.shading)!=null?s:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(l=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let g=(h=(u=t==null?void 0:t.style)==null?void 0:u.wallTopColor)!=null?h:t==null?void 0:t.wallTopColor;g!=null&&(e.topColor=g)}return e}p(Sp,"translateToCoreStyle");var g7=p((r,t)=>{var o;let i=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(we);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(go);case"exterior-walls":return i==null?void 0:i.layers.get(Zr);case"interior-doors":return i==null?void 0:i.layers.get(Ya);case"exterior-doors":return i==null?void 0:i.layers.get(Za);default:return typeof r=="string"?r:r.id}},"getTargetID");function e0(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}p(e0,"tweenToPromise");function Vh(r){return r.bbox?r.bbox:Ea(r)}p(Vh,"getBoundingBox");function y7(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1]),Math.max(r[2],t[2]),Math.max(r[3],t[3])]}p(y7,"expandBbox");function A7(r){return[...new Set(r)]}p(A7,"unique");function t0(r,t,e){return r.floorId&&t.has(r.floorId)?t.get(r.floorId):e}p(t0,"getTargetFloorObject");var F7=Math.PI*.1,je,bt,Ot,va,Ca,eo,Sa,gl,ur,k7,ml,B7,x0=class x0{constructor(t,e,i,o){I(this,ur);I(this,je,{});I(this,bt);I(this,Ot);I(this,va);I(this,Ca);I(this,eo);I(this,Sa);I(this,gl);M(this,bt,e),M(this,Ot,t.features),M(this,va,i),M(this,Ca,o)}get path(){return a(this,Ot).map(t=>a(this,bt).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(a(this,je).departure)return a(this,je).departure;let t=a(this,Ot)[0].properties.id,e=a(this,va)[0];if(a(this,va).length>1){for(let i of a(this,va))if(cu(i,a(this,bt)).includes(t)){e=i;break}}return a(this,je).departure=e,e}get destination(){if(a(this,je).destination)return a(this,je).destination;let t=a(this,Ot)[a(this,Ot).length-1].properties.id,e=a(this,Ca)[0];if(a(this,Ca).length>1){for(let i of a(this,Ca))if(cu(i,a(this,bt)).includes(t)){e=i;break}}return a(this,je).destination=e,e}get coordinates(){return a(this,je).coordinates?a(this,je).coordinates:(a(this,je).coordinates=a(this,Ot).map(t=>new Q(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),a(this,je).coordinates)}get distance(){return a(this,je).distance?a(this,je).distance:(a(this,je).distance=a(this,Ot).reduce((t,e)=>t+(e.properties.distance||0),0),a(this,je).distance)}get instructions(){if(a(this,Ot).length<2)return[];if(a(this,je).instructions)return a(this,je).instructions;let t=[],e=0;for(let i=0;i<a(this,Ot).length;i++){let o=a(this,Ot)[i],n=a(this,Ot)[i-1],s=a(this,Ot)[i+1],c=new Q(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=R(this,ur,k7).call(this,{prevDirection:n,direction:o,nextDirection:s});e+=(n==null?void 0:n.properties.distance)||0;for(let u of l)u&&(t.push({action:u,distance:e,coordinate:c,node:a(this,bt).getById("node",o.properties.id)}),e=0)}return a(this,je).instructions=t,a(this,je).instructions}};je=new WeakMap,bt=new WeakMap,Ot=new WeakMap,va=new WeakMap,Ca=new WeakMap,eo=new WeakMap,Sa=new WeakMap,gl=new WeakMap,ur=new WeakSet,k7=p(function(t){var b,S;let{prevDirection:e,direction:i,nextDirection:o}=t,n=e&&a(this,bt).getById("floor",e.properties.groupBy),s=a(this,bt).getById("floor",i.properties.groupBy),c=o&&a(this,bt).getById("floor",o.properties.groupBy),l=[];e||l.push({type:"Departure"});let u=a(this,bt).getMVFFeatureByNodeId("connection",i.properties.id),h=u?a(this,bt).getById("connection",u.id):void 0,g=u&&u.nodes.length>1,y=a(this,bt).enterpriseMode&&(!i.properties.destination||!(u!=null&&u.nodes.includes(i.properties.destination))||!(u!=null&&u.nodes.includes(i.properties.id)));if(u&&!(!g||y))if(!a(this,eo)||a(this,eo)==="exit")l.push(R(this,ur,ml).call(this,"TakeConnection",s,c,h,u)),M(this,eo,"take"),M(this,Sa,h),M(this,gl,u);else{let C=a(this,bt).getMVFFeatureByNodeId("connection",(b=e==null?void 0:e.properties.id)!=null?b:""),x=a(this,bt).getById("connection",(S=C==null?void 0:C.id)!=null?S:"");l.push(R(this,ur,ml).call(this,"ExitConnection",s,n,x,C)),M(this,eo,"exit"),M(this,Sa,h),M(this,gl,u)}else a(this,eo)==="take"?(l.push(R(this,ur,ml).call(this,"ExitConnection",s,n,a(this,Sa),a(this,gl))),M(this,eo,"exit"),M(this,Sa,h)):c&&s.id!==c.id?l.push(R(this,ur,ml).call(this,"TakeConnection",s,c,h)):n&&n.id!==s.id?l.push(R(this,ur,ml).call(this,"ExitConnection",s,n,h)):l.push(R(this,ur,B7).call(this,e,i));return o||l.push({type:"Arrival"}),l},"#getActions"),ml=p(function(t,e,i,o,n){var l,u;let s="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let h=e.elevation-i.elevation;h>0?s="down":h<0&&(s="up")}let c=(u=(l=o==null?void 0:o.type)!=null?l:n==null?void 0:n.type)!=null?u:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:s,connection:o,connectionType:c}},"#createConnectionAction"),B7=p(function(t,e){let i=e.properties.edges;if(!i||i.filter(s=>s.destination.properties.id!==(t==null?void 0:t.properties.id)&&s.destination.properties.id!==e.properties.destination).length===0)return null;let n=t?-O7(t.properties.angle,e.properties.angle):0;return Math.abs(n)>=F7?{type:"Turn",bearing:L7(n,F7),referencePosition:"At"}:null},"#createTurnAction"),p(x0,"Directions");var qh=x0,I0=class I0{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:o,multiplicativeDistanceWeightScaling:n}){d(this,"navigator");d(this,"connections");d(this,"getDirections",p((t,e,i,o)=>{let{accessible:n,smoothing:{enabled:s,radius:c}}=i,l=t.flatMap(b=>cu(b,o)),u=e.flatMap(b=>cu(b,o)),h=this.getExcludedNodeIds(i.excludedConnections).filter(b=>!l.includes(b)&&!u.includes(b)),g=this.getDisabledConnectionNodeIds(n).filter(b=>!l.includes(b)&&!u.includes(b)),y=this.navigator.getDirections({zones:i.zones.map(b=>{var S;return{geometry:b.geometry,cost:b.cost,map:(S=b.floor)==null?void 0:S.id}}),originIds:l,destinationNodeIds:u,excludedNodeIds:h,disabledConnectionNodeIds:g,simplify:{enabled:s,bufferRadius:c},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(y,t,e);let v=new qh(y,o,t,e);if(!(v.distance===0&&new Set([...l,...u]).size===l.length+u.length))return v},"getDirections"));d(this,"getExcludedNodeIds",p(t=>{if(t.length===0)return[];let e=new Set(t.map(i=>i.id));return this.connections.reduce((i,o)=>e.has(o.id)?i.concat(o.nodes):i,[])},"getExcludedNodeIds"));d(this,"getDisabledConnectionNodeIds",p(t=>t===!1?[]:this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]),"getDisabledConnectionNodeIds"));d(this,"addCoordinateDirections",p((t,[e],[i])=>{if(t.features.length){if(Q.is(e)){let o=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if(Q.is(i)){let o=this.createDirectionFeature(i,0,0),n=t.features[t.features.length-1];n.properties.distance=this.navigator.getDistance(n.geometry.coordinates,[i.longitude,i.latitude]),n.properties.angle=this.navigator.getAngle(n.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(o)}}},"addCoordinateDirections"));d(this,"createDirectionFeature",p((t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i,edges:[]}}),"createDirectionFeature"));this.navigator=new Ps({nodes:t,geojsonCollection:this.createCollection(e),groupBy:o,multiplicativeDistanceWeightScaling:n}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,o])=>e.concat(o.features.map(n=>(n.properties.map=i,n))),[])}}};p(I0,"DirectionsInternal");var Qh=I0;function cu(r,t){var e,i,o,n,s;if(On.is(r))return r.navigationTarget.flatMap(c=>cu(c,t));if(Mi.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(e=c==null?void 0:c[0])!=null&&e.feature.id?[c[0].feature.id]:[]}else if(Q.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(i=c==null?void 0:c[0])!=null&&i.feature.id?[c[0].feature.id]:[]}else if(Pi.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(o=c==null?void 0:c[0])!=null&&o.feature.id?[c[0].feature.id]:[]}else if(br.is(r)){let c=t.Query.nearest(r,{types:["node"]});return(n=c==null?void 0:c[0])!=null&&n.feature.id?[c[0].feature.id]:[]}else if(xi.is(r)){let c=t==null?void 0:t.getMVFFeatureById("area",r.id);return(s=c==null?void 0:c.properties.destinationNodes)!=null?s:[]}else if(Ge.is(r)){let c=t==null?void 0:t.getMVFFeatureById("space",r.id);return c==null?[]:c.properties.destinationNodes}else{if(bo.is(r))return r.coordinates.reduce((c,l)=>{var h;let u=t.Query.nearest(l,{types:["node"]});return(h=u==null?void 0:u[0])!=null&&h.feature.id&&c.push(u[0].feature.id),c},[]);if(_t.is(r)){let c=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return c!=null?c:[]}else return rr.is(r)?r.spaces.flatMap(c=>{var l,u;return(u=(l=t==null?void 0:t.getMVFFeatureById("space",c.id))==null?void 0:l.properties.destinationNodes)!=null?u:[]}).filter(c=>typeof c=="string"):Yr.is(r)?r.nodes.map(c=>c.id):vi.is(r)?[r.id]:[]}}p(cu,"getNodesFromTarget");m();m();m();m();m();m();function P0(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return _7(this.cover(t,e),t,e,r)}p(P0,"default");function _7(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var o,n=r._root,s={data:i},c=r._x0,l=r._y0,u=r._x1,h=r._y1,g,y,v,b,S,C,x,T;if(!n)return r._root=s,r;for(;n.length;)if((S=t>=(g=(c+u)/2))?c=g:u=g,(C=e>=(y=(l+h)/2))?l=y:h=y,o=n,!(n=n[x=C<<1|S]))return o[x]=s,r;if(v=+r._x.call(null,n.data),b=+r._y.call(null,n.data),t===v&&e===b)return s.next=n,o?o[x]=s:r._root=s,r;do o=o?o[x]=new Array(4):r._root=new Array(4),(S=t>=(g=(c+u)/2))?c=g:u=g,(C=e>=(y=(l+h)/2))?l=y:h=y;while((x=C<<1|S)===(T=(b>=y)<<1|v>=g));return o[T]=n,o[x]=s,r}p(_7,"add");function R7(r){var t,e,i=r.length,o,n,s=new Array(i),c=new Array(i),l=1/0,u=1/0,h=-1/0,g=-1/0;for(e=0;e<i;++e)isNaN(o=+this._x.call(null,t=r[e]))||isNaN(n=+this._y.call(null,t))||(s[e]=o,c[e]=n,o<l&&(l=o),o>h&&(h=o),n<u&&(u=n),n>g&&(g=n));if(l>h||u>g)return this;for(this.cover(l,u).cover(h,g),e=0;e<i;++e)_7(this,s[e],c[e],r[e]);return this}p(R7,"addAll");m();function M0(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,i=this._y0,o=this._x1,n=this._y1;if(isNaN(e))o=(e=Math.floor(r))+1,n=(i=Math.floor(t))+1;else{for(var s=o-e||1,c=this._root,l,u;e>r||r>=o||i>t||t>=n;)switch(u=(t<i)<<1|r<e,l=new Array(4),l[u]=c,c=l,s*=2,u){case 0:o=e+s,n=i+s;break;case 1:e=o-s,n=i+s;break;case 2:o=e+s,i=n-s;break;case 3:e=o-s,i=n-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=i,this._x1=o,this._y1=n,this}p(M0,"default");m();function T0(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}p(T0,"default");m();function w0(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}p(w0,"default");m();m();function Ke(r,t,e,i,o){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=o}p(Ke,"default");function D0(r,t,e){var i,o=this._x0,n=this._y0,s,c,l,u,h=this._x1,g=this._y1,y=[],v=this._root,b,S;for(v&&y.push(new Ke(v,o,n,h,g)),e==null?e=1/0:(o=r-e,n=t-e,h=r+e,g=t+e,e*=e);b=y.pop();)if(!(!(v=b.node)||(s=b.x0)>h||(c=b.y0)>g||(l=b.x1)<o||(u=b.y1)<n))if(v.length){var C=(s+l)/2,x=(c+u)/2;y.push(new Ke(v[3],C,x,l,u),new Ke(v[2],s,x,C,u),new Ke(v[1],C,c,l,x),new Ke(v[0],s,c,C,x)),(S=(t>=x)<<1|r>=C)&&(b=y[y.length-1],y[y.length-1]=y[y.length-1-S],y[y.length-1-S]=b)}else{var T=r-+this._x.call(null,v.data),D=t-+this._y.call(null,v.data),w=T*T+D*D;if(w<e){var E=Math.sqrt(e=w);o=r-E,n=t-E,h=r+E,g=t+E,i=v.data}}return i}p(D0,"default");m();function E0(r){if(isNaN(h=+this._x.call(null,r))||isNaN(g=+this._y.call(null,r)))return this;var t,e=this._root,i,o,n,s=this._x0,c=this._y0,l=this._x1,u=this._y1,h,g,y,v,b,S,C,x;if(!e)return this;if(e.length)for(;;){if((b=h>=(y=(s+l)/2))?s=y:l=y,(S=g>=(v=(c+u)/2))?c=v:u=v,t=e,!(e=e[C=S<<1|b]))return this;if(!e.length)break;(t[C+1&3]||t[C+2&3]||t[C+3&3])&&(i=t,x=C)}for(;e.data!==r;)if(o=e,!(e=e.next))return this;return(n=e.next)&&delete e.next,o?(n?o.next=n:delete o.next,this):t?(n?t[C]=n:delete t[C],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[x]=e:this._root=e),this):(this._root=n,this)}p(E0,"default");function N7(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}p(N7,"removeAll");m();function O0(){return this._root}p(O0,"default");m();function L0(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}p(L0,"default");m();function A0(r){var t=[],e,i=this._root,o,n,s,c,l;for(i&&t.push(new Ke(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,n=e.x0,s=e.y0,c=e.x1,l=e.y1)&&i.length){var u=(n+c)/2,h=(s+l)/2;(o=i[3])&&t.push(new Ke(o,u,h,c,l)),(o=i[2])&&t.push(new Ke(o,n,h,u,l)),(o=i[1])&&t.push(new Ke(o,u,s,c,h)),(o=i[0])&&t.push(new Ke(o,n,s,u,h))}return this}p(A0,"default");m();function F0(r){var t=[],e=[],i;for(this._root&&t.push(new Ke(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var o=i.node;if(o.length){var n,s=i.x0,c=i.y0,l=i.x1,u=i.y1,h=(s+l)/2,g=(c+u)/2;(n=o[0])&&t.push(new Ke(n,s,c,h,g)),(n=o[1])&&t.push(new Ke(n,h,c,l,g)),(n=o[2])&&t.push(new Ke(n,s,g,h,u)),(n=o[3])&&t.push(new Ke(n,h,g,l,u))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}p(F0,"default");m();function G7(r){return r[0]}p(G7,"defaultX");function k0(r){return arguments.length?(this._x=r,this):this._x}p(k0,"default");m();function V7(r){return r[1]}p(V7,"defaultY");function B0(r){return arguments.length?(this._y=r,this):this._y}p(B0,"default");function pu(r,t,e){var i=new _0(t==null?G7:t,e==null?V7:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}p(pu,"quadtree");function _0(r,t,e,i,o,n){this._x=r,this._y=t,this._x0=e,this._y0=i,this._x1=o,this._y1=n,this._root=void 0}p(_0,"Quadtree");function j7(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}p(j7,"leaf_copy");var Lt=pu.prototype=_0.prototype;Lt.copy=function(){var r=new _0(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,i;if(!t)return r;if(!t.length)return r._root=j7(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var o=0;o<4;++o)(i=t.source[o])&&(i.length?e.push({source:i,target:t.target[o]=new Array(4)}):t.target[o]=j7(i));return r};Lt.add=P0;Lt.addAll=R7;Lt.cover=M0;Lt.data=T0;Lt.extent=w0;Lt.find=D0;Lt.remove=E0;Lt.removeAll=N7;Lt.root=O0;Lt.size=L0;Lt.visit=A0;Lt.visitAfter=F0;Lt.x=k0;Lt.y=B0;var $t,rn,R0=class R0{constructor(t){I(this,$t,{});I(this,rn);M(this,rn,t)}getTreeByType(t,e,i){var s;if(a(this,$t)[t]||(a(this,$t)[t]={}),a(this,$t)[t][e]&&a(this,$t)[t][e][i])return a(this,$t)[t][e][i];a(this,$t)[t][e]||(a(this,$t)[t][e]={}),a(this,$t)[t][e][i]||(a(this,$t)[t][e][i]=pu());let o=a(this,$t)[t][e][i];o.x(c=>c.geometry.coordinates[1]),o.y(c=>c.geometry.coordinates[0]);let n=[];switch(t){case"node":n=((s=a(this,rn).directions.navigator.graph.nodesByGroup.get(i))==null?void 0:s.filter(c=>c.properties.neighbors.length>0))||[];break;case"point-of-interest":n=a(this,rn).mvfPoisByFloorId[i]||[];break;case"door":n=a(this,rn).mvfEntrancesByFloorId[i]||[];break;case"annotation":n=a(this,rn).mvfAnnotationsByFloorId[i]||[];break}return(n==null?void 0:n.length)>0&&o.addAll(n),o}};$t=new WeakMap,rn=new WeakMap,p(R0,"QueryCache");var Kh=R0;var jE=G.object({limit:G.enum(["same-floor","same-elevation"]).optional(),radius:G.number().optional(),types:G.array(G.enum(["node","point-of-interest"])).min(1)}),di,du,N0=class N0{constructor(t){I(this,di);I(this,du);M(this,di,t),M(this,du,new Kh(a(this,di)))}nearest(t,e){try{jE.parse(e)}catch(s){A.error(s);return}let i=Vl(t);if(!i)return;let o=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let s of a(this,di).getByType("floor-stack")){let c=s.defaultFloor;c&&o.push(c.id)}else if(e.limit==="same-elevation"){let s=a(this,di).floorsById[i.floorId];if(s){let c=s==null?void 0:s.elevation;c&&(o=a(this,di).getByType("floor-stack").map(l=>{var u;return(u=l.floors.find(h=>h.elevation===c))==null?void 0:u.id}).filter(Boolean))}}let n=[];for(let s of A7(e.types))for(let c of o){let l=a(this,du).getTreeByType(s,a(this,di).mapName,c).find(i.latitude,i.longitude,e.radius);if(l){let u=a(this,di).getById(s,l==null?void 0:l.properties.id);u&&n.push({distance:Pr([i.longitude,i.latitude],l.geometry.coordinates),feature:u})}}return n.sort((s,c)=>s.distance-c.distance)}};di=new WeakMap,du=new WeakMap,p(N0,"Query");var uu=N0;m();m();var hu,G0=class G0{constructor(t){I(this,hu);M(this,hu,t||[])}get raw(){return a(this,hu)}};hu=new WeakMap,p(G0,"OpeningHours");var ef=G0;var At,W,Me,yl=class yl extends Xe{constructor(e,i){super(i.mvfData.id);d(this,"__type",yl.__type);d(this,"id","loc_");d(this,"name","");d(this,"externalId");d(this,"description");d(this,"logo");d(this,"phone");d(this,"social",[]);d(this,"images",[]);d(this,"links",[]);d(this,"website");d(this,"icon");I(this,At);I(this,W,{});I(this,Me);M(this,At,e),M(this,Me,i.mvfData);for(let o in i.mvfData)o==="links"?this.links=i.mvfData.links.map(n=>new fo({mvfData:n})):o==="pictures"?this.images=i.mvfData.pictures.map(n=>n.url?new bn({mvfData:{url:n.url}}):void 0).filter(n=>n!=null):o==="website"?i.mvfData.website&&(this.website=new fo({mvfData:i.mvfData.website})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,Me)[o]}})}static is(e){return e.__type===yl.__type}get spaces(){if(a(this,W).spaces)return a(this,W).spaces;if(a(this,Me).spaces==null)return a(this,W).spaces=[],a(this,W).spaces;a(this,W).spaces=[];for(let e=0;e<a(this,Me).spaces.length;e++){let i=a(this,At).getById("space",a(this,Me).spaces[e].id);i&&a(this,W).spaces.push(i)}return a(this,W).spaces}get points(){if(a(this,W).points)return a(this,W).points;if(a(this,Me).spaces==null)return a(this,W).points=[],a(this,W).points;a(this,W).points=[];for(let e=0;e<a(this,Me).spaces.length;e++){let i=a(this,At).getById("point-of-interest",a(this,Me).spaces[e].id);i&&a(this,W).points.push(i)}return a(this,W).points}get doors(){if(a(this,W).doors)return a(this,W).doors;if(a(this,Me).entrances==null)return a(this,W).doors=[],a(this,W).doors;a(this,W).doors=[];for(let e=0;e<a(this,Me).entrances.length;e++){let i=a(this,At).getById("door",a(this,Me).entrances[e].id);i&&a(this,W).doors.push(i)}return a(this,W).doors}get connections(){var i;if(a(this,W).connections)return a(this,W).connections;if(a(this,Me).connections==null)return a(this,W).connections=[],a(this,W).connections;let e=new Set;for(let o=0;o<a(this,Me).connections.length;o++){let n=a(this,Me).connections[o],s=a(this,At).mvfConnectionsById[n],l=(s==null?[]:s.nodes).map(u=>a(this,At).getById("node",u)).filter(Boolean);for(let u of l){if(u==null)continue;let h=Xr([u.coordinate.longitude,u.coordinate.latitude]),y=((i=a(this,At).connectionSpaceIdsByLatLon[h])!=null?i:[]).map(v=>a(this,At).connectionsById[v]).filter(v=>v!=null);for(let v of y)e.add(v)}}return a(this,W).connections=Array.from(e),a(this,W).connections}get annotations(){if(a(this,W).annotations)return a(this,W).annotations;if(a(this,Me).annotations==null)return a(this,W).annotations=[],a(this,W).annotations;a(this,W).annotations=[];for(let e=0;e<a(this,Me).annotations.length;e++){let i=a(this,At).getById("annotation",a(this,Me).annotations[e].id);i&&a(this,W).annotations.push(i)}return a(this,W).annotations}get categories(){return a(this,W).categories?a(this,W).categories:a(this,Me).categories==null?(a(this,W).categories=[],a(this,W).categories):(a(this,W).categories=a(this,Me).categories.map(e=>a(this,At).getById("location-category",e)).filter(e=>e!=null),a(this,W).categories)}get mapObjects(){return a(this,W).mapObjects?a(this,W).mapObjects:a(this,Me).obstructions==null?(a(this,W).mapObjects=[],a(this,W).mapObjects):(a(this,W).mapObjects=a(this,Me).obstructions.map(e=>a(this,At).getById("object",e.id)).filter(e=>e!=null),a(this,W).mapObjects)}get areas(){return a(this,W).areas?a(this,W).areas:a(this,Me).areas==null?(a(this,W).areas=[],a(this,W).areas):(a(this,W).areas=a(this,Me).areas.map(e=>a(this,At).getById("area",e.id)).filter(e=>e!=null),a(this,W).areas)}get focusTarget(){if(a(this,W).focusTarget)return a(this,W).focusTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);return a(this,W).focusTarget=e,e}get openingHours(){var e;return a(this,W).openingHours?a(this,W).openingHours:(a(this,W).openingHours=new ef((e=a(this,Me).openingHoursSpecification)!=null?e:[]),a(this,W).openingHours)}get navigationTarget(){if(a(this,W).navigationTarget)return a(this,W).navigationTarget;let e=[];for(let i of this.spaces)e.push(i);for(let i of this.connections)e.push(...i.coordinates);for(let i of this.doors)e.push(i.focusTarget);for(let i of this.mapObjects)e.push(i.focusTarget);for(let i of this.annotations)e.push(i.focusTarget);for(let i of this.points)e.push(i.focusTarget);return a(this,W).navigationTarget=e,e}toJSON(){return{id:this.id,name:this.name}}};At=new WeakMap,W=new WeakMap,Me=new WeakMap,p(yl,"LocationProfile"),d(yl,"__type","location-profile");var V0=yl,On=V0;m();var on,Wt,xa,bl=class bl extends Xe{constructor(e,i){super(i.mvfData.id);d(this,"__type",bl.__type);d(this,"id","cat_");d(this,"name","");d(this,"icon","");I(this,on);I(this,Wt,{});I(this,xa);M(this,on,e),M(this,xa,i.mvfData);for(let o in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,xa)[o]}})}static is(e){return e.__type===bl.__type}get parent(){return a(this,Wt).parent?a(this,Wt).parent:(a(this,Wt).parent=a(this,xa).parent?a(this,on).getById("location-category",a(this,xa).parent):void 0,a(this,Wt).parent)}get children(){return a(this,Wt).children?a(this,Wt).children:(a(this,Wt).children=a(this,on).locationCategoriesByParentId[this.id]||[],a(this,Wt).children)}get locationProfiles(){if(a(this,Wt).locationProfiles)return a(this,Wt).locationProfiles;let e=[];for(let i of a(this,on).locationProfilesByCategoryId[this.id]||[]){let o=a(this,on).getById("location-profile",i.id);o&&e.push(o)}return a(this,Wt).locationProfiles=e,e}toJSON(){return{id:this.id,name:this.name}}};on=new WeakMap,Wt=new WeakMap,xa=new WeakMap,p(bl,"LocationCategory"),d(bl,"__type","location-category");var j0=bl,Yl=j0;var $,tf,U7,vl,nn,Ia,U0=class U0 extends te{constructor(e,i){var c,l,u,h,g;super();I(this,tf);d(this,"Analytics");I(this,$,{});d(this,"Query");d(this,"mvf");d(this,"outdoorViewToken");d(this,"spaceIdsByDestinationNodeId");d(this,"objectEntranceNodeIdsByObstructionId");d(this,"obstructionIdByEntranceId");d(this,"venue");d(this,"sasToken");d(this,"directions");d(this,"enterpriseMode",!1);d(this,"nodesById");d(this,"spacesById");d(this,"floorsById");d(this,"floorStacksById");d(this,"facadesById");d(this,"facadesBySpaceId");d(this,"connectionsById");d(this,"objectsById");d(this,"doorsById");d(this,"pointsOfInterestById");d(this,"annotationsById");d(this,"areasById");d(this,"locationProfilesById");d(this,"locationCategoriesById");d(this,"locationProfilesByExternalId");d(this,"locationsById");d(this,"locationProfilesByCategoryId");d(this,"locationCategoriesByParentId");d(this,"categoriesById");d(this,"doorsByNodeId");d(this,"mvfLocationsBySpaceId");d(this,"locationIdsByNodeId");d(this,"spaceIdsByNodeId");d(this,"mvfAnnotationsById");d(this,"mvfConnectionsById");d(this,"mvfConnectionsByNodeId");d(this,"mvfConnectionIdsByLatLon");d(this,"mvfEntrancesById");d(this,"mvfNodesById");d(this,"mvfObstructionById");d(this,"mvfSpacesById");d(this,"mvfFloorsById");d(this,"mvfFloorStacksById");d(this,"mvfAreasById");d(this,"connectionSpaceIdsByLatLon");d(this,"locationProfilesByAttachedFeatureId");d(this,"spacesByExternalId");d(this,"nodesByExternalId");d(this,"objectsByExternalId");d(this,"poisByExternalId");d(this,"floorsByExternalId");d(this,"floorStacksByExternalId");d(this,"doorsByExternalId");d(this,"areasByExternalId");d(this,"connectionsByExternalId");d(this,"locationsByExternalId");d(this,"categoriesByExternalId");d(this,"mvfNodesByFloorId");d(this,"mvfSpacesByFloorId");d(this,"mvfPoisByFloorId");d(this,"mvfEntrancesByFloorId");d(this,"mvfAnnotationsByFloorId");d(this,"localePacksUrls");d(this,"currentLanguage");d(this,"languagePacks",{});d(this,"tilesets",{});d(this,"binaryBundle");d(this,"envControl");d(this,"getMapDataOptions");I(this,vl);d(this,"getDirectionsMultiDestination",p((e,i,o)=>this.getDirections(e,i,{...o,multiDestination:!0}),"getDirectionsMultiDestination"));d(this,"getDirections",p((e,i,o)=>{let{accessible:n=!1,smoothing:s=!0,multiDestination:c=!1}=o||{},l=typeof s=="object"?s.enabled:s,u=typeof s=="object"?s.radius:void 0,h=(o==null?void 0:o.zones)||[],g={accessible:n,zones:h,smoothing:{enabled:l!=null?l:!0,radius:u!=null?u:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(c&&Array.isArray(i)){let y=Array.isArray(e)?e:[e],v=[];for(let b of i){let S=Array.isArray(b)?b:[b],C=this.directions.getDirections(y,S,g,this);if(!C){A.error("getDirections failed due to missing directions for one of the segments");return}y=S,v.push(C)}return v}else{let y=Array.isArray(e)?e:[e],v=Array.isArray(i)?i:[i];if(Array.isArray(v[0])){A.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,v[0].id),this.directions.getDirections(y,v,g,this)}},"getDirections"));I(this,nn);I(this,Ia);d(this,"transformImageRequest",p(async e=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!oS(e))return{url:e};let i=await this.getSasToken();if(i==null)return A.error("Failed to append SAS token to image request. Requests for private images may fail."),{url:e};let[o]=e.split("?");return{url:"".concat(o,"?").concat(i)}},"transformImageRequest"));let o=(c=i==null?void 0:i.env)!=null?c:Fn();if(this.envControl=o,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new rs,this.localePacksUrls=(l=i==null?void 0:i.localePacksUrls)!=null?l:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.getMapDataOptions=i==null?void 0:i.getMapDataOptions,((u=e["tileset.json"])==null?void 0:u.default)!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,o.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let y of e["tileset.json"].others)this.tilesets[y.key]=y;this.enterpriseMode=(h=i==null?void 0:i.enterprise)!=null?h:!1,this.sasToken=i==null?void 0:i.sasToken;let n=Tv(e,this);this.nodesById=n.nodesById,this.spacesById=n.spacesById,this.floorsById=n.floorsById,this.floorStacksById=n.floorStacksById,this.facadesById=n.facadesById,this.facadesBySpaceId=n.facadesBySpaceId,this.connectionsById=n.connectionsById,this.objectsById=n.objectsById,this.doorsById=n.doorsById,this.pointsOfInterestById=n.poisById,this.annotationsById=n.annotationsById,this.areasById=n.areasById,this.locationProfilesById=n.locationProfilesById,this.locationCategoriesById=n.locationCategoriesById,this.locationProfilesByCategoryId=n.locationProfilesByCategoryId,this.locationCategoriesByParentId=n.locationCategoriesByParentId,this.spacesByExternalId=n.spacesByExternalId,this.nodesByExternalId=n.nodesByExternalId,this.objectsByExternalId=n.objectsByExternalId,this.floorsByExternalId=n.floorsByExternalId,this.locationProfilesByExternalId=n.locationProfilesByExternalId,this.floorStacksByExternalId=n.floorStacksByExternalId,this.poisByExternalId=n.poisByExternalId,this.doorsByExternalId=n.doorsByExternalId,this.areasByExternalId=n.areasByExternalId,this.mvfAnnotationsById=n.mvfAnnotationsById,this.mvfConnectionsById=n.mvfConnectionsById,this.mvfConnectionsByNodeId=n.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=n.mvfConnectionIdsByLatLon,this.mvfEntrancesById=n.mvfEntrancesById,this.mvfNodesById=n.mvfNodesById,this.mvfObstructionById=n.mvfObstructionById,this.mvfSpacesById=n.mvfSpacesById,this.mvfFloorsById=n.mvfFloorsById,this.mvfFloorStacksById=n.mvfFloorStacksById,this.mvfNodesByFloorId=n.mvfNodesByFloorId,this.mvfSpacesByFloorId=n.mvfSpacesByFloorId,this.mvfPoisByFloorId=n.mvfPoisByFloorId,this.mvfEntrancesByFloorId=n.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=n.mvfAnnotationsByFloorId,this.mvfAreasById=n.mvfAreasById,this.doorsByNodeId=n.doorsByNodeId,this.spaceIdsByDestinationNodeId=n.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=n.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=n.obstructionIdByEntranceId;let s=Mv(e,this);if(this.locationsById=s.locationsById,this.categoriesById=s.categoriesById,this.mvfLocationsBySpaceId=s.mvfLocationsBySpaceId,this.locationIdsByNodeId=s.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=n.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=n.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=s.spaceIdsByNodeId,this.connectionsByExternalId=s.connectionsByExternalId,this.locationsByExternalId=s.locationsByExternalId,this.categoriesByExternalId=s.categoriesByExternalId,s.venue.name!=null){this.venue=new ku(this,{mvfData:s.venue});let y={};for(let v in s.mvfLocationsById)y[v]=s.mvfLocationsById[v];for(let v in s.locationInstancesById)y[v]=s.locationInstancesById[v];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":y,"enterprise-category":s.mvfCategoriesById,"floor-stack":n.mvfFloorStacksById,floor:n.mvfFloorsById}},(g=i==null?void 0:i.languagePacks)==null||g.forEach(({language:v,localePack:b})=>{this.languagePacks[v.code]=zg(b)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new uu(this),this.directions=new Qh({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let e=this;return{get baseUri(){var i;return e.envControl.getBaseUri((i=e.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new Q(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?e:0}get spaces(){return a(this,$).spaces==null&&(a(this,$).spaces=globalThis.Object.values(this.spacesById)),a(this,$).spaces}get objects(){return a(this,$).objects==null&&(a(this,$).objects=globalThis.Object.values(this.objectsById)),a(this,$).objects}get connections(){return a(this,$).connections==null&&(a(this,$).connections=globalThis.Object.values(this.connectionsById)),a(this,$).connections}get floors(){return a(this,$).floors==null&&(a(this,$).floors=globalThis.Object.values(this.floorsById)),a(this,$).floors}get floorStacks(){return a(this,$).floorStacks==null&&(a(this,$).floorStacks=globalThis.Object.values(this.floorStacksById)),a(this,$).floorStacks}get facades(){return a(this,$).facades==null&&(a(this,$).facades=globalThis.Object.values(this.facadesById)),a(this,$).facades}get doors(){return a(this,$).doors==null&&(a(this,$).doors=globalThis.Object.values(this.doorsById)),a(this,$).doors}get pointsOfInterest(){return a(this,$).pointsOfInterest==null&&(a(this,$).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),a(this,$).pointsOfInterest}get annotations(){return a(this,$).annotations==null&&(a(this,$).annotations=globalThis.Object.values(this.annotationsById)),a(this,$).annotations}get areas(){return a(this,$).areas==null&&(a(this,$).areas=globalThis.Object.values(this.areasById)),a(this,$).areas}get nodes(){return a(this,$).nodes==null&&(a(this,$).nodes=globalThis.Object.values(this.nodesById)),a(this,$).nodes}get locations(){return a(this,$).locations==null&&(a(this,$).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return a(this,$).categories==null&&(a(this,$).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return a(this,$).locationProfiles==null&&(a(this,$).locationProfiles=globalThis.Object.values(this.locationProfilesById)),a(this,$).locationProfiles}get locationCategories(){return a(this,$).locationCategories==null&&(a(this,$).locationCategories=globalThis.Object.values(this.locationCategoriesById)),a(this,$).locationCategories}get mvfFloors(){return a(this,$).mvfFloors==null&&(a(this,$).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),a(this,$).mvfFloors}get mvfFloorStacks(){return a(this,$).mvfFloorStacks==null&&(a(this,$).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),a(this,$).mvfFloorStacks}async getAccessToken(){if(this.getMapDataOptions==null)return;let e="accessToken"in this.getMapDataOptions?this.getMapDataOptions.accessToken:void 0;if(!e&&"key"in this.getMapDataOptions&&"secret"in this.getMapDataOptions)try{a(this,nn)||M(this,nn,An(this.getMapDataOptions,this.enterpriseMode));let i=await a(this,nn);M(this,nn,void 0),e=i.accessToken}catch(i){M(this,nn,void 0),A.error("Failed to fetch access token. Requests for private images may fail.",i)}return e}async getSasToken(){if(this.getMapDataOptions==null)return;let e;try{a(this,Ia)||M(this,Ia,this.getAccessToken().then(o=>{if(this.getMapDataOptions==null||o==null)throw new Error("Unable to fetch SAS token without access token");return ls(this.getMapDataOptions,o)})),e=(await a(this,Ia)).token}catch(i){A.log("Unable to fetch SAS token",i)}finally{M(this,Ia,void 0)}return e}getByType(e){switch(e){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(e,i){switch(e){case"location-profile":return this.locationProfilesById[i];case"location-category":return this.locationCategoriesById[i];case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":let o=this.connectionsById[i];return o==null&&(o=R(this,tf,U7).call(this,this.mvfConnectionsById[i])),o;case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:return}}getByExternalId(e,i){var o,n,s,c,l,u,h,g,y,v,b,S;switch(e){case"location-profile":return(o=this.locationProfilesByExternalId[i])!=null?o:[];case"location-category":return[];case"space":return(n=this.spacesByExternalId[i])!=null?n:[];case"floor":return(s=this.floorsByExternalId[i])!=null?s:[];case"floor-stack":return(c=this.floorStacksByExternalId[i])!=null?c:[];case"node":return(l=this.nodesByExternalId[i])!=null?l:[];case"door":return(u=this.doorsByExternalId[i])!=null?u:[];case"connection":return(h=this.connectionsByExternalId[i])!=null?h:[];case"object":return(g=this.objectsByExternalId[i])!=null?g:[];case"point-of-interest":return(y=this.poisByExternalId[i])!=null?y:[];case"area":return(v=this.areasByExternalId[i])!=null?v:[];case"enterprise-location":return(b=this.locationsByExternalId[i])!=null?b:[];case"enterprise-category":return(S=this.categoriesByExternalId[i])!=null?S:[];default:return[]}}getMapDataById(e){var i,o,n,s,c,l,u,h,g,y;return(y=(g=(h=(u=(l=(c=(s=(n=(o=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?o:this.floorStacksById[e])!=null?n:this.facadesById[e])!=null?s:this.nodesById[e])!=null?c:this.doorsById[e])!=null?l:this.connectionsById[e])!=null?u:this.objectsById[e])!=null?h:this.pointsOfInterestById[e])!=null?g:this.annotationsById[e])!=null?y:this.areasById[e]}getMVFFeatureById(e,i){switch(e){case"space":return this.mvfSpacesById[i];case"node":return this.mvfNodesById[i];case"obstruction":return this.mvfObstructionById[i];case"floor":return this.mvfFloorsById[i];case"floor-stack":return this.mvfFloorStacksById[i];case"connection":return this.mvfConnectionsById[i];case"entrance":return this.mvfEntrancesById[i];case"annotation":return this.mvfAnnotationsById[i];case"area":return this.mvfAreasById[i];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,i){switch(e){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,i,o,n){var l,u;if(!this.currentLanguage)return n;let{code:s}=this.currentLanguage,c=(u=(l=this.languagePacks[s])==null?void 0:l.optimized)==null?void 0:u[e];if(c){let h=c[o];if(h!=null&&h[i]!==void 0)return h[i]}return n}async changeLanguage(e){var c;let i=e.toLowerCase();if(!i){A.error("language code must be defined");return}if(!this.currentLanguage){A.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,n=(c=this.venue)==null?void 0:c.languages.find(({code:l})=>l.toLowerCase()===i.toLowerCase());if(!n){A.warn("language not found");return}if(o===n.code)return;let s=this.languagePacks[n.code];if(!s){let l=this.localePacksUrls[n.code];if(!l){A.error("locale packs url not found for ".concat(n.code));return}a(this,vl)&&a(this,vl).abort();let u=new AbortController;M(this,vl,u);let h;try{h=await Xv(l,{signal:u.signal})}catch(g){A.error("failed downloading language pack",g);return}if(!h||u.signal.aborted)return;s=zg(h),this.languagePacks[n.code]=s}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=n,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let o=Vl(e),n=Vl(i);return Pr([o.longitude,o.latitude],[n.longitude,n.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var o;let i=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let c=await tm(this.localePacksUrls[s.code],{signal:n.signal}),l=await cs(c);l&&i.push({language:{code:s.code,name:s.name},localePack:l})}}catch(c){A.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var o;if(!this.binaryBundle){A.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let c=await tm(this.localePacksUrls[s.code],{signal:n.signal});c&&i.push({language:{code:s.code,name:s.name},localePack:c})}}catch(c){A.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(a(this,$)))a(this,$)[e]=null}};$=new WeakMap,tf=new WeakSet,U7=p(function(e){var c;let i=(c=e==null?void 0:e.nodes)==null?void 0:c[0],o=this.getById("node",i);if(o==null)return;let n=Xr([o.coordinate.longitude,o.coordinate.latitude]),s=this.connectionSpaceIdsByLatLon[n];return s==null?void 0:s.map(l=>this.connectionsById[l]).find(l=>l!=null)},"#getConnectionFromMVFConnection"),vl=new WeakMap,nn=new WeakMap,Ia=new WeakMap,p(U0,"MapDataInternal");var fl=U0;var Sl,Pa,fu,hi,Cl=class Cl extends mr{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",Cl.__type);I(this,Sl);I(this,Pa);I(this,fu);I(this,hi,{});M(this,Sl,i.mvfData),M(this,Pa,e),M(this,fu,i.floorStackId)}static is(e){return e.__type===Cl.__type}get floorStack(){return a(this,Pa).getById("floor-stack",a(this,fu))}get spaces(){if(!a(this,hi).spaces){a(this,hi).spaces=[];for(let e of a(this,Sl).spaces){let i=a(this,Pa).getById("space",e.spaceId);i&&a(this,hi).spaces.push(i)}}return a(this,hi).spaces}get center(){if(!a(this,hi).center){let e={type:"FeatureCollection",features:[]};for(let o of this.spaces){let n=a(this,Pa).mvfSpacesById[o.id];n&&e.features.push(n)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=Bu(e);a(this,hi).center=new Q(i.geometry.coordinates[1],i.geometry.coordinates[0],a(this,Sl).spaces[0].floorId)}return a(this,hi).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};Sl=new WeakMap,Pa=new WeakMap,fu=new WeakMap,hi=new WeakMap,p(Cl,"Facade"),d(Cl,"__type","facade");var H0=Cl,rr=H0;export{Q as a,vi as b,Ge as c,Ll as d,rr as e,Yr as f,Xl as g,KD as h,D7 as i,E7 as j,GE as k};
|