@mappedin/react-sdk 6.0.1-beta.37 → 6.0.1-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +289 -654
- package/lib/esm/{GLTFExporter-3DPEZKOC.js → GLTFExporter-LCJJ2XME.js} +1 -1
- package/lib/esm/GLTFLoader-EOECKSEX.js +1 -0
- package/lib/esm/browser-LSWKTFI4.js +1 -0
- package/lib/esm/{chunk-7H7HYUVU.js → chunk-3QBLXB2D.js} +1 -1
- package/lib/esm/chunk-5IJAS5ZC.js +1 -0
- package/lib/esm/chunk-BYBJJK7K.js +1 -0
- package/lib/esm/chunk-BYMKRV3A.js +1 -0
- package/lib/esm/chunk-D44H7KGD.js +1 -0
- package/lib/esm/chunk-MNQRLYHZ.js +1 -0
- package/lib/esm/chunk-SBBKLBAA.js +1 -0
- package/lib/esm/index.d.ts +575 -300
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-MBXNQKQ4.js +1 -0
- package/lib/esm/{internal-OHZQTK3N.js → internal-IZKKNLJQ.js} +1 -1
- package/lib/esm/outdoor-context-v4-PH7UY7HA.js +1 -0
- package/lib/esm/{roboto-regular-V36DLM4S.js → roboto-regular-E5TUWU5Q.js} +1 -1
- package/lib/esm/text3d-D7RMMBLN.js +1 -0
- package/package.json +2 -2
- package/lib/esm/GLTFLoader-FNDPGHTV.js +0 -1
- package/lib/esm/browser-PUDTREP5.js +0 -1
- package/lib/esm/chunk-CBBFEVN4.js +0 -1
- package/lib/esm/chunk-J5IUISYU.js +0 -1
- package/lib/esm/chunk-PFDTT6ZZ.js +0 -1
- package/lib/esm/chunk-RGA6MUTU.js +0 -1
- package/lib/esm/chunk-S7CLJZMO.js +0 -1
- package/lib/esm/chunk-YP5ZSRNK.js +0 -1
- package/lib/esm/inspector-4J34N3O3.js +0 -1
- package/lib/esm/outdoor-context-v4-VQWUPKMU.js +0 -1
- package/lib/esm/text3d-ZXEDJBSG.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as fu,$a as Cv,A as vf,Aa as tv,B as Pr,Ba as wf,C as p2,Ca as rv,D as aa,Da as Df,E as R,Ea as Ef,F as Ux,Fa as iv,G as A2,Ga as ov,H as Dr,Ha as nv,I as F2,Ia as av,J as dt,Ja as sv,K as Sf,Ka as Of,L as B2,La as $i,M as al,Ma as lv,N as k2,Na as cv,O as Yi,Oa as pv,P as xf,Pa as uv,Q as Zi,Qa as bu,R as Ae,Ra as Lf,S as sl,Sa as dv,T as If,Ta as hv,U as R2,Ua as fv,V as da,Va as mv,W as $o,Wa as yv,X as N2,Xa as Af,Y as Pf,Ya as gv,Z as G2,Za as vv,_a as bv,a as t2,aa as mu,ab as Sv,b as r2,ba as V2,bb as xv,c as O,ca as j2,cb as qe,d as mf,da as yu,db as Iv,e as iu,ea as H2,eb as rr,f as i2,fa as U2,fb as Ie,g as ou,ga as W2,h as o2,ha as X2,i as nu,ia as zi,j as rl,ja as Mf,k as n2,ka as ll,l as yf,la as Y2,m as J,ma as Z2,n as be,na as z2,o as na,oa as q2,p as gf,pa as qi,q as Ir,qa as gu,r as au,ra as ha,s as ti,sa as vu,t as Yo,ta as $2,u as a2,ua as Tf,v as s2,va as J2,w as l2,wa as Q2,x as c2,xa as tr,y as il,ya as K2,z as Tt,za as ev}from"./chunk-PFDTT6ZZ.js";import{j as _2}from"./chunk-RGA6MUTU.js";import{a as Ji}from"./chunk-7H7HYUVU.js";import{$ as S2,$a as E2,Aa as ri,Ba as uu,C as f2,Ca as M2,D as ue,Da as T2,E as ee,Fa as ii,I as m2,J as y2,K as g2,L as v2,M as W,N as wt,O as b2,P as sa,Pa as ua,Q as la,R as nl,S as ze,Ta as du,U as Ht,Ua as w2,V as zo,W as C2,X as le,Y as ca,Ya as D2,_ as qo,_a as wr,aa as bf,ab as hu,b as su,bb as O2,ca as Wi,db as L2,e as Zo,f as u2,g as ol,ka as pa,la as x2,ma as cu,na as I2,p as d2,pa as Cf,r as h2,ua as P2,va as Xi,wa as pu,ya as Mr,z as lu,za as Tr}from"./chunk-CBBFEVN4.js";import{a as y,b as P}from"./chunk-S7CLJZMO.js";import{a as p,c as H,d as e2,e as ru,f as d,g as a,h as x,i as T,j as V}from"./chunk-J5IUISYU.js";var Qv=H((fm,mm)=>{y();(function(r,t){typeof fm=="object"&&typeof mm<"u"?mm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(fm,function(){"use strict";function r(b,C,w,M,D){p(function E(F,B,G,N,k){for(;N>G;){if(N-G>600){var j=N-G+1,U=B-G+1,K=Math.log(j),te=.5*Math.exp(2*K/3),fe=.5*Math.sqrt(K*te*(j-te)/j)*(U-j/2<0?-1:1),Le=Math.max(G,Math.floor(B-U*te/j+fe)),ct=Math.min(N,Math.floor(B+(j-U)*te/j+fe));E(F,B,Le,ct,k)}var me=F[B],we=G,ye=N;for(t(F,G,B),k(F[N],me)>0&&t(F,G,N);we<ye;){for(t(F,we,ye),we++,ye--;k(F[we],me)<0;)we++;for(;k(F[ye],me)>0;)ye--}k(F[G],me)===0?t(F,G,ye):t(F,++ye,N),ye<=B&&(G=ye+1),B<=ye&&(N=ye-1)}},"t")(b,C,w||0,M||b.length-1,D||e)}p(r,"t");function t(b,C,w){var M=b[C];b[C]=b[w],b[w]=M}p(t,"i");function e(b,C){return b<C?-1:b>C?1:0}p(e,"n");var i=p(function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function o(b,C,w){if(!w)return C.indexOf(b);for(var M=0;M<C.length;M++)if(w(b,C[M]))return M;return-1}p(o,"e");function n(b,C){s(b,0,b.children.length,C,b)}p(n,"a");function s(b,C,w,M,D){D||(D=I(null)),D.minX=1/0,D.minY=1/0,D.maxX=-1/0,D.maxY=-1/0;for(var E=C;E<w;E++){var F=b.children[E];c(D,b.leaf?M(F):F)}return D}p(s,"h");function c(b,C){return b.minX=Math.min(b.minX,C.minX),b.minY=Math.min(b.minY,C.minY),b.maxX=Math.max(b.maxX,C.maxX),b.maxY=Math.max(b.maxY,C.maxY),b}p(c,"o");function l(b,C){return b.minX-C.minX}p(l,"s");function u(b,C){return b.minY-C.minY}p(u,"l");function h(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}p(h,"f");function m(b){return b.maxX-b.minX+(b.maxY-b.minY)}p(m,"u");function g(b,C){return b.minX<=C.minX&&b.minY<=C.minY&&C.maxX<=b.maxX&&C.maxY<=b.maxY}p(g,"m");function v(b,C){return C.minX<=b.maxX&&C.minY<=b.maxY&&C.maxX>=b.minX&&C.maxY>=b.minY}p(v,"c");function I(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}p(I,"p");function S(b,C,w,M,D){for(var E=[C,w];E.length;)if(!((w=E.pop())-(C=E.pop())<=M)){var F=C+Math.ceil((w-C)/M/2)*M;r(b,F,C,w,D),E.push(C,F,F,w)}}return p(S,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var C=this.data,w=[];if(!v(b,C))return w;for(var M=this.toBBox,D=[];C;){for(var E=0;E<C.children.length;E++){var F=C.children[E],B=C.leaf?M(F):F;v(b,B)&&(C.leaf?w.push(F):g(b,B)?this._all(F,w):D.push(F))}C=D.pop()}return w},i.prototype.collides=function(b){var C=this.data;if(!v(b,C))return!1;for(var w=[];C;){for(var M=0;M<C.children.length;M++){var D=C.children[M],E=C.leaf?this.toBBox(D):D;if(v(b,E)){if(C.leaf||g(b,E))return!0;w.push(D)}}C=w.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var C=0;C<b.length;C++)this.insert(b[C]);return this}var w=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===w.height)this._splitRoot(this.data,w);else{if(this.data.height<w.height){var M=this.data;this.data=w,w=M}this._insert(w,this.data.height-w.height-1,!0)}else this.data=w;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=I([]),this},i.prototype.remove=function(b,C){if(!b)return this;for(var w,M,D,E=this.data,F=this.toBBox(b),B=[],G=[];E||B.length;){if(E||(E=B.pop(),M=B[B.length-1],w=G.pop(),D=!0),E.leaf){var N=o(b,E.children,C);if(N!==-1)return E.children.splice(N,1),B.push(E),this._condense(B),this}D||E.leaf||!g(E,F)?M?(w++,E=M.children[w],D=!1):E=null:(B.push(E),G.push(w),w=0,M=E,E=E.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,C){return b.minX-C.minX},i.prototype.compareMinY=function(b,C){return b.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,C){for(var w=[];b;)b.leaf?C.push.apply(C,b.children):w.push.apply(w,b.children),b=w.pop();return C},i.prototype._build=function(b,C,w,M){var D,E=w-C+1,F=this._maxEntries;if(E<=F)return n(D=I(b.slice(C,w+1)),this.toBBox),D;M||(M=Math.ceil(Math.log(E)/Math.log(F)),F=Math.ceil(E/Math.pow(F,M-1))),(D=I([])).leaf=!1,D.height=M;var B=Math.ceil(E/F),G=B*Math.ceil(Math.sqrt(F));S(b,C,w,G,this.compareMinX);for(var N=C;N<=w;N+=G){var k=Math.min(N+G-1,w);S(b,N,k,B,this.compareMinY);for(var j=N;j<=k;j+=B){var U=Math.min(j+B-1,k);D.children.push(this._build(b,j,U,M-1))}}return n(D,this.toBBox),D},i.prototype._chooseSubtree=function(b,C,w,M){for(;M.push(C),!C.leaf&&M.length-1!==w;){for(var D=1/0,E=1/0,F=void 0,B=0;B<C.children.length;B++){var G=C.children[B],N=h(G),k=(j=b,U=G,(Math.max(U.maxX,j.maxX)-Math.min(U.minX,j.minX))*(Math.max(U.maxY,j.maxY)-Math.min(U.minY,j.minY))-N);k<E?(E=k,D=N<D?N:D,F=G):k===E&&N<D&&(D=N,F=G)}C=F||C.children[0]}var j,U;return C},i.prototype._insert=function(b,C,w){var M=w?b:this.toBBox(b),D=[],E=this._chooseSubtree(M,this.data,C,D);for(E.children.push(b),c(E,M);C>=0&&D[C].children.length>this._maxEntries;)this._split(D,C),C--;this._adjustParentBBoxes(M,D,C)},i.prototype._split=function(b,C){var w=b[C],M=w.children.length,D=this._minEntries;this._chooseSplitAxis(w,D,M);var E=this._chooseSplitIndex(w,D,M),F=I(w.children.splice(E,w.children.length-E));F.height=w.height,F.leaf=w.leaf,n(w,this.toBBox),n(F,this.toBBox),C?b[C-1].children.push(F):this._splitRoot(w,F)},i.prototype._splitRoot=function(b,C){this.data=I([b,C]),this.data.height=b.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,C,w){for(var M,D,E,F,B,G,N,k=1/0,j=1/0,U=C;U<=w-C;U++){var K=s(b,0,U,this.toBBox),te=s(b,U,w,this.toBBox),fe=(D=K,E=te,F=void 0,B=void 0,G=void 0,N=void 0,F=Math.max(D.minX,E.minX),B=Math.max(D.minY,E.minY),G=Math.min(D.maxX,E.maxX),N=Math.min(D.maxY,E.maxY),Math.max(0,G-F)*Math.max(0,N-B)),Le=h(K)+h(te);fe<k?(k=fe,M=U,j=Le<j?Le:j):fe===k&&Le<j&&(j=Le,M=U)}return M||w-C},i.prototype._chooseSplitAxis=function(b,C,w){var M=b.leaf?this.compareMinX:l,D=b.leaf?this.compareMinY:u;this._allDistMargin(b,C,w,M)<this._allDistMargin(b,C,w,D)&&b.children.sort(M)},i.prototype._allDistMargin=function(b,C,w,M){b.children.sort(M);for(var D=this.toBBox,E=s(b,0,C,D),F=s(b,w-C,w,D),B=m(E)+m(F),G=C;G<w-C;G++){var N=b.children[G];c(E,b.leaf?D(N):N),B+=m(E)}for(var k=w-C-1;k>=C;k--){var j=b.children[k];c(F,b.leaf?D(j):j),B+=m(F)}return B},i.prototype._adjustParentBBoxes=function(b,C,w){for(var M=w;M>=0;M--)c(C[M],b)},i.prototype._condense=function(b){for(var C=b.length-1,w=void 0;C>=0;C--)b[C].children.length===0?C>0?(w=b[C-1].children).splice(w.indexOf(b[C]),1):this.clear():n(b[C],this.toBBox)},i})});var Cm=H(z=>{"use strict";y();Object.defineProperty(z,"__esModule",{value:!0});z.earthRadius=63710088e-1;z.factors={centimeters:z.earthRadius*100,centimetres:z.earthRadius*100,degrees:z.earthRadius/111325,feet:z.earthRadius*3.28084,inches:z.earthRadius*39.37,kilometers:z.earthRadius/1e3,kilometres:z.earthRadius/1e3,meters:z.earthRadius,metres:z.earthRadius,miles:z.earthRadius/1609.344,millimeters:z.earthRadius*1e3,millimetres:z.earthRadius*1e3,nauticalmiles:z.earthRadius/1852,radians:1,yards:z.earthRadius*1.0936};z.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/z.earthRadius,yards:1.0936133};z.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 co(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(co,"feature");z.feature=co;function G6(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return ym(t).geometry;case"LineString":return vm(t).geometry;case"Polygon":return gm(t).geometry;case"MultiPoint":return eb(t).geometry;case"MultiLineString":return Kv(t).geometry;case"MultiPolygon":return tb(t).geometry;default:throw new Error(r+" is invalid")}}p(G6,"geometry");z.geometry=G6;function ym(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(!Mu(r[0])||!Mu(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return co(i,t,e)}p(ym,"point");z.point=ym;function V6(r,t,e){return e===void 0&&(e={}),Tu(r.map(function(i){return ym(i,t)}),e)}p(V6,"points");z.points=V6;function gm(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 co(c,t,e)}p(gm,"polygon");z.polygon=gm;function j6(r,t,e){return e===void 0&&(e={}),Tu(r.map(function(i){return gm(i,t)}),e)}p(j6,"polygons");z.polygons=j6;function vm(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 co(i,t,e)}p(vm,"lineString");z.lineString=vm;function H6(r,t,e){return e===void 0&&(e={}),Tu(r.map(function(i){return vm(i,t)}),e)}p(H6,"lineStrings");z.lineStrings=H6;function Tu(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(Tu,"featureCollection");z.featureCollection=Tu;function Kv(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return co(i,t,e)}p(Kv,"multiLineString");z.multiLineString=Kv;function eb(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return co(i,t,e)}p(eb,"multiPoint");z.multiPoint=eb;function tb(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return co(i,t,e)}p(tb,"multiPolygon");z.multiPolygon=tb;function U6(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return co(i,t,e)}p(U6,"geometryCollection");z.geometryCollection=U6;function W6(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(W6,"round");z.round=W6;function rb(r,t){t===void 0&&(t="kilometers");var e=z.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}p(rb,"radiansToLength");z.radiansToLength=rb;function bm(r,t){t===void 0&&(t="kilometers");var e=z.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}p(bm,"lengthToRadians");z.lengthToRadians=bm;function X6(r,t){return ib(bm(r,t))}p(X6,"lengthToDegrees");z.lengthToDegrees=X6;function Y6(r){var t=r%360;return t<0&&(t+=360),t}p(Y6,"bearingToAzimuth");z.bearingToAzimuth=Y6;function ib(r){var t=r%(2*Math.PI);return t*180/Math.PI}p(ib,"radiansToDegrees");z.radiansToDegrees=ib;function Z6(r){var t=r%360;return t*Math.PI/180}p(Z6,"degreesToRadians");z.degreesToRadians=Z6;function z6(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 rb(bm(r,t),e)}p(z6,"convertLength");z.convertLength=z6;function q6(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=z.areaFactors[t];if(!i)throw new Error("invalid original units");var o=z.areaFactors[e];if(!o)throw new Error("invalid final units");return r/i*o}p(q6,"convertArea");z.convertArea=q6;function Mu(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}p(Mu,"isNumber");z.isNumber=Mu;function $6(r){return!!r&&r.constructor===Object}p($6,"isObject");z.isObject=$6;function J6(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(!Mu(t))throw new Error("bbox must only contain numbers")})}p(J6,"validateBBox");z.validateBBox=J6;function Q6(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(Q6,"validateId");z.validateId=Q6});var lb=H(Ve=>{"use strict";y();Object.defineProperty(Ve,"__esModule",{value:!0});var ot=Cm();function Ol(r,t,e){if(r!==null)for(var i,o,n,s,c,l,u,h=0,m=0,g,v=r.type,I=v==="FeatureCollection",S=v==="Feature",b=I?r.features.length:1,C=0;C<b;C++){u=I?r.features[C].geometry:S?r.geometry:r,g=u?u.type==="GeometryCollection":!1,c=g?u.geometries.length:1;for(var w=0;w<c;w++){var M=0,D=0;if(s=g?u.geometries[w]: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,m,C,M,D)===!1)return!1;m++,M++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],m,C,M,D)===!1)return!1;m++,E==="MultiPoint"&&M++}E==="LineString"&&M++;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],m,C,M,D)===!1)return!1;m++}E==="MultiLineString"&&M++,E==="Polygon"&&D++}E==="Polygon"&&M++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(D=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-h;n++){if(t(l[i][o][n],m,C,M,D)===!1)return!1;m++}D++}M++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(Ol(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}p(Ol,"coordEach");function K6(r,t,e,i){var o=e;return Ol(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(K6,"coordReduce");function ob(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(ob,"propEach");function e9(r,t,e){var i=e;return ob(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(e9,"propReduce");function nb(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(nb,"featureEach");function t9(r,t,e){var i=e;return nb(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(t9,"featureReduce");function r9(r){var t=[];return Ol(r,function(e){t.push(e)}),t}p(r9,"coordAll");function Sm(r,t){var e,i,o,n,s,c,l,u,h,m,g=0,v=r.type==="FeatureCollection",I=r.type==="Feature",S=v?r.features.length:1;for(e=0;e<S;e++){for(c=v?r.features[e].geometry:I?r.geometry:r,u=v?r.features[e].properties:I?r.properties:{},h=v?r.features[e].bbox:I?r.bbox:void 0,m=v?r.features[e].id:I?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,g,u,h,m)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,g,u,h,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],g,u,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}p(Sm,"geomEach");function i9(r,t,e){var i=e;return Sm(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}p(i9,"geomReduce");function wu(r,t){Sm(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(ot.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],m={type:l,coordinates:h};if(t(ot.feature(m,o),i,u)===!1)return!1}})}p(wu,"flattenEach");function o9(r,t,e){var i=e;return wu(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}p(o9,"flattenReduce");function ab(r,t){wu(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(Ol(e,function(m,g,v,I,S){if(c===void 0||i>l||I>u||S>h){c=m,l=i,u=I,h=S,n=0;return}var b=ot.lineString([c,m],e.properties);if(t(b,i,o,S,n)===!1)return!1;n++,c=m})===!1)return!1}}})}p(ab,"segmentEach");function n9(r,t,e){var i=e,o=!1;return ab(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(n9,"segmentReduce");function sb(r,t){if(!r)throw new Error("geojson is required");wu(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(ot.lineString(s[c],e.properties),i,o,c)===!1)return!1;break}}})}p(sb,"lineEach");function a9(r,t,e){var i=e;return sb(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}p(a9,"lineReduce");function s9(r,t){if(t=t||{},!ot.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),ot.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),ot.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),ot.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),ot.lineString([l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}p(s9,"findSegment");function l9(r,t){if(t=t||{},!ot.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 ot.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),ot.point(l[i],s,t);case"LineString":return n<0&&(n=l.length+n),ot.point(l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),ot.point(l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),ot.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),ot.point(l[i][o][n],s,t)}throw new Error("geojson is invalid")}p(l9,"findPoint");Ve.coordAll=r9;Ve.coordEach=Ol;Ve.coordReduce=K6;Ve.featureEach=nb;Ve.featureReduce=t9;Ve.findPoint=l9;Ve.findSegment=s9;Ve.flattenEach=wu;Ve.flattenReduce=o9;Ve.geomEach=Sm;Ve.geomReduce=i9;Ve.lineEach=sb;Ve.lineReduce=a9;Ve.propEach=ob;Ve.propReduce=e9;Ve.segmentEach=ab;Ve.segmentReduce=n9});var xm=H((zA,pb)=>{"use strict";y();var cb=Object.prototype.toString;pb.exports=p(function(t){var e=cb.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&cb.call(t.callee)==="[object Function]"),i},"isArguments")});var bb=H((JA,vb)=>{"use strict";y();var gb;Object.keys||(Ll=Object.prototype.hasOwnProperty,Im=Object.prototype.toString,ub=xm(),Pm=Object.prototype.propertyIsEnumerable,db=!Pm.call({toString:null},"toString"),hb=Pm.call(function(){},"prototype"),Al=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Du=p(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),fb={$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},mb=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!fb["$"+r]&&Ll.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Du(window[r])}catch{return!0}}catch{return!0}return!1}(),yb=p(function(r){if(typeof window>"u"||!mb)return Du(r);try{return Du(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),gb=p(function(t){var e=t!==null&&typeof t=="object",i=Im.call(t)==="[object Function]",o=ub(t),n=e&&Im.call(t)==="[object String]",s=[];if(!e&&!i&&!o)throw new TypeError("Object.keys called on a non-object");var c=hb&&i;if(n&&t.length>0&&!Ll.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")&&Ll.call(t,h)&&s.push(String(h));if(db)for(var m=yb(t),g=0;g<Al.length;++g)!(m&&Al[g]==="constructor")&&Ll.call(t,Al[g])&&s.push(Al[g]);return s},"keys"));var Ll,Im,ub,Pm,db,hb,Al,Du,fb,mb,yb;vb.exports=gb});var Ou=H((eF,xb)=>{"use strict";y();var c9=Array.prototype.slice,p9=xm(),Cb=Object.keys,Eu=Cb?p(function(t){return Cb(t)},"keys"):bb(),Sb=Object.keys;Eu.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 p9(i)?Sb(c9.call(i)):Sb(i)},"keys"))}else Object.keys=Eu;return Object.keys||Eu},"shimObjectKeys");xb.exports=Eu});var Pb=H((iF,Ib)=>{"use strict";y();Ib.exports=Error});var Tb=H((nF,Mb)=>{"use strict";y();Mb.exports=EvalError});var Db=H((sF,wb)=>{"use strict";y();wb.exports=RangeError});var Ob=H((cF,Eb)=>{"use strict";y();Eb.exports=ReferenceError});var Mm=H((uF,Lb)=>{"use strict";y();Lb.exports=SyntaxError});var mi=H((hF,Ab)=>{"use strict";y();Ab.exports=TypeError});var Bb=H((mF,Fb)=>{"use strict";y();Fb.exports=URIError});var Fl=H((gF,kb)=>{"use strict";y();kb.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 Lu=H((CF,Rb)=>{"use strict";y();var _b=typeof Symbol<"u"&&Symbol,u9=Fl();Rb.exports=p(function(){return typeof _b!="function"||typeof Symbol!="function"||typeof _b("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:u9()},"hasNativeSymbols")});var Gb=H((IF,Nb)=>{"use strict";y();var Tm={__proto__:null,foo:{}},d9=Object;Nb.exports=p(function(){return{__proto__:Tm}.foo===Tm.foo&&!(Tm instanceof d9)},"hasProto")});var Hb=H((TF,jb)=>{"use strict";y();var h9="Function.prototype.bind called on incompatible ",f9=Object.prototype.toString,m9=Math.max,y9="[object Function]",Vb=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"),g9=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"),v9=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");jb.exports=p(function(t){var e=this;if(typeof e!="function"||f9.apply(e)!==y9)throw new TypeError(h9+e);for(var i=g9(arguments,1),o,n=p(function(){if(this instanceof o){var h=e.apply(this,Vb(i,arguments));return Object(h)===h?h:this}return e.apply(t,Vb(i,arguments))},"binder"),s=m9(0,e.length-i.length),c=[],l=0;l<s;l++)c[l]="$"+l;if(o=Function("binder","return function ("+v9(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 Au=H((EF,Ub)=>{"use strict";y();var b9=Hb();Ub.exports=Function.prototype.bind||b9});var wm=H((LF,Wb)=>{"use strict";y();var C9=Function.prototype.call,S9=Object.prototype.hasOwnProperty,x9=Au();Wb.exports=x9.call(C9,S9)});var pr=H((FF,qb)=>{"use strict";y();var ae,I9=Pb(),P9=Tb(),M9=Db(),T9=Ob(),Za=Mm(),Ya=mi(),w9=Bb(),zb=Function,Dm=p(function(r){try{return zb('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),vn=Object.getOwnPropertyDescriptor;if(vn)try{vn({},"")}catch{vn=null}var Em=p(function(){throw new Ya},"throwTypeError"),D9=vn?function(){try{return arguments.callee,Em}catch{try{return vn(arguments,"callee").get}catch{return Em}}}():Em,Wa=Lu()(),E9=Gb()(),$e=Object.getPrototypeOf||(E9?function(r){return r.__proto__}:null),Xa={},O9=typeof Uint8Array>"u"||!$e?ae:$e(Uint8Array),bn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ae:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ae:ArrayBuffer,"%ArrayIteratorPrototype%":Wa&&$e?$e([][Symbol.iterator]()):ae,"%AsyncFromSyncIteratorPrototype%":ae,"%AsyncFunction%":Xa,"%AsyncGenerator%":Xa,"%AsyncGeneratorFunction%":Xa,"%AsyncIteratorPrototype%":Xa,"%Atomics%":typeof Atomics>"u"?ae:Atomics,"%BigInt%":typeof BigInt>"u"?ae:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ae:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ae:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ae:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":I9,"%eval%":eval,"%EvalError%":P9,"%Float32Array%":typeof Float32Array>"u"?ae:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ae:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ae:FinalizationRegistry,"%Function%":zb,"%GeneratorFunction%":Xa,"%Int8Array%":typeof Int8Array>"u"?ae:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ae:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ae:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Wa&&$e?$e($e([][Symbol.iterator]())):ae,"%JSON%":typeof JSON=="object"?JSON:ae,"%Map%":typeof Map>"u"?ae:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Wa||!$e?ae:$e(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ae:Promise,"%Proxy%":typeof Proxy>"u"?ae:Proxy,"%RangeError%":M9,"%ReferenceError%":T9,"%Reflect%":typeof Reflect>"u"?ae:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ae:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Wa||!$e?ae:$e(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ae:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Wa&&$e?$e(""[Symbol.iterator]()):ae,"%Symbol%":Wa?Symbol:ae,"%SyntaxError%":Za,"%ThrowTypeError%":D9,"%TypedArray%":O9,"%TypeError%":Ya,"%Uint8Array%":typeof Uint8Array>"u"?ae:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ae:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ae:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ae:Uint32Array,"%URIError%":w9,"%WeakMap%":typeof WeakMap>"u"?ae:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ae:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ae:WeakSet};if($e)try{null.error}catch(r){Xb=$e($e(r)),bn["%Error.prototype%"]=Xb}var Xb,L9=p(function r(t){var e;if(t==="%AsyncFunction%")e=Dm("async function () {}");else if(t==="%GeneratorFunction%")e=Dm("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Dm("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&$e&&(e=$e(o.prototype))}return bn[t]=e,e},"doEval"),Yb={__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"]},Bl=Au(),Fu=wm(),A9=Bl.call(Function.call,Array.prototype.concat),F9=Bl.call(Function.apply,Array.prototype.splice),Zb=Bl.call(Function.call,String.prototype.replace),Bu=Bl.call(Function.call,String.prototype.slice),B9=Bl.call(Function.call,RegExp.prototype.exec),k9=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_9=/\\(\\)?/g,R9=p(function(t){var e=Bu(t,0,1),i=Bu(t,-1);if(e==="%"&&i!=="%")throw new Za("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Za("invalid intrinsic syntax, expected opening `%`");var o=[];return Zb(t,k9,function(n,s,c,l){o[o.length]=c?Zb(l,_9,"$1"):s||n}),o},"stringToPath"),N9=p(function(t,e){var i=t,o;if(Fu(Yb,i)&&(o=Yb[i],i="%"+o[0]+"%"),Fu(bn,i)){var n=bn[i];if(n===Xa&&(n=L9(i)),typeof n>"u"&&!e)throw new Ya("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:n}}throw new Za("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");qb.exports=p(function(t,e){if(typeof t!="string"||t.length===0)throw new Ya("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ya('"allowMissing" argument must be a boolean');if(B9(/^%?[^%]*%?$/,t)===null)throw new Za("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=R9(t),o=i.length>0?i[0]:"",n=N9("%"+o+"%",e),s=n.name,c=n.value,l=!1,u=n.alias;u&&(o=u[0],F9(i,A9([0,1],u)));for(var h=1,m=!0;h<i.length;h+=1){var g=i[h],v=Bu(g,0,1),I=Bu(g,-1);if((v==='"'||v==="'"||v==="`"||I==='"'||I==="'"||I==="`")&&v!==I)throw new Za("property names with quotes must have matching quotes");if((g==="constructor"||!m)&&(l=!0),o+="."+g,s="%"+o+"%",Fu(bn,s))c=bn[s];else if(c!=null){if(!(g in c)){if(!e)throw new Ya("base intrinsic for "+t+" exists, but the property is not available.");return}if(vn&&h+1>=i.length){var S=vn(c,g);m=!!S,m&&"get"in S&&!("originalValue"in S.get)?c=S.get:c=c[g]}else m=Fu(c,g),c=c[g];m&&!l&&(bn[s]=c)}}return c},"GetIntrinsic")});var _u=H((_F,$b)=>{"use strict";y();var G9=pr(),ku=G9("%Object.defineProperty%",!0)||!1;if(ku)try{ku({},"a",{value:1})}catch{ku=!1}$b.exports=ku});var Nu=H((NF,Jb)=>{"use strict";y();var V9=pr(),Ru=V9("%Object.getOwnPropertyDescriptor%",!0);if(Ru)try{Ru([],"length")}catch{Ru=null}Jb.exports=Ru});var Gu=H((VF,e3)=>{"use strict";y();var Qb=_u(),j9=Mm(),za=mi(),Kb=Nu();e3.exports=p(function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new za("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new za("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new za("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new za("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new za("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new za("`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=!!Kb&&Kb(t,e);if(Qb)Qb(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 j9("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Vu=H((UF,r3)=>{"use strict";y();var Om=_u(),t3=p(function(){return!!Om},"hasPropertyDescriptors");t3.hasArrayLengthDefineBug=p(function(){if(!Om)return null;try{return Om([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");r3.exports=t3});var po=H((YF,a3)=>{"use strict";y();var H9=Ou(),U9=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",W9=Object.prototype.toString,X9=Array.prototype.concat,i3=Gu(),Y9=p(function(r){return typeof r=="function"&&W9.call(r)==="[object Function]"},"isFunction"),o3=Vu()(),Z9=p(function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!Y9(i)||!i())return}o3?i3(r,t,e,!0):i3(r,t,e)},"defineProperty"),n3=p(function(r,t){var e=arguments.length>2?arguments[2]:{},i=H9(t);U9&&(i=X9.call(i,Object.getOwnPropertySymbols(t)));for(var o=0;o<i.length;o+=1)Z9(r,i[o],t[i[o]],e[i[o]])},"defineProperties");n3.supportsDescriptors=!!o3;a3.exports=n3});var u3=H((qF,p3)=>{"use strict";y();var z9=pr(),s3=Gu(),q9=Vu()(),l3=Nu(),c3=mi(),$9=z9("%Math.floor%");p3.exports=p(function(t,e){if(typeof t!="function")throw new c3("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||$9(e)!==e)throw new c3("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,n=!0;if("length"in t&&l3){var s=l3(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(n=!1)}return(o||n||!i)&&(q9?s3(t,"length",e,!0,!0):s3(t,"length",e)),t},"setFunctionLength")});var Cn=H((QF,ju)=>{"use strict";y();var Lm=Au(),Hu=pr(),J9=u3(),Q9=mi(),f3=Hu("%Function.prototype.apply%"),m3=Hu("%Function.prototype.call%"),y3=Hu("%Reflect.apply%",!0)||Lm.call(m3,f3),d3=_u(),K9=Hu("%Math.max%");ju.exports=p(function(t){if(typeof t!="function")throw new Q9("a function is required");var e=y3(Lm,m3,arguments);return J9(e,1+K9(0,t.length-(arguments.length-1)),!0)},"callBind");var h3=p(function(){return y3(Lm,f3,arguments)},"applyBind");d3?d3(ju.exports,"apply",{value:h3}):ju.exports.apply=h3});var Rt=H((tB,b3)=>{"use strict";y();var g3=pr(),v3=Cn(),e8=v3(g3("String.prototype.indexOf"));b3.exports=p(function(t,e){var i=g3(t,!!e);return typeof i=="function"&&e8(t,".prototype.")>-1?v3(i):i},"callBoundIntrinsic")});var Am=H((oB,P3)=>{"use strict";y();var t8=Ou(),x3=Fl()(),I3=Rt(),C3=Object,r8=I3("Array.prototype.push"),S3=I3("Object.prototype.propertyIsEnumerable"),i8=x3?Object.getOwnPropertySymbols:null;P3.exports=p(function(t,e){if(t==null)throw new TypeError("target must be an object");var i=C3(t);if(arguments.length===1)return i;for(var o=1;o<arguments.length;++o){var n=C3(arguments[o]),s=t8(n),c=x3&&(Object.getOwnPropertySymbols||i8);if(c)for(var l=c(n),u=0;u<l.length;++u){var h=l[u];S3(n,h)&&r8(s,h)}for(var m=0;m<s.length;++m){var g=s[m];if(S3(n,g)){var v=n[g];i[g]=v}}}return i},"assign")});var Bm=H((sB,M3)=>{"use strict";y();var Fm=Am(),o8=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"),n8=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");M3.exports=p(function(){return!Object.assign||o8()||n8()?Fm:Object.assign},"getPolyfill")});var w3=H((pB,T3)=>{"use strict";y();var a8=po(),s8=Bm();T3.exports=p(function(){var t=s8();return a8(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t},"shimAssign")});var L3=H((hB,O3)=>{"use strict";y();var l8=po(),c8=Cn(),p8=Am(),D3=Bm(),u8=w3(),d8=c8.apply(D3()),E3=p(function(t,e){return d8(Object,arguments)},"assign");l8(E3,{getPolyfill:D3,implementation:p8,shim:u8});O3.exports=E3});var F3=H((yB,A3)=>{"use strict";y();var _l=p(function(){return typeof p(function(){},"f").name=="string"},"functionsHaveNames"),kl=Object.getOwnPropertyDescriptor;if(kl)try{kl([],"length")}catch{kl=null}_l.functionsHaveConfigurableNames=p(function(){if(!_l()||!kl)return!1;var t=kl(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var h8=Function.prototype.bind;_l.boundFunctionsHaveNames=p(function(){return _l()&&typeof h8=="function"&&p(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");A3.exports=_l});var _3=H((bB,k3)=>{"use strict";y();var B3=Gu(),f8=Vu()(),m8=F3().functionsHaveConfigurableNames(),y8=mi();k3.exports=p(function(t,e){if(typeof t!="function")throw new y8("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||m8)&&(f8?B3(t,"name",e,!0,!0):B3(t,"name",e)),t},"setFunctionName")});var km=H((xB,R3)=>{"use strict";y();var g8=_3(),v8=mi(),b8=Object;R3.exports=g8(p(function(){if(this==null||this!==b8(this))throw new v8("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 _m=H((MB,N3)=>{"use strict";y();var C8=km(),S8=po().supportsDescriptors,x8=Object.getOwnPropertyDescriptor;N3.exports=p(function(){if(S8&&/a/mig.flags==="gim"){var t=x8(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:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return C8},"getPolyfill")});var j3=H((DB,V3)=>{"use strict";y();var I8=po().supportsDescriptors,P8=_m(),M8=Object.getOwnPropertyDescriptor,T8=Object.defineProperty,w8=TypeError,G3=Object.getPrototypeOf,D8=/a/;V3.exports=p(function(){if(!I8||!G3)throw new w8("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=P8(),e=G3(D8),i=M8(e,"flags");return(!i||i.get!==t)&&T8(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var X3=H((LB,W3)=>{"use strict";y();var E8=po(),O8=Cn(),L8=km(),H3=_m(),A8=j3(),U3=O8(H3());E8(U3,{getPolyfill:H3,implementation:L8,shim:A8});W3.exports=U3});var uo=H((FB,Y3)=>{"use strict";y();var F8=Fl();Y3.exports=p(function(){return F8()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Nm=H((_B,z3)=>{"use strict";y();var B8=uo()(),k8=Rt(),Rm=k8("Object.prototype.toString"),Uu=p(function(t){return B8&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Rm(t)==="[object Arguments]"},"isArguments"),Z3=p(function(t){return Uu(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Rm(t)!=="[object Array]"&&Rm(t.callee)==="[object Function]"},"isArguments"),_8=function(){return Uu(arguments)}();Uu.isLegacyArguments=Z3;z3.exports=_8?Uu:Z3});var q3=H(()=>{y()});var m4=H((HB,f4)=>{y();var zm=typeof Map=="function"&&Map.prototype,Gm=Object.getOwnPropertyDescriptor&&zm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xu=zm&&Gm&&typeof Gm.get=="function"?Gm.get:null,$3=zm&&Map.prototype.forEach,qm=typeof Set=="function"&&Set.prototype,Vm=Object.getOwnPropertyDescriptor&&qm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Yu=qm&&Vm&&typeof Vm.get=="function"?Vm.get:null,J3=qm&&Set.prototype.forEach,R8=typeof WeakMap=="function"&&WeakMap.prototype,Nl=R8?WeakMap.prototype.has:null,N8=typeof WeakSet=="function"&&WeakSet.prototype,Gl=N8?WeakSet.prototype.has:null,G8=typeof WeakRef=="function"&&WeakRef.prototype,Q3=G8?WeakRef.prototype.deref:null,V8=Boolean.prototype.valueOf,j8=Object.prototype.toString,H8=Function.prototype.toString,U8=String.prototype.match,$m=String.prototype.slice,fo=String.prototype.replace,W8=String.prototype.toUpperCase,K3=String.prototype.toLowerCase,l4=RegExp.prototype.test,e4=Array.prototype.concat,kr=Array.prototype.join,X8=Array.prototype.slice,t4=Math.floor,Um=typeof BigInt=="function"?BigInt.prototype.valueOf:null,jm=Object.getOwnPropertySymbols,Wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,qa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",nt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===qa||!0)?Symbol.toStringTag:null,c4=Object.prototype.propertyIsEnumerable,r4=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function i4(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||l4.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-t4(-r):t4(r);if(i!==r){var o=String(i),n=$m.call(t,o.length+1);return fo.call(o,e,"$&_")+"."+fo.call(fo.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fo.call(t,e,"$&_")}p(i4,"addNumericSeparator");var Xm=q3(),o4=Xm.custom,n4=u4(o4)?o4:null;f4.exports=p(function r(t,e,i,o){var n=e||{};if(ho(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ho(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=ho(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(ho(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(ho(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 h4(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return c?i4(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return c?i4(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 Ym(t)?"[Array]":"[Object]";var m=cI(n,i);if(typeof o>"u")o=[];else if(d4(o,t)>=0)return"[Circular]";function g(K,te,fe){if(te&&(o=X8.call(o),o.push(te)),fe){var Le={depth:n.depth};return ho(n,"quoteStyle")&&(Le.quoteStyle=n.quoteStyle),r(K,Le,i+1,o)}return r(K,n,i+1,o)}if(p(g,"inspect"),typeof t=="function"&&!a4(t)){var v=eI(t),I=Wu(t,g);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(I.length>0?" { "+kr.call(I,", ")+" }":"")}if(u4(t)){var S=qa?fo.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wm.call(t);return typeof t=="object"&&!qa?Rl(S):S}if(aI(t)){for(var b="<"+K3.call(String(t.nodeName)),C=t.attributes||[],w=0;w<C.length;w++)b+=" "+C[w].name+"="+p4(Y8(C[w].value),"double",n);return b+=">",t.childNodes&&t.childNodes.length&&(b+="..."),b+="</"+K3.call(String(t.nodeName))+">",b}if(Ym(t)){if(t.length===0)return"[]";var M=Wu(t,g);return m&&!lI(M)?"["+Zm(M,m)+"]":"[ "+kr.call(M,", ")+" ]"}if(z8(t)){var D=Wu(t,g);return!("cause"in Error.prototype)&&"cause"in t&&!c4.call(t,"cause")?"{ ["+String(t)+"] "+kr.call(e4.call("[cause]: "+g(t.cause),D),", ")+" }":D.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+kr.call(D,", ")+" }"}if(typeof t=="object"&&s){if(n4&&typeof t[n4]=="function"&&Xm)return Xm(t,{depth:h-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(tI(t)){var E=[];return $3&&$3.call(t,function(K,te){E.push(g(te,t,!0)+" => "+g(K,t))}),s4("Map",Xu.call(t),E,m)}if(oI(t)){var F=[];return J3&&J3.call(t,function(K){F.push(g(K,t))}),s4("Set",Yu.call(t),F,m)}if(rI(t))return Hm("WeakMap");if(nI(t))return Hm("WeakSet");if(iI(t))return Hm("WeakRef");if($8(t))return Rl(g(Number(t)));if(Q8(t))return Rl(g(Um.call(t)));if(J8(t))return Rl(V8.call(t));if(q8(t))return Rl(g(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!Z8(t)&&!a4(t)){var B=Wu(t,g),G=r4?r4(t)===Object.prototype:t instanceof Object||t.constructor===Object,N=t instanceof Object?"":"null prototype",k=!G&&nt&&Object(t)===t&&nt in t?$m.call(mo(t),8,-1):N?"Object":"",j=G||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",U=j+(k||N?"["+kr.call(e4.call([],k||[],N||[]),": ")+"] ":"");return B.length===0?U+"{}":m?U+"{"+Zm(B,m)+"}":U+"{ "+kr.call(B,", ")+" }"}return String(t)},"inspect_");function p4(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}p(p4,"wrapQuotes");function Y8(r){return fo.call(String(r),/"/g,""")}p(Y8,"quote");function Ym(r){return mo(r)==="[object Array]"&&(!nt||!(typeof r=="object"&&nt in r))}p(Ym,"isArray");function Z8(r){return mo(r)==="[object Date]"&&(!nt||!(typeof r=="object"&&nt in r))}p(Z8,"isDate");function a4(r){return mo(r)==="[object RegExp]"&&(!nt||!(typeof r=="object"&&nt in r))}p(a4,"isRegExp");function z8(r){return mo(r)==="[object Error]"&&(!nt||!(typeof r=="object"&&nt in r))}p(z8,"isError");function q8(r){return mo(r)==="[object String]"&&(!nt||!(typeof r=="object"&&nt in r))}p(q8,"isString");function $8(r){return mo(r)==="[object Number]"&&(!nt||!(typeof r=="object"&&nt in r))}p($8,"isNumber");function J8(r){return mo(r)==="[object Boolean]"&&(!nt||!(typeof r=="object"&&nt in r))}p(J8,"isBoolean");function u4(r){if(qa)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Wm)return!1;try{return Wm.call(r),!0}catch{}return!1}p(u4,"isSymbol");function Q8(r){if(!r||typeof r!="object"||!Um)return!1;try{return Um.call(r),!0}catch{}return!1}p(Q8,"isBigInt");var K8=Object.prototype.hasOwnProperty||function(r){return r in this};function ho(r,t){return K8.call(r,t)}p(ho,"has");function mo(r){return j8.call(r)}p(mo,"toStr");function eI(r){if(r.name)return r.name;var t=U8.call(H8.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}p(eI,"nameOf");function d4(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(d4,"indexOf");function tI(r){if(!Xu||!r||typeof r!="object")return!1;try{Xu.call(r);try{Yu.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}p(tI,"isMap");function rI(r){if(!Nl||!r||typeof r!="object")return!1;try{Nl.call(r,Nl);try{Gl.call(r,Gl)}catch{return!0}return r instanceof WeakMap}catch{}return!1}p(rI,"isWeakMap");function iI(r){if(!Q3||!r||typeof r!="object")return!1;try{return Q3.call(r),!0}catch{}return!1}p(iI,"isWeakRef");function oI(r){if(!Yu||!r||typeof r!="object")return!1;try{Yu.call(r);try{Xu.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}p(oI,"isSet");function nI(r){if(!Gl||!r||typeof r!="object")return!1;try{Gl.call(r,Gl);try{Nl.call(r,Nl)}catch{return!0}return r instanceof WeakSet}catch{}return!1}p(nI,"isWeakSet");function aI(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}p(aI,"isElement");function h4(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return h4($m.call(r,0,t.maxStringLength),t)+i}var o=fo.call(fo.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,sI);return p4(o,"single",t)}p(h4,"inspectString");function sI(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":"")+W8.call(t.toString(16))}p(sI,"lowbyte");function Rl(r){return"Object("+r+")"}p(Rl,"markBoxed");function Hm(r){return r+" { ? }"}p(Hm,"weakCollectionOf");function s4(r,t,e,i){var o=i?Zm(e,i):kr.call(e,", ");return r+" ("+t+") {"+o+"}"}p(s4,"collectionOf");function lI(r){for(var t=0;t<r.length;t++)if(d4(r[t],"\n")>=0)return!1;return!0}p(lI,"singleLineValues");function cI(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=kr.call(Array(r.indent+1)," ");else return null;return{base:e,prev:kr.call(Array(t+1),e)}}p(cI,"getIndent");function Zm(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+kr.call(r,","+e)+"\n"+t.prev}p(Zm,"indentedJoin");function Wu(r,t){var e=Ym(r),i=[];if(e){i.length=r.length;for(var o=0;o<r.length;o++)i[o]=ho(r,o)?t(r[o],r):""}var n=typeof jm=="function"?jm(r):[],s;if(qa){s={};for(var c=0;c<n.length;c++)s["$"+n[c]]=n[c]}for(var l in r)ho(r,l)&&(e&&String(Number(l))===l&&l<r.length||qa&&s["$"+l]instanceof Symbol||(l4.call(/[^\w$]/,l)?i.push(t(l,r)+": "+t(r[l],r)):i.push(l+": "+t(r[l],r))));if(typeof jm=="function")for(var u=0;u<n.length;u++)c4.call(r,n[u])&&i.push("["+t(n[u])+"]: "+t(r[n[u]],r));return i}p(Wu,"arrObjKeys")});var Qm=H((XB,g4)=>{"use strict";y();var y4=pr(),$a=Rt(),pI=m4(),uI=mi(),Zu=y4("%WeakMap%",!0),zu=y4("%Map%",!0),dI=$a("WeakMap.prototype.get",!0),hI=$a("WeakMap.prototype.set",!0),fI=$a("WeakMap.prototype.has",!0),mI=$a("Map.prototype.get",!0),yI=$a("Map.prototype.set",!0),gI=$a("Map.prototype.has",!0),Jm=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"),vI=p(function(r,t){var e=Jm(r,t);return e&&e.value},"listGet"),bI=p(function(r,t,e){var i=Jm(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},"listSet"),CI=p(function(r,t){return!!Jm(r,t)},"listHas");g4.exports=p(function(){var t,e,i,o={assert:function(n){if(!o.has(n))throw new uI("Side channel does not contain "+pI(n))},get:function(n){if(Zu&&n&&(typeof n=="object"||typeof n=="function")){if(t)return dI(t,n)}else if(zu){if(e)return mI(e,n)}else if(i)return vI(i,n)},has:function(n){if(Zu&&n&&(typeof n=="object"||typeof n=="function")){if(t)return fI(t,n)}else if(zu){if(e)return gI(e,n)}else if(i)return CI(i,n);return!1},set:function(n,s){Zu&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new Zu),hI(t,n,s)):zu?(e||(e=new zu),yI(e,n,s)):(i||(i={key:{},next:null}),bI(i,n,s))}};return o},"getSideChannel")});var b4=H((zB,v4)=>{"use strict";y();var SI=wm(),Vl=Qm()(),yi=mi(),Km={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new yi("`O` is not an object");if(typeof t!="string")throw new yi("`slot` must be a string");if(Vl.assert(r),!Km.has(r,t))throw new yi("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new yi("`O` is not an object");if(typeof t!="string")throw new yi("`slot` must be a string");var e=Vl.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new yi("`O` is not an object");if(typeof t!="string")throw new yi("`slot` must be a string");var e=Vl.get(r);return!!e&&SI(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new yi("`O` is not an object");if(typeof t!="string")throw new yi("`slot` must be a string");var i=Vl.get(r);i||(i={},Vl.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(Km);v4.exports=Km});var x4=H(($B,S4)=>{"use strict";y();var jl=b4(),xI=SyntaxError,C4=typeof StopIteration=="object"?StopIteration:null;S4.exports=p(function(t){if(!C4)throw new xI("this environment lacks StopIteration");jl.set(t,"[[Done]]",!1);var e={next:p(function(){var o=jl.get(this,"[[Iterator]]"),n=jl.get(o,"[[Done]]");try{return{done:n,value:n?void 0:o.next()}}catch(s){if(jl.set(o,"[[Done]]",!0),s!==C4)throw s;return{done:!0,value:void 0}}},"next")};return jl.set(e,"[[Iterator]]",t),e},"getStopIterationIterator")});var ey=H((KB,I4)=>{y();var II={}.toString;I4.exports=Array.isArray||function(r){return II.call(r)=="[object Array]"}});var ty=H((tk,P4)=>{"use strict";y();var PI=String.prototype.valueOf,MI=p(function(t){try{return PI.call(t),!0}catch{return!1}},"tryStringObject"),TI=Object.prototype.toString,wI="[object String]",DI=uo()();P4.exports=p(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:DI?MI(t):TI.call(t)===wI},"isString")});var iy=H((ok,w4)=>{"use strict";y();var ry=typeof Map=="function"&&Map.prototype?Map:null,EI=typeof Set=="function"&&Set.prototype?Set:null,qu;ry||(qu=p(function(t){return!1},"isMap"));var T4=ry?Map.prototype.has:null,M4=EI?Set.prototype.has:null;!qu&&!T4&&(qu=p(function(t){return!1},"isMap"));w4.exports=qu||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 ry}catch{}return!1},"isMap")});var ny=H((sk,O4)=>{"use strict";y();var OI=typeof Map=="function"&&Map.prototype?Map:null,oy=typeof Set=="function"&&Set.prototype?Set:null,$u;oy||($u=p(function(t){return!1},"isSet"));var D4=OI?Map.prototype.has:null,E4=oy?Set.prototype.has:null;!$u&&!E4&&($u=p(function(t){return!1},"isSet"));O4.exports=$u||p(function(t){if(!t||typeof t!="object")return!1;try{if(E4.call(t),D4)try{D4.call(t)}catch{return!0}return t instanceof oy}catch{}return!1},"isSet")});var H4=H((pk,Ku)=>{"use strict";y();var L4=Nm(),A4=x4();Lu()()||Fl()()?(Ju=Symbol.iterator,Ku.exports=p(function(t){if(t!=null&&typeof t[Ju]<"u")return t[Ju]();if(L4(t))return Array.prototype[Ju].call(t)},"getIterator")):(F4=ey(),B4=ty(),ay=pr(),k4=ay("%Map%",!0),_4=ay("%Set%",!0),$t=Rt(),sy=$t("Array.prototype.push"),ly=$t("String.prototype.charCodeAt"),R4=$t("String.prototype.slice"),N4=p(function(t,e){var i=t.length;if(e+1>=i)return e+1;var o=ly(t,e);if(o<55296||o>56319)return e+1;var n=ly(t,e+1);return n<56320||n>57343?e+1:e+2},"advanceStringIndex"),Qu=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"),cy=p(function(t,e){if(F4(t)||L4(t))return Qu(t);if(B4(t)){var i=0;return{next:p(function(){var n=N4(t,i),s=R4(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"),!k4&&!_4?Ku.exports=p(function(t){if(t!=null)return cy(t,!0)},"getIterator"):(G4=iy(),V4=ny(),py=$t("Map.prototype.forEach",!0),uy=$t("Set.prototype.forEach",!0),(typeof P>"u"||!P.versions||!P.versions.node)&&(dy=$t("Map.prototype.iterator",!0),hy=$t("Set.prototype.iterator",!0)),fy=$t("Map.prototype.@@iterator",!0)||$t("Map.prototype._es6-shim iterator_",!0),my=$t("Set.prototype.@@iterator",!0)||$t("Set.prototype._es6-shim iterator_",!0),j4=p(function(t){if(G4(t)){if(dy)return A4(dy(t));if(fy)return fy(t);if(py){var e=[];return py(t,function(o,n){sy(e,[n,o])}),Qu(e)}}if(V4(t)){if(hy)return A4(hy(t));if(my)return my(t);if(uy){var i=[];return uy(t,function(o){sy(i,o)}),Qu(i)}}},"getCollectionIterator"),Ku.exports=p(function(t){return j4(t)||cy(t)},"getIterator")));var Ju,F4,B4,ay,k4,_4,$t,sy,ly,R4,N4,Qu,cy,G4,V4,py,uy,dy,hy,fy,my,j4});var yy=H((hk,W4)=>{"use strict";y();var U4=p(function(r){return r!==r},"numberIsNaN");W4.exports=p(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||U4(t)&&U4(e))},"is")});var gy=H((yk,X4)=>{"use strict";y();var LI=yy();X4.exports=p(function(){return typeof Object.is=="function"?Object.is:LI},"getPolyfill")});var Z4=H((bk,Y4)=>{"use strict";y();var AI=gy(),FI=po();Y4.exports=p(function(){var t=AI();return FI(Object,{is:t},{is:p(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var J4=H((xk,$4)=>{"use strict";y();var BI=po(),kI=Cn(),_I=yy(),z4=gy(),RI=Z4(),q4=kI(z4(),Object);BI(q4,{getPolyfill:z4,implementation:_I,shim:RI});$4.exports=q4});var by=H((Pk,tC)=>{"use strict";y();var NI=Cn(),eC=Rt(),GI=pr(),vy=GI("%ArrayBuffer%",!0),ed=eC("ArrayBuffer.prototype.byteLength",!0),VI=eC("Object.prototype.toString"),Q4=!!vy&&!ed&&new vy(0).slice,K4=!!Q4&&NI(Q4);tC.exports=p(ed||K4?function(t){if(!t||typeof t!="object")return!1;try{return ed?ed(t):K4(t,0),!0}catch{return!1}}:vy?function(t){return VI(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var iC=H((wk,rC)=>{"use strict";y();var jI=Date.prototype.getDay,HI=p(function(t){try{return jI.call(t),!0}catch{return!1}},"tryDateGetDayCall"),UI=Object.prototype.toString,WI="[object Date]",XI=uo()();rC.exports=p(function(t){return typeof t!="object"||t===null?!1:XI?HI(t):UI.call(t)===WI},"isDateObject")});var lC=H((Ok,sC)=>{"use strict";y();var Cy=Rt(),oC=uo()(),nC,aC,Sy,xy;oC&&(nC=Cy("Object.prototype.hasOwnProperty"),aC=Cy("RegExp.prototype.exec"),Sy={},td=p(function(){throw Sy},"throwRegexMarker"),xy={toString:td,valueOf:td},typeof Symbol.toPrimitive=="symbol"&&(xy[Symbol.toPrimitive]=td));var td,YI=Cy("Object.prototype.toString"),ZI=Object.getOwnPropertyDescriptor,zI="[object RegExp]";sC.exports=p(oC?function(t){if(!t||typeof t!="object")return!1;var e=ZI(t,"lastIndex"),i=e&&nC(e,"value");if(!i)return!1;try{aC(t,xy)}catch(o){return o===Sy}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:YI(t)===zI},"isRegex")});var uC=H((Fk,pC)=>{"use strict";y();var qI=Rt(),cC=qI("SharedArrayBuffer.prototype.byteLength",!0);pC.exports=p(cC?function(t){if(!t||typeof t!="object")return!1;try{return cC(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var hC=H((_k,dC)=>{"use strict";y();var $I=Number.prototype.toString,JI=p(function(t){try{return $I.call(t),!0}catch{return!1}},"tryNumberObject"),QI=Object.prototype.toString,KI="[object Number]",eP=uo()();dC.exports=p(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:eP?JI(t):QI.call(t)===KI},"isNumberObject")});var yC=H((Gk,mC)=>{"use strict";y();var fC=Rt(),tP=fC("Boolean.prototype.toString"),rP=fC("Object.prototype.toString"),iP=p(function(t){try{return tP(t),!0}catch{return!1}},"booleanBrandCheck"),oP="[object Boolean]",nP=uo()();mC.exports=p(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:nP&&Symbol.toStringTag in t?iP(t):rP(t)===oP},"isBoolean")});var CC=H((Hk,Iy)=>{"use strict";y();var aP=Object.prototype.toString,sP=Lu()();sP?(gC=Symbol.prototype.toString,vC=/^Symbol\(.*\)$/,bC=p(function(t){return typeof t.valueOf()!="symbol"?!1:vC.test(gC.call(t))},"isRealSymbolObject"),Iy.exports=p(function(t){if(typeof t=="symbol")return!0;if(aP.call(t)!=="[object Symbol]")return!1;try{return bC(t)}catch{return!1}},"isSymbol")):Iy.exports=p(function(t){return!1},"isSymbol");var gC,vC,bC});var IC=H((Xk,xC)=>{"use strict";y();var SC=typeof BigInt<"u"&&BigInt;xC.exports=p(function(){return typeof SC=="function"&&typeof BigInt=="function"&&typeof SC(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var TC=H((zk,Py)=>{"use strict";y();var lP=IC()();lP?(PC=BigInt.prototype.valueOf,MC=p(function(t){try{return PC.call(t),!0}catch{}return!1},"tryBigIntObject"),Py.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:MC(t)},"isBigInt")):Py.exports=p(function(t){return!1},"isBigInt");var PC,MC});var DC=H((Jk,wC)=>{"use strict";y();var cP=ty(),pP=hC(),uP=yC(),dP=CC(),hP=TC();wC.exports=p(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(cP(t))return"String";if(pP(t))return"Number";if(uP(t))return"Boolean";if(dP(t))return"Symbol";if(hP(t))return"BigInt"},"whichBoxedPrimitive")});var LC=H((e_,OC)=>{"use strict";y();var rd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,EC=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,id;rd||(id=p(function(t){return!1},"isWeakMap"));var Ty=rd?rd.prototype.has:null,My=EC?EC.prototype.has:null;!id&&!Ty&&(id=p(function(t){return!1},"isWeakMap"));OC.exports=id||p(function(t){if(!t||typeof t!="object")return!1;try{if(Ty.call(t,Ty),My)try{My.call(t,My)}catch{return!0}return t instanceof rd}catch{}return!1},"isWeakMap")});var FC=H((i_,Dy)=>{"use strict";y();var fP=pr(),AC=Rt(),mP=fP("%WeakSet%",!0),wy=AC("WeakSet.prototype.has",!0);wy?(od=AC("WeakMap.prototype.has",!0),Dy.exports=p(function(t){if(!t||typeof t!="object")return!1;try{if(wy(t,wy),od)try{od(t,od)}catch{return!0}return t instanceof mP}catch{}return!1},"isWeakSet")):Dy.exports=p(function(t){return!1},"isWeakSet");var od});var kC=H((a_,BC)=>{"use strict";y();var yP=iy(),gP=ny(),vP=LC(),bP=FC();BC.exports=p(function(t){if(t&&typeof t=="object"){if(yP(t))return"Map";if(gP(t))return"Set";if(vP(t))return"WeakMap";if(bP(t))return"WeakSet"}return!1},"whichCollection")});var GC=H((c_,NC)=>{"use strict";y();var RC=Function.prototype.toString,Ja=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Oy,nd;if(typeof Ja=="function"&&typeof Object.defineProperty=="function")try{Oy=Object.defineProperty({},"length",{get:function(){throw nd}}),nd={},Ja(function(){throw 42},null,Oy)}catch(r){r!==nd&&(Ja=null)}else Ja=null;var CP=/^\s*class\b/,Ly=p(function(t){try{var e=RC.call(t);return CP.test(e)}catch{return!1}},"isES6ClassFunction"),Ey=p(function(t){try{return Ly(t)?!1:(RC.call(t),!0)}catch{return!1}},"tryFunctionToStr"),ad=Object.prototype.toString,SP="[object Object]",xP="[object Function]",IP="[object GeneratorFunction]",PP="[object HTMLAllCollection]",MP="[object HTML document.all class]",TP="[object HTMLCollection]",wP=typeof Symbol=="function"&&!!Symbol.toStringTag,DP=!(0 in[,]),Ay=p(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(_C=document.all,ad.call(_C)===ad.call(document.all)&&(Ay=p(function(t){if((DP||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=ad.call(t);return(e===PP||e===MP||e===TP||e===SP)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var _C;NC.exports=p(Ja?function(t){if(Ay(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Ja(t,null,Oy)}catch(e){if(e!==nd)return!1}return!Ly(t)&&Ey(t)}:function(t){if(Ay(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(wP)return Ey(t);if(Ly(t))return!1;var e=ad.call(t);return e!==xP&&e!==IP&&!/^\[object HTML/.test(e)?!1:Ey(t)},"isCallable")});var HC=H((d_,jC)=>{"use strict";y();var EP=GC(),OP=Object.prototype.toString,VC=Object.prototype.hasOwnProperty,LP=p(function(t,e,i){for(var o=0,n=t.length;o<n;o++)VC.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},"forEachArray"),AP=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"),FP=p(function(t,e,i){for(var o in t)VC.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},"forEachObject"),BP=p(function(t,e,i){if(!EP(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=i),OP.call(t)==="[object Array]"?LP(t,e,o):typeof t=="string"?AP(t,e,o):FP(t,e,o)},"forEach");jC.exports=BP});var WC=H((m_,UC)=>{"use strict";y();UC.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var YC=H((g_,XC)=>{"use strict";y();var Fy=WC(),kP=typeof globalThis>"u"?global:globalThis;XC.exports=p(function(){for(var t=[],e=0;e<Fy.length;e++)typeof kP[Fy[e]]=="function"&&(t[t.length]=Fy[e]);return t},"availableTypedArrays")});var JC=H((C_,$C)=>{"use strict";y();var ld=HC(),_P=YC(),ZC=Cn(),_y=Rt(),sd=Nu(),RP=_y("Object.prototype.toString"),qC=uo()(),zC=typeof globalThis>"u"?global:globalThis,ky=_P(),Ry=_y("String.prototype.slice"),By=Object.getPrototypeOf,NP=_y("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"),cd={__proto__:null};qC&&sd&&By?ld(ky,function(r){var t=new zC[r];if(Symbol.toStringTag in t){var e=By(t),i=sd(e,Symbol.toStringTag);if(!i){var o=By(e);i=sd(o,Symbol.toStringTag)}cd["$"+r]=ZC(i.get)}}):ld(ky,function(r){var t=new zC[r],e=t.slice||t.set;e&&(cd["$"+r]=ZC(e))});var GP=p(function(t){var e=!1;return ld(cd,function(i,o){if(!e)try{"$"+i(t)===o&&(e=Ry(o,1))}catch{}}),e},"tryAllTypedArrays"),VP=p(function(t){var e=!1;return ld(cd,function(i,o){if(!e)try{i(t),e=Ry(o,1)}catch{}}),e},"tryAllSlices");$C.exports=p(function(t){if(!t||typeof t!="object")return!1;if(!qC){var e=Ry(RP(t),8,-1);return NP(ky,e)>-1?e:e!=="Object"?!1:VP(t)}return sd?GP(t):null},"whichTypedArray")});var e5=H((I_,KC)=>{"use strict";y();var jP=Rt(),QC=jP("ArrayBuffer.prototype.byteLength",!0),HP=by();KC.exports=p(function(t){return HP(t)?QC?QC(t):t.byteLength:NaN},"byteLength")});var M5=H((T_,P5)=>{"use strict";y();var S5=L3(),_r=Rt(),t5=X3(),UP=pr(),Qa=H4(),WP=Qm(),r5=J4(),i5=Nm(),o5=ey(),n5=by(),a5=iC(),s5=lC(),l5=uC(),c5=Ou(),p5=DC(),u5=kC(),d5=JC(),h5=e5(),f5=_r("SharedArrayBuffer.prototype.byteLength",!0),m5=_r("Date.prototype.getTime"),Ny=Object.getPrototypeOf,y5=_r("Object.prototype.toString"),ud=UP("%Set%",!0),Gy=_r("Map.prototype.has",!0),dd=_r("Map.prototype.get",!0),g5=_r("Map.prototype.size",!0),hd=_r("Set.prototype.add",!0),x5=_r("Set.prototype.delete",!0),fd=_r("Set.prototype.has",!0),pd=_r("Set.prototype.size",!0);function v5(r,t,e,i){for(var o=Qa(r),n;(n=o.next())&&!n.done;)if(ur(t,n.value,e,i))return x5(r,n.value),!0;return!1}p(v5,"setHasEqualElement");function I5(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(I5,"findLooseMatchingPrimitives");function XP(r,t,e,i,o,n){var s=I5(e);if(s!=null)return s;var c=dd(t,s),l=S5({},o,{strict:!1});return typeof c>"u"&&!Gy(t,s)||!ur(i,c,l,n)?!1:!Gy(r,s)&&ur(i,c,l,n)}p(XP,"mapMightHaveLoosePrim");function YP(r,t,e){var i=I5(e);return i!=null?i:fd(t,i)&&!fd(r,i)}p(YP,"setMightHaveLoosePrim");function b5(r,t,e,i,o,n){for(var s=Qa(r),c,l;(c=s.next())&&!c.done;)if(l=c.value,ur(e,l,o,n)&&ur(i,dd(t,l),o,n))return x5(r,l),!0;return!1}p(b5,"mapHasEqualEntry");function ur(r,t,e,i){var o=e||{};if(o.strict?r5(r,t):r===t)return!0;var n=p5(r),s=p5(t);if(n!==s)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return o.strict?r5(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),qP(r,t,o,i)}p(ur,"internalDeepEqual");function C5(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(C5,"isBuffer");function ZP(r,t,e,i){if(pd(r)!==pd(t))return!1;for(var o=Qa(r),n=Qa(t),s,c,l;(s=o.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new ud),hd(l,s.value);else if(!fd(t,s.value)){if(e.strict||!YP(r,t,s.value))return!1;l||(l=new ud),hd(l,s.value)}if(l){for(;(c=n.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!v5(l,c.value,e.strict,i))return!1}else if(!e.strict&&!fd(r,c.value)&&!v5(l,c.value,e.strict,i))return!1;return pd(l)===0}return!0}p(ZP,"setEquiv");function zP(r,t,e,i){if(g5(r)!==g5(t))return!1;for(var o=Qa(r),n=Qa(t),s,c,l,u,h,m;(s=o.next())&&!s.done;)if(u=s.value[0],h=s.value[1],u&&typeof u=="object")l||(l=new ud),hd(l,u);else if(m=dd(t,u),typeof m>"u"&&!Gy(t,u)||!ur(h,m,e,i)){if(e.strict||!XP(r,t,u,h,e,i))return!1;l||(l=new ud),hd(l,u)}if(l){for(;(c=n.next())&&!c.done;)if(u=c.value[0],m=c.value[1],u&&typeof u=="object"){if(!b5(l,r,u,m,e,i))return!1}else if(!e.strict&&(!r.has(u)||!ur(dd(r,u),m,e,i))&&!b5(l,r,u,m,S5({},e,{strict:!1}),i))return!1;return pd(l)===0}return!0}p(zP,"mapEquiv");function qP(r,t,e,i){var o,n;if(typeof r!=typeof t||r==null||t==null||y5(r)!==y5(t)||i5(r)!==i5(t))return!1;var s=o5(r),c=o5(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=s5(r),m=s5(t);if(h!==m||(h||m)&&(r.source!==t.source||t5(r)!==t5(t)))return!1;var g=a5(r),v=a5(t);if(g!==v||(g||v)&&m5(r)!==m5(t)||e.strict&&Ny&&Ny(r)!==Ny(t))return!1;var I=d5(r),S=d5(t);if(I!==S)return!1;if(I||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 b=C5(r),C=C5(t);if(b!==C)return!1;if(b||C){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var w=n5(r),M=n5(t);if(w!==M)return!1;if(w||M)return h5(r)!==h5(t)?!1:typeof Uint8Array=="function"&&ur(new Uint8Array(r),new Uint8Array(t),e,i);var D=l5(r),E=l5(t);if(D!==E)return!1;if(D||E)return f5(r)!==f5(t)?!1:typeof Uint8Array=="function"&&ur(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var F=c5(r),B=c5(t);if(F.length!==B.length)return!1;for(F.sort(),B.sort(),o=F.length-1;o>=0;o--)if(F[o]!=B[o])return!1;for(o=F.length-1;o>=0;o--)if(n=F[o],!ur(r[n],t[n],e,i))return!1;var G=u5(r),N=u5(t);return G!==N?!1:G==="Set"||N==="Set"?ZP(r,t,e,i):G==="Map"?zP(r,t,e,i):!0}p(qP,"objEquiv");P5.exports=p(function(t,e,i){return ur(t,e,i,WP())},"deepEqual")});var j5=H(ce=>{"use strict";y();Object.defineProperty(ce,"__esModule",{value:!0});function $P(r){return r&&r.__esModule?r:{default:r}}p($P,"_interopRequireDefault");var JP=Object.defineProperty,de=p((r,t)=>JP(r,"name",{value:t,configurable:!0}),"__name"),QP=M5(),KP=$P(QP),Wl,T5=(Wl=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||!Hl(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=Vy(t),o=Vy(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(!Hl(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 Hl(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?KP.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Hl(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(Wl,"_GeojsonEquality"),Wl);de(T5,"GeojsonEquality");var eM=T5;function Hl(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}p(Hl,"sameLength");de(Hl,"sameLength");function Vy(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}p(Vy,"explode");de(Vy,"explode");var Ot=63710088e-1,Hy={centimeters:Ot*100,centimetres:Ot*100,degrees:360/(2*Math.PI),feet:Ot*3.28084,inches:Ot*39.37,kilometers:Ot/1e3,kilometres:Ot/1e3,meters:Ot,metres:Ot,miles:Ot/1609.344,millimeters:Ot*1e3,millimetres:Ot*1e3,nauticalmiles:Ot/1852,radians:1,yards:Ot*1.0936},jy={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 gi(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(gi,"feature");de(gi,"feature");function w5(r,t,e={}){switch(r){case"Point":return md(t).geometry;case"LineString":return gd(t).geometry;case"Polygon":return yd(t).geometry;case"MultiPoint":return Wy(t).geometry;case"MultiLineString":return Uy(t).geometry;case"MultiPolygon":return Xy(t).geometry;default:throw new Error(r+" is invalid")}}p(w5,"geometry");de(w5,"geometry");function md(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(!Ul(r[0])||!Ul(r[1]))throw new Error("coordinates must contain numbers");return gi({type:"Point",coordinates:r},t,e)}p(md,"point");de(md,"point");function D5(r,t,e={}){return Xl(r.map(i=>md(i,t)),e)}p(D5,"points");de(D5,"points");function yd(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 gi({type:"Polygon",coordinates:r},t,e)}p(yd,"polygon");de(yd,"polygon");function E5(r,t,e={}){return Xl(r.map(i=>yd(i,t)),e)}p(E5,"polygons");de(E5,"polygons");function gd(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return gi({type:"LineString",coordinates:r},t,e)}p(gd,"lineString");de(gd,"lineString");function O5(r,t,e={}){return Xl(r.map(i=>gd(i,t)),e)}p(O5,"lineStrings");de(O5,"lineStrings");function Xl(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}p(Xl,"featureCollection");de(Xl,"featureCollection");function Uy(r,t,e={}){return gi({type:"MultiLineString",coordinates:r},t,e)}p(Uy,"multiLineString");de(Uy,"multiLineString");function Wy(r,t,e={}){return gi({type:"MultiPoint",coordinates:r},t,e)}p(Wy,"multiPoint");de(Wy,"multiPoint");function Xy(r,t,e={}){return gi({type:"MultiPolygon",coordinates:r},t,e)}p(Xy,"multiPolygon");de(Xy,"multiPolygon");function L5(r,t,e={}){return gi({type:"GeometryCollection",geometries:r},t,e)}p(L5,"geometryCollection");de(L5,"geometryCollection");function A5(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(A5,"round");de(A5,"round");function Yy(r,t="kilometers"){let e=Hy[t];if(!e)throw new Error(t+" units is invalid");return r*e}p(Yy,"radiansToLength");de(Yy,"radiansToLength");function vd(r,t="kilometers"){let e=Hy[t];if(!e)throw new Error(t+" units is invalid");return r/e}p(vd,"lengthToRadians");de(vd,"lengthToRadians");function F5(r,t){return Zy(vd(r,t))}p(F5,"lengthToDegrees");de(F5,"lengthToDegrees");function B5(r){let t=r%360;return t<0&&(t+=360),t}p(B5,"bearingToAzimuth");de(B5,"bearingToAzimuth");function Zy(r){return r%(2*Math.PI)*180/Math.PI}p(Zy,"radiansToDegrees");de(Zy,"radiansToDegrees");function k5(r){return r%360*Math.PI/180}p(k5,"degreesToRadians");de(k5,"degreesToRadians");function _5(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Yy(vd(r,t),e)}p(_5,"convertLength");de(_5,"convertLength");function R5(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=jy[t];if(!i)throw new Error("invalid original units");let o=jy[e];if(!o)throw new Error("invalid final units");return r/i*o}p(R5,"convertArea");de(R5,"convertArea");function Ul(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}p(Ul,"isNumber");de(Ul,"isNumber");function N5(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}p(N5,"isObject");de(N5,"isObject");function G5(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(!Ul(t))throw new Error("bbox must only contain numbers")})}p(G5,"validateBBox");de(G5,"validateBBox");function V5(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(V5,"validateId");de(V5,"validateId");ce.GeojsonEquality=eM;ce.areaFactors=jy;ce.bearingToAzimuth=B5;ce.convertArea=R5;ce.convertLength=_5;ce.degreesToRadians=k5;ce.earthRadius=Ot;ce.factors=Hy;ce.feature=gi;ce.featureCollection=Xl;ce.geometry=w5;ce.geometryCollection=L5;ce.isNumber=Ul;ce.isObject=N5;ce.lengthToDegrees=F5;ce.lengthToRadians=vd;ce.lineString=gd;ce.lineStrings=O5;ce.multiLineString=Uy;ce.multiPoint=Wy;ce.multiPolygon=Xy;ce.point=md;ce.points=D5;ce.polygon=yd;ce.polygons=E5;ce.radiansToDegrees=Zy;ce.radiansToLength=Yy;ce.round=A5;ce.validateBBox=G5;ce.validateId=V5});var Q5=H(je=>{"use strict";y();Object.defineProperty(je,"__esModule",{value:!0});var tM=Object.defineProperty,et=p((r,t)=>tM(r,"name",{value:t,configurable:!0}),"__name"),at=j5();function Ka(r,t,e){if(r!==null)for(var i,o,n,s,c,l,u,h=0,m=0,g,v=r.type,I=v==="FeatureCollection",S=v==="Feature",b=I?r.features.length:1,C=0;C<b;C++){u=I?r.features[C].geometry:S?r.geometry:r,g=u?u.type==="GeometryCollection":!1,c=g?u.geometries.length:1;for(var w=0;w<c;w++){var M=0,D=0;if(s=g?u.geometries[w]: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,m,C,M,D)===!1)return!1;m++,M++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],m,C,M,D)===!1)return!1;m++,E==="MultiPoint"&&M++}E==="LineString"&&M++;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],m,C,M,D)===!1)return!1;m++}E==="MultiLineString"&&M++,E==="Polygon"&&D++}E==="Polygon"&&M++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(D=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-h;n++){if(t(l[i][o][n],m,C,M,D)===!1)return!1;m++}D++}M++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(Ka(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}p(Ka,"coordEach");et(Ka,"coordEach");function H5(r,t,e,i){var o=e;return Ka(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(H5,"coordReduce");et(H5,"coordReduce");function zy(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(zy,"propEach");et(zy,"propEach");function U5(r,t,e){var i=e;return zy(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(U5,"propReduce");et(U5,"propReduce");function qy(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(qy,"featureEach");et(qy,"featureEach");function W5(r,t,e){var i=e;return qy(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}p(W5,"featureReduce");et(W5,"featureReduce");function X5(r){var t=[];return Ka(r,function(e){t.push(e)}),t}p(X5,"coordAll");et(X5,"coordAll");function bd(r,t){var e,i,o,n,s,c,l,u,h,m,g=0,v=r.type==="FeatureCollection",I=r.type==="Feature",S=v?r.features.length:1;for(e=0;e<S;e++){for(c=v?r.features[e].geometry:I?r.geometry:r,u=v?r.features[e].properties:I?r.properties:{},h=v?r.features[e].bbox:I?r.bbox:void 0,m=v?r.features[e].id:I?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,g,u,h,m)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,g,u,h,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],g,u,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}p(bd,"geomEach");et(bd,"geomEach");function Y5(r,t,e){var i=e;return bd(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}p(Y5,"geomReduce");et(Y5,"geomReduce");function Yl(r,t){bd(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(at.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],m={type:l,coordinates:h};if(t(at.feature.call(void 0,m,o),i,u)===!1)return!1}})}p(Yl,"flattenEach");et(Yl,"flattenEach");function Z5(r,t,e){var i=e;return Yl(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}p(Z5,"flattenReduce");et(Z5,"flattenReduce");function $y(r,t){Yl(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(Ka(e,function(m,g,v,I,S){if(c===void 0||i>l||I>u||S>h){c=m,l=i,u=I,h=S,n=0;return}var b=at.lineString.call(void 0,[c,m],e.properties);if(t(b,i,o,S,n)===!1)return!1;n++,c=m})===!1)return!1}}})}p($y,"segmentEach");et($y,"segmentEach");function z5(r,t,e){var i=e,o=!1;return $y(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(z5,"segmentReduce");et(z5,"segmentReduce");function Jy(r,t){if(!r)throw new Error("geojson is required");Yl(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(at.lineString.call(void 0,s[c],e.properties),i,o,c)===!1)return!1;break}}})}p(Jy,"lineEach");et(Jy,"lineEach");function q5(r,t,e){var i=e;return Jy(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}p(q5,"lineReduce");et(q5,"lineReduce");function $5(r,t){if(t=t||{},!at.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),at.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),at.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),at.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),at.lineString.call(void 0,[l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}p($5,"findSegment");et($5,"findSegment");function J5(r,t){if(t=t||{},!at.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 at.point.call(void 0,l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),at.point.call(void 0,l[i],s,t);case"LineString":return n<0&&(n=l.length+n),at.point.call(void 0,l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),at.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),at.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),at.point.call(void 0,l[i][o][n],s,t)}throw new Error("geojson is invalid")}p(J5,"findPoint");et(J5,"findPoint");je.coordAll=X5;je.coordEach=Ka;je.coordReduce=H5;je.featureEach=qy;je.featureReduce=W5;je.findPoint=J5;je.findSegment=$5;je.flattenEach=Yl;je.flattenReduce=Z5;je.geomEach=bd;je.geomReduce=Y5;je.lineEach=Jy;je.lineReduce=q5;je.propEach=zy;je.propReduce=U5;je.segmentEach=$y;je.segmentReduce=z5});var K5=H(Cd=>{"use strict";y();Object.defineProperty(Cd,"__esModule",{value:!0});var rM=Object.defineProperty,iM=p((r,t)=>rM(r,"name",{value:t,configurable:!0}),"__name"),oM=Q5();function Qy(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return oM.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(Qy,"bbox");iM(Qy,"bbox");var nM=Qy;Cd.bbox=Qy;Cd.default=nM});var o7=H((V_,Ky)=>{y();var Rr=Qv(),t7=Cm(),r7=lb(),es=K5().default,aM=r7.featureEach,N_=r7.coordEach,G_=t7.polygon,e7=t7.featureCollection;function i7(r){var t=new Rr(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:es(e),Rr.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:es(o),i.push(o)}):aM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:es(o),i.push(o)}),Rr.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:es(e),Rr.prototype.remove.call(this,e,i)},t.clear=function(){return Rr.prototype.clear.call(this)},t.search=function(e){var i=Rr.prototype.search.call(this,this.toBBox(e));return e7(i)},t.collides=function(e){return Rr.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Rr.prototype.all.call(this);return e7(e)},t.toJSON=function(){return Rr.prototype.toJSON.call(this)},t.fromJSON=function(e){return Rr.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=es(e);else if(e.type==="FeatureCollection")i=es(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}p(i7,"geojsonRbush");Ky.exports=i7;Ky.exports.default=i7});var W7=H((ZV,ac)=>{"use strict";y();var xM=!1,Tn=!1,R7=!0,N7=!1,f={},G7=!1;typeof ac<"u"&&ac.exports?(ac.exports=f,G7=!0):typeof document<"u"?window.ClipperLib=f:self.ClipperLib=f;var Hd;G7?(Ue="chrome",Hd="Netscape"):(Ue=navigator.userAgent.toString().toLowerCase(),Hd=navigator.appName);var Ue,ne={};Ue.indexOf("chrome")!=-1&&Ue.indexOf("chromium")==-1?ne.chrome=1:ne.chrome=0;Ue.indexOf("chromium")!=-1?ne.chromium=1:ne.chromium=0;Ue.indexOf("safari")!=-1&&Ue.indexOf("chrome")==-1&&Ue.indexOf("chromium")==-1?ne.safari=1:ne.safari=0;Ue.indexOf("firefox")!=-1?ne.firefox=1:ne.firefox=0;Ue.indexOf("firefox/17")!=-1?ne.firefox17=1:ne.firefox17=0;Ue.indexOf("firefox/15")!=-1?ne.firefox15=1:ne.firefox15=0;Ue.indexOf("firefox/3")!=-1?ne.firefox3=1:ne.firefox3=0;Ue.indexOf("opera")!=-1?ne.opera=1:ne.opera=0;Ue.indexOf("msie 10")!=-1?ne.msie10=1:ne.msie10=0;Ue.indexOf("msie 9")!=-1?ne.msie9=1:ne.msie9=0;Ue.indexOf("msie 8")!=-1?ne.msie8=1:ne.msie8=0;Ue.indexOf("msie 7")!=-1?ne.msie7=1:ne.msie7=0;Ue.indexOf("msie ")!=-1?ne.msie=1:ne.msie=0;f.biginteger_used=null;var vo,IM=0xdeadbeefcafe,k7=(IM&16777215)==15715070;function _(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(_,"BigInteger");function se(){return new _(null)}p(se,"nbi");function PM(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(PM,"am1");function MM(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(MM,"am2");function TM(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(TM,"am3");k7&&Hd=="Microsoft Internet Explorer"?(_.prototype.am=MM,vo=30):k7&&Hd!="Netscape"?(_.prototype.am=PM,vo=26):(_.prototype.am=TM,vo=28);_.prototype.DB=vo;_.prototype.DM=(1<<vo)-1;_.prototype.DV=1<<vo;var Ig=52;_.prototype.FV=Math.pow(2,Ig);_.prototype.F1=Ig-vo;_.prototype.F2=2*vo-Ig;var wM="0123456789abcdefghijklmnopqrstuvwxyz",Wd=new Array,os,Qt;os=48;for(Qt=0;Qt<=9;++Qt)Wd[os++]=Qt;os=97;for(Qt=10;Qt<36;++Qt)Wd[os++]=Qt;os=65;for(Qt=10;Qt<36;++Qt)Wd[os++]=Qt;function _7(r){return wM.charAt(r)}p(_7,"int2char");function V7(r,t){var e=Wd[r.charCodeAt(t)];return e==null?-1:e}p(V7,"intAt");function DM(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}p(DM,"bnpCopyTo");function EM(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(EM,"bnpFromInt");function go(r){var t=se();return t.fromInt(r),t}p(go,"nbv");function OM(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:V7(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&&(this.s=-1,n>0&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&_.ZERO.subTo(this,this)}p(OM,"bnpFromString");function LM(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}p(LM,"bnpClamp");function AM(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=_7(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+=_7(i));return o?n:"0"}p(AM,"bnToString");function FM(){var r=se();return _.ZERO.subTo(this,r),r}p(FM,"bnNegate");function BM(){return this.s<0?this.negate():this}p(BM,"bnAbs");function kM(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(kM,"bnCompareTo");function Xd(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(Xd,"nbits");function _M(){return this.t<=0?0:this.DB*(this.t-1)+Xd(this[this.t-1]^this.s&this.DM)}p(_M,"bnBitLength");function RM(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(RM,"bnpDLShiftTo");function NM(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(NM,"bnpDRShiftTo");function GM(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(GM,"bnpLShiftTo");function VM(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(VM,"bnpRShiftTo");function jM(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(jM,"bnpSubTo");function HM(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&&_.ZERO.subTo(t,t)}p(HM,"bnpMultiplyTo");function UM(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(UM,"bnpSquareTo");function WM(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=se());var n=se(),s=this.s,c=r.s,l=this.DB-Xd(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 m=h*(1<<this.F1)+(u>1?n[u-2]>>this.F2:0),g=this.FV/m,v=(1<<this.F1)/m,I=1<<this.F2,S=e.t,b=S-u,C=t==null?se():t;for(n.dlShiftTo(b,C),e.compareTo(C)>=0&&(e[e.t++]=1,e.subTo(C,e)),_.ONE.dlShiftTo(u,C),C.subTo(n,n);n.t<u;)n[n.t++]=0;for(;--b>=0;){var w=e[--S]==h?this.DM:Math.floor(e[S]*g+(e[S-1]+I)*v);if((e[S]+=n.am(0,w,e,b,0,u))<w)for(n.dlShiftTo(b,C),e.subTo(C,e);e[S]<--w;)e.subTo(C,e)}t!=null&&(e.drShiftTo(u,t),s!=c&&_.ZERO.subTo(t,t)),e.t=u,e.clamp(),l>0&&e.rShiftTo(l,e),s<0&&_.ZERO.subTo(e,e)}}}p(WM,"bnpDivRemTo");function XM(r){var t=se();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(_.ZERO)>0&&r.subTo(t,t),t}p(XM,"bnMod");function wn(r){this.m=r}p(wn,"Classic");function YM(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}p(YM,"cConvert");function ZM(r){return r}p(ZM,"cRevert");function zM(r){r.divRemTo(this.m,null,r)}p(zM,"cReduce");function qM(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(qM,"cMulTo");function $M(r,t){r.squareTo(t),this.reduce(t)}p($M,"cSqrTo");wn.prototype.convert=YM;wn.prototype.revert=ZM;wn.prototype.reduce=zM;wn.prototype.mulTo=qM;wn.prototype.sqrTo=$M;function JM(){if(this.t<1)return 0;var r=this[0];if(!(r&1))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(JM,"bnpInvDigit");function Dn(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(Dn,"Montgomery");function QM(r){var t=se();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t}p(QM,"montConvert");function KM(r){var t=se();return r.copyTo(t),this.reduce(t),t}p(KM,"montRevert");function eT(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(eT,"montReduce");function tT(r,t){r.squareTo(t),this.reduce(t)}p(tT,"montSqrTo");function rT(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(rT,"montMulTo");Dn.prototype.convert=QM;Dn.prototype.revert=KM;Dn.prototype.reduce=eT;Dn.prototype.mulTo=rT;Dn.prototype.sqrTo=tT;function iT(){return(this.t>0?this[0]&1:this.s)==0}p(iT,"bnpIsEven");function oT(r,t){if(r>4294967295||r<1)return _.ONE;var e=se(),i=se(),o=t.convert(this),n=Xd(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(oT,"bnpExp");function nT(r,t){var e;return r<256||t.isEven()?e=new wn(t):e=new Dn(t),this.exp(r,e)}p(nT,"bnModPowInt");_.prototype.copyTo=DM;_.prototype.fromInt=EM;_.prototype.fromString=OM;_.prototype.clamp=LM;_.prototype.dlShiftTo=RM;_.prototype.drShiftTo=NM;_.prototype.lShiftTo=GM;_.prototype.rShiftTo=VM;_.prototype.subTo=jM;_.prototype.multiplyTo=HM;_.prototype.squareTo=UM;_.prototype.divRemTo=WM;_.prototype.invDigit=JM;_.prototype.isEven=iT;_.prototype.exp=oT;_.prototype.toString=AM;_.prototype.negate=FM;_.prototype.abs=BM;_.prototype.compareTo=kM;_.prototype.bitLength=_M;_.prototype.mod=XM;_.prototype.modPowInt=nT;_.ZERO=go(0);_.ONE=go(1);function aT(){var r=se();return this.copyTo(r),r}p(aT,"bnClone");function sT(){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(sT,"bnIntValue");function lT(){return this.t==0?this.s:this[0]<<24>>24}p(lT,"bnByteValue");function cT(){return this.t==0?this.s:this[0]<<16>>16}p(cT,"bnShortValue");function pT(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}p(pT,"bnpChunkSize");function uT(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}p(uT,"bnSigNum");function dT(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=go(e),o=se(),n=se(),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(dT,"bnpToRadix");function hT(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=V7(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&&_.ZERO.subTo(this,this)}p(hT,"bnpFromRadix");function fT(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(_.ONE.shiftLeft(r-1),Pg,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(_.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(fT,"bnpFromNumber");function mT(){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&&(i|=-256),o==0&&(this.s&128)!=(i&128)&&++o,(o>0||i!=this.s)&&(t[o++]=i);return t}p(mT,"bnToByteArray");function yT(r){return this.compareTo(r)==0}p(yT,"bnEquals");function gT(r){return this.compareTo(r)<0?this:r}p(gT,"bnMin");function vT(r){return this.compareTo(r)>0?this:r}p(vT,"bnMax");function bT(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(bT,"bnpBitwiseTo");function CT(r,t){return r&t}p(CT,"op_and");function ST(r){var t=se();return this.bitwiseTo(r,CT,t),t}p(ST,"bnAnd");function Pg(r,t){return r|t}p(Pg,"op_or");function xT(r){var t=se();return this.bitwiseTo(r,Pg,t),t}p(xT,"bnOr");function j7(r,t){return r^t}p(j7,"op_xor");function IT(r){var t=se();return this.bitwiseTo(r,j7,t),t}p(IT,"bnXor");function H7(r,t){return r&~t}p(H7,"op_andnot");function PT(r){var t=se();return this.bitwiseTo(r,H7,t),t}p(PT,"bnAndNot");function MT(){for(var r=se(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}p(MT,"bnNot");function TT(r){var t=se();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}p(TT,"bnShiftLeft");function wT(r){var t=se();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}p(wT,"bnShiftRight");function DT(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}p(DT,"lbit");function ET(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+DT(this[r]);return this.s<0?this.t*this.DB:-1}p(ET,"bnGetLowestSetBit");function OT(r){for(var t=0;r!=0;)r&=r-1,++t;return t}p(OT,"cbit");function LT(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=OT(this[e]^t);return r}p(LT,"bnBitCount");function AT(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}p(AT,"bnTestBit");function FT(r,t){var e=_.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}p(FT,"bnpChangeBit");function BT(r){return this.changeBit(r,Pg)}p(BT,"bnSetBit");function kT(r){return this.changeBit(r,H7)}p(kT,"bnClearBit");function _T(r){return this.changeBit(r,j7)}p(_T,"bnFlipBit");function RT(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(RT,"bnpAddTo");function NT(r){var t=se();return this.addTo(r,t),t}p(NT,"bnAdd");function GT(r){var t=se();return this.subTo(r,t),t}p(GT,"bnSubtract");function VT(r){var t=se();return this.multiplyTo(r,t),t}p(VT,"bnMultiply");function jT(){var r=se();return this.squareTo(r),r}p(jT,"bnSquare");function HT(r){var t=se();return this.divRemTo(r,t,null),t}p(HT,"bnDivide");function UT(r){var t=se();return this.divRemTo(r,null,t),t}p(UT,"bnRemainder");function WT(r){var t=se(),e=se();return this.divRemTo(r,t,e),new Array(t,e)}p(WT,"bnDivideAndRemainder");function XT(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}p(XT,"bnpDMultiply");function YT(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(YT,"bnpDAddOffset");function sc(){}p(sc,"NullExp");function U7(r){return r}p(U7,"nNop");function ZT(r,t,e){r.multiplyTo(t,e)}p(ZT,"nMulTo");function zT(r,t){r.squareTo(t)}p(zT,"nSqrTo");sc.prototype.convert=U7;sc.prototype.revert=U7;sc.prototype.mulTo=ZT;sc.prototype.sqrTo=zT;function qT(r){return this.exp(r,new sc)}p(qT,"bnPow");function $T(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($T,"bnpMultiplyLowerTo");function JT(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(JT,"bnpMultiplyUpperTo");function ns(r){this.r2=se(),this.q3=se(),_.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}p(ns,"Barrett");function QT(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=se();return r.copyTo(t),this.reduce(t),t}p(QT,"barrettConvert");function KT(r){return r}p(KT,"barrettRevert");function ew(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(ew,"barrettReduce");function tw(r,t){r.squareTo(t),this.reduce(t)}p(tw,"barrettSqrTo");function rw(r,t,e){r.multiplyTo(t,e),this.reduce(e)}p(rw,"barrettMulTo");ns.prototype.convert=QT;ns.prototype.revert=KT;ns.prototype.reduce=ew;ns.prototype.mulTo=rw;ns.prototype.sqrTo=tw;function iw(r,t){var e=r.bitLength(),i,o=go(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 ns(t):n=new Dn(t);var s=new Array,c=3,l=i-1,u=(1<<i)-1;if(s[1]=n.convert(this),i>1){var h=se();for(n.sqrTo(s[1],h);c<=u;)s[c]=se(),n.mulTo(h,s[c-2],s[c]),c+=2}var m=r.t-1,g,v=!0,I=se(),S;for(e=Xd(r[m])-1;m>=0;){for(e>=l?g=r[m]>>e-l&u:(g=(r[m]&(1<<e+1)-1)<<l-e,m>0&&(g|=r[m-1]>>this.DB+e-l)),c=i;!(g&1);)g>>=1,--c;if((e-=c)<0&&(e+=this.DB,--m),v)s[g].copyTo(o),v=!1;else{for(;c>1;)n.sqrTo(o,I),n.sqrTo(I,o),c-=2;c>0?n.sqrTo(o,I):(S=o,o=I,I=S),n.mulTo(I,s[g],o)}for(;m>=0&&!(r[m]&1<<e);)n.sqrTo(o,I),S=o,o=I,I=S,--e<0&&(e=this.DB-1,--m)}return n.revert(o)}p(iw,"bnModPow");function ow(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(ow,"bnGCD");function nw(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(nw,"bnpModInt");function aw(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return _.ZERO;for(var e=r.clone(),i=this.clone(),o=go(1),n=go(0),s=go(0),c=go(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(_.ONE)!=0)return _.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(aw,"bnModInverse");var mt=[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],sw=(1<<26)/mt[mt.length-1];function lw(r){var t,e=this.abs();if(e.t==1&&e[0]<=mt[mt.length-1]){for(t=0;t<mt.length;++t)if(e[0]==mt[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<mt.length;){for(var i=mt[t],o=t+1;o<mt.length&&i<sw;)i*=mt[o++];for(i=e.modInt(i);t<o;)if(i%mt[t++]==0)return!1}return e.millerRabin(r)}p(lw,"bnIsProbablePrime");function cw(r){var t=this.subtract(_.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>mt.length&&(r=mt.length);for(var o=se(),n=0;n<r;++n){o.fromInt(mt[Math.floor(Math.random()*mt.length)]);var s=o.modPow(i,this);if(s.compareTo(_.ONE)!=0&&s.compareTo(t)!=0){for(var c=1;c++<e&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(_.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}p(cw,"bnpMillerRabin");_.prototype.chunkSize=pT;_.prototype.toRadix=dT;_.prototype.fromRadix=hT;_.prototype.fromNumber=fT;_.prototype.bitwiseTo=bT;_.prototype.changeBit=FT;_.prototype.addTo=RT;_.prototype.dMultiply=XT;_.prototype.dAddOffset=YT;_.prototype.multiplyLowerTo=$T;_.prototype.multiplyUpperTo=JT;_.prototype.modInt=nw;_.prototype.millerRabin=cw;_.prototype.clone=aT;_.prototype.intValue=sT;_.prototype.byteValue=lT;_.prototype.shortValue=cT;_.prototype.signum=uT;_.prototype.toByteArray=mT;_.prototype.equals=yT;_.prototype.min=gT;_.prototype.max=vT;_.prototype.and=ST;_.prototype.or=xT;_.prototype.xor=IT;_.prototype.andNot=PT;_.prototype.not=MT;_.prototype.shiftLeft=TT;_.prototype.shiftRight=wT;_.prototype.getLowestSetBit=ET;_.prototype.bitCount=LT;_.prototype.testBit=AT;_.prototype.setBit=BT;_.prototype.clearBit=kT;_.prototype.flipBit=_T;_.prototype.add=NT;_.prototype.subtract=GT;_.prototype.multiply=VT;_.prototype.divide=HT;_.prototype.remainder=UT;_.prototype.divideAndRemainder=WT;_.prototype.modPow=iw;_.prototype.modInverse=aw;_.prototype.pow=qT;_.prototype.gcd=ow;_.prototype.isProbablePrime=lw;_.prototype.square=jT;var oe=_;oe.prototype.IsNegative=function(){return this.compareTo(oe.ZERO)==-1};oe.op_Equality=function(r,t){return r.compareTo(t)==0};oe.op_Inequality=function(r,t){return r.compareTo(t)!=0};oe.op_GreaterThan=function(r,t){return r.compareTo(t)>0};oe.op_LessThan=function(r,t){return r.compareTo(t)<0};oe.op_Addition=function(r,t){return new oe(r).add(new oe(t))};oe.op_Subtraction=function(r,t){return new oe(r).subtract(new oe(t))};oe.Int128Mul=function(r,t){return new oe(r).multiply(new oe(t))};oe.op_Division=function(r,t){return r.divide(t)};oe.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Ud>"u"&&(Ud=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 Ud;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};Ud(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)};ne.msie||ne.opera||ne.safari?f.Cast_Int32=function(r){return r|0}:f.Cast_Int32=function(r){return~~r};ne.chrome?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:ne.firefox&&typeof Number.toInteger=="function"?f.Cast_Int64=function(r){return Number.toInteger(r)}:ne.msie7||ne.msie8?f.Cast_Int64=function(r){return parseInt(r,10)}:ne.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,Tn)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};Tn?(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};N7&&(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;xM?(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&&oe.op_Equality(oe.Int128Mul(r.X-t.X,e.Y-t.Y),oe.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?oe.op_Equality(oe.Int128Mul(e.Delta.Y,i.Delta.X),oe.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?oe.op_Equality(oe.Int128Mul(o.Y-n.Y,n.X-s.X),oe.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?oe.op_Equality(oe.Int128Mul(o.Y-n.Y,s.X-c.X),oe.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?oe.op_Equality(oe.Int128Mul(r.Delta.Y,t.Delta.X),oe.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?oe.op_Equality(oe.Int128Mul(r.Y-t.Y,t.X-e.X),oe.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?oe.op_Equality(oe.Int128Mul(r.Y-t.Y,e.X-i.X),oe.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){R7?!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 m=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 g=new f.LocalMinima;for(g.Next=null,g.Y=u.Bot.Y,g.LeftBound=null,g.RightBound=u,g.RightBound.Side=f.EdgeSide.esRight,g.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(g),this.m_edges.push(o),!0}this.m_edges.push(o);for(var v,I=null;u=this.FindNextLocMin(u),u!=I;){I==null&&(I=u);var g=new f.LocalMinima;g.Next=null,g.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(g.LeftBound=u.Prev,g.RightBound=u,v=!1):(g.LeftBound=u,g.RightBound=u.Prev,v=!0),g.LeftBound.Side=f.EdgeSide.esLeft,g.RightBound.Side=f.EdgeSide.esRight,e?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,u=this.ProcessBound(g.LeftBound,v);var S=this.ProcessBound(g.RightBound,!v);g.LeftBound.OutIdx==f.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==f.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),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,Tn&&(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,Tn&&(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)};Tn&&(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),Tn&&(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),Tn&&(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,m=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==m){g.OutIdx=h,g.Side=u;break}g=g.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(R7&&(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,m,g;r.PolyTyp==f.PolyType.ptSubject?(u=this.m_SubjFillType,m=this.m_ClipFillType):(u=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==f.PolyType.ptSubject?(h=this.m_SubjFillType,g=this.m_ClipFillType):(h=this.m_ClipFillType,g=this.m_SubjFillType);var v,I;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:I=t.WindCnt;break;case f.PolyFillType.pftNegative:I=-t.WindCnt;break;default:I=Math.abs(t.WindCnt);break}if(s&&c)o||n||v!==0&&v!=1||I!==0&&I!=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)(I===0||I==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)&&(I===0||I==1)&&!o&&!n){var S,b;switch(m){case f.PolyFillType.pftPositive:S=r.WindCnt2;break;case f.PolyFillType.pftNegative:S=-r.WindCnt2;break;default:S=Math.abs(r.WindCnt2);break}switch(g){case f.PolyFillType.pftPositive:b=t.WindCnt2;break;case f.PolyFillType.pftNegative:b=-t.WindCnt2;break;default:b=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(v==1&&I==1)switch(this.m_ClipType){case f.ClipType.ctIntersection:S>0&&b>0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctUnion:S<=0&&b<=0&&this.AddLocalMinPoly(r,t,e);break;case f.ClipType.ctDifference:(r.PolyTyp==f.PolyType.ptClip&&S>0&&b>0||r.PolyTyp==f.PolyType.ptSubject&&S<=0&&b<=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 m=new f.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(r,u,m,!0)}else{var m=new f.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(u,r,m,!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 g=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 I=this.AddOutPt(v,r.Bot);this.AddJoin(g,I,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 I=this.AddOutPt(h,r.Bot);this.AddJoin(g,I,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 pw=p(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),uw=p(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),dw=p(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),hw=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");ne.msie?f.Clipper.Round=pw:ne.chromium?f.Clipper.Round=dw:ne.safari?f.Clipper.Round=hw:f.Clipper.Round=uw;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 m=h.Left,g=h.Right,v=new f.IntPoint,I;return i.Pt.X>=m&&i.Pt.X<=g?(v.X=i.Pt.X,v.Y=i.Pt.Y,I=i.Pt.X>o.Pt.X):n.Pt.X>=m&&n.Pt.X<=g?(v.X=n.Pt.X,v.Y=n.Pt.Y,I=n.Pt.X>s.Pt.X):o.Pt.X>=m&&o.Pt.X<=g?(v.X=o.Pt.X,v.Y=o.Pt.Y,I=o.Pt.X>i.Pt.X):(v.X=s.Pt.X,v.Y=s.Pt.Y,I=s.Pt.X>n.Pt.X),r.OutPt1=i,r.OutPt2=n,this.JoinHorz(i,o,n,s,v,I)}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 b=s.Pt.Y>n.Pt.Y||!f.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange);if(b){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==b?!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};N7&&(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,m=r.length,g=r[h];h<m;h++,g=r[h])u[h]=new f.IntPoint(t[l].X+g.X,t[l].Y+g.Y);c.push(u)}else for(var l=0;l<s;l++){for(var u=new Array(n),h=0,m=r.length,g=r[h];h<m;h++,g=r[h])u[h]=new f.IntPoint(t[l].X-g.X,t[l].Y-g.Y);c.push(u)}for(var v=new Array,l=0;l<s-1+o;l++)for(var h=0;h<n;h++){var I=new Array;I.push(c[l%s][h%n]),I.push(c[(l+1)%s][h%n]),I.push(c[(l+1)%s][(h+1)%n]),I.push(c[l%s][(h+1)%n]),f.Clipper.Orientation(I)||I.reverse(),v.push(I)}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 m=new f.Paths;return c.Execute(f.ClipType.ctUnion,m,s,s),m}};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};Ud(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 m=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(-m.X,-m.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 g;if(e.m_endtype==f.EndType.etOpenButt){var l=n-1;g=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(g),g=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(g)}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?(g=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(g),g=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(g)):(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,m,g=[],v=0;v<o;v++)if(s=i[v],n=s.length,n!==0){if(n<3){c=s,g.push(c);continue}for(c=s,l=t*t,u=s[0],h=1,m=1;m<n;m++)(s[m].X-u.X)*(s[m].X-u.X)+(s[m].Y-u.Y)*(s[m].Y-u.Y)<=l||(c[h]=s[m],u=s[m],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&&g.push(c)}return!e&&g.length?g=g[0]:!e&&g.length===0?g=[]:e&&g.length===0&&(g=[[]]),g};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,m,g,v,I,S,b,C,w,M=r.length,D=t*t,E=[];for(e=0;e<M;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,g=[],i=0;i<c-2;i++)l=o[i],h=o[i+1],u=o[i+2],C=l.X,w=l.Y,I=u.X-C,S=u.Y-w,(I!==0||S!==0)&&(b=((h.X-C)*I+(h.Y-w)*S)/(I*I+S*S),b>1?(C=u.X,w=u.Y):b>0&&(C+=I*b,w+=S*b)),I=h.X-C,S=h.Y-w,m=I*I+S*S,m<=D&&(g[i+1]=1,i++);for(s.push({X:o[0].X,Y:o[0].Y}),i=1;i<c-1;i++)g[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(),g.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,m=r.length;if(m<2)return 0;for(t&&(r[m]=r[0],m++);--m;)n=r[m],c=n.X,l=n.Y,s=r[m-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};ac.exports=f});var px=H((VJ,$h)=>{y();(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,m=l.x-u,g=l.y-h;if(m!==0||g!==0){var v=((s.x-u)*m+(s.y-h)*g)/(m*m+g*g);v>1?(u=l.x,h=l.y):v>0&&(u+=m*v,h+=g*v)}return m=s.x-u,g=s.y-h,m*m+g*g}p(t,"getSqSegDist");function e(s,c){for(var l=s[0],u=[l],h,m=1,g=s.length;m<g;m++)h=s[m],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 m=u,g,v=c+1;v<l;v++){var I=t(s[v],s[c],s[l]);I>m&&(g=v,m=I)}m>u&&(g-c>1&&i(s,c,g,u,h),h.push(s[g]),l-g>1&&i(s,g,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 $h<"u"?($h.exports=n,$h.exports.default=n):typeof self<"u"?self.simplify=n:window.simplify=n})()});y();y();var fa=class fa{constructor(t,e,i){d(this,"__type",fa.__type);d(this,"id",be());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===fa.__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(fa,"Coordinate"),d(fa,"__type","coordinate");var Ff=fa,re=Ff;y();var Bf=class Bf{constructor(t){d(this,"id");this.id=t}};p(Bf,"BaseMetaData");var Ge=Bf;var Er,ht,Jo,Qi,ma=class ma extends Ge{constructor(e,i){super(i.mvfData.properties.id);d(this,"__type",ma.__type);x(this,Er,void 0);x(this,ht,{});x(this,Jo,void 0);x(this,Qi,void 0);T(this,Er,e),T(this,Jo,i.floorId),T(this,Qi,i.mvfData)}static is(e){return e.__type===ma.__type}get locations(){return a(this,ht).locations?a(this,ht).locations:(a(this,ht).locations=(a(this,Er).locationIdsByNodeId[this.id]||[]).map(e=>a(this,Er).getById("enterprise-location",e)).filter(Boolean),a(this,ht).locations)}get space(){var e;return a(this,Er).getById("space",(e=a(this,Er).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=a(this,Er).getById("floor",a(this,Jo));if(e==null)throw new Error("Floor ".concat(a(this,Jo)," not found!"));return e}get coordinate(){if(a(this,ht).coordinate==null){let[e,i]=a(this,Qi).geometry.coordinates;a(this,ht).coordinate=new re(i,e,a(this,Jo))}return a(this,ht).coordinate}get externalId(){var e;return(e=a(this,Qi).properties.externalId)!=null?e:""}get neighbors(){if(a(this,ht).neighbours==null){let e=a(this,Qi).properties.neighbors.map(i=>{let o=a(this,Er).getById("node",i.id);if(o==null)throw new Error("Node ".concat(i.id," not found!"));return o});a(this,ht).neighbours=e}return a(this,ht).neighbours}get geoJSON(){return{...a(this,Qi),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,ht)))delete a(this,ht)[e]}};Er=new WeakMap,ht=new WeakMap,Jo=new WeakMap,Qi=new WeakMap,p(ma,"Node"),d(ma,"__type","node");var kf=ma,oi=kf;y();y();var Qo,_f=class _f{constructor(t,e){d(this,"id");x(this,Qo,void 0);this.id=t}get geoJSONBoundingBox(){return a(this,Qo)?a(this,Qo):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(T(this,Qo,aa(this.geoJSON)),a(this,Qo))}get geoJSON(){return{properties:null,type:"Point",geometry:{}}}};Qo=new WeakMap,p(_f,"BaseMapData");var or=_f;var Ko,Ut,Wt,ga,ya=class ya extends or{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",ya.__type);x(this,Ko,void 0);x(this,Ut,{});x(this,Wt,void 0);x(this,ga,void 0);T(this,Ko,e),T(this,Wt,i.mvfData),T(this,ga,i.facadeId)}static is(e){return e.__type===ya.__type}get type(){return a(this,Wt).type}get name(){var e;return(e=a(this,Wt).name)!=null?e:""}get shortName(){var e;return(e=a(this,Wt).shortName)!=null?e:""}get externalId(){var e;return(e=a(this,Wt).externalId)!=null?e:""}get floors(){var e,i;if(a(this,Ut).floors==null){let o=((i=(e=a(this,Wt).floors)!=null?e:a(this,Wt).maps)!=null?i:[]).reduce((n,s)=>{let c=a(this,Ko).floorsById[s];return c&&n.push(c),n},[]);o.length===0&&O.error("Floor stack ".concat(this.id," has no floors")),a(this,Ut).floors=o}return a(this,Ut).floors}get defaultFloor(){if(a(this,Ut).defaultFloor!=null)return a(this,Ut).defaultFloor;let e=a(this,Wt).defaultFloor?a(this,Ko).getById("floor",a(this,Wt).defaultFloor):void 0;return a(this,Ut).defaultFloor=e||this.floors.reduce((i,o)=>Math.abs(o.elevation)<Math.abs(i.elevation)?o:i),a(this,Ut).defaultFloor}get facade(){return a(this,ga)?a(this,Ko).facadesById[a(this,ga)]:void 0}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,Ut)))delete a(this,Ut)[e]}};Ko=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,ga=new WeakMap,p(ya,"FloorStack"),d(ya,"__type","floor-stack");var Rf=ya,cl=Rf;y();y();y();y();y();y();var ul,va,pl=class pl extends Ge{constructor(e){super(String(be()));x(this,ul,{});x(this,va,void 0);T(this,va,e.mvfData)}static is(e){return e.__type===pl.__type}get url(){return a(this,va).url}get name(){return a(this,va).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,ul)))delete a(this,ul)[e]}};ul=new WeakMap,va=new WeakMap,p(pl,"Hyperlink"),d(pl,"__type","hyperlink");var Nf=pl,Ki=Nf;y();var hl,en,dl=class dl extends Ge{constructor(e){super(String(be()));x(this,hl,{});x(this,en,void 0);T(this,en,e.mvfData)}static is(e){return e.__type===dl.__type}get url(){return a(this,en).url}get name(){return a(this,en).altText}get altText(){return a(this,en).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,hl)))delete a(this,hl)[e]}};hl=new WeakMap,en=new WeakMap,p(dl,"Image"),d(dl,"__type","image");var Gf=dl,tn=Gf;var rn,nr,ni,Vf=class Vf extends or{constructor(e,i){super(i.properties.id,e);x(this,rn,void 0);x(this,nr,void 0);x(this,ni,{});T(this,rn,e),T(this,nr,i)}get externalId(){var e;return(e=a(this,nr).properties.externalId)!=null?e:""}get name(){var i,o,n,s,c;let e="";return"details"in a(this,nr).properties||(e=(i=a(this,nr).properties.externalId)!=null?i:""),e===""&&(e=(n=(o=a(this,nr).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,nr).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,ni).images!=null)return a(this,ni).images;let e=(n=(o=(i=a(this,nr).properties.details)==null?void 0:i.images)==null?void 0:o.map(l=>new tn({mvfData:{...l,url:a(this,rn).sasToken?l.url+"?".concat(a(this,rn).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,ni).images=e,e}get links(){var i,o,n,s,c;if(a(this,ni).links!=null)return a(this,ni).links;let e=(n=(o=(i=a(this,nr).properties.details)==null?void 0:i.links)==null?void 0:o.map(l=>new Ki({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,ni).links=e,e}get locationProfiles(){var e;return(e=a(this,rn).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}};rn=new WeakMap,nr=new WeakMap,ni=new WeakMap,p(Vf,"DetailedMapData");var Ke=Vf;var fl,on,Ca,Sa,ba=class ba extends Ke{constructor(e,i){super(e,i.mvfData);d(this,"__type",ba.__type);x(this,fl,void 0);x(this,on,void 0);x(this,Ca,{});x(this,Sa,void 0);T(this,fl,e),T(this,on,i.floorId),T(this,Sa,i.mvfData)}static is(e){return e.__type===ba.__type}get center(){var e;if(a(this,Ca).center==null){let[i,o]=(e=a(this,Sa).properties.center)!=null?e:[0,0];a(this,Ca).center=new re(o,i,a(this,on))}return a(this,Ca).center}get floor(){let e=a(this,fl).getById("floor",a(this,on));if(e==null)throw new Error("Floor ".concat(a(this,on)," not found!"));return e}get geoJSON(){return{...a(this,Sa),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};fl=new WeakMap,on=new WeakMap,Ca=new WeakMap,Sa=new WeakMap,p(ba,"Area"),d(ba,"__type","area");var jf=ba,ai=jf;y();var nn,si,an,Ia,xa=class xa extends Ke{constructor(e,i){super(e,i.mvfData);d(this,"__type",xa.__type);x(this,nn,void 0);x(this,si,void 0);x(this,an,void 0);x(this,Ia,void 0);T(this,si,{}),T(this,Ia,i.mvfData),T(this,nn,e),T(this,an,i.floorId)}static is(e){return e.__type===xa.__type}get floor(){let e=a(this,nn).getById("floor",a(this,an));if(e==null)throw new Error("Floor ".concat(a(this,an)," not found!"));return e}get center(){if(a(this,si).center==null){let[[e,i],[o,n]]=a(this,Ia).geometry.coordinates,s=(e+o)/2,c=(i+n)/2;a(this,si).center=new re(c,s,a(this,an))}return a(this,si).center}get isExterior(){var o;let e=a(this,nn).obstructionIdByEntranceId[this.id],i=a(this,nn).getMVFFeatureById("obstruction",e);return(o=i==null?void 0:i.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...a(this,Ia),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,si)))delete a(this,si)[e]}};nn=new WeakMap,si=new WeakMap,an=new WeakMap,Ia=new WeakMap,p(xa,"Door"),d(xa,"__type","door");var Hf=xa,ar=Hf;y();var eo,sn,kt,Or,Pa=class Pa extends Ke{constructor(e,i){super(e,i.mvfData);d(this,"__type",Pa.__type);x(this,eo,void 0);x(this,sn,void 0);x(this,kt,{});x(this,Or,void 0);T(this,eo,e),T(this,sn,i.floorId),T(this,Or,i.mvfData)}getMvfData(){return a(this,Or)}static is(e){return e.__type===Pa.__type}get type(){return Xx(a(this,Or).properties.kind)}get locations(){if(a(this,kt).locations)return a(this,kt).locations;a(this,kt).locations=[];let e=a(this,eo).mvfLocationsBySpaceId[a(this,Or).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let o=a(this,eo).getById("enterprise-location",i.id);o&&a(this,kt).locations.push(o)}return a(this,kt).locations}get floor(){let e=a(this,eo).getById("floor",a(this,sn));if(e==null)throw new Error("Floor ".concat(a(this,sn)," not found!"));return e}get doors(){return a(this,Or).properties.destinationNodes.reduce((e,i)=>{let o=a(this,eo).doorsByNodeId[i];return o&&e.push(o),e},[])}get center(){var e;if(a(this,kt).center==null){let[i,o]=(e=a(this,Or).properties.center)!=null?e:[0,0];a(this,kt).center=new re(o,i,a(this,sn))}return a(this,kt).center}get geoJSON(){return{...a(this,Or),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,kt)))delete a(this,kt)[e]}};eo=new WeakMap,sn=new WeakMap,kt=new WeakMap,Or=new WeakMap,p(Pa,"Space"),d(Pa,"__type","space");var Uf=Pa,Wx=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Xx(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return Wx.includes(t)?t:"room"}p(Xx,"validateSpaceType");var Be=Uf;y();var sr,Ce,Xt,Ma=class Ma extends or{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",Ma.__type);x(this,sr,void 0);x(this,Ce,{});x(this,Xt,void 0);T(this,sr,e),T(this,Xt,i.mvfData)}static is(e){return e.__type===Ma.__type}get focusTarget(){return this}get name(){var e,i;return"name"in a(this,Xt)?(i=a(this,Xt).name)!=null?i:"":(e=a(this,Xt).externalId)!=null?e:""}get shortName(){var e,i;return"shortName"in a(this,Xt)?(i=a(this,Xt).shortName)!=null?i:"":(e=a(this,Xt).externalId)!=null?e:""}get externalId(){var e;return(e=a(this,Xt).externalId)!=null?e:""}get elevation(){return a(this,Xt).elevation}get spaces(){if(a(this,Ce).spaces==null){let e=a(this,sr).spaces.filter(i=>i.floor.id===this.id);a(this,Ce).spaces=e}return a(this,Ce).spaces}get objects(){if(a(this,Ce).objects==null){let e=a(this,sr).objects.filter(i=>i.floor.id===this.id);a(this,Ce).objects=e}return a(this,Ce).objects}get connections(){if(a(this,Ce).connections==null){let e=a(this,sr).connections.filter(i=>i.floors.includes(this));a(this,Ce).connections=e}return a(this,Ce).connections}get doors(){if(a(this,Ce).doors==null){let e=a(this,sr).doors.filter(i=>i.floor.id===this.id);a(this,Ce).doors=e}return a(this,Ce).doors}get annotations(){if(a(this,Ce).annotations==null){let e=a(this,sr).annotations.filter(i=>i.floor.id===this.id);a(this,Ce).annotations=e}return a(this,Ce).annotations}get pois(){if(a(this,Ce).pois==null){let e=a(this,sr).pointsOfInterest.filter(i=>i.floor.id===this.id);a(this,Ce).pois=e}return a(this,Ce).pois}get floorStack(){if(a(this,Ce).floorStack==null){let e=a(this,sr).floorStacks.find(i=>i.floors.includes(this));a(this,Ce).floorStack=e}return a(this,Ce).floorStack}toJSON(){return{id:this.id,name:this.name,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,Ce)))delete a(this,Ce)[e]}};sr=new WeakMap,Ce=new WeakMap,Xt=new WeakMap,p(Ma,"Floor"),d(Ma,"__type","floor");var Wf=Ma,Yt=Wf;y();y();y();var ml=p(r=>r!=null,"notNull");y();function yl(r){return typeof r=="string"?r:r.id}p(yl,"getId");function Yf(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}p(Yf,"isPosition");var Xf=8,to=p(r=>typeof r=="number"?r.toFixed(Xf):Yf(r)?r[1].toFixed(Xf)+"-"+r[0].toFixed(Xf):r.map(t=>to(t)).join("-"),"serializeCoords");y();function gl(r){let t;if(Be.is(r)||ar.is(r)||Dt.is(r)||ai.is(r)||Zt.is(r))t=r.center;else if(li.is(r)||ci.is(r))t=r.coordinate;else if(re.is(r))t=r;else if(oi.is(r))t=r.coordinate;else if(Lr.is(r))t=r.coordinates[0];else return;return t}p(gl,"getCoordinateFromStuffs");y();y();var Ta={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"}},Ar="ExteriorWalls",ro="Walls",Pv=0,wa="InteriorDoors",Da="ExteriorDoors",Pe="GeometryLayer",pi="LabelsLayer",Fr="MarkersLayer",Ea="FootprintLayer",Oa="OcclusionLayer",Mv="ImagesLayer";var Tv=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],wv={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function Zf(r){var t,e;(t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)&&O.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}p(Zf,"validateOptions");function zf(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={...Ta,...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=Ta.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:{...Ta.imagePlacementOptions,...r==null?void 0:r.imagePlacementOptions}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}p(zf,"handleShow3DMapOptionDefault");function Dv(r){let t={remove_watermark:!1};if(r)try{let e=iu(r);Object.assign(t,e.capabilities)}catch(e){O.error("Error decoding capabilities from token",e)}return t}p(Dv,"handleTokenCapabilities");var io,zt,ui,La=class La extends Ke{constructor(e,i){let o=Object.values(i.mvfDataByFloorId)[0];super(e,o);d(this,"__type",La.__type);x(this,io,void 0);x(this,zt,void 0);x(this,ui,void 0);T(this,zt,{}),T(this,io,e),T(this,ui,i.mvfDataByFloorId)}static is(e){return e.__type===La.__type}get accessible(){var e;return(e=Object.values(a(this,ui))[0].properties.accessible)!=null?e:!1}get type(){var e,i;return(i=(e=Object.values(a(this,ui))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get extra(){return Object.values(a(this,ui))[0].properties.extra}get coordinates(){return a(this,zt).coordinates==null&&(a(this,zt).coordinates=Object.entries(a(this,ui)).map(([e,i])=>new re(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),a(this,zt).coordinates}get nodes(){return Object.values(a(this,ui))[0].properties.nodes.map(e=>a(this,io).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?a(this,io).getById("floor",e.floorId):void 0).filter(ml)}get locationProfiles(){var i,o,n,s,c;if(a(this,zt).locationProfiles!=null)return a(this,zt).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=to(l),h=(c=a(this,io).mvfConnectionIdsByLatLon[u])!=null?c:[];for(let m of h){let g=a(this,io).locationProfilesByAttachedFeatureId[m];if(g!=null){e=g;break}}}return a(this,zt).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,zt)))delete a(this,zt)[e]}};io=new WeakMap,zt=new WeakMap,ui=new WeakMap,p(La,"Connection"),d(La,"__type","connection");var qf=La,oo=qf;y();var vl,ln,no,cn,Aa=class Aa extends Ke{constructor(e,i){super(e,i.mvfData);d(this,"__type",Aa.__type);x(this,vl,void 0);x(this,ln,void 0);x(this,no,{});x(this,cn,void 0);T(this,vl,e),T(this,ln,i.floorId),T(this,cn,i.mvfData)}static is(e){return e.__type===Aa.__type}get type(){let e=a(this,cn).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=a(this,vl).getById("floor",a(this,ln));if(e==null)throw new Error("Floor ".concat(a(this,ln)," not found!"));return e}get center(){var e;if(a(this,no).center==null){let[i,o]=(e=a(this,cn).properties.center)!=null?e:[0,0];a(this,no).center=new re(o,i,a(this,ln))}return a(this,no).center}get geoJSON(){return{...a(this,cn),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,no)))a(this,no)[e]=null}};vl=new WeakMap,ln=new WeakMap,no=new WeakMap,cn=new WeakMap,p(Aa,"MapObject"),d(Aa,"__type","object");var $f=Aa,Dt=$f;y();var bl,pn,ao,Ba,Fa=class Fa extends Ke{constructor(e,i){super(e,i.mvfData);d(this,"__type",Fa.__type);x(this,bl,void 0);x(this,pn,void 0);x(this,ao,{});x(this,Ba,void 0);T(this,bl,e),T(this,Ba,i.mvfData),T(this,pn,i.floorId)}static is(e){return e.__type===Fa.__type}get floor(){let e=a(this,bl).getById("floor",a(this,pn));if(e==null)throw new Error("Floor ".concat(a(this,pn)," not found!"));return e}get coordinate(){var e;if(a(this,ao).coordinate==null){let[i,o]=(e=a(this,Ba).geometry.coordinates)!=null?e:[0,0];a(this,ao).coordinate=new re(o,i,a(this,pn))}return a(this,ao).coordinate}get geoJSON(){return{...a(this,Ba),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,ao))a(this,ao)[e]=null}};bl=new WeakMap,pn=new WeakMap,ao=new WeakMap,Ba=new WeakMap,p(Fa,"PointOfInterest"),d(Fa,"__type","point-of-interest");var Jf=Fa,li=Jf;y();var Cl,un,so,dn,Sl,Kf,ka=class ka extends Ke{constructor(e,i){super(e,i.mvfData);x(this,Sl);d(this,"__type",ka.__type);x(this,Cl,void 0);x(this,un,void 0);x(this,so,{});x(this,dn,void 0);T(this,Cl,e),T(this,un,i.floorId),T(this,dn,i.mvfData)}static is(e){return e.__type===ka.__type}get group(){return V(this,Sl,Kf).call(this).group}get type(){return V(this,Sl,Kf).call(this).type}get coordinate(){if(a(this,so).coordinate==null){let[e,i]=a(this,dn).geometry.coordinates;a(this,so).coordinate=new re(i,e,a(this,un))}return a(this,so).coordinate}get floor(){let e=a(this,Cl).getById("floor",a(this,un));if(e==null)throw new Error("Floor ".concat(a(this,un)," not found!"));return e}get geoJSON(){return{...a(this,dn),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]}};Cl=new WeakMap,un=new WeakMap,so=new WeakMap,dn=new WeakMap,Sl=new WeakSet,Kf=p(function(){let[e,i]=a(this,dn).properties.symbolId.split("--");return{group:e,type:i}},"#getGroupAndTypeFromSymbolId"),p(ka,"Annotation"),d(ka,"__type","annotation");var Qf=ka,ci=Qf;y();var Yx=p((r,t)=>{var l,u,h,m,g,v,I,S,b,C,w;let e={},i={},o={},n={},s={},c={};for(let M of r["location.json"]||[]){let D=new hn(t,{mvfData:M});if(e[M.id]=D,M.externalId&&(n[M.externalId]==null&&(n[M.externalId]=[]),n[M.externalId].push(D)),M.categories)for(let F of M.categories)s[F]==null&&(s[F]=[]),s[F].push(D);let E=[...(u=(l=M.obstructions)==null?void 0:l.map(F=>F.id))!=null?u:[],...(m=(h=M.spaces)==null?void 0:h.map(F=>F.id))!=null?m:[],...(v=(g=M.annotations)==null?void 0:g.map(F=>F.id))!=null?v:[],...(I=M.connections)!=null?I:[],...(b=(S=M.entrances)==null?void 0:S.map(F=>F.id))!=null?b:[],...(w=(C=M.areas)==null?void 0:C.map(F=>F.id))!=null?w:[]];for(let F of E)F&&(c[F]==null&&(c[F]=[]),c[F].push(D))}for(let M of r["category.json"]||[]){let D=new Il(t,{mvfData:M});i[M.id]=D,M.parent&&(o[M.parent]==null&&(o[M.parent]=[]),o[M.parent].push(D))}return{locationCategoriesByParentId:o,locationProfilesById:e,locationCategoriesById:i,locationProfilesByExternalId:n,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:c}},"processMVFLocationProfilesAndCategories"),Zx=p((r,t)=>{var S,b;let e={},i={},o={},n={},s={},c={},l={},u={},h={},m={},g={},v={},I=globalThis.Object.keys(r.space);for(let C of I){let w=r.space[C];if(w!=null)for(let M of w.features){v[M.properties.id]=C,l[M.properties.id]=M;for(let D of M.properties.destinationNodes)s[D]==null&&(s[D]=[]),s[D].push(M.properties.id);if(M.properties.kind==="desk-entrance"&&(c[M.properties.externalId]==null&&(c[M.properties.externalId]=[]),c[M.properties.externalId].push(...M.properties.destinationNodes)),!["void","desk-entrance"].includes((S=M.properties.kind)!=null?S:"")){if((b=M.properties.kind)!=null&&b.includes("connection")){let D=to(M.geometry.coordinates);m[D]==null&&(m[D]=[]),m[D].push(M.properties.id);continue}if(M.properties.kind==="poi"){let D=new li(t,{floorId:C,mvfData:M});o[M.properties.id]=D,h[C]||(h[C]=[]),h[C].push(M),M.properties.externalId&&(n[M.properties.externalId]==null&&(n[M.properties.externalId]=[]),n[M.properties.externalId].push(D))}else{let D=new Be(t,{floorId:C,mvfData:M});e[M.properties.id]=D,M.properties.externalId&&(i[M.properties.externalId]==null&&(i[M.properties.externalId]=[]),i[M.properties.externalId].push(D)),u[C]||(u[C]=[]),u[C].push(M)}}}}for(let C in m){let w=m[C],M={};for(let E of w){let F=v[E],B=l[E];M[F]=B}let D=new oo(t,{mvfDataByFloorId:M});g[D.id]=D}return{spacesById:e,spacesByExternalId:i,poisById:o,poisByExternalId:n,connectionsById:g,spaceIdsByDestinationNodeId:s,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:l,connectionIdsByLatLon:m,mvfSpacesByFloorId:u,mvfPoisByFloorId:h}},"processMVFSpaces"),zx=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 oi(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"),qx=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 m of u.properties.entrances)n[m]=u.properties.id;if(u.properties.kind==="Wall")continue;let h=new Dt(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"),$x=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 Yt(t,{mvfData:n.properties});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 Yt(t,{mvfData:n});e[n.id]=s}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:o}},"processMVFFloors"),Jx=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],m=new cl(t,{mvfData:u,facadeId:h==null?void 0:h.id});if(e[u.id]=m,u.externalId&&(i[u.externalId]==null&&(i[u.externalId]=[]),i[u.externalId].push(m)),o[u.id]=u,h){let g=new Zt(t,{mvfData:h,floorStackId:u.id});n[h.id]=g;for(let v of h.spaces)s[v.spaceId]=g}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:o,facadesById:n,facadesBySpaceId:s}},"processMVFFloorStacks"),Qx=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=to(c.geometry.coordinates);i[l]==null&&(i[l]=[]),i[l].push(s.id)}return n},{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:i}},"processMVFConnections"),Kx=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 m=new ar(t,{floorId:l,mvfData:h});h.properties.node&&(o[h.properties.node]=m),e[h.properties.id]=m,h.properties.externalId&&(i[h.properties.externalId]==null&&(i[h.properties.externalId]=[]),i[h.properties.externalId].push(m)),s[l]||(s[l]=[]),s[l].push(h)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:o,mvfEntrancesById:n,mvfEntrancesByFloorId:s}},"processMVFEntrances"),e6=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"),t6=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"),r6=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"),i6=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"),o6=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 ci(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"),n6=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 ai(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"),Ev=p((r,t)=>{var C,w,M,D,E,F,B,G,N;let e={},i={},o={},n={},s=((w=(C=r.enterprise)==null?void 0:C.locations)!=null?w:[]).reduce((k,j)=>(k[j.id]=j,k),{}),c={},l={},u={},h={},m={},g={},v=((M=r.enterprise)==null?void 0:M.venue)||{},I={},S={};for(let k of(E=(D=r.enterprise)==null?void 0:D.categories)!=null?E:[]){let j=new xl(t,{mvfData:k});c[k.id]=j,k.externalId&&(l[k.externalId]==null&&(l[k.externalId]=[]),l[k.externalId].push(j)),u[k.id]=k,k.locations.forEach(U=>{m[U]==null&&(m[U]=[]),m[U].push(k.id)})}let b={};for(let k of(B=(F=r.enterprise)==null?void 0:F.locationInstances)!=null?B:[]){let j=s[k.parent],U=Object.keys(j),K={};for(let fe of U)K[fe]=void 0;let te={...K,polygons:[],nodes:[],...k};b[te.parent]==null&&(b[te.parent]=[]),b[te.parent].push(new Lr(t,{mvfData:te,categoryIds:m[te.id],parentId:k.parent})),I[te.id]=k}for(let k in r.space){let j=r.space[k];if(j!=null)for(let U of j.features)for(let K of U.properties.destinationNodes)S[K]==null&&(S[K]=[]),S[K].push(U.properties.id)}for(let k of(N=(G=r.enterprise)==null?void 0:G.locations)!=null?N:[]){let j=new Lr(t,{mvfData:k,categoryIds:m[k.id],locationInstances:b[k.id]});o[k.id]=j,k.externalId&&(n[k.externalId]==null&&(n[k.externalId]=[]),n[k.externalId].push(j)),k.nodes.forEach(U=>{g[U.id]==null&&(g[U.id]=[]),g[U.id].push(k.id)});for(let U of k.polygons)h[U.id]==null&&(h[U.id]=[]),h[U.id].push(k)}if(t.enterpriseMode===!0){for(let k in t.mvfConnectionsById){let j={},U=t.mvfConnectionsById[k];for(let K of t.mvfConnectionsById[k].nodes){let te=t.nodesById[K];te!=null&&(j[te.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[te.coordinate.longitude,te.coordinate.latitude]},properties:{id:k,externalId:U.externalId,kind:"enterprise."+U.type,destinationNodes:[],flags:"",type:U.type,nodes:U.nodes,accessible:U.accessible,extra:U.extra}})}Object.keys(j).length>0&&(e[k]=new oo(t,{mvfDataByFloorId:j}),U.externalId&&(i[U.externalId]==null&&(i[U.externalId]=[]),i[U.externalId].push(e[k])))}t.connectionsById=e}return{spaceIdsByNodeId:S,connectionsByExternalId:i,locationIdsByNodeId:g,mvfLocationsBySpaceId:h,mvfLocationsById:s,mvfCategoriesById:u,locationsById:o,locationsByExternalId:n,locationInstancesById:I,categoriesById:c,categoriesByExternalId:l,venue:v}},"createEnterpriseDataFromMVF"),Ov=p((r,t)=>{let{spacesById:e,spacesByExternalId:i,spaceIdsByDestinationNodeId:o,poisById:n,poisByExternalId:s,mvfSpacesById:c,objectEntranceNodeIdsByObstructionId:l,connectionsById:u,connectionIdsByLatLon:h,mvfSpacesByFloorId:m,mvfPoisByFloorId:g}=Zx(r,t),{nodesById:v,nodesByExternalId:I,mvfNodesById:S,mvfNodesByFloorId:b}=zx(r,t),{objectsById:C,objectsByExternalId:w,mvfObstructionById:M,obstructionIdByEntranceId:D}=qx(r,t),{floorsById:E,floorsByExternalId:F,mvfFloorsById:B}=$x(r,t),{floorStacksById:G,floorStacksByExternalId:N,mvfFloorStacksById:k,facadesById:j,facadesBySpaceId:U}=Jx(r,t),{mvfConnectionsById:K,mvfConnectionsByNodeId:te,mvfConnectionIdsByLatLon:fe}=Qx(r,S),{doorsById:Le,doorsByExternalId:ct,doorsByNodeId:me,mvfEntrancesById:we,mvfEntrancesByFloorId:ye}=Kx(r,t),{annotationsById:pt,mvfAnnotationsById:er,mvfAnnotationsByFloorId:it}=o6(r,t),{areasById:ut,areasByExternalId:ei,mvfAreasById:ji}=n6(r,t);t6(r,c,M),e6(r,c,M),r6(r,c),i6(r,c,M);let{locationCategoriesByParentId:ie,locationProfilesById:pe,locationCategoriesById:ve,locationProfilesByExternalId:Mt,locationProfilesByCategoryId:Hi,locationProfilesByAttachedFeatureId:Xo}=Yx(r,t);return{spacesById:e,spacesByExternalId:i,nodesById:v,nodesByExternalId:I,objectsById:C,objectsByExternalId:w,floorsById:E,floorsByExternalId:F,floorStacksById:G,floorStacksByExternalId:N,facadesById:j,facadesBySpaceId:U,connectionsById:u,doorsById:Le,doorsByExternalId:ct,doorsByNodeId:me,poisById:n,poisByExternalId:s,annotationsById:pt,areasById:ut,areasByExternalId:ei,spaceIdsByDestinationNodeId:o,objectEntranceNodeIdsByObstructionId:l,obstructionIdByEntranceId:D,connectionIdsByLatLon:h,locationProfilesById:pe,locationCategoriesById:ve,locationProfilesByExternalId:Mt,locationProfilesByCategoryId:Hi,locationCategoriesByParentId:ie,mvfSpacesById:c,mvfNodesById:S,mvfObstructionById:M,mvfFloorsById:B,mvfFloorStacksById:k,mvfConnectionsById:K,mvfConnectionsByNodeId:te,mvfEntrancesById:we,mvfAnnotationsById:er,mvfNodesByFloorId:b,mvfSpacesByFloorId:m,mvfPoisByFloorId:g,mvfAreasById:ji,mvfEntrancesByFloorId:ye,mvfAnnotationsByFloorId:it,locationProfilesByAttachedFeatureId:Xo,mvfConnectionIdsByLatLon:fe}},"createDataFromMVF");y();y();y();var a6=p(function(){let t=globalThis.fetch;return{fetch(...e){if(!ml(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")(),Lv=a6.fetch;var kv=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],Av=kv[0],_v="https://api-gateway.mappedin.com/track-analytics/a/",Rv="deny-watchposition",Nv="load-mapview",Gv="load-mapdata",Vv="change-language",jv="query-directions";var di,lr,_a,Cu,tm=class tm{constructor(){x(this,_a);x(this,di,Object.freeze({}));x(this,lr,void 0);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",n2((t,e)=>this.sendAnalyticEvent(jv,{start:t,end:e,type:"location_to_location"}),2500));T(this,lr,V(this,_a,Cu).call(this,a(this,di)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){T(this,di,{}),T(this,lr,V(this,_a,Cu).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return T(this,di,Object.freeze(Object.assign({},a(this,di),t))),T(this,lr,V(this,_a,Cu).call(this,t)),a(this,lr)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=em({...a(this,lr),mapId:e.mapId})),e.context&&(e.context=Bv(e.context)),e.baseUri&&(e.analyticsBaseUrl=em({baseUri:e.baseUri,mapId:a(this,lr).mapId})),Object.assign(a(this,lr),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,lr)}getContext(){return this.getState().context||a(this,di).context||Av}getSessionId(){return this.getState().sessionId||a(this,di).sessionId||Fv()}sendAnalyticEvent(t,e={}){let i=this.getState(),o=l6(i.analyticsBaseUrl,t),n={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&O.log("Analytics.track",o,n),!i.sendEvents)return Promise.resolve();if(!this.authReady)return O.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)),Lv(o,{method:"POST",mode:"cors",headers:n,body:JSON.stringify(s)})}capture(t,e){if(p6.includes(t))return O.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=c6.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(Gv,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(Vv,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(Rv)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(Nv,{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,lr=new WeakMap,_a=new WeakSet,Cu=p(function(t){var i,o,n,s;let e=(i=t.baseUri)!=null?i:_v;return{baseUri:e,analyticsBaseUrl:em({...t,baseUri:e}),version:((o=P==null?void 0:P.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||s6(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||Fv(),platformString:t.platformString||"",context:Bv(t.context)||Av,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(tm,"AnalyticsInternal");var Ra=tm;function em({mapId:r,baseUri:t=_v}){return"".concat(t).concat(r,"/")}p(em,"getBaseUrl");function s6(){return na.getInstance().loadLocalData("deviceId")}p(s6,"getDeviceIDFromStorage");function Fv(){return na.getInstance().loadSessionData("id")}p(Fv,"getSessionIDFromStorage");function l6(r,t){return r+t}p(l6,"buildUrl");function Bv(r){return kv.find(t=>t===r)}p(Bv,"getValidContext");var c6=["$select-location","$select-category","$query-suggest","$query-search"],p6=[Nv,Gv,jv,Rv,Vv],EL=new Ra,hi,rm=class rm{constructor(t){x(this,hi,void 0);d(this,"capture");d(this,"updateState");T(this,hi,t),this.capture=a(this,hi).capture.bind(a(this,hi)),this.updateState=a(this,hi).updateState.bind(a(this,hi))}getState(){return Object.assign({},a(this,hi).getState())}};hi=new WeakMap,p(rm,"Analytics");var Pl=rm;y();var u6=new Set(["polygons"]),cr,Me,Et,Ml,Na=class Na extends Ge{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Na.__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","");x(this,cr,void 0);x(this,Me,{});x(this,Et,void 0);x(this,Ml,void 0);T(this,cr,e),T(this,Et,i.mvfData),T(this,Ml,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let o in i.mvfData)!u6.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,Et)[o]!=null?a(this,cr).getPropTranslation(this.__type,o,a(this,Et).id,a(this,Et)[o]):a(this,cr).getPropTranslation(this.__type,o,a(this,Et).id,n[o])}return a(this,cr).getPropTranslation(this.__type,o,a(this,Et).id,a(this,Et)[o])}})}static is(e){return e.__type===Na.__type}get focusTarget(){return this.spaces}get categories(){return a(this,Me).categories?a(this,Me).categories:(a(this,Me).categories=(a(this,Ml).map(e=>a(this,cr).getById("enterprise-category",e))||[]).filter(Boolean),a(this,Me).categories)}get coordinates(){if(a(this,Me).coordinates)return a(this,Me).coordinates;a(this,Me).coordinates=[];for(let e=0;e<this.nodes.length;e++)a(this,Me).coordinates.push(this.nodes[e].coordinate);return a(this,Me).coordinates}get nodes(){if(a(this,Me).nodes)return a(this,Me).nodes;a(this,Me).nodes=[];for(let e=0;e<a(this,Et).nodes.length;e++){let i=a(this,cr).getById("node",a(this,Et).nodes[e].id);i&&a(this,Me).nodes.push(i)}return a(this,Me).nodes}get spaces(){if(a(this,Me).spaces)return a(this,Me).spaces;a(this,Me).spaces=[];for(let e=0;e<a(this,Et).polygons.length;e++){let i=a(this,cr).getById("space",a(this,Et).polygons[e].id);i&&a(this,Me).spaces.push(i)}return a(this,Me).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,Me)))delete a(this,Me)[e]}};cr=new WeakMap,Me=new WeakMap,Et=new WeakMap,Ml=new WeakMap,p(Na,"EnterpriseLocation"),d(Na,"__type","enterprise-location");var im=Na,Lr=im;y();var d6=new Set,fn,ft,Br,Ga=class Ga extends Ge{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Ga.__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");x(this,fn,void 0);x(this,ft,{});x(this,Br,void 0);T(this,fn,e),T(this,Br,i.mvfData);for(let o in i.mvfData)!d6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return a(this,fn).getPropTranslation(this.__type,o,a(this,Br).id,a(this,Br)[o])}})}static is(e){return e.__type===Ga.__type}get children(){if(a(this,ft).children)return a(this,ft).children;a(this,ft).children=[];for(let e=0;e<a(this,Br).children.length;e++){let i=a(this,fn).getById("enterprise-category",a(this,Br).children[e]);i&&a(this,ft).children.push(i)}return a(this,ft).children}get locations(){if(a(this,ft).locations)return a(this,ft).locations;a(this,ft).locations=[];for(let e=0;e<a(this,Br).locations.length;e++){let i=a(this,fn).getById("enterprise-location",a(this,Br).locations[e]);i&&a(this,ft).locations.push(i)}return a(this,ft).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,ft)))delete a(this,ft)[e]}};fn=new WeakMap,ft=new WeakMap,Br=new WeakMap,p(Ga,"EnterpriseCategory"),d(Ga,"__type","enterprise-category");var om=Ga,xl=om;y();var h6=new Set,Tl,wl,Va=class Va extends Ge{constructor(e,i){super(i.mvfData.externalId);d(this,"__type",Va.__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");x(this,Tl,{});x(this,wl,void 0);T(this,wl,i.mvfData);for(let o in i.mvfData)!h6.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=i.mvfData[o])}static is(e){return e.__type===Va.__type}get name(){var e;return(e=a(this,wl).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,Tl)))delete a(this,Tl)[e]}};Tl=new WeakMap,wl=new WeakMap,p(Va,"EnterpriseVenue"),d(Va,"__type","enterprise-venue");var nm=Va,Su=nm;y();var Hv=globalThis.fetch,Yv,f6=(Yv=P==null?void 0:P.env)==null?void 0:Yv.npm_package_version,lm="https://app.mappedin.com/",m6="https://auth.mappedin.com/",Uv="accessTokens",Wv="miSasTokens";function fi(){if(Hv==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Hv}p(fi,"isomorphicFetch");var sm={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Zv(r){var e;let t={...sm,...r};return t.headers={...t.headers,"mappedin-sdk-version":f6},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(Zv,"parseOptions");function y6(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(y6,"constructParamsForRequest");async function g6(r,t,e=!1){let i=y6(r,t,e),o=await fi()(i.url,i.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}p(g6,"generateAPIRequest");var v6=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 O.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){O.warn("Perspective ".concat(i," is missing url or locale_packs!"));continue}e[i]={url:n,locale_packs:s}}return e},"getPerspectivesFromResponse");async function b6(r,t="exports/mvf/1/bundle"){var u,h;let e=Zv({baseUri:"https://api-gateway.mappedin.com/",...sm,...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 g6(e,i),n=o.url,s=o.locale_packs,c=(h=e.perspective)!=null?h:sm.perspective,l=v6(o);if(c!=null&&c!==""&&l!=null){let m=l[c];m==null?O.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(O.log('Loading perspective "'.concat(c,'"')),n=m.url,s=m.locale_packs)}return{url:n,localePacks:s,updated_at:o.updated_at}}p(b6,"getVenueMVFURL");var am=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function cm(r,{signal:t}){let e=await(await fi()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}p(cm,"getLanguagePackUnitArray");async function ja(r){let e=(await import("./browser-PUDTREP5.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let o=e["enterprise/locations.json"];o&&(i.enterprise.locations=JSON.parse(am().decode(o)));let n=e["enterprise/categories.json"];n&&(i.enterprise.categories=JSON.parse(am().decode(n)))}return e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(am().decode(e["manifest.json"]))),i}p(ja,"parseLanguagePack");async function zv(r,{signal:t}){try{let e=await(await fi()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await ja(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}p(zv,"downloadLanguagePack");async function pm(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 b6(r,i),s=await fi()(o).then(l=>l.arrayBuffer()),c=new Uint8Array(s);t({compressed:c,localePacks:n})}catch(i){e(i)}})}p(pm,"downloadVenueBundleMVFAPIGateway");async function um(r,t){return new Promise(async(e,i)=>{try{let{url:o}=await C6(r,t),n=await fi()(o).then(c=>c.arrayBuffer()),s=new Uint8Array(n);e(s)}catch(o){i(o)}})}p(um,"downloadMVF");function dm(r){return r.endsWith("/")?r:"".concat(r,"/")}p(dm,"normalizeUrl");async function C6(r,t){let e="".concat(r.baseUri?dm(r.baseUri):lm,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await fi()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}p(C6,"getMakerBundleURL");async function mn(r,t=!1){let e="".concat(r.key),i=na.getInstance(),o=(i==null?void 0:i.loadSessionData(Uv))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expiresTimestamp)return o[e];let s=t?await S6(r,n):await x6(r,n),c={...o,[e]:s};return i==null||i.saveSessionData(Uv,c),s}p(mn,"getAccessToken");async function S6(r,t){var n;let e="".concat((n=r.baseAuthUri)!=null?n:m6,"oauth2/token"),i=await fi()(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(S6,"fetchAccessTokenEnterprise");async function x6(r,t){let e="".concat(r.baseAuthUri?dm(r.baseAuthUri):lm,"api/api-key/token"),i=await fi()(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(x6,"fetchAccessToken");function Dl(r){var i,o,n,s,c,l,u,h,m,g,v,I;let t=new TextDecoder,e=t.decode.bind(t);try{let S={"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&&(S.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(S.enterprise.locations=JSON.parse(e((o=r.enterprise)==null?void 0:o["locations.json"]))),(n=r.enterprise)!=null&&n["categories.json"]&&(S.enterprise.categories=JSON.parse(e((s=r.enterprise)==null?void 0:s["categories.json"]))),(c=r.enterprise)!=null&&c["venue.json"]&&(S.enterprise.venue=JSON.parse(e((l=r.enterprise)==null?void 0:l["venue.json"]))),(u=r.enterprise)!=null&&u["layers.json"]&&(S.enterprise.layers=JSON.parse(e((h=r.enterprise)==null?void 0:h["layers.json"]))),(m=r.enterprise)!=null&&m["locationInstances.json"]&&(S.enterprise.locationInstances=JSON.parse(e((g=r.enterprise)==null?void 0:g["locationInstances.json"]))),(v=r.enterprise)!=null&&v["enterpriseStyles.json"]&&(S.enterprise.enterpriseStyles=JSON.parse(e((I=r.enterprise)==null?void 0:I["enterpriseStyles.json"])))),r["floorstack.json"]!=null?S["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(S["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),S["floorstack.json"]==null&&S["mapstack.json"]==null&&S["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(S["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),S["floor.geojson"]==null&&S["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(S["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(S["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(S["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(S["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){S.annotation={};let C=Object.keys(r.annotation);for(let w of C){let M=w.replace(/\.json|\.geojson/g,"");S.annotation[M]=JSON.parse(e(r.annotation[w]))}}let b=Object.keys(r.space);for(let C of b){let w=C.replace(/\.json|\.geojson/g,"");S.space[w]=JSON.parse(e(r.space[C]))}if(r.obstruction!=null){let C=Object.keys(r.obstruction);for(let w of C){let M=w.replace(/\.json|\.geojson/g,"");S.obstruction[M]=JSON.parse(e(r.obstruction[w]))}}else S.obstruction={};if(r.entrance!=null){let C=Object.keys(r.entrance);for(let w of C){let M=w.replace(/\.json|\.geojson/g,"");S.entrance[M]=JSON.parse(e(r.entrance[w]))}}else S.entrance={};if("floorImages"in r&&r.floorImages!=null){S.floorImages={};for(let C of Object.keys(r.floorImages)){let w=C.replace(/\.json|\.geojson/g,"");S.floorImages[w]=JSON.parse(e(r.floorImages[C]))}}if("textAreas"in r&&r.textAreas!=null){S.textAreas={};for(let C of Object.keys(r.textAreas)){let w=C.replace(/\.json|\.geojson/g,"");S.textAreas[w]=JSON.parse(e(r.textAreas[C]))}}if("facade"in r&&r.facade!=null){S.facade={};for(let C of Object.keys(r.facade)){let w=C.replace(/\.json|\.geojson/g,"");S.facade[w]=JSON.parse(e(r.facade[C]))}}if("area"in r&&r.area!=null){S.area={};for(let C of Object.keys(r.area)){let w=C.replace(/\.json|\.geojson/g,"");S.area[w]=JSON.parse(e(r.area[C]))}}return S}catch(S){throw O.error(S),new Error("MVF parsing failed! Probably encountered a bad file.")}}p(Dl,"parseMVF");function I6(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(I6,"validateStaticMVFFiles");async function El(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-PUDTREP5.js")).unzipSync(r);if(!I6(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"){O.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(El,"unzipMVF");async function Ha(r,t){let e="".concat(t),i=na.getInstance(),o=(i==null?void 0:i.loadSessionData(Wv))||{},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(Wv,c),s}p(Ha,"getSasToken");async function P6(r,t){let e="".concat(r.baseAuthUri?dm(r.baseAuthUri):lm,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await fi()(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");function yn(){let r="us",t={};function e(){return w6(E6(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?Xv.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?Xv.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}p(yn,"createEnvControl");var qv=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"}),Xv=Object.freeze({...qv,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),M6=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"}),T6=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"});function w6(r,t){return{...r,...t}}p(w6,"getAuthStateByEnvironment");var D6={eu:M6,us:qv,"us-staging":T6};function E6(r){return D6[r]}p(E6,"getEnvironmentAuthState");y();y();y();y();y();y();function qt(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(qt,"getCoord");function _t(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(_t,"getCoords");function Ua(r){return r.type==="Feature"?r.geometry:r}p(Ua,"getGeom");function $v(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}p($v,"getType");function O6(r,t,e){e===void 0&&(e={});for(var i=qt(r),o=_t(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")),L6(o[n],o[n+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}p(O6,"booleanPointOnLine");function L6(r,t,e,i,o){var n=e[0],s=e[1],c=r[0],l=r[1],u=t[0],h=t[1],m=e[0]-c,g=e[1]-l,v=u-c,I=h-l,S=m*I-g*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(I)?v>0?c<n&&n<=u:u<=n&&n<c:I>0?l<s&&s<=h:h<=s&&s<l;if(i==="end")return Math.abs(v)>=Math.abs(I)?v>0?c<=n&&n<u:u<n&&n<=c:I>0?l<=s&&s<h:h<s&&s<=l;if(i==="both")return Math.abs(v)>=Math.abs(I)?v>0?c<n&&n<u:u<n&&n<c:I>0?l<s&&s<h:h<s&&s<l}else return Math.abs(v)>=Math.abs(I)?v>0?c<=n&&n<=u:u<=n&&n<=c:I>0?l<=s&&s<=h:h<=s&&s<=l;return!1}p(L6,"isPointOnLineSegment");var Jv=O6;y();function A6(r,t){t===void 0&&(t={});var e=aa(r),i=(e[0]+e[2])/2,o=(e[1]+e[3])/2;return Ir([i,o],t.properties,t)}p(A6,"center");var xu=A6;y();y();function F6(r,t,e){e===void 0&&(e={});var i=qt(r),o=qt(t),n=Tt(o[1]-i[1]),s=Tt(o[0]-i[0]),c=Tt(i[1]),l=Tt(o[1]),u=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(c)*Math.cos(l);return l2(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}p(F6,"distance");var lo=F6;function Iu(r,t){return t===void 0&&(t={}),p2(r,function(e,i){var o=i.geometry.coordinates;return e+lo(o[0],o[1],t)},0)}p(Iu,"length");y();y();y();function Pu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return B6(r,t);var i=qt(r),o=qt(t),n=Tt(i[0]),s=Tt(o[0]),c=Tt(i[1]),l=Tt(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 il(Math.atan2(u,h))}p(Pu,"bearing");function B6(r,t){var e=Pu(t,r);return e=(e+180)%360,e}p(B6,"calculateFinalBearing");y();function gn(r,t,e,i){i===void 0&&(i={});var o=qt(r),n=Tt(o[0]),s=Tt(o[1]),c=Tt(e),l=c2(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)),m=il(h),g=il(u);return Ir([m,g],i.properties)}p(gn,"destination");y();y();function k6(r){if(!r)throw new Error("geojson is required");var t=[];return Pr(r,function(e){_6(e,t)}),Yo(t)}p(k6,"lineSegment");function _6(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=_t(i);break;case"LineString":e=[_t(i)]}e.forEach(function(o){var n=R6(o,r.properties);n.forEach(function(s){s.id=t.length,t.push(s)})})}}p(_6,"lineSegmentFeature");function R6(r,t){var e=[];return r.reduce(function(i,o){var n=ti([i,o],t);return n.bbox=N6(i,o),e.push(n),o}),e}p(R6,"createSegments");function N6(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(N6,"bbox");var hm=k6;var a7=ru(o7(),1);function sM(r,t){var e={},i=[];if(r.type==="LineString"&&(r=gf(r)),t.type==="LineString"&&(t=gf(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=n7(r,t);return o&&i.push(o),Yo(i)}var n=(0,a7.default)();return n.load(hm(t)),vf(hm(r),function(s){vf(n.search(s),function(c){var l=n7(s,c);if(l){var u=_t(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Yo(i)}p(sM,"lineIntersect");function n7(r,t){var e=_t(r),i=_t(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],m=i[1][1],g=(m-u)*(s-o)-(h-l)*(c-n),v=(h-l)*(n-u)-(m-u)*(o-l),I=(s-o)*(n-u)-(c-n)*(o-l);if(g===0)return null;var S=v/g,b=I/g;if(S>=0&&S<=1&&b>=0&&b<=1){var C=o+S*(s-o),w=n+S*(c-n);return Ir([C,w])}return null}p(n7,"intersects");var ts=sM;function lM(r,t,e){e===void 0&&(e={});var i=Ir([1/0,1/0],{dist:1/0}),o=0;return Pr(r,function(n){for(var s=_t(n),c=0;c<s.length-1;c++){var l=Ir(s[c]);l.properties.dist=lo(t,l,e);var u=Ir(s[c+1]);u.properties.dist=lo(t,u,e);var h=lo(l,u,e),m=Math.max(l.properties.dist,u.properties.dist),g=Pu(l,u),v=gn(t,m,g+90,e),I=gn(t,m,g-90,e),S=ts(ti([v.geometry.coordinates,I.geometry.coordinates]),ti([l.geometry.coordinates,u.geometry.coordinates])),b=null;S.features.length>0&&(b=S.features[0],b.properties.dist=lo(t,b,e),b.properties.location=o+lo(l,b,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),b&&b.properties.dist<i.properties.dist&&(i=b,i.properties.index=c),o+=h}}),i}p(lM,"nearestPointOnLine");var Zl=lM;function cM(r,t,e){var i=_t(e);if($v(e)!=="LineString")throw new Error("line must be a LineString");var o=Zl(e,r),n=Zl(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),ti(c,e.properties)}p(cM,"lineSlice");var eg=cM;var pM=1e-7;function tg(r){return{type:"Point",coordinates:r}}p(tg,"point");function uM(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,o=e.map(n=>Zl(r,tg(n)));return i.reduce((n,s)=>{let c=eg(tg(s),o[0],r),l=eg(tg(s),o[1],r),u=Iu(c)<Iu(l)?c:l;return u.properties={...r.properties,entrances:[]},n.concat([u])},[])}p(uM,"splitObstructionByEntrance");function rg(r,t){return t.reduce((e,i)=>{let o={epsilon:pM},n=e.obstructions.findIndex(c=>Jv(xu(i),c,o)),s=e.obstructions[n];if(s){let[c,l]=uM(s,i);e.entrances.push(i),e.obstructions.splice(n,1,c,l)}return e},{obstructions:[r],entrances:[]})}p(rg,"findAndSplitObstructionByAllEntrances");y();function ig(r){var e,i,o,n,s;let t=((i=(e=r.enterprise)==null?void 0:e.locations)==null?void 0:i.reduce((c,l)=>(c[l.id]=l,c),{}))||{};for(let c of((o=r.enterprise)==null?void 0:o.locationInstances)||[])t[c.id]=c;return{type:"downloaded",data:r,optimized:{locations:t,categories:(s=(n=r.enterprise)==null?void 0:n.categories)==null?void 0:s.reduce((c,l)=>(c[l.id]=l,c),{})}}}p(ig,"parseLocalePackToLanguagePack");function s7(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}p(s7,"isMappedinCdnUrl");y();y();y();y();y();y();y();var og=class og{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");this.origin=t,this.destination=e,this.distance=i,this.angle=o;let c=n||0;if(s?t.properties.floor!==e.properties.floor?this.weight=c:this.weight=(c>=0?this.distance*c:0)+this.distance:this.weight=c>=0?this.distance+c:0,isNaN(this.angle))throw new Error("nan angle")}};p(og,"Edge");var Sn=og;y();y();y();function vi(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=qt(r),o=Ua(t),n=o.type,s=t.bbox,c=o.coordinates;if(s&&dM(i,s)===!1)return!1;n==="Polygon"&&(c=[c]);for(var l=!1,u=0;u<c.length&&!l;u++)if(l7(i,c[u][0],e.ignoreBoundary)){for(var h=!1,m=1;m<c[u].length&&!h;)l7(i,c[u][m],!e.ignoreBoundary)&&(h=!0),m++;h||(l=!0)}return l}p(vi,"booleanPointInPolygon");function l7(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 m=c>r[1]!=u>r[1]&&r[0]<(l-s)*(r[1]-c)/(u-c)+s;m&&(i=!i)}return i}p(l7,"inRing");function dM(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}p(dM,"inBBox");y();y();function bi([r,t],[e,i]){let o=t-i,n=r-e;return(Math.atan2(n,o)+Math.PI*3)%(Math.PI*2)}p(bi,"getAngle");y();var hM=63710088e-1;function dr(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 hM*u}p(dr,"getDistance");y();y();function Sd(r,t,e,i){let[o,n]=r,[s,c]=t,[l,u]=e,[h,m]=i;if(n===c&&o===s||u===m&&l===h)return null;let g=(h-l)*(c-n)-(m-u)*(s-o);if(g===0)return null;let v=((m-u)*(o-l)-(h-l)*(n-u))/g,I=((c-n)*(o-l)-(s-o)*(n-u))/g;if(v<0||v>1||I<0||I>1)return null;let S=n+v*(c-n);return[o+v*(s-o),S]}p(Sd,"getLineIntersection");y();function ng(r,t,e,i){let o=gn(r,e/1e3,i),n=gn(t,e/1e3,i);return[o.geometry.coordinates,n.geometry.coordinates]}p(ng,"getOffsetLine");y();function ag(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(ag,"radToDegNormalized");var c7=111e3;function p7(r,t,e=[],i=0){let o=!0,n=r.geometry.coordinates,s=t.geometry.coordinates,c=ag(bi(n,s)-Math.PI/2),l=ag(bi(n,s)+Math.PI/2),u=i/c7,h=i/(c7*Math.cos(n[1]*Math.PI/180)),m=Math.min(n[1],s[1])-u,g=Math.max(n[1],s[1])+u,v=Math.min(n[0],s[0])-h,I=Math.max(n[0],s[0])+h;for(let S of e)if(!(Math.max(S[0][1],S[1][1])<m||Math.min(S[0][1],S[1][1])>g||Math.max(S[0][0],S[1][0])<v||Math.min(S[0][0],S[1][0])>I)){if(i>0){let b=ng(n,s,i,c),C=ng(n,s,i,l);if(Sd(b[0],b[1],S[0],S[1])||Sd(C[0],C[1],S[0],S[1])){o=!1;return}}else if(Sd(n,s,S[0],S[1])){o=!1;return}}return o}p(p7,"hasLineOfSight");var xn,zl,sg,Id,u7,Pd,d7,Md,h7,Td,f7,wd,m7,Dd,y7,Ed,lg=class lg{constructor({nodes:t,groupBy:e,multiplicativeDistanceWeightScaling:i}){x(this,zl);x(this,Id);x(this,Pd);x(this,Md);x(this,Td);x(this,wd);x(this,Dd);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);x(this,xn,void 0);x(this,Ed,p((t,e)=>{let i=0;for(let o of e)(!o[a(this,xn)]||o[a(this,xn)]===t.properties[a(this,xn)])&&vi(t.geometry.coordinates,o.geometry.geometry)&&(i+=Math.max(0,o.cost));return i},"#getZonalCost"));T(this,xn,e);let{features:o}=t;this.nodesById=V(this,Id,u7).call(this,o),V(this,Pd,d7).call(this),V(this,Md,h7).call(this,o,e,{multiplicativeDistanceWeightScaling:i})}getShortestEuclideanDistance(t,e){return e.reduce((i,o)=>{let n=dr(t.geometry.coordinates,o.geometry.coordinates);return Math.min(i,n)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,zones:o}){let n=V(this,zl,sg).call(this,t),s=V(this,zl,sg).call(this,e);if(n.length===0||s.length===0)return[];let{frontier:c,cameFrom:l,costSoFar:u}=V(this,Td,f7).call(this,n,s);for(;c.length>0;){let h=c.shift();if(!h)break;if(V(this,wd,m7).call(this,h.origin,s))return V(this,Dd,y7).call(this,l,h.origin.properties.id);for(let m of this.edges[h.origin.properties.id]){let g=u[h.origin.properties.id]+m.weight+a(this,Ed).call(this,m.destination,o);if(!(g===1/0||i!=null&&i.has(m.destination.properties.id))&&(u[m.destination.properties.id]==null||g<u[m.destination.properties.id])){let v=g+this.getShortestEuclideanDistance(m.destination,s);u[m.destination.properties.id]=g,l[m.destination.properties.id]=m,c.push({origin:m.destination,priority:v})}}c.sort((m,g)=>m.priority-g.priority)}return[]}};xn=new WeakMap,zl=new WeakSet,sg=p(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),Id=new WeakSet,u7=p(function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},"#createNodesById"),Pd=new WeakSet,d7=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"),Md=new WeakSet,h7=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=dr(o.geometry.coordinates,l.geometry.coordinates),h=bi(o.geometry.coordinates,l.geometry.coordinates);return new Sn({origin:o,destination:l,pathWeight:c,distance:u,angle:h,multiplicativeDistanceWeightScaling:i==null?void 0:i.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),Td=new WeakSet,f7=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"),wd=new WeakSet,m7=p(function(t,e){return e.some(i=>i.properties.id===t.properties.id)},"#isDestinationNode"),Dd=new WeakSet,y7=p(function(t,e){let i=[],o=t[e];for(;o;)i.push(o),o=t[o.origin.properties.id];return i.reverse()},"#reconstructPath"),Ed=new WeakMap,p(lg,"NavigationGraph");var xd=lg;var fM=.4,cg=class cg{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)=>dr(t,e),"getDistance"));d(this,"getAngle",p((t,e)=>bi(t,e),"getAngle"));this.groupBy=i,this.graph=new xd({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,simplify:n,multiplicativeDistanceWeightScaling:s}){var h,m;let c=(h=n==null?void 0:n.enabled)!=null?h:!0,l=t!=null?t:[],u=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:l,excludedNodeIds:new Set(o)});return u.length===0?{type:"FeatureCollection",features:[]}:(c&&(u=this.simplifyAllSteps(u,(m=n==null?void 0:n.bufferRadius)!=null?m:fM,s)),this.generatePath(u))}simplifyAllSteps(t,e,i){var u,h;let o=[],n=[t[0]];for(let m=1;m<t.length;m++)if(this.groupBy!=="default"&&t[m].origin.properties[this.groupBy]!==t[m-1].origin.properties[this.groupBy]){let g=t[m-1].origin.properties[this.groupBy],v=(u=this.geometryEdgesByMapId.get(g))!=null?u:[];o.push(...this.simplifySteps(n,v,e,i)),n=[t[m]]}else n.push(t[m]);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||!p7(t[s].origin,t[c].origin,e,i)){let l=c-1;n.push(new Sn({...t[s],destination:t[l].origin,distance:dr(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:bi(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),s=l}return n.push(new Sn({...t[s],destination:t[t.length-1].origin,distance:dr(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:bi(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),n}};p(cg,"Navigator");var rs=cg;y();var gE={};e2(gE,{Annotation:()=>ci,Area:()=>ai,Connection:()=>oo,Coordinate:()=>re,DOORS:()=>jc,Door:()=>ar,E_SDK_LOG_LEVEL:()=>t2,EnterpriseCategory:()=>xl,EnterpriseLocation:()=>Lr,EnterpriseVenue:()=>Su,Facade:()=>Zt,Floor:()=>Yt,FloorStack:()=>cl,Hyperlink:()=>Ki,ImageData:()=>tn,LocationCategory:()=>Il,LocationProfile:()=>hn,MAPPEDIN_COLORS:()=>wv,MapObject:()=>Dt,Node:()=>oi,PointOfInterest:()=>li,Space:()=>Be,WALLS:()=>Vc,createMapLibreOverlay:()=>mE,enableTestMode:()=>hg,getMapData:()=>Sx,getMapDataEnterprise:()=>fE,hydrateMapData:()=>hE,hydrateMapDataFromMVF:()=>uE,parseMVF:()=>Dl,preloadFont:()=>Tf,setLoggerLevel:()=>r2,setUseEnterpriseAPI:()=>dE,show3dMap:()=>xx,show3dMapGeojson:()=>yE,unzipMVF:()=>El});y();y();y();y();var $l,Jl,Ql,pg=class pg{constructor(t,e,{enabled:i=!1}={}){x(this,$l,void 0);d(this,"searchInstance");x(this,Jl,void 0);x(this,Ql,void 0);d(this,"enabled",!1);T(this,$l,t),T(this,Jl,e),T(this,Ql,()=>{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 O.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return O.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return O.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-OHZQTK3N.js").then(({InternalSearch:t})=>new t(a(this,$l)))),a(this,Jl).on("language-change",a(this,Ql)),await this.searchInstance)}};$l=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,p(pg,"Search");var ql=pg;var g7=new WeakMap,ke,dg=class dg extends J{constructor(e,{search:i}={}){super();x(this,ke,void 0);d(this,"Analytics");d(this,"Search");d(this,"Query");d(this,"getDirections",p((e,i,o)=>a(this,ke).getDirections(e,i,o),"getDirections"));d(this,"getDirectionsMultiDestination",p((e,i,o)=>a(this,ke).getDirectionsMultiDestination(e,i,o),"getDirectionsMultiDestination"));T(this,ke,e),g7.set(this,e),this.Analytics=new Pl(e.Analytics),this.Query=e.Query,this.Search=new ql(this,e,{enabled:i==null?void 0:i.enabled}),a(this,ke).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return a(this,ke).getEnv()}get mapName(){return a(this,ke).mapName}get mapCenter(){return a(this,ke).mapCenter}get organizationId(){return a(this,ke).organizationId}get outdoorViewToken(){return a(this,ke).outdoorViewToken}getByType(e){return a(this,ke).getByType(e)}getById(e,i){return a(this,ke).getById(e,i)}getByExternalId(e,i){return a(this,ke).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return a(this,ke).changeLanguage(e)}get currentLanguage(){return a(this,ke).currentLanguage}get naturalBearing(){var e;return(e=a(this,ke).naturalBearing)!=null?e:0}getDistance(e,i){return a(this,ke).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return a(this,ke).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return a(this,ke).toJSONBundle({downloadLanguagePacks:e})}};ke=new WeakMap,p(dg,"MapData");var ug=dg,Od=ug;function Kl(r){let t=g7.get(r);if(!t)throw new Error("MapDataInternal not found");return t}p(Kl,"getMapDataInternal");y();y();y();y();y();y();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var v7="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=";y();y();var b7=!1;function hg(){b7=!0}p(hg,"enableTestMode");function C7(){return b7}p(C7,"isTestMode");var fg=class fg{constructor(t){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new ze);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,C7()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new ze,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new L2({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 ze((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(i=t.backgroundAlpha)!=null?i:1}catch(c){O.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(fg,"Renderer");var Ld=fg;y();y();var S7='"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),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';y();y();y();y();y();function x7(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(x7,"contains");y();function I7(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}p(I7,"intersectPoint");y();function P7(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(P7,"intersects");y();function Ci(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}p(Ci,"appendItems");y();var mg=class mg{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:x7(this,t)}intersects(t){return P7(this,t)}intersectsPoint(t){return I7(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};p(mg,"Rectangle");var He=mg;var In=class In{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 In(new He(t,e,i/2,o/2),this),this.topRight=new In(new He(t+i/2,e,i/2,o/2),this),this.bottomLeft=new In(new He(t,e+o/2,i/2,o/2),this),this.bottomRight=new In(new He(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&&(Ci(e,this.topLeft.queryRect(t)),Ci(e,this.topRight.queryRect(t)),Ci(e,this.bottomLeft.queryRect(t)),Ci(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(Ci(e,this.topLeft.queryPoint(t)),Ci(e,this.topRight.queryPoint(t)),Ci(e,this.bottomLeft.queryPoint(t)),Ci(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(In,"QuadTree");var Nr=In;y();function T7(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(T7,"throttle");var Pn=!1,yM=150,yg=class yg extends J{constructor(e,i,o=new Worker(URL.createObjectURL(new Blob([S7],{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 Nr(new He(0,0,0,0)));d(this,"interactiveCollidersQTree",new Nr(new He(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",p(()=>{Pn=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",p(()=>{Pn=!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=!0)=>{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;Pn&&(this.visibleCollidersQTree=new Nr(new He(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Nr(new He(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 He(n.x,n.y,n.w,n.h,{entityId:u.id}),Pn&&this.visibleCollidersQTree.insert(c),s=this.coreState.geometry2DMap.get(u.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new He(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)))}Pn&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",p(()=>{Pn&&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=T7(this._postMessage,yM,!1),Pn?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(yg,"CollisionSystem");var Ad=yg;y();y();y();y();var vg=class vg{constructor(t){d(this,"type");d(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};p(vg,"Tap");var Fd=vg,bg=class bg{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(bg,"TapsController");var Bd=bg;y();function D7(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 Ie&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}p(D7,"getUniqueIntersectedGroupContainers");function E7(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(E7,"arraysEqual");var is,Cg=class Cg extends J{constructor(e,i,o,n,s){super();d(this,"raycaster",new wr);d(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});d(this,"coreState");d(this,"camera");d(this,"cameraPlane");d(this,"_quadtree",new Nr(new He(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);x(this,is,void 0);d(this,"onPointerMoveRaf",p(e=>{this.lastPointerEvent=e,a(this,is)&&cancelAnimationFrame(a(this,is)),T(this,is,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 Bd);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 Fd(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");d(this,"resize",p(()=>{let{top:e,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[e,i]},"resize"));this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=e,this.coreState=i,this.cameraPlane=n,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}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=bM(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.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}return this.cachedHitBoxes}intersect(e){var b,C,w;let i=[e.offsetX,e.offsetY],o=this._quadtree.queryPoint(i),[n]=o.filter(M=>M.intersectsPoint(i)),s=this.state.containerOffset[0],c=this.state.containerOffset[1];this.ndcPoint.x=(e.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-s)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[l]=this.getMouseRayIntersects(),u=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(M=>M.object.visible),[h]=u,m=(b=h==null?void 0:h.instanceId)!=null?b:h==null?void 0:h.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(M=>M.object.visible),v;g!=null&&g.length>0&&(v=D7(g));let I=m!=null?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[m]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId),S;return I||(S=SM(h==null?void 0:h.object,this.coreState.geometry3DMap)),{entity2D:((C=n==null?void 0:n.userData)==null?void 0:C.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(n==null?void 0:n.userData.entityId),entity3D:I!=null?I:S,position:(w=h==null?void 0:h.point)!=null?w:l==null?void 0:l.point,groupContainers:v}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&L7(this.state.lastHover,!1,this.coreState),e&&L7(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!E7(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.cameraPlane],!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}};is=new WeakMap,p(Cg,"InteractionSystem");var ec=Cg;function L7(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(L7,"updateHover");function bM(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}p(bM,"processCursor");function CM(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof Wi)return;if(t.userData.isSingleModel)return t;t=t.parent}}p(CM,"findModelParent");function SM(r,t){let e=CM(r);return e?t.get(e.userData.entityId):void 0}p(SM,"findModelParentEntity");y();y();var Mn,Gr,kd,_d,A7,rc,Rd,Nd,F7,Gd,B7,ic,Vd,oc,nc,jd,xg=class xg{constructor(t){x(this,_d);x(this,Nd);x(this,Gd);x(this,Mn,null);x(this,Gr,void 0);d(this,"getCurrentSceneGLTF",p(async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await V(this,_d,A7).call(this),o=a(this,kd).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"));x(this,kd,p(t=>{let{scale:e,light:i,onlyVisible:o}=t,n=new Wi,s=new wt().setFromObject(a(this,Gr).entityScene);if(a(this,rc).call(this,a(this,Gr).entityScene,n,o),i){let c=new du(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"));x(this,rc,p((t,e,i)=>{t.material&&(t instanceof cu?V(this,Nd,F7).call(this,t).forEach(o=>e.add(o)):t instanceof Cf&&e.add(V(this,Gd,B7).call(this,t))),t.children.forEach(o=>{(!i||o.visible)&&a(this,rc).call(this,o,e,i)})},"#processObject3D"));x(this,Rd,p((t,e,i)=>{let o=new T2({color:new ze(t),metalness:0});return o.opacity=e,o.transparent=i,o},"#createStandardMaterial"));x(this,ic,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,Vd).call(this,l,u),a(this,nc).call(this,o,c,n,s),h&&a(this,jd).call(this,h),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=Zo),t},"#convertGeometry"));x(this,Vd,p((t,e)=>{let i=new W,o=new W;for(let n=0;n<t.count;n++)i.fromBufferAttribute(t,n),a(this,oc).call(this,i),t.setXYZ(n,i.x,i.y,i.z),e&&(o.fromBufferAttribute(e,n),a(this,oc).call(this,o),e.setXYZ(n,o.x,o.y,o.z))},"#convertAttributes"));x(this,oc,p(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));x(this,nc,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 la)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"));x(this,jd,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"));T(this,Gr,t),a(this,Gr).entityScene=t.entityScene,a(this,Gr).geometry3DMap=t.geometry3DMap}destroy(){T(this,Mn,null)}};Mn=new WeakMap,Gr=new WeakMap,kd=new WeakMap,_d=new WeakSet,A7=p(async function(){if(!a(this,Mn)){let{GLTFExporter:t}=await import("./GLTFExporter-3DPEZKOC.js");T(this,Mn,new t)}return a(this,Mn)},"#getGLTFExporter"),rc=new WeakMap,Rd=new WeakMap,Nd=new WeakSet,F7=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,Gr).geometry3DMap.get(l)),n=new Map;return o.forEach(l=>{var v;if(!l||!(l instanceof Ae))return;let u=l.components[1],h=l.components[2];if(!u.visible||u instanceof Dr&&u.opacity===0||u instanceof gu||u instanceof vu)return;let m=h!=null&&h.hover?u.hoverColor||a(this,Gr).hoverColor:u.color,g="".concat(m,"-").concat(u.opacity,"-").concat(Number(u.visible));n.has(g)||n.set(g,[]),(v=n.get(g))==null||v.push(l)}),n.forEach((l,u)=>{let[h,m,g]=u.split("-"),v=l.reduce((C,w)=>{if(w.type==="custom-geometry")return C;let M=w.components[0];return"geometry"in M&&M.geometry instanceof C2&&C.push(M.geometry),C},[]),I=a(this,Rd).call(this,h,Number(m),t.material.transparent),S=Ji(v,!0),b=new le(S,I);b.position.copy(t.position),b.rotation.copy(t.rotation),b.scale.copy(t.scale),b.visible=!!g,a(this,nc).call(this,b.position,b.scale,b.rotation,b.quaternion),e.push(a(this,ic).call(this,b))}),e},"#processBatchedMesh"),Gd=new WeakSet,B7=p(function(t){let e=t.geometry.clone(),i=t.material,o=new Ht({color:i.color,side:Zo});o.opacity=i.opacity,o.transparent=i.transparent;let n=new Cf(e,o);return n.position.copy(t.position),n.rotation.copy(t.rotation),n.scale.copy(t.scale),n.visible=t.visible,a(this,ic).call(this,n)},"#processLineSegments"),ic=new WeakMap,Vd=new WeakMap,oc=new WeakMap,nc=new WeakMap,jd=new WeakMap,p(xg,"ExporterSystem");var tc=xg;y();y();y();var Mg=ru(W7());function X7(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}p(X7,"JSClipperError");X7.prototype=Error.prototype;Mg.default.Error=function(r){throw new X7(r)};var We=Mg.default;var fw="gray",mw=.1,lc=100,Tg=new We.ClipperOffset;function yw(r,t){Tg.Clear(),t/=2;let e=r.map(o=>({X:o.x*lc,Y:o.y*lc}));Tg.AddPath(e,We.JoinType.jtMiter,We.EndType.etClosedPolygon);let i=new We.Paths;return Tg.Execute(i,t*lc),i.length?i[0].map(n=>({x:n.X/lc,y:n.Y/lc})):r}p(yw,"offset");function Yd(r,t,e){var I,S;let{color:i=fw,opacity:o=1,altitude:n=0,height:s=mw}=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}},l=new Mr,h=r.geometry.coordinates[0].map(b=>{let C=t(b[1],b[0]);return c.min.x=Math.min(c.min.x,C.x),c.min.y=Math.min(c.min.y,C.y),c.max.x=Math.max(c.max.x,C.x),c.max.y=Math.max(c.max.y,C.y),C});((S=(I=r.properties)==null?void 0:I.style)==null?void 0:S.edgeOffset)!=null&&r.properties.style.edgeOffset!==0&&(h=yw(h,r.properties.style.edgeOffset)),l.moveTo(h[0].x,h[0].y),h.slice(1).forEach(b=>l.lineTo(b.x,b.y)),l.lineTo(h[0].x,h[0].y);let m=r.geometry.coordinates.slice(1);l.holes=m.map(b=>{let C=b.map(M=>t(M[1],M[0])),w=new Xi;return w.moveTo(C[0].x,C[0].y),C.slice(1).forEach(M=>w.lineTo(M.x,M.y)),w.lineTo(C[0].x,C[0].y),w});let g={bevelEnabled:!1,depth:s},v=new Tr(l,g);return v.userData={style:{color:i,opacity:o}},v}p(Yd,"renderPolygonGeometry");y();var gw="gray",vw=.1;function Zd(r,t,e){let{color:i=gw,opacity:o=1,altitude:n=0,height:s=vw}=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(m=>{let g=new Mr,v=m[0].map(b=>{let C=t(b[1],b[0]);return c.min.x=Math.min(c.min.x,C.x),c.min.y=Math.min(c.min.y,C.y),c.max.x=Math.max(c.max.x,C.x),c.max.y=Math.max(c.max.y,C.y),C});g.moveTo(v[0].x,v[0].y),v.slice(1).forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(v[0].x,v[0].y);let I=m.slice(1);g.holes=I.map(b=>{let C=b.map(M=>t(M[1],M[0])),w=new Xi;return w.moveTo(C[0].x,C[0].y),C.slice(1).forEach(M=>w.lineTo(M.x,M.y)),w.lineTo(C[0].x,C[0].y),w});let S=new Tr(g,l);u.push(S)});let h=Ji(u);return h.translate(0,0,n||0),h.userData={style:{color:i,opacity:o}},h}p(Zd,"renderMultiPolygonGeometry");y();var bw="gray",wg=new We.ClipperOffset,yt=100;function Y7(r,t,e){let{color:i=bw,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 b=t(r.geometry.coordinates[S][1],r.geometry.coordinates[S][0]),C=t(r.geometry.coordinates[S+1][1],r.geometry.coordinates[S+1][0]);h.push([b,C])}wg.AddPaths(h.map(S=>S.map(b=>({X:b.x*yt,Y:b.y*yt}))),s==="round"?We.JoinType.jsRound:s==="miter"?We.JoinType.jsMiter:We.JoinType.jsSquare,c==="round"?We.EndType.etOpenRound:c==="butt"?We.EndType.etOpenButt:We.EndType.etOpenSquare);let m=new We.PolyTree;wg.Execute(m,n/2*yt);let g=[],v={bevelEnabled:!1,depth:l};for(let S of m.m_AllPolys){let b=new Mr;if(S.IsHole())continue;let C=S.m_polygon;b.moveTo(C[0].X/yt,C[0].Y/yt),C.slice(1).forEach(w=>b.lineTo(w.X/yt,w.Y/yt)),b.lineTo(C[0].X/yt,C[0].Y/yt),b.holes=S.m_Childs.map(w=>{let M=new Xi,D=w.m_polygon;return M.moveTo(D[0].X/yt,D[0].Y/yt),D.slice(1).forEach(E=>M.lineTo(E.X/yt,E.Y/yt)),M.lineTo(D[0].X/yt,D[0].Y/yt),M}),g.push(new Tr(b,v))}let I=Ji(g);return I.translate(0,0,u||0),I.userData={style:{color:i,opacity:o}},wg.Clear(),I}p(Y7,"renderLineStringGeometry");y();var gt=100,Cw=.22,Sw=.01;function Z7(r,t,e={}){let{width:i=Cw,height:o=Sw,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 We.ClipperOffset,m=r.geometry.coordinates.map(S=>S.map(b=>t(b[1],b[0])));h.AddPaths(m.map(S=>S.map(b=>({X:b.x*gt,Y:b.y*gt}))),We.JoinType.jsMiter,We.EndType.etOpenRound);let g=new We.PolyTree;h.Execute(g,i/2*gt);let v=[];for(let S of g.m_AllPolys){let b=new Mr;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 C=S.m_polygon;b.moveTo(C[0].X/gt,C[0].Y/gt),C.slice(1).forEach(w=>b.lineTo(w.X/gt,w.Y/gt)),b.lineTo(C[0].X/gt,C[0].Y/gt),b.holes=S.m_Childs.map(w=>{let M=new Xi,D=w.m_polygon;return M.moveTo(D[0].X/gt,D[0].Y/gt),D.slice(1).forEach(E=>M.lineTo(E.X/gt,E.Y/gt)),M.lineTo(D[0].X/gt,D[0].Y/gt),M}),v.push(new Tr(b,u))}let I=Ji(v);return I.translate(0,0,c||0),I.userData={style:{color:n,opacity:s}},h.Clear(),I}p(Z7,"renderMultiLineStringGeometry");y();y();var as=R.object({type:R.enum(["Point"]),coordinates:R.array(R.number()).length(2)});var xw=R.object({rotation:R.array(R.number()).length(3).optional(),altitude:R.number().optional(),scale:R.array(R.number()).length(3).optional(),interactive:R.boolean().optional(),verticalOffset:R.number().optional(),id:R.union([R.number(),R.string()]).optional()}),Iw=R.object({type:R.enum(["Feature"]),geometry:as,properties:xw}),Pw=R.object({type:R.enum(["FeatureCollection"]),features:R.array(Iw)}),Mw=R.object({color:R.string()}),Tw=R.object({url:R.string(),color:R.string().optional(),opacity:R.number().optional(),material:R.record(R.string(),Mw).optional()});function z7(r,t,e){R.union([R.number(),R.string()]).parse(r),Pw.parse(t),Tw.parse(e)}p(z7,"validateModelGroup");var cc,pc,Dg=class Dg{constructor(t){d(this,"mesh");d(this,"type","model");d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new ze);d(this,"position",new W);x(this,cc,0);x(this,pc,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return a(this,cc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,T(this,cc,t))}get opacity(){return a(this,pc)}set opacity(t){var e,i,o;if(this.mesh){if(this.mesh.children[0]instanceof pa){for(let n of this.mesh.children)if(n instanceof pa){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let s=zi(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 le&&n.material&&(Array.isArray(n.material)?n.material.forEach(s=>{s.opacity=t}):n.material.opacity=t)});T(this,pc,t)}}};cc=new WeakMap,pc=new WeakMap,p(Dg,"ModelComponent");var bo=Dg;y();function zd(r){var n;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 s=ww(o,i);(n=t.mesh)==null||n.traverse(c=>{c instanceof le&&c.material&&(Array.isArray(c.material)?c.material.forEach(l=>{s[l.name]&&l.color.set(s[l.name].color)}):s[c.material.name]&&c.material.color.set(s[c.material.name].color))})}t.altitude!==e.verticalOffset&&(t.altitude=e.verticalOffset),e.visible!==t.visible&&(t.visible=e.visible)}p(zd,"applyModelGeometryStyle");function ww(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(ww,"consolidateColorAndMaterial");function Dw(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(Dw,"generateIndex");var Ew=1e4,Eg=class Eg extends J{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-FNDPGHTV.js");return this.loader=new e,this.loader}createEntityFromFeature(e,i,o){let n=new dt(i),s=new Ae(n,new Dr(o));return s.id=e,s}createModelFromFeature(e,i,o){let n=new bo(i),s=o;i.properties.verticalOffset!=null&&(s={...o,verticalOffset:i.properties.verticalOffset});let c=new Ae(n,new vu(s));return c.id=e,c}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 sa,s=new la,c=new v2,l=new W,u=new Zi,h=await this.getGLTFLoader(),m=new Promise(g=>{h.load(i,v=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?v.scene.traverse(I=>{let S=I;if("isMesh"in S&&S.isMesh===!0){let b=new pa(S.geometry,S.material,e.size);b.userData={entities:{}},u.add(b),o.add(u)}}):(v.scene.traverse(I=>{"isMesh"in I&&I.isMesh===!0&&(I.position.set(0,0,0),I.rotation.set(0,0,0),I.scale.set(1,1,1),I.updateMatrix())}),u.add(v.scene),o.add(u),u.userData.isSingleModel=!0,u.userData.entityId=e.values().next().value,u.userData.type="model")),g()})});return this.optimizePromise.push(m.then(()=>{var I,S,b,C,w,M;let g=0,v;for(let D of e.values()){if(v=this.state.geometry3DMap.get(D),!v||(v==null?void 0:v.type)!=="model")continue;let E=v.components[0],F=v.components[0].feature;E.mesh=u,E.instanceIndex=g,zd(v),v.components[1].dirty=!1;let{x:B,y:G}=this.convertTo3DMapPosition(F.geometry.coordinates[1],F.geometry.coordinates[0],0);E.position.set(B,G,E.altitude),s.set(((I=F.properties.rotation)==null?void 0:I[0])||0,((S=F.properties.rotation)==null?void 0:S[1])||0,((b=F.properties.rotation)==null?void 0:b[2])||0),l.set(((C=F.properties.scale)==null?void 0:C[0])||1,((w=F.properties.scale)==null?void 0:w[1])||1,((M=F.properties.scale)==null?void 0:M[2])||1),c.setFromEuler(s),n.compose(E.position,c,l),u.children.forEach(N=>{!v||(v==null?void 0:v.type)!=="model"||!(N instanceof pa)||(N.setMatrixAt(g,n),N.userData.entities[g]=v.id)}),E.mesh.userData.isSingleModel&&(E.mesh.matrix.copy(n),E.mesh.matrix.decompose(E.mesh.position,E.mesh.quaternion,E.mesh.scale)),g++}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 dt&&(o=s.components[0].feature,n=s.components[1],o.geometry.type==="Polygon"?(i=Yd(o,this.convertTo3DMapPosition,n),(c=o.properties)!=null&&c.textures&&o.properties.textures.length>0&&xv(i,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(s,i)):o.geometry.type==="MultiPolygon"?(i=Zd(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="LineString"?(i=Y7(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiLineString"&&(i=Z7(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof rr||e instanceof Ie)){for(let s of e.children)this.optimize(s);if(e instanceof Ie||e.userData.dirty===!1)return;let o={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(s){O.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>=Ew&&(s=0,n++);let m=Dw(h)+n;o[m]===void 0&&(o[m]={style:h,entities:[]}),o[m].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=Cv(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)}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};p(Eg,"MeshCreationAndOptimizationSystem");var qd=Eg;y();var Og=class Og{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 Yi&&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(Og,"DOMVisibilitySystem");var $d=Og;y();var Lg=class Lg{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 Ae&&(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(Lg,"TwoDProjectionSystem");var Jd=Lg;y();y();var Ow=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")(),q7=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}=Ow(i);l.font=c;let u=[],h=r.split(" "),m=0,g=0,v=0;for(;g<h.length;){let C=h[g];if(m===o&&m>0){u[m-1]+="...";break}if(u[m]==null&&(u[m]=C,g++),h.length===1){u[m]=C;break}if(h[g]==null)break;let{width:w}=l.measureText(u[m]+" "+h[g]);w<=e*i?(u[m]+=" "+h[g],g++):m++}u.forEach(C=>{let{width:w}=l.measureText(C);v=Math.max(w,v)});let I=t*i*n,S=u.length*I;return{maxWidth:v,maxHeight:S,lines:u.length,draw:(C,w,M)=>{u.length===1?(s.strokeText&&C.strokeText(u[0],w,M),C.fillText(u[0],w,M)):(s.strokeText&&(C.strokeText(u[0],w,M-I/2),C.strokeText(u[1],w,M+I/2)),C.fillText(u[0],w,M-I/2),C.fillText(u[1],w,M+I/2))}}},"shaveText");y();function $7(r){let t=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}p($7,"createImage");var Lw=3.5,Aw=2.5,Fw=2,Bw=5,uc=2.5;var Ag=class Ag extends J{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,i,o)=>{let n=(e-i)/(o-i),s=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let c,l,u,h,m,g;for(let v of this.state.geometry2DIdsInScene)if(g=this.state.geometry2DMap.get(v),g!=null&&(m=g.components[0],m instanceof qi&&!g.disposed)){if(l=m.appearance.marker.foregroundColor,u=m.appearance.marker.backgroundColor,h=m.markerSize,c="".concat(l.active,"-").concat(l.inactive,"-").concat(u.active,"-").concat(u.inactive,"-").concat(h),this.pinCache[c]||this.prepare(m,c,this.colliderContext),m.appearance.marker.icon&&(!m.imageHash||m.dirty)&&this.cacheImage(m),this.textCache[m.id]==null||m.dirty||this.dirty){m.dirty=!1,m.collisionDirty=!0,this.textCache[m.id]={};let{textDrawFn:I,width:S,height:b}=this.processText(m.text,m.appearance.text.size,m.appearance.text.maxWidth,m.appearance.text.numLines,m.appearance.text.lineHeight);["left","center","right"].forEach(w=>{this.textCache[m.id][w]=this.textToCanvas(I,m.appearance.text.size,w,S,b,m.appearance.text.foregroundColor,m.appearance.text.backgroundColor)}),m.dimensions={width:Math.ceil(S/s),height:Math.ceil(b/s)},m.currentStrategyIndex===-1&&(m.currentStrategyIndex=0);let C=m.strategies[m.currentStrategyIndex];if(C){C.onStrategySelected(m);let w=m.style;m.style=m.newStyle,m.newStyle=w}}m.canShow&&m.visible&&(m.enabled||m.visibilityNeedsUpdate!==!1)&&(m.zoomProportion=n,this.draw(m,c,this.colliderContext))}this.dirty=!1},"update"));d(this,"processText",p((e,i,o,n,s)=>{let c=this.state.pixelRatio,{draw:l,maxWidth:u,maxHeight:h}=q7({text:e,size:i,pixelRatio:c,maxWidth:o,maxLines:n,lineHeight:s});return{textDrawFn:l,width:u+uc*c*2,height:h+uc*c*2}},"processText"));d(this,"textToCanvas",p((e,i,o,n,s,c,l)=>{let u=this.state.pixelRatio,h,m=n,g=s;window.OffscreenCanvas!=null&&!N2()?h=new OffscreenCanvas(m,g):(h=document.createElement("canvas"),h.width=m,h.height=g,h.style.width=m+"px",h.style.height=g+"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=uc*u,v.fillStyle=c,v.strokeStyle=l;let I=o==="left"?0:o==="center"?m/2:m-uc*u/2;return e(v,I,(g+uc*u/2)/2),h},"textToCanvas"));d(this,"cacheImage",p(e=>{if(!e.appearance.marker.icon)return;let i=U2(e.appearance.marker.icon);e.imageHash=i,this.imagePromiseCache[i]||(this.imagePromiseCache[i]=new Promise(o=>{this.transformRequest(e.appearance.marker.icon).then(n=>{let s=$7(n.url);s.onload=()=>{this.imageCache[i]=s,this.publish("img:loaded"),o(s)}})}))},"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=Fw*c,u.shadowBlur=Bw*c,u.beginPath(),u.arc(l/2,l/2,i/2+Aw*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:Lw*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){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 u=this.imageCache[e.imageHash],h=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*n,m=e.appearance.marker.iconFit,g=h,v=h,I="".concat(e.imageHash,"_").concat(m);if(this.imageDimensionsCache[I])g=this.imageDimensionsCache[I].width,v=this.imageDimensionsCache[I].height;else{let S=u.width*n,b=u.height*n;if(m==="contain"){let C=Math.sqrt(S**2+b**2),w=h/C;g=S*w,v=b*w}if(m==="cover"){let C=h/S,w=h/b,M=Math.max(C,w);g=S*M,v=b*M}}o.save(),o.beginPath(),o.arc(s,c,h/2,0,2*Math.PI),o.closePath(),o.clip(),o.drawImage(u,s-g/2,c-v/2,g,v),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(Ag,"TwoDDrawSystem");var Qd=Ag;y();y();var Co=class Co{constructor(){d(this,"loader");this.loader=new ua}static getInstance(){return Co.instance||(Co.instance=new Co),Co.instance}getLoader(){return this.loader}load(t){return new Promise((e,i)=>{this.loader.load(t,e,void 0,i)})}};p(Co,"TextureLoaderSingleton"),d(Co,"instance");var Fg=Co,So=Fg.getInstance();function _w(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(_w,"processColor");var En,dc,Bg=class Bg extends J{constructor(e){super();x(this,En);d(this,"state");d(this,"textureLoadingCache",new Map);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!==""&&V(this,En,dc).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&V(this,En,dc).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?V(this,En,dc).call(this,s.path,e,"topTexture"):s.face==="side"&&e.texture!==s.path&&V(this,En,dc).call(this,s.path,e,"texture");(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,m,g,v;let e,i,o;for(let I of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(I),o instanceof rr&&o.type==="geometry-group"){let S=o.components[0];if(o.userData.shadingDirty){let b=o.userData.entities3D.values().next().value;if(b==null)continue;let C=this.state.geometry3DMap.get(b);C instanceof Ae&&(C.type==="geometry"||C.type==="custom-geometry")&&(e=C.components[0],o.userData.shadingDirty&&S.shading&&this.setShading(e,S.shading));let w,M;for(let D of o.userData.entities3D.values())w=this.state.geometry3DMap.get(D),M=w.components[0],w.type==="geometry"&&M.detached&&o.userData.shadingDirty&&S.shading&&this.setShading(M,S.shading);o.userData.shadingDirty=!1}if(S.dirty){let b=B2(o);b&&b.material instanceof I2&&(b.material.color.set(Sv(S.color)),b.material.needsUpdate=!0);let C=o.getfirstChildEntityId();if(C){let w=this.state.geometry3DMap.get(C),M=w==null?void 0:w.components[0];M instanceof dt&&this.processTextures(M,S)}S.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 S=o.components[0],b=o.components[1];i=o.components[2];let C=_w(o,this.state.hoverColor);if(S.setColor(C[0],C[1]),b.visible!==S.visible&&(S.visible=b.visible,S instanceof dt&&S.textMesh)){let w=this.state.geometry3DMap.get(S.textMesh.userData.entityId);(w==null?void 0:w.type)==="text3d"&&(w.components[0].visible=b.visible)}b.altitude!==S.altitude&&(S.altitude=b.altitude),b.opacity!==S.opacity&&(S.opacity=b.opacity),b.renderOrder!==S.renderOrder&&(S.renderOrder=b.renderOrder),b.dirty=!1,S instanceof dt&&this.processTextures(S,b,i),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model"&&((c=o.components[1])!=null&&c.dirty))zd(o),o.components[1].dirty=!1;else if((o==null?void 0:o.type)==="image"&&((l=o.components[1])!=null&&l.dirty)){e=o.components[0];let S=o.components[1];S.visible!==e.visible&&(e.visible=S.visible),S.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((u=o.components[1])!=null&&u.dirty)){e=o.components[0];let S=o.components[1];S.visible!=null&&S.visible!==e.visible&&(e.visible=S.visible);let{textMesh:b}=e;if(b){Object.assign(b,S.getState());let C=(h=S.hoverColor)!=null?h:this.state.text3dHoverColor;b.color=S.hoverByPolygon?C:(m=S.color)!=null?m:ha.color,b.outlineColor=S.hoverByPolygon?C:(g=S.outlineColor)!=null?g:ha.outlineColor,b.strokeColor=S.hoverByPolygon?C:(v=S.strokeColor)!=null?v:ha.strokeColor}S.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};En=new WeakSet,dc=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)=>{So.getLoader().load(e,l=>{o==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{O.error("Failed to load texture: ".concat(e)),c("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,n)}},"#loadTexture"),p(Bg,"DrawSystem");var Kd=Bg;y();var kg=class kg extends J{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 qi&&(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=zi(c,0,1,o,n,n===0?W2:X2),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(kg,"TwoDVisibilitySystem");var eh=kg;y();var _g=class _g extends J{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,"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.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"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.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),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(),j2(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(),V2(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();return 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.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.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,this.systems.cameraSystem.rotationDirty)}),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){O.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)}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(_g,"RenderSystem");var th=_g;y();var Rw=R.object({interactive:R.boolean().optional(),id:R.string().optional(),nearRadius:R.number().optional(),farRadius:R.number().optional(),accentColor:R.string().optional(),displayArrowsOnPath:R.boolean().optional(),animateArrowsOnPath:R.boolean().optional()}),Nw=R.object({type:R.enum(["Feature"]),geometry:as,properties:R.object({parentId:R.any().optional()})});function J7(r,t){R.object({features:R.array(Nw)}).parse(r),Rw.parse(t)}p(J7,"validatePath");var hc,Rg=class Rg{constructor(t,e){d(this,"type","path");d(this,"mesh",new Zi);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,"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 W);x(this,hc,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.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,hc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,T(this,hc,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};hc=new WeakMap,p(Rg,"PathComponent");var xo=Rg;y();var Ng=class Ng{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 Ie&&t.components[0]){let i=t.components[0];if(i.dirty){for(let o of t.children)(o instanceof rr||o instanceof Ie)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));i.dirty=!1}}}};p(Ng,"StackSystem");var rh=Ng;y();y();y();var De=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut: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)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut: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)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut: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)}}),Bounce:Object.freeze({In:function(r){return 1-De.Bounce.Out(1-r)},Out: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},InOut:function(r){return r<.5?De.Bounce.In(r*2)*.5:De.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),fc=p(function(){return performance.now()},"now"),Vg=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=fc()),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}(),ss={Linear:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=ss.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)},Bezier:function(r,t){for(var e=0,i=r.length-1,o=Math.pow,n=ss.Utils.Bernstein,s=0;s<=i;s++)e+=o(1-t,i-s)*o(t,s)*r[s]*n(i,s);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=ss.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)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=ss.Utils.Factorial;return e(r)/e(t)/e(r-t)},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: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}}},Q7=function(){function r(){}return p(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),Gg=new Vg,Lt=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=De.Linear.None,this._interpolationFunction=ss.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Q7.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=Gg,Gg.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=fc()),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 m=i[s];if(m.length===0)continue;for(var g=[c],v=0,I=m.length;v<I;v+=1){var S=this._handleRelativeValue(c,m[v]);if(isNaN(S)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(S)}h&&(i[s]=g)}if((u==="object"||l)&&c&&!h){e[s]=l?[]:{};var b=c;for(var C in b)e[s][C]=b[C];o[s]=l?[]:{};var m=i[s];if(!this._isDynamic){var w={};for(var C in m)w[C]=m[C];i[s]=m=w}this._setupProperties(b,e[s],m,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=fc()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=fc()),!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=De.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=ss.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=fc()),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),b=s-S*c,C=Math.min(b/i._duration,1);return C===0&&s===i._duration?1:C},"calculateElapsedPortion"),h=u(),m=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((s-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=g);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*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,I=this._chainedTweens.length;v<I;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 cU=Q7.nextId,Vr=Gg,pU=Vr.getAll.bind(Vr),uU=Vr.removeAll.bind(Vr),dU=Vr.add.bind(Vr),hU=Vr.remove.bind(Vr),fU=Vr.update.bind(Vr);y();y();y();var K7=p((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),eS=p((r,t)=>new ee(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),jg=p((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),mc=p((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),Hg=p((r,t)=>new ee((r.x+t.x)/2,(r.y+t.y)/2),"average"),Ug=p(r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t},"getScrollDelta");var Wg=class Wg{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=jg(t,e),this.lastDistance=mc(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=mc(t,e);this.input1=t,this.input2=e;let o=jg(t,e);this.lastAngle=o,this.lastDistance=i,this.totalDistance+=(mc(this.first,t)+mc(this.second,e))/2,this.first=Hg(this.first,t),this.second=Hg(this.second,e)}};p(Wg,"InputSet");var ih=Wg;y();var Xg=class Xg{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 wr,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(Xg,"TouchAnchor");var yc=Xg;var hr={};e2(hr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Vw,CLIPPING_RADIUS:()=>gc,CONTROL_OPTIONS:()=>Gw,DEFAULT_BEARING:()=>Xw,DEFAULT_MAX_ZOOM_LEVEL:()=>Uw,DEFAULT_MIN_ZOOM_LEVEL:()=>$g,DEFAULT_PITCH:()=>Ww,DEFAULT_ZOOM_LEVEL:()=>Hw,EVENTS:()=>sh,MAPLIBRE_TILE_SIZE:()=>oh,MAX_LAT:()=>Zg,MAX_MERCATOR_ZOOM_LEVEL:()=>ah,MIN_LAT:()=>Yg,MIN_MERCATOR_ZOOM_LEVEL:()=>nh,ROOM_MERCATOR_ZOOM_LEVEL:()=>jw,TWO_PI:()=>zg,WHEEL_ZOOM_MULTIPLIER:()=>qg,ZRANGE:()=>ls});y();var oh=512,Yg=-85.051129,Zg=85.051129,gc=1e4,Gw={chain:"chain",cancel:"cancel"},zg=Math.PI*2,ls=100,qg=1e4,nh=0,ah=24,Vw=17,jw=20,sh=["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"],Hw=18,$g=12,Uw=22,Ww=0,Xw=0;var lh=!1,Yw=!1;var ch,ph=class ph extends J{constructor(e,i,o,n,s){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);d(this,"rotationDirty",!1);x(this,ch,$g);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 W(1/0,1/0),max:new W(-1/0,-1/0),center:new W(0,0,0),radius:1/0});d(this,"minTilt",0);d(this,"maxTilt",1.2);d(this,"MOUSE_BUTTONS",{ORBIT:su.RIGHT,ZOOM:su.MIDDLE,PAN:su.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new wr);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 D2(!0));d(this,"coords",{mouse:new ee,rotateStart:new ee,rotateEnd:new ee,rotateDelta:new ee,panStart:new W,panCameraStart:new W,panEnd:new W,panDelta:new W,initialShiftPos:new ee,initialPedestal:0,floorAnchor:new W});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,"raycastToFloor",p(e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new W},"raycastToFloor"));d(this,"isUserInteracting",p(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",p(()=>new W(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,"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={},m=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(u.x=m.x,h.x=e.position.x),e.position.y!==void 0&&(u.y=m.y,h.y=e.position.y),e.position.z!==void 0&&(u.z=m.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:M,end:D}=nu(this.getRotation(),e.rotation);u.rotation=M,h.rotation=D}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 g=u.zoom!==h.zoom,v=u.rotation!==h.rotation,I=u.tilt!==h.tilt,S=new Lt(u).to(h,P.env.TESTING?0:i).onUpdate(M=>{this.setMulti({x:M.x,y:M.y,z:M.z},M.zoom,M.rotation,M.tilt)}).onComplete(()=>{this.completeTween(S),this.publish("multi-end",{zooming:g,rotating:v,tilting:I}),n&&n()}).onStart(()=>{this.state!==7&&(this.state=7,S.state=7,this.publish("multi-start",{zooming:g,rotating:v,tilting:I})),this.publish("change")});this.rendererState.tweenGroup.add(S);let b=Array.from(this.tweens.entries()),C=b[b.length-1],w=!1;return C!=null&&(C[1].interruptible?(typeof C[1].cancelledCallback=="function"&&C[1].cancelledCallback(),this.completeTween(C[0])):(w=!0,C[0].chain(S))),this.tweens.set(S,{cancelledCallback:s,interruptible:l.interruptible}),o?S.easing(o):S.easing(De.Quadratic.In),!e.doNotAutoStart&&!w&&(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/ls,this.camera.far=i*ls),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%zg);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/ls,this.camera.far=i*ls,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 sh)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=lh?2e3:1e10,i=lh?100:1,o=new ri(e,e,i,i),n=new Ht({color:0,wireframe:lh,visible:lh}),s=new le(o,n);return this.scene.add(s),s},"createCameraPlane"));d(this,"addEventListeners",p(()=>{let{domElement:e}=this.renderer;for(let i of sh)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}},"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 ih(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")},"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 yc(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new yc(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")},"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")},"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-Ug(e)*i/qg*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 la;i.setFromRotationMatrix(e,"ZYX");let o=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),n=i.z,s=new W(0,0,1);s.applyEuler(i),s.setLength(o);let c=new W;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,m=s.x-n.x,g=s.y-n.y,v=Math.atan2(g,m),I=l.x-c.x,S=l.y-c.y,b=Math.atan2(S,I),C=K7(v,b),w=new sa;w.makeRotationZ(-C);let M=w.clone();M.multiply(e.snapHolderMatrix);let D=p((Vx,jx,Hx)=>Vx.elements[(jx-1)*4+Hx-1],"m"),E=D(o,1,1)*D(M,1,1)-u.x*D(o,3,4)*D(M,3,1),F=D(o,1,1)*D(M,1,2)-u.x*D(o,3,4)*D(M,3,2),B=D(o,1,1)*D(M,1,3)-u.x*D(o,3,4)*D(M,3,3),G=n.x*E+n.y*F+n.z*B,N=D(o,2,2)*D(M,2,1)-u.y*D(o,3,4)*D(M,3,1),k=D(o,2,2)*D(M,2,2)-u.y*D(o,3,4)*D(M,3,2),j=D(o,2,2)*D(M,2,3)-u.y*D(o,3,4)*D(M,3,3),U=n.x*N+n.y*k+n.z*j,K=D(o,1,1)*D(M,1,1)-h.x*D(o,3,4)*D(M,3,1),te=D(o,1,1)*D(M,1,2)-h.x*D(o,3,4)*D(M,3,2),fe=D(o,1,1)*D(M,1,3)-h.x*D(o,3,4)*D(M,3,3),Le=s.x*K+s.y*te+s.z*fe,ct=D(o,2,2)*D(M,2,1)-h.y*D(o,3,4)*D(M,3,1),me=D(o,2,2)*D(M,2,2)-h.y*D(o,3,4)*D(M,3,2),we=D(o,2,2)*D(M,2,3)-h.y*D(o,3,4)*D(M,3,3),ye=s.x*ct+s.y*me+s.z*we,pt=Math.abs(K-E),er=Math.abs(te-F),it=Math.abs(fe-B),ut=Math.abs(K-N),ei=Math.abs(te-k),ji=Math.abs(fe-j),ie=Math.abs(ct-E),pe=Math.abs(me-F),ve=Math.abs(we-B),Mt=Math.abs(ct-N),Hi=Math.abs(me-k),Xo=Math.abs(we-j),xr=Math.min(pt+er+it,ut+ei+ji),Ui=Math.min(ie+pe+ve,Mt+Hi+Xo);xr<Ui&&(K=ct,te=me,fe=we,Le=ye);let tl=N*B-E*j,df=k*B-F*j,q0=U*B-G*j,hf=K*j-N*fe,ff=te*j-k*fe,$0=Le*j-U*fe,kx=($0*df-q0*ff)/(hf*df-tl*ff),_x=($0*tl-q0*hf)/(ff*tl-df*hf),J0=k*E-F*N,Rx=j*E-B*N,Nx=U*E-G*N,Q0=te*N-k*K,Gx=fe*N-j*K,K0=((Le*N-U*K)*J0-Nx*Q0)/(Gx*J0-Rx*Q0),tu=M.clone();return tu.elements[12]=kx,tu.elements[13]=_x,tu.elements[14]=K0,K0>0?tu: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=eS(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=Ug(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",$o(()=>{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},"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(ue.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(ue.degToRad(i))*2*Math.PI*mf/n;return ue.clamp(Math.log2(s/512),nh,ah)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",p(e=>{let[,i]=this.center,o=ue.clamp(e,nh,ah),n=Math.pow(2,o),s=ue.clamp(i,Yg,Zg),c=n*512;return Math.cos(ue.degToRad(s))*Math.PI*2*mf/c*this.options.canvasHeight/2/Math.tan(ue.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 nl);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,ch)}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}=fu((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}=mu((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),this.setTilt(i.tilt||u);let m=tS(e,{canvasWidth:s,canvasHeight:c,paddingOption:i.padding,minZoom:o,maxZoom:n,position:h,camera:this.camera,orbit:this.orbit});return this.setRotation(l),this.setTilt(u),{center:m.position,zoomLevel:this.convertAltitudeToZoomLevel(m.zoom)}}focusOn(e,i){Yw&&(this.debugContainer&&qe(this.debugContainer),e.forEach(b=>{let C=new le(new ca(2,2,2),new Ht({color:65280}));C.position.copy(b),this.debugContainer.add(C),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,m;i.duration!==void 0?m=i.duration:P.env.TESTING==="true"?m=0:m=200;let g=i.padding,v=this.getRotation(),I=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let S=tS(e,{canvasHeight:h,paddingOption:g,canvasWidth:u,minZoom:c,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(v),this.setTilt(I),this.animateCamera({position:S.position,tilt:i.tilt,rotation:i.rotation,zoom:S.zoom},m,o,n,s,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};ch=new WeakMap,p(ph,"CameraSystem"),d(ph,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var cs=ph;function tS(r,{canvasWidth:t,orbit:e,paddingOption:i,canvasHeight:o,minZoom:n,maxZoom:s,camera:c,position:l}){let u={zoom:n,position:l};if(r.length===0)return u;for(let Ui of cs.CAMERA_FRAME_PADDING_SIDES)typeof i[Ui]!="number"&&(i[Ui]=0);let h=i.type==="portion"?{top:i.top*o,bottom:i.bottom*o,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(h.left+h.right>=t||h.top+h.bottom>=o)return u;e.updateMatrixWorld();let m=c.matrixWorldInverse,g=c.fov*(Math.PI/180)/2,v=g,S=Math.atan(Math.tan(g)*(t/o)),b=new W(1/0,1/0,1/0),C=new W(-1/0,-1/0,-1/0),w=new wt().setFromPoints(r),M;for(let Ui=0,tl=r.length;Ui<tl;Ui++)M=r[Ui].clone(),M.applyMatrix4(m),b.min(M),C.max(M);let D=C.x-b.x,E=C.y-b.y,F=t-h.left-h.right,B=o-h.top-h.bottom,G=(C.x+b.x)/2,N=(C.y+b.y)/2,k=D/F,j=E/B,U=n,K=s,te=U*Math.tan(S)*2,fe=K*Math.tan(S)*2,Le=te/t,ct=fe/t,me=Math.max(k,j);me=ue.clamp(me,Le,ct);let we=F*me,ye=B*me,pt={min:{x:G-we/2-h.left*me,y:N-ye/2-h.bottom*me},max:{x:G+we/2+h.right*me,y:N+ye/2+h.top*me}},er=(pt.min.x+pt.max.x)/2,it=(pt.min.y+pt.max.y)/2,ut=w.getCenter(new W),ei=Math.abs(er-pt.min.x),ji=Math.abs(it-pt.min.y),ie=ei/Math.tan(S),pe=ji/Math.tan(v),ve=new W;ve.set(er,it,C.z+Math.max(ie,pe)),ve.applyMatrix4(c.matrixWorld);let Mt=new W;Mt.set(er,it,C.z),Mt.applyMatrix4(c.matrixWorld);let Hi=new W().subVectors(Mt,ve),Xo=(ut.z-ve.z)/Hi.z,xr=new W().copy(ve).add(Hi.clone().multiplyScalar(Xo));return Mt.set(xr.x,xr.y,xr.z),ve.sub(Mt),{position:xr,zoom:ve.length()}}p(tS,"getCameraFrameForPoints");y();var Zw=300,vc,bc,Jg=class Jg{constructor(t){d(this,"state");x(this,vc,new W);x(this,bc,new W);this.state=t}update(t){var o;let e,i;this.state.cameraObject.getWorldPosition(a(this,bc));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.canShow===!0&&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,bc).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.animation&&i.animation.cancel(),i.visibilityNeedsUpdate==="show"?(i.containerEl.style.opacity="0",i.canShow=!0):i.canShow=!1,i.animation=i.containerEl.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:Zw,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};vc=new WeakMap,bc=new WeakMap,p(Jg,"DOMDrawSystem");var uh=Jg;y();var Qg=class Qg{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};p(Qg,"StackComponent");var dh=Qg;y();var Kg=class Kg extends J{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 Yi&&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(Kg,"DOMResizeSystem");var hh=Kg;y();var zw=0,qw=90;function Si(r,t,e,i){return(r<t||r>e)&&O.warn(i),Math.min(e,Math.max(t,r))}p(Si,"clampWithWarning");var ps={linear:De.Linear.None,"ease-in":De.Quadratic.In,"ease-out":De.Quadratic.Out,"ease-in-out":De.Quadratic.InOut},$w=-50,X,q,us,Cc,Sc,xc,e1,t1=class t1{constructor(t,e,i,o){x(this,xc);x(this,X,void 0);x(this,q,void 0);x(this,us,void 0);x(this,Cc,void 0);x(this,Sc,void 0);T(this,X,t),T(this,q,e),T(this,us,i),T(this,Cc,o),a(this,q).cameraSystem.on("pedestal-change",({pedestal:n})=>{a(this,X).map&&(a(this,X).map.transform.elevation=n,a(this,X).map.transform.minElevationForCurrentTile=$w,a(this,X).map.triggerRepaint()),a(this,q).cameraSystem.setCameraPlaneElevation(n),a(this,Cc).position.z=n})}get center(){return a(this,X).mode==="outdoors-overlay"&&a(this,X).map?a(this,X).map.getCenter().toArray():a(this,q).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,q).interactionSystem.handleHover();return}a(this,q).cameraSystem.setCenter(t[0],t[1]),a(this,q).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,q).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,q).cameraSystem.setZoomLevel(Si(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,q).cameraSystem.isAnimating}cancelAnimation(){a(this,q).cameraSystem.cancelAnimation()}get maxZoomLevel(){return a(this,q).cameraSystem.maxZoomLevel}get minZoomLevel(){return a(this,q).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){a(this,q).panBoundsSystem.autoMinZoomLevel=t,t&&(a(this,q).panBoundsSystem.dirty=!0,a(this,q).panBoundsSystem.update())}get autoMinZoomLevel(){return a(this,q).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var o;e&&this.setAutoMinZoomLevel(!1);let i=Si(t,hr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(hr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));a(this,q).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(o=a(this,X).map)==null||o.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=Si(t,this.minZoomLevel,hr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(hr.MAX_MERCATOR_ZOOM_LEVEL,"."));a(this,q).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():ue.radToDeg(a(this,q).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():ue.radToDeg(a(this,q).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(zw,t);(i=a(this,X).map)==null||i.setMinPitch(e),a(this,q).cameraSystem.minTilt=ue.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(qw,t);(i=a(this,X).map)==null||i.setMaxPitch(e),a(this,q).cameraSystem.maxTilt=ue.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():ue.radToDeg(a(this,q).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,q).cameraSystem.setRotation(ue.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():ue.radToDeg(a(this,q).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,q).cameraSystem.setTilt(ue.degToRad(Si(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,q).cameraSystem.getPedestal()}setElevation(t){a(this,q).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return a(this,Sc)&&a(this,Sc).stop(),new Promise(i=>{var n;let o=a(this,q).cameraSystem.getPosition();o.z=t,a(this,q).cameraSystem.animateCamera({position:o},(e==null?void 0:e.duration)||300,ps[(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,us).insetsPadding}get panMode(){return a(this,q).cameraSystem.enablePan===!1&&a(this,q).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,q).cameraSystem.enablePan=!0,a(this,q).cameraSystem.enablePedestal=!1):(a(this,q).cameraSystem.enablePan=!1,a(this,q).cameraSystem.enablePedestal=!0))}setInsetPadding(t){a(this,us).insetsPadding=Object.assign({},sl,t)}animateTo(t){var s,c,l,u,h,m;if(a(this,X).mode==="outdoors-overlay"&&a(this,X).map)return(m=a(this,X).map)==null||m.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,q).cameraSystem.convertZoomLevelToAltitude(Si(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?ue.degToRad(t.bearing):void 0,n=t.pitch!==void 0?ue.degToRad(Si(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(g=>{var v;a(this,q).cameraSystem.animateCamera({position:e,zoom:i,rotation:o,tilt:n},t.duration||0,ps[t.easing||"ease-in-out"],()=>{a(this,q).interactionSystem.handleHover(),g()},g,{interruptible:(v=t==null?void 0:t.interruptible)!=null?v:!0})})}getCameraFrameForCoordinates(t,e){let i=V(this,xc,e1).call(this,e||{},()=>Promise.resolve()),{center:o,zoomLevel:n}=a(this,q).cameraSystem.getCameraFrameForCoordinates(t.map(s=>a(this,X).convertTo3DMapPosition(s[1],s[0],s[2]||0)),i);return{center:a(this,X).convert3DMapPositionToCoordinate(o),zoomLevel:n}}focusOn(t,e){var i,o;return t==null||!Array.isArray(t)||t.length<=0?(O.error("focusOn coordinates are invalid:",t),Promise.resolve()):a(this,X).mode==="outdoors-overlay"&&a(this,X).map?(t.length===1?(i=a(this,X).map)==null||i.flyTo({center:t[0],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()}):(o=a(this,X).map)==null||o.fitBounds(t,{duration:e==null?void 0:e.duration,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()}),a(this,q).interactionSystem.handleHover(),Promise.resolve()):new Promise(n=>{a(this,q).cameraSystem.focusOn(t.map(s=>a(this,X).convertTo3DMapPosition(s[1],s[0],s[2]||0)),V(this,xc,e1).call(this,e||{},n))})}};X=new WeakMap,q=new WeakMap,us=new WeakMap,Cc=new WeakMap,Sc=new WeakMap,xc=new WeakSet,e1=p(function(t,e){var i;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:a(this,q).cameraSystem.convertZoomLevelToAltitude(Si(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,q).cameraSystem.convertZoomLevelToAltitude(Si(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({},sl,t==null?void 0:t.padding):this.insetsPadding,curve:ps[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ue.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ue.degToRad(Si(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:()=>{a(this,q).interactionSystem.handleHover(),e()},cancelledCallback:e,interruptible:(i=t==null?void 0:t.interruptible)!=null?i:!0}},"#convertToLegacy"),p(t1,"Camera");var fh=t1;y();var rS="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 iS="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}";y();var oS=4.291666666666667,nS=15,aS=25,sS=43/60;y();var lS=["horizontal","icon"],Kw=new Map([[lS[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>'],[lS[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>']]),eD=/<svg([^>]*)>/g;function cS(r,t,e,i){let o=Kw.get(r);return o?o.replace(eD,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}p(cS,"getLogoIcon");var pS=!1,ge,xi,ds,st,vt,On,fr,jr,r1=class r1 extends J{constructor(e,i,o){super();x(this,ge,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});x(this,xi,void 0);x(this,ds,void 0);x(this,st,void 0);x(this,vt,void 0);x(this,On,void 0);x(this,fr,0);x(this,jr,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,ge).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",p(()=>{var o,n,s,c;let e=a(this,ge).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,ge).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"));T(this,ge,Object.assign({},a(this,ge),o)),T(this,ds,e),T(this,xi,i)}get color(){return a(this,ge).color==="light"?"white":"#293136"}get iconName(){return a(this,ge).iconOnly?"icon":"horizontal"}get minWidth(){return a(this,ge).iconOnly?nS:75}get defaultWidth(){return a(this,ge).iconOnly?aS:150}get aspectRatio(){return a(this,ge).iconOnly?sS:oS}get options(){return{...a(this,ge)}}set options(e){T(this,ge,{padding:e.padding||a(this,ge).padding,position:e.position||a(this,ge).position,iconOnly:e.iconOnly||a(this,ge).iconOnly,color:e.color||a(this,ge).color,scale:e.scale||a(this,ge).scale,onClick:a(this,ge).onClick,visible:e.visible||a(this,ge).visible})}get icon(){return cS(this.iconName,this.color,a(this,fr)*a(this,xi).pixelRatio,a(this,jr)*a(this,xi).pixelRatio)}setSize(e,i){a(this,vt)&&(a(this,vt).uniforms.uSize.value.x=e,a(this,vt).uniforms.uSize.value.y=i)}setXY(e,i){a(this,vt)&&(a(this,vt).uniforms.uSize.value.w=e,a(this,vt).uniforms.uSize.value.z=i)}get width(){return a(this,fr)}get height(){return a(this,jr)}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,ge).position]}insertIntoQuadTree(e){a(this,On)!=null&&typeof a(this,ge).onClick=="function"&&e.insert(a(this,On))}resize(e,i){if(a(this,ge).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(e,i),n=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(a(this,fr),a(this,jr)),c=Math.min(e-a(this,fr),Math.max(0,o.x+n.x+s.x)),l=Math.min(i-a(this,jr),Math.max(0,o.y+n.y+s.y));this.setSize(a(this,fr)/e,a(this,jr)/i),this.setXY(c/e,l/i),T(this,On,new He(c,l,a(this,fr),a(this,jr),{entityId:"watermark"}))}update(){this.dirty&&a(this,ge).visible===!0&&(T(this,fr,Math.min(a(this,xi).canvasWidth,Math.max(this.minWidth,this.defaultWidth*a(this,ge).scale))),T(this,jr,a(this,fr)/this.aspectRatio),So.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(T(this,vt,new qo({uniforms:{uTexture:{value:e},uSize:{value:new y2(0,0,0,0)},uOpacity:{value:.7}},vertexShader:rS,fragmentShader:iS,depthWrite:!1,depthTest:!1,defines:{debug:pS},wireframe:pS,transparent:!0,visible:!0})),a(this,st))a(this,st).material=a(this,vt),a(this,st).material.needsUpdate=!0;else{let i=new ri(2,2,1,1);T(this,st,new le(i,a(this,vt))),a(this,st).position.set(0,0,-1),a(this,st).frustumCulled=!1,a(this,st).renderOrder=999;let o=new ca(1,1,1),n=new le(o,new Ht({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));n.frustumCulled=!1,n.layers.set(1),a(this,st).add(n),a(this,ds).add(a(this,st))}this.resize(a(this,xi).canvasWidth,a(this,xi).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){a(this,st)&&(a(this,ds).remove(a(this,st)),qe(a(this,st))),T(this,st,void 0),a(this,vt)&&a(this,vt).dispose(),T(this,vt,void 0),T(this,On,void 0)}};ge=new WeakMap,xi=new WeakMap,ds=new WeakMap,st=new WeakMap,vt=new WeakMap,On=new WeakMap,fr=new WeakMap,jr=new WeakMap,p(r1,"WatermarkSystem");var mh=r1;y();var yh=100,iD=!1,o1=class o1 extends J{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 wt,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new W(0,0,0),new W(yh*2,yh*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(yh))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let i of this.state.geometry2DMap.values())i.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(i.position),i.positionDirty=!1);let e=i1.copy(this.currentTotalBoundingBox).expandByScalar(yh).getBoundingSphere(oD).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new W),min:i1.min,max:i1.max,radius:e},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,iD&&this.state.entityScene.parent instanceof Wi){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new le(new uu(this.cameraSystem.panBounds.radius),new Ht({color:16711680,transparent:!0,opacity:.2})),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let i=new W;this.currentTotalBoundingBox.getSize(i);let o=new ca(i.x,i.y,i.z),n=new Ht({color:65280,wireframe:!0,transparent:!0,opacity:.5}),s=new le(o,n);s.position.copy(this.currentTotalBoundingBox.getCenter(new W)),this.state.entityScene.parent.add(s)}}}};p(o1,"PanBoundsSystem");var gh=o1,i1=new wt,oD=new b2;y();var uS="\xA9 Mappedin",nD="https://info.mappedin.com/feedback",a1=["top-left","top-right","bottom-left","bottom-right"],aD=640,sD=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"),n1={custom:[],position:"bottom-right",feedback:!0},s1=class s1{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",uS);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=a1.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=n1){var o;let e=t.position&&a1.includes(t.position)?t.position:n1.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=sD(),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:n1.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=nD,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=[uS],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<=aD||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(s1,"HTMLControlsSystem");var vh=s1;y();var Ic,l1=class l1{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 ze);x(this,Ic,0);this.mesh=new Zi,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){O.warn("TODO: implement custom geometry opacity")}get opacity(){return O.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,Ic)}set altitude(t){this.mesh&&(this.mesh.position.z=t,T(this,Ic,t))}get renderOrder(){return O.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){O.warn("TODO: implement custom geometry render order")}};Ic=new WeakMap,p(l1,"CustomGeometryComponent");var hs=l1;y();var c1=class c1{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(c1,"CustomGeometrySystem");var bh=c1;y();y();var p1=class p1 extends le{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};p(p1,"EntityMesh");var Ch=p1,lD=R.object({flipImageToFaceCamera:R.boolean().optional(),url:R.string()}),cD=R.object({type:R.enum(["Feature"]),properties:R.object({width:R.number(),height:R.number(),rotation:R.number().min(0).max(360).optional(),verticalOffset:R.number().optional()}),geometry:as});function dS(r,t,e){R.union([R.number(),R.string()]).parse(r),cD.parse(t),lD.parse(e)}p(dS,"validateImage");var u1=class u1{constructor(t){d(this,"mesh",new Zi);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 W);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(u1,"ImageComponent");var Sh=u1;y();function d1(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(d1,"rotatePoint");function pD(r,t){return r.map(e=>d1(e,t))}p(pD,"rotatePoints");function uD(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(uD,"getBounds");function dD(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(dD,"pointInPolygon");function hS(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(hS,"isValidRectangle");function hD(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(hD,"calculateGridDimensions");function fD(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};dD(l,r)&&(n[s][c]=1)}return n}p(fD,"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)&&hS(r,o,i,s,s);s++)n=s;e[i][o]=n}return e}p(mD,"calculateRectSizes");function yD(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 m=Math.pow(t[u][h],2),g=e.minX+h*o,v=e.minY+u*n;s+=m,c+=g*m,l+=v*m}return{x:c/s,y:l/s}}p(yD,"calculatePolygonCenter");function gD(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 m=0;m<u;m++)for(let g=0;g<u;g++)if(r[m][g]===1)for(let v=1;v<=u-g;v++){let I=v;if(!(I>u-m)&&hS(r,g,m,v,I)){let S=v*I,b=t.minX+(g+v/2)*e,C=t.minY+(m+I/2)*i,w={x:b,y:C},D=Math.sqrt(Math.pow(w.x-o.x,2)+Math.pow(w.y-o.y,2))/h,E=S*(1-n)-D*n*S;E>c&&(c=E,l={center:w,width:v*e*s,height:v*i*s})}}return l}p(gD,"findBestRectangle");function h1(r,t,e,i={}){let{scaleFactor:o=.9,centerPriority:n=.5,resolution:s=100,minimumSizeRatio:c=.5}=i,l=i2(e),u=r.width/r.height,h=pD(t,l),m=uD(h),{dx:g,dy:v,gridBounds:I}=hD(m,u,s),S=fD(h,I,s,g,v),b=mD(S,s),C=yD(S,b,I,s,g,v),w=gD(S,I,g,v,C,n,o);return!w||w.width<r.width*c||w.height<r.height*c?r:{...w,center:d1(w.center,-l),rotation:e,polygonCenter:d1(C,-l)}}p(h1,"findLargestInteriorRectangle");var Pc=Math.PI*2,vD=Math.PI/2,bD=Math.PI*1.5,CD=.01,fS=!1,f1=class f1 extends J{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 I,S,b;let l={width:o.width,height:o.height,center:this.convertTo3DMapPosition(s),rotation:(I=o.rotation)!=null?I:0},u=(S=this.imagePlacementOptions.mode)!=null?S:"default",h=(()=>{switch(u){case"fit-nearest-90":let C=(this.initialBearing-this.naturalBearing+360)%180;return C>=45&&C<=135?h1(l,c,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return h1(l,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if(fS&&h.polygonCenter){let C=new le(new uu(1),new ii({color:65280}));C.position.set(h.polygonCenter.x,h.polygonCenter.y,n),this.rendererState.entityScene.add(C)}let m=new ii({transparent:!0,depthWrite:!1,side:Zo}),g=new ri(h.width,h.height),v=new Ch(g);if(v.visible=!1,(b=this.getOrDownloadImage(i))==null||b.then(C=>{m.map=C,m.needsUpdate=!0,m.map.colorSpace=lu,v.visible=!0,this.publish("image-loaded")}),v.userData.entityId=e,v.material=m,fS){let C=new le(new ri(o.width,o.height),new ii({color:"gray"}));v.add(C);let w=new O2;v.add(w),w.scale.set(10,10,10)}return v.position.set(h.center.x,h.center.y,n+CD),v.rotation.z=(-ue.degToRad(h.rotation)+Pc)%Pc,v}getOrDownloadImage(e){if(this.imageLoadingCache.has(e))return this.imageLoadingCache.get(e);{let i=new Promise(o=>{So.getLoader().load(e,n=>{o(n)})});return this.imageLoadingCache.set(e,i),i}}flipIfNeeded(e,i){if(e.imageMesh==null)return;let o=-i,n=e.imageMesh.rotation.z,s=(n-o+Pc)%Pc;s>vD&&s<bD&&(e.imageMesh.rotation.z=(n+Math.PI)%Pc)}update(e){var s,c,l,u,h;let i,o,n;for(let m of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(m),(i==null?void 0:i.type)==="image"){if(o=i.components[0],n=i.components[1],n.url&&o.imageMesh==null){let g=this.convertTo3DMapPosition(o.feature.geometry.coordinates),v={x:g.x,y:g.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 g=o.feature.geometry.coordinates[0].map(I=>{let S=this.convertTo3DMapPosition(I);return{x:S.x,y:S.y}}),v=this.createImageMesh(m,(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,g);o.mesh.parent.add(v),o.imageMesh=v}o.imageMesh&&(o.visible?n.showImage&&!o.imageMesh.visible?o.imageMesh.visible=!0:!n.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1):o.imageMesh.visible=!1,n.flipImageToFaceCamera&&this.flipIfNeeded(o,e))}}};p(f1,"ImageSystem");var xh=f1;y();var Io,m1=class m1 extends J{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);x(this,Io,void 0);d(this,"update",p((e=!1)=>{e||(a(this,Io)&&cancelAnimationFrame(a(this,Io)),T(this,Io,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 m=u.x/this.state.canvasWidth*2-1,g=-(u.y/this.state.canvasHeight)*2+1,v=new ee(m,g),I=new wr;return I.setFromCamera(v,this.camera),[I,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 dt&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let n=new le(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,Io)&&cancelAnimationFrame(a(this,Io)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Io=new WeakMap,p(m1,"GeometryInFocusSystem");var Ih=m1;y();y();y();y();function Mc(r,t){t===void 0&&(t={});var e=Ua(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return SD(e,t);case"MultiPolygon":return xD(e,t);default:throw new Error("invalid poly")}}p(Mc,"default");function SD(r,t){t===void 0&&(t={});var e=Ua(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{};return mS(i,o)}p(SD,"polygonToLine");function xD(r,t){t===void 0&&(t={});var e=Ua(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{},n=[];return i.forEach(function(s){n.push(mS(s,o))}),Yo(n)}p(xD,"multiPolygonToLine");function mS(r,t){return r.length>1?a2(r,t):ti(r[0],t)}p(mS,"coordsToLine");function ID(r,t){var e=!0;return Pr(r,function(i){Pr(t,function(o){if(e===!1)return!1;e=PD(i.geometry,o.geometry)})}),e}p(ID,"booleanDisjoint");function PD(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!DD(r.coordinates,t.coordinates);case"LineString":return!yS(t,r);case"Polygon":return!vi(r,t)}break;case"LineString":switch(t.type){case"Point":return!yS(r,t);case"LineString":return!MD(r,t);case"Polygon":return!gS(t,r)}break;case"Polygon":switch(t.type){case"Point":return!vi(t,r);case"LineString":return!gS(r,t);case"Polygon":return!TD(t,r)}}return!1}p(PD,"disjoint");function yS(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(wD(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}p(yS,"isPointOnLine");function MD(r,t){var e=ts(r,t);return e.features.length>0}p(MD,"isLineOnLine");function gS(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var o=i[e];if(vi(o,r))return!0}var n=ts(t,Mc(r));return n.features.length>0}p(gS,"isLineInPoly");function TD(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var o=i[e];if(vi(o,t))return!0}for(var n=0,s=t.coordinates[0];n<s.length;n++){var c=s[n];if(vi(c,r))return!0}var l=ts(Mc(r),Mc(t));return l.features.length>0}p(TD,"isPolyInPoly");function wD(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(wD,"isPointOnLineSegment");function DD(r,t){return r[0]===t[0]&&r[1]===t[1]}p(DD,"compareCoords");var vS=ID;function y1(r,t){var e=!1;return Pr(r,function(i){Pr(t,function(o){if(e===!0)return!0;e=!vS(i.geometry,o.geometry)})}),e}p(y1,"booleanIntersects");var g1=class g1{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=au(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(n=s2(o.geometry.coordinates)),!n)continue;for(let s of this.polygons)if(y1(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=au(n.geometry.coordinates);o.push(s)}else n.geometry.type==="MultiPolygon"&&o.push(...n.geometry.coordinates.map(s=>au(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(g1,"OutdoorLayers");var Ph=g1;y();y();y();var v1="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 b1='#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 bS="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 AD=new ua;function CS(r,t,e){let{nearRadius:i,farRadius:o,accentColor:n,completeFraction:s,isVertical:c}=t,{color:l}=e,u=!0,h=0,m=1/0,g=t.displayArrowsOnPath,v=!c,I=!0,S=g,b=i/2+FD,C=0;r[0].z+=b;for(let ie=1;ie<r.length;++ie){r[ie].z+=b;let pe=r[ie].x-r[ie-1].x,ve=r[ie].z-r[ie-1].z;if(c)C+=Math.sqrt(pe*pe+ve*ve);else{let Mt=r[ie].y-r[ie-1].y;C+=Math.sqrt(pe*pe+Mt*Mt+ve*ve)}}if(!c){let ie=b-.01;r.push(r[r.length-1].clone().setZ(ie)),r.unshift(r[0].clone().setZ(ie))}let w=new m2;S&&(w=AD.load(bS),w.colorSpace=lu);let M=new ze(l),D=new ze(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:M},pathLength:{type:"f",value:C},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:D},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:w},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:I},opacityMultiplier:{type:"f",value:1}},F=new P2(r);F.curveType="catmullrom",F.tension=0;let B=30,G=8,N=B*r.length,k=new M2(F,N,i,G,!1),j=new Float32Array(k.attributes.position.count);for(let ie=r.length;ie<j.length;ie++)j[ie]=ie;k.setAttribute("vertexIndex",new zo(j,1));let U=new Float32Array(k.attributes.position.count),K=new zo(U,1);for(let ie=0;ie<=N;ie++)for(let pe=0;pe<=G;++pe)K.setX(ie*(G+1)+pe,ie/N);k.setAttribute("pathDistance",K);let te=new Float32Array(k.attributes.normal.count*3),fe=new zo(te,3);for(let ie=0;ie<N;ie++){let pe=k.tangents[ie];for(let ve=0;ve<=G;++ve)fe.setXYZ(ie*(G+1)+ve,pe.x,pe.y,pe.z)}k.setAttribute("pathTangent",fe);let Le=new Float32Array(k.attributes.normal.count*3),ct=new zo(Le,3);for(let ie=0;ie<N;ie++){let pe=k.tangents[ie];var me,we,ye;c?(me=pe.x*pe.y,we=-1+pe.y*pe.y,ye=pe.z*pe.y):(me=-pe.x*pe.z,we=-pe.y*pe.z,ye=1-pe.z*pe.z);let ve=Math.sqrt(me*me+we*we+ye*ye);ve===0&&(ve=1);let Mt=me/ve,Hi=we/ve,Xo=ye/ve;for(let xr=0;xr<=G;++xr)ct.setXYZ(ie*(G+1)+xr,Mt,Hi,Xo)}k.setAttribute("pathNormal",ct);let pt=new qo({uniforms:E,vertexShader:v1,fragmentShader:b1});pt.transparent=!0,pt.alphaTest=.5,E.resolution.value.x=1,E.resolution.value.y=1,E.vertexes.value=j.length,E.arrowTexture.value.wrapS=ol,E.arrowTexture.value.wrapT=ol,E.arrowTexture.value.anisotropy=16,E.complete.value=s;let er=new le(k,pt),it=er.clone(),ut={...E,opacityMultiplier:{type:"f",value:.25}};ut.complete.value=1,it.material=new qo({uniforms:ut,vertexShader:v1,fragmentShader:b1}),it.material.transparent=!0,it.material.alphaTest=.5,it.material.depthWrite=!1,it.material.depthTest=!1,it.renderOrder=1,ut.resolution.value.x=1,ut.resolution.value.y=1,ut.vertexes.value=j.length,ut.arrowTexture.value.wrapS=ol,ut.arrowTexture.value.wrapT=ol,ut.arrowTexture.value.anisotropy=16,ut.complete.value=s,er.userData=it.userData=t.mesh.userData;let ei=t.mesh;ei.add(er),ei.add(it),k.computeBoundingBox();let ji=new W;return k.boundingBox.getCenter(ji),{mesh:ei,material:pt,center:ji}}p(CS,"buildPath");var FD=.15;var C1=class C1 extends J{constructor(e,i,o){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=o}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 xo))continue;if(l.dirty||h){if(l.mesh.parent!=null)for(let g=l.mesh.children.length-1;g>=0;g--)qe(l.mesh.children[0]);let m=[];if(l.feature.features.forEach(g=>{let v=g.geometry.coordinates[2]||0,I;if(g.properties.parentId&&(I=this.getParentContainer(g.properties.parentId,!0),I!=null&&I.altitude!=null&&(v+=I.altitude,l.isVertical=!0)),!g.properties.parentId||I!=null&&I.visible){let S=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],v);m.push(S)}}),m.length>1){let{mesh:g,material:v,center:I}=CS(m,l,{color:u.color});l.mesh=g,l.material=v,l.position=I}l.dirty=!1}u.dirty&&(l.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(u.color),m.material.needsUpdate=!0}),l.mesh.position.z=u.altitude,u.dirty=!1),l.material&&(l.mesh.children.forEach(m=>{let g=m.material.uniforms;g.nearZoom.value=e,g.farZoom.value=i,g.cameraParameters.value.x=o,l.materialDirty&&(g.nearRadius.value=l.nearRadius,g.displayArrowsOnPath.value=l.displayArrowsOnPath,g.farRadius.value=l.farRadius,g.pulseColor.value.set(l.accentColor),g.complete.value=l.completeFraction),m.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(m=>{m.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,m.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};p(C1,"PathSystem");var Tc=C1;y();var Xe,fs,mr,S1=class S1{constructor(t){d(this,"rendererState");d(this,"dirty",!1);x(this,Xe,void 0);x(this,fs,void 0);x(this,mr,void 0);this.rendererState=t}updateOne(t){if(t instanceof Ae&&t.components[0]instanceof dt&&t.components[1]instanceof Dr&&t.parentObject3D instanceof rr&&(T(this,Xe,t.components[0]),T(this,mr,t.components[1]),a(this,Xe).detached&&a(this,Xe).dirty&&a(this,Xe).geometry!=null&&a(this,Xe).material!=null)){T(this,fs,t.parentObject3D),a(this,Xe).visible=!1;let e=new ze(a(this,mr).color),i=new bv({color:e,side:Zo,opacity:a(this,mr).opacity||1,transparent:a(this,mr).opacity!==void 0?a(this,mr).opacity<1:!1},1,a(this,Xe).material.repeatYFactor),o=new F2(1,a(this,Xe).geometry.attributes.position.count||0,0,i),n=o.addGeometry(a(this,Xe).geometry);o.addInstance(n),o.userData={entities:{0:t.id},detached:!0},a(this,Xe).instanceIndex=n,a(this,Xe).material.setColor(a(this,Xe).instanceIndex,e,a(this,mr).topColor?new ze(a(this,mr).topColor):e),a(this,Xe).mesh=o,a(this,Xe).material=i,a(this,fs).add(o),a(this,Xe).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(){T(this,Xe,void 0),T(this,fs,void 0),T(this,mr,void 0)}};Xe=new WeakMap,fs=new WeakMap,mr=new WeakMap,p(S1,"MeshDetachmentSystem");var Mh=S1;y();y();function SS(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(SS,"updateHeight");var Ln,Po,x1=class x1{constructor(t){d(this,"rendererState");d(this,"dirty",!1);x(this,Ln,void 0);x(this,Po,void 0);this.rendererState=t}updateOne(t){var e;t instanceof Ae&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(T(this,Ln,t.components[0]),T(this,Po,t.components[1]),t.type==="geometry"&&a(this,Po).height!==a(this,Ln).currentHeight&&SS(a(this,Ln),a(this,Po).height,a(this,Po).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){T(this,Ln,void 0),T(this,Po,void 0)}};Ln=new WeakMap,Po=new WeakMap,p(x1,"MeshModificationSystem");var Th=x1;y();var BD={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1},I1=class I1{constructor(t){d(this,"state",BD);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(I1,"Debug");var wh=I1;y();var Dh=9,kD=!1,xS=.1;function _D(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(_D,"fillArrayWithColor");var P1=class P1{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,"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 g2(this.width,this.height,{format:h2,type:d2,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];return(n<<16|s<<8|c)===i},"shouldShowByXY"));d(this,"activeOccluders",new Set);d(this,"update",p(()=>{if(!this.enabled||(this.activeOccluders.clear(),!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 Ie&&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=Yd(t,this.convertTo3DMapPosition,{color:"white",height:xS});e=this.createOccluderMesh(s,n.userData.occluderId),n.add(e)}else if(t.geometry.type==="MultiPolygon"){let s=Zd(t,this.convertTo3DMapPosition,{color:"white",height:xS});e=this.createOccluderMesh(s,n.userData.occluderId),n==null||n.add(e)}n.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let i=new ze(1,1,1);this.renderer.setClearColor(i),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(Dh),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),kD?this.renderService.enabledLayers.add(Dh):this.renderService.enabledLayers.delete(Dh),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 qo({glslVersion:f2,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);_D(o,i.count,e),t.setAttribute("color",new zo(o,3))}createOccluderMesh(t,e){let i=new le(t,this.pickingMaterial);return i.layers.set(Dh),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(P1,"Occlusion2DSystem");var Eh=P1;var IS=new wr;var{DEFAULT_PITCH:E1,DEFAULT_BEARING:O1,DEFAULT_ZOOM_LEVEL:L1,DEFAULT_MIN_ZOOM_LEVEL:RD,DEFAULT_MAX_ZOOM_LEVEL:ND}=hr,GD=ue.radToDeg(.6435011087932844),Fe,Ee,An,wc,ms,Mo,Fn,ys,Dc,T1,A,he,yr,Oe,Hr,Je,L,Ec,Ne,Se,Oh,PS,Lh,MS,Ah,TS,To,Oc,Lc,gs,Fh,Ac,Fc,Bc,vs,kc,w1,Bn,_c,bt,Ct,Rc,D1,bs,Nc,A1=class A1 extends J{constructor(e,i={}){var g,v,I,S,b,C,w,M,D,E,F;super();x(this,Dc);x(this,Oh);x(this,Lh);x(this,Ah);x(this,kc);x(this,Rc);d(this,"options");d(this,"container");d(this,"Debug");x(this,Fe,void 0);x(this,Ee,void 0);x(this,An,void 0);x(this,wc,void 0);x(this,ms,void 0);x(this,Mo,void 0);x(this,Fn,void 0);x(this,ys,void 0);d(this,"rendererDomElement");x(this,A,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ie("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:sl,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new Vg,cameraObject:new bf,naturalBearing:0});d(this,"camera");x(this,he,void 0);x(this,yr,void 0);x(this,Oe,void 0);x(this,Hr,void 0);x(this,Je,void 0);x(this,L,{});x(this,Ec,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");x(this,Ne,p(()=>{a(this,L).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));x(this,Se,p(()=>{a(this,L).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));x(this,To,"standalone");x(this,Oc,p(e=>Math.trunc(e*10)/10,"#round10"));x(this,Lc,p(()=>{a(this,L).twoDDrawSystem.dirty=!0,V(this,Dc,T1).call(this,da()),a(this,L).watermarkSystem.dirty=!0,a(this,L).occlusion2DSystem.resize(),this.render()},"#handlePixelRatioChange"));x(this,gs,p(()=>{a(this,A).canvasWidth=this.rendererDomElement.clientWidth,a(this,A).canvasHeight=this.rendererDomElement.clientHeight,V(this,Dc,T1).call(this,da()),a(this,vs).call(this),V(this,Ah,TS).call(this),a(this,L).cameraSystem.resize(this.canvasWidth,this.canvasHeight),a(this,L).cameraSystem.dirty=!0,a(this,L).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),a(this,L).htmlControlsSystem.resize(this.canvasWidth),a(this,L).geometryInFocusSystem.resize(),a(this,L).interactionSystem.resize(),a(this,L).occlusion2DSystem.resize(),this.render()},"#handleWindowResize"));x(this,Fh,p(()=>{this.renderSync()},"#renderFull"));x(this,Ac,new W);x(this,Fc,p((e,i)=>{let o=this.mode==="standalone"?a(this,Ee):this.viewCamera;if(a(this,Ee).position.z+this.camera.elevation>i.z){a(this,Ac).copy(i);let n=a(this,Ac).project(o),s=(n.x+1)/2*this.canvasWidth-0/2,c=(-n.y+1)/2*this.canvasHeight-0/2,l=a(this,Oc).call(this,s),u=a(this,Oc).call(this,c);e.x=l,e.y=u}else e.x=-1e3,e.y=-1e3},"#project"));x(this,Bc,p((e,i)=>{a(this,Je).setBufferSize(e,i),a(this,Ee).aspect=e/i,a(this,Ee).updateProjectionMatrix(),a(this,Ee).updateMatrixWorld(!0),a(this,ms).x=e,a(this,ms).y=i},"#setBufferSize"));x(this,vs,p(()=>{var s;let e=a(this,A).canvasWidth=this.rendererDomElement.clientWidth,i=a(this,A).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(e*this.resolutionScale),n=Math.floor(i*this.resolutionScale);a(this,Bc).call(this,o,n),(s=this.map)==null||s.resize(),a(this,A).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",p((e,i=!0)=>{if(!e)return i?a(this,A).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let o=a(this,A).geometry3DMap.get(e);return o instanceof Ie?o:(O.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?a(this,A).entityScene:void 0)}else if(e.type==="group-container"){let o=a(this,A).geometry3DMap.get(e.id);if(o instanceof Ie)return o}return i?a(this,A).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",p(()=>{a(this,L).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",p(()=>{a(this,L).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",p((e,i)=>{var l;let o=e/this.canvasWidth*2-1,n=-(i/this.canvasHeight)*2+1,s=new ee(o,n);IS.setFromCamera(s,a(this,Ee).clone());let c=(l=IS.intersectObject(a(this,Mo),!1)[0])==null?void 0:l.point;return c!=null?this.convert3DMapPositionToCoordinate(c):void 0},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",p(e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o=new ee;return a(this,Fc).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}=fu((s=(n=a(this,A).center)==null?void 0:n[1])!=null?s:0,(l=(c=a(this,A).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,Je).setBackgroundColor(e,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",p(()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,i),n=this.projectScreenXYToCoordinate(e,i);return o==null||n==null?void 0:ou(o,n)/e},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",p((e,i)=>{!this.map||(i==null?void 0:i.length)===0||(a(this,L).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())},"hideOutdoorLayersUnderPoint"));d(this,"hideOutdoorLayersIntersectingPolygons",p((e,i,o)=>{a(this,L).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,o),this.render()},"hideOutdoorLayersIntersectingPolygons"));x(this,Bn,new x2);x(this,_c,new sa);d(this,"render",p(()=>{if(a(this,L).renderSystem!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return a(this,L).renderSystem.update()},"render"));d(this,"renderSync",p(()=>a(this,L).renderSystem.update(!0),"renderSync"));x(this,bt,$o(()=>{this.publish("user-interaction-start",void 0)},0,!0));x(this,Ct,$o(()=>{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"&&(O.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,L).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",p(()=>{var e;a(this,L)&&(a(this,L).cameraSystem.off("user-dolly-start",a(this,bt)),a(this,L).cameraSystem.off("user-pan-start",a(this,bt)),a(this,L).cameraSystem.off("user-rotate-start",a(this,bt)),a(this,L).cameraSystem.off("user-zoom-start",a(this,bt)),a(this,L).cameraSystem.off("user-tilt-start",a(this,bt)),a(this,L).cameraSystem.off("user-pedestal-start",a(this,bt)),a(this,L).cameraSystem.off("user-dolly-end",a(this,Ct)),a(this,L).cameraSystem.off("user-pan-end",a(this,Ct)),a(this,L).cameraSystem.off("user-rotate-end",a(this,Ct)),a(this,L).cameraSystem.off("user-zoom-end",a(this,Ct)),a(this,L).cameraSystem.off("user-tilt-end",a(this,Ct)),a(this,L).cameraSystem.off("user-pedestal-end",a(this,Ct)),a(this,L).renderSystem.off("measure-canvas",a(this,vs)),this.remove("__scene"),a(this,Ne).call(this),a(this,Se).call(this),this.renderSync(),a(this,L).renderSystem.destroy(),a(this,L).cameraSystem.off("change",this.render),a(this,L).pathSystem.off("animate:path",this.render),a(this,L).cameraSystem.dispose(),a(this,L).exporterSystem.destroy(),a(this,L).outdoorLayersSystem.destroy(),a(this,L).drawSystem.destroy(),window.removeEventListener("resize",a(this,gs),!1),a(this,Ec).removeEventListener("change",a(this,Lc)),a(this,Fn)&&a(this,Fn).disconnect(),this._subscribers={},a(this,Je).destroy(),(e=a(this,Fe))==null||e.traverse(i=>{qe(i),"dispose"in i&&typeof i.dispose=="function"&&i.dispose()}),T(this,Fe,void 0),a(this,L).htmlControlsSystem.destroy(),a(this,L).collisionSystem.destroy(),a(this,L).interactionSystem.destroy(),a(this,L).domMutationSystem.destroy(),a(this,L).geometryInFocusSystem.destroy(),T(this,L,void 0),a(this,To)!=="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,Hr)),this.container.removeChild(a(this,he)),T(this,Je,void 0))},"destroy"));x(this,bs,new W);x(this,Nc,new W);if(a(this,A).naturalBearing=(g=i.naturalBearing)!=null?g: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&&(T(this,To,i.mode),this.map=i.map),a(this,A).entityScene.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),a(this,A).entityScene.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),a(this,A).geometry3DMap.set(a(this,A).entityScene.userData.entityId,a(this,A).entityScene),i.center&&(a(this,A).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,V(this,Oh,PS).call(this),V(this,Lh,MS).call(this),a(this,L).htmlControlsSystem=new vh(this.container),a(this,To)!=="outdoors-overlay"&&a(this,L).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),P.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),T(this,Je,new Ld({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:B=>{var G;(G=i.onWebGLContextRestored)==null||G.call(i,B),a(this,Ne).call(this),a(this,Se).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(I=i.backgroundAlpha)!=null?I:1})),T(this,Fe,new Wi),a(this,Fe).add(a(this,A).entityScene);let o=window.__THREE_DEVTOOLS__;P.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:a(this,Fe)})),o.dispatchEvent(new CustomEvent("observe",{detail:a(this,Je)}))),T(this,Ee,new bf(GD,this.aspect,50,1e5)),a(this,A).cameraObject=a(this,Ee),T(this,wc,new S2),a(this,Ee).renderOrder=999;let n=new nl;n.add(a(this,Ee)),T(this,ys,new nl),a(this,ys).add(n),a(this,Fe).add(a(this,ys)),a(this,Ee).updateProjectionMatrix(),a(this,Ee).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=a(this,Je).domElement(),T(this,ms,new ee);let s=new ri(1e6,1e6),c=new Ht({color:0,visible:!1});T(this,Mo,new le(s,c)),a(this,Fe).add(a(this,Mo)),(S=i.gl)!=null&&S.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",a(this,gs),!1),a(this,Ec).addEventListener("change",a(this,Lc)),typeof ResizeObserver=="function"&&((b=P.env)==null?void 0:b.NODE_ENV)!=="test"&&(T(this,Fn,new ResizeObserver($o(()=>{a(this,gs).call(this)},0))),(C=a(this,Fn))==null||C.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1920px":"100%",P.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),a(this,A).canvasWidth=this.rendererDomElement.clientWidth,a(this,A).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,u=this.canvasHeight;a(this,L).watermarkSystem=new mh(a(this,Ee),a(this,A),i==null?void 0:i.watermark),a(this,L).watermarkSystem.on("texture-loaded",this.render),a(this,A).shouldMeasureCanvas=!0,a(this,A).pixelRatio=this.resolutionScale,a(this,Bc).call(this,Math.floor(l*this.resolutionScale),Math.floor(u*this.resolutionScale));let h=new du(16777215,.3*Math.PI);h.position.set(-150,-150,350),a(this,Fe).add(h);let m=new w2(16777215,.741*Math.PI);a(this,Fe).add(m),a(this,L).cameraSystem=new cs(a(this,Ee),a(this,Fe),a(this,Je).renderer,a(this,A),{mode:this.mode,canvasHeight:u,canvasWidth:l}),a(this,L).cameraSystem.on("user-dolly-start",a(this,bt)),a(this,L).cameraSystem.on("user-pan-start",a(this,bt)),a(this,L).cameraSystem.on("user-rotate-start",a(this,bt)),a(this,L).cameraSystem.on("user-zoom-start",a(this,bt)),a(this,L).cameraSystem.on("user-tilt-start",a(this,bt)),a(this,L).cameraSystem.on("user-pedestal-start",a(this,bt)),a(this,L).cameraSystem.on("user-dolly-end",a(this,Ct)),a(this,L).cameraSystem.on("user-pan-end",a(this,Ct)),a(this,L).cameraSystem.on("user-rotate-end",a(this,Ct)),a(this,L).cameraSystem.on("user-zoom-end",a(this,Ct)),a(this,L).cameraSystem.on("user-tilt-end",a(this,Ct)),a(this,L).cameraSystem.on("user-pedestal-end",a(this,Ct)),a(this,L).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),a(this,L).geometryInFocusSystem&&(a(this,L).geometryInFocusSystem.cameraDirty=!0),this.render()}),a(this,L).pathSystem=new Tc(a(this,A),this.convertTo3DMapPosition,this.getParentContainer),a(this,L).pathSystem.on("animate:path",this.render),a(this,L).panBoundsSystem=new gh(a(this,A),a(this,L).cameraSystem),a(this,L).panBoundsSystem.on("update",()=>{let{panBounds:B,fov:G,convertAltitudeToZoomLevel:N}=a(this,L).cameraSystem;if(a(this,L).panBoundsSystem.autoMinZoomLevel){if(B.radius<=0)return;let k=Math.min(a(this,A).canvasWidth/a(this,A).canvasHeight,1),j=G*Math.PI/180*k,U=Math.tan(j/2),{radius:K,center:te}=a(this,L).cameraSystem.panBounds,fe=K/U,Le=this.getThreeCamera().getWorldPosition(new W),ct=te.distanceTo(Le),me=Math.abs(Le.z-te.z),we=fe*me/ct,ye=N(we);Z2(ye,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(ye)}}),this.camera=new fh(this,a(this,L),a(this,A),a(this,Mo)),this.camera.setZoomLevel((D=i.zoomLevel)!=null?D:L1),this.camera.setBearing((E=i.bearing)!=null?E:O1),this.camera.setPitch((F=i.pitch)!=null?F:E1),this.camera.setMaxZoomLevel(ND),this.camera.setMinZoomLevel(RD),a(this,L).domVisiblitySystem=new $d(a(this,A),a(this,Hr)),a(this,L).domMutationSystem=new hh(a(this,A),a(this,Hr)),a(this,L).domMutationSystem.on("dimensions-update",()=>{a(this,L).collisionSystem.collidersDirty=!0,this.render()}),a(this,L).domDrawSystem=new uh(a(this,A)),a(this,L).collisionSystem=new Ad(a(this,yr),a(this,A)),a(this,L).twoDDrawSystem=new Qd(a(this,A),a(this,Oe)),a(this,L).interactionSystem=new ec(this.rendererDomElement,a(this,A),a(this,Ee),a(this,Mo),a(this,L).cameraSystem.isUserInteracting),a(this,L).interactionSystem.on("hover",this.render),a(this,L).interactionSystem.on("click",B=>{var G,N,k,j,U,K;if(((G=B.entity2D)==null?void 0:G.id)==="watermark"&&typeof a(this,L).watermarkSystem.options.onClick=="function"){a(this,L).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(B.position),geometry:B.entity3D?[(N=B.entity3D)==null?void 0:N.id]:[],paths:((k=B.entity3D)==null?void 0:k.components[0])instanceof xo?[B.entity3D.id]:[],markers:((j=B.entity2D)==null?void 0:j.components[0])instanceof Yi?[B.entity2D.id]:[],models:((U=B.entity3D)==null?void 0:U.components[0])instanceof bo?[B.entity3D.id]:[],labels:((K=B.entity2D)==null?void 0:K.components[0])instanceof qi?[B.entity2D.id]:[],containers:Array.isArray(B.groupContainers)?B.groupContainers.map(te=>te.userData.entityId):[],pointerEvent:B.pointerEvent})}),a(this,L).interactionSystem.on("hover",B=>{var G,N,k,j,U,K;B.position&&((G=B.entity2D)==null?void 0:G.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(B.position),geometry:B.entity3D?[(N=B.entity3D)==null?void 0:N.id]:[],paths:((k=B.entity3D)==null?void 0:k.components[0])instanceof xo?[B.entity3D.id]:[],markers:((j=B.entity2D)==null?void 0:j.components[0])instanceof Yi?[B.entity2D.id]:[],models:((U=B.entity3D)==null?void 0:U.components[0])instanceof bo?[B.entity3D.id]:[],labels:((K=B.entity2D)==null?void 0:K.components[0])instanceof qi?[B.entity2D.id]:[],containers:Array.isArray(B.groupContainers)?B.groupContainers.map(te=>te.userData.entityId):[]})}),a(this,L).geometryInFocusSystem=new Ih(a(this,A),a(this,Ee)),a(this,L).geometryInFocusSystem.on("geometry-in-focus",B=>{this.publish("geometry-in-focus",B)}),a(this,L).twoDVisiblitySystem=new eh(a(this,A)),a(this,L).drawSystem=new Kd(a(this,A)),a(this,L).drawSystem.on("texture-loaded",this.render),a(this,L).stackSystem=new rh(a(this,A)),a(this,L).twoDProjectionSystem=new Jd(a(this,A),a(this,Fc)),a(this,L).exporterSystem=new tc(a(this,A)),a(this,L).meshOptimizationSystem=new qd(a(this,A),this.convertTo3DMapPosition),a(this,L).meshOptimizationSystem.on("model-loaded",this.render),a(this,L).meshDetachmentSystem=new Mh(a(this,A)),a(this,L).meshModificationSystem=new Th(a(this,A)),a(this,L).customGeometrySystem=new bh(a(this,A),this.convertTo3DMapPosition),a(this,L).outlineInterpolationSystem=new Iv(a(this,A)),a(this,L).renderSystem=new th(a(this,Je),a(this,A),this.mode,a(this,Fe),a(this,Ee),this.viewCamera,a(this,L)),a(this,L).imageSystem=new xh(a(this,A),this.convertTo3DMapPosition,i.bearing,i.naturalBearing,i.imagePlacementOptions),a(this,L).text3DSystem=new $2(a(this,A),this.convertTo3DMapPosition),a(this,L).text3DSystem.on("render",this.render),a(this,L).imageSystem.on("image-loaded",this.render),a(this,L).renderSystem.on("pre-render",()=>this.publish("pre-render")),a(this,L).renderSystem.on("post-render",()=>this.publish("post-render")),a(this,L).renderSystem.on("measure-canvas",a(this,vs)),a(this,L).outdoorLayersSystem=new Ph(this.map),a(this,L).occlusion2DSystem=new Eh(a(this,A),this.convertTo3DMapPosition,a(this,Je)),i.occlusionEnabled&&a(this,L).occlusion2DSystem.enable(),this.Debug=new wh(this),i.environment!==!1&&T(this,An,V(this,Rc,D1).call(this)),a(this,Fh).call(this)}get viewCamera(){return a(this,wc)}get canvasWidth(){return a(this,A).canvasWidth}get canvasHeight(){return a(this,A).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:da()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return a(this,To)}addGroupContainer(e,i,o){if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let n=new Ie(e);n.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),n.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ne).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&&tr(n,i.interactive,a(this,A)),a(this,A).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Ie&&s.addEntity(n),a(this,Se).call(this),this.render()}else O.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,A).geometry3DMap.has(e))O.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let n=new Ie(e);n.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),n.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),n.components[0]=new dh,(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),a(this,A).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Ie&&s.addEntity(n)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,o,n,s){if(a(this,A).geometry3DMap.has(e))O.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new hs(i,o),l=new Ae(c,new Dr(n));l.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},a(this,A).geometry3DMap.set(l.id,l);let u=this.getParentContainer(s);u instanceof Ie&&u.addEntity(l),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,o,n){var s,c;if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let l=new rr(e,new Sf(o));l.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),l.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),l.userData.dirty=!0,a(this,A).geometry3DMap.set(e,l);for(let h of i.features){if(h.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(h.geometry.type))continue;let m=(h==null?void 0:h.id)||((s=h==null?void 0:h.properties)==null?void 0:s.id)||be(),{visible:g,...v}=o||{color:A2},I=a(this,L).meshOptimizationSystem.createEntityFromFeature(m,h,v);a(this,A).geometry3DMap.set(m,I),l.userData.entities3D.add(m)}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 Ie&&u.addEntity(l),a(this,Se).call(this),this.render()}else O.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return a(this,L).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,i){let o=this.getParentContainer(i),n=a(this,L).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(e,n),n}addImage(e,i,o,n){try{dS(e,i,o)}catch(s){O.error(s);return}if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let s=new Sh(i),c=new Ae(s,new Dr(o));c.id=e||be(),s.mesh.userData={entityId:c.id,type:"path"},a(this,A).geometry3DMap.set(c.id,c);let l=this.getParentContainer(n);l instanceof Ie&&l.addEntity(c),a(this,Se).call(this),this.render()}else O.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{z7(e,i,o)}catch(u){O.error(u);return}if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let u=new rr(e,new Sf(o));u.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),u.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ne).call(this)}),a(this,A).geometry3DMap.set(e,u),u.userData.dirty=!0,u.userData.modelURL=o.url;for(let m of i.features){let g=m.id||m.properties.id||be(),v=a(this,L).meshOptimizationSystem.createModelFromFeature(g,m,o);(m.properties.interactive!==void 0||o.interactive!=null)&&tr(v,(c=m.properties.interactive)!=null?c:o.interactive,a(this,A)),a(this,A).geometry3DMap.set(g,v),u.userData.entities3D.add(g)}let h=this.getParentContainer(n);h instanceof Ie&&h.addEntity(u),a(this,Se).call(this),(l=this.render())==null||l.then(s)}else O.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{k2(e,i,o||{})}catch(l){O.error(l);return}if(s===void 0||!a(this,A).geometry2DMap.has(s)&&!a(this,A).geometry3DMap.has(s)){let l=V(this,kc,w1).call(this,e,new Yi(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"&&tr(l,o==null?void 0:o.interactive,a(this,A)),(c=this.getParentContainer(n))==null||c.addEntity(l),this.render()}else O.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}labelText3D(e,i,o={}){var u,h;try{if(!i||!e)throw new Error("content and meshGeometryId are required");J2.parse(o)}catch(m){O.error(m);return}let n=a(this,A).geometry3DMap.get(e);if((n==null?void 0:n.type)!=="geometry"){O.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 m=a(this,A).geometry3DMap.get(s.textEntityId);if((m==null?void 0:m.type)!=="text3d"){O.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let c=new Q2({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:be()}});c.polygonEntityId=e;let l=new Ae(c,new gu(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,A).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{q2(e,i,o||{})}catch(l){O.error(l);return}if(s===void 0||!a(this,A).geometry2DMap.has(s)&&!a(this,A).geometry3DMap.has(s)){let l=V(this,kc,w1).call(this,e,new qi(i,o||{},a(this,A)),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&&tr(l,o==null?void 0:o.interactive,a(this,A));let u=typeof n=="string"||typeof n=="number"?a(this,A).geometry3DMap.get(n):void 0;u instanceof Ae?u.addEntity(l):(c=this.getParentContainer(n))==null||c.addEntity(l),a(this,Ne).call(this),this.render()}else O.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{J7(e,i||{})}catch(u){O.error(u);return}let n=new xo(e,mv(i)),s=new Ae(n,new Dr({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));s.id=(i==null?void 0:i.id)||be(),n.mesh.userData={entityId:s.id,type:"path"},a(this,A).geometry3DMap.set(s.id,s),(i==null?void 0:i.interactive)!=null&&tr(s,i==null?void 0:i.interactive,a(this,A));let c=this.getParentContainer(o);return c instanceof Ie&&c.addEntity(s),a(this,Se).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(e){a(this,L).watermarkSystem.options=e,a(this,L).watermarkSystem.dirty=!0,a(this,L).collisionSystem.collidersDirty=!0,this.render()}remove(e){var o,n;let i;if(typeof e=="string"||typeof e=="number"?(i=a(this,A).geometry2DMap.get(e),i==null&&(i=a(this,A).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=a(this,A).geometry2DMap.get(e.id),i==null&&(i=a(this,A).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")a(this,A).geometry3DMap.delete(i.id),i.object3d&&qe(i.object3d);else if(i.type==="group-container"){a(this,A).geometry3DMap.delete(i.userData.entityId);for(let s of i.childrenIds.values())this.remove(s),i.userData.entities2D.delete(s);qe(i)}else if(i.type==="geometry-group"){a(this,A).geometry3DMap.delete(i.userData.entityId);for(let s of i.userData.entities3D.values())this.remove(s),i.userData.entities3D.delete(s);qe(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),qe(i.object3d)),"outline"in s&&s.outline&&qe(s.outline),"focusMesh"in s&&s.focusMesh!=null&&qe(s.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),a(this,A).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,A).geometry3DMap.get(s);c instanceof Ae&&c.removeEntity(i)}}i.object3d&&qe(i.object3d),i.type==="label"&&delete a(this,L).twoDDrawSystem.textCache[i.id],a(this,A).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&qe(i.object3d),a(this,A).geometry3DMap.delete(i.id);else if(i.type==="text3d"){qe(i.object3d);let{batchedText:s,textMesh:c,polygonEntityId:l}=i.components[0];if(c&&(s&&s.removeText(c),qe(c)),l){a(this,L).text3DSystem.remove(l);let u=a(this,A).geometry3DMap.get(l);(u==null?void 0:u.type)==="geometry"&&(u.components[0].textMesh=void 0,u.components[0].textEntityId=void 0)}a(this,A).geometry3DMap.delete(i.id)}a(this,Se).call(this),a(this,Ne).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return a(this,Fe)}getThreeCamera(){return a(this,Ee)}async setEnvironment(e){if(a(this,Fe))if(e==="basic"){a(this,An)||T(this,An,V(this,Rc,D1).call(this));let i=await a(this,An);a(this,Fe).environment=i}else a(this,Fe).environment=null}getEnvironment(){var e;return(e=a(this,Fe))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return a(this,L).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(a(this,L).renderSystem.threeDdirty||a(this,L).renderSystem.twoDdirty)&&this.renderSync();let i=new wt;if(e==null)i.setFromObject(a(this,A).entityScene);else{let o=ll(a(this,A),e);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let n=o.components[0],s=n instanceof dt?n.geometry:void 0;n.mesh instanceof cu&&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(rl(i))return R2(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var o,n,s,c,l,u;if(e==null)return{type:"map-view",hoverColor:a(this,A).hoverColor,text3dHoverColor:a(this,A).text3dHoverColor};let i=ll(a(this,A),e);if((i==null?void 0:i.type)==="custom-geometry"){let h=i.components[0],m=i.components[1];return{id:i.id,type:"custom-geometry",visible:m.visible,altitude:m.altitude,parent:(o=i.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(h.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let h=[];for(let g of i.userData.entities3D.values()){let v=this.getState(g);((v==null?void 0:v.type)==="geometry"||(v==null?void 0:v.type)==="model")&&h.push(v)}let m=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:m.opacity,color:m.color,initialColor:m.initialColor,height:m.height,altitude:i.altitude,topColor:m.topColor,outline:m.outline,shading:m.shading,texture:m.texture,topTexture:m.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(g=>a(this,A).geometry3DMap.get(g)).every(g=>g&&g.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(g=>this.getState(g)).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,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(h=>this.getState(h)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let h=i.components[0],m=i.object3d.parent,g=m==null?void 0:m.userData.entityId;return{id:i.id,type:"label",text:h.text||"",parent:{id:g,type:m==null?void 0:m.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:h.enabled,visible:h.visible,initialRank:al(h.initialRank),options:{rank:al(h.rank),appearance:h.appearance,interactive:i.components[1]!=null,verticalOffset:i.verticalOffset}}}else if((i==null?void 0:i.type)==="marker"){let h=i.components[0],m=i.object3d.parent,g=m==null?void 0:m.userData.entityId;return{id:i.id,type:"marker",enabled:h.enabled,visible:h.visible,anchor:h.options.anchor,dynamicResize:h.options.dynamicResize,parent:{id:g,type:m==null?void 0:m.type},position:this.convert3DMapPositionToCoordinate(i.position),element:h.containerEl,initialRank:al(h.initialRank),options:{rank:al(h.rank),interactive:i.components[1]!=null||!1,verticalOffset:i.verticalOffset}}}else if((i==null?void 0:i.type)==="geometry"){let{color:h,hoverColor:m,initialColor:g,initialTopColor:v,topColor:I}=i.components[1],S=i.components[0],b=i.components[1],C=i.components[2],w=i.parentObject3D;return{id:i.id,type:"geometry",opacity:b.opacity,initialColor:g,color:h,focusable:S.focusable,initialTopColor:v,topColor:I,hoverColor:m,hovered:!!(C!=null&&C.hover),height:b.height,visible:b.visible,outline:b.outline,showImage:b.showImage,texture:b.texture,topTexture:b.topTexture,flipImageToFaceCamera:b.flipImageToFaceCamera,parent:{id:w==null?void 0:w.userData.entityId,type:w==null?void 0:w.type},position:this.convert3DMapPositionToCoordinate(S.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let h=i.components[0],m=i.components[1],g=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(h.position),interactive:g!=null,material:m.material,visible:m.visible,verticalOffset:m.verticalOffset,color:m.color,opacity:m.opacity}}else if((i==null?void 0:i.type)==="path"){let h=i.components[0],m=i.components[2],g=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(h.position),visible:g.visible,interactive:m!=null,completeFraction:h.completeFraction,color:g.color,accentColor:h.accentColor,nearRadius:h.nearRadius,farRadius:h.farRadius,animateArrowsOnPath:h.animateArrowsOnPath,displayArrowsOnPath:h.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let h=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(h.position),visible:i.components[1].visible,verticalOffset:(n=h.feature.properties.verticalOffset)!=null?n:0,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"){yv(i);let h=i.components[0],m=i.components[1],{textMesh:g}=h,v=(s=h.mesh)==null?void 0:s.parent;v instanceof Ie&&((c=v.children.find(b=>b.type==="batchedtext"))==null||c.getWorldPosition(a(this,Nc))),a(this,bs).set(0,0,0);let I=g?g.getWorldPosition(a(this,bs)):a(this,bs);return Object.assign({},ha,m.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(I.add(a(this,Nc))),visible:(l=h.visible)!=null?l:!1,content:(u=h.feature.properties.content)!=null?u:""})}else return}}setState(e,i){var n,s;if(typeof e=="object"&&i==null){"hoverColor"in e&&(a(this,A).hoverColor=(n=e.hoverColor)!=null?n:a(this,A).hoverColor),"text3dHoverColor"in e&&(a(this,A).text3dHoverColor=(s=e.text3dHoverColor)!=null?s:a(this,A).text3dHoverColor);return}let o=ll(a(this,A),e);if(o!=null){if(o.type==="custom-geometry"){let c=a(this,A).geometry3DMap.get(o.id);if(c instanceof Ae&&c.components[0]instanceof hs){let l=i;$i(o,l.visible),bu(o,l.altitude),Df(o,l.position,this.convertTo3DMapPosition),Ef(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let c=i;tr(o,c.interactive,a(this,A))&&a(this,Se).call(this),o.type==="path"&&(bu(o,c.altitude),fv(o,c))}else if(o.type==="model"){let c=i;tr(o,c.interactive,a(this,A))&&a(this,Se).call(this),$i(o,c.visible),vv(o,c)}else if(o.type==="group-container"){let c=i;$i(o,c.visible)&&(a(this,L).outlineInterpolationSystem.dirty=!0,a(this,L).pathSystem.altitudeDirty=!0),bu(o,c.altitude)&&(a(this,L).pathSystem.altitudeDirty=!0),tr(o,c.interactive,a(this,A))&&a(this,Se).call(this)}else if(o.type==="geometry-group"){let c=i;$i(o,c.visible)&&(a(this,L).outlineInterpolationSystem.dirty=!0),K2(o,a(this,A),c)&&(a(this,L).outlineInterpolationSystem.dirty=!0),Lf(o,c.outline)&&(a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),c.height!=null&&(wf(o,a(this,A),c.height),a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),c.altitude!=null&&(o.setAltitude(c.altitude),o.userData.outlineDirty=!0),cv(o,c),ev(o,c.shading),lv(o,a(this,A),c.opacity)&&(o.userData.outlineDirty=!0,a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),tr(o,c.interactive,a(this,A))&&(a(this,Se).call(this),a(this,Ne).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof dt){let c=i;$i(o,c.visible)&&(a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Lf(o,c.outline)&&(a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),tv(o,c),dv(o,c.focusable)&&(a(this,L).geometryInFocusSystem.focusablesDirty=!0),hv(o,c.renderOrder)&&(a(this,L).meshDetachmentSystem.dirty=!0),uv(o,c.opacity)&&(a(this,L).meshDetachmentSystem.dirty=!0,a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Of(o,c.flipImageToFaceCamera),c.height!=null&&(wf(o,a(this,A),c.height),a(this,L).outlineInterpolationSystem.geometries3DDirty=!0),pv(o,c)&&(a(this,L).meshDetachmentSystem.dirty=!0),rv(o,c),av(o,c.hoverColor),tr(o,c.interactive,a(this,A)),sv(o,c.hovered)}a(this,Se).call(this)}else if(o.type==="label"||o.type==="marker"){let c=i;nv(o,i,a(this,A)),ov(o,i,a(this,A))&&(a(this,Ne).call(this),a(this,L).domMutationSystem.dirty=!0),Df(o,c.position,this.convertTo3DMapPosition),Ef(o,this.getParentContainer(c.parent,!1))&&(a(this,Ne).call(this),a(this,L).panBoundsSystem.dirty=!0),iv(o,c.enabled),$i(o,c.visible)}else if(o.type==="image"){let c=i;$i(o,c.visible),Of(o,c.flipImageToFaceCamera)}else o.type==="text3d"&&gv(o,i);this.render()}}convertTo3DMapPosition(e,i,o=0,n){var l,u,h,m,g;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}=mu((h=(u=a(this,A).center)==null?void 0:u[1])!=null?h:0,(g=(m=a(this,A).center)==null?void 0:m[0])!=null?g:0,e,i);return n?(n.set(s,c,o),n):new W(s,c,o)}get backgroundColor(){return typeof a(this,Je).backgroundColor=="string"?a(this,Je).backgroundColor:"#".concat(a(this,Je).backgroundColor.getHexString())}get backgroundAlpha(){return a(this,Je).backgroundAlpha}getThreeRenderer(){return a(this,Je)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?Y2(i):void 0}isInView(e){let i=ll(a(this,A),e);if(a(this,_c).identity().multiply(a(this,Ee).projectionMatrix).multiply(a(this,Ee).matrixWorldInverse),a(this,Bn).setFromProjectionMatrix(a(this,_c)),i instanceof xf)return a(this,Bn).containsPoint(i.position);if(i instanceof Ae){let o=i==null?void 0:i.components[0];if(o instanceof hs||o instanceof bo)return a(this,Bn).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof dt){let n=new wt(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return a(this,Bn).intersectsBox(n)}}return!1}getSystems(){return a(this,L)}getInternalState(){return a(this,A)}getTweenGroup(){return a(this,A).tweenGroup}};Fe=new WeakMap,Ee=new WeakMap,An=new WeakMap,wc=new WeakMap,ms=new WeakMap,Mo=new WeakMap,Fn=new WeakMap,ys=new WeakMap,Dc=new WeakSet,T1=p(function(e){var i;a(this,To)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),a(this,A).pixelRatio=this.resolutionScale},"#setResolutionScale"),A=new WeakMap,he=new WeakMap,yr=new WeakMap,Oe=new WeakMap,Hr=new WeakMap,Je=new WeakMap,L=new WeakMap,Ec=new WeakMap,Ne=new WeakMap,Se=new WeakMap,Oh=new WeakSet,PS=p(function(){T(this,he,document.createElement("div")),a(this,he).classList.add("mappedin__smart-collision-engine__container"),T(this,yr,document.createElement("canvas")),a(this,yr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(a(this,he)),T(this,Oe,document.createElement("canvas")),a(this,Oe).classList.add("mappedin__smart-collision-engine__container"),a(this,Oe).width=a(this,he).clientWidth*this.resolutionScale,a(this,Oe).height=a(this,he).clientHeight*this.resolutionScale,a(this,Oe).style.width=a(this,he).clientWidth+"px",a(this,Oe).style.height=a(this,he).clientHeight+"px",a(this,he).appendChild(a(this,yr)),a(this,he).appendChild(a(this,Oe)),a(this,yr).width=a(this,he).clientWidth,a(this,yr).height=a(this,he).clientHeight,a(this,Oe).width=a(this,he).clientWidth*this.resolutionScale,a(this,Oe).height=a(this,he).clientHeight*this.resolutionScale,a(this,Oe).style.width=a(this,he).clientWidth+"px",a(this,Oe).style.height=a(this,he).clientHeight+"px"},"#renderEntity2DContainer"),Lh=new WeakSet,MS=p(function(){T(this,Hr,document.createElement("div")),a(this,Hr).classList.add("mappedin-2d-entities"),Object.assign(a(this,Hr).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(a(this,Hr))},"#renderEntityDOMContainer"),Ah=new WeakSet,TS=p(function(){a(this,Oe).width=a(this,he).clientWidth*this.resolutionScale,a(this,Oe).height=a(this,he).clientHeight*this.resolutionScale,a(this,Oe).style.width=a(this,he).clientWidth+"px",a(this,Oe).style.height=a(this,he).clientHeight+"px",a(this,yr).width=a(this,he).clientWidth,a(this,yr).height=a(this,he).clientHeight,a(this,Oe).width=a(this,he).clientWidth*this.resolutionScale,a(this,Oe).height=a(this,he).clientHeight*this.resolutionScale,a(this,Oe).style.width=a(this,he).clientWidth+"px",a(this,Oe).style.height=a(this,he).clientHeight+"px",a(this,L).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),To=new WeakMap,Oc=new WeakMap,Lc=new WeakMap,gs=new WeakMap,Fh=new WeakMap,Ac=new WeakMap,Fc=new WeakMap,Bc=new WeakMap,vs=new WeakMap,kc=new WeakSet,w1=p(function(e,i,o,n){let s=new xf(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n);return o!=null&&(s.occluderId=o),a(this,A).geometry2DMap.set(s.id,s),s},"#createEntity2D"),Bn=new WeakMap,_c=new WeakMap,bt=new WeakMap,Ct=new WeakMap,Rc=new WeakSet,D1=p(async function(){return So.load(v7).then(e=>{var i;return a(this,Fe)&&((i=a(this,Fe).environment)==null||i.dispose(),e.mapping=u2,a(this,Fe).environment=e,this.render()),e})},"#loadEnvMap"),bs=new WeakMap,Nc=new WeakMap,p(A1,"Core");var M1=A1,Gc=M1;y();function VD(r,t){jD(r,t)(r.getScene(),t),HD(r,t),t.addFolder("Export").add({export: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");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(VD,"mountSceneGraphVisualizer");function jD(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?z2(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:()=>{}};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:()=>{}};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,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(l){var h,m;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var u,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(l){var h,m;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var u,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(l){var h,m;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var u,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:h.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(l){var h,m;let u=r.getState(o.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(m=(h=u.options.appearance)==null?void 0:h.marker)==null?void 0:m.backgroundColor,inactive:l}}}}})},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(jD,"createParseChild");function HD(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(HD,"createWatermarkChild");var wS="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",UD="https://auth.mappedin.com/oauth2/token";async function DS(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-VQWUPKMU.js"),u=t.outdoorView.headers;u==null&&(u=await H2(UD));let h=t.center||[0,0],m=new c({container:r,style:t.outdoorView.style||wS,center:h,attributionControl:!1,zoom:(i=t.zoomLevel)!=null?i:L1,pitch:(o=t.pitch)!=null?o:E1,bearing:(n=t.bearing)!=null?n:O1,transformRequest:G2(u),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:da(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=m.painter.context.gl,v=new Gc(r,{center:h,zoomLevel:m.getZoom(),pitch:m.getPitch(),bearing:m.getBearing(),gl:g,map:m,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}),I={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(v.camera.minZoomLevel),m.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",D=>{I.center=D.center,I.zoom=D.zoomLevel,I.bearing=D.bearing,I.pitch=D.pitch,m.jumpTo(I)});let S=l.fromLngLat(h,0),b=yu(S,v.viewCamera,v.camera,()=>{v.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(b),v.renderSync())});let C=!1,w=!1;m.on("idle",()=>{m&&(C||(v.publish("outdoor-view-loaded"),C=!0),w||(w=!0,v.publish("outdoor-style-loaded")))});let M=p(D=>{D&&(D.sourceDataType==="metadata"||D.sourceDataType==="visibility"||D.dataType==="style"||D.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(m)},"updateData");return m.on("styledata",D=>{m&&D&&D.dataType==="style"&&D.type==="styledata"&&(w=!1),M(D)}),m.on("sourcedata",M),m.on("terrain",M),m.on("error",D=>{var E;if(((E=D.error)==null?void 0:E.url)===wS){O.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}O.warn(D)}),v}else return new Gc(r,t)}p(DS,"createRenderer");y();var Vc=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Vc||{}),jc=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(jc||{});y();y();var Cs=class Cs{constructor(t,e,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",Cs.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===Cs.__type}get focusTarget(){return this.target.anchorTarget}};p(Cs,"Label"),d(Cs,"__type","Label");var wo=Cs;y();var xs,Ss=class Ss{constructor(t,e,i){d(this,"id");x(this,xs,void 0);d(this,"__type",Ss.__type);d(this,"contentEl");this.id=t,this.contentEl=e,T(this,xs,i)}get target(){return a(this,xs)}static is(t){return t.__type===Ss.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){T(this,xs,t)}};xs=new WeakMap,p(Ss,"Marker"),d(Ss,"__type","Marker");var Ii=Ss;y();var Uc,Wc,Is=class Is{constructor(t,e,i){x(this,Uc,void 0);x(this,Wc,void 0);d(this,"target");d(this,"__type",Is.__type);T(this,Uc,t),T(this,Wc,e),this.target=i}static is(t){return t.__type===Is.__type}get id(){return a(this,Uc)}get url(){return a(this,Wc)}};Uc=new WeakMap,Wc=new WeakMap,p(Is,"Image"),d(Is,"__type","Image");var Hc=Is;y();var Ps=class Ps{constructor(t,e){d(this,"id");d(this,"groupId");d(this,"__type",Ps.__type);this.id=t,this.groupId=e}static is(t){return t.__type===Ps.__type}};p(Ps,"Model"),d(Ps,"__type","Model");var kn=Ps;y();var F1=class F1{constructor(t,e,i){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"__type");this.id=t,this.__type="Path",this.animation=e,this.coordinates=i}get focusTarget(){return this.coordinates}};p(F1,"Path");var _n=F1;y();var Do,B1=class B1{constructor(t){x(this,Do,void 0);T(this,Do,t)}get center(){return a(this,Do).center}get bearing(){return a(this,Do).bearing}get pitch(){return a(this,Do).pitch}get zoomLevel(){return a(this,Do).zoomLevel}};Do=new WeakMap,p(B1,"CameraTransform");var Xc=B1;y();var Ms=class Ms{constructor(t){d(this,"id");d(this,"__type",Ms.__type);this.id=t}static is(t){return t.__type===Ms.__type}get focusTarget(){return this}};p(Ms,"Shape"),d(Ms,"__type","Shape");var Eo=Ms;y();var Yc=class Yc{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===Yc.__type}};p(Yc,"Text3D"),d(Yc,"__type","Text3D");var Oo=Yc;y();y();y();var WD=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>']]),XD=/<svg([^>]*)>/g;function ES(r,t,e){let i=WD.get(r);return i?i.replace(XD,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}p(ES,"getStyledIcon");var YD=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"),ZD=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"),k1="#722ED1",_1="#1890FF",OS=p(({type:r="departure",color:t=_1})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?YD(t):ZD(t),"\n </div>"),"DroppedPin"),zD=p(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),LS=p(({type:r="stairs",color:t=k1,direction:e="up"})=>{let i=zD("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(ES("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");y();var AS=p(async r=>new Promise(t=>setTimeout(t,r)),"ms");var Rn={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},inactivePathOptions:{drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},markerOptions:{departureColor:_1,destinationColor:k1}},Pi,Mi,Lo,xe,zc,Ti,Qe,Ur,Kt,wi,Nn,_h,FS,Ts,Bh,ws,kh,Rh,BS,qc,R1=class R1{constructor(t,e,i){x(this,_h);x(this,Ts);x(this,ws);x(this,Rh);x(this,Pi,new Map);x(this,Mi,void 0);x(this,Lo,void 0);x(this,xe,Rn);x(this,zc,void 0);x(this,Ti,void 0);x(this,Qe,[]);x(this,Ur,void 0);x(this,Kt,new Map);x(this,wi,new Map);x(this,Nn,new Map);x(this,qc,p(t=>{var e;if((e=a(this,xe).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=a(this,Pi).get(t.markers[0]);i!=null&&i.action.toFloor&&(a(this,xe).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"));T(this,Mi,t),T(this,zc,i),T(this,Lo,e)}get currentMap(){return a(this,zc).call(this)}get isMultiFloor(){if(!a(this,Qe).length)return!1;let t=new Set;for(let e of a(this,Qe))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,Kt).get(t)}getMarkerById(t){return a(this,Pi).get(t)}get paths(){let t=[];return a(this,Kt).forEach(({path:e})=>t.push(e)),t}get activeDirections(){return a(this,Nn).get(a(this,Ur))}get activePath(){var t;if(a(this,Ur))return(t=a(this,Kt).get(a(this,Ur).id))==null?void 0:t.path}get floorStacks(){let t=a(this,Lo).getMapData();if(!a(this,Qe).length||!t)return[];let e=new Set;for(let i of a(this,Qe))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,Lo).getMapData();if(!a(this,Qe).length||!t)return[];let e=new Set;for(let i of a(this,Qe))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,Qe)[t];if(!a(this,Qe).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Qe)[t]){O.warn("Direction #".concat(t," does not exist"));return}let i=a(this,wi).get(e);if(!i){O.warn("The direction is not a part of muli-direcional path");return}V(this,Ts,Bh).call(this,i)}setActivePath(t){if(!a(this,Qe).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Nn).get(t)){O.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}V(this,Ts,Bh).call(this,t)}setActivePathByDirections(t){if(!a(this,Qe).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=a(this,wi).get(t);if(!e){O.warn("The direction is not a part of muli-direcional path");return}V(this,Ts,Bh).call(this,e)}async draw(t,e={}){var l,u;let i=Array.isArray(t)?t:[t],o=i[0],n=i[i.length-1],s=o.coordinates[0];T(this,Qe,i),a(this,Ti)&&this.clear(),T(this,xe,{setMapOnConnectionClick:(l=e.setMapOnConnectionClick)!=null?l:Rn.setMapOnConnectionClick,setMapToDeparture:(u=e.setMapToDeparture)!=null?u:Rn.setMapToDeparture,pathOptions:{...Rn.pathOptions,...e.pathOptions},inactivePathOptions:{...Rn.inactivePathOptions,...e.inactivePathOptions},createMarkers:{...Rn.createMarkers,...e.createMarkers},markerOptions:{...Rn.markerOptions,...e.markerOptions}}),s.floorId&&a(this,xe).setMapToDeparture&&this.currentMap.setFloor(s.floorId);let c=!1;return T(this,Ti,{promise:new Promise(async h=>{var m,g,v;if(P.env.NODE_ENV!=="test"&&await AS(500),c||!i.length){h();return}(m=a(this,xe).createMarkers)!=null&&m.departure&&V(this,ws,kh).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let I=0;I<i.length;I++){let S=i[I],b=I?{...a(this,xe).inactivePathOptions}:{...a(this,xe).pathOptions};if(S.coordinates.length<2){O.warn("Directions must have at least 2 coordinates"),h();return}let C=this.currentMap.Paths.add(S.coordinates,b),w=C.paths.map(D=>D.id.toString()),M=new _n(be(),C.animation,S.coordinates);for(let D of w){a(this,Kt).set(D,{path:M,entityIds:w});let E=I?{...a(this,xe).inactivePathOptions,altitude:0}:{...a(this,xe).pathOptions,altitude:.05};a(this,Mi).setState(D,E)}if(a(this,Kt).set(M.id,{path:M,entityIds:w}),a(this,wi).set(S,M),a(this,Nn).set(M,S),P.env.NODE_ENV!=="test"&&await C.animation,c){h();return}(g=a(this,xe).createMarkers)!=null&&g.connection&&V(this,Rh,BS).call(this,S.instructions,"connection"),I===0&&(T(this,Ur,a(this,wi).get(a(this,Qe)[0])),a(this,Mi).on("click",a(this,qc)))}if((v=a(this,xe).createMarkers)!=null&&v.destination&&V(this,ws,kh).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),c){h();return}a(this,Lo).mapObjects.forEach(I=>{I.processFloorChange(I.currentFloorId)}),h()}),cancel:()=>{c=!0}}),a(this,Ti).promise}clear(){a(this,Pi).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),a(this,Pi).clear(),a(this,Kt).forEach(({path:t,entityIds:e})=>{a(this,Kt).delete(t.id),e.forEach(i=>a(this,Kt).delete(i)),this.currentMap.Paths.remove(e)}),a(this,Ti)&&(a(this,Ti).cancel(),T(this,Ti,void 0)),T(this,Qe,[]),a(this,wi).clear(),a(this,Nn).clear(),T(this,Ur,void 0),a(this,Mi).off("click",a(this,qc)),a(this,Lo).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};Pi=new WeakMap,Mi=new WeakMap,Lo=new WeakMap,xe=new WeakMap,zc=new WeakMap,Ti=new WeakMap,Qe=new WeakMap,Ur=new WeakMap,Kt=new WeakMap,wi=new WeakMap,Nn=new WeakMap,_h=new WeakSet,FS=p(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),Ts=new WeakSet,Bh=p(function(t){T(this,Ur,t),a(this,Qe).forEach(e=>{let i=a(this,wi).get(e);if(i){let o=a(this,Kt).get(i.id),n=o.path.id===a(this,Ur).id?{...a(this,xe).pathOptions,altitude:.05}:{...a(this,xe).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{a(this,Mi).setState(s,n)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),ws=new WeakSet,kh=p(function(t,e,i){var o,n,s,c,l;if(e==="connection"&&i){let u=i.action.type==="ExitConnection"?a(this,xe).markerOptions.departureColor:a(this,xe).markerOptions.destinationColor,h;if(typeof((o=a(this,xe).createMarkers)==null?void 0:o.connection)=="function"){let g=a(this,xe).createMarkers.connection(i);a(this,Mi).setState(g.id.toString(),{options:{interactive:!0}}),h={id:g.id,type:"marker"}}else h=this.currentMap.Markers.add(i.coordinate,LS({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 m=this.currentMap.Markers.getContentEl(h.id.toString());if(!m)throw new Error("marker component should exist");a(this,Pi).set(h.id,{instruction:i,marker:new Ii(h.id.toString(),m,i.coordinate)})}else{let u=e==="departure"?a(this,xe).markerOptions.departureColor:a(this,xe).markerOptions.destinationColor,h;typeof((c=a(this,xe).createMarkers)==null?void 0:c.departure)=="function"&&e==="departure"?h={id:a(this,xe).createMarkers.departure(i).id,type:"marker"}:typeof((l=a(this,xe).createMarkers)==null?void 0:l.destination)=="function"&&e==="destination"?h={id:a(this,xe).createMarkers.destination(i).id,type:"marker"}:h=this.currentMap.Markers.add(t,OS({type:e,color:u}),{anchor:"top",rank:"always-visible"}),a(this,Pi).set(h.id,void 0)}},"#addMarker"),Rh=new WeakSet,BS=p(function(t,e){t.filter(o=>V(this,_h,FS).call(this,o.action)).forEach(o=>{V(this,ws,kh).call(this,o.coordinate,e,o)})},"#addMarkers"),qc=new WeakMap,p(R1,"Navigation");var Zc=R1;y();y();y();var qD=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>']]),$D=/<svg([^>]*)>/g;function kS(r,t,e){let i=qD.get(r);return i?i.replace($D,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}p(kS,"getStyledIcon");var Gn,Ds,$c,N1,Gh,_S,Vh,RS,Jc,G1,jh,NS,V1=class V1{constructor(t,e){x(this,$c);x(this,Gh);x(this,Vh);x(this,Jc);x(this,jh);x(this,Gn,void 0);x(this,Ds,void 0);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});T(this,Gn,t),T(this,Ds,e)}auto(){let t=[],e=a(this,Ds)[Object.keys(a(this,Ds))[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,Gn).Labels.add(o,n,V(this,$c,N1).call(this,i));t.push(s)}});else{i.__type==="space"&&i.name!==""&&a(this,Gn).updateState(i,{interactive:!0,hoverColor:"#F0F0F0"});let o=i.name||i.externalId;if(o){let n=a(this,Gn).Labels.add(i,o,V(this,$c,N1).call(this,i));t.push(n)}}}),{labels:t}}};Gn=new WeakMap,Ds=new WeakMap,$c=new WeakSet,N1=p(function(t){let e=kS(V(this,Gh,_S).call(this,t),"white",12);return{appearance:{text:{foregroundColor:V(this,Jc,G1).call(this,t)},marker:{foregroundColor:{active:V(this,Jc,G1).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:V(this,jh,NS).call(this,t)}},"#generatLabelAppearance"),Gh=new WeakSet,_S=p(function(t){return t.__type==="connection"?V(this,Vh,RS).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),Vh=new WeakSet,RS=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"),Jc=new WeakSet,G1=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"),jh=new WeakSet,NS=p(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),p(V1,"Labels");var Nh=V1;var j1=class j1{constructor(t,e){d(this,"Labels");d(this,"auto",p(()=>this.Labels.auto(),"auto"));this.Labels=new Nh(t,e)}};p(j1,"DefaultTheme");var Hh=j1;y();var Q,Kc,Es,Uh,ep,H1,Wh,GS,U1=class U1{constructor(t){x(this,Es);x(this,ep);x(this,Wh);x(this,Q,void 0);x(this,Kc,void 0);d(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(a(this,Q).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(a(this,Q).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(a(this,Q).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{a(this,Q).getSystems().cameraSystem.enablePan=!0,a(this,Q).getSystems().cameraSystem.enableZoom=!0,a(this,Q).getSystems().cameraSystem.enableRotate=!0},disable:()=>{a(this,Q).getSystems().cameraSystem.enablePan=!1,a(this,Q).getSystems().cameraSystem.enableZoom=!1,a(this,Q).getSystems().cameraSystem.enableRotate=!1}});d(this,"setMinPitch",p(t=>{a(this,Q).camera.setMinPitch(t)},"setMinPitch"));d(this,"setMaxPitch",p(t=>{a(this,Q).camera.setMaxPitch(t)},"setMaxPitch"));d(this,"setMinZoomLevel",p(t=>{a(this,Q).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",p(t=>{a(this,Q).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));T(this,Kc,t),T(this,Q,t.core)}setScreenOffsets(t){a(this,Q).camera.setInsetPadding(t)}get screenOffsets(){return a(this,Q).camera.insetsPadding}get panMode(){return a(this,Q).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&a(this,Q).camera.setPanMode(t)}getFocusOnTransform(t,e){let i=a(this,Q).camera.getCameraFrameForCoordinates(V(this,ep,H1).call(this,t,e),{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,easing:e==null?void 0:e.easing});return{center:new re(i.center[1],i.center[0]),zoomLevel:i.zoomLevel}}focusOn(t,e){return a(this,Q).camera.focusOn(V(this,ep,H1).call(this,t,e),{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,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,Q).camera.animateTo({center:i!=null?[c.longitude,c.latitude,a(this,Q).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,Q).camera.setCenter(s),a(this,Q).camera.setZoomLevel(i),a(this,Q).camera.setBearing(o),a(this,Q).camera.setPitch(n)}get center(){let t=a(this,Q).camera.center;return new re(t[1],t[0],void 0)}setAutoMinZoomLevel(t){a(this,Q).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return a(this,Q).camera.autoMinZoomLevel}get zoomLevel(){return a(this,Q).camera.zoomLevel}get pitch(){return a(this,Q).camera.pitch}get minPitch(){return a(this,Q).camera.minPitch}get maxPitch(){return a(this,Q).camera.maxPitch}get bearing(){let t=a(this,Q).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return a(this,Q).camera.minZoomLevel}get maxZoomLevel(){return a(this,Q).camera.maxZoomLevel}setElevation(t){a(this,Q).camera.setElevation(t)}get elevation(){return a(this,Q).camera.elevation}animateElevation(t,e){return a(this,Q).camera.animateElevation(t,e)}};Q=new WeakMap,Kc=new WeakMap,Es=new WeakSet,Uh=p(function(t){var i,o,n,s,c,l;let e=a(this,Q).camera.elevation;return re.is(t)&&t.floorId!=null?(o=(i=a(this,Q).getState(t.floorId))==null?void 0:i.altitude)!=null?o:e:Yt.is(t)?(s=(n=a(this,Q).getState(t.id))==null?void 0:n.altitude)!=null?s:e:"floor"in t&&Yt.is(t.floor)&&(l=(c=a(this,Q).getState(t.floor.id))==null?void 0:c.altitude)!=null?l:e},"#getFloorAltitude"),ep=new WeakSet,H1=p(function(t,e){var s,c;let i=[],n=(Array.isArray(t)?t:[t]).flatMap(l=>{var u;return(u=l==null?void 0:l.focusTarget)!=null?u:[l]});for(let l of n)if(l!=null)if(re.is(l)){let u=V(this,Es,Uh).call(this,l);i.push([l.longitude,l.latitude,u])}else if((l==null?void 0:l.id)!=null){let u=V(this,Es,Uh).call(this,l),h=a(this,Q).getBoundingArea(l.id);if(h)i.push(...h.map(m=>[m[0],m[1],u]));else if(Yt.is(l)){let m=(s=a(this,Q).getState(l.id))==null?void 0:s.altitude,g=a(this,Kc).currentMap.floorsById.get(l.id);if(g!=null&&g.geoJSONBoundingBox){let v=[[g.geoJSONBoundingBox[0],g.geoJSONBoundingBox[1],m],[g.geoJSONBoundingBox[2],g.geoJSONBoundingBox[3],m]];i.push(...v)}}else if("geoJSONBoundingBox"in l){let m=V(this,Es,Uh).call(this,l);if(l.geoJSONBoundingBox!=null){let g=[[l.geoJSONBoundingBox[0],l.geoJSONBoundingBox[1],m],[l.geoJSONBoundingBox[2],l.geoJSONBoundingBox[3],m]];i.push(...g)}else{let g=Os(l.geoJSON);if(g){let v=[[g[0],g[1],m],[g[2],g[3],m]];i.push(...v)}}}}else Yf(l)&&i.push(l);return((c=e==null?void 0:e.axisAlignedPadding)==null?void 0:c.vertical)!==void 0&&(i=V(this,Wh,GS).call(this,i,e.axisAlignedPadding)),i},"#computeCoordinateCloud"),Wh=new WeakSet,GS=p(function(t,e){var n;let i=(n=e==null?void 0:e.vertical)!=null?n:0;return[t.map(s=>{var c;return[s[0],s[1],((c=s[2])!=null?c:0)-i]}),t.map(s=>{var c;return[s[0],s[1],(c=s[2])!=null?c:0]}),t.map(s=>{var c;return[s[0],s[1],((c=s[2])!=null?c:0)+i]})].flat()},"#expandCoordinateCloud"),p(U1,"Camera");var Qc=U1;y();var Ls,W1=class W1{constructor({currentMapGetter:t}){x(this,Ls,void 0);T(this,Ls,t)}get currentMap(){return a(this,Ls).call(this)}async getCurrentSceneGLTF(t){let e=a(this,Ls).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(O.error("There is no map to export. Please load a map first."),new Blob)}};Ls=new WeakMap,p(W1,"Exporter");var tp=W1;y();var Wr,ip,X1=class X1{constructor({currentMapGetter:t}){x(this,Wr,new Map);x(this,ip,void 0);T(this,ip,t)}get currentMap(){return a(this,ip).call(this)}getById(t){return a(this,Wr).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(Xr(o),e,{...i,parentId:Be.is(t)||Dt.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,verticalOffset:o.verticalOffset}),c=new wo(s.id.toString(),e,t);return a(this,Wr).set(c.id,{label:c,entityId:c.id}),c}all(t){var i;let e=[];return(i=this.currentMap)==null||i.Labels.all({onCreate:(o,n,s)=>{let c=new wo(o.toString(),n,s);a(this,Wr).set(c.id,{label:c,entityId:c.id}),e.push(c)},labelOptions:t}),e}remove(t){var i;let e=a(this,Wr).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),a(this,Wr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Wr).forEach(({label:e})=>{this.remove(e),t.push(e),a(this,Wr).delete(e.id.toString())}),t}};Wr=new WeakMap,ip=new WeakMap,p(X1,"Labels");var rp=X1;y();y();var VS={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},jS={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},HS=.5,z1=class z1{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(z1,"Layer");var Ao=z1,Vn,q1=class q1{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,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"footprint");d(this,"floorStackId");d(this,"multiFloorView");x(this,Vn,void 0);d(this,"load",p(()=>{var o,n,s,c,l,u;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(pi,"-").concat(this.id),{},this.id);this.layers.set(pi,new Ao(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(Fr,"-").concat(this.id),{},this.id);this.layers.set(Fr,new Ao(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(Pe,"-").concat(this.id),{},this.id);if(this.layers.set(Pe,new Ao(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 h=this.renderer.addGroupContainer("".concat(Oa,"-").concat(this.id),{},this.id);this.layers.set(Oa,new Ao(this.renderer,h.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,h.id)}if(this.spaces!=null&&this.spaces.features.length>0){let h=this.spaces.features.filter(I=>{var S;return I.geometry.type==="Polygon"&&((S=I.properties.kind)==null?void 0:S.toLowerCase())!=="void"}),m=Z1(h,this.styleMap),g=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),v=0;for(let[I,S]of m){let b=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(v),{features:S},op(I,this.options),g);v++;let C=g.id.toString();this.layers.get(Pe).layers.set(I.id||C,b.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let h=this.obstructions.features.filter(M=>M.geometry.type==="Polygon"&&M.properties.kind==="object"),m=Z1(h,this.styleMap),g=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),v=0;for(let[M,D]of m){let E=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(v),{features:D},op(M,this.options),g);v++;let F=g.id.toString();this.layers.get(Pe).layers.set(M.id||F,E.id.toString())}let I=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!1),S=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!0),b=this.entrances,C=VS,w=VS;if(I!=null&&I.length>0){let M=this.styleMap[(s=I[0].properties)==null?void 0:s.id];M!=null&&(C={...M}),w=C;let{walls:D,entrances:E}=Y1(I,(b==null?void 0:b.features)||[]),F=Math.max(C.height-.11,HS),B={...jS,height:F},G=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),E,B,i);this.layers.get(Pe).layers.set(wa,G.id.toString());let N=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[D]},op(C,this.options),i);this.layers.get(Pe).layers.set(ro,N.id.toString())}if(S!=null&&S.length>0){let M=this.styleMap[(c=S[0].properties)==null?void 0:c.id];M!=null&&(w={...M,id:Ar});let{walls:D,entrances:E}=Y1(S,(b==null?void 0:b.features)||[]),F=Math.max(w.height-.11,HS),B={...jS,height:F},G=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),E,B,i);this.layers.get(Pe).layers.set(Da,G.id.toString());let N=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[D]},op(w,this.options),i);this.layers.get(Pe).layers.set(Ar,N.id.toString())}}if(this.floorImages!=null){let h=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let m of this.floorImages.features||[])"anchorId"in m.properties||"anchorId"in m.properties&&((l=m.properties)==null?void 0:l.anchorId)==null||this.renderer.addImage(be(),m,{url:m.properties.path,flipImageToFaceCamera:!0},h);this.layers.set(Mv,new Ao(this.renderer,h.id.toString()))}return(u=this.multiFloorView)!=null&&u.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var u,h,m,g;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.footprint=(h=s["floor.geojson"])==null?void 0:h.features.find(v=>v.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=o,this.footprint&&((m=this.multiFloorView)!=null&&m.enabled)&&this.obstructions!=null&&this.obstructions.features.length>0){let v=this.obstructions.features.filter(I=>I.geometry.type==="LineString"&&I.properties.kind==="Wall"&&I.properties.footprintComponent===!0);if(v!=null&&v.length>0){let I=this.styleMap[(g=v[0].properties)==null?void 0:g.id],S=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...I,height:this.multiFloorView.floorHeight,altitude:0,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":I.color},this.id);this.layers.set(Ea,new Ao(this.renderer,S.id.toString()))}}}get geoJSONBoundingBox(){if(a(this,Vn))return a(this,Vn);if(!this.footprint){O.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return T(this,Vn,Os(this.footprint)),a(this,Vn)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};Vn=new WeakMap,p(q1,"FloorObject");var np=q1;y();var $1=50,J1=!1,JD=1e3,Te,As,Yr,gr,tt,sp,Fo,Fs,jn,lp,Q1,Hn,cp,pp,up,dp,Di,Xh,YS,hp,Bo,fp,K1,Yh,ZS,Zh,zS,Un,e0=class e0 extends J{constructor({currentMapGetter:e}){super();x(this,lp);x(this,Xh);x(this,fp);x(this,Yh);x(this,Zh);x(this,Te,void 0);x(this,As,0);x(this,Yr,void 0);x(this,gr,!1);x(this,tt,[]);x(this,sp,0);x(this,Fo,$1);x(this,Fs,!1);x(this,jn,"collapsed");d(this,"expandedFactor",0);x(this,Hn,"all-floors");x(this,cp,p(()=>{let e=a(this,Te).call(this);if(a(this,sp)===this.expandedFactor||e==null||!a(this,gr))return;T(this,sp,this.expandedFactor);let i=zi(this.expandedFactor,0,1,0,this.distanceBetweenFloors),n=zi(this.expandedFactor,0,.1,0,1)===0;a(this,tt).forEach((s,c)=>{e.renderer.setState(s.containerId,{visible:n?s.id===e.currentFloorId:!0,altitude:i*c})}),this.expandedFactor===0?(T(this,gr,!1),e.renderer.camera.setPanMode("default"),a(this,Bo)&&a(this,Bo).call(this)):this.expandedFactor===1&&(T(this,gr,!1),a(this,Bo)&&a(this,Bo).call(this))},"#handlePreRender"));x(this,pp,p(()=>{var e,i,o;this.expanded&&T(this,As,(i=(e=a(this,Te).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(o=a(this,Te).call(this))==null||o.renderer.on("user-interaction-end",a(this,dp))},"#handleUserInteractionStart"));x(this,up,p(()=>{var i;let e=a(this,Te).call(this);if(e!=null&&this.expanded&&a(this,Fs)&&!a(this,gr)){let o=e.currentFloorId,n=[1/0,e.currentFloorId];for(let s=0;s<a(this,tt).length;s++){let c=a(this,tt)[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,tt).forEach(s=>{e.renderer.setState(s.containerId,{visible:a(this,Hn)==="all-floors"?!0:e.currentFloor.id===s.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId,previousFloorId:o}))}},"#determineCurrentMapBasedOnElevation"));x(this,dp,p(()=>{var i,o;let e=a(this,Te).call(this);if(this.expanded&&e&&a(this,As)!==((i=e.renderer.camera.elevation)!=null?i:0)){let n=[1/0,e.currentFloorId,0];for(let s=0;s<a(this,tt).length;s++){let c=a(this,tt)[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,Fs)&&V(this,Xh,YS).call(this,n[2]),T(this,As,0),e.renderer.off("user-interaction-end",a(this,dp))}},"#handleUserInteractionEnd"));x(this,Di,null);x(this,hp,null);x(this,Bo,void 0);x(this,Un,void 0);T(this,Te,e);let i=a(this,Te).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",a(this,pp)),i.renderer.on("camera-change",a(this,up)),i.renderer.on("pre-render",a(this,cp)))}get state(){return a(this,jn)}get expanded(){return a(this,jn)!=="collapsed"}get distanceBetweenFloors(){if(a(this,Fo)==="auto"){if(a(this,Un)!=null)return a(this,Un);let e=V(this,Zh,zS).call(this);if(e)return T(this,Un,e),e}return typeof a(this,Fo)=="number"?a(this,Fo):$1}clearCachedFloorSeparationDistance(){T(this,Un,void 0)}get includedFloors(){var e;return(e=a(this,lp,Q1))!=null&&e.api.mapData?a(this,tt).map(i=>{var o,n;return(n=(o=a(this,lp,Q1))==null?void 0:o.api.mapData)==null?void 0:n.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return a(this,Hn)}setFloorVisiblityMode(e){T(this,Hn,e);let i=a(this,Te).call(this);i!=null&&a(this,tt).forEach(o=>{i.renderer.setState(o.containerId,{visible:a(this,Hn)==="all-floors"?!0:i.currentFloor.id===o.id})})}changeFloorOnElevationChanges(e){T(this,Fs,e)}async expand(e){var o,n,s;let i=a(this,Te).call(this);if(i!=null)return(e==null?void 0:e.distanceBetweenFloors)==="auto"?T(this,Fo,"auto"):T(this,Fo,(o=e==null?void 0:e.distanceBetweenFloors)!=null?o:$1),T(this,tt,(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,tt).sort((c,l)=>c.elevation-l.elevation),a(this,tt).length<=1||this.expanded===!0?Promise.resolve():(T(this,gr,!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),V(this,fp,K1).call(this,"expand",e).then(()=>{T(this,jn,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{T(this,gr,!1)}))}async collapse(e){let i=a(this,Te).call(this);if(i!=null)return this.expanded===!0?(T(this,gr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),V(this,fp,K1).call(this,"collapse",e).then(()=>{T(this,jn,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{T(this,gr,!1)})):Promise.resolve()}destroy(){let e=a(this,Te).call(this);e!=null&&(e.renderer.off("user-interaction-start",a(this,pp)),e.renderer.off("camera-change",a(this,up)),e.renderer.off("pre-render",a(this,cp)))}};Te=new WeakMap,As=new WeakMap,Yr=new WeakMap,gr=new WeakMap,tt=new WeakMap,sp=new WeakMap,Fo=new WeakMap,Fs=new WeakMap,jn=new WeakMap,lp=new WeakSet,Q1=p(function(){return a(this,Te).call(this)},"#currentMap"),Hn=new WeakMap,cp=new WeakMap,pp=new WeakMap,up=new WeakMap,dp=new WeakMap,Di=new WeakMap,Xh=new WeakSet,YS=p(function(e){var o,n,s;a(this,Di)&&a(this,Di).stop();let i=a(this,Te).call(this);i!=null&&(T(this,Di,new Lt({elevation:(o=i.renderer.camera.elevation)!=null?o:0}).to({elevation:e},150).easing(De.Quadratic.Out).onComplete(()=>{var c;a(this,Di)&&((c=a(this,Te).call(this))==null||c.renderer.getTweenGroup().remove(a(this,Di)))}).onUpdate(({elevation:c})=>{i.renderer.camera.setElevation(c)}).start()),(n=a(this,Te).call(this))==null||n.renderer.getTweenGroup().add(a(this,Di)),(s=a(this,Te).call(this))==null||s.renderer.render())},"#animateElevationTo"),hp=new WeakMap,Bo=new WeakMap,fp=new WeakSet,K1=p(function(e,i){var c,l,u,h;a(this,Yr)&&a(this,Yr).stop();let o=a(this,Te).call(this);if(o==null)return Promise.reject(new Error("No current map"));let n=a(this,tt).indexOf(o.currentFloor),s=(c=o.renderer.camera.elevation)!=null?c:0;return T(this,hp,new Promise(m=>{T(this,Bo,m)})),T(this,Yr,new Lt({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:JD).easing(ps[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m;let g=n*this.distanceBetweenFloors;o.renderer.camera.setElevation(e==="expand"?g*m:s*m)}).onComplete(()=>{var m;a(this,Yr)&&((m=a(this,Te).call(this))==null||m.renderer.getTweenGroup().remove(a(this,Yr)))}).start()),a(this,Yr).cameraAnimation=!0,(u=a(this,Te).call(this))==null||u.renderer.getTweenGroup().add(a(this,Yr)),(h=a(this,Te).call(this))==null||h.renderer.render(),a(this,hp)},"#animate"),Yh=new WeakSet,ZS=p(function(e,i,o,n){let s=XS(e,o),c=0,l,u,h=new wt;do{if(c>1e4)return-1;c+=5;let m=h.copy(i).translate(new W(0,0,c));if(l=XS(m,o),u=s.intersectsBox(l),J1){let g=new hu(m,u?"red":"green"),v=new W;m.getCenter(v),g.position.copy(v),n.add(g)}}while(u);return c},"#computeMinZOffsetToSeparateFirstTwoFloors"),Zh=new WeakSet,zS=p(function(){let e=a(this,Te).call(this);if(!e)return;let i=e.renderer,o=i.getThreeScene();if(!e.api.mapData||!o)return;let s=a(this,tt).length>0?a(this,tt):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;yf(c,"group-container"),yf(l,"group-container");let u=new wt;if(u.setFromObject(c),J1){let v=new hu(u,"blue");o.add(v)}let h=new wt;if(h.setFromObject(l),J1){let v=new hu(h,"red");o.add(v)}let m=i.getThreeCamera();if(!rl(u)||!rl(h))return;let g=V(this,Yh,ZS).call(this,u,h,m,o);if(g!==-1)return g},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),Un=new WeakMap,p(e0,"StackedMaps");var ap=e0;function QD(r){let t=r,e=t.min,i=t.max;return[new W(e.x,e.y,e.z),new W(e.x,e.y,i.z),new W(e.x,i.y,e.z),new W(e.x,i.y,i.z),new W(i.x,e.y,e.z),new W(i.x,e.y,i.z),new W(i.x,i.y,e.z),new W(i.x,i.y,i.z)]}p(QD,"getCornersOfBox");var US=new W,WS=new ee;function XS(r,t){let e=QD(r),i=new E2;return e.forEach(o=>{US.copy(o).project(t),WS.copy(US),i.expandByPoint(WS)}),i}p(XS,"projectToBox2D");y();var Bs,t0=class t0{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");x(this,Bs,void 0);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,Bs)==null){this.floorObjects.length===0&&O.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)),T(this,Bs,t)}return a(this,Bs)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){O.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})})}};Bs=new WeakMap,p(t0,"FloorStackObject");var mp=t0;y();function qS(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=[Fr,Pe,pi,Oa],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(Ea))):i.includes(s.id)&&s.elevation<t.elevation?(o.floorStates[n].visible=!0,o.floorStates[n].visibleLayers=[Ea,Fr,Pe,Oa],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=[Ea],o.floorStates[n].footprint.height=e,o.floorStates[n].footprint.altitude=0)}return o}p(qS,"getVisiblityState");y();y();y();y();var ks,Wn,rt,gp,_s,vp,bp,Rs,At,r0=class r0{constructor(t,e,i){d(this,"id");x(this,ks,void 0);x(this,Wn,void 0);x(this,rt,void 0);x(this,gp,void 0);x(this,_s,[]);x(this,vp,!1);x(this,bp,1);x(this,Rs,new Map);x(this,At,void 0);this.id=t.id,T(this,ks,t),T(this,Wn,e),T(this,rt,i),this.setDefaultFloor(this.defaultFloor)}get floorStack(){return a(this,Wn)}get defaultFloor(){var t;return(t=a(this,gp))!=null?t:a(this,Wn).defaultFloor}setDefaultFloor(t){T(this,gp,t),this.updateChildGeometryIds(t)}updateChildGeometryIds(t){T(this,_s,[]);let e=a(this,rt).getState(t.layers.get(Pe).containerId);for(let i of e.children){let o=a(this,rt).getState(i);for(let n of o.children){let s=a(this,rt).getState(n);s&&a(this,_s).push(s.id.toString())}}}set focusable(t){T(this,vp,t),a(this,ks).spaces.forEach(e=>{let i=a(this,rt).getState(e.id);i&&a(this,rt).setState(i,{focusable:t,renderOrder:t?2:0})})}get focusable(){return a(this,vp)}set opacity(t){T(this,bp,t),a(this,ks).spaces.forEach(e=>{let i=a(this,rt).getState(e.id);i&&(a(this,Rs).has(e.id)||a(this,Rs).set(e.id,i.opacity),a(this,rt).setState(i,{opacity:Math.min(a(this,Rs).get(e.id),t)}))})}get opacity(){return a(this,bp)}animateOpacity(t,e=300){a(this,At)&&a(this,At).stop(),t<1&&this.defaultFloor.setVisible(!0),T(this,At,new Lt({opacity:this.opacity}).easing(De.Quadratic.In).to({opacity:t},e).onUpdate(({opacity:i})=>{this.opacity=i,a(this,_s).forEach(o=>{a(this,rt).setState(a(this,rt).getState(o),{opacity:1-i})})}).onStop(()=>{a(this,At)&&(a(this,rt).getTweenGroup().remove(a(this,At)),T(this,At,void 0))}).onComplete(()=>{a(this,At)&&(a(this,rt).getTweenGroup().remove(a(this,At)),T(this,At,void 0)),this.opacity===1&&a(this,Wn).floorObjects.forEach(i=>{i.setVisible(!1)})})),a(this,At).start(),a(this,rt).getTweenGroup().add(a(this,At)),a(this,rt).render()}};ks=new WeakMap,Wn=new WeakMap,rt=new WeakMap,gp=new WeakMap,_s=new WeakMap,vp=new WeakMap,bp=new WeakMap,Rs=new WeakMap,At=new WeakMap,p(r0,"FacadeObject");var yp=r0;var JS=!1,br,Xn,Ns,ko,Cp,Yn,Cr,Nt,vr,qh,QS,Sp,i0,Gs,zh,Ei,xp,Ip,o0,Vs,n0=class n0 extends J{constructor(e,i,{currentMapGetter:o}){super();x(this,Nt);x(this,qh);x(this,Sp);x(this,Gs);x(this,Ip);x(this,br,void 0);x(this,Xn,!1);x(this,Ns,17);x(this,ko,!1);x(this,Cp,void 0);x(this,Yn,void 0);x(this,Cr,new Map);x(this,Ei,new Set);x(this,xp,p(e=>{if(!a(this,Xn)||e.length===0||!a(this,ko))return;let i=-1/0,o,n=!1,s=new Set,c=new Map;e.forEach((l,u)=>{var v;let h=V(this,Sp,i0).call(this,l);if(!h)return;let m=1-u/e.length,g=((v=c.get(h.id))!=null?v:0)+m;c.set(h.id,g),g>i&&(i=g,o=h),a(this,Ei).has(h.id)||(V(this,Gs,zh).call(this,h.id,0),n=!0),s.add(h.id)}),JS&&O.log("likelyInFocus:",[o==null?void 0:o.floorStack.name,i],"Weights:",e.flatMap(l=>{let u=V(this,Sp,i0).call(this,l);return u?[u.floorStack.name,c.get(u.id)]:[]}));for(let l of a(this,Ei))s.has(l)||(V(this,Gs,zh).call(this,l,1),n=!0);T(this,Ei,s),o&&a(this,Nt,vr).currentFloorStackId!==o.floorStack.id&&(V(this,qh,QS).call(this,o.id),n=!0),n&&this.publish("focus-change",{facades:Array.from(a(this,Ei)),spaces:e})},"#handleEntitiesInFocus"));x(this,Vs,p(e=>{if(e.zoomLevel>=a(this,Ns)&&!a(this,ko))T(this,ko,!0);else if(e.zoomLevel<a(this,Ns)&&a(this,ko)){T(this,ko,!1);for(let i of a(this,Cr).values())i.opacity<1&&V(this,Gs,zh).call(this,i.id,1);a(this,Ei).clear(),a(this,Nt,vr).outdoorFloorStacks.size>0&&!a(this,Nt,vr).outdoorFloorStacks.has(a(this,Nt,vr).currentFloorStackId)&&(a(this,Nt,vr).setFloorStack(a(this,Nt,vr).outdoorFloorStacks.values().next().value,"dynamic-focus"),this.publish("focus-change",{facades:[],spaces:[]}))}},"#handleCameraChange"));T(this,br,e),T(this,Cp,o),T(this,Yn,i)}get focusedFacades(){return Array.from(a(this,Ei)).map(e=>{var i;return(i=a(this,Yn).getMapDataInternal())==null?void 0:i.getById("facade",e)}).filter(e=>e!=null)}enable(e){var i;T(this,Ns,(i=e==null?void 0:e.minZoomLevel)!=null?i:17),this.enabled||(a(this,br).on("geometry-in-focus",a(this,xp)),a(this,br).on("camera-change",a(this,Vs)),a(this,Vs).call(this,a(this,br).camera),V(this,Ip,o0).call(this,!0),T(this,Xn,!0)),JS&&a(this,br).getSystems().geometryInFocusSystem.showRaycasters()}disable(){T(this,Xn,!1),a(this,br).off("geometry-in-focus",a(this,xp)),a(this,br).off("camera-change",a(this,Vs)),V(this,Ip,o0).call(this,!1)}get enabled(){return a(this,Xn)}setDefaultFloorForStack(e,i){a(this,Nt,vr)==null&&O.throw("Current map does not exist.");let o=a(this,Nt,vr).floorsById.get(i.id);if(o==null){O.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(o.floorStackId!==e.id){O.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,Cr).get(e.facade.id);n&&n.setDefaultFloor(o)}resetDefaultFloorForStack(e){let i=e.facade&&a(this,Cr).get(e.facade.id);i&&i.setDefaultFloor(i.floorStack.defaultFloor)}};br=new WeakMap,Xn=new WeakMap,Ns=new WeakMap,ko=new WeakMap,Cp=new WeakMap,Yn=new WeakMap,Cr=new WeakMap,Nt=new WeakSet,vr=p(function(){return a(this,Cp).call(this)},"#currentMap"),qh=new WeakSet,QS=p(function(e){let i=a(this,Cr).get(e);i&&a(this,Nt,vr).setFloor(i.defaultFloor.id,"dynamic-focus")},"#setFloorByFacadeId"),Sp=new WeakSet,i0=p(function(e){var o;let i=(o=a(this,Yn).getMapDataInternal())==null?void 0:o.facadesBySpaceId[e];return a(this,Cr).get(i.id)},"#getFacadeBySpaceId"),Gs=new WeakSet,zh=p(function(e,i){let o=a(this,Cr).get(e);o&&o.animateOpacity(i)},"#setFacadeOpacity"),Ei=new WeakMap,xp=new WeakMap,Ip=new WeakSet,o0=p(function(e){var i;(i=a(this,Yn).getMapDataInternal())==null||i.facades.forEach(o=>{let n=a(this,Cr).get(o.id);n==null&&(n=new yp(o,a(this,Nt,vr).floorStacksById.get(o.floorStack.id),a(this,br)),a(this,Cr).set(o.id,n)),n.focusable=e})},"#setAllFacadesFocusable"),Vs=new WeakMap,p(n0,"DynamicFocus");var js=n0;var eE=5,tE={linear:De.Linear.None,easeIn:De.Quadratic.In,easeOut:De.Quadratic.Out,easeInOut:De.Quadratic.InOut},Zr,s0=class s0 extends J{constructor(e,i,o,n){var u,h,m,g;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:(e,i,o)=>{let{floorId:n,...s}=o,c=n?this.floorsById.get(n):this.currentFloor,l=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(u=>{var h,m;return{type:"Feature",properties:{id:be(),rotation:(h=u.rotation)==null?void 0:h.map(g=>g*(Math.PI/180)),scale:u.scale,interactive:u.interactive,verticalOffset:u.target.anchorTarget.verticalOffset+((m=u.verticalOffset)!=null?m:0)},geometry:{type:"Point",coordinates:Xr(u.target)}}})},s,{parent:c.id});if(l==null)throw new Error("error creating model");return this.renderer.getState(l).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});d(this,"Images",{add:(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(be(),u,{url:i,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});d(this,"Markers",{add:(e,i,o)=>{var c;let n=e.floorId?this.floorsById.get(e.floorId):this.currentFloor,s=o;return o.rank==="initial"&&(s.rank="medium"),this.renderer.addMarker2D(Xr(e),i,{...s,occluderId:n==null?void 0:n.occluderId,verticalOffset:e.verticalOffset},(c=n==null?void 0:n.layers.get(Fr))==null?void 0:c.containerId)},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(e,i,o)=>{var c;let n=this.renderer.getState(e),s=o?this.floorsById.get(o):this.currentFloor;if(!n){O.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(n.type!=="marker"){O.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(Fr))==null?void 0:c.containerId})},animateTo:(e,i,o,n)=>{let s=this.renderer.getState(e),c=o?this.floorsById.get(o):this.currentFloor;if(!s)return O.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(s.type!=="marker")return O.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 Lt({lon:s.position[0],lat:s.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(tE[l.easing]).onUpdate(({lon:h,lat:m})=>{var v;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let I=(v=c==null?void 0:c.layers.get(Fr))==null?void 0:v.containerId;I&&this.Markers.setPosition(e,[h,m],I)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(e,u),a0(u).then(()=>{this.animations.delete(e)})}});d(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});d(this,"Shapes",{add:(e,i,o)=>{let n=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=be();return this.renderer.addGeometryGroup(s,e,i,n.id),s},remove:e=>(this.renderer.remove(e.id),e.id)});d(this,"Text3D",{label:(e,i,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){O.warn("Enterprise mode is not enabled, skipping label creation");return}let n=KS(this.renderer,e,i,o);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode))return O.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=KS(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},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){O.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});d(this,"Labels",{all:({onCreate:e,labelOptions:i={}})=>{for(let o of Object.entries(this.mvf.space)){let[n,s]=o;s&&s.features.forEach(c=>{var S,b,C,w,M;let l=(S=this.api.getMapData())==null?void 0:S.getById("space",c.properties.id);if(!l)return;let u=(b=this.styleMap[c.properties.id])==null?void 0:b.showImage,h=(C=c.properties.details)==null?void 0:C.images,g={marker:{...u&&((w=h==null?void 0:h[0])!=null&&w.url)?{icon:h[0].url}:{},...(M=i.appearance)==null?void 0:M.marker},...i.appearance},I=(n?this.floorsById.get(n):this.currentFloor).layers.get(pi);if(c.properties.center&&c.properties.externalId!==""){let D=this.renderer.addLabel2D(c.properties.center,c.properties.externalId,{id:c.properties.id+"-label",...i,appearance:g,rank:i.rank},Be.is(l)?l.id:I==null?void 0:I.containerId);D&&(Be.is(l)&&I&&I.labelIds.add(D.id.toString()),e(D.id,c.properties.externalId,l))}})}},add:(e,i,o={})=>{let{floorId:n,...s}=o,c=n?this.floorsById.get(n):this.currentFloor,l=c.layers.get(pi),u=this.renderer.addLabel2D(e,i,{...s,occluderId:c.occluderId,verticalOffset:o.verticalOffset},(o==null?void 0:o.parentId)||(l==null?void 0:l.containerId));if(!u)throw new Error("label creating failed");return o!=null&&o.parentId&&l&&l.labelIds.add(u.id.toString()),u},remove:({label:e,entityId:i})=>{var o;if(Be.is(e.target)){let n=this.floorsById.get(e.target.floor.id);n&&((o=n.layers.get(pi))==null||o.labelIds.delete(e.id.toString()))}this.renderer.remove(i)},removeAll:()=>{}});d(this,"Paths",{add:(e,i)=>{var u;let o=[],n=e[0].floorId||"root",s=0;for(let h of e){let{floorId:m="root",latitude:g,longitude:v}=h;m!==n&&(s++,n=m),o[s]==null&&o.push({floorId:m,coordinates:[]}),o[s].coordinates.push([v,g])}let c=o.reduce((h,{floorId:m,coordinates:g},v)=>{if(v!==0){let S=o[v-1],b=g[0],C=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:S.floorId},geometry:{type:"Point",coordinates:S.coordinates[S.coordinates.length-1]}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:b}}]},i,this.id);C&&h.push(C)}let I=this.renderer.addPath({type:"FeatureCollection",features:g.map(S=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:S}}))},i,m);return I&&h.push(I),h},[]),l=new Lt({fraction:0}).to({fraction:1},(u=i==null?void 0:i.drawDuration)!=null?u:1e3).onUpdate(({fraction:h})=>{c.forEach(m=>{this.renderer.setState(m.id,{completeFraction:h})})}).start();return this.renderer.getTweenGroup().add(l),this.renderer.render(),this.animations.set(c[0].id.toString(),l),{paths:c,animation:a0(l).then(()=>{this.animations.delete(c[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});x(this,Zr,{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 ap({currentMapGetter:()=>this}),this.DynamicFocus=new js(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(u=i==null?void 0:i.mvf)!=null?u:{};let s=ex(this.mvf["styles.json"]||{});if(this.styleMap=s,T(this,Zr,{enabled:!1,floorHeight:eE,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!i){this.id!=="outdoors-container"&&O.warn("Map (".concat(this.id,") created with no data."));let v=new mp({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 I=new np(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,a(this,Zr),o!=null?o:{});v.addFloor(I),this.floorsById.set(I.id,I),this.setFloor(I.id);return}let c=i.getMVFFeatureByType("floor-stack");(c==null||c.length===0)&&O.throw("MVF does not contain any Floor Stacks.");for(let v of c){let I=new mp(v,this.id,this.renderer,(h=this.mvf.facade)==null?void 0:h[v.id]);if(I.floorIds.length!==0){for(let S of I.floorIds){let b=i.getMVFFeatureById("floor",S);if(b!=null){let C=this.mvf.space[b.id],w=this.mvf.obstruction[b.id];if((C==null||C.features.length===0)&&(w==null||w.features.length===0))continue;let M=new np(I.id,b,this.renderer,a(this,Zr),o!=null?o:{},this.mvf,s);I.addFloor(M),this.floorsById.set(M.id,M)}}this.floorStacksById.set(v.id,I),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(i.facadesBySpaceId)){let I=i.getById("space",v);I&&(this.outdoorFloorStacks.add(I.floor.floorStack.id),(m=this.floorsById.get(I.floor.id))==null||m.setVisible(!0))}let l=(g=this.mvf.enterprise)==null?void 0:g.venue.defaultMap;if(o!=null&&o.initialFloor){let v=yl(o.initialFloor);v&&this.floorsById.has(v)?l=v:O.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||O.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){O.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){O.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||O.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,Zr))!=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(m=>{m.id!==e&&m.setVisible(!1)});else{let h=qS(this.currentFloorStack.floorObjects,i,a(this,Zr).floorHeight,((c=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:c.map(m=>m.id))||[]);(u=(l=this.api)==null?void 0:l.Outdoor)==null||u.setOpacity(h.outdoorOpacity),h.floorStates.forEach(m=>{m.floor.setVisible(m.visible);for(let[g,v]of m.floor.layers)m.visibleLayers.includes(g)?v.show():v.hide();this.renderer.setState("Footprint-".concat(m.floor.id),{height:m.footprint.height,altitude:m.footprint.altitude})}),a(this,Zr).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*a(this,Zr).floorHeight)}}setFloor(e,i){if(this.currentFloorId===e)return;if(!this.floorsById.has(e)){O.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}if(this.publish("floor-change-start",{floorId:e}),this.DynamicFocus.enabled){let n=this.floorsById.get(e);if(!this.outdoorFloorStacks.has(this.currentFloorStack.id)&&(n==null?void 0:n.floorStackId)===this.currentFloorStack.id){let s=this.floorsById.get(this.currentFloorId);s==null||s.setVisible(!1)}}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));let o=this.currentFloorId;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:o})}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};Zr=new WeakMap,p(s0,"GeojsonApiMapObject");var Pp=s0;function KS(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}p(KS,"labelSpace");y();var Sr,Tp,l0=class l0{constructor({currentMapGetter:t}){x(this,Sr,new Map);x(this,Tp,void 0);T(this,Tp,t)}get currentMap(){return a(this,Tp).call(this)}getById(t){return a(this,Sr).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 Ii(s.id.toString(),c,t);return a(this,Sr).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var i;let e=a(this,Sr).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),a(this,Sr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Sr).forEach(({marker:e})=>{this.remove(e),t.push(e),a(this,Sr).delete(e.id.toString())}),t}setPosition(t,e){var s;let i=e.anchorTarget;if(!i){O.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){O.error("Cannot determine the current map.");return}let n=a(this,Sr).get(t.id);if(!n){O.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(n.entityId,Xr(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 O.error("Cannot determine coordinate from target."),Promise.resolve();let n=this.currentMap;if(!n)return O.error("Cannot determine the current map."),Promise.resolve();let s=a(this,Sr).get(t.id);return s?(s.marker.updateTarget(e),n.Markers.animateTo(s.entityId,Xr(o),(c=o.floorId)!=null?c:n.currentFloorId,i)):(O.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Sr=new WeakMap,Tp=new WeakMap,p(l0,"Markers");var Mp=l0;y();var Oi,Dp,c0=class c0{constructor({currentMapGetter:t}){x(this,Oi,new Map);x(this,Dp,void 0);T(this,Dp,t)}get currentMap(){return a(this,Dp).call(this)}getById(t){return a(this,Oi).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(Xr(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 Hc(s.id.toString(),e,t);return a(this,Oi).set(c.id,{image:c,entityId:s.id.toString()}),c}remove(t){var i;let e=a(this,Oi).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),a(this,Oi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Oi).forEach(({image:e})=>{this.remove(e),t.push(e),a(this,Oi).delete(e.id.toString())}),t}};Oi=new WeakMap,Dp=new WeakMap,p(c0,"Images");var wp=c0;y();var zr,Op,p0=class p0{constructor({currentMapGetter:t}){x(this,zr,new Map);x(this,Op,void 0);T(this,Op,t)}get currentMap(){return a(this,Op).call(this)}getById(t){return a(this,zr).get(t)}add(t,e){let i=Array.isArray(t)?t:[t],o=i.reduce((c,l)=>{var h;let u=l.target.anchorTarget;return u?(c.has(u.floorId)||c.set(u.floorId,[]),(h=c.get(u.floorId))==null||h.push({...l,target:u}),c):(O.error("Cannot determine coordinate from options."),c)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=[];return o.forEach((c,l)=>{let u=be();n.Models.add(u,c,{...e,floorId:l}).forEach(({id:m})=>{let g=new kn(m.toString(),u);a(this,zr).set(g.id,{model:g,entityId:m.toString(),groupId:u}),s.push(g)})}),Array.isArray(t)?s:s[0]}remove(t){var i;let e=a(this,zr).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),a(this,zr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,zr).forEach(({model:e})=>{var o;let i=a(this,zr).get(e.id);i&&(t.push(e),(o=this.currentMap)==null||o.Models.remove(i.entityId,i.groupId),a(this,zr).delete(e.id.toString()))}),t}};zr=new WeakMap,Op=new WeakMap,p(p0,"Models");var Ep=p0;y();var qr,Ap,u0=class u0{constructor({currentMapGetter:t}){x(this,qr,new Map);x(this,Ap,void 0);T(this,Ap,t)}get currentMap(){return a(this,Ap).call(this)}getById(t){return a(this,qr).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 _n(be(),o.animation,t);for(let c of n)a(this,qr).set(c,{path:s,entityIds:n});return a(this,qr).set(s.id,{path:s,entityIds:n}),s}remove(t){var i;let e=a(this,qr).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),a(this,qr).delete(t.id),e.entityIds.forEach(o=>a(this,qr).delete(o)))}removeAll(){let t=[];return a(this,qr).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};qr=new WeakMap,Ap=new WeakMap,p(u0,"Paths");var Lp=u0;y();var dx=ru(Ux(),1);y();var d0="#2266ff",rE="#808080",tx="#f5f5f5";var rx={radius:10,color:d0,inactiveColor:rE,heading:{color:d0,opacity:.7},accuracyRing:{color:d0,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};y();var ix="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";y();var ox=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 Mr;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 Tr(c,{depth:.1,bevelEnabled:!1,UVGenerator:oE(t)})},"createSectorGeometry"),h0=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"),oE=p(r=>({generateTopUV:(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],m=e[n*3+1];return[h0(s,c,r),h0(l,u,r),h0(h,m,r)]},generateSideWallUV:()=>[new ee(0,1),new ee(0,1),new ee(0,1),new ee(0,1)]}),"radialUVGenerator");function nx(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(nx,"getPositionWithOverrides");function nE([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 m=ou([o,n],h);return{proportion:Math.max(0,Math.min(1,u)),intersection:h,distance:m}}p(nE,"getPointLineIntersection");function ax(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=nE(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(ax,"findBlueDotOnPath");function sx(r,t){let e=new ii({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,o=.35*4,n=ox(Math.PI/6,o,i);new ua().load(ix,c=>{e.alphaMap=c,e.needsUpdate=!0});let s=new le(n,e);return s.position.z=-.05,s.renderOrder=0,s}p(sx,"createHeadingCone");function lx(r,t){let e=new pu(1,1,.05,32),i=new ii({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),o=new le(e,i);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}p(lx,"createAccuracyRing");function cx(r){let t=new pu(.35,.35,.07,32),e=new ii({transparent:!0,color:tx,depthTest:!1,depthWrite:!1}),i=new le(t,e);i.renderOrder=2;let o=new pu(.35*.8,.35*.8,.01,32),n=new ii({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),s=new le(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(cx,"createBlueDot");var hx=ru(px(),1);var Zn,Li,Gt,Vt,Ai,zn,qn,$n,_e,Ft,Fp,Fi,Bp,kp,_p,Rp,Jh,$r,Bi,Qh,Jn,Np,Jr,f0=class f0 extends J{constructor(e,i){super();this.core=e;this.geoJSONApi=i;x(this,Zn,null);d(this,"geometry");x(this,Li,void 0);x(this,Gt,void 0);x(this,Vt,void 0);x(this,Ai,void 0);x(this,zn,void 0);x(this,qn,void 0);x(this,$n,void 0);x(this,_e,rx);x(this,Ft,1);x(this,Fp,void 0);x(this,Fi,void 0);d(this,"state","disabled");d(this,"following",!1);x(this,Bp,p(e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)},"#getFloorByFloorId"));x(this,kp,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,Bp).call(this,n.id):void 0}return i},"#getFloorByFloorLevel"));x(this,_p,p(e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,o,n,s]=e.children;if(a(this,Jh).call(this),o.scale.set(a(this,Ft),a(this,Ft),a(this,Ft)),o.position.z=.07/2*a(this,Ft),n.scale.set(a(this,Ft),a(this,Ft),a(this,Ft)),n.position.z=.07*a(this,Ft),this.state==="active"){n.material.color.set(a(this,_e).color);let c=this.accuracy;c!=null?(i.visible=!0,a(this,qn)&&a(this,qn).stop(),T(this,qn,new Lt({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,qn))):i.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,a(this,$n)&&a(this,$n).stop();let{start:u,end:h}=nu(s.rotation.z,-ue.degToRad(l));T(this,$n,new Lt({rotation:u}).to({rotation:h},150).onUpdate(({rotation:m})=>{s.rotation.z=m}).start()),this.core.getTweenGroup().add(a(this,$n)),s.scale.set(a(this,Ft),a(this,Ft),1)}else s.visible=!1}else this.state==="inactive"&&(n.material.color.set(a(this,_e).inactiveColor),s.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));x(this,Rp,p(e=>{var s,c;let i;try{i=pE.parse(nx(e,a(this,Gt)))}catch(l){a(this,$r).call(this,"error"),O.error("BlueDot: Position parse failed",l instanceof R.ZodError?l.message:String(l)),this.publish("error");return}a(this,_e).debug&&O.log("BlueDot: Parsed position",i),T(this,Vt,i),a(this,$r).call(this,"position-update"),a(this,Ai)&&clearTimeout(a(this,Ai)),typeof a(this,_e).timeout=="number"&&a(this,_e).timeout<1/0&&T(this,Ai,setTimeout(()=>{a(this,_e).debug&&O.log("BlueDot: Position timed out after ".concat(a(this,_e).timeout,"ms")),a(this,$r).call(this,"timeout"),this.core.render()},a(this,_e).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("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:l=>{let u=lx(a(this,_e).accuracyRing.color,a(this,_e).accuracyRing.opacity),{outerMesh:h,innerMesh:m}=cx(a(this,_e).color),g=sx(a(this,_e).heading.color,a(this,_e).heading.opacity);l.add(u),u.visible=!1,l.add(h),l.add(m),l.add(g),g.visible=!1,a(this,_p).call(this,l)},update:a(this,_p)},{visible:!0},o);else{let l=this.core.getState(this.geometry);n=[l.position[0],l.position[1]]}a(this,zn)&&a(this,zn).stop(),T(this,zn,new Lt(n).to([i.longitude,i.latitude],1e3).easing(De.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,zn)),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{cE.parse(e)}catch(l){a(this,$r).call(this,"error"),O.error("BlueDot: Browser sent invalid position",l instanceof R.ZodError?l.message:String(l)),this.publish("error");return}T(this,Li,{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,kp).call(this,(c=e.coords)==null?void 0:c.floorLevel)}),a(this,Rp).call(this,a(this,Li))}},"onPositionUpdate"));d(this,"onPositionError",p(e=>{var i;switch(a(this,$r).call(this,"error"),e.code){case e.PERMISSION_DENIED:O.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:O.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:O.error("Geolocation request timed out.",e);break;default:O.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)},"onPositionError"));x(this,Jh,p(()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==a(this,Fp)){T(this,Fp,e);let o=(i=this.core.getMetresPerPixel())!=null?i:1;T(this,Ft,Math.max(a(this,_e).radius/(.35/o),1))}},"#updateScale"));x(this,$r,p(e=>{let i=lE[this.state].actions[e];if(i){switch(a(this,_e).debug&&O.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 O.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))},"#transitionAction"));x(this,Bi,void 0);x(this,Qh,p(()=>{if(a(this,Bi)==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);T(this,Bi,(0,hx.default)(i.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return a(this,Bi)},"#getSimplifiedDirections"));x(this,Jn,p(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),a(this,Jr)&&(this.off("position-update",a(this,Jr)),T(this,Jr,void 0)),this.following=!1,T(this,Bi,void 0),this.core.off("user-interaction-start",a(this,Jn)),this.geoJSONApi.currentMap.off("navigation-active-path-change",a(this,Np)),this.publish("follow-change",{following:!1})},"#cancelFollow"));x(this,Np,p(()=>{T(this,Bi,void 0)},"#pathChangeHandler"));x(this,Jr,void 0);d(this,"follow",p((e,i)=>{var n,s,c,l;if(e===!1){a(this,Jn).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&O.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,Jr)&&this.off("position-update",a(this,Jr)):(this.following=!0,this.core.on("user-interaction-start",a(this,Jn)),this.geoJSONApi.currentMap.on("navigation-active-path-change",a(this,Np))),T(this,Jr,u=>{let{coordinate:h,heading:m,floor:g}=u;if(o.center=[h.longitude,h.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),T(this,Bi,void 0)),e==="position-and-heading")o.bearing=m!=null?m:void 0;else if(e==="position-and-path-direction"){let v=a(this,Qh).call(this);if(v!=null){let I=ax(v,[h.longitude,h.latitude]);if(I!=null){let S=v[I.segmentIndex],b=v[I.segmentIndex+1];o.bearing=o2(S,b)}}}this.core.camera.animateTo(o)}),this.on("position-update",a(this,Jr)),this.publish("follow-change",{following:!0,mode:e})},"follow"))}get heading(){var e;return(e=a(this,Vt))==null?void 0:e.heading}get accuracy(){var e;return(e=a(this,Vt))==null?void 0:e.accuracy}get coordinate(){var e,i;if(a(this,Vt)!=null)return(a(this,Fi)==null||((e=this.floor)==null?void 0:e.id)!==a(this,Fi).floorId||a(this,Vt).latitude!==a(this,Fi).latitude||a(this,Vt).longitude!==a(this,Fi).longitude)&&T(this,Fi,new re(a(this,Vt).latitude,a(this,Vt).longitude,(i=this.floor)==null?void 0:i.id)),a(this,Fi)}get floor(){var e;return(e=a(this,Vt))==null?void 0:e.floor}enable(e){T(this,_e,(0,dx.default)({},e,a(this,_e))),a(this,$r).call(this,"enable"),this.watchDevicePosition(a(this,_e).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),a(this,Ai)&&(clearTimeout(a(this,Ai)),T(this,Ai,void 0)),this.following&&a(this,Jn).call(this),this.watchDevicePosition(!1),T(this,Vt,void 0),T(this,Gt,void 0),a(this,$r).call(this,"disable")}watchDevicePosition(e){if(a(this,Zn)&&(navigator.geolocation.clearWatch(a(this,Zn)),T(this,Zn,null)),a(this,Li)&&T(this,Li,void 0),e){if(this.state==="disabled"){O.warn("BlueDot must be enabled before watching browser position.");return}T(this,Zn,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var o,n;e==null?T(this,Gt,void 0):"coords"in e?T(this,Gt,Object.assign({},a(this,Gt),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:a(this,kp).call(this,e.coords.floorLevel)})):(T(this,Gt,Object.assign({},a(this,Gt),e)),"floorOrFloorId"in e&&(a(this,Gt).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?a(this,Bp).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((o=a(this,Gt))==null?void 0:o.latitude)!=null&&((n=a(this,Gt))==null?void 0:n.longitude)!=null||a(this,Li)!=null)&&a(this,Rp).call(this,a(this,Li))}};Zn=new WeakMap,Li=new WeakMap,Gt=new WeakMap,Vt=new WeakMap,Ai=new WeakMap,zn=new WeakMap,qn=new WeakMap,$n=new WeakMap,_e=new WeakMap,Ft=new WeakMap,Fp=new WeakMap,Fi=new WeakMap,Bp=new WeakMap,kp=new WeakMap,_p=new WeakMap,Rp=new WeakMap,Jh=new WeakMap,$r=new WeakMap,Bi=new WeakMap,Qh=new WeakMap,Jn=new WeakMap,Np=new WeakMap,Jr=new WeakMap,p(f0,"BlueDot");var Us=f0,lE={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"}}},cE=R.object({coords:R.object({latitude:R.number(),longitude:R.number(),accuracy:R.number(),altitude:R.number().optional().nullable(),altitudeAccuracy:R.number().optional().nullable(),heading:R.number().optional().nullable(),speed:R.number().optional().nullable(),floorLevel:R.number().optional().nullable()}),timestamp:R.number()}),pE=R.object({latitude:R.number(),longitude:R.number(),floor:R.custom().optional(),accuracy:R.number().optional(),heading:R.number().optional().nullable()});y();var ki,Vp,m0=class m0{constructor({currentMapGetter:t}){x(this,ki,new Map);x(this,Vp,void 0);T(this,Vp,t)}get currentMap(){return a(this,Vp).call(this)}getById(t){return a(this,ki).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 Eo(n);return a(this,ki).set(s.id,s),s}remove(t){var i;a(this,ki).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),a(this,ki).delete(t.id.toString()))}removeAll(){let t=[];return a(this,ki).forEach(e=>{this.remove(e),t.push(e.id),a(this,ki).delete(e.id.toString())}),t}};ki=new WeakMap,Vp=new WeakMap,p(m0,"Shapes");var Gp=m0;y();var Hp,y0=class y0{constructor({currentMapGetter:t}){x(this,Hp,void 0);T(this,Hp,t)}get currentMap(){return a(this,Hp).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(Pe))continue;let c=s.layers.get(Pe);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===ro&&!(Ar in t)){let l=c.layers.get(Ar);l&&"color"in t[n]&&((o=this.currentMap)==null||o.renderer.setState(l,{color:t[n].color}))}}}};Hp=new WeakMap,p(y0,"Style");var jp=y0;y();var g0={opacity:1},lt,Up,Wp,Ro,_i,Xp,v0,Kh,fx,b0=class b0{constructor(t,e){x(this,Xp);x(this,Kh);x(this,lt,void 0);x(this,Up,[]);x(this,Wp,{opacity:"initial"});x(this,Ro,{opacity:new Map});x(this,_i,new Set);T(this,lt,t),T(this,Up,e||[]);let i=a(this,lt).map;i&&i.on("idle",()=>{a(this,Ro).opacity.size||V(this,Xp,v0).call(this,i)})}setStyle(t){var e,i;if(a(this,lt).map){(e=a(this,lt).map)==null||e.setStyle(t),a(this,_i).size&&(a(this,_i).clear(),this.hide()),V(this,Kh,fx).call(this),V(this,Xp,v0).call(this,a(this,lt).map),this.setOpacity(a(this,Wp).opacity),(i=a(this,lt).map)==null||i.moveLayer(If);for(let[o,n,s]of a(this,Up)||[])a(this,lt).hideOutdoorLayersIntersectingPolygons(o,n,s)}}get map(){return a(this,lt).map}get enabled(){return!!a(this,lt).map}get visible(){return a(this,_i).size===0}show(){let t=a(this,lt).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,lt).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,lt).map;if(!i)return;let o=(s=(n=a(this,lt).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,Ro).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,Wp).opacity=t)}catch(u){O.warn("Error setting opacity:",u)}})})}};lt=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Ro=new WeakMap,_i=new WeakMap,Xp=new WeakSet,v0=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,Ro).opacity.set(i.id,[(n=t.getPaintProperty(i.id,"icon-opacity"))!=null?n:g0.opacity,(s=t.getPaintProperty(i.id,"text-opacity"))!=null?s:g0.opacity]):a(this,Ro).opacity.set(i.id,[(c=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?c:g0.opacity,void 0])))})},"#setInitialStyle"),Kh=new WeakSet,fx=p(function(){Object.values(a(this,Ro)).forEach(t=>t.clear())},"#clearInitialStyle"),p(b0,"Outdoor");var Ws=b0;y();var Ri,Ni,No,C0=class C0{constructor({currentMapGetter:t}){x(this,Ri,void 0);x(this,Ni,new Map);x(this,No,new Map);T(this,Ri,t)}labelAll(t={}){var o,n;let e=[],i=new Set;return(n=(o=a(this,Ri).call(this))==null?void 0:o.Text3D.labelAll(t))==null||n.forEach(({textInfo:s,target:c})=>{let l=s.id.toString(),u=a(this,No).get(l);if(u){i.has(l)||e.push(u.text3DView),i.add(l);return}i.add(l);let h=new Oo(l,c);a(this,Ni).set(h.id,{targetId:c.id,text3d:l,text3DView:h}),a(this,No).set(l,{text3DView:h}),e.push(h)}),e}label(t,e,i={}){var n;if(a(this,Ri).call(this))if(Be.is(t)){let s=(n=a(this,Ri).call(this))==null?void 0:n.Text3D.label(t,e,i);if(!s)return;let c=s.textInfo.id.toString(),l=a(this,No).get(c);if(l)return l.text3DView;let u=new Oo(c,s.target);return a(this,Ni).set(u.id,{targetId:s.target.id,text3d:c,text3DView:u}),a(this,No).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,Ni).get(e);i&&((o=a(this,Ri).call(this))==null||o.Text3D.remove(i.text3d),a(this,Ni).delete(e),a(this,No).delete(i.text3d))}removeAll(){a(this,Ni).forEach(t=>{var e;(e=a(this,Ri).call(this))==null||e.Text3D.remove(t.text3d)}),a(this,Ni).clear()}};Ri=new WeakMap,Ni=new WeakMap,No=new WeakMap,p(C0,"Text3D");var ef=C0;var tf=.05,I0=class I0{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 Qc(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new Pp("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")});let o=new Xc(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let n=p(l=>u=>{var E,F,B;let h=[],m=[],g=[],v=[];u.labels.forEach(G=>{let N=this.Labels.getById(G.toString());N&&h.push(N.label)}),u.markers.forEach(G=>{let N=this.Markers.getById(G.toString())||this.Navigation.getMarkerById(G.toString());N&&m.push(N.marker)}),u.models.forEach(G=>{let N=this.Models.getById(G.toString());N&&g.push(N.model)}),u.paths.forEach(G=>{let N=this.Paths.getById(G.toString())||this.Navigation.getPathById(G.toString());N&&v.push(N.path)});let I=u.geometry[0],S;I&&(S=(E=this.getMapDataInternal())==null?void 0:E.getById("space",I)),S||(S=(F=this.getMapDataInternal())==null?void 0:F.getById("object",I));let b=u.containers.reduce((G,N)=>{var j;let k=(j=this.getMapDataInternal())==null?void 0:j.getById("floor",N);return k&&Yt.is(k)&&G.push(k),G},[]),C,w=0;if(b.length>0){C=b[0].id;let G=this.core.getState(C);w=u.coordinate[2]?u.coordinate[2]-G.altitude:w}let M;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(G=>{this.core.setState(G.id,{hovered:!1})}),S&&Be.is(S)&&(M=(B=this.getMapDataInternal())==null?void 0:B.facadesBySpaceId[I],M&&M.spaces.forEach(G=>{this.core.setState(G.id,{hovered:!0})})),this.lastFacadeIntersected=M;let D={coordinate:new re({latitude:u.coordinate[1],longitude:u.coordinate[0],floorId:C,verticalOffset:w}),spaces:S&&Be.is(S)?[S]:[],objects:S&&Dt.is(S)?[S]:[],markers:m,labels:h,models:g,paths:v,floors:b,facades:M?[M]:[]};"pointerEvent"in u&&(D.pointerEvent=u.pointerEvent),this.mapView.publish(l,D)},"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:()=>this.currentMap};this.Markers=new Mp(s),this.Models=new Ep(s),this.Labels=new rp(s),this.Text3D=new ef(s),this.Exporter=new tp(s),this.Paths=new Lp(s),this.Navigation=new Zc(this.core,this,s.currentMapGetter),this.BlueDot=new Us(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 Ws(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 wp(s),this.Shapes=new Gp(s),this.Style=new jp(s);let c=new Hh(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(Pe);if(n){let s=n.layers.get(ro);s&&this.core.setState(s,S0(e,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Pe);if(n){let s=n.layers.get(Ar);s&&this.core.setState(s,S0(e,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Pe);if(n){let s=n.layers.get(wa);s&&this.core.setState(s,rf(e,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Pe);if(n){let s=n.layers.get(Da);s&&this.core.setState(s,rf(e,this.core.getState(s)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(wo.is(i))return this.core.setState(i.id,mx({...e,type:"label"},this.core.getState(i.id)));if(Ii.is(i))return this.core.setState(i.id,yx({...e,type:"marker"},this.core.getState(i.id)));if((Be.is(i)||Dt.is(i))&&this.core.setState(i.id,x0({...e,type:"geometry"},this.core.getState(i.id))),ar.is(i)&&this.core.setState(i.id,rf({...e,type:"doors"},this.core.getState(i.id))),Eo.is(i)&&this.core.setState(i.id,Pf(e,["altitude","color","opacity"])),kn.is(i)&&this.core.setState(i.id,e),Zt.is(i))for(let o of i.spaces)this.core.setState(o.id,x0({...e,type:"geometry"},this.core.getState(o.id)));Oo.is(i)&&this.core.setState(i.id,Pf(e,Af))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Kl(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var m,g,v,I;let o;try{o=Kl(t)}catch(S){O.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 re(s[1],s[0])});let c=n["manifest.geojson"].features[0].properties.name,l=new Pp("mapObject-".concat(c),o,e,this),u=this.core.getBoundingArea(l.currentFloor.id);u==null&&O.error("Could not determine bounding box for map:",l.currentFloor.id);let h=(g=(m=e==null?void 0:e.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?g:[];if(h.length>0){let S,b=[];for(let C of l.floorStacksById.values())if(C.defaultFloor.footprint&&C.defaultFloor.footprint.geometry!=null&&((v=C.defaultFloor.footprint.geometry)==null?void 0:v.coordinates.length)>0){let w=C.defaultFloor.footprint,M=Os(w);S==null?S=M:vx(S,M),b.push(w)}b.length>0&&S!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(S,b,h),this.hiddenOutdoorGeometries.push([S,b,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",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),l.on("floor-change",S=>{var b,C;this.mapView.publish("floor-change",{reason:S.reason,floor:this.currentFloor,previousFloor:(C=(b=this.getMapDataInternal())==null?void 0:b.getById("floor",S.previousFloorId))!=null?C:this.currentFloor})}),l.DynamicFocus.on("focus-change",S=>{this.mapView.publish("dynamic-focus-change",{facades:S.facades.map(b=>{var C;return(C=this.getMapDataInternal())==null?void 0:C.getById("facade",b)}).filter(b=>b!=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=(I=e==null?void 0:e.screenOffsets)!=null?I:{top:tf*this.core.canvasHeight,left:tf*this.core.canvasWidth,right:tf*this.core.canvasWidth,bottom:tf*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:Pv,padding:S}).then(()=>{i(t)})}else i(t)})}setFloor(t,e){return this.currentMap.setFloor(yl(t),e)}setFloorStack(t){return this.currentMap.setFloorStack(yl(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw O.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw O.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw O.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw O.throw("Missing currentFloor");return e}getState(t){var o,n;if(typeof t=="object"&&Zt.is(t)){O.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}let e=gx(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:s,topColor:c,texture:l,topTexture:u,visible:h,height:m,opacity:g}=i;return{type:"walls",visible:h,color:s,topColor:c,texture:l?{url:l}:void 0,topTexture:u?{url:u}:void 0,height:m,opacity:g}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:s,topColor:c,texture:l,topTexture:u,visible:h,opacity:m}=i;return{type:"doors",visible:h,color:s,topColor:c,opacity:m,texture:l?{url:l}:void 0,topTexture:u?{url:u}: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,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 s=typeof i.parent=="object"?i.parent.id:i.parent,c=this.Markers.getById(i.id.toString()),l=c!=null&&c.marker.target?c==null?void 0:c.marker.target.anchorTarget:void 0;return l==null&&(l=new re(i.position[1],i.position[0],s.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")return{...i,type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&Eo.is(t)){let[s]=i.children;if(s.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(n=i.altitude)!=null?n:0,visible:i.visible,color:i.color,height:s.height,opacity:s.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}createCoordinate(t,e,i){return new re(t,e,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(t,e,i){let o=this.core.projectScreenXYToCoordinate(t,e);return o?new re(o[1],o[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}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(I0,"GeoJsonApi");var Yp=I0;y();y();var P0=class P0{constructor(t){d(this,"state");d(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};p(P0,"Debug");var nf=P0;y();var bx=R.object({environment:R.union([R.literal("basic"),R.literal(!1)]).optional(),text3d:R.object({hoverColor:R.string().optional()}).optional(),geometry:R.object({hoverColor:R.string().optional()}).optional(),backgroundColor:R.string().optional(),backgroundAlpha:R.number().optional()}).strict();var Zp,Y,Gi,M0=class M0 extends J{constructor(e){super();x(this,Zp,{});x(this,Y,void 0);x(this,Gi,void 0);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,Y).core.render()},"update"));d(this,"getDirections",p((e,i,o)=>{var n;return(n=a(this,Y).getMapData())==null?void 0:n.getDirections(e,i,o)},"getDirections"));d(this,"getDirectionsMultiDestination",p((e,i,o)=>{var n;return(n=a(this,Y).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");T(this,Gi,e);let i=new Yp(e,this);T(this,Y,i),this.Camera=a(this,Y).Camera,T(this,Zp,a(this,Y).mapDataExternal),this.Markers=a(this,Y).Markers,this.Models=a(this,Y).Models,this.Labels=a(this,Y).Labels,this.Text3D=a(this,Y).Text3D,this.Exporter=a(this,Y).Exporter,this.Paths=a(this,Y).Paths,this.Navigation=a(this,Y).Navigation,this.BlueDot=a(this,Y).BlueDot,this.Shapes=a(this,Y).Shapes,this.Style=a(this,Y).Style,this.auto=a(this,Y).auto,this.Outdoor=a(this,Y).Outdoor,this.Images=a(this,Y).Images,a(this,Gi).container.dataset.version=P.env.npm_package_version,this.Debug=new nf(a(this,Y).core)}get StackedMaps(){return a(this,Y).currentMap.StackedMaps}get DynamicFocus(){return a(this,Y).currentMap.DynamicFocus}updateState(e,i){return a(this,Y).updateState(e,i)}updateGlobalState(e){var i,o,n,s;try{bx.parse(e)}catch(c){O.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,Y).core.backgroundColor,u=(s=e.backgroundAlpha)!=null?s:a(this,Y).core.backgroundAlpha;a(this,Y).core.setBackgroundColor(l,u)}e.environment!=null&&a(this,Y).core.setEnvironment(e.environment),a(this,Y).core.setState(c)}}getGlobalState(){let e=a(this,Y).core.getState();return{backgroundColor:a(this,Y).core.backgroundColor,backgroundAlpha:a(this,Y).core.backgroundAlpha,environment:a(this,Y).core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return a(this,Zp)}getDimensions(){return{width:a(this,Gi).canvasWidth,height:a(this,Gi).canvasHeight}}expand(e){var i;return(i=a(this,Y).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=a(this,Y).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return a(this,Y).addMap(e,i)}setFloor(e){return a(this,Y).setFloor(e)}setFloorStack(e){return a(this,Y).setFloorStack(e)}get currentFloorStack(){return a(this,Y).currentFloorStack}get currentFloor(){return a(this,Y).currentFloor}updateWatermark(e){a(this,Y).updateWatermark(e)}getState(e){return a(this,Y).getState(e)}setHoverColor(e){a(this,Y).setHoverColor(e)}getHoverColor(){return a(this,Y).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return a(this,Y).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return a(this,Y).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return a(this,Y).isInView(e)}getDistance(e,i){var o;return(o=a(this,Y).getMapData())==null?void 0:o.getDistance(e,i)}createCoordinate(e,i,o){return a(this,Y).createCoordinate(e,i,o)}createCoordinateFromScreenCoordinate(e,i,o){return a(this,Y).createCoordinateFromScreenCoordinate(e,i,o)}auto(){return{labels:this.Labels.all()}}get __core(){if(P.env.INTERNAL==="true")return a(this,Y).core;throw new Error("__core is not available.")}clear(){a(this,Y).clear()}destroy(){a(this,Y).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-4J34N3O3.js");await new i(this,a(this,Y)).enable(e)}async takeScreenshot(){return new Promise(e=>{a(this,Gi).render(),requestAnimationFrame(()=>{let o=a(this,Gi).rendererDomElement.toDataURL("image/png");e(o)})})}};Zp=new WeakMap,Y=new WeakMap,Gi=new WeakMap,p(M0,"MapView");var Xs=M0;y();y();var T0=class T0 extends J{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(ue.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ue.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",p(e=>{O.warn(e)},"handleError"));this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new Gc(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=_2.fromLngLat(this.origin,0);return this.layer=yu(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(T0,"MapLibreOverlay");var af=T0;var Qn,Ys,Go,Kn,zp=class zp extends J{constructor(e,i,o){super();x(this,Qn,void 0);x(this,Ys,void 0);x(this,Go,void 0);x(this,Kn,void 0);d(this,"on",p((e,i)=>{super.on(e,i)},"on"));d(this,"off",p((e,i)=>{super.off(e,i)},"off"));T(this,Kn,new af(e)),T(this,Qn,i),T(this,Ys,o)}onAdd(e){var n,s;let i=a(this,Kn).onAdd(e),o={...Ta,...(n=a(this,Ys))!=null?n:{},outdoorView:{token:a(this,Qn).outdoorViewToken,...(s=a(this,Ys))==null?void 0:s.outdoorView}};return T(this,Go,new Xs(a(this,Kn).core)),a(this,Go).addMap(a(this,Qn),o).then(()=>{this.publish("loaded",{mapView:a(this,Go),mapData:a(this,Qn)})}),i}onRemove(){a(this,Go)&&a(this,Go).clear(),zp.instance=null,a(this,Kn).onRemove()}};Qn=new WeakMap,Ys=new WeakMap,Go=new WeakMap,Kn=new WeakMap,p(zp,"MappedinMapLibreOverlay"),d(zp,"instance");var Zs=zp;var uE=p(async(r,t)=>{let e,i=yn();t&&i.updateByUserOption(t);try{t&&(e=(await mn({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(s){O.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new zs(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new Od(o)},"hydrateMapDataFromMVF"),Cx=!1;function dE(r){Cx=r}p(dE,"setUseEnterpriseAPI");var hE=p(async(r,t)=>{var u,h,m,g;let e={...t||{}},i,o=yn();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 El(r.main);i=Dl(v),n.languagePacks=[];for(let I of(h=r.languagePacks)!=null?h:[])I.localePack instanceof Uint8Array&&n.languagePacks.push({language:I.language,localePack:await ja(I.localePack)})}else if(r.type==="json")i=r.main,n.languagePacks=(m=r.languagePacks)!=null?m:[];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 mn(e,n.enterprise);s=(v==null?void 0:v.accessToken)||""}if(n.outdoorViewToken=s,n.env=o,s&&!n.enterprise)try{n.sasToken=(await Ha(e,s)).token}catch(v){O.error("Failed to fetch SAS token.",v)}n.getMapDataOptions=e;let c=new zs(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:(g=e.analytics)==null?void 0:g.context});let l=new Od(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"),Sx=p(async r=>{var S;let t=Cx,e,i=yn();i.updateByUserOption(r);let o={...r};if("accessToken"in o){e=o.accessToken;let{aud:b,sub:C}=iu(e);(Tv.some(w=>b.includes(w))||C&&C.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 mn(o,t)).accessToken;else throw new Error("Missing key or secret.");!t&&o.layoutId!=null?O.warn("layoutId is currently unsupported!"):o.layoutId!=="draft"&&O.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'),o.baseUri=i.getBaseUri(t);let n=performance.now(),s,c;if(t){let b={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},C=await pm(b);s=C.compressed,c=C.localePacks}else s=await um(o,e);let l=performance.now(),u=await El(s),h=Dl(u),m=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(h);let g;if(!t)try{g=(await Ha(o,e)).token}catch(b){O.error("Failed to fetch SAS token.",b)}let v=new zs(h,{env:i,outdoorViewToken:e,sasToken:g,enterprise:t,localePacksUrls:c,binaryBundle:s,getMapDataOptions:o}),I=new Od(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:m-l,downloadDuration:l-n,viewId:o.viewId}),"language"in o)try{await I.changeLanguage(o.language)}catch{}return I},"getMapData"),fE=Sx,mE=p((r,t)=>{Zs.instance!=null&&O.warn("Only a single map venue is supported at this time.");let e=new Zs([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Zs.instance=e,e},"createMapLibreOverlay"),xx=p(async(r,t,e)=>{var u,h,m,g,v,I,S,b,C,w,M;let i=performance.now(),o=zf(e,t);o&&Zf(o);let n=Dv((u=t.outdoorViewToken)!=null?u:""),s=Kl(t);(h=o.outdoorView)!=null&&h.style&&s.envControl.updateTileServerBaseUrl((m=o.outdoorView)==null?void 0:m.style);let c=await DS(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(g=o.style)==null?void 0:g.backgroundAlpha,backgroundColor:(v=o.style)==null?void 0:v.backgroundColor,outdoorView:(I=o.outdoorView)!=null&&I.token?{headers:{"x-mappedin-tiles-key":(S=o.outdoorView)==null?void 0:S.token},style:t.getEnv().tileServerUri,enabled:!!((b=o.outdoorView)!=null&&b.enabled),lowDpi:(C=o.outdoorView)==null?void 0:C.lowDpi}:void 0,watermark:{...o.watermark,visible:!s.enterpriseMode&&!n.remove_watermark},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((w=o.antialiasing)!=null&&w.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(M=o.occlusion)==null?void 0:M.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 Xs(c);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},"show3dMap"),yE=xx;function Xr(r){return[r.longitude,r.latitude]}p(Xr,"convertCoordinateToPosition");function vE(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}p(vE,"getEntranceMap");var Y1=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}=rg(o,s);n=l.map(u=>u.geometry.coordinates),i.entrances.features.push(...c)}i.walls.geometry.coordinates.push(...n)}return i},"cutEntrancesFromLineStrings");function mx(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(mx,"translateLabelStateToGeojsonCore");function yx(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(yx,"translateMarkerStateToGeojsonCore");function rf(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(rf,"translateDoorsStateToGeojsonCore");function S0(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(S0,"translateWallsStateToGeojsonCore");function x0(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)),e}p(x0,"translateSpaceStateToGeojsonCore");function Ix(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}p(Ix,"differenceBetweenAngles");function Px(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(Px,"getRelativeBearing");function ex(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(ex,"extractStyleMap");function Z1(r,t){return r.reduce((e,i)=>{let o=t[i.properties.id];return o==null||(e.has(o)||e.set(o,[]),e.get(o).push(i)),e},new Map)}p(Z1,"groupGeometryByStyle");function op(r,t={}){var o,n,s,c,l,u;let e={...r},i=(n=(o=t==null?void 0:t.style)==null?void 0:o.shading)!=null?n: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=(c=(s=t==null?void 0:t.style)==null?void 0:s.outlines)!=null?c:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let h=(u=(l=t==null?void 0:t.style)==null?void 0:l.wallTopColor)!=null?u:t==null?void 0:t.wallTopColor;h!=null&&(e.topColor=h)}return e}p(op,"translateToCoreStyle");var gx=p((r,t)=>{var o;let i=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Pe);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(ro);case"exterior-walls":return i==null?void 0:i.layers.get(Ar);case"interior-doors":return i==null?void 0:i.layers.get(wa);case"exterior-doors":return i==null?void 0:i.layers.get(Da);default:return typeof r=="string"?r:r.id}},"getTargetID");function a0(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}p(a0,"tweenToPromise");function Os(r){return r.bbox?r.bbox:aa(r)}p(Os,"getBoundingBox");function vx(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(vx,"expandBbox");function Mx(r){return[...new Set(r)]}p(Mx,"unique");var Tx=Math.PI*.1,Re,St,xt,ea,ta,Vi,ra,lf,wx,Vo,qs,cf,Dx,w0=class w0{constructor(t,e,i,o){x(this,lf);x(this,Vo);x(this,cf);x(this,Re,{});x(this,St,void 0);x(this,xt,void 0);x(this,ea,void 0);x(this,ta,void 0);x(this,Vi,void 0);x(this,ra,void 0);T(this,St,e),T(this,xt,t.features),T(this,ea,i),T(this,ta,o)}get path(){return a(this,xt).map(t=>a(this,St).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(a(this,Re).departure)return a(this,Re).departure;let t=a(this,xt)[0].properties.id,e=a(this,ea)[0];if(a(this,ea).length>1){for(let i of a(this,ea))if(qp(i,a(this,St)).includes(t)){e=i;break}}return a(this,Re).departure=e,e}get destination(){if(a(this,Re).destination)return a(this,Re).destination;let t=a(this,xt)[a(this,xt).length-1].properties.id,e=a(this,ta)[0];if(a(this,ta).length>1){for(let i of a(this,ta))if(qp(i,a(this,St)).includes(t)){e=i;break}}return a(this,Re).destination=e,e}get coordinates(){return a(this,Re).coordinates?a(this,Re).coordinates:(a(this,Re).coordinates=a(this,xt).map(t=>new re(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),a(this,Re).coordinates)}get distance(){return a(this,Re).distance?a(this,Re).distance:(a(this,Re).distance=a(this,xt).reduce((t,e)=>t+(e.properties.distance||0),0),a(this,Re).distance)}get instructions(){if(a(this,xt).length<2)return[];if(a(this,Re).instructions)return a(this,Re).instructions;let t=[],e=0;for(let i=0;i<a(this,xt).length;i++){let o=a(this,xt)[i],n=a(this,xt)[i-1],s=a(this,xt)[i+1],c=new re(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=V(this,lf,wx).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,St).getById("node",o.properties.id)}),e=0)}return a(this,Re).instructions=t,a(this,Re).instructions}};Re=new WeakMap,St=new WeakMap,xt=new WeakMap,ea=new WeakMap,ta=new WeakMap,Vi=new WeakMap,ra=new WeakMap,lf=new WeakSet,wx=p(function(t){var g,v;let{prevDirection:e,direction:i,nextDirection:o}=t,n=e&&a(this,St).getById("floor",e.properties.groupBy),s=a(this,St).getById("floor",i.properties.groupBy),c=o&&a(this,St).getById("floor",o.properties.groupBy),l=[];e||l.push({type:"Departure"});let u=a(this,St).getMVFFeatureByNodeId("connection",i.properties.id),h=u?a(this,St).getById("connection",u.id):void 0,m=u&&(u.nodes.length<=1||!i.properties.destination||!u.nodes.includes(i.properties.destination)||!u.nodes.includes(i.properties.id));if(u&&!m)if(!a(this,Vi)||a(this,Vi)==="exit")l.push(V(this,Vo,qs).call(this,"TakeConnection",s,c,h,u)),T(this,Vi,"take"),T(this,ra,h);else{let I=a(this,St).getMVFFeatureByNodeId("connection",(g=e==null?void 0:e.properties.id)!=null?g:""),S=a(this,St).getById("connection",(v=I==null?void 0:I.id)!=null?v:"");l.push(V(this,Vo,qs).call(this,"ExitConnection",s,n,S,I)),T(this,Vi,"exit"),T(this,ra,h)}else a(this,Vi)==="take"?(l.push(V(this,Vo,qs).call(this,"ExitConnection",s,n,a(this,ra))),T(this,Vi,"exit"),T(this,ra,h)):c&&s.id!==c.id?l.push(V(this,Vo,qs).call(this,"TakeConnection",s,c,h)):n&&n.id!==s.id?l.push(V(this,Vo,qs).call(this,"ExitConnection",s,n,h)):l.push(V(this,cf,Dx).call(this,e,i));return o||l.push({type:"Arrival"}),l},"#getActions"),Vo=new WeakSet,qs=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"),cf=new WeakSet,Dx=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?-Ix(t.properties.angle,e.properties.angle):0;return Math.abs(n)>=Tx?{type:"Turn",bearing:Px(n,Tx),referencePosition:"At"}:null},"#createTurnAction"),p(w0,"Directions");var of=w0,D0=class D0{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(v=>qp(v,o)),u=e.flatMap(v=>qp(v,o)),h=this.getExcludedNodeIds(n,i.excludedConnections).filter(v=>!l.includes(v)&&!u.includes(v)),m=this.navigator.getDirections({zones:i.zones.map(v=>{var I;return{geometry:v.geometry,cost:v.cost,map:(I=v.floor)==null?void 0:I.id}}),originIds:l,destinationNodeIds:u,excludedNodeIds:h,simplify:{enabled:s,bufferRadius:c},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(m,t,e);let g=new of(m,o,t,e);if(!(g.distance===0&&new Set([...l,...u]).size===l.length+u.length))return g},"getDirections"));d(this,"getExcludedNodeIds",p((t,e)=>{if(!t&&e.length===0)return[];let i=new Set(e.map(o=>o.id));return this.connections.reduce((o,n)=>n.accessible&&!i.has(n.id)?o:o.concat(n.nodes),[])},"getExcludedNodeIds"));d(this,"addCoordinateDirections",p((t,[e],[i])=>{if(t.features.length){if(re.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(re.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 rs({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(D0,"DirectionsInternal");var sf=D0;function qp(r,t){var e,i,o,n,s;if(hn.is(r))return r.navigationTarget.flatMap(c=>qp(c,t));if(ci.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(re.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(li.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(ar.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(ai.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(Be.is(r)){let c=t==null?void 0:t.getMVFFeatureById("space",r.id);return c==null?[]:c.properties.destinationNodes}else{if(oo.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(Dt.is(r)){let c=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return c!=null?c:[]}else return Zt.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"):Lr.is(r)?r.nodes.map(c=>c.id):oi.is(r)?[r.id]:[]}}p(qp,"getNodesFromTarget");y();y();y();y();y();y();function E0(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return Ex(this.cover(t,e),t,e,r)}p(E0,"default");function Ex(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,m,g,v,I,S,b,C,w;if(!n)return r._root=s,r;for(;n.length;)if((S=t>=(m=(c+u)/2))?c=m:u=m,(b=e>=(g=(l+h)/2))?l=g:h=g,o=n,!(n=n[C=b<<1|S]))return o[C]=s,r;if(v=+r._x.call(null,n.data),I=+r._y.call(null,n.data),t===v&&e===I)return s.next=n,o?o[C]=s:r._root=s,r;do o=o?o[C]=new Array(4):r._root=new Array(4),(S=t>=(m=(c+u)/2))?c=m:u=m,(b=e>=(g=(l+h)/2))?l=g:h=g;while((C=b<<1|S)===(w=(I>=g)<<1|v>=m));return o[w]=n,o[C]=s,r}p(Ex,"add");function Ox(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,m=-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>m&&(m=n));if(l>h||u>m)return this;for(this.cover(l,u).cover(h,m),e=0;e<i;++e)Ex(this,s[e],c[e],r[e]);return this}p(Ox,"addAll");y();function O0(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(O0,"default");y();function L0(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}p(L0,"default");y();function A0(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(A0,"default");y();y();function Ye(r,t,e,i,o){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=o}p(Ye,"default");function F0(r,t,e){var i,o=this._x0,n=this._y0,s,c,l,u,h=this._x1,m=this._y1,g=[],v=this._root,I,S;for(v&&g.push(new Ye(v,o,n,h,m)),e==null?e=1/0:(o=r-e,n=t-e,h=r+e,m=t+e,e*=e);I=g.pop();)if(!(!(v=I.node)||(s=I.x0)>h||(c=I.y0)>m||(l=I.x1)<o||(u=I.y1)<n))if(v.length){var b=(s+l)/2,C=(c+u)/2;g.push(new Ye(v[3],b,C,l,u),new Ye(v[2],s,C,b,u),new Ye(v[1],b,c,l,C),new Ye(v[0],s,c,b,C)),(S=(t>=C)<<1|r>=b)&&(I=g[g.length-1],g[g.length-1]=g[g.length-1-S],g[g.length-1-S]=I)}else{var w=r-+this._x.call(null,v.data),M=t-+this._y.call(null,v.data),D=w*w+M*M;if(D<e){var E=Math.sqrt(e=D);o=r-E,n=t-E,h=r+E,m=t+E,i=v.data}}return i}p(F0,"default");y();function B0(r){if(isNaN(h=+this._x.call(null,r))||isNaN(m=+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,m,g,v,I,S,b,C;if(!e)return this;if(e.length)for(;;){if((I=h>=(g=(s+l)/2))?s=g:l=g,(S=m>=(v=(c+u)/2))?c=v:u=v,t=e,!(e=e[b=S<<1|I]))return this;if(!e.length)break;(t[b+1&3]||t[b+2&3]||t[b+3&3])&&(i=t,C=b)}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[b]=n:delete t[b],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[C]=e:this._root=e),this):(this._root=n,this)}p(B0,"default");function Lx(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}p(Lx,"removeAll");y();function k0(){return this._root}p(k0,"default");y();function _0(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}p(_0,"default");y();function R0(r){var t=[],e,i=this._root,o,n,s,c,l;for(i&&t.push(new Ye(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 Ye(o,u,h,c,l)),(o=i[2])&&t.push(new Ye(o,n,h,u,l)),(o=i[1])&&t.push(new Ye(o,u,s,c,h)),(o=i[0])&&t.push(new Ye(o,n,s,u,h))}return this}p(R0,"default");y();function N0(r){var t=[],e=[],i;for(this._root&&t.push(new Ye(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,m=(c+u)/2;(n=o[0])&&t.push(new Ye(n,s,c,h,m)),(n=o[1])&&t.push(new Ye(n,h,c,l,m)),(n=o[2])&&t.push(new Ye(n,s,m,h,u)),(n=o[3])&&t.push(new Ye(n,h,m,l,u))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}p(N0,"default");y();function Ax(r){return r[0]}p(Ax,"defaultX");function G0(r){return arguments.length?(this._x=r,this):this._x}p(G0,"default");y();function Fx(r){return r[1]}p(Fx,"defaultY");function V0(r){return arguments.length?(this._y=r,this):this._y}p(V0,"default");function $p(r,t,e){var i=new j0(t==null?Ax:t,e==null?Fx:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}p($p,"quadtree");function j0(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(j0,"Quadtree");function Bx(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}p(Bx,"leaf_copy");var It=$p.prototype=j0.prototype;It.copy=function(){var r=new j0(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=Bx(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]=Bx(i));return r};It.add=E0;It.addAll=Ox;It.cover=O0;It.data=L0;It.extent=A0;It.find=F0;It.remove=B0;It.removeAll=Lx;It.root=k0;It.size=_0;It.visit=R0;It.visitAfter=N0;It.x=G0;It.y=V0;var jt,jo,H0=class H0{constructor(t){x(this,jt,{});x(this,jo,void 0);T(this,jo,t)}getTreeByType(t,e,i){if(a(this,jt)[t]||(a(this,jt)[t]={}),a(this,jt)[t][e]&&a(this,jt)[t][e][i])return a(this,jt)[t][e][i];a(this,jt)[t][e]||(a(this,jt)[t][e]={}),a(this,jt)[t][e][i]||(a(this,jt)[t][e][i]=$p());let o=a(this,jt)[t][e][i];o.x(s=>s.geometry.coordinates[1]),o.y(s=>s.geometry.coordinates[0]);let n=[];switch(t){case"node":n=a(this,jo).mvfNodesByFloorId[i]||[];break;case"point-of-interest":n=a(this,jo).mvfPoisByFloorId[i]||[];break;case"door":n=a(this,jo).mvfEntrancesByFloorId[i]||[];break;case"annotation":n=a(this,jo).mvfAnnotationsByFloorId[i]||[];break}return(n==null?void 0:n.length)>0&&o.addAll(n),o}};jt=new WeakMap,jo=new WeakMap,p(H0,"QueryCache");var pf=H0;var bE=R.object({limit:R.enum(["same-floor","same-elevation"]).optional(),radius:R.number().optional(),types:R.array(R.enum(["node","point-of-interest"])).min(1)}),Qr,Qp,U0=class U0{constructor(t){x(this,Qr,void 0);x(this,Qp,void 0);T(this,Qr,t),T(this,Qp,new pf(a(this,Qr)))}nearest(t,e){try{bE.parse(e)}catch(s){O.error(s);return}let i=gl(t);if(!i)return;let o=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let s of a(this,Qr).getByType("floor-stack")){let c=s.defaultFloor;c&&o.push(c.id)}else if(e.limit==="same-elevation"){let s=a(this,Qr).floorsById[i.floorId];if(s){let c=s==null?void 0:s.elevation;c&&(o=a(this,Qr).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 Mx(e.types))for(let c of o){let l=a(this,Qp).getTreeByType(s,a(this,Qr).mapName,c).find(i.latitude,i.longitude,e.radius);if(l){let u=a(this,Qr).getById(s,l==null?void 0:l.properties.id);u&&n.push({distance:dr([i.longitude,i.latitude],l.geometry.coordinates),feature:u})}}return n.sort((s,c)=>s.distance-c.distance)}};Qr=new WeakMap,Qp=new WeakMap,p(U0,"Query");var Jp=U0;y();y();var Kp,W0=class W0{constructor(t){x(this,Kp,void 0);T(this,Kp,t||[])}get raw(){return a(this,Kp)}};Kp=new WeakMap,p(W0,"OpeningHours");var uf=W0;var Pt,$,Ze,$s=class $s extends Ge{constructor(e,i){super(i.mvfData.id);d(this,"__type",$s.__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");x(this,Pt,void 0);x(this,$,{});x(this,Ze,void 0);T(this,Pt,e),T(this,Ze,i.mvfData);for(let o in i.mvfData)o==="links"?this.links=i.mvfData.links.map(n=>new Ki({mvfData:n})):o==="pictures"?this.images=i.mvfData.pictures.map(n=>n.url?new tn({mvfData:{url:n.url}}):void 0).filter(n=>n!=null):o==="website"?i.mvfData.website&&(this.website=new Ki({mvfData:i.mvfData.website})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,Ze)[o]}})}static is(e){return e.__type===$s.__type}get spaces(){if(a(this,$).spaces)return a(this,$).spaces;a(this,$).spaces=[];for(let e=0;e<a(this,Ze).spaces.length;e++){let i=a(this,Pt).getById("space",a(this,Ze).spaces[e].id);i&&a(this,$).spaces.push(i)}return a(this,$).spaces}get points(){if(a(this,$).points)return a(this,$).points;a(this,$).points=[];for(let e=0;e<a(this,Ze).spaces.length;e++){let i=a(this,Pt).getById("point-of-interest",a(this,Ze).spaces[e].id);i&&a(this,$).points.push(i)}return a(this,$).points}get doors(){if(a(this,$).doors)return a(this,$).doors;a(this,$).doors=[];for(let e=0;e<a(this,Ze).entrances.length;e++){let i=a(this,Pt).getById("door",a(this,Ze).entrances[e].id);i&&a(this,$).doors.push(i)}return a(this,$).doors}get connections(){var i;if(a(this,$).connections)return a(this,$).connections;let e=new Set;for(let o=0;o<a(this,Ze).connections.length;o++){let n=a(this,Ze).connections[o],s=a(this,Pt).mvfConnectionsById[n],l=(s==null?[]:s.nodes).map(u=>a(this,Pt).getById("node",u)).filter(Boolean);for(let u of l){if(u==null)continue;let h=to([u.coordinate.longitude,u.coordinate.latitude]),g=((i=a(this,Pt).connectionSpaceIdsByLatLon[h])!=null?i:[]).map(v=>a(this,Pt).connectionsById[v]).filter(v=>v!=null);for(let v of g)e.add(v)}}return a(this,$).connections=Array.from(e),a(this,$).connections}get annotations(){if(a(this,$).annotations)return a(this,$).annotations;a(this,$).annotations=[];for(let e=0;e<a(this,Ze).annotations.length;e++){let i=a(this,Pt).getById("annotation",a(this,Ze).annotations[e].id);i&&a(this,$).annotations.push(i)}return a(this,$).annotations}get categories(){return a(this,$).categories?a(this,$).categories:(a(this,$).categories=a(this,Ze).categories.map(e=>a(this,Pt).getById("location-category",e)).filter(e=>e!=null),a(this,$).categories)}get mapObjects(){return a(this,$).mapObjects?a(this,$).mapObjects:(a(this,$).mapObjects=a(this,Ze).obstructions.map(e=>a(this,Pt).getById("object",e.id)).filter(e=>e!=null),a(this,$).mapObjects)}get areas(){return a(this,$).areas?a(this,$).areas:(a(this,$).areas=a(this,Ze).areas.map(e=>a(this,Pt).getById("area",e.id)).filter(e=>e!=null),a(this,$).areas)}get focusTarget(){if(a(this,$).focusTarget)return a(this,$).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,$).focusTarget=e,e}get openingHours(){return a(this,$).openingHours?a(this,$).openingHours:(a(this,$).openingHours=new uf(a(this,Ze).openingHoursSpecification),a(this,$).openingHours)}get navigationTarget(){if(a(this,$).navigationTarget)return a(this,$).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,$).navigationTarget=e,e}toJSON(){return{id:this.id,name:this.name}}};Pt=new WeakMap,$=new WeakMap,Ze=new WeakMap,p($s,"LocationProfile"),d($s,"__type","location-profile");var X0=$s,hn=X0;y();var Ho,Bt,ia,Js=class Js extends Ge{constructor(e,i){super(i.mvfData.id);d(this,"__type",Js.__type);d(this,"id","cat_");d(this,"name","");d(this,"icon","");x(this,Ho,void 0);x(this,Bt,{});x(this,ia,void 0);T(this,Ho,e),T(this,ia,i.mvfData);for(let o in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,ia)[o]}})}static is(e){return e.__type===Js.__type}get parent(){return a(this,Bt).parent?a(this,Bt).parent:(a(this,Bt).parent=a(this,ia).parent?a(this,Ho).getById("location-category",a(this,ia).parent):void 0,a(this,Bt).parent)}get children(){return a(this,Bt).children?a(this,Bt).children:(a(this,Bt).children=a(this,Ho).locationCategoriesByParentId[this.id]||[],a(this,Bt).children)}get locationProfiles(){if(a(this,Bt).locationProfiles)return a(this,Bt).locationProfiles;let e=[];for(let i of a(this,Ho).locationProfilesByCategoryId[this.id]||[]){let o=a(this,Ho).getById("location-profile",i.id);o&&e.push(o)}return a(this,Bt).locationProfiles=e,e}toJSON(){return{id:this.id,name:this.name}}};Ho=new WeakMap,Bt=new WeakMap,ia=new WeakMap,p(Js,"LocationCategory"),d(Js,"__type","location-category");var Y0=Js,Il=Y0;var Z,Qs,Uo,Wo,Z0=class Z0 extends J{constructor(e,i){var c,l,u,h,m;super();d(this,"Analytics");x(this,Z,{});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");x(this,Qs,void 0);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)||[],m={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 g=Array.isArray(e)?e:[e],v=[];for(let I of i){let S=Array.isArray(I)?I:[I],b=this.directions.getDirections(g,S,m,this);if(!b){O.error("getDirections failed due to missing directions for one of the segments");return}g=S,v.push(b)}return v}else{let g=Array.isArray(e)?e:[e],v=Array.isArray(i)?i:[i];if(Array.isArray(v[0])){O.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,v[0].id),this.directions.getDirections(g,v,m,this)}},"getDirections"));x(this,Uo,void 0);x(this,Wo,void 0);d(this,"transformImageRequest",p(async e=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!s7(e))return{url:e};let i="accessToken"in this.getMapDataOptions?this.getMapDataOptions.accessToken:void 0;if(!i&&"key"in this.getMapDataOptions&&"secret"in this.getMapDataOptions)try{a(this,Uo)||T(this,Uo,mn(this.getMapDataOptions,this.enterpriseMode));let o=await a(this,Uo);T(this,Uo,void 0),i=o.accessToken}catch(o){T(this,Uo,void 0),O.error("Failed to fetch access token. Requests for private images may fail.",o)}if(!i)return{url:e};try{a(this,Wo)||T(this,Wo,Ha({mapId:this.getMapDataOptions.mapId},i));let o=await a(this,Wo);T(this,Wo,void 0);let[n]=e.split("?");return{url:"".concat(n,"?").concat(o.token)}}catch(o){T(this,Wo,void 0),O.error("Failed to append SAS token to image request. Requests for private images may fail.",o)}return{url:e}},"transformImageRequest"));let o=(c=i==null?void 0:i.env)!=null?c:yn();if(this.envControl=o,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new Ra,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 g of e["tileset.json"].others)this.tilesets[g.key]=g;this.enterpriseMode=(h=i==null?void 0:i.enterprise)!=null?h:!1,this.sasToken=i==null?void 0:i.sasToken;let n=Ov(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=Ev(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 Su(this,{mvfData:s.venue});let g={};for(let v in s.mvfLocationsById)g[v]=s.mvfLocationsById[v];for(let v in s.locationInstancesById)g[v]=s.locationInstancesById[v];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:g,categories:s.mvfCategoriesById}},(m=i==null?void 0:i.languagePacks)==null||m.forEach(({language:v,localePack:I})=>{this.languagePacks[v.code]=ig(I)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Jp(this),this.directions=new sf({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 re(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,Z).spaces==null&&(a(this,Z).spaces=globalThis.Object.values(this.spacesById)),a(this,Z).spaces}get objects(){return a(this,Z).objects==null&&(a(this,Z).objects=globalThis.Object.values(this.objectsById)),a(this,Z).objects}get connections(){return a(this,Z).connections==null&&(a(this,Z).connections=globalThis.Object.values(this.connectionsById)),a(this,Z).connections}get floors(){return a(this,Z).floors==null&&(a(this,Z).floors=globalThis.Object.values(this.floorsById)),a(this,Z).floors}get floorStacks(){return a(this,Z).floorStacks==null&&(a(this,Z).floorStacks=globalThis.Object.values(this.floorStacksById)),a(this,Z).floorStacks}get facades(){return a(this,Z).facades==null&&(a(this,Z).facades=globalThis.Object.values(this.facadesById)),a(this,Z).facades}get doors(){return a(this,Z).doors==null&&(a(this,Z).doors=globalThis.Object.values(this.doorsById)),a(this,Z).doors}get pointsOfInterest(){return a(this,Z).pointsOfInterest==null&&(a(this,Z).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),a(this,Z).pointsOfInterest}get annotations(){return a(this,Z).annotations==null&&(a(this,Z).annotations=globalThis.Object.values(this.annotationsById)),a(this,Z).annotations}get areas(){return a(this,Z).areas==null&&(a(this,Z).areas=globalThis.Object.values(this.areasById)),a(this,Z).areas}get nodes(){return a(this,Z).nodes==null&&(a(this,Z).nodes=globalThis.Object.values(this.nodesById)),a(this,Z).nodes}get locations(){return a(this,Z).locations==null&&(a(this,Z).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return a(this,Z).categories==null&&(a(this,Z).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return a(this,Z).locationProfiles==null&&(a(this,Z).locationProfiles=globalThis.Object.values(this.locationProfilesById)),a(this,Z).locationProfiles}get locationCategories(){return a(this,Z).locationCategories==null&&(a(this,Z).locationCategories=globalThis.Object.values(this.locationCategoriesById)),a(this,Z).locationCategories}get mvfFloors(){return a(this,Z).mvfFloors==null&&(a(this,Z).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),a(this,Z).mvfFloors}get mvfFloorStacks(){return a(this,Z).mvfFloorStacks==null&&(a(this,Z).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),a(this,Z).mvfFloorStacks}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":return this.connectionsById[i];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,m,g,v,I,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(m=this.objectsByExternalId[i])!=null?m:[];case"point-of-interest":return(g=this.poisByExternalId[i])!=null?g:[];case"area":return(v=this.areasByExternalId[i])!=null?v:[];case"enterprise-location":return(I=this.locationsByExternalId[i])!=null?I:[];case"enterprise-category":return(S=this.categoriesByExternalId[i])!=null?S:[];default:return[]}}getMapDataById(e){var i,o,n,s,c,l,u,h,m,g;return(g=(m=(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?m:this.annotationsById[e])!=null?g: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 u,h;if(!this.currentLanguage)return n;let{code:s}=this.currentLanguage,c=e==="enterprise-category"?"categories":e==="enterprise-location"?"locations":void 0;if(!c)return n;let l=(h=(u=this.languagePacks[s])==null?void 0:u.optimized)==null?void 0:h[c];if(l){let m=l[o];if(m!=null&&m[i]!==void 0)return m[i]}return n}async changeLanguage(e){var c;let i=e.toLowerCase();if(!i){O.error("language code must be defined");return}if(!this.currentLanguage){O.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){O.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){O.error("locale packs url not found for ".concat(n.code));return}a(this,Qs)&&a(this,Qs).abort();let u=new AbortController;T(this,Qs,u);let h;try{h=await zv(l,{signal:u.signal})}catch(m){O.error("failed downloading language pack",m);return}if(!h||u.signal.aborted)return;s=ig(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=gl(e),n=gl(i);return dr([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 cm(this.localePacksUrls[s.code],{signal:n.signal}),l=await ja(c);l&&i.push({language:{code:s.code,name:s.name},localePack:l})}}catch(c){O.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){O.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 cm(this.localePacksUrls[s.code],{signal:n.signal});c&&i.push({language:{code:s.code,name:s.name},localePack:c})}}catch(c){O.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,Z)))a(this,Z)[e]=null}};Z=new WeakMap,Qs=new WeakMap,Uo=new WeakMap,Wo=new WeakMap,p(Z0,"MapDataInternal");var zs=Z0;var el,oa,eu,Kr,Ks=class Ks extends or{constructor(e,i){super(i.mvfData.id,e);d(this,"__type",Ks.__type);x(this,el,void 0);x(this,oa,void 0);x(this,eu,void 0);x(this,Kr,{});T(this,el,i.mvfData),T(this,oa,e),T(this,eu,i.floorStackId)}static is(e){return e.__type===Ks.__type}get floorStack(){return a(this,oa).getById("floor-stack",a(this,eu))}get spaces(){if(!a(this,Kr).spaces){a(this,Kr).spaces=[];for(let e of a(this,el).spaces){let i=a(this,oa).getById("space",e.spaceId);i&&a(this,Kr).spaces.push(i)}}return a(this,Kr).spaces}get center(){if(!a(this,Kr).center){let e={type:"FeatureCollection",features:[]};for(let o of this.spaces){let n=a(this,oa).mvfSpacesById[o.id];n&&e.features.push(n)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=xu(e);a(this,Kr).center=new re(i.geometry.coordinates[1],i.geometry.coordinates[0],a(this,el).spaces[0].floorId)}return a(this,Kr).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};el=new WeakMap,oa=new WeakMap,eu=new WeakMap,Kr=new WeakMap,p(Ks,"Facade"),d(Ks,"__type","facade");var z0=Ks,Zt=z0;export{re as a,oi as b,Be as c,cl as d,Zt as e,Lr as f,xl as g,VD as h,Sx as i,xx as j,gE as k};
|