@mappedin/mappedin-js 6.0.1-beta.40 → 6.0.1-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{$ as el,$a as yu,A as Ft,Aa as Ea,B as L1,Ba as mu,C as nf,Ca as Oa,D as Nr,Da as La,E as A1,Ea as K1,F as Ta,G as N,Ga as e0,H as hx,Ha as gu,I as F1,Ia as Jt,J as Gr,Ja as t0,K as k1,Ka as r0,L as vt,La as i0,M as af,Ma as df,N as B1,Na as o0,O as _1,Oa as hf,P as Qs,Pa as ff,Q as R1,Qa as n0,R as to,Ra as a0,S as N1,Sa as s0,T as ro,Ta as l0,U as sf,Ua as c0,V as io,Va as mf,W as Oe,Wa as no,X as Ks,Xa as gf,Y as lf,Ya as p0,Z as cf,Za as u0,_ as j1,_a as d0,aa as U1,ab as yf,ba as wa,bb as h0,c as L,ca as Da,cb as f0,d as Kh,da as H1,db as m0,e as lu,ea as tl,eb as g0,f as P1,fa as W1,fb as y0,g as Ma,gb as bf,h as cu,ha as du,hb as b0,i as M1,ia as hu,ib as v0,j as pu,ja as X1,jb as C0,k as ln,ka as Y1,kb as S0,l as T1,la as fu,lb as x0,m as rf,ma as Z1,mb as I0,n as ve,na as z1,nb as Re,o as ee,oa as q1,ob as P0,p as cn,pa as $1,pb as dr,q as of,qa as oo,qb as Ie,r as Rr,ra as pf,s as uu,sa as J1,t as gi,ta as Q1,u as pn,ua as uf,v as w1,w as D1,x as E1,y as O1,z as Js,za as rl}from"./chunk-HH7HMNDW.js";import{j as G1,u as V1}from"./chunk-ZKST35SK.js";import{a as Vr}from"./chunk-ERH6UBJK.js";import{$ as h1,$a as S1,Aa as fi,Ba as au,C as a1,Ca as y1,D as ne,Da as b1,E as K,Fa as mi,I as s1,J as l1,K as c1,L as p1,M as z,N as ut,O as u1,P as on,Pa,Q as Ia,R as nn,S as Qe,Ta as su,U as bt,Ua as v1,V as an,W as d1,X as oe,Y as hi,Ya as C1,_ as sn,_a as _r,aa as ef,ab as x1,b as ru,ca as Qi,cb as I1,e as rn,f as i1,g as $s,ka as Ki,la as f1,ma as ou,na as m1,p as o1,pa as tf,r as n1,ua as g1,va as eo,wa as nu,ya as kr,z as iu,za as Br}from"./chunk-RJTPVVPZ.js";import{a as f,b as I}from"./chunk-YXZOAYFJ.js";import{b as j,c as dx,d as tu,e as u,f as a,g as x,h as P,i as _}from"./chunk-HALSTKAB.js";var z0=j((Tf,wf)=>{f();(function(r,t){typeof Tf=="object"&&typeof wf<"u"?wf.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(Tf,function(){"use strict";function r(v,S,M,w,T){(function D(F,O,B,k,G){for(;k>B;){if(k-B>600){var V=k-B+1,X=O-B+1,re=Math.log(V),U=.5*Math.exp(2*re/3),ie=.5*Math.sqrt(re*U*(V-U)/V)*(X-V/2<0?-1:1),Z=Math.max(B,Math.floor(O-X*U/V+ie)),we=Math.min(k,Math.floor(O+(V-X)*U/V+ie));D(F,O,Z,we,G)}var ue=F[O],ge=B,xe=k;for(t(F,B,O),G(F[k],ue)>0&&t(F,B,k);ge<xe;){for(t(F,ge,xe),ge++,xe--;G(F[ge],ue)<0;)ge++;for(;G(F[xe],ue)>0;)xe--}G(F[B],ue)===0?t(F,B,xe):t(F,++xe,k),xe<=O&&(B=xe+1),O<=xe&&(k=xe-1)}})(v,S,M||0,w||v.length-1,T||e)}function t(v,S,M){var w=v[S];v[S]=v[M],v[M]=w}function e(v,S){return v<S?-1:v>S?1:0}var i=function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(v,S,M){if(!M)return S.indexOf(v);for(var w=0;w<S.length;w++)if(M(v,S[w]))return w;return-1}function n(v,S){s(v,0,v.children.length,S,v)}function s(v,S,M,w,T){T||(T=y(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var D=S;D<M;D++){var F=v.children[D];c(T,v.leaf?w(F):F)}return T}function c(v,S){return v.minX=Math.min(v.minX,S.minX),v.minY=Math.min(v.minY,S.minY),v.maxX=Math.max(v.maxX,S.maxX),v.maxY=Math.max(v.maxY,S.maxY),v}function l(v,S){return v.minX-S.minX}function p(v,S){return v.minY-S.minY}function d(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}function m(v){return v.maxX-v.minX+(v.maxY-v.minY)}function g(v,S){return v.minX<=S.minX&&v.minY<=S.minY&&S.maxX<=v.maxX&&S.maxY<=v.maxY}function b(v,S){return S.minX<=v.maxX&&S.minY<=v.maxY&&S.maxX>=v.minX&&S.maxY>=v.minY}function y(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function C(v,S,M,w,T){for(var D=[S,M];D.length;)if(!((M=D.pop())-(S=D.pop())<=w)){var F=S+Math.ceil((M-S)/w/2)*w;r(v,F,S,M,T),D.push(S,F,F,M)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(v){var S=this.data,M=[];if(!b(v,S))return M;for(var w=this.toBBox,T=[];S;){for(var D=0;D<S.children.length;D++){var F=S.children[D],O=S.leaf?w(F):F;b(v,O)&&(S.leaf?M.push(F):g(v,O)?this._all(F,M):T.push(F))}S=T.pop()}return M},i.prototype.collides=function(v){var S=this.data;if(!b(v,S))return!1;for(var M=[];S;){for(var w=0;w<S.children.length;w++){var T=S.children[w],D=S.leaf?this.toBBox(T):T;if(b(v,D)){if(S.leaf||g(v,D))return!0;M.push(T)}}S=M.pop()}return!1},i.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var S=0;S<v.length;S++)this.insert(v[S]);return this}var M=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===M.height)this._splitRoot(this.data,M);else{if(this.data.height<M.height){var w=this.data;this.data=M,M=w}this._insert(M,this.data.height-M.height-1,!0)}else this.data=M;return this},i.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(v,S){if(!v)return this;for(var M,w,T,D=this.data,F=this.toBBox(v),O=[],B=[];D||O.length;){if(D||(D=O.pop(),w=O[O.length-1],M=B.pop(),T=!0),D.leaf){var k=o(v,D.children,S);if(k!==-1)return D.children.splice(k,1),O.push(D),this._condense(O),this}T||D.leaf||!g(D,F)?w?(M++,D=w.children[M],T=!1):D=null:(O.push(D),B.push(M),M=0,w=D,D=D.children[0])}return this},i.prototype.toBBox=function(v){return v},i.prototype.compareMinX=function(v,S){return v.minX-S.minX},i.prototype.compareMinY=function(v,S){return v.minY-S.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(v){return this.data=v,this},i.prototype._all=function(v,S){for(var M=[];v;)v.leaf?S.push.apply(S,v.children):M.push.apply(M,v.children),v=M.pop();return S},i.prototype._build=function(v,S,M,w){var T,D=M-S+1,F=this._maxEntries;if(D<=F)return n(T=y(v.slice(S,M+1)),this.toBBox),T;w||(w=Math.ceil(Math.log(D)/Math.log(F)),F=Math.ceil(D/Math.pow(F,w-1))),(T=y([])).leaf=!1,T.height=w;var O=Math.ceil(D/F),B=O*Math.ceil(Math.sqrt(F));C(v,S,M,B,this.compareMinX);for(var k=S;k<=M;k+=B){var G=Math.min(k+B-1,M);C(v,k,G,O,this.compareMinY);for(var V=k;V<=G;V+=O){var X=Math.min(V+O-1,G);T.children.push(this._build(v,V,X,w-1))}}return n(T,this.toBBox),T},i.prototype._chooseSubtree=function(v,S,M,w){for(;w.push(S),!S.leaf&&w.length-1!==M;){for(var T=1/0,D=1/0,F=void 0,O=0;O<S.children.length;O++){var B=S.children[O],k=d(B),G=(V=v,X=B,(Math.max(X.maxX,V.maxX)-Math.min(X.minX,V.minX))*(Math.max(X.maxY,V.maxY)-Math.min(X.minY,V.minY))-k);G<D?(D=G,T=k<T?k:T,F=B):G===D&&k<T&&(T=k,F=B)}S=F||S.children[0]}var V,X;return S},i.prototype._insert=function(v,S,M){var w=M?v:this.toBBox(v),T=[],D=this._chooseSubtree(w,this.data,S,T);for(D.children.push(v),c(D,w);S>=0&&T[S].children.length>this._maxEntries;)this._split(T,S),S--;this._adjustParentBBoxes(w,T,S)},i.prototype._split=function(v,S){var M=v[S],w=M.children.length,T=this._minEntries;this._chooseSplitAxis(M,T,w);var D=this._chooseSplitIndex(M,T,w),F=y(M.children.splice(D,M.children.length-D));F.height=M.height,F.leaf=M.leaf,n(M,this.toBBox),n(F,this.toBBox),S?v[S-1].children.push(F):this._splitRoot(M,F)},i.prototype._splitRoot=function(v,S){this.data=y([v,S]),this.data.height=v.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(v,S,M){for(var w,T,D,F,O,B,k,G=1/0,V=1/0,X=S;X<=M-S;X++){var re=s(v,0,X,this.toBBox),U=s(v,X,M,this.toBBox),ie=(T=re,D=U,F=void 0,O=void 0,B=void 0,k=void 0,F=Math.max(T.minX,D.minX),O=Math.max(T.minY,D.minY),B=Math.min(T.maxX,D.maxX),k=Math.min(T.maxY,D.maxY),Math.max(0,B-F)*Math.max(0,k-O)),Z=d(re)+d(U);ie<G?(G=ie,w=X,V=Z<V?Z:V):ie===G&&Z<V&&(V=Z,w=X)}return w||M-S},i.prototype._chooseSplitAxis=function(v,S,M){var w=v.leaf?this.compareMinX:l,T=v.leaf?this.compareMinY:p;this._allDistMargin(v,S,M,w)<this._allDistMargin(v,S,M,T)&&v.children.sort(w)},i.prototype._allDistMargin=function(v,S,M,w){v.children.sort(w);for(var T=this.toBBox,D=s(v,0,S,T),F=s(v,M-S,M,T),O=m(D)+m(F),B=S;B<M-S;B++){var k=v.children[B];c(D,v.leaf?T(k):k),O+=m(D)}for(var G=M-S-1;G>=S;G--){var V=v.children[G];c(F,v.leaf?T(V):V),O+=m(F)}return O},i.prototype._adjustParentBBoxes=function(v,S,M){for(var w=M;w>=0;w--)c(S[w],v)},i.prototype._condense=function(v){for(var S=v.length-1,M=void 0;S>=0;S--)v[S].children.length===0?S>0?(M=v[S-1].children).splice(M.indexOf(v[S]),1):this.clear():n(v[S],this.toBBox)},i})});var Af=j($=>{"use strict";f();Object.defineProperty($,"__esModule",{value:!0});$.earthRadius=63710088e-1;$.factors={centimeters:$.earthRadius*100,centimetres:$.earthRadius*100,degrees:$.earthRadius/111325,feet:$.earthRadius*3.28084,inches:$.earthRadius*39.37,kilometers:$.earthRadius/1e3,kilometres:$.earthRadius/1e3,meters:$.earthRadius,metres:$.earthRadius,miles:$.earthRadius/1609.344,millimeters:$.earthRadius*1e3,millimetres:$.earthRadius*1e3,nauticalmiles:$.earthRadius/1852,radians:1,yards:$.earthRadius*1.0936};$.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/$.earthRadius,yards:1.0936133};$.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 so(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}$.feature=so;function Wx(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Df(t).geometry;case"LineString":return Of(t).geometry;case"Polygon":return Ef(t).geometry;case"MultiPoint":return $0(t).geometry;case"MultiLineString":return q0(t).geometry;case"MultiPolygon":return J0(t).geometry;default:throw new Error(r+" is invalid")}}$.geometry=Wx;function Df(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 so(i,t,e)}$.point=Df;function Xx(r,t,e){return e===void 0&&(e={}),Tu(r.map(function(i){return Df(i,t)}),e)}$.points=Xx;function Ef(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 so(c,t,e)}$.polygon=Ef;function Yx(r,t,e){return e===void 0&&(e={}),Tu(r.map(function(i){return Ef(i,t)}),e)}$.polygons=Yx;function Of(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 so(i,t,e)}$.lineString=Of;function Zx(r,t,e){return e===void 0&&(e={}),Tu(r.map(function(i){return Of(i,t)}),e)}$.lineStrings=Zx;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}$.featureCollection=Tu;function q0(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return so(i,t,e)}$.multiLineString=q0;function $0(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return so(i,t,e)}$.multiPoint=$0;function J0(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return so(i,t,e)}$.multiPolygon=J0;function zx(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return so(i,t,e)}$.geometryCollection=zx;function qx(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}$.round=qx;function Q0(r,t){t===void 0&&(t="kilometers");var e=$.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}$.radiansToLength=Q0;function Lf(r,t){t===void 0&&(t="kilometers");var e=$.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}$.lengthToRadians=Lf;function $x(r,t){return K0(Lf(r,t))}$.lengthToDegrees=$x;function Jx(r){var t=r%360;return t<0&&(t+=360),t}$.bearingToAzimuth=Jx;function K0(r){var t=r%(2*Math.PI);return t*180/Math.PI}$.radiansToDegrees=K0;function Qx(r){var t=r%360;return t*Math.PI/180}$.degreesToRadians=Qx;function Kx(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 Q0(Lf(r,t),e)}$.convertLength=Kx;function e7(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=$.areaFactors[t];if(!i)throw new Error("invalid original units");var o=$.areaFactors[e];if(!o)throw new Error("invalid final units");return r/i*o}$.convertArea=e7;function Mu(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}$.isNumber=Mu;function t7(r){return!!r&&r.constructor===Object}$.isObject=t7;function r7(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")})}$.validateBBox=r7;function i7(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")}$.validateId=i7});var ob=j(We=>{"use strict";f();Object.defineProperty(We,"__esModule",{value:!0});var dt=Af();function ul(r,t,e){if(r!==null)for(var i,o,n,s,c,l,p,d=0,m=0,g,b=r.type,y=b==="FeatureCollection",C=b==="Feature",v=y?r.features.length:1,S=0;S<v;S++){p=y?r.features[S].geometry:C?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var M=0;M<c;M++){var w=0,T=0;if(s=g?p.geometries[M]:p,s!==null){l=s.coordinates;var D=s.type;switch(d=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(l,m,S,w,T)===!1)return!1;m++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],m,S,w,T)===!1)return!1;m++,D==="MultiPoint"&&w++}D==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-d;o++){if(t(l[i][o],m,S,w,T)===!1)return!1;m++}D==="MultiLineString"&&w++,D==="Polygon"&&T++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(T=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-d;n++){if(t(l[i][o][n],m,S,w,T)===!1)return!1;m++}T++}w++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(ul(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o7(r,t,e,i){var o=e;return ul(r,function(n,s,c,l,p){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,p)},i),o}function eb(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}}function n7(r,t,e){var i=e;return eb(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}function tb(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++);}function a7(r,t,e){var i=e;return tb(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}function s7(r){var t=[];return ul(r,function(e){t.push(e)}),t}function Ff(r,t){var e,i,o,n,s,c,l,p,d,m,g=0,b=r.type==="FeatureCollection",y=r.type==="Feature",C=b?r.features.length:1;for(e=0;e<C;e++){for(c=b?r.features[e].geometry:y?r.geometry:r,p=b?r.features[e].properties:y?r.properties:{},d=b?r.features[e].bbox:y?r.bbox:void 0,m=b?r.features[e].id:y?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,p,d,m)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,g,p,d,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],g,p,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}function l7(r,t,e){var i=e;return Ff(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}function wu(r,t){Ff(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(dt.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 p=0;p<e.coordinates.length;p++){var d=e.coordinates[p],m={type:l,coordinates:d};if(t(dt.feature(m,o),i,p)===!1)return!1}})}function c7(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}function rb(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,p=0,d=0;if(ul(e,function(m,g,b,y,C){if(c===void 0||i>l||y>p||C>d){c=m,l=i,p=y,d=C,n=0;return}var v=dt.lineString([c,m],e.properties);if(t(v,i,o,C,n)===!1)return!1;n++,c=m})===!1)return!1}}})}function p7(r,t,e){var i=e,o=!1;return rb(r,function(n,s,c,l,p){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,p),o=!0}),i}function ib(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(dt.lineString(s[c],e.properties),i,o,c)===!1)return!1;break}}})}function u7(r,t,e){var i=e;return ib(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}function d7(r,t){if(t=t||{},!dt.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),dt.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),dt.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),dt.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),dt.lineString([l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}function h7(r,t){if(t=t||{},!dt.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 dt.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),dt.point(l[i],s,t);case"LineString":return n<0&&(n=l.length+n),dt.point(l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),dt.point(l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),dt.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),dt.point(l[i][o][n],s,t)}throw new Error("geojson is invalid")}We.coordAll=s7;We.coordEach=ul;We.coordReduce=o7;We.featureEach=tb;We.featureReduce=a7;We.findPoint=h7;We.findSegment=d7;We.flattenEach=wu;We.flattenReduce=c7;We.geomEach=Ff;We.geomReduce=l7;We.lineEach=ib;We.lineReduce=u7;We.propEach=eb;We.propReduce=n7;We.segmentEach=rb;We.segmentReduce=p7});var kf=j((RE,ab)=>{"use strict";f();var nb=Object.prototype.toString;ab.exports=function(t){var e=nb.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&nb.call(t.callee)==="[object Function]"),i}});var mb=j((GE,fb)=>{"use strict";f();var hb;Object.keys||(dl=Object.prototype.hasOwnProperty,Bf=Object.prototype.toString,sb=kf(),_f=Object.prototype.propertyIsEnumerable,lb=!_f.call({toString:null},"toString"),cb=_f.call(function(){},"prototype"),hl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Du=function(r){var t=r.constructor;return t&&t.prototype===r},pb={$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},ub=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!pb["$"+r]&&dl.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Du(window[r])}catch{return!0}}catch{return!0}return!1}(),db=function(r){if(typeof window>"u"||!ub)return Du(r);try{return Du(r)}catch{return!1}},hb=function(t){var e=t!==null&&typeof t=="object",i=Bf.call(t)==="[object Function]",o=sb(t),n=e&&Bf.call(t)==="[object String]",s=[];if(!e&&!i&&!o)throw new TypeError("Object.keys called on a non-object");var c=cb&&i;if(n&&t.length>0&&!dl.call(t,0))for(var l=0;l<t.length;++l)s.push(String(l));if(o&&t.length>0)for(var p=0;p<t.length;++p)s.push(String(p));else for(var d in t)!(c&&d==="prototype")&&dl.call(t,d)&&s.push(String(d));if(lb)for(var m=db(t),g=0;g<hl.length;++g)!(m&&hl[g]==="constructor")&&dl.call(t,hl[g])&&s.push(hl[g]);return s});var dl,Bf,sb,_f,lb,cb,hl,Du,pb,ub,db;fb.exports=hb});var Ou=j((jE,bb)=>{"use strict";f();var f7=Array.prototype.slice,m7=kf(),gb=Object.keys,Eu=gb?function(t){return gb(t)}:mb(),yb=Object.keys;Eu.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(i){return m7(i)?yb(f7.call(i)):yb(i)})}else Object.keys=Eu;return Object.keys||Eu};bb.exports=Eu});var Cb=j((HE,vb)=>{"use strict";f();vb.exports=Error});var xb=j((XE,Sb)=>{"use strict";f();Sb.exports=EvalError});var Pb=j((ZE,Ib)=>{"use strict";f();Ib.exports=RangeError});var Tb=j((qE,Mb)=>{"use strict";f();Mb.exports=ReferenceError});var Rf=j((JE,wb)=>{"use strict";f();wb.exports=SyntaxError});var vi=j((KE,Db)=>{"use strict";f();Db.exports=TypeError});var Ob=j((tO,Eb)=>{"use strict";f();Eb.exports=URIError});var fl=j((iO,Lb)=>{"use strict";f();Lb.exports=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}});var Lu=j((nO,Fb)=>{"use strict";f();var Ab=typeof Symbol<"u"&&Symbol,g7=fl();Fb.exports=function(){return typeof Ab!="function"||typeof Symbol!="function"||typeof Ab("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:g7()}});var Bb=j((sO,kb)=>{"use strict";f();var Nf={__proto__:null,foo:{}},y7=Object;kb.exports=function(){return{__proto__:Nf}.foo===Nf.foo&&!(Nf instanceof y7)}});var Nb=j((cO,Rb)=>{"use strict";f();var b7="Function.prototype.bind called on incompatible ",v7=Object.prototype.toString,C7=Math.max,S7="[object Function]",_b=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},x7=function(t,e){for(var i=[],o=e||0,n=0;o<t.length;o+=1,n+=1)i[n]=t[o];return i},I7=function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e};Rb.exports=function(t){var e=this;if(typeof e!="function"||v7.apply(e)!==S7)throw new TypeError(b7+e);for(var i=x7(arguments,1),o,n=function(){if(this instanceof o){var d=e.apply(this,_b(i,arguments));return Object(d)===d?d:this}return e.apply(t,_b(i,arguments))},s=C7(0,e.length-i.length),c=[],l=0;l<s;l++)c[l]="$"+l;if(o=Function("binder","return function ("+I7(c,",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var p=function(){};p.prototype=e.prototype,o.prototype=new p,p.prototype=null}return o}});var Au=j((uO,Gb)=>{"use strict";f();var P7=Nb();Gb.exports=Function.prototype.bind||P7});var Gf=j((hO,Vb)=>{"use strict";f();var M7=Function.prototype.call,T7=Object.prototype.hasOwnProperty,w7=Au();Vb.exports=w7.call(M7,T7)});var mr=j((mO,Xb)=>{"use strict";f();var ce,D7=Cb(),E7=xb(),O7=Pb(),L7=Tb(),Ua=Rf(),ja=vi(),A7=Ob(),Wb=Function,Vf=function(r){try{return Wb('"use strict"; return ('+r+").constructor;")()}catch{}},fn=Object.getOwnPropertyDescriptor;if(fn)try{fn({},"")}catch{fn=null}var jf=function(){throw new ja},F7=fn?function(){try{return arguments.callee,jf}catch{try{return fn(arguments,"callee").get}catch{return jf}}}():jf,Ga=Lu()(),k7=Bb()(),Ke=Object.getPrototypeOf||(k7?function(r){return r.__proto__}:null),Va={},B7=typeof Uint8Array>"u"||!Ke?ce:Ke(Uint8Array),mn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ce:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ce:ArrayBuffer,"%ArrayIteratorPrototype%":Ga&&Ke?Ke([][Symbol.iterator]()):ce,"%AsyncFromSyncIteratorPrototype%":ce,"%AsyncFunction%":Va,"%AsyncGenerator%":Va,"%AsyncGeneratorFunction%":Va,"%AsyncIteratorPrototype%":Va,"%Atomics%":typeof Atomics>"u"?ce:Atomics,"%BigInt%":typeof BigInt>"u"?ce:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ce:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ce:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ce:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":D7,"%eval%":eval,"%EvalError%":E7,"%Float32Array%":typeof Float32Array>"u"?ce:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ce:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ce:FinalizationRegistry,"%Function%":Wb,"%GeneratorFunction%":Va,"%Int8Array%":typeof Int8Array>"u"?ce:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ce:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ce:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ga&&Ke?Ke(Ke([][Symbol.iterator]())):ce,"%JSON%":typeof JSON=="object"?JSON:ce,"%Map%":typeof Map>"u"?ce:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ga||!Ke?ce:Ke(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ce:Promise,"%Proxy%":typeof Proxy>"u"?ce:Proxy,"%RangeError%":O7,"%ReferenceError%":L7,"%Reflect%":typeof Reflect>"u"?ce:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ce:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ga||!Ke?ce:Ke(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ce:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ga&&Ke?Ke(""[Symbol.iterator]()):ce,"%Symbol%":Ga?Symbol:ce,"%SyntaxError%":Ua,"%ThrowTypeError%":F7,"%TypedArray%":B7,"%TypeError%":ja,"%Uint8Array%":typeof Uint8Array>"u"?ce:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ce:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ce:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ce:Uint32Array,"%URIError%":A7,"%WeakMap%":typeof WeakMap>"u"?ce:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ce:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ce:WeakSet};if(Ke)try{null.error}catch(r){jb=Ke(Ke(r)),mn["%Error.prototype%"]=jb}var jb,_7=function r(t){var e;if(t==="%AsyncFunction%")e=Vf("async function () {}");else if(t==="%GeneratorFunction%")e=Vf("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Vf("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&Ke&&(e=Ke(o.prototype))}return mn[t]=e,e},Ub={__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"]},ml=Au(),Fu=Gf(),R7=ml.call(Function.call,Array.prototype.concat),N7=ml.call(Function.apply,Array.prototype.splice),Hb=ml.call(Function.call,String.prototype.replace),ku=ml.call(Function.call,String.prototype.slice),G7=ml.call(Function.call,RegExp.prototype.exec),V7=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j7=/\\(\\)?/g,U7=function(t){var e=ku(t,0,1),i=ku(t,-1);if(e==="%"&&i!=="%")throw new Ua("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ua("invalid intrinsic syntax, expected opening `%`");var o=[];return Hb(t,V7,function(n,s,c,l){o[o.length]=c?Hb(l,j7,"$1"):s||n}),o},H7=function(t,e){var i=t,o;if(Fu(Ub,i)&&(o=Ub[i],i="%"+o[0]+"%"),Fu(mn,i)){var n=mn[i];if(n===Va&&(n=_7(i)),typeof n>"u"&&!e)throw new ja("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:n}}throw new Ua("intrinsic "+t+" does not exist!")};Xb.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new ja("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new ja('"allowMissing" argument must be a boolean');if(G7(/^%?[^%]*%?$/,t)===null)throw new Ua("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=U7(t),o=i.length>0?i[0]:"",n=H7("%"+o+"%",e),s=n.name,c=n.value,l=!1,p=n.alias;p&&(o=p[0],N7(i,R7([0,1],p)));for(var d=1,m=!0;d<i.length;d+=1){var g=i[d],b=ku(g,0,1),y=ku(g,-1);if((b==='"'||b==="'"||b==="`"||y==='"'||y==="'"||y==="`")&&b!==y)throw new Ua("property names with quotes must have matching quotes");if((g==="constructor"||!m)&&(l=!0),o+="."+g,s="%"+o+"%",Fu(mn,s))c=mn[s];else if(c!=null){if(!(g in c)){if(!e)throw new ja("base intrinsic for "+t+" exists, but the property is not available.");return}if(fn&&d+1>=i.length){var C=fn(c,g);m=!!C,m&&"get"in C&&!("originalValue"in C.get)?c=C.get:c=c[g]}else m=Fu(c,g),c=c[g];m&&!l&&(mn[s]=c)}}return c}});var _u=j((yO,Yb)=>{"use strict";f();var W7=mr(),Bu=W7("%Object.defineProperty%",!0)||!1;if(Bu)try{Bu({},"a",{value:1})}catch{Bu=!1}Yb.exports=Bu});var Nu=j((vO,Zb)=>{"use strict";f();var X7=mr(),Ru=X7("%Object.getOwnPropertyDescriptor%",!0);if(Ru)try{Ru([],"length")}catch{Ru=null}Zb.exports=Ru});var Gu=j((SO,$b)=>{"use strict";f();var zb=_u(),Y7=Rf(),Ha=vi(),qb=Nu();$b.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Ha("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ha("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ha("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ha("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ha("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ha("`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=!!qb&&qb(t,e);if(zb)zb(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 Y7("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Vu=j((IO,Qb)=>{"use strict";f();var Uf=_u(),Jb=function(){return!!Uf};Jb.hasArrayLengthDefineBug=function(){if(!Uf)return null;try{return Uf([],"length",{value:1}).length!==1}catch{return!0}};Qb.exports=Jb});var lo=j((MO,rv)=>{"use strict";f();var Z7=Ou(),z7=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",q7=Object.prototype.toString,$7=Array.prototype.concat,Kb=Gu(),J7=function(r){return typeof r=="function"&&q7.call(r)==="[object Function]"},ev=Vu()(),Q7=function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!J7(i)||!i())return}ev?Kb(r,t,e,!0):Kb(r,t,e)},tv=function(r,t){var e=arguments.length>2?arguments[2]:{},i=Z7(t);z7&&(i=$7.call(i,Object.getOwnPropertySymbols(t)));for(var o=0;o<i.length;o+=1)Q7(r,i[o],t[i[o]],e[i[o]])};tv.supportsDescriptors=!!ev;rv.exports=tv});var sv=j((wO,av)=>{"use strict";f();var K7=mr(),iv=Gu(),e6=Vu()(),ov=Nu(),nv=vi(),t6=K7("%Math.floor%");av.exports=function(t,e){if(typeof t!="function")throw new nv("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||t6(e)!==e)throw new nv("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,n=!0;if("length"in t&&ov){var s=ov(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(n=!1)}return(o||n||!i)&&(e6?iv(t,"length",e,!0,!0):iv(t,"length",e)),t}});var gn=j((EO,ju)=>{"use strict";f();var Hf=Au(),Uu=mr(),r6=sv(),i6=vi(),pv=Uu("%Function.prototype.apply%"),uv=Uu("%Function.prototype.call%"),dv=Uu("%Reflect.apply%",!0)||Hf.call(uv,pv),lv=_u(),o6=Uu("%Math.max%");ju.exports=function(t){if(typeof t!="function")throw new i6("a function is required");var e=dv(Hf,uv,arguments);return r6(e,1+o6(0,t.length-(arguments.length-1)),!0)};var cv=function(){return dv(Hf,pv,arguments)};lv?lv(ju.exports,"apply",{value:cv}):ju.exports.apply=cv});var Ht=j((LO,mv)=>{"use strict";f();var hv=mr(),fv=gn(),n6=fv(hv("String.prototype.indexOf"));mv.exports=function(t,e){var i=hv(t,!!e);return typeof i=="function"&&n6(t,".prototype.")>-1?fv(i):i}});var Wf=j((FO,Cv)=>{"use strict";f();var a6=Ou(),bv=fl()(),vv=Ht(),gv=Object,s6=vv("Array.prototype.push"),yv=vv("Object.prototype.propertyIsEnumerable"),l6=bv?Object.getOwnPropertySymbols:null;Cv.exports=function(t,e){if(t==null)throw new TypeError("target must be an object");var i=gv(t);if(arguments.length===1)return i;for(var o=1;o<arguments.length;++o){var n=gv(arguments[o]),s=a6(n),c=bv&&(Object.getOwnPropertySymbols||l6);if(c)for(var l=c(n),p=0;p<l.length;++p){var d=l[p];yv(n,d)&&s6(s,d)}for(var m=0;m<s.length;++m){var g=s[m];if(yv(n,g)){var b=n[g];i[g]=b}}}return i}});var Yf=j((BO,Sv)=>{"use strict";f();var Xf=Wf(),c6=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},p6=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};Sv.exports=function(){return!Object.assign||c6()||p6()?Xf:Object.assign}});var Iv=j((RO,xv)=>{"use strict";f();var u6=lo(),d6=Yf();xv.exports=function(){var t=d6();return u6(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var wv=j((GO,Tv)=>{"use strict";f();var h6=lo(),f6=gn(),m6=Wf(),Pv=Yf(),g6=Iv(),y6=f6.apply(Pv()),Mv=function(t,e){return y6(Object,arguments)};h6(Mv,{getPolyfill:Pv,implementation:m6,shim:g6});Tv.exports=Mv});var Ev=j((jO,Dv)=>{"use strict";f();var yl=function(){return typeof(function(){}).name=="string"},gl=Object.getOwnPropertyDescriptor;if(gl)try{gl([],"length")}catch{gl=null}yl.functionsHaveConfigurableNames=function(){if(!yl()||!gl)return!1;var t=gl(function(){},"name");return!!t&&!!t.configurable};var b6=Function.prototype.bind;yl.boundFunctionsHaveNames=function(){return yl()&&typeof b6=="function"&&(function(){}).bind().name!==""};Dv.exports=yl});var Av=j((HO,Lv)=>{"use strict";f();var Ov=Gu(),v6=Vu()(),C6=Ev().functionsHaveConfigurableNames(),S6=vi();Lv.exports=function(t,e){if(typeof t!="function")throw new S6("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||C6)&&(v6?Ov(t,"name",e,!0,!0):Ov(t,"name",e)),t}});var Zf=j((XO,Fv)=>{"use strict";f();var x6=Av(),I6=vi(),P6=Object;Fv.exports=x6(function(){if(this==null||this!==P6(this))throw new I6("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var zf=j((ZO,kv)=>{"use strict";f();var M6=Zf(),T6=lo().supportsDescriptors,w6=Object.getOwnPropertyDescriptor;kv.exports=function(){if(T6&&/a/mig.flags==="gim"){var t=w6(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 M6}});var Rv=j((qO,_v)=>{"use strict";f();var D6=lo().supportsDescriptors,E6=zf(),O6=Object.getOwnPropertyDescriptor,L6=Object.defineProperty,A6=TypeError,Bv=Object.getPrototypeOf,F6=/a/;_v.exports=function(){if(!D6||!Bv)throw new A6("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=E6(),e=Bv(F6),i=O6(e,"flags");return(!i||i.get!==t)&&L6(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var jv=j((JO,Vv)=>{"use strict";f();var k6=lo(),B6=gn(),_6=Zf(),Nv=zf(),R6=Rv(),Gv=B6(Nv());k6(Gv,{getPolyfill:Nv,implementation:_6,shim:R6});Vv.exports=Gv});var co=j((KO,Uv)=>{"use strict";f();var N6=fl();Uv.exports=function(){return N6()&&!!Symbol.toStringTag}});var $f=j((tL,Wv)=>{"use strict";f();var G6=co()(),V6=Ht(),qf=V6("Object.prototype.toString"),Hu=function(t){return G6&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:qf(t)==="[object Arguments]"},Hv=function(t){return Hu(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&qf(t)!=="[object Array]"&&qf(t.callee)==="[object Function]"},j6=function(){return Hu(arguments)}();Hu.isLegacyArguments=Hv;Wv.exports=j6?Hu:Hv});var Xv=j(()=>{f()});var u2=j((aL,p2)=>{f();var am=typeof Map=="function"&&Map.prototype,Jf=Object.getOwnPropertyDescriptor&&am?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xu=am&&Jf&&typeof Jf.get=="function"?Jf.get:null,Yv=am&&Map.prototype.forEach,sm=typeof Set=="function"&&Set.prototype,Qf=Object.getOwnPropertyDescriptor&&sm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Yu=sm&&Qf&&typeof Qf.get=="function"?Qf.get:null,Zv=sm&&Set.prototype.forEach,U6=typeof WeakMap=="function"&&WeakMap.prototype,vl=U6?WeakMap.prototype.has:null,H6=typeof WeakSet=="function"&&WeakSet.prototype,Cl=H6?WeakSet.prototype.has:null,W6=typeof WeakRef=="function"&&WeakRef.prototype,zv=W6?WeakRef.prototype.deref:null,X6=Boolean.prototype.valueOf,Y6=Object.prototype.toString,Z6=Function.prototype.toString,z6=String.prototype.match,lm=String.prototype.slice,uo=String.prototype.replace,q6=String.prototype.toUpperCase,qv=String.prototype.toLowerCase,o2=RegExp.prototype.test,$v=Array.prototype.concat,jr=Array.prototype.join,$6=Array.prototype.slice,Jv=Math.floor,tm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Kf=Object.getOwnPropertySymbols,rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Wa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ht=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Wa||!0)?Symbol.toStringTag:null,n2=Object.prototype.propertyIsEnumerable,Qv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Kv(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||o2.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Jv(-r):Jv(r);if(i!==r){var o=String(i),n=lm.call(t,o.length+1);return uo.call(o,e,"$&_")+"."+uo.call(uo.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return uo.call(t,e,"$&_")}var im=Xv(),e2=im.custom,t2=s2(e2)?e2:null;p2.exports=function r(t,e,i,o){var n=e||{};if(po(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(po(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=po(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(po(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(po(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 c2(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return c?Kv(t,l):l}if(typeof t=="bigint"){var p=String(t)+"n";return c?Kv(t,p):p}var d=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=d&&d>0&&typeof t=="object")return om(t)?"[Array]":"[Object]";var m=fI(n,i);if(typeof o>"u")o=[];else if(l2(o,t)>=0)return"[Circular]";function g(re,U,ie){if(U&&(o=$6.call(o),o.push(U)),ie){var Z={depth:n.depth};return po(n,"quoteStyle")&&(Z.quoteStyle=n.quoteStyle),r(re,Z,i+1,o)}return r(re,n,i+1,o)}if(typeof t=="function"&&!r2(t)){var b=nI(t),y=Wu(t,g);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(y.length>0?" { "+jr.call(y,", ")+" }":"")}if(s2(t)){var C=Wa?uo.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):rm.call(t);return typeof t=="object"&&!Wa?bl(C):C}if(uI(t)){for(var v="<"+qv.call(String(t.nodeName)),S=t.attributes||[],M=0;M<S.length;M++)v+=" "+S[M].name+"="+a2(J6(S[M].value),"double",n);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+qv.call(String(t.nodeName))+">",v}if(om(t)){if(t.length===0)return"[]";var w=Wu(t,g);return m&&!hI(w)?"["+nm(w,m)+"]":"[ "+jr.call(w,", ")+" ]"}if(K6(t)){var T=Wu(t,g);return!("cause"in Error.prototype)&&"cause"in t&&!n2.call(t,"cause")?"{ ["+String(t)+"] "+jr.call($v.call("[cause]: "+g(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+jr.call(T,", ")+" }"}if(typeof t=="object"&&s){if(t2&&typeof t[t2]=="function"&&im)return im(t,{depth:d-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(aI(t)){var D=[];return Yv&&Yv.call(t,function(re,U){D.push(g(U,t,!0)+" => "+g(re,t))}),i2("Map",Xu.call(t),D,m)}if(cI(t)){var F=[];return Zv&&Zv.call(t,function(re){F.push(g(re,t))}),i2("Set",Yu.call(t),F,m)}if(sI(t))return em("WeakMap");if(pI(t))return em("WeakSet");if(lI(t))return em("WeakRef");if(tI(t))return bl(g(Number(t)));if(iI(t))return bl(g(tm.call(t)));if(rI(t))return bl(X6.call(t));if(eI(t))return bl(g(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!Q6(t)&&!r2(t)){var O=Wu(t,g),B=Qv?Qv(t)===Object.prototype:t instanceof Object||t.constructor===Object,k=t instanceof Object?"":"null prototype",G=!B&&ht&&Object(t)===t&&ht in t?lm.call(ho(t),8,-1):k?"Object":"",V=B||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",X=V+(G||k?"["+jr.call($v.call([],G||[],k||[]),": ")+"] ":"");return O.length===0?X+"{}":m?X+"{"+nm(O,m)+"}":X+"{ "+jr.call(O,", ")+" }"}return String(t)};function a2(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function J6(r){return uo.call(String(r),/"/g,"&quot;")}function om(r){return ho(r)==="[object Array]"&&(!ht||!(typeof r=="object"&&ht in r))}function Q6(r){return ho(r)==="[object Date]"&&(!ht||!(typeof r=="object"&&ht in r))}function r2(r){return ho(r)==="[object RegExp]"&&(!ht||!(typeof r=="object"&&ht in r))}function K6(r){return ho(r)==="[object Error]"&&(!ht||!(typeof r=="object"&&ht in r))}function eI(r){return ho(r)==="[object String]"&&(!ht||!(typeof r=="object"&&ht in r))}function tI(r){return ho(r)==="[object Number]"&&(!ht||!(typeof r=="object"&&ht in r))}function rI(r){return ho(r)==="[object Boolean]"&&(!ht||!(typeof r=="object"&&ht in r))}function s2(r){if(Wa)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!rm)return!1;try{return rm.call(r),!0}catch{}return!1}function iI(r){if(!r||typeof r!="object"||!tm)return!1;try{return tm.call(r),!0}catch{}return!1}var oI=Object.prototype.hasOwnProperty||function(r){return r in this};function po(r,t){return oI.call(r,t)}function ho(r){return Y6.call(r)}function nI(r){if(r.name)return r.name;var t=z6.call(Z6.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function l2(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}function aI(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}function sI(r){if(!vl||!r||typeof r!="object")return!1;try{vl.call(r,vl);try{Cl.call(r,Cl)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function lI(r){if(!zv||!r||typeof r!="object")return!1;try{return zv.call(r),!0}catch{}return!1}function cI(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}function pI(r){if(!Cl||!r||typeof r!="object")return!1;try{Cl.call(r,Cl);try{vl.call(r,vl)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function uI(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function c2(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return c2(lm.call(r,0,t.maxStringLength),t)+i}var o=uo.call(uo.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,dI);return a2(o,"single",t)}function dI(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":"")+q6.call(t.toString(16))}function bl(r){return"Object("+r+")"}function em(r){return r+" { ? }"}function i2(r,t,e,i){var o=i?nm(e,i):jr.call(e,", ");return r+" ("+t+") {"+o+"}"}function hI(r){for(var t=0;t<r.length;t++)if(l2(r[t],"\n")>=0)return!1;return!0}function fI(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=jr.call(Array(r.indent+1)," ");else return null;return{base:e,prev:jr.call(Array(t+1),e)}}function nm(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+jr.call(r,","+e)+"\n"+t.prev}function Wu(r,t){var e=om(r),i=[];if(e){i.length=r.length;for(var o=0;o<r.length;o++)i[o]=po(r,o)?t(r[o],r):""}var n=typeof Kf=="function"?Kf(r):[],s;if(Wa){s={};for(var c=0;c<n.length;c++)s["$"+n[c]]=n[c]}for(var l in r)po(r,l)&&(e&&String(Number(l))===l&&l<r.length||Wa&&s["$"+l]instanceof Symbol||(o2.call(/[^\w$]/,l)?i.push(t(l,r)+": "+t(r[l],r)):i.push(l+": "+t(r[l],r))));if(typeof Kf=="function")for(var p=0;p<n.length;p++)n2.call(r,n[p])&&i.push("["+t(n[p])+"]: "+t(r[n[p]],r));return i}});var pm=j((lL,h2)=>{"use strict";f();var d2=mr(),Xa=Ht(),mI=u2(),gI=vi(),Zu=d2("%WeakMap%",!0),zu=d2("%Map%",!0),yI=Xa("WeakMap.prototype.get",!0),bI=Xa("WeakMap.prototype.set",!0),vI=Xa("WeakMap.prototype.has",!0),CI=Xa("Map.prototype.get",!0),SI=Xa("Map.prototype.set",!0),xI=Xa("Map.prototype.has",!0),cm=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},II=function(r,t){var e=cm(r,t);return e&&e.value},PI=function(r,t,e){var i=cm(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},MI=function(r,t){return!!cm(r,t)};h2.exports=function(){var t,e,i,o={assert:function(n){if(!o.has(n))throw new gI("Side channel does not contain "+mI(n))},get:function(n){if(Zu&&n&&(typeof n=="object"||typeof n=="function")){if(t)return yI(t,n)}else if(zu){if(e)return CI(e,n)}else if(i)return II(i,n)},has:function(n){if(Zu&&n&&(typeof n=="object"||typeof n=="function")){if(t)return vI(t,n)}else if(zu){if(e)return xI(e,n)}else if(i)return MI(i,n);return!1},set:function(n,s){Zu&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new Zu),bI(t,n,s)):zu?(e||(e=new zu),SI(e,n,s)):(i||(i={key:{},next:null}),PI(i,n,s))}};return o}});var m2=j((pL,f2)=>{"use strict";f();var TI=Gf(),Sl=pm()(),Ci=vi(),um={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ci("`O` is not an object");if(typeof t!="string")throw new Ci("`slot` must be a string");if(Sl.assert(r),!um.has(r,t))throw new Ci("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ci("`O` is not an object");if(typeof t!="string")throw new Ci("`slot` must be a string");var e=Sl.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ci("`O` is not an object");if(typeof t!="string")throw new Ci("`slot` must be a string");var e=Sl.get(r);return!!e&&TI(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Ci("`O` is not an object");if(typeof t!="string")throw new Ci("`slot` must be a string");var i=Sl.get(r);i||(i={},Sl.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(um);f2.exports=um});var b2=j((dL,y2)=>{"use strict";f();var xl=m2(),wI=SyntaxError,g2=typeof StopIteration=="object"?StopIteration:null;y2.exports=function(t){if(!g2)throw new wI("this environment lacks StopIteration");xl.set(t,"[[Done]]",!1);var e={next:function(){var o=xl.get(this,"[[Iterator]]"),n=xl.get(o,"[[Done]]");try{return{done:n,value:n?void 0:o.next()}}catch(s){if(xl.set(o,"[[Done]]",!0),s!==g2)throw s;return{done:!0,value:void 0}}}};return xl.set(e,"[[Iterator]]",t),e}});var dm=j((fL,v2)=>{f();var DI={}.toString;v2.exports=Array.isArray||function(r){return DI.call(r)=="[object Array]"}});var hm=j((gL,C2)=>{"use strict";f();var EI=String.prototype.valueOf,OI=function(t){try{return EI.call(t),!0}catch{return!1}},LI=Object.prototype.toString,AI="[object String]",FI=co()();C2.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:FI?OI(t):LI.call(t)===AI}});var mm=j((bL,I2)=>{"use strict";f();var fm=typeof Map=="function"&&Map.prototype?Map:null,kI=typeof Set=="function"&&Set.prototype?Set:null,qu;fm||(qu=function(t){return!1});var x2=fm?Map.prototype.has:null,S2=kI?Set.prototype.has:null;!qu&&!x2&&(qu=function(t){return!1});I2.exports=qu||function(t){if(!t||typeof t!="object")return!1;try{if(x2.call(t),S2)try{S2.call(t)}catch{return!0}return t instanceof fm}catch{}return!1}});var ym=j((CL,T2)=>{"use strict";f();var BI=typeof Map=="function"&&Map.prototype?Map:null,gm=typeof Set=="function"&&Set.prototype?Set:null,$u;gm||($u=function(t){return!1});var P2=BI?Map.prototype.has:null,M2=gm?Set.prototype.has:null;!$u&&!M2&&($u=function(t){return!1});T2.exports=$u||function(t){if(!t||typeof t!="object")return!1;try{if(M2.call(t),P2)try{P2.call(t)}catch{return!0}return t instanceof gm}catch{}return!1}});var N2=j((xL,Ku)=>{"use strict";f();var w2=$f(),D2=b2();Lu()()||fl()()?(Ju=Symbol.iterator,Ku.exports=function(t){if(t!=null&&typeof t[Ju]<"u")return t[Ju]();if(w2(t))return Array.prototype[Ju].call(t)}):(E2=dm(),O2=hm(),bm=mr(),L2=bm("%Map%",!0),A2=bm("%Set%",!0),Kt=Ht(),vm=Kt("Array.prototype.push"),Cm=Kt("String.prototype.charCodeAt"),F2=Kt("String.prototype.slice"),k2=function(t,e){var i=t.length;if(e+1>=i)return e+1;var o=Cm(t,e);if(o<55296||o>56319)return e+1;var n=Cm(t,e+1);return n<56320||n>57343?e+1:e+2},Qu=function(t){var e=0;return{next:function(){var o=e>=t.length,n;return o||(n=t[e],e+=1),{done:o,value:n}}}},Sm=function(t,e){if(E2(t)||w2(t))return Qu(t);if(O2(t)){var i=0;return{next:function(){var n=k2(t,i),s=F2(t,i,n);return i=n,{done:n>t.length,value:s}}}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},!L2&&!A2?Ku.exports=function(t){if(t!=null)return Sm(t,!0)}:(B2=mm(),_2=ym(),xm=Kt("Map.prototype.forEach",!0),Im=Kt("Set.prototype.forEach",!0),(typeof I>"u"||!I.versions||!I.versions.node)&&(Pm=Kt("Map.prototype.iterator",!0),Mm=Kt("Set.prototype.iterator",!0)),Tm=Kt("Map.prototype.@@iterator",!0)||Kt("Map.prototype._es6-shim iterator_",!0),wm=Kt("Set.prototype.@@iterator",!0)||Kt("Set.prototype._es6-shim iterator_",!0),R2=function(t){if(B2(t)){if(Pm)return D2(Pm(t));if(Tm)return Tm(t);if(xm){var e=[];return xm(t,function(o,n){vm(e,[n,o])}),Qu(e)}}if(_2(t)){if(Mm)return D2(Mm(t));if(wm)return wm(t);if(Im){var i=[];return Im(t,function(o){vm(i,o)}),Qu(i)}}},Ku.exports=function(t){return R2(t)||Sm(t)}));var Ju,E2,O2,bm,L2,A2,Kt,vm,Cm,F2,k2,Qu,Sm,B2,_2,xm,Im,Pm,Mm,Tm,wm,R2});var Dm=j((PL,V2)=>{"use strict";f();var G2=function(r){return r!==r};V2.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||G2(t)&&G2(e))}});var Em=j((TL,j2)=>{"use strict";f();var _I=Dm();j2.exports=function(){return typeof Object.is=="function"?Object.is:_I}});var H2=j((DL,U2)=>{"use strict";f();var RI=Em(),NI=lo();U2.exports=function(){var t=RI();return NI(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Z2=j((OL,Y2)=>{"use strict";f();var GI=lo(),VI=gn(),jI=Dm(),W2=Em(),UI=H2(),X2=VI(W2(),Object);GI(X2,{getPolyfill:W2,implementation:jI,shim:UI});Y2.exports=X2});var Lm=j((AL,J2)=>{"use strict";f();var HI=gn(),$2=Ht(),WI=mr(),Om=WI("%ArrayBuffer%",!0),ed=$2("ArrayBuffer.prototype.byteLength",!0),XI=$2("Object.prototype.toString"),z2=!!Om&&!ed&&new Om(0).slice,q2=!!z2&&HI(z2);J2.exports=ed||q2?function(t){if(!t||typeof t!="object")return!1;try{return ed?ed(t):q2(t,0),!0}catch{return!1}}:Om?function(t){return XI(t)==="[object ArrayBuffer]"}:function(t){return!1}});var K2=j((kL,Q2)=>{"use strict";f();var YI=Date.prototype.getDay,ZI=function(t){try{return YI.call(t),!0}catch{return!1}},zI=Object.prototype.toString,qI="[object Date]",$I=co()();Q2.exports=function(t){return typeof t!="object"||t===null?!1:$I?ZI(t):zI.call(t)===qI}});var o3=j((_L,i3)=>{"use strict";f();var Am=Ht(),e3=co()(),t3,r3,Fm,km;e3&&(t3=Am("Object.prototype.hasOwnProperty"),r3=Am("RegExp.prototype.exec"),Fm={},td=function(){throw Fm},km={toString:td,valueOf:td},typeof Symbol.toPrimitive=="symbol"&&(km[Symbol.toPrimitive]=td));var td,JI=Am("Object.prototype.toString"),QI=Object.getOwnPropertyDescriptor,KI="[object RegExp]";i3.exports=e3?function(t){if(!t||typeof t!="object")return!1;var e=QI(t,"lastIndex"),i=e&&t3(e,"value");if(!i)return!1;try{r3(t,km)}catch(o){return o===Fm}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:JI(t)===KI}});var s3=j((NL,a3)=>{"use strict";f();var eP=Ht(),n3=eP("SharedArrayBuffer.prototype.byteLength",!0);a3.exports=n3?function(t){if(!t||typeof t!="object")return!1;try{return n3(t),!0}catch{return!1}}:function(t){return!1}});var c3=j((VL,l3)=>{"use strict";f();var tP=Number.prototype.toString,rP=function(t){try{return tP.call(t),!0}catch{return!1}},iP=Object.prototype.toString,oP="[object Number]",nP=co()();l3.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:nP?rP(t):iP.call(t)===oP}});var d3=j((UL,u3)=>{"use strict";f();var p3=Ht(),aP=p3("Boolean.prototype.toString"),sP=p3("Object.prototype.toString"),lP=function(t){try{return aP(t),!0}catch{return!1}},cP="[object Boolean]",pP=co()();u3.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:pP&&Symbol.toStringTag in t?lP(t):sP(t)===cP}});var g3=j((WL,Bm)=>{"use strict";f();var uP=Object.prototype.toString,dP=Lu()();dP?(h3=Symbol.prototype.toString,f3=/^Symbol\(.*\)$/,m3=function(t){return typeof t.valueOf()!="symbol"?!1:f3.test(h3.call(t))},Bm.exports=function(t){if(typeof t=="symbol")return!0;if(uP.call(t)!=="[object Symbol]")return!1;try{return m3(t)}catch{return!1}}):Bm.exports=function(t){return!1};var h3,f3,m3});var v3=j((YL,b3)=>{"use strict";f();var y3=typeof BigInt<"u"&&BigInt;b3.exports=function(){return typeof y3=="function"&&typeof BigInt=="function"&&typeof y3(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var x3=j((zL,_m)=>{"use strict";f();var hP=v3()();hP?(C3=BigInt.prototype.valueOf,S3=function(t){try{return C3.call(t),!0}catch{}return!1},_m.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:S3(t)}):_m.exports=function(t){return!1};var C3,S3});var P3=j(($L,I3)=>{"use strict";f();var fP=hm(),mP=c3(),gP=d3(),yP=g3(),bP=x3();I3.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(fP(t))return"String";if(mP(t))return"Number";if(gP(t))return"Boolean";if(yP(t))return"Symbol";if(bP(t))return"BigInt"}});var w3=j((QL,T3)=>{"use strict";f();var rd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,M3=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,id;rd||(id=function(t){return!1});var Nm=rd?rd.prototype.has:null,Rm=M3?M3.prototype.has:null;!id&&!Nm&&(id=function(t){return!1});T3.exports=id||function(t){if(!t||typeof t!="object")return!1;try{if(Nm.call(t,Nm),Rm)try{Rm.call(t,Rm)}catch{return!0}return t instanceof rd}catch{}return!1}});var E3=j((eA,Vm)=>{"use strict";f();var vP=mr(),D3=Ht(),CP=vP("%WeakSet%",!0),Gm=D3("WeakSet.prototype.has",!0);Gm?(od=D3("WeakMap.prototype.has",!0),Vm.exports=function(t){if(!t||typeof t!="object")return!1;try{if(Gm(t,Gm),od)try{od(t,od)}catch{return!0}return t instanceof CP}catch{}return!1}):Vm.exports=function(t){return!1};var od});var L3=j((rA,O3)=>{"use strict";f();var SP=mm(),xP=ym(),IP=w3(),PP=E3();O3.exports=function(t){if(t&&typeof t=="object"){if(SP(t))return"Map";if(xP(t))return"Set";if(IP(t))return"WeakMap";if(PP(t))return"WeakSet"}return!1}});var B3=j((oA,k3)=>{"use strict";f();var F3=Function.prototype.toString,Ya=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Um,nd;if(typeof Ya=="function"&&typeof Object.defineProperty=="function")try{Um=Object.defineProperty({},"length",{get:function(){throw nd}}),nd={},Ya(function(){throw 42},null,Um)}catch(r){r!==nd&&(Ya=null)}else Ya=null;var MP=/^\s*class\b/,Hm=function(t){try{var e=F3.call(t);return MP.test(e)}catch{return!1}},jm=function(t){try{return Hm(t)?!1:(F3.call(t),!0)}catch{return!1}},ad=Object.prototype.toString,TP="[object Object]",wP="[object Function]",DP="[object GeneratorFunction]",EP="[object HTMLAllCollection]",OP="[object HTML document.all class]",LP="[object HTMLCollection]",AP=typeof Symbol=="function"&&!!Symbol.toStringTag,FP=!(0 in[,]),Wm=function(){return!1};typeof document=="object"&&(A3=document.all,ad.call(A3)===ad.call(document.all)&&(Wm=function(t){if((FP||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=ad.call(t);return(e===EP||e===OP||e===LP||e===TP)&&t("")==null}catch{}return!1}));var A3;k3.exports=Ya?function(t){if(Wm(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Ya(t,null,Um)}catch(e){if(e!==nd)return!1}return!Hm(t)&&jm(t)}:function(t){if(Wm(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(AP)return jm(t);if(Hm(t))return!1;var e=ad.call(t);return e!==wP&&e!==DP&&!/^\[object HTML/.test(e)?!1:jm(t)}});var N3=j((aA,R3)=>{"use strict";f();var kP=B3(),BP=Object.prototype.toString,_3=Object.prototype.hasOwnProperty,_P=function(t,e,i){for(var o=0,n=t.length;o<n;o++)_3.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},RP=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)},NP=function(t,e,i){for(var o in t)_3.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},GP=function(t,e,i){if(!kP(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=i),BP.call(t)==="[object Array]"?_P(t,e,o):typeof t=="string"?RP(t,e,o):NP(t,e,o)};R3.exports=GP});var V3=j((lA,G3)=>{"use strict";f();G3.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var U3=j((pA,j3)=>{"use strict";f();var Xm=V3(),VP=typeof globalThis>"u"?global:globalThis;j3.exports=function(){for(var t=[],e=0;e<Xm.length;e++)typeof VP[Xm[e]]=="function"&&(t[t.length]=Xm[e]);return t}});var Z3=j((dA,Y3)=>{"use strict";f();var ld=N3(),jP=U3(),H3=gn(),zm=Ht(),sd=Nu(),UP=zm("Object.prototype.toString"),X3=co()(),W3=typeof globalThis>"u"?global:globalThis,Zm=jP(),qm=zm("String.prototype.slice"),Ym=Object.getPrototypeOf,HP=zm("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},cd={__proto__:null};X3&&sd&&Ym?ld(Zm,function(r){var t=new W3[r];if(Symbol.toStringTag in t){var e=Ym(t),i=sd(e,Symbol.toStringTag);if(!i){var o=Ym(e);i=sd(o,Symbol.toStringTag)}cd["$"+r]=H3(i.get)}}):ld(Zm,function(r){var t=new W3[r],e=t.slice||t.set;e&&(cd["$"+r]=H3(e))});var WP=function(t){var e=!1;return ld(cd,function(i,o){if(!e)try{"$"+i(t)===o&&(e=qm(o,1))}catch{}}),e},XP=function(t){var e=!1;return ld(cd,function(i,o){if(!e)try{i(t),e=qm(o,1)}catch{}}),e};Y3.exports=function(t){if(!t||typeof t!="object")return!1;if(!X3){var e=qm(UP(t),8,-1);return HP(Zm,e)>-1?e:e!=="Object"?!1:XP(t)}return sd?WP(t):null}});var $3=j((fA,q3)=>{"use strict";f();var YP=Ht(),z3=YP("ArrayBuffer.prototype.byteLength",!0),ZP=Lm();q3.exports=function(t){return ZP(t)?z3?z3(t):t.byteLength:NaN}});var SC=j((gA,CC)=>{"use strict";f();var yC=wv(),Ur=Ht(),J3=jv(),zP=mr(),Za=N2(),qP=pm(),Q3=Z2(),K3=$f(),eC=dm(),tC=Lm(),rC=K2(),iC=o3(),oC=s3(),nC=Ou(),aC=P3(),sC=L3(),lC=Z3(),cC=$3(),pC=Ur("SharedArrayBuffer.prototype.byteLength",!0),uC=Ur("Date.prototype.getTime"),$m=Object.getPrototypeOf,dC=Ur("Object.prototype.toString"),ud=zP("%Set%",!0),Jm=Ur("Map.prototype.has",!0),dd=Ur("Map.prototype.get",!0),hC=Ur("Map.prototype.size",!0),hd=Ur("Set.prototype.add",!0),bC=Ur("Set.prototype.delete",!0),fd=Ur("Set.prototype.has",!0),pd=Ur("Set.prototype.size",!0);function fC(r,t,e,i){for(var o=Za(r),n;(n=o.next())&&!n.done;)if(gr(t,n.value,e,i))return bC(r,n.value),!0;return!1}function vC(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}function $P(r,t,e,i,o,n){var s=vC(e);if(s!=null)return s;var c=dd(t,s),l=yC({},o,{strict:!1});return typeof c>"u"&&!Jm(t,s)||!gr(i,c,l,n)?!1:!Jm(r,s)&&gr(i,c,l,n)}function JP(r,t,e){var i=vC(e);return i!=null?i:fd(t,i)&&!fd(r,i)}function mC(r,t,e,i,o,n){for(var s=Za(r),c,l;(c=s.next())&&!c.done;)if(l=c.value,gr(e,l,o,n)&&gr(i,dd(t,l),o,n))return bC(r,l),!0;return!1}function gr(r,t,e,i){var o=e||{};if(o.strict?Q3(r,t):r===t)return!0;var n=aC(r),s=aC(t);if(n!==s)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return o.strict?Q3(r,t):r==t;var c=i.has(r),l=i.has(t),p;if(c&&l){if(i.get(r)===i.get(t))return!0}else p={};return c||i.set(r,p),l||i.set(t,p),e9(r,t,o,i)}function gC(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))}function QP(r,t,e,i){if(pd(r)!==pd(t))return!1;for(var o=Za(r),n=Za(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||!JP(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(!fC(l,c.value,e.strict,i))return!1}else if(!e.strict&&!fd(r,c.value)&&!fC(l,c.value,e.strict,i))return!1;return pd(l)===0}return!0}function KP(r,t,e,i){if(hC(r)!==hC(t))return!1;for(var o=Za(r),n=Za(t),s,c,l,p,d,m;(s=o.next())&&!s.done;)if(p=s.value[0],d=s.value[1],p&&typeof p=="object")l||(l=new ud),hd(l,p);else if(m=dd(t,p),typeof m>"u"&&!Jm(t,p)||!gr(d,m,e,i)){if(e.strict||!$P(r,t,p,d,e,i))return!1;l||(l=new ud),hd(l,p)}if(l){for(;(c=n.next())&&!c.done;)if(p=c.value[0],m=c.value[1],p&&typeof p=="object"){if(!mC(l,r,p,m,e,i))return!1}else if(!e.strict&&(!r.has(p)||!gr(dd(r,p),m,e,i))&&!mC(l,r,p,m,yC({},e,{strict:!1}),i))return!1;return pd(l)===0}return!0}function e9(r,t,e,i){var o,n;if(typeof r!=typeof t||r==null||t==null||dC(r)!==dC(t)||K3(r)!==K3(t))return!1;var s=eC(r),c=eC(t);if(s!==c)return!1;var l=r instanceof Error,p=t instanceof Error;if(l!==p||(l||p)&&(r.name!==t.name||r.message!==t.message))return!1;var d=iC(r),m=iC(t);if(d!==m||(d||m)&&(r.source!==t.source||J3(r)!==J3(t)))return!1;var g=rC(r),b=rC(t);if(g!==b||(g||b)&&uC(r)!==uC(t)||e.strict&&$m&&$m(r)!==$m(t))return!1;var y=lC(r),C=lC(t);if(y!==C)return!1;if(y||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 v=gC(r),S=gC(t);if(v!==S)return!1;if(v||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 M=tC(r),w=tC(t);if(M!==w)return!1;if(M||w)return cC(r)!==cC(t)?!1:typeof Uint8Array=="function"&&gr(new Uint8Array(r),new Uint8Array(t),e,i);var T=oC(r),D=oC(t);if(T!==D)return!1;if(T||D)return pC(r)!==pC(t)?!1:typeof Uint8Array=="function"&&gr(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var F=nC(r),O=nC(t);if(F.length!==O.length)return!1;for(F.sort(),O.sort(),o=F.length-1;o>=0;o--)if(F[o]!=O[o])return!1;for(o=F.length-1;o>=0;o--)if(n=F[o],!gr(r[n],t[n],e,i))return!1;var B=sC(r),k=sC(t);return B!==k?!1:B==="Set"||k==="Set"?QP(r,t,e,i):B==="Map"?KP(r,t,e,i):!0}CC.exports=function(t,e,i){return gr(t,e,i,qP())}});var RC=j(fe=>{"use strict";f();Object.defineProperty(fe,"__esModule",{value:!0});function t9(r){return r&&r.__esModule?r:{default:r}}var r9=Object.defineProperty,ye=(r,t)=>r9(r,"name",{value:t,configurable:!0}),i9=SC(),o9=t9(i9),xC=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||!Il(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=Qm(t),o=Qm(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(!Il(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 Il(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?o9.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Il(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)}};ye(xC,"GeojsonEquality");var n9=xC;function Il(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}ye(Il,"sameLength");function Qm(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}ye(Qm,"explode");var kt=63710088e-1,eg={centimeters:kt*100,centimetres:kt*100,degrees:360/(2*Math.PI),feet:kt*3.28084,inches:kt*39.37,kilometers:kt/1e3,kilometres:kt/1e3,meters:kt,metres:kt,miles:kt/1609.344,millimeters:kt*1e3,millimetres:kt*1e3,nauticalmiles:kt/1852,radians:1,yards:kt*1.0936},Km={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 Si(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}ye(Si,"feature");function IC(r,t,e={}){switch(r){case"Point":return md(t).geometry;case"LineString":return yd(t).geometry;case"Polygon":return gd(t).geometry;case"MultiPoint":return rg(t).geometry;case"MultiLineString":return tg(t).geometry;case"MultiPolygon":return ig(t).geometry;default:throw new Error(r+" is invalid")}}ye(IC,"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(!Pl(r[0])||!Pl(r[1]))throw new Error("coordinates must contain numbers");return Si({type:"Point",coordinates:r},t,e)}ye(md,"point");function PC(r,t,e={}){return Ml(r.map(i=>md(i,t)),e)}ye(PC,"points");function gd(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 Si({type:"Polygon",coordinates:r},t,e)}ye(gd,"polygon");function MC(r,t,e={}){return Ml(r.map(i=>gd(i,t)),e)}ye(MC,"polygons");function yd(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Si({type:"LineString",coordinates:r},t,e)}ye(yd,"lineString");function TC(r,t,e={}){return Ml(r.map(i=>yd(i,t)),e)}ye(TC,"lineStrings");function Ml(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}ye(Ml,"featureCollection");function tg(r,t,e={}){return Si({type:"MultiLineString",coordinates:r},t,e)}ye(tg,"multiLineString");function rg(r,t,e={}){return Si({type:"MultiPoint",coordinates:r},t,e)}ye(rg,"multiPoint");function ig(r,t,e={}){return Si({type:"MultiPolygon",coordinates:r},t,e)}ye(ig,"multiPolygon");function wC(r,t,e={}){return Si({type:"GeometryCollection",geometries:r},t,e)}ye(wC,"geometryCollection");function DC(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}ye(DC,"round");function og(r,t="kilometers"){let e=eg[t];if(!e)throw new Error(t+" units is invalid");return r*e}ye(og,"radiansToLength");function bd(r,t="kilometers"){let e=eg[t];if(!e)throw new Error(t+" units is invalid");return r/e}ye(bd,"lengthToRadians");function EC(r,t){return ng(bd(r,t))}ye(EC,"lengthToDegrees");function OC(r){let t=r%360;return t<0&&(t+=360),t}ye(OC,"bearingToAzimuth");function ng(r){return r%(2*Math.PI)*180/Math.PI}ye(ng,"radiansToDegrees");function LC(r){return r%360*Math.PI/180}ye(LC,"degreesToRadians");function AC(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return og(bd(r,t),e)}ye(AC,"convertLength");function FC(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=Km[t];if(!i)throw new Error("invalid original units");let o=Km[e];if(!o)throw new Error("invalid final units");return r/i*o}ye(FC,"convertArea");function Pl(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}ye(Pl,"isNumber");function kC(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}ye(kC,"isObject");function BC(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(!Pl(t))throw new Error("bbox must only contain numbers")})}ye(BC,"validateBBox");function _C(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")}ye(_C,"validateId");fe.GeojsonEquality=n9;fe.areaFactors=Km;fe.bearingToAzimuth=OC;fe.convertArea=FC;fe.convertLength=AC;fe.degreesToRadians=LC;fe.earthRadius=kt;fe.factors=eg;fe.feature=Si;fe.featureCollection=Ml;fe.geometry=IC;fe.geometryCollection=wC;fe.isNumber=Pl;fe.isObject=kC;fe.lengthToDegrees=EC;fe.lengthToRadians=bd;fe.lineString=yd;fe.lineStrings=TC;fe.multiLineString=tg;fe.multiPoint=rg;fe.multiPolygon=ig;fe.point=md;fe.points=PC;fe.polygon=gd;fe.polygons=MC;fe.radiansToDegrees=ng;fe.radiansToLength=og;fe.round=DC;fe.validateBBox=BC;fe.validateId=_C});var zC=j(Xe=>{"use strict";f();Object.defineProperty(Xe,"__esModule",{value:!0});var a9=Object.defineProperty,ot=(r,t)=>a9(r,"name",{value:t,configurable:!0}),ft=RC();function za(r,t,e){if(r!==null)for(var i,o,n,s,c,l,p,d=0,m=0,g,b=r.type,y=b==="FeatureCollection",C=b==="Feature",v=y?r.features.length:1,S=0;S<v;S++){p=y?r.features[S].geometry:C?r.geometry:r,g=p?p.type==="GeometryCollection":!1,c=g?p.geometries.length:1;for(var M=0;M<c;M++){var w=0,T=0;if(s=g?p.geometries[M]:p,s!==null){l=s.coordinates;var D=s.type;switch(d=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(l,m,S,w,T)===!1)return!1;m++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],m,S,w,T)===!1)return!1;m++,D==="MultiPoint"&&w++}D==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-d;o++){if(t(l[i][o],m,S,w,T)===!1)return!1;m++}D==="MultiLineString"&&w++,D==="Polygon"&&T++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(T=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-d;n++){if(t(l[i][o][n],m,S,w,T)===!1)return!1;m++}T++}w++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(za(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}ot(za,"coordEach");function NC(r,t,e,i){var o=e;return za(r,function(n,s,c,l,p){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,p)},i),o}ot(NC,"coordReduce");function ag(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}}ot(ag,"propEach");function GC(r,t,e){var i=e;return ag(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}ot(GC,"propReduce");function sg(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++);}ot(sg,"featureEach");function VC(r,t,e){var i=e;return sg(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}ot(VC,"featureReduce");function jC(r){var t=[];return za(r,function(e){t.push(e)}),t}ot(jC,"coordAll");function vd(r,t){var e,i,o,n,s,c,l,p,d,m,g=0,b=r.type==="FeatureCollection",y=r.type==="Feature",C=b?r.features.length:1;for(e=0;e<C;e++){for(c=b?r.features[e].geometry:y?r.geometry:r,p=b?r.features[e].properties:y?r.properties:{},d=b?r.features[e].bbox:y?r.bbox:void 0,m=b?r.features[e].id:y?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,p,d,m)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,g,p,d,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],g,p,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}ot(vd,"geomEach");function UC(r,t,e){var i=e;return vd(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}ot(UC,"geomReduce");function Tl(r,t){vd(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(ft.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 p=0;p<e.coordinates.length;p++){var d=e.coordinates[p],m={type:l,coordinates:d};if(t(ft.feature.call(void 0,m,o),i,p)===!1)return!1}})}ot(Tl,"flattenEach");function HC(r,t,e){var i=e;return Tl(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}ot(HC,"flattenReduce");function lg(r,t){Tl(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,p=0,d=0;if(za(e,function(m,g,b,y,C){if(c===void 0||i>l||y>p||C>d){c=m,l=i,p=y,d=C,n=0;return}var v=ft.lineString.call(void 0,[c,m],e.properties);if(t(v,i,o,C,n)===!1)return!1;n++,c=m})===!1)return!1}}})}ot(lg,"segmentEach");function WC(r,t,e){var i=e,o=!1;return lg(r,function(n,s,c,l,p){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,p),o=!0}),i}ot(WC,"segmentReduce");function cg(r,t){if(!r)throw new Error("geojson is required");Tl(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(ft.lineString.call(void 0,s[c],e.properties),i,o,c)===!1)return!1;break}}})}ot(cg,"lineEach");function XC(r,t,e){var i=e;return cg(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}ot(XC,"lineReduce");function YC(r,t){if(t=t||{},!ft.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),ft.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),ft.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),ft.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),ft.lineString.call(void 0,[l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}ot(YC,"findSegment");function ZC(r,t){if(t=t||{},!ft.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 ft.point.call(void 0,l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),ft.point.call(void 0,l[i],s,t);case"LineString":return n<0&&(n=l.length+n),ft.point.call(void 0,l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),ft.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),ft.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),ft.point.call(void 0,l[i][o][n],s,t)}throw new Error("geojson is invalid")}ot(ZC,"findPoint");Xe.coordAll=jC;Xe.coordEach=za;Xe.coordReduce=NC;Xe.featureEach=sg;Xe.featureReduce=VC;Xe.findPoint=ZC;Xe.findSegment=YC;Xe.flattenEach=Tl;Xe.flattenReduce=HC;Xe.geomEach=vd;Xe.geomReduce=UC;Xe.lineEach=cg;Xe.lineReduce=XC;Xe.propEach=ag;Xe.propReduce=GC;Xe.segmentEach=lg;Xe.segmentReduce=WC});var qC=j(Cd=>{"use strict";f();Object.defineProperty(Cd,"__esModule",{value:!0});var s9=Object.defineProperty,l9=(r,t)=>s9(r,"name",{value:t,configurable:!0}),c9=zC();function pg(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return c9.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}l9(pg,"bbox");var p9=pg;Cd.bbox=pg;Cd.default=p9});var e4=j((wA,ug)=>{f();var Hr=z0(),JC=Af(),QC=ob(),qa=qC().default,u9=QC.featureEach,MA=QC.coordEach,TA=JC.polygon,$C=JC.featureCollection;function KC(r){var t=new Hr(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qa(e),Hr.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:qa(o),i.push(o)}):u9(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qa(o),i.push(o)}),Hr.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:qa(e),Hr.prototype.remove.call(this,e,i)},t.clear=function(){return Hr.prototype.clear.call(this)},t.search=function(e){var i=Hr.prototype.search.call(this,this.toBBox(e));return $C(i)},t.collides=function(e){return Hr.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Hr.prototype.all.call(this);return $C(e)},t.toJSON=function(){return Hr.prototype.toJSON.call(this)},t.fromJSON=function(e){return Hr.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=qa(e);else if(e.type==="FeatureCollection")i=qa(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}ug.exports=KC;ug.exports.default=KC});var I5=j((FV,bc)=>{"use strict";f();var q9=!1,Wn=!1,g5=!0,y5=!1,h={},b5=!1;typeof bc<"u"&&bc.exports?(bc.exports=h,b5=!0):typeof document<"u"?window.ClipperLib=h:self.ClipperLib=h;var Zd;b5?(ze="chrome",Zd="Netscape"):(ze=navigator.userAgent.toString().toLowerCase(),Zd=navigator.appName);var ze,le={};ze.indexOf("chrome")!=-1&&ze.indexOf("chromium")==-1?le.chrome=1:le.chrome=0;ze.indexOf("chromium")!=-1?le.chromium=1:le.chromium=0;ze.indexOf("safari")!=-1&&ze.indexOf("chrome")==-1&&ze.indexOf("chromium")==-1?le.safari=1:le.safari=0;ze.indexOf("firefox")!=-1?le.firefox=1:le.firefox=0;ze.indexOf("firefox/17")!=-1?le.firefox17=1:le.firefox17=0;ze.indexOf("firefox/15")!=-1?le.firefox15=1:le.firefox15=0;ze.indexOf("firefox/3")!=-1?le.firefox3=1:le.firefox3=0;ze.indexOf("opera")!=-1?le.opera=1:le.opera=0;ze.indexOf("msie 10")!=-1?le.msie10=1:le.msie10=0;ze.indexOf("msie 9")!=-1?le.msie9=1:le.msie9=0;ze.indexOf("msie 8")!=-1?le.msie8=1:le.msie8=0;ze.indexOf("msie 7")!=-1?le.msie7=1:le.msie7=0;ze.indexOf("msie ")!=-1?le.msie=1:le.msie=0;h.biginteger_used=null;var Ao,$9=0xdeadbeefcafe,f5=($9&16777215)==15715070;function R(r,t,e){h.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))}function pe(){return new R(null)}function J9(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}function Q9(r,t,e,i,o,n){for(var s=t&32767,c=t>>15;--n>=0;){var l=this[r]&32767,p=this[r++]>>15,d=c*l+p*s;l=s*l+((d&32767)<<15)+e[i]+(o&1073741823),o=(l>>>30)+(d>>>15)+c*p+(o>>>30),e[i++]=l&1073741823}return o}function K9(r,t,e,i,o,n){for(var s=t&16383,c=t>>14;--n>=0;){var l=this[r]&16383,p=this[r++]>>14,d=c*l+p*s;l=s*l+((d&16383)<<14)+e[i]+o,o=(l>>28)+(d>>14)+c*p,e[i++]=l&268435455}return o}f5&&Zd=="Microsoft Internet Explorer"?(R.prototype.am=Q9,Ao=30):f5&&Zd!="Netscape"?(R.prototype.am=J9,Ao=26):(R.prototype.am=K9,Ao=28);R.prototype.DB=Ao;R.prototype.DM=(1<<Ao)-1;R.prototype.DV=1<<Ao;var ey=52;R.prototype.FV=Math.pow(2,ey);R.prototype.F1=ey-Ao;R.prototype.F2=2*Ao-ey;var eM="0123456789abcdefghijklmnopqrstuvwxyz",qd=new Array,ms,lr;ms=48;for(lr=0;lr<=9;++lr)qd[ms++]=lr;ms=97;for(lr=10;lr<36;++lr)qd[ms++]=lr;ms=65;for(lr=10;lr<36;++lr)qd[ms++]=lr;function m5(r){return eM.charAt(r)}function v5(r,t){var e=qd[r.charCodeAt(t)];return e==null?-1:e}function tM(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}function rM(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}function Lo(r){var t=pe();return t.fromInt(r),t}function iM(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:v5(r,i);if(s<0){r.charAt(i)=="-"&&(o=!0);continue}o=!1,n==0?this[this.t++]=s:n+e>this.DB?(this[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this[this.t++]=s>>this.DB-n):this[this.t-1]|=s<<n,n+=e,n>=this.DB&&(n-=this.DB)}e==8&&(r[0]&128)!=0&&(this.s=-1,n>0&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&R.ZERO.subTo(this,this)}function oM(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}function nM(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=m5(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+=m5(i));return o?n:"0"}function aM(){var r=pe();return R.ZERO.subTo(this,r),r}function sM(){return this.s<0?this.negate():this}function lM(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}function $d(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}function cM(){return this.t<=0?0:this.DB*(this.t-1)+$d(this[this.t-1]^this.s&this.DM)}function pM(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}function uM(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}function dM(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()}function hM(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()}function fM(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()}function mM(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&&R.ZERO.subTo(t,t)}function gM(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()}function yM(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=pe());var n=pe(),s=this.s,c=r.s,l=this.DB-$d(i[i.t-1]);l>0?(i.lShiftTo(l,n),o.lShiftTo(l,e)):(i.copyTo(n),o.copyTo(e));var p=n.t,d=n[p-1];if(d!=0){var m=d*(1<<this.F1)+(p>1?n[p-2]>>this.F2:0),g=this.FV/m,b=(1<<this.F1)/m,y=1<<this.F2,C=e.t,v=C-p,S=t==null?pe():t;for(n.dlShiftTo(v,S),e.compareTo(S)>=0&&(e[e.t++]=1,e.subTo(S,e)),R.ONE.dlShiftTo(p,S),S.subTo(n,n);n.t<p;)n[n.t++]=0;for(;--v>=0;){var M=e[--C]==d?this.DM:Math.floor(e[C]*g+(e[C-1]+y)*b);if((e[C]+=n.am(0,M,e,v,0,p))<M)for(n.dlShiftTo(v,S),e.subTo(S,e);e[C]<--M;)e.subTo(S,e)}t!=null&&(e.drShiftTo(p,t),s!=c&&R.ZERO.subTo(t,t)),e.t=p,e.clamp(),l>0&&e.rShiftTo(l,e),s<0&&R.ZERO.subTo(e,e)}}}function bM(r){var t=pe();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(R.ZERO)>0&&r.subTo(t,t),t}function Xn(r){this.m=r}function vM(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}function CM(r){return r}function SM(r){r.divRemTo(this.m,null,r)}function xM(r,t,e){r.multiplyTo(t,e),this.reduce(e)}function IM(r,t){r.squareTo(t),this.reduce(t)}Xn.prototype.convert=vM;Xn.prototype.revert=CM;Xn.prototype.reduce=SM;Xn.prototype.mulTo=xM;Xn.prototype.sqrTo=IM;function PM(){if(this.t<1)return 0;var r=this[0];if((r&1)==0)return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Yn(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}function MM(r){var t=pe();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(R.ZERO)>0&&this.m.subTo(t,t),t}function TM(r){var t=pe();return r.copyTo(t),this.reduce(t),t}function wM(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)}function DM(r,t){r.squareTo(t),this.reduce(t)}function EM(r,t,e){r.multiplyTo(t,e),this.reduce(e)}Yn.prototype.convert=MM;Yn.prototype.revert=TM;Yn.prototype.reduce=wM;Yn.prototype.mulTo=EM;Yn.prototype.sqrTo=DM;function OM(){return(this.t>0?this[0]&1:this.s)==0}function LM(r,t){if(r>4294967295||r<1)return R.ONE;var e=pe(),i=pe(),o=t.convert(this),n=$d(r)-1;for(o.copyTo(e);--n>=0;)if(t.sqrTo(e,i),(r&1<<n)>0)t.mulTo(i,o,e);else{var s=e;e=i,i=s}return t.revert(e)}function AM(r,t){var e;return r<256||t.isEven()?e=new Xn(t):e=new Yn(t),this.exp(r,e)}R.prototype.copyTo=tM;R.prototype.fromInt=rM;R.prototype.fromString=iM;R.prototype.clamp=oM;R.prototype.dlShiftTo=pM;R.prototype.drShiftTo=uM;R.prototype.lShiftTo=dM;R.prototype.rShiftTo=hM;R.prototype.subTo=fM;R.prototype.multiplyTo=mM;R.prototype.squareTo=gM;R.prototype.divRemTo=yM;R.prototype.invDigit=PM;R.prototype.isEven=OM;R.prototype.exp=LM;R.prototype.toString=nM;R.prototype.negate=aM;R.prototype.abs=sM;R.prototype.compareTo=lM;R.prototype.bitLength=cM;R.prototype.mod=bM;R.prototype.modPowInt=AM;R.ZERO=Lo(0);R.ONE=Lo(1);function FM(){var r=pe();return this.copyTo(r),r}function kM(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function BM(){return this.t==0?this.s:this[0]<<24>>24}function _M(){return this.t==0?this.s:this[0]<<16>>16}function RM(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}function NM(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function GM(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var t=this.chunkSize(r),e=Math.pow(r,t),i=Lo(e),o=pe(),n=pe(),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}function VM(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=v5(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&&R.ZERO.subTo(this,this)}function jM(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(R.ONE.shiftLeft(r-1),ty,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(R.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)}}function UM(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,o=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[o++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),(i&128)!=0&&(i|=-256),o==0&&(this.s&128)!=(i&128)&&++o,(o>0||i!=this.s)&&(t[o++]=i);return t}function HM(r){return this.compareTo(r)==0}function WM(r){return this.compareTo(r)<0?this:r}function XM(r){return this.compareTo(r)>0?this:r}function YM(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()}function ZM(r,t){return r&t}function zM(r){var t=pe();return this.bitwiseTo(r,ZM,t),t}function ty(r,t){return r|t}function qM(r){var t=pe();return this.bitwiseTo(r,ty,t),t}function C5(r,t){return r^t}function $M(r){var t=pe();return this.bitwiseTo(r,C5,t),t}function S5(r,t){return r&~t}function JM(r){var t=pe();return this.bitwiseTo(r,S5,t),t}function QM(){for(var r=pe(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}function KM(r){var t=pe();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}function e8(r){var t=pe();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}function t8(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}function r8(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+t8(this[r]);return this.s<0?this.t*this.DB:-1}function i8(r){for(var t=0;r!=0;)r&=r-1,++t;return t}function o8(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=i8(this[e]^t);return r}function n8(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}function a8(r,t){var e=R.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}function s8(r){return this.changeBit(r,ty)}function l8(r){return this.changeBit(r,S5)}function c8(r){return this.changeBit(r,C5)}function p8(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()}function u8(r){var t=pe();return this.addTo(r,t),t}function d8(r){var t=pe();return this.subTo(r,t),t}function h8(r){var t=pe();return this.multiplyTo(r,t),t}function f8(){var r=pe();return this.squareTo(r),r}function m8(r){var t=pe();return this.divRemTo(r,t,null),t}function g8(r){var t=pe();return this.divRemTo(r,null,t),t}function y8(r){var t=pe(),e=pe();return this.divRemTo(r,t,e),new Array(t,e)}function b8(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}function v8(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]}}function vc(){}function x5(r){return r}function C8(r,t,e){r.multiplyTo(t,e)}function S8(r,t){r.squareTo(t)}vc.prototype.convert=x5;vc.prototype.revert=x5;vc.prototype.mulTo=C8;vc.prototype.sqrTo=S8;function x8(r){return this.exp(r,new vc)}function I8(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()}function P8(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)}function gs(r){this.r2=pe(),this.q3=pe(),R.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}function M8(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=pe();return r.copyTo(t),this.reduce(t),t}function T8(r){return r}function w8(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)}function D8(r,t){r.squareTo(t),this.reduce(t)}function E8(r,t,e){r.multiplyTo(t,e),this.reduce(e)}gs.prototype.convert=M8;gs.prototype.revert=T8;gs.prototype.reduce=w8;gs.prototype.mulTo=E8;gs.prototype.sqrTo=D8;function O8(r,t){var e=r.bitLength(),i,o=Lo(1),n;if(e<=0)return o;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?n=new Xn(t):t.isEven()?n=new gs(t):n=new Yn(t);var s=new Array,c=3,l=i-1,p=(1<<i)-1;if(s[1]=n.convert(this),i>1){var d=pe();for(n.sqrTo(s[1],d);c<=p;)s[c]=pe(),n.mulTo(d,s[c-2],s[c]),c+=2}var m=r.t-1,g,b=!0,y=pe(),C;for(e=$d(r[m])-1;m>=0;){for(e>=l?g=r[m]>>e-l&p:(g=(r[m]&(1<<e+1)-1)<<l-e,m>0&&(g|=r[m-1]>>this.DB+e-l)),c=i;(g&1)==0;)g>>=1,--c;if((e-=c)<0&&(e+=this.DB,--m),b)s[g].copyTo(o),b=!1;else{for(;c>1;)n.sqrTo(o,y),n.sqrTo(y,o),c-=2;c>0?n.sqrTo(o,y):(C=o,o=y,y=C),n.mulTo(y,s[g],o)}for(;m>=0&&(r[m]&1<<e)==0;)n.sqrTo(o,y),C=o,o=y,y=C,--e<0&&(e=this.DB-1,--m)}return n.revert(o)}function L8(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}function A8(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}function F8(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return R.ZERO;for(var e=r.clone(),i=this.clone(),o=Lo(1),n=Lo(0),s=Lo(0),c=Lo(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!o.isEven()||!n.isEven())&&(o.addTo(this,o),n.subTo(r,n)),o.rShiftTo(1,o)):n.isEven()||n.subTo(r,n),n.rShiftTo(1,n);for(;i.isEven();)i.rShiftTo(1,i),t?((!s.isEven()||!c.isEven())&&(s.addTo(this,s),c.subTo(r,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(r,c),c.rShiftTo(1,c);e.compareTo(i)>=0?(e.subTo(i,e),t&&o.subTo(s,o),n.subTo(c,n)):(i.subTo(e,i),t&&s.subTo(o,s),c.subTo(n,c))}if(i.compareTo(R.ONE)!=0)return R.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}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],k8=(1<<26)/Mt[Mt.length-1];function B8(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<k8;)i*=Mt[o++];for(i=e.modInt(i);t<o;)if(i%Mt[t++]==0)return!1}return e.millerRabin(r)}function _8(r){var t=this.subtract(R.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=pe(),n=0;n<r;++n){o.fromInt(Mt[Math.floor(Math.random()*Mt.length)]);var s=o.modPow(i,this);if(s.compareTo(R.ONE)!=0&&s.compareTo(t)!=0){for(var c=1;c++<e&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(R.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}R.prototype.chunkSize=RM;R.prototype.toRadix=GM;R.prototype.fromRadix=VM;R.prototype.fromNumber=jM;R.prototype.bitwiseTo=YM;R.prototype.changeBit=a8;R.prototype.addTo=p8;R.prototype.dMultiply=b8;R.prototype.dAddOffset=v8;R.prototype.multiplyLowerTo=I8;R.prototype.multiplyUpperTo=P8;R.prototype.modInt=A8;R.prototype.millerRabin=_8;R.prototype.clone=FM;R.prototype.intValue=kM;R.prototype.byteValue=BM;R.prototype.shortValue=_M;R.prototype.signum=NM;R.prototype.toByteArray=UM;R.prototype.equals=HM;R.prototype.min=WM;R.prototype.max=XM;R.prototype.and=zM;R.prototype.or=qM;R.prototype.xor=$M;R.prototype.andNot=JM;R.prototype.not=QM;R.prototype.shiftLeft=KM;R.prototype.shiftRight=e8;R.prototype.getLowestSetBit=r8;R.prototype.bitCount=o8;R.prototype.testBit=n8;R.prototype.setBit=s8;R.prototype.clearBit=l8;R.prototype.flipBit=c8;R.prototype.add=u8;R.prototype.subtract=d8;R.prototype.multiply=h8;R.prototype.divide=m8;R.prototype.remainder=g8;R.prototype.divideAndRemainder=y8;R.prototype.modPow=O8;R.prototype.modInverse=F8;R.prototype.pow=x8;R.prototype.gcd=L8;R.prototype.isProbablePrime=B8;R.prototype.square=f8;var se=R;se.prototype.IsNegative=function(){return this.compareTo(se.ZERO)==-1};se.op_Equality=function(r,t){return r.compareTo(t)==0};se.op_Inequality=function(r,t){return r.compareTo(t)!=0};se.op_GreaterThan=function(r,t){return r.compareTo(t)>0};se.op_LessThan=function(r,t){return r.compareTo(t)<0};se.op_Addition=function(r,t){return new se(r).add(new se(t))};se.op_Subtraction=function(r,t){return new se(r).subtract(new se(t))};se.Int128Mul=function(r,t){return new se(r).multiply(new se(t))};se.op_Division=function(r,t){return r.divide(t)};se.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof zd>"u"&&(zd=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}});var zd;h.Path=function(){return[]};h.Paths=function(){return[]};h.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])};h.DoublePoint0=function(){this.X=0,this.Y=0};h.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};h.DoublePoint2=function(r,t){this.X=r,this.Y=t};h.PolyNode=function(){this.m_Parent=null,this.m_polygon=new h.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};h.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};h.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};h.PolyNode.prototype.Contour=function(){return this.m_polygon};h.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};h.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};h.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]};h.PolyNode.prototype.Childs=function(){return this.m_Childs};h.PolyNode.prototype.Parent=function(){return this.m_Parent};h.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};h.PolyTree=function(){this.m_AllPolys=[],h.PolyNode.call(this)};h.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};h.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};h.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};zd(h.PolyTree,h.PolyNode);h.Math_Abs_Int64=h.Math_Abs_Int32=h.Math_Abs_Double=function(r){return Math.abs(r)};h.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};le.msie||le.opera||le.safari?h.Cast_Int32=function(r){return r|0}:h.Cast_Int32=function(r){return~~r};le.chrome?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:le.firefox&&typeof Number.toInteger=="function"?h.Cast_Int64=function(r){return Number.toInteger(r)}:le.msie7||le.msie8?h.Cast_Int64=function(r){return parseInt(r,10)}:le.msie?h.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:h.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};h.Clear=function(r){r.length=0};h.PI=3.141592653589793;h.PI2=2*3.141592653589793;h.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,Wn)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 h.DoublePoint){var e=r[0];this.X=h.Clipper.Round(e.X),this.Y=h.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 h.DoublePoint){var e=r[0];this.X=h.Clipper.Round(e.X),this.Y=h.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};h.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};h.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};Wn?(h.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},h.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},h.IntPoint1dp=function(r){this.X=h.Clipper.Round(r.X),this.Y=h.Clipper.Round(r.Y),this.Z=0},h.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},h.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(h.IntPoint0=function(){this.X=0,this.Y=0},h.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},h.IntPoint1dp=function(r){this.X=h.Clipper.Round(r.X),this.Y=h.Clipper.Round(r.Y)},h.IntPoint2=function(r,t){this.X=r,this.Y=t});h.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)};h.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};h.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};h.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};h.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};h.PolyType={ptSubject:0,ptClip:1};h.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};h.JoinType={jtSquare:0,jtRound:1,jtMiter:2};h.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};y5&&(h.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});h.EdgeSide={esLeft:0,esRight:1};h.Direction={dRightToLeft:0,dLeftToRight:1};h.TEdge=function(){this.Bot=new h.IntPoint,this.Curr=new h.IntPoint,this.Top=new h.IntPoint,this.Delta=new h.IntPoint,this.Dx=0,this.PolyTyp=h.PolyType.ptSubject,this.Side=h.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};h.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new h.IntPoint};h.MyIntersectNodeSort=function(){};h.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};h.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};h.Scanbeam=function(){this.Y=0,this.Next=null};h.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};h.OutPt=function(){this.Idx=0,this.Pt=new h.IntPoint,this.Next=null,this.Prev=null};h.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new h.IntPoint};h.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};h.ClipperBase.horizontal=-9007199254740992;h.ClipperBase.Skip=-2;h.ClipperBase.Unassigned=-1;h.ClipperBase.tolerance=1e-20;q9?(h.ClipperBase.loRange=46340,h.ClipperBase.hiRange=46340):(h.ClipperBase.loRange=47453132,h.ClipperBase.hiRange=0xfffffffffffff);h.ClipperBase.near_zero=function(r){return r>-h.ClipperBase.tolerance&&r<h.ClipperBase.tolerance};h.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};h.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(h.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};h.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&&se.op_Equality(se.Int128Mul(r.X-t.X,e.Y-t.Y),se.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)};h.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};h.ClipperBase.prototype.SlopesEqual=h.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?se.op_Equality(se.Int128Mul(e.Delta.Y,i.Delta.X),se.Int128Mul(e.Delta.X,i.Delta.Y)):h.Cast_Int64(e.Delta.Y*i.Delta.X)==h.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(o=r[0],n=r[1],s=r[2],l=r[3],l?se.op_Equality(se.Int128Mul(o.Y-n.Y,n.X-s.X),se.Int128Mul(o.X-n.X,n.Y-s.Y)):h.Cast_Int64((o.Y-n.Y)*(n.X-s.X))-h.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?se.op_Equality(se.Int128Mul(o.Y-n.Y,s.X-c.X),se.Int128Mul(o.X-n.X,s.Y-c.Y)):h.Cast_Int64((o.Y-n.Y)*(s.X-c.X))-h.Cast_Int64((o.X-n.X)*(s.Y-c.Y))===0)};h.ClipperBase.SlopesEqual3=function(r,t,e){return e?se.op_Equality(se.Int128Mul(r.Delta.Y,t.Delta.X),se.Int128Mul(r.Delta.X,t.Delta.Y)):h.Cast_Int64(r.Delta.Y*t.Delta.X)==h.Cast_Int64(r.Delta.X*t.Delta.Y)};h.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?se.op_Equality(se.Int128Mul(r.Y-t.Y,t.X-e.X),se.Int128Mul(r.X-t.X,t.Y-e.Y)):h.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-h.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};h.ClipperBase.SlopesEqual5=function(r,t,e,i,o){return o?se.op_Equality(se.Int128Mul(r.Y-t.Y,e.X-i.X),se.Int128Mul(r.X-t.X,e.Y-i.Y)):h.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-h.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};h.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;h.Clear(this.m_edges[r])}h.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};h.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};h.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>h.ClipperBase.hiRange||r.Y>h.ClipperBase.hiRange||-r.X>h.ClipperBase.hiRange||-r.Y>h.ClipperBase.hiRange)&&h.Error("Coordinate outside allowed range in RangeTest()."):(r.X>h.ClipperBase.loRange||r.Y>h.ClipperBase.loRange||-r.X>h.ClipperBase.loRange||-r.Y>h.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};h.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};h.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};h.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;h.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||h.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=h.ClipperBase.horizontal&&r.Prev.Dx!=h.ClipperBase.horizontal)break;for(;r.Prev.Dx==h.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==h.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};h.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,o,n;if(r.Dx==h.ClipperBase.horizontal&&(t?n=r.Prev.Bot.X:n=r.Next.Bot.X,r.Bot.X!=n&&this.ReverseHorizontal(r)),i.OutIdx!=h.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=h.ClipperBase.Skip;)i=i.Next;if(i.Dx==h.ClipperBase.horizontal&&i.Next.OutIdx!=h.ClipperBase.Skip){for(o=i;o.Prev.Dx==h.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==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==h.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!=h.ClipperBase.Skip;)i=i.Prev;if(i.Dx==h.ClipperBase.horizontal&&i.Prev.OutIdx!=h.ClipperBase.Skip){for(o=i;o.Next.Dx==h.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==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==h.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==h.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==h.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==h.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 h.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};h.ClipperBase.prototype.AddPath=function(r,t,e){g5?!e&&t==h.PolyType.ptClip&&h.Error("AddPath: Open paths must be subject."):e||h.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&h.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&h.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 h.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],p=l,d=l;;){if(h.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==l&&(l=p.Next),p=this.RemoveEdge(p),d=p;continue}if(p.Prev==p.Next)break;if(e&&h.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==l&&(l=p.Next),p=this.RemoveEdge(p),p=p.Prev,d=p;continue}if(p=p.Next,p==d)break}if(!e&&p==p.Next||e&&p.Prev==p.Next)return!1;e||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=h.ClipperBase.Skip);var m=l;p=l;do this.InitEdge2(p,t),p=p.Next,s&&p.Curr.Y!=l.Curr.Y&&(s=!1);while(p!=l);if(s){if(e)return!1;p.Prev.OutIdx=h.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var g=new h.LocalMinima;for(g.Next=null,g.Y=p.Bot.Y,g.LeftBound=null,g.RightBound=p,g.RightBound.Side=h.EdgeSide.esRight,g.RightBound.WindDelta=0;p.Next.OutIdx!=h.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(g),this.m_edges.push(o),!0}this.m_edges.push(o);for(var b,y=null;p=this.FindNextLocMin(p),p!=y;){y==null&&(y=p);var g=new h.LocalMinima;g.Next=null,g.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(g.LeftBound=p.Prev,g.RightBound=p,b=!1):(g.LeftBound=p,g.RightBound=p.Prev,b=!0),g.LeftBound.Side=h.EdgeSide.esLeft,g.RightBound.Side=h.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,p=this.ProcessBound(g.LeftBound,b);var C=this.ProcessBound(g.RightBound,!b);g.LeftBound.OutIdx==h.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==h.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),b||(p=C)}return!0};h.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};h.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return h.IntPoint.op_Equality(r,e)||h.IntPoint.op_Equality(r,t)||h.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};h.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};h.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=h.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};h.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}};h.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};h.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,Wn&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};h.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=h.EdgeSide.esLeft,t.OutIdx=h.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=h.EdgeSide.esRight,t.OutIdx=h.ClipperBase.Unassigned),r=r.Next}};h.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=h.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=h.PolyFillType.pftEvenOdd,this.m_SubjFillType=h.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,h.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=h.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,Wn&&(this.ZFillFunction=null)};h.Clipper.ioReverseSolution=1;h.Clipper.ioStrictlySimple=2;h.Clipper.ioPreserveCollinear=4;h.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),h.ClipperBase.prototype.Clear.call(this))};h.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};h.Clipper.prototype.Reset=function(){h.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};h.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new h.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new h.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 h.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};h.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof h.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&&h.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,h.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,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],l=r[1];return this.Execute(i,l,h.PolyFillType.pftEvenOdd,h.PolyFillType.pftEvenOdd)}};h.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}};h.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),h.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{h.Clear(this.m_Joins),h.Clear(this.m_GhostJoins)}};h.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};h.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);h.Clear(this.m_PolyOuts)};h.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};h.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}};h.Clipper.prototype.AddJoin=function(r,t,e){var i=new h.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};h.Clipper.prototype.AddGhostJoin=function(r,t){var e=new h.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};Wn&&(h.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))});h.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&&(h.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&h.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&&h.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&&h.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}}}};h.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}};h.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<h.Clipper.TopX(r,t.Top.Y):r.Top.X>h.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};h.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==h.PolyType.ptSubject?this.m_SubjFillType==h.PolyFillType.pftEvenOdd:this.m_ClipFillType==h.PolyFillType.pftEvenOdd};h.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==h.PolyType.ptSubject?this.m_ClipFillType==h.PolyFillType.pftEvenOdd:this.m_SubjFillType==h.PolyFillType.pftEvenOdd};h.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==h.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case h.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case h.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case h.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case h.ClipType.ctIntersection:switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2!==0;case h.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case h.ClipType.ctUnion:switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case h.ClipType.ctDifference:if(r.PolyTyp==h.PolyType.ptSubject)switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2!==0;case h.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case h.ClipType.ctXor:if(r.WindDelta===0)switch(e){case h.PolyFillType.pftEvenOdd:case h.PolyFillType.pftNonZero:return r.WindCnt2===0;case h.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};h.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!=h.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};h.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)};h.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};h.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)}};h.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)}};h.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)};h.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,o,n;if(h.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=h.EdgeSide.esLeft,t.Side=h.EdgeSide.esRight,o=r,o.PrevInAEL==t?n=t.PrevInAEL:n=o.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=h.EdgeSide.esRight,t.Side=h.EdgeSide.esLeft,o=t,o.PrevInAEL==r?n=r.PrevInAEL:n=o.PrevInAEL),n!==null&&n.OutIdx>=0&&h.Clipper.TopX(n,e.Y)==h.Clipper.TopX(o,e.Y)&&h.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};h.Clipper.prototype.CreateOutRec=function(){var r=new h.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};h.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==h.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var o=new h.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),Wn&&(h.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):h.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&&h.IntPoint.op_Equality(t,n.Pt))return n;if(!e&&h.IntPoint.op_Equality(t,n.Prev.Pt))return n.Prev;var o=new h.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),Wn&&(h.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):h.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}};h.Clipper.prototype.SwapPoints=function(r,t){var e=new h.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};h.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};h.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new h.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};h.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)};h.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?h.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};h.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;h.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;h.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;h.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;h.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};h.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;h.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};h.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};h.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};h.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};h.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,p;r.Side==h.EdgeSide.esLeft?(t.Side==h.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),p=h.EdgeSide.esLeft):(t.Side==h.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),p=h.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 d=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=d,g.Side=p;break}g=g.NextInAEL}i.Idx=e.Idx};h.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)}};h.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};h.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};h.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(g5&&(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==h.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!=h.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=h.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1))),o&&(r.OutIdx<0?this.DeleteFromAEL(r):h.Error("Error intersecting polylines")),n&&(t.OutIdx<0?this.DeleteFromAEL(t):h.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 p,d,m,g;r.PolyTyp==h.PolyType.ptSubject?(p=this.m_SubjFillType,m=this.m_ClipFillType):(p=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==h.PolyType.ptSubject?(d=this.m_SubjFillType,g=this.m_ClipFillType):(d=this.m_ClipFillType,g=this.m_SubjFillType);var b,y;switch(p){case h.PolyFillType.pftPositive:b=r.WindCnt;break;case h.PolyFillType.pftNegative:b=-r.WindCnt;break;default:b=Math.abs(r.WindCnt);break}switch(d){case h.PolyFillType.pftPositive:y=t.WindCnt;break;case h.PolyFillType.pftNegative:y=-t.WindCnt;break;default:y=Math.abs(t.WindCnt);break}if(s&&c)o||n||b!==0&&b!=1||y!==0&&y!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=h.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(s)(y===0||y==1)&&(this.AddOutPt(r,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if(c)(b===0||b==1)&&(this.AddOutPt(t,e),h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t));else if((b===0||b==1)&&(y===0||y==1)&&!o&&!n){var C,v;switch(m){case h.PolyFillType.pftPositive:C=r.WindCnt2;break;case h.PolyFillType.pftNegative:C=-r.WindCnt2;break;default:C=Math.abs(r.WindCnt2);break}switch(g){case h.PolyFillType.pftPositive:v=t.WindCnt2;break;case h.PolyFillType.pftNegative:v=-t.WindCnt2;break;default:v=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(b==1&&y==1)switch(this.m_ClipType){case h.ClipType.ctIntersection:C>0&&v>0&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctUnion:C<=0&&v<=0&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctDifference:(r.PolyTyp==h.PolyType.ptClip&&C>0&&v>0||r.PolyTyp==h.PolyType.ptSubject&&C<=0&&v<=0)&&this.AddLocalMinPoly(r,t,e);break;case h.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else h.Clipper.SwapSides(r,t)}o!=n&&(o&&r.OutIdx>=0||n&&t.OutIdx>=0)&&(h.Clipper.SwapSides(r,t),h.Clipper.SwapPolyIndexes(r,t)),o&&this.DeleteFromAEL(r),n&&this.DeleteFromAEL(t)};h.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)};h.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)};h.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&h.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,h.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};h.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};h.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=h.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=h.Direction.dRightToLeft)};h.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=h.EdgeSide.esLeft&&(e=e.Prev),t&&(h.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};h.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&&h.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(c=this.GetMaximaPair(s));;){for(var l=r==s,p=this.GetNextInAEL(r,i);p!==null&&!(p.Curr.X==r.Top.X&&r.NextInLML!==null&&p.Dx<r.NextInLML.Dx);){var d=this.GetNextInAEL(p,i);if(i==h.Direction.dLeftToRight&&p.Curr.X<=n||i==h.Direction.dRightToLeft&&p.Curr.X>=o){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),p==c&&l){i==h.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),c.OutIdx>=0&&h.Error("ProcessHorizontal error");return}else if(i==h.Direction.dLeftToRight){var m=new h.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,m,!0)}else{var m=new h.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,m,!0)}this.SwapPositionsInAEL(r,p)}else if(i==h.Direction.dLeftToRight&&p.Curr.X>=n||i==h.Direction.dRightToLeft&&p.Curr.X<=o)break;p=d}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&h.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 b=r.PrevInAEL,d=r.NextInAEL;if(b!==null&&b.Curr.X==r.Bot.X&&b.Curr.Y==r.Bot.Y&&b.WindDelta!==0&&b.OutIdx>=0&&b.Curr.Y>b.Top.Y&&h.ClipperBase.SlopesEqual(r,b,this.m_UseFullRange)){var y=this.AddOutPt(b,r.Bot);this.AddJoin(g,y,r.Top)}else if(d!==null&&d.Curr.X==r.Bot.X&&d.Curr.Y==r.Bot.Y&&d.WindDelta!==0&&d.OutIdx>=0&&d.Curr.Y>d.Top.Y&&h.ClipperBase.SlopesEqual(r,d,this.m_UseFullRange)){var y=this.AddOutPt(d,r.Bot);this.AddJoin(g,y,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else c!==null?c.OutIdx>=0?(i==h.Direction.dLeftToRight?this.IntersectEdges(r,c,r.Top,!1):this.IntersectEdges(c,r,r.Top,!1),c.OutIdx>=0&&h.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(c)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};h.Clipper.prototype.GetNextInAEL=function(r,t){return t==h.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};h.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};h.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};h.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};h.Clipper.prototype.GetMaximaPair=function(r){var t=null;return h.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:h.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!h.ClipperBase.IsHorizontal(t))?null:t};h.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,h.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};h.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=h.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 h.IntPoint;if(e.Curr.X>o.Curr.X){!this.IntersectPoint(e,o,n)&&e.Curr.X>o.Curr.X+1&&h.Error("Intersection error"),n.Y>r&&(n.Y=r,Math.abs(e.Dx)>Math.abs(o.Dx)?n.X=h.Clipper.TopX(o,r):n.X=h.Clipper.TopX(e,r));var s=new h.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}};h.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};h.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};h.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};h.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 R8=function(r){return r<0?Math.ceil(r-.5):Math.round(r)},N8=function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},G8=function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},V8=function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)};le.msie?h.Clipper.Round=R8:le.chromium?h.Clipper.Round=G8:le.safari?h.Clipper.Round=V8:h.Clipper.Round=N8;h.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+h.Clipper.Round(r.Dx*(t-r.Bot.Y))};h.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,o;if(h.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,h.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,e.Y=h.Clipper.Round(e.X/t.Dx+o));else if(t.Delta.X===0)e.X=t.Bot.X,h.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=h.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=h.Clipper.Round(n),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=h.Clipper.Round(r.Dx*n+i):e.X=h.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=h.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=h.Clipper.TopX(r,e.Y):e.X=h.Clipper.TopX(t,e.Y)}return!0};h.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||!h.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)&&h.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=h.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&&h.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&&h.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}};h.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)):h.Error("DoMaxima error")};h.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};h.Clipper.Orientation=function(r){return h.Clipper.Area(r)>=0};h.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};h.Clipper.prototype.BuildResult=function(r){h.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)}}}};h.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 h.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))}};h.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(h.IntPoint.op_Equality(e.Pt,e.Next.Pt)||h.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||h.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};h.Clipper.prototype.DupOutPt=function(r,t){var e=new h.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};h.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};h.Clipper.prototype.JoinHorz=function(r,t,e,i,o,n){var s=r.Pt.X>t.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight,c=e.Pt.X>i.Pt.X?h.Direction.dRightToLeft:h.Direction.dLeftToRight;if(s==c)return!1;if(s==h.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),h.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),h.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==h.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),h.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),h.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==h.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};h.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,o=new h.OutPt,n=r.OutPt2,s=new h.OutPt,c=r.OutPt1.Pt.Y==r.OffPt.Y;if(c&&h.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&h.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(o=r.OutPt1.Next;o!=i&&h.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&&h.IntPoint.op_Equality(s.Pt,r.OffPt);)s=s.Next;var p=s.Pt.Y>r.OffPt.Y;return l==p?!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 d={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,o.Pt.X,n.Pt.X,s.Pt.X,d))return!1;var m=d.Left,g=d.Right,b=new h.IntPoint,y;return i.Pt.X>=m&&i.Pt.X<=g?(b.X=i.Pt.X,b.Y=i.Pt.Y,y=i.Pt.X>o.Pt.X):n.Pt.X>=m&&n.Pt.X<=g?(b.X=n.Pt.X,b.Y=n.Pt.Y,y=n.Pt.X>s.Pt.X):o.Pt.X>=m&&o.Pt.X<=g?(b.X=o.Pt.X,b.Y=o.Pt.Y,y=o.Pt.X>i.Pt.X):(b.X=s.Pt.X,b.Y=s.Pt.Y,y=s.Pt.X>n.Pt.X),r.OutPt1=i,r.OutPt2=n,this.JoinHorz(i,o,n,s,b,y)}else{for(o=i.Next;h.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Next;var C=o.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange);if(C){for(o=i.Prev;h.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Prev;if(o.Pt.Y>i.Pt.Y||!h.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange))return!1}for(s=n.Next;h.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Next;var v=s.Pt.Y>n.Pt.Y||!h.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange);if(v){for(s=n.Prev;h.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Prev;if(s.Pt.Y>n.Pt.Y||!h.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange))return!1}return o==i||s==n||o==s||t==e&&C==v?!1:C?(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)}};h.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new h.IntRect(0,0,0,0);var i=new h.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};h.Clipper.prototype.GetBounds2=function(r){var t=r,e=new h.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};h.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};h.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};h.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};h.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)}};h.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)};h.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};h.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||h.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)}}};h.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};h.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(h.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)}};h.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};h.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};y5&&(h.Clipper.OffsetPaths=function(r,t,e,i,o){var n=new h.Paths,s=new h.ClipperOffset(o,o);return s.AddPaths(r,e,i),s.Execute(n,t),n});h.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,e,t,t),e};h.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=h.PolyFillType.pftEvenOdd);var e=new Array,i=new h.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,h.PolyType.ptSubject,!0),i.Execute(h.ClipType.ctUnion,e,t,t),e};h.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};h.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)};h.Clipper.SlopesNearCollinear=function(r,t,e,i){return h.Clipper.DistanceFromLineSqrd(t,r,e)<i};h.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,o=r.Y-t.Y;return i*i+o*o<=e};h.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};h.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 h.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;)h.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,n)?(s=h.Clipper.ExcludeOp(s),e--):h.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,n)?(h.Clipper.ExcludeOp(s.Next),s=h.Clipper.ExcludeOp(s),e-=2):h.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,n)?(s=h.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 h.IntPoint(s.Pt),s=s.Next;return i=null,c};h.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,o=r.length;i<o;i++)e[i]=h.Clipper.CleanPolygon(r[i],t);return e};h.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 p=new Array(n),d=0,m=r.length,g=r[d];d<m;d++,g=r[d])p[d]=new h.IntPoint(t[l].X+g.X,t[l].Y+g.Y);c.push(p)}else for(var l=0;l<s;l++){for(var p=new Array(n),d=0,m=r.length,g=r[d];d<m;d++,g=r[d])p[d]=new h.IntPoint(t[l].X-g.X,t[l].Y-g.Y);c.push(p)}for(var b=new Array,l=0;l<s-1+o;l++)for(var d=0;d<n;d++){var y=new Array;y.push(c[l%s][d%n]),y.push(c[(l+1)%s][d%n]),y.push(c[(l+1)%s][(d+1)%n]),y.push(c[l%s][(d+1)%n]),h.Clipper.Orientation(y)||y.reverse(),b.push(y)}var C=new h.Clipper(0);return C.AddPaths(b,h.PolyType.ptSubject,!0),C.Execute(h.ClipType.ctUnion,c,h.PolyFillType.pftNonZero,h.PolyFillType.pftNonZero),c};h.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],o=r[2];return h.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 h.Clipper,l,p=0,d=n.length;p<d;++p){var l=h.Clipper.Minkowski(e,n[p],!0,o);c.AddPaths(l,h.PolyType.ptSubject,!0)}o&&c.AddPaths(n,h.PolyType.ptClip,!0);var m=new h.Paths;return c.Execute(h.ClipType.ctUnion,m,s,s),m}};h.Clipper.MinkowskiDiff=function(r,t,e){return h.Clipper.Minkowski(r,t,!1,e)};h.Clipper.PolyTreeToPaths=function(r){var t=new Array;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntAny,t),t};h.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case h.Clipper.NodeType.ntOpen:return;case h.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])h.Clipper.AddPolyNodeToPaths(c,t,e)};h.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new h.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};h.Clipper.ClosedPathsFromPolyTree=function(r){var t=new h.Paths;return h.Clipper.AddPolyNodeToPaths(r,h.Clipper.NodeType.ntClosed,t),t};zd(h.Clipper,h.ClipperBase);h.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};h.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=h.ClipperOffset.def_arc_tolerance),this.m_destPolys=new h.Paths,this.m_srcPoly=new h.Path,this.m_destPoly=new h.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 h.IntPoint,this.m_polyNodes=new h.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};h.ClipperOffset.two_pi=6.28318530717959;h.ClipperOffset.def_arc_tolerance=.25;h.ClipperOffset.prototype.Clear=function(){h.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};h.ClipperOffset.Round=h.Clipper.Round;h.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var o=new h.PolyNode;if(o.m_jointype=t,o.m_endtype=e,e==h.EndType.etClosedLine||e==h.EndType.etClosedPolygon)for(;i>0&&h.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++)h.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==h.EndType.etClosedPolygon&&n<2||e!=h.EndType.etClosedPolygon&&n<0)&&(this.m_polyNodes.AddChild(o),e==h.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new h.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 h.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};h.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,o=r.length;i<o;i++)this.AddPath(r[i],t,e)};h.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!h.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==h.EndType.etClosedPolygon||t.m_endtype==h.EndType.etClosedLine&&h.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==h.EndType.etClosedLine&&!h.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};h.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new h.DoublePoint(0,0);var o=1/Math.sqrt(e*e+i*i);return e*=o,i*=o,new h.DoublePoint(i,-e)};h.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,h.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==h.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=h.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*h.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*h.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(h.ClipperOffset.two_pi/o),this.m_cos=Math.cos(h.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/h.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!=h.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,n==1){if(e.m_jointype==h.JoinType.jtRound)for(var s=1,c=0,l=1;l<=o;l++){this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r)));var p=s;s=s*this.m_cos-this.m_sin*c,c=p*this.m_sin+c*this.m_cos}else for(var s=-1,c=-1,l=0;l<4;++l)this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),h.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(h.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(e.m_endtype==h.EndType.etClosedLine||e.m_endtype==h.EndType.etClosedPolygon?this.m_normals.push(h.ClipperOffset.GetUnitNormal(this.m_srcPoly[n-1],this.m_srcPoly[0])):this.m_normals.push(new h.DoublePoint(this.m_normals[n-2])),e.m_endtype==h.EndType.etClosedPolygon){for(var d=n-1,l=0;l<n;l++)d=this.OffsetPoint(l,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==h.EndType.etClosedLine){for(var d=n-1,l=0;l<n;l++)d=this.OffsetPoint(l,d,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 h.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new h.DoublePoint(-m.X,-m.Y),d=0;for(var l=n-1;l>=0;l--)d=this.OffsetPoint(l,d,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var d=0,l=1;l<n-1;++l)d=this.OffsetPoint(l,d,e.m_jointype);var g;if(e.m_endtype==h.EndType.etOpenButt){var l=n-1;g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*r),h.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*r)),this.m_destPoly.push(g),g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*r),h.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*r)),this.m_destPoly.push(g)}else{var l=n-1;d=n-2,this.m_sinA=0,this.m_normals[l]=new h.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(l,d):this.DoRound(l,d)}for(var l=n-1;l>0;l--)this.m_normals[l]=new h.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new h.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),d=n-1;for(var l=d-1;l>0;--l)d=this.OffsetPoint(l,d,e.m_jointype);e.m_endtype==h.EndType.etOpenButt?(g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),h.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(d=1,this.m_sinA=0,e.m_endtype==h.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};h.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof h.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var o=new h.Clipper(0);if(o.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var n=h.Clipper.GetBounds(this.m_destPolys),s=new h.Path;if(s.push(new h.IntPoint(n.left-10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.top-10)),s.push(new h.IntPoint(n.left-10,n.top-10)),o.AddPath(s,h.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftNegative,h.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];h.Clear(e),this.FixOrientations(),this.DoOffset(i);var o=new h.Clipper(0);if(o.AddPaths(this.m_destPolys,h.PolyType.ptSubject,!0),i>0)o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftPositive,h.PolyFillType.pftPositive);else{var n=h.Clipper.GetBounds(this.m_destPolys),s=new h.Path;s.push(new h.IntPoint(n.left-10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.bottom+10)),s.push(new h.IntPoint(n.right+10,n.top-10)),s.push(new h.IntPoint(n.left-10,n.top-10)),o.AddPath(s,h.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(h.ClipType.ctUnion,e,h.PolyFillType.pftNegative,h.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};h.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 h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new h.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case h.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 h.JoinType.jtSquare:this.DoSquare(r,t);break;case h.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};h.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 h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),h.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 h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};h.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),h.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};h.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=h.Cast_Int32(h.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 h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+o*this.m_delta),h.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 h.IntPoint(h.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),h.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};h.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};h.JS={};h.JS.AreaOfPolygon=function(r,t){return t||(t=1),h.Clipper.Area(r)/(t*t)};h.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=h.Clipper.Area(r[i]);return e/(t*t)};h.JS.BoundsOfPath=function(r,t){return h.JS.BoundsOfPaths([r],t)};h.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=h.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};h.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=h.JS.Clone(i);if(typeof t!="number"||t===null)return h.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,p,d,m,g=[],b=0;b<o;b++)if(s=i[b],n=s.length,n!==0){if(n<3){c=s,g.push(c);continue}for(c=s,l=t*t,p=s[0],d=1,m=1;m<n;m++)(s[m].X-p.X)*(s[m].X-p.X)+(s[m].Y-p.Y)*(s[m].Y-p.Y)<=l||(c[d]=s[m],p=s[m],d++);p=s[d-1],(s[0].X-p.X)*(s[0].X-p.X)+(s[0].Y-p.Y)*(s[0].Y-p.Y)<=l&&d--,d<n&&c.splice(d,n-d),c.length&&g.push(c)}return!e&&g.length?g=g[0]:!e&&g.length===0?g=[]:e&&g.length===0&&(g=[[]]),g};h.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};h.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return h.Error("Tolerance is not a number in Lighten()."),h.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return h.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,o,n,s,c,l,p,d,m,g,b,y,C,v,S,M,w=r.length,T=t*t,D=[];for(e=0;e<w;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?(b=1,o.push({X:o[0].X,Y:o[0].Y}),c=o.length):b=0,g=[],i=0;i<c-2;i++)l=o[i],d=o[i+1],p=o[i+2],S=l.X,M=l.Y,y=p.X-S,C=p.Y-M,(y!==0||C!==0)&&(v=((d.X-S)*y+(d.Y-M)*C)/(y*y+C*C),v>1?(S=p.X,M=p.Y):v>0&&(S+=y*v,M+=C*v)),y=d.X-S,C=d.Y-M,m=y*y+C*C,m<=T&&(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}),b&&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&&D.push(s)}return!r[0]instanceof Array&&(D=D[0]),typeof D>"u"&&(D=[[]]),D};h.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,o=0,n,s,c=0,l=0,p=0,d=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],p=s.X,d=s.Y,o+=i((c-p)*(c-p)+(l-d)*(l-d));return t&&r.pop(),o/e};h.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,o=0;o<r.length;o++)i+=h.JS.PerimeterOfPath(r[o],t,e);return i};h.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};h.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};h.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)};h.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)};h.ExPolygons=function(){return[]};h.ExPolygon=function(){this.outer=null,this.holes=null};h.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new h.ExPolygon;e.outer=r.Contour();var i=r.Childs(),o=i.length;e.holes=new Array(o);var n,s,c,l,p,d;for(c=0;c<o;c++)for(n=i[c],e.holes[c]=n.Contour(),l=0,p=n.Childs(),d=p.length;l<d;l++)s=p[l],h.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(e)};h.JS.ExPolygonsToPaths=function(r){var t,e,i,o,n=new h.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};h.JS.PolyTreeToExPolygons=function(r){var t=new h.ExPolygons,e,i,o,n;for(i=0,o=r.Childs(),n=o.length;i<n;i++)e=o[i],h.JS.AddOuterPolyNodeToExPolygons(e,t);return t};bc.exports=h});var HS=j((iJ,Uh)=>{f();(function(){"use strict";function r(s,c){var l=s.x-c.x,p=s.y-c.y;return l*l+p*p}function t(s,c,l){var p=c.x,d=c.y,m=l.x-p,g=l.y-d;if(m!==0||g!==0){var b=((s.x-p)*m+(s.y-d)*g)/(m*m+g*g);b>1?(p=l.x,d=l.y):b>0&&(p+=m*b,d+=g*b)}return m=s.x-p,g=s.y-d,m*m+g*g}function e(s,c){for(var l=s[0],p=[l],d,m=1,g=s.length;m<g;m++)d=s[m],r(d,l)>c&&(p.push(d),l=d);return l!==d&&p.push(d),p}function i(s,c,l,p,d){for(var m=p,g,b=c+1;b<l;b++){var y=t(s[b],s[c],s[l]);y>m&&(g=b,m=y)}m>p&&(g-c>1&&i(s,c,g,p,d),d.push(s[g]),l-g>1&&i(s,g,l,p,d))}function o(s,c){var l=s.length-1,p=[s[0]];return i(s,0,l,c,p),p.push(s[l]),p}function n(s,c,l){if(s.length<=2)return s;var p=c!==void 0?c*c:1;return s=l?s:e(s,p),s=o(s,p),s}typeof define=="function"&&define.amd?define(function(){return n}):typeof Uh<"u"?(Uh.exports=n,Uh.exports.default=n):typeof self<"u"?self.simplify=n:window.simplify=n})()});f();f();f();f();f();f();var il=r=>r!=null;var fx=function(){let t=globalThis.fetch;return{fetch(...e){if(!il(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}}}(),M0=fx.fetch;var E0=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],T0=E0[0],O0="https://api-gateway.mappedin.com/track-analytics/a/",L0="deny-watchposition",A0="load-mapview",F0="load-mapdata",k0="change-language",B0="query-directions";var yi,hr,Aa,bu,Fa=class{constructor(){x(this,Aa);x(this,yi,Object.freeze({}));x(this,hr);u(this,"oneTimeEventsSent",new Set);u(this,"sendGetDirectionsEvent",T1((t,e)=>this.sendAnalyticEvent(B0,{start:t,end:e,type:"location_to_location"}),2500));P(this,hr,_(this,Aa,bu).call(this,a(this,yi)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){P(this,yi,{}),P(this,hr,_(this,Aa,bu).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return P(this,yi,Object.freeze(Object.assign({},a(this,yi),t))),P(this,hr,_(this,Aa,bu).call(this,t)),a(this,hr)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=vf({...a(this,hr),mapId:e.mapId})),e.context&&(e.context=D0(e.context)),e.baseUri&&(e.analyticsBaseUrl=vf({baseUri:e.baseUri,mapId:a(this,hr).mapId})),Object.assign(a(this,hr),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,hr)}getContext(){return this.getState().context||a(this,yi).context||T0}getSessionId(){return this.getState().sessionId||a(this,yi).sessionId||w0()}sendAnalyticEvent(t,e={}){let i=this.getState(),o=gx(i.analyticsBaseUrl,t),n={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&L.log("Analytics.track",o,n),!i.sendEvents)return Promise.resolve();if(!this.authReady)return L.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)),M0(o,{method:"POST",mode:"cors",headers:n,body:JSON.stringify(s)})}capture(t,e){if(bx.includes(t))return L.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=yx.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(F0,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(k0,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(L0)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(A0,{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)}};yi=new WeakMap,hr=new WeakMap,Aa=new WeakSet,bu=function(t){var i,o,n,s;let e=(i=t.baseUri)!=null?i:O0;return{baseUri:e,analyticsBaseUrl:vf({...t,baseUri:e}),version:((o=I==null?void 0:I.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||mx(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||w0(),platformString:t.platformString||"",context:D0(t.context)||T0,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}};function vf({mapId:r,baseUri:t=O0}){return"".concat(t).concat(r,"/")}function mx(){return cn.getInstance().loadLocalData("deviceId")}function w0(){return cn.getInstance().loadSessionData("id")}function gx(r,t){return r+t}function D0(r){return E0.find(t=>t===r)}var yx=["$select-location","$select-category","$query-suggest","$query-search"],bx=[A0,F0,B0,L0,k0],cD=new Fa,bi,ol=class{constructor(t){x(this,bi);u(this,"capture");u(this,"updateState");P(this,bi,t),this.capture=a(this,bi).capture.bind(a(this,bi)),this.updateState=a(this,bi).updateState.bind(a(this,bi))}getState(){return Object.assign({},a(this,bi).getState())}};bi=new WeakMap;f();f();var al,sl,ll,nl=class{constructor(t,e,{enabled:i=!1}={}){x(this,al);u(this,"searchInstance");x(this,sl);x(this,ll);u(this,"enabled",!1);P(this,al,t),P(this,sl,e),P(this,ll,()=>{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 L.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return L.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return L.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-SB6CKAWY.js").then(({InternalSearch:t})=>new t(a(this,al)))),a(this,sl).on("language-change",a(this,ll)),await this.searchInstance)}};al=new WeakMap,sl=new WeakMap,ll=new WeakMap;var _0=new WeakMap,Le,Cf=class extends ee{constructor(e,{search:i}={}){super();x(this,Le);u(this,"Analytics");u(this,"Search");u(this,"Query");u(this,"getDirections",(e,i,o)=>a(this,Le).getDirections(e,i,o));u(this,"getDirectionsMultiDestination",(e,i,o)=>a(this,Le).getDirectionsMultiDestination(e,i,o));P(this,Le,e),_0.set(this,e),this.Analytics=new ol(e.Analytics),this.Query=e.Query,this.Search=new nl(this,e,{enabled:i==null?void 0:i.enabled}),a(this,Le).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return a(this,Le).getEnv()}getAccessToken(){return a(this,Le).getAccessToken()}getSasToken(){return a(this,Le).getSasToken()}get mapName(){return a(this,Le).mapName}get mapCenter(){return a(this,Le).mapCenter}get organizationId(){return a(this,Le).organizationId}get outdoorViewToken(){return a(this,Le).outdoorViewToken}getByType(e){return a(this,Le).getByType(e)}getById(e,i){return a(this,Le).getById(e,i)}getByExternalId(e,i){return a(this,Le).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return a(this,Le).changeLanguage(e)}get currentLanguage(){return a(this,Le).currentLanguage}get naturalBearing(){var e;return(e=a(this,Le).naturalBearing)!=null?e:0}getDistance(e,i){return a(this,Le).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return a(this,Le).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return a(this,Le).toJSONBundle({downloadLanguagePacks:e})}};Le=new WeakMap;var vu=Cf;function cl(r){let t=_0.get(r);if(!t)throw new Error("MapDataInternal not found");return t}f();f();f();f();f();function ka(r){return r.endsWith("/")?r:"".concat(r,"/")}f();var Ba="https://app.mappedin.com/",R0="https://auth.mappedin.com/";f();var N0="accessTokens";async function un(r,t=!1){let e="".concat(r.key),i=cn.getInstance(),o=(i==null?void 0:i.loadSessionData(N0))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expiresTimestamp)return o[e];let s=t?await vx(r,n):await Cx(r,n),c={...o,[e]:s};return i==null||i.saveSessionData(N0,c),s}async function vx(r,t){var n;let e="".concat((n=r.baseAuthUri)!=null?n:R0,"oauth2/token"),i=await fr()(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}}async function Cx(r,t){let e="".concat(r.baseAuthUri?ka(r.baseAuthUri):Ba,"api/api-key/token"),i=await fr()(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}}f();var G0="miSasTokens";async function _a(r,t){let e="".concat(t,"__").concat(r.mapId),i=cn.getInstance(),o=(i==null?void 0:i.loadSessionData(G0))||{},n=Date.now();if(o[e]&&n<o[e].expires)return o[e];let s=await Sx(r,t),c={...o,[e]:{token:s.token,expires:new Date(s.expires).getTime()}};return i==null||i.saveSessionData(G0,c),s}async function Sx(r,t){let e="".concat(r.baseUri?ka(r.baseUri):Ba,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await fr()(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()}var V0=globalThis.fetch,U0,xx=(U0=I==null?void 0:I.env)==null?void 0:U0.npm_package_version;function fr(){if(V0==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return V0}var Sf={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function H0(r){var e;let t={...Sf,...r};return t.headers={...t.headers,"mappedin-sdk-version":xx},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}function Ix(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}}async function Px(r,t,e=!1){let i=Ix(r,t,e),o=await fr()(i.url,i.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}var Mx=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 L.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){L.warn("Perspective ".concat(i," is missing url or locale_packs!"));continue}e[i]={url:n,locale_packs:s}}return e};async function Tx(r,t="exports/mvf/1/bundle"){var p,d;let e=H0({baseUri:"https://api-gateway.mappedin.com/",...Sf,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((p=e.version)!=null?p:"2.0.0");e.headers["Content-Type"]="application/zip";let o=await Px(e,i),n=o.url,s=o.locale_packs,c=(d=e.perspective)!=null?d:Sf.perspective,l=Mx(o);if(c!=null&&c!==""&&l!=null){let m=l[c];m==null?L.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(L.log('Loading perspective "'.concat(c,'"')),n=m.url,s=m.locale_packs)}return{url:n,localePacks:s,updated_at:o.updated_at}}var pl=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function xf(r,{signal:t}){let e=await(await fr()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}async function Ra(r){let e=(await import("./browser-HJJPOQZ3.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let o=e["enterprise/locations.json"];o&&(i.enterprise.locations=JSON.parse(pl().decode(o)));let n=e["enterprise/categories.json"];n&&(i.enterprise.categories=JSON.parse(pl().decode(n)))}return e["floorstack.json"]&&(i["floorstack.json"]=JSON.parse(pl().decode(e["floorstack.json"]))),e["floor.geojson"]&&(i["floor.geojson"]=JSON.parse(pl().decode(e["floor.geojson"]))),e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(pl().decode(e["manifest.json"]))),i}async function W0(r,{signal:t}){try{let e=await(await fr()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Ra(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}async function If(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 Tx(r,i),s=await fr()(o).then(l=>l.arrayBuffer()),c=new Uint8Array(s);t({compressed:c,localePacks:n})}catch(i){e(i)}})}async function Pf(r,t){return new Promise(async(e,i)=>{try{let{url:o}=await wx(r,t),n=await fr()(o).then(c=>c.arrayBuffer()),s=new Uint8Array(n);e(s)}catch(o){i(o)}})}async function wx(r,t){let e="".concat(r.baseUri?ka(r.baseUri):Ba,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await fr()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}function Cu(r){var i,o,n,s,c,l,p,d,m,g,b,y,C,v,S,M,w,T;let t=new TextDecoder,e=t.decode.bind(t);try{let D={"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&&(D.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(D.enterprise.locations=JSON.parse(e((o=r.enterprise)==null?void 0:o["locations.json"]))),(n=r.enterprise)!=null&&n["categories.json"]&&(D.enterprise.categories=JSON.parse(e((s=r.enterprise)==null?void 0:s["categories.json"]))),(c=r.enterprise)!=null&&c["venue.json"]&&(D.enterprise.venue=JSON.parse(e((l=r.enterprise)==null?void 0:l["venue.json"]))),(p=r.enterprise)!=null&&p["layers.json"]&&(D.enterprise.layers=JSON.parse(e((d=r.enterprise)==null?void 0:d["layers.json"]))),(m=r.enterprise)!=null&&m["locationInstances.json"]&&(D.enterprise.locationInstances=JSON.parse(e((g=r.enterprise)==null?void 0:g["locationInstances.json"]))),(b=r.enterprise)!=null&&b["enterpriseStyles.json"]&&(D.enterprise.enterpriseStyles=JSON.parse(e((y=r.enterprise)==null?void 0:y["enterpriseStyles.json"]))),(C=r.enterprise)!=null&&C["textures.json"]&&(D.enterprise.textures=JSON.parse(e((v=r.enterprise)==null?void 0:v["textures.json"]))),(S=r.enterprise)!=null&&S["floorText.json"]&&(D.enterprise.floorText=JSON.parse(e((M=r.enterprise)==null?void 0:M["floorText.json"]))),(w=r.enterprise)!=null&&w["categoryPriorities.json"]&&(D.enterprise.categoryPriorities=JSON.parse(e((T=r.enterprise)==null?void 0:T["categoryPriorities.json"])))),r["floorstack.json"]!=null?D["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(D["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),D["floorstack.json"]==null&&D["mapstack.json"]==null&&D["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(D["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),D["floor.geojson"]==null&&D["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(D["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(D["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(D["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(D["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){D.annotation={};let O=Object.keys(r.annotation);for(let B of O){let k=B.replace(/\.json|\.geojson/g,"");D.annotation[k]=JSON.parse(e(r.annotation[B]))}}let F=Object.keys(r.space);for(let O of F){let B=O.replace(/\.json|\.geojson/g,"");D.space[B]=JSON.parse(e(r.space[O]))}if(r.obstruction!=null){let O=Object.keys(r.obstruction);for(let B of O){let k=B.replace(/\.json|\.geojson/g,"");D.obstruction[k]=JSON.parse(e(r.obstruction[B]))}}else D.obstruction={};if(r.entrance!=null){let O=Object.keys(r.entrance);for(let B of O){let k=B.replace(/\.json|\.geojson/g,"");D.entrance[k]=JSON.parse(e(r.entrance[B]))}}else D.entrance={};if("floorImages"in r&&r.floorImages!=null){D.floorImages={};for(let O of Object.keys(r.floorImages)){let B=O.replace(/\.json|\.geojson/g,"");D.floorImages[B]=JSON.parse(e(r.floorImages[O]))}}if("textAreas"in r&&r.textAreas!=null){D.textAreas={};for(let O of Object.keys(r.textAreas)){let B=O.replace(/\.json|\.geojson/g,"");D.textAreas[B]=JSON.parse(e(r.textAreas[O]))}}if("facade"in r&&r.facade!=null){D.facade={};for(let O of Object.keys(r.facade)){let B=O.replace(/\.json|\.geojson/g,"");D.facade[B]=JSON.parse(e(r.facade[O]))}}if("area"in r&&r.area!=null){D.area={};for(let O of Object.keys(r.area)){let B=O.replace(/\.json|\.geojson/g,"");D.area[B]=JSON.parse(e(r.area[O]))}}return D}catch(D){throw L.error(D),new Error("MVF parsing failed! Probably encountered a bad file.")}}function Dx(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}async function Su(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-HJJPOQZ3.js")).unzipSync(r);if(!Dx(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"){L.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)}})}function dn(){let r="us",t={};function e(){return Ax(kx(r),t)}return{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?j0.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?j0.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}var X0=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"}),j0=Object.freeze({...X0,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),Ex=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"}),Ox=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"}),Lx=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function Ax(r,t){return{...r,...t}}var Fx={eu:Ex,us:X0,"us-staging-enterprise":Ox,"us-staging-self-serve":Lx};function kx(r){return Fx[r]}f();f();f();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")}function Ut(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")}function Na(r){return r.type==="Feature"?r.geometry:r}function Y0(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Bx(r,t,e){e===void 0&&(e={});for(var i=Qt(r),o=Ut(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")),_x(o[n],o[n+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function _x(r,t,e,i,o){var n=e[0],s=e[1],c=r[0],l=r[1],p=t[0],d=t[1],m=e[0]-c,g=e[1]-l,b=p-c,y=d-l,C=m*y-g*b;if(o!==null){if(Math.abs(C)>o)return!1}else if(C!==0)return!1;if(i){if(i==="start")return Math.abs(b)>=Math.abs(y)?b>0?c<n&&n<=p:p<=n&&n<c:y>0?l<s&&s<=d:d<=s&&s<l;if(i==="end")return Math.abs(b)>=Math.abs(y)?b>0?c<=n&&n<p:p<n&&n<=c:y>0?l<=s&&s<d:d<s&&s<=l;if(i==="both")return Math.abs(b)>=Math.abs(y)?b>0?c<n&&n<p:p<n&&n<c:y>0?l<s&&s<d:d<s&&s<l}else return Math.abs(b)>=Math.abs(y)?b>0?c<=n&&n<=p:p<=n&&n<=c:y>0?l<=s&&s<=d:d<=s&&s<=l;return!1}var Z0=Bx;f();function Rx(r,t){t===void 0&&(t={});var e=Ta(r),i=(e[0]+e[2])/2,o=(e[1]+e[3])/2;return Rr([i,o],t.properties,t)}var xu=Rx;f();f();function Nx(r,t,e){e===void 0&&(e={});var i=Qt(r),o=Qt(t),n=Ft(o[1]-i[1]),s=Ft(o[0]-i[0]),c=Ft(i[1]),l=Ft(o[1]),p=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(c)*Math.cos(l);return E1(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),e.units)}var ao=Nx;function Iu(r,t){return t===void 0&&(t={}),A1(r,function(e,i){var o=i.geometry.coordinates;return e+ao(o[0],o[1],t)},0)}f();f();f();function Pu(r,t,e){if(e===void 0&&(e={}),e.final===!0)return Gx(r,t);var i=Qt(r),o=Qt(t),n=Ft(i[0]),s=Ft(o[0]),c=Ft(i[1]),l=Ft(o[1]),p=Math.sin(s-n)*Math.cos(l),d=Math.cos(c)*Math.sin(l)-Math.sin(c)*Math.cos(l)*Math.cos(s-n);return Js(Math.atan2(p,d))}function Gx(r,t){var e=Pu(t,r);return e=(e+180)%360,e}f();function hn(r,t,e,i){i===void 0&&(i={});var o=Qt(r),n=Ft(o[0]),s=Ft(o[1]),c=Ft(e),l=O1(t,i.units),p=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(c)),d=n+Math.atan2(Math.sin(c)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(p)),m=Js(d),g=Js(p);return Rr([m,g],i.properties)}f();f();function Vx(r){if(!r)throw new Error("geojson is required");var t=[];return Nr(r,function(e){jx(e,t)}),pn(t)}function jx(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ut(i);break;case"LineString":e=[Ut(i)]}e.forEach(function(o){var n=Ux(o,r.properties);n.forEach(function(s){s.id=t.length,t.push(s)})})}}function Ux(r,t){var e=[];return r.reduce(function(i,o){var n=gi([i,o],t);return n.bbox=Hx(i,o),e.push(n),o}),e}function Hx(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,p=i>n?i:n;return[s,c,l,p]}var Mf=Vx;var r4=tu(e4(),1);function d9(r,t){var e={},i=[];if(r.type==="LineString"&&(r=of(r)),t.type==="LineString"&&(t=of(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=t4(r,t);return o&&i.push(o),pn(i)}var n=(0,r4.default)();return n.load(Mf(t)),nf(Mf(r),function(s){nf(n.search(s),function(c){var l=t4(s,c);if(l){var p=Ut(l).join(",");e[p]||(e[p]=!0,i.push(l))}})}),pn(i)}function t4(r,t){var e=Ut(r),i=Ut(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],p=i[0][1],d=i[1][0],m=i[1][1],g=(m-p)*(s-o)-(d-l)*(c-n),b=(d-l)*(n-p)-(m-p)*(o-l),y=(s-o)*(n-p)-(c-n)*(o-l);if(g===0)return null;var C=b/g,v=y/g;if(C>=0&&C<=1&&v>=0&&v<=1){var S=o+C*(s-o),M=n+C*(c-n);return Rr([S,M])}return null}var $a=d9;function h9(r,t,e){e===void 0&&(e={});var i=Rr([1/0,1/0],{dist:1/0}),o=0;return Nr(r,function(n){for(var s=Ut(n),c=0;c<s.length-1;c++){var l=Rr(s[c]);l.properties.dist=ao(t,l,e);var p=Rr(s[c+1]);p.properties.dist=ao(t,p,e);var d=ao(l,p,e),m=Math.max(l.properties.dist,p.properties.dist),g=Pu(l,p),b=hn(t,m,g+90,e),y=hn(t,m,g-90,e),C=$a(gi([b.geometry.coordinates,y.geometry.coordinates]),gi([l.geometry.coordinates,p.geometry.coordinates])),v=null;C.features.length>0&&(v=C.features[0],v.properties.dist=ao(t,v,e),v.properties.location=o+ao(l,v,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=c,i.properties.location=o),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=c+1,i.properties.location=o+d),v&&v.properties.dist<i.properties.dist&&(i=v,i.properties.index=c),o+=d}}),i}var wl=h9;function f9(r,t,e){var i=Ut(e);if(Y0(e)!=="LineString")throw new Error("line must be a LineString");var o=wl(e,r),n=wl(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),gi(c,e.properties)}var dg=f9;var m9=1e-7;function hg(r){return{type:"Point",coordinates:r}}function g9(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,o=e.map(n=>wl(r,hg(n)));return i.reduce((n,s)=>{let c=dg(hg(s),o[0],r),l=dg(hg(s),o[1],r),p=Iu(c)<Iu(l)?c:l;return p.properties={...r.properties,entrances:[]},n.concat([p])},[])}function fg(r,t){return t.reduce((e,i)=>{let o={epsilon:m9},n=e.obstructions.findIndex(c=>Z0(xu(i),c,o)),s=e.obstructions[n];if(s){let[c,l]=g9(s,i);e.entrances.push(i),e.obstructions.splice(n,1,c,l)}return e},{obstructions:[r],entrances:[]})}f();f();f();var Dl=class Dl{constructor(t,e,i){u(this,"__type",Dl.__type);u(this,"id",ve());u(this,"latitude");u(this,"longitude");u(this,"floorId");u(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===Dl.__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(){}};u(Dl,"__type","coordinate");var mg=Dl,J=mg;f();var Ye=class{constructor(t){u(this,"id");this.id=t}};var Wr,Ct,yn,fo,El=class El extends Ye{constructor(e,i){super(i.mvfData.properties.id);u(this,"__type",El.__type);x(this,Wr);x(this,Ct,{});x(this,yn);x(this,fo);P(this,Wr,e),P(this,yn,i.floorId),P(this,fo,i.mvfData)}static is(e){return e.__type===El.__type}get locations(){return a(this,Ct).locations?a(this,Ct).locations:(a(this,Ct).locations=(a(this,Wr).locationIdsByNodeId[this.id]||[]).map(e=>a(this,Wr).getById("enterprise-location",e)).filter(Boolean),a(this,Ct).locations)}get space(){var e;return a(this,Wr).getById("space",(e=a(this,Wr).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=a(this,Wr).getById("floor",a(this,yn));if(e==null)throw new Error("Floor ".concat(a(this,yn)," not found!"));return e}get coordinate(){if(a(this,Ct).coordinate==null){let[e,i]=a(this,fo).geometry.coordinates;a(this,Ct).coordinate=new J(i,e,a(this,yn))}return a(this,Ct).coordinate}get externalId(){var e;return(e=a(this,fo).properties.externalId)!=null?e:""}get neighbors(){if(a(this,Ct).neighbours==null){let e=a(this,fo).properties.neighbors.map(i=>{let o=a(this,Wr).getById("node",i.id);if(o==null)throw new Error("Node ".concat(i.id," not found!"));return o});a(this,Ct).neighbours=e}return a(this,Ct).neighbours}get geoJSON(){return{...a(this,fo),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,Ct)))delete a(this,Ct)[e]}};Wr=new WeakMap,Ct=new WeakMap,yn=new WeakMap,fo=new WeakMap,u(El,"__type","node");var gg=El,mo=gg;f();f();f();f();var Ol,xi,Sd=class Sd extends Ye{constructor(e){super(String(ve()));x(this,Ol,{});x(this,xi);P(this,xi,e.mvfData)}static is(e){return e.__type===Sd.__type}get url(){return a(this,xi).url}get name(){if("displayName"in a(this,xi))return a(this,xi).displayName;if("label"in a(this,xi))return a(this,xi).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Ol)))delete a(this,Ol)[e]}};Ol=new WeakMap,xi=new WeakMap,u(Sd,"__type","hyperlink");var yg=Sd,bn=yg;f();var Ll,vn,xd=class xd extends Ye{constructor(e){super(String(ve()));x(this,Ll,{});x(this,vn);P(this,vn,e.mvfData)}static is(e){return e.__type===xd.__type}get url(){return a(this,vn).url}get name(){return a(this,vn).altText}get altText(){return a(this,vn).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Ll)))delete a(this,Ll)[e]}};Ll=new WeakMap,vn=new WeakMap,u(xd,"__type","image");var bg=xd,Ja=bg;f();var Cn,yr=class{constructor(t,e){u(this,"id");x(this,Cn);this.id=t}get geoJSONBoundingBox(){return a(this,Cn)?a(this,Cn):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(P(this,Cn,Ta(this.geoJSON)),a(this,Cn))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Cn=new WeakMap;var Sn,br,Ii,nt=class extends yr{constructor(e,i){super(i.properties.id,e);x(this,Sn);x(this,br);x(this,Ii,{});P(this,Sn,e),P(this,br,i)}get externalId(){var e;return(e=a(this,br).properties.externalId)!=null?e:""}get name(){var i,o,n,s,c;let e="";return"details"in a(this,br).properties||(e=(i=a(this,br).properties.externalId)!=null?i:""),e===""&&(e=(n=(o=a(this,br).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,br).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,Ii).images!=null)return a(this,Ii).images;let e=(n=(o=(i=a(this,br).properties.details)==null?void 0:i.images)==null?void 0:o.map(l=>new Ja({mvfData:{...l,url:a(this,Sn).sasToken?l.url+"?".concat(a(this,Sn).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,Ii).images=e,e}get links(){var i,o,n,s,c;if(a(this,Ii).links!=null)return a(this,Ii).links;let e=(n=(o=(i=a(this,br).properties.details)==null?void 0:i.links)==null?void 0:o.map(l=>new bn({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,Ii).links=e,e}get locationProfiles(){var e;return(e=a(this,Sn).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}};Sn=new WeakMap,br=new WeakMap,Ii=new WeakMap;var Fl,xn,Qa,Ka,Al=class Al extends nt{constructor(e,i){super(e,i.mvfData);u(this,"__type",Al.__type);x(this,Fl);x(this,xn);x(this,Qa,{});x(this,Ka);P(this,Fl,e),P(this,xn,i.floorId),P(this,Ka,i.mvfData)}static is(e){return e.__type===Al.__type}get center(){var e;if(a(this,Qa).center==null){let[i,o]=(e=a(this,Ka).properties.center)!=null?e:[0,0];a(this,Qa).center=new J(o,i,a(this,xn))}return a(this,Qa).center}get floor(){let e=a(this,Fl).getById("floor",a(this,xn));if(e==null)throw new Error("Floor ".concat(a(this,xn)," not found!"));return e}get geoJSON(){return{...a(this,Ka),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,xn=new WeakMap,Qa=new WeakMap,Ka=new WeakMap,u(Al,"__type","area");var vg=Al,go=vg;f();var In,Pi,Pn,es,kl=class kl extends nt{constructor(e,i){super(e,i.mvfData);u(this,"__type",kl.__type);x(this,In);x(this,Pi);x(this,Pn);x(this,es);P(this,Pi,{}),P(this,es,i.mvfData),P(this,In,e),P(this,Pn,i.floorId)}static is(e){return e.__type===kl.__type}get floor(){let e=a(this,In).getById("floor",a(this,Pn));if(e==null)throw new Error("Floor ".concat(a(this,Pn)," not found!"));return e}get center(){if(a(this,Pi).center==null){let[[e,i],[o,n]]=a(this,es).geometry.coordinates,s=(e+o)/2,c=(i+n)/2;a(this,Pi).center=new J(c,s,a(this,Pn))}return a(this,Pi).center}get isExterior(){var o;let e=a(this,In).obstructionIdByEntranceId[this.id],i=a(this,In).getMVFFeatureById("obstruction",e);return(o=i==null?void 0:i.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...a(this,es),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,Pi)))delete a(this,Pi)[e]}};In=new WeakMap,Pi=new WeakMap,Pn=new WeakMap,es=new WeakMap,u(kl,"__type","door");var Cg=kl,Xr=Cg;f();var yo,Mn,Wt,Yr,Bl=class Bl extends nt{constructor(e,i){super(e,i.mvfData);u(this,"__type",Bl.__type);x(this,yo);x(this,Mn);x(this,Wt,{});x(this,Yr);P(this,yo,e),P(this,Mn,i.floorId),P(this,Yr,i.mvfData)}getMvfData(){return a(this,Yr)}static is(e){return e.__type===Bl.__type}get type(){return b9(a(this,Yr).properties.kind)}get locations(){if(a(this,Wt).locations)return a(this,Wt).locations;a(this,Wt).locations=[];let e=a(this,yo).mvfLocationsBySpaceId[a(this,Yr).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let o=a(this,yo).getById("enterprise-location",i.id);o&&a(this,Wt).locations.push(o)}return a(this,Wt).locations}get floor(){let e=a(this,yo).getById("floor",a(this,Mn));if(e==null)throw new Error("Floor ".concat(a(this,Mn)," not found!"));return e}get doors(){return a(this,Yr).properties.destinationNodes.reduce((e,i)=>{let o=a(this,yo).doorsByNodeId[i];return o&&e.push(o),e},[])}get center(){var e;if(a(this,Wt).center==null){let[i,o]=(e=a(this,Yr).properties.center)!=null?e:[0,0];a(this,Wt).center=new J(o,i,a(this,Mn))}return a(this,Wt).center}get geoJSON(){return{...a(this,Yr),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,Wt)))delete a(this,Wt)[e]}};yo=new WeakMap,Mn=new WeakMap,Wt=new WeakMap,Yr=new WeakMap,u(Bl,"__type","space");var Sg=Bl,y9=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function b9(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return y9.includes(t)?t:"room"}var je=Sg;f();var er,Me,tr,Rl,Ig,_l=class _l extends yr{constructor(e,i){super(i.mvfData.properties.id,e);x(this,Rl);u(this,"__type",_l.__type);x(this,er);x(this,Me,{});x(this,tr);P(this,er,e),P(this,tr,i.mvfData)}static is(e){return e.__type===_l.__type}get focusTarget(){return this}get name(){var e,i;return"name"in a(this,tr).properties?(i=_(this,Rl,Ig).call(this,"name"))!=null?i:"":(e=a(this,tr).properties.externalId)!=null?e:""}get shortName(){var e,i;return"shortName"in a(this,tr).properties?(i=_(this,Rl,Ig).call(this,"shortName"))!=null?i:"":(e=a(this,tr).properties.externalId)!=null?e:""}get externalId(){var e;return(e=a(this,tr).properties.externalId)!=null?e:""}get elevation(){return a(this,tr).properties.elevation}get spaces(){if(a(this,Me).spaces==null){let e=a(this,er).spaces.filter(i=>i.floor.id===this.id);a(this,Me).spaces=e}return a(this,Me).spaces}get geoJSON(){var e;return{type:"Feature",properties:null,geometry:(e=a(this,tr).geometry)!=null?e:{type:"Polygon",coordinates:[]}}}get objects(){if(a(this,Me).objects==null){let e=a(this,er).objects.filter(i=>i.floor.id===this.id);a(this,Me).objects=e}return a(this,Me).objects}get connections(){if(a(this,Me).connections==null){let e=a(this,er).connections.filter(i=>i.floors.includes(this));a(this,Me).connections=e}return a(this,Me).connections}get doors(){if(a(this,Me).doors==null){let e=a(this,er).doors.filter(i=>i.floor.id===this.id);a(this,Me).doors=e}return a(this,Me).doors}get annotations(){if(a(this,Me).annotations==null){let e=a(this,er).annotations.filter(i=>i.floor.id===this.id);a(this,Me).annotations=e}return a(this,Me).annotations}get pois(){if(a(this,Me).pois==null){let e=a(this,er).pointsOfInterest.filter(i=>i.floor.id===this.id);a(this,Me).pois=e}return a(this,Me).pois}get floorStack(){if(a(this,Me).floorStack==null){let e=a(this,er).floorStacks.find(i=>i.floors.includes(this));a(this,Me).floorStack=e}return a(this,Me).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,Me)))delete a(this,Me)[e]}};er=new WeakMap,Me=new WeakMap,tr=new WeakMap,Rl=new WeakSet,Ig=function(e){let i=a(this,tr).properties[e];return a(this,er).getPropTranslation(this.__type,e,this.id,i)},u(_l,"__type","floor");var xg=_l,Xt=xg;f();f();f();function Nl(r){return typeof r=="string"?r:r.id}function Mg(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}var Pg=8,Zr=r=>typeof r=="number"?r.toFixed(Pg):Mg(r)?r[1].toFixed(Pg)+"-"+r[0].toFixed(Pg):r.map(t=>Zr(t)).join("-");f();function Gl(r){let t;if(je.is(r)||Xr.is(r)||Yt.is(r)||go.is(r)||vr.is(r))t=r.center;else if(bo.is(r)||vo.is(r))t=r.coordinate;else if(J.is(r))t=r;else if(mo.is(r))t=r.coordinate;else if(Mi.is(r))t=r.coordinates[0];else return;return t}f();f();var Tn={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},zr="ExteriorWalls",Co="Walls",i4=0,ts="InteriorDoors",rs="ExteriorDoors",Te="GeometryLayer",Ti="LabelsLayer",qr="MarkersLayer",is="FootprintLayer",os="OcclusionLayer",o4="ImagesLayer";var n4=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],v9={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function Tg(r){var t,e;(t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)&&L.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function wg(r,t){var o,n,s,c,l,p;let e=((o=r==null?void 0:r.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,i={...Tn,...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=Tn.outdoorView)==null?void 0:c.layersHiddenByGeometry,...r==null?void 0:r.outdoorView},bearing:(p=(l=r==null?void 0:r.bearing)!=null?l:t.naturalBearing)!=null?p:0,imagePlacementOptions:{...Tn.imagePlacementOptions,...r==null?void 0:r.imagePlacementOptions},multiFloorView:{...Tn.multiFloorView,...r==null?void 0:r.multiFloorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}function a4(r){let t={remove_watermark:!1};if(r)try{let e=lu(r);Object.assign(t,e.capabilities)}catch(e){L.error("Error decoding capabilities from token",e)}return t}var So,rr,wi,Vl=class Vl extends nt{constructor(e,i){let o=Object.values(i.mvfDataByFloorId)[0];super(e,o);u(this,"__type",Vl.__type);x(this,So);x(this,rr);x(this,wi);P(this,rr,{}),P(this,So,e),P(this,wi,i.mvfDataByFloorId)}static is(e){return e.__type===Vl.__type}get accessible(){var e;return(e=Object.values(a(this,wi))[0].properties.accessible)!=null?e:!1}get type(){var e,i;return(i=(e=Object.values(a(this,wi))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get extra(){return Object.values(a(this,wi))[0].properties.extra}get coordinates(){return a(this,rr).coordinates==null&&(a(this,rr).coordinates=Object.entries(a(this,wi)).map(([e,i])=>new J(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),a(this,rr).coordinates}get nodes(){return Object.values(a(this,wi))[0].properties.nodes.map(e=>a(this,So).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?a(this,So).getById("floor",e.floorId):void 0).filter(il)}get locationProfiles(){var i,o,n,s,c;if(a(this,rr).locationProfiles!=null)return a(this,rr).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],p=Zr(l),d=(c=a(this,So).mvfConnectionIdsByLatLon[p])!=null?c:[];for(let m of d){let g=a(this,So).locationProfilesByAttachedFeatureId[m];if(g!=null){e=g;break}}}return a(this,rr).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,rr)))delete a(this,rr)[e]}};So=new WeakMap,rr=new WeakMap,wi=new WeakMap,u(Vl,"__type","connection");var Dg=Vl,wn=Dg;f();var Ul,Dn,xo,En,jl=class jl extends nt{constructor(e,i){super(e,i.mvfData);u(this,"__type",jl.__type);x(this,Ul);x(this,Dn);x(this,xo,{});x(this,En);P(this,Ul,e),P(this,Dn,i.floorId),P(this,En,i.mvfData)}static is(e){return e.__type===jl.__type}get type(){let e=a(this,En).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=a(this,Ul).getById("floor",a(this,Dn));if(e==null)throw new Error("Floor ".concat(a(this,Dn)," not found!"));return e}get center(){var e;if(a(this,xo).center==null){let[i,o]=(e=a(this,En).properties.center)!=null?e:[0,0];a(this,xo).center=new J(o,i,a(this,Dn))}return a(this,xo).center}get geoJSON(){return{...a(this,En),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,xo)))a(this,xo)[e]=null}};Ul=new WeakMap,Dn=new WeakMap,xo=new WeakMap,En=new WeakMap,u(jl,"__type","object");var Eg=jl,Yt=Eg;f();var Wl,On,Io,ns,Hl=class Hl extends nt{constructor(e,i){super(e,i.mvfData);u(this,"__type",Hl.__type);x(this,Wl);x(this,On);x(this,Io,{});x(this,ns);P(this,Wl,e),P(this,ns,i.mvfData),P(this,On,i.floorId)}static is(e){return e.__type===Hl.__type}get floor(){let e=a(this,Wl).getById("floor",a(this,On));if(e==null)throw new Error("Floor ".concat(a(this,On)," not found!"));return e}get coordinate(){var e;if(a(this,Io).coordinate==null){let[i,o]=(e=a(this,ns).geometry.coordinates)!=null?e:[0,0];a(this,Io).coordinate=new J(o,i,a(this,On))}return a(this,Io).coordinate}get geoJSON(){return{...a(this,ns),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,Io))a(this,Io)[e]=null}};Wl=new WeakMap,On=new WeakMap,Io=new WeakMap,ns=new WeakMap,u(Hl,"__type","point-of-interest");var Og=Hl,bo=Og;f();var Yl,Ln,Po,An,Zl,Ag,Xl=class Xl extends nt{constructor(e,i){super(e,i.mvfData);x(this,Zl);u(this,"__type",Xl.__type);x(this,Yl);x(this,Ln);x(this,Po,{});x(this,An);P(this,Yl,e),P(this,Ln,i.floorId),P(this,An,i.mvfData)}static is(e){return e.__type===Xl.__type}get group(){return _(this,Zl,Ag).call(this).group}get type(){return _(this,Zl,Ag).call(this).type}get coordinate(){if(a(this,Po).coordinate==null){let[e,i]=a(this,An).geometry.coordinates;a(this,Po).coordinate=new J(i,e,a(this,Ln))}return a(this,Po).coordinate}get floor(){let e=a(this,Yl).getById("floor",a(this,Ln));if(e==null)throw new Error("Floor ".concat(a(this,Ln)," not found!"));return e}get geoJSON(){return{...a(this,An),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,Po)))delete a(this,Po)[e]}};Yl=new WeakMap,Ln=new WeakMap,Po=new WeakMap,An=new WeakMap,Zl=new WeakSet,Ag=function(){let[e,i]=a(this,An).properties.symbolId.split("--");return{group:e,type:i}},u(Xl,"__type","annotation");var Lg=Xl,vo=Lg;f();var Mo,or,Cr,as,ql,kg,zl=class zl extends yr{constructor(e,i){super(i.mvfData.id,e);x(this,ql);u(this,"__type",zl.__type);x(this,Mo);x(this,or,{});x(this,Cr);x(this,as);P(this,Mo,e),P(this,Cr,i.mvfData),P(this,as,i.facadeId)}static is(e){return e.__type===zl.__type}get type(){return a(this,Cr).type}get name(){var e;return(e=_(this,ql,kg).call(this,"name"))!=null?e:""}get shortName(){var e;return(e=_(this,ql,kg).call(this,"shortName"))!=null?e:""}get externalId(){var e;return(e=a(this,Cr).externalId)!=null?e:""}get floors(){var e,i;if(a(this,or).floors==null){let o=((i=(e=a(this,Cr).floors)!=null?e:a(this,Cr).maps)!=null?i:[]).reduce((n,s)=>{let c=a(this,Mo).floorsById[s];return c&&n.push(c),n},[]);o.length===0&&L.error("Floor stack ".concat(this.id," has no floors")),a(this,or).floors=o}return a(this,or).floors}get defaultFloor(){if(a(this,or).defaultFloor!=null)return a(this,or).defaultFloor;let e=a(this,Cr).defaultFloor?a(this,Mo).getById("floor",a(this,Cr).defaultFloor):void 0;return a(this,or).defaultFloor=e||this.floors.reduce((i,o)=>Math.abs(o.elevation)<Math.abs(i.elevation)?o:i),a(this,or).defaultFloor}get facade(){return a(this,as)?a(this,Mo).facadesById[a(this,as)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,or)))delete a(this,or)[e]}};Mo=new WeakMap,or=new WeakMap,Cr=new WeakMap,as=new WeakMap,ql=new WeakSet,kg=function(e){return a(this,Mo).getPropTranslation(this.__type,e,this.id,a(this,Cr)[e])},u(zl,"__type","floor-stack");var Fg=zl,Id=Fg;f();var ss,Fn,Jl,$r,$l=class $l extends yr{constructor(e,i){super(i.mvfData.id,e);u(this,"__type",$l.__type);x(this,ss);x(this,Fn);x(this,Jl);x(this,$r,{});P(this,ss,i.mvfData),P(this,Fn,e),P(this,Jl,i.floorStackId)}static is(e){return e.__type===$l.__type}get floorStack(){return a(this,Fn).getById("floor-stack",a(this,Jl))}get spaces(){if(!a(this,$r).spaces){a(this,$r).spaces=[];for(let e of a(this,ss).spaces){let i=a(this,Fn).getById("space",e.spaceId);i&&a(this,$r).spaces.push(i)}}return a(this,$r).spaces}get center(){if(!a(this,$r).center){let e={type:"FeatureCollection",features:[]};for(let o of this.spaces){let n=a(this,Fn).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,$r).center=new J(i.geometry.coordinates[1],i.geometry.coordinates[0],a(this,ss).spaces[0].floorId)}return a(this,$r).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};ss=new WeakMap,Fn=new WeakMap,Jl=new WeakMap,$r=new WeakMap,u($l,"__type","facade");var Bg=$l,vr=Bg;f();var C9=(r,t)=>{var l,p,d,m,g,b,y,C,v,S,M;let e={},i={},o={},n={},s={},c={};for(let w of r["location.json"]||[]){let T=new ls(t,{mvfData:w});if(e[w.id]=T,w.externalId&&(n[w.externalId]==null&&(n[w.externalId]=[]),n[w.externalId].push(T)),w.categories)for(let F of w.categories)s[F]==null&&(s[F]=[]),s[F].push(T);let D=[...(p=(l=w.obstructions)==null?void 0:l.map(F=>F.id))!=null?p:[],...(m=(d=w.spaces)==null?void 0:d.map(F=>F.id))!=null?m:[],...(b=(g=w.annotations)==null?void 0:g.map(F=>F.id))!=null?b:[],...(y=w.connections)!=null?y:[],...(v=(C=w.entrances)==null?void 0:C.map(F=>F.id))!=null?v:[],...(M=(S=w.areas)==null?void 0:S.map(F=>F.id))!=null?M:[]];for(let F of D)F&&(c[F]==null&&(c[F]=[]),c[F].push(T))}for(let w of r["category.json"]||[]){let T=new Md(t,{mvfData:w});i[w.id]=T,w.parent&&(o[w.parent]==null&&(o[w.parent]=[]),o[w.parent].push(T))}return{locationCategoriesByParentId:o,locationProfilesById:e,locationCategoriesById:i,locationProfilesByExternalId:n,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:c}},S9=(r,t,e)=>{var v,S;let i={},o={},n={},s={},c={},l={},p={},d={},m={},g={},b={},y={},C=globalThis.Object.keys(r.space);for(let M of C){let w=r.space[M];if(w!=null)for(let T of w.features){y[T.properties.id]=M,p[T.properties.id]=T;for(let D of T.properties.destinationNodes)c[D]==null&&(c[D]=[]),c[D].push(T.properties.id);if(T.properties.kind==="desk-entrance"&&(l[T.properties.externalId]==null&&(l[T.properties.externalId]=[]),l[T.properties.externalId].push(...T.properties.destinationNodes)),!["void","desk-entrance"].includes((v=T.properties.kind)!=null?v:"")){if((S=T.properties.kind)!=null&&S.includes("connection")){let D=Zr(T.geometry.coordinates);g[D]==null&&(g[D]=[]),g[D].push(T.properties.id);continue}if(T.properties.kind==="poi"){let D=new bo(e,{floorId:M,mvfData:T});n[T.properties.id]=D,m[M]||(m[M]=[]),m[M].push(T),T.properties.externalId&&(s[T.properties.externalId]==null&&(s[T.properties.externalId]=[]),s[T.properties.externalId].push(D))}else{let D=new je(e,{floorId:M,mvfData:T});i[T.properties.id]=D,T.properties.externalId&&(o[T.properties.externalId]==null&&(o[T.properties.externalId]=[]),o[T.properties.externalId].push(D)),d[M]||(d[M]=[]),d[M].push(T)}}}}for(let M in g){let w=g[M],T={};for(let F of w){let O=y[F],B=p[F],k=t==null?void 0:t["n_"+B.properties.id.split("s_")[1]];T[O]={...B,properties:{...B.properties,accessible:(k==null?void 0:k.accessible)===!0}}}let D=new wn(e,{mvfDataByFloorId:T});b[D.id]=D}return{spacesById:i,spacesByExternalId:o,poisById:n,poisByExternalId:s,connectionsById:b,spaceIdsByDestinationNodeId:c,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:p,connectionIdsByLatLon:g,mvfSpacesByFloorId:d,mvfPoisByFloorId:m}},x9=(r,t)=>{var s,c;let e={},i={},o={},n={};for(let l of r["node.geojson"].features){o[l.properties.id]=l;let p=new mo(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});e[l.properties.id]=p,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(p));let d=(c=l.properties.floor)!=null?c:l.properties.map;n[d]||(n[d]=[]),n[d].push(l)}return{nodesById:e,nodesByExternalId:i,mvfNodesById:o,mvfNodesByFloorId:n}},I9=(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 p of l.features){o[p.properties.id]=p;for(let m of p.properties.entrances)n[m]=p.properties.id;if(p.properties.kind==="Wall")continue;let d=new Yt(t,{floorId:c,mvfData:p});e[p.properties.id]=d,p.properties.externalId&&(i[p.properties.externalId]==null&&(i[p.properties.externalId]=[]),i[p.properties.externalId].push(d))}}return{objectsById:e,objectsByExternalId:i,mvfObstructionById:o,obstructionIdByEntranceId:n}},P9=(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 Xt(t,{mvfData:n});e[n.properties.id]=s,n.properties.externalId&&(i[n.properties.externalId]==null&&(i[n.properties.externalId]=[]),i[n.properties.externalId].push(s))}else for(let n of r["map.geojson"]){o[n.id]=n;let s=new Xt(t,{mvfData:{properties:n}});e[n.id]=s}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:o}},M9=(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 p of c){let d=(l=r.facade)==null?void 0:l[p.id],m=new Id(t,{mvfData:p,facadeId:d==null?void 0:d.id});if(e[p.id]=m,p.externalId&&(i[p.externalId]==null&&(i[p.externalId]=[]),i[p.externalId].push(m)),o[p.id]=p,d){let g=new vr(t,{mvfData:d,floorStackId:p.id});n[d.id]=g;for(let b of d.spaces)s[b.spaceId]=g}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:o,facadesById:n,facadesBySpaceId:s}},T9=(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=Zr(c.geometry.coordinates);i[l]==null&&(i[l]=[]),i[l].push(s.id)}return n},{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:i}},w9=(r,t)=>{let e={},i={},o={},n={},s={},c=globalThis.Object.keys(r.entrance);for(let l of c){let p=r.entrance[l];if(p!=null)for(let d of p.features){n[d.properties.id]=d;let m=new Xr(t,{floorId:l,mvfData:d});d.properties.node&&(o[d.properties.node]=m),e[d.properties.id]=m,d.properties.externalId&&(i[d.properties.externalId]==null&&(i[d.properties.externalId]=[]),i[d.properties.externalId].push(m)),s[l]||(s[l]=[]),s[l].push(d)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:o,mvfEntrancesById:n,mvfEntrancesByFloorId:s}},D9=(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 p=l.properties;p.textArea=c,p.textArea&&(p.textArea.position=s.geometry.coordinates)}}}}},E9=(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 p=l.properties;p.image=c,p.image&&(p.image.position=s.geometry.coordinates)}}}}},O9=(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 p=l.properties;p.style={styleId:n,edgeOffset:s.edgeOffset}}})}},L9=(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)}}},A9=(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 p=new vo(t,{floorId:s,mvfData:l});e[l.properties.id]=p,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o}},F9=(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 p=new go(t,{floorId:s,mvfData:l});e[l.properties.id]=p,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(p))}}return{areasById:e,areasByExternalId:i,mvfAreasById:o}},s4=(r,t)=>{var S,M,w,T,D,F,O,B,k,G,V,X,re;let e={},i={},o={},n={},s=((M=(S=r.enterprise)==null?void 0:S.locations)!=null?M:[]).reduce((U,ie)=>(U[ie.id]=ie,U),{}),c={},l={},p={},d={},m={},g={},b=((w=r.enterprise)==null?void 0:w.venue)||{},y={},C={};for(let U of(D=(T=r.enterprise)==null?void 0:T.categories)!=null?D:[]){let ie=new Pd(t,{mvfData:U});c[U.id]=ie,U.externalId&&(l[U.externalId]==null&&(l[U.externalId]=[]),l[U.externalId].push(ie)),p[U.id]=U,U.locations.forEach(Z=>{m[Z]==null&&(m[Z]=[]),m[Z].push(U.id)})}let v={};for(let U of(O=(F=r.enterprise)==null?void 0:F.locationInstances)!=null?O:[]){let ie=s[U.parent],Z=Object.keys(ie),we={};for(let ge of Z)we[ge]=void 0;let ue={...we,polygons:[],nodes:[],...U};v[ue.parent]==null&&(v[ue.parent]=[]),v[ue.parent].push(new Mi(t,{mvfData:ue,categoryIds:((k=(B=r.enterprise)==null?void 0:B.categoryPriorities)==null?void 0:k[ue.id])||m[ue.id],parentId:U.parent})),y[ue.id]=U}for(let U in r.space){let ie=r.space[U];if(ie!=null)for(let Z of ie.features)for(let we of Z.properties.destinationNodes)C[we]==null&&(C[we]=[]),C[we].push(Z.properties.id)}for(let U of(V=(G=r.enterprise)==null?void 0:G.locations)!=null?V:[]){let ie=new Mi(t,{mvfData:U,categoryIds:((re=(X=r.enterprise)==null?void 0:X.categoryPriorities)==null?void 0:re[U.id])||m[U.id],locationInstances:v[U.id]});o[U.id]=ie,U.externalId&&(n[U.externalId]==null&&(n[U.externalId]=[]),n[U.externalId].push(ie)),U.nodes.forEach(Z=>{g[Z.id]==null&&(g[Z.id]=[]),g[Z.id].push(U.id)});for(let Z of U.polygons)d[Z.id]==null&&(d[Z.id]=[]),d[Z.id].push(U)}if(t.enterpriseMode===!0){for(let U in t.mvfConnectionsById){let ie={},Z=t.mvfConnectionsById[U];for(let we of t.mvfConnectionsById[U].nodes){let ue=t.nodesById[we];ue!=null&&(ie[ue.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[ue.coordinate.longitude,ue.coordinate.latitude]},properties:{id:U,externalId:Z.externalId,kind:"enterprise."+Z.type,destinationNodes:[],flags:"",type:Z.type,nodes:Z.nodes,accessible:Z.accessible,extra:Z.extra,details:Z.details}})}Object.keys(ie).length>0&&(e[U]=new wn(t,{mvfDataByFloorId:ie}),Z.externalId&&(i[Z.externalId]==null&&(i[Z.externalId]=[]),i[Z.externalId].push(e[U])))}t.connectionsById=e}return{spaceIdsByNodeId:C,connectionsByExternalId:i,locationIdsByNodeId:g,mvfLocationsBySpaceId:d,mvfLocationsById:s,mvfCategoriesById:p,locationsById:o,locationsByExternalId:n,locationInstancesById:y,categoriesById:c,categoriesByExternalId:l,venue:b}},l4=(r,t)=>{let{nodesById:e,nodesByExternalId:i,mvfNodesById:o,mvfNodesByFloorId:n}=x9(r,t),{mvfConnectionsById:s,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:l}=T9(r,o),{spacesById:p,spacesByExternalId:d,spaceIdsByDestinationNodeId:m,poisById:g,poisByExternalId:b,mvfSpacesById:y,objectEntranceNodeIdsByObstructionId:C,connectionsById:v,connectionIdsByLatLon:S,mvfSpacesByFloorId:M,mvfPoisByFloorId:w}=S9(r,c,t),{objectsById:T,objectsByExternalId:D,mvfObstructionById:F,obstructionIdByEntranceId:O}=I9(r,t),{floorsById:B,floorsByExternalId:k,mvfFloorsById:G}=P9(r,t),{floorStacksById:V,floorStacksByExternalId:X,mvfFloorStacksById:re,facadesById:U,facadesBySpaceId:ie}=M9(r,t),{doorsById:Z,doorsByExternalId:we,doorsByNodeId:ue,mvfEntrancesById:ge,mvfEntrancesByFloorId:xe}=w9(r,t),{annotationsById:pr,mvfAnnotationsById:At,mvfAnnotationsByFloorId:ct}=A9(r,t),{areasById:it,areasByExternalId:di,mvfAreasById:$i}=F9(r,t);E9(r,y,F),D9(r,y,F),O9(r,y),L9(r,y,F);let{locationCategoriesByParentId:ae,locationProfilesById:de,locationCategoriesById:Ve,locationProfilesByExternalId:pt,locationProfilesByCategoryId:ur,locationProfilesByAttachedFeatureId:Ji}=C9(r,t);return{spacesById:p,spacesByExternalId:d,nodesById:e,nodesByExternalId:i,objectsById:T,objectsByExternalId:D,floorsById:B,floorsByExternalId:k,floorStacksById:V,floorStacksByExternalId:X,facadesById:U,facadesBySpaceId:ie,connectionsById:v,doorsById:Z,doorsByExternalId:we,doorsByNodeId:ue,poisById:g,poisByExternalId:b,annotationsById:pr,areasById:it,areasByExternalId:di,spaceIdsByDestinationNodeId:m,objectEntranceNodeIdsByObstructionId:C,obstructionIdByEntranceId:O,connectionIdsByLatLon:S,locationProfilesById:de,locationCategoriesById:Ve,locationProfilesByExternalId:pt,locationProfilesByCategoryId:ur,locationCategoriesByParentId:ae,mvfSpacesById:y,mvfNodesById:o,mvfObstructionById:F,mvfFloorsById:G,mvfFloorStacksById:re,mvfConnectionsById:s,mvfConnectionsByNodeId:c,mvfEntrancesById:ge,mvfAnnotationsById:At,mvfNodesByFloorId:n,mvfSpacesByFloorId:M,mvfPoisByFloorId:w,mvfAreasById:$i,mvfEntrancesByFloorId:xe,mvfAnnotationsByFloorId:ct,locationProfilesByAttachedFeatureId:Ji,mvfConnectionIdsByLatLon:l}};f();var k9=new Set(["polygons"]),Sr,De,Bt,Kl,Ql=class Ql extends Ye{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",Ql.__type);u(this,"description");u(this,"name","");u(this,"amenity");u(this,"externalId","");u(this,"extra");u(this,"gallery");u(this,"instances");u(this,"logo");u(this,"operationHours");u(this,"phone");u(this,"picture");u(this,"shortName");u(this,"showFloatingLabelWhenImagePresent");u(this,"showLogo");u(this,"siblingGroups");u(this,"social");u(this,"sortOrder",-1);u(this,"states");u(this,"tags");u(this,"type","");x(this,Sr);x(this,De,{});x(this,Bt);x(this,Kl);P(this,Sr,e),P(this,Bt,i.mvfData),P(this,Kl,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let o in i.mvfData)!k9.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(i.parentId){let n=a(this,Sr).locationsById[i.parentId];return a(this,Bt)[o]!=null?a(this,Sr).getPropTranslation(this.__type,o,a(this,Bt).id,a(this,Bt)[o]):a(this,Sr).getPropTranslation(this.__type,o,a(this,Bt).id,n[o])}return a(this,Sr).getPropTranslation(this.__type,o,a(this,Bt).id,a(this,Bt)[o])}})}static is(e){return e.__type===Ql.__type}get focusTarget(){return this.spaces}get categories(){return a(this,De).categories?a(this,De).categories:(a(this,De).categories=(a(this,Kl).map(e=>a(this,Sr).getById("enterprise-category",e))||[]).filter(Boolean),a(this,De).categories)}get coordinates(){if(a(this,De).coordinates)return a(this,De).coordinates;a(this,De).coordinates=[];for(let e=0;e<this.nodes.length;e++)a(this,De).coordinates.push(this.nodes[e].coordinate);return a(this,De).coordinates}get nodes(){if(a(this,De).nodes)return a(this,De).nodes;a(this,De).nodes=[];for(let e=0;e<a(this,Bt).nodes.length;e++){let i=a(this,Sr).getById("node",a(this,Bt).nodes[e].id);i&&a(this,De).nodes.push(i)}return a(this,De).nodes}get spaces(){if(a(this,De).spaces)return a(this,De).spaces;a(this,De).spaces=[];for(let e=0;e<a(this,Bt).polygons.length;e++){let i=a(this,Sr).getById("space",a(this,Bt).polygons[e].id);i&&a(this,De).spaces.push(i)}return a(this,De).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,De)))delete a(this,De)[e]}};Sr=new WeakMap,De=new WeakMap,Bt=new WeakMap,Kl=new WeakMap,u(Ql,"__type","enterprise-location");var _g=Ql,Mi=_g;f();var B9=new Set,kn,St,Jr,ec=class ec extends Ye{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",ec.__type);u(this,"name","");u(this,"color");u(this,"externalId","");u(this,"extra");u(this,"icon");u(this,"iconFromDefaultList");u(this,"sortOrder",-1);u(this,"picture");x(this,kn);x(this,St,{});x(this,Jr);P(this,kn,e),P(this,Jr,i.mvfData);for(let o in i.mvfData)!B9.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return a(this,kn).getPropTranslation(this.__type,o,a(this,Jr).id,a(this,Jr)[o])}})}static is(e){return e.__type===ec.__type}get children(){if(a(this,St).children)return a(this,St).children;a(this,St).children=[];for(let e=0;e<a(this,Jr).children.length;e++){let i=a(this,kn).getById("enterprise-category",a(this,Jr).children[e]);i&&a(this,St).children.push(i)}return a(this,St).children}get locations(){if(a(this,St).locations)return a(this,St).locations;a(this,St).locations=[];for(let e=0;e<a(this,Jr).locations.length;e++){let i=a(this,kn).getById("enterprise-location",a(this,Jr).locations[e]);i&&a(this,St).locations.push(i)}return a(this,St).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,St)))delete a(this,St)[e]}};kn=new WeakMap,St=new WeakMap,Jr=new WeakMap,u(ec,"__type","enterprise-category");var Rg=ec,Pd=Rg;f();var _9=new Set,rc,ic,tc=class tc extends Ye{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",tc.__type);u(this,"countrycode");u(this,"externalId","");u(this,"defaultLanguage",{code:"en",name:"English"});u(this,"defaultMap");u(this,"extra");u(this,"icon");u(this,"languages",[]);u(this,"links",[]);u(this,"logo");u(this,"mappedinWebUrl");u(this,"slug","");u(this,"topLocations");u(this,"tzid");x(this,rc,{});x(this,ic);P(this,ic,i.mvfData);for(let o in i.mvfData)!_9.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=i.mvfData[o])}static is(e){return e.__type===tc.__type}get name(){var e;return(e=a(this,ic).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,rc)))delete a(this,rc)[e]}};rc=new WeakMap,ic=new WeakMap,u(tc,"__type","enterprise-venue");var Ng=tc,Gg=Ng;f();function Vg(r){var o,n,s,c,l,p;let t=((n=(o=r.enterprise)==null?void 0:o.locations)==null?void 0:n.reduce((d,m)=>(d[m.id]=m,d),{}))||{};for(let d of((s=r.enterprise)==null?void 0:s.locationInstances)||[])t[d.id]=d;let e={};for(let d of r["floorstack.json"]||[])e[d.id]=d;let i={};for(let d of((c=r["floor.geojson"])==null?void 0:c.features)||[])d.properties&&d.properties.id&&(i[d.properties.id]=d.properties);return{type:"downloaded",data:r,optimized:{"enterprise-location":t,"enterprise-category":((p=(l=r.enterprise)==null?void 0:l.categories)==null?void 0:p.reduce((d,m)=>(d[m.id]=m,d),{}))||{},"floor-stack":e,floor:i}}}function c4(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}f();f();f();f();f();f();f();var Bn=class{constructor({origin:t,destination:e,distance:i=0,angle:o=0,pathWeight:n=0,multiplicativeDistanceWeightScaling:s=!0}){u(this,"origin");u(this,"destination");u(this,"distance");u(this,"angle");u(this,"weight");if(this.origin=t,this.destination=e,this.distance=i,this.angle=o,this.weight=n||0,s?t.properties.floor===e.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===e.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};f();f();f();function Di(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=Na(t),n=o.type,s=t.bbox,c=o.coordinates;if(s&&R9(i,s)===!1)return!1;n==="Polygon"&&(c=[c]);for(var l=!1,p=0;p<c.length&&!l;p++)if(p4(i,c[p][0],e.ignoreBoundary)){for(var d=!1,m=1;m<c[p].length&&!d;)p4(i,c[p][m],!e.ignoreBoundary)&&(d=!0),m++;d||(l=!0)}return l}function p4(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],p=t[n][1],d=r[1]*(s-l)+c*(l-r[0])+p*(r[0]-s)===0&&(s-r[0])*(l-r[0])<=0&&(c-r[1])*(p-r[1])<=0;if(d)return!e;var m=c>r[1]!=p>r[1]&&r[0]<(l-s)*(r[1]-c)/(p-c)+s;m&&(i=!i)}return i}function R9(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}f();f();function Ei([r,t],[e,i]){let o=t-i,n=r-e;return(Math.atan2(n,o)+Math.PI*3)%(Math.PI*2)}f();var N9=63710088e-1;function xr(r,t){let[e,i]=r.map(d=>d*Math.PI/180),[o,n]=t.map(d=>d*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),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return N9*p}f();f();function Td(r,t,e,i){let[o,n]=r,[s,c]=t,[l,p]=e,[d,m]=i;if(n===c&&o===s||p===m&&l===d)return null;let g=(d-l)*(c-n)-(m-p)*(s-o);if(g===0)return null;let b=((m-p)*(o-l)-(d-l)*(n-p))/g,y=((c-n)*(o-l)-(s-o)*(n-p))/g;if(b<0||b>1||y<0||y>1)return null;let C=n+b*(c-n);return[o+b*(s-o),C]}f();function jg(r,t,e,i){let o=hn(r,e/1e3,i),n=hn(t,e/1e3,i);return[o.geometry.coordinates,n.geometry.coordinates]}f();function Ug(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}var u4=111e3;function d4(r,t,e=[],i=0){let o=!0,n=r.geometry.coordinates,s=t.geometry.coordinates,c=Ug(Ei(n,s)-Math.PI/2),l=Ug(Ei(n,s)+Math.PI/2),p=i/u4,d=i/(u4*Math.cos(n[1]*Math.PI/180)),m=Math.min(n[1],s[1])-p,g=Math.max(n[1],s[1])+p,b=Math.min(n[0],s[0])-d,y=Math.max(n[0],s[0])+d;for(let C of e)if(!(Math.max(C[0][1],C[1][1])<m||Math.min(C[0][1],C[1][1])>g||Math.max(C[0][0],C[1][0])<b||Math.min(C[0][0],C[1][0])>y)){if(i>0){let v=jg(n,s,i,c),S=jg(n,s,i,l);if(Td(v[0],v[1],C[0],C[1])||Td(S[0],S[1],C[0],C[1])){o=!1;return}}else if(Td(n,s,C[0],C[1])){o=!1;return}}return o}var _n,at,Hg,h4,f4,m4,g4,y4,b4,Dd,wd=class{constructor({nodes:t,groupBy:e,multiplicativeDistanceWeightScaling:i}){x(this,at);u(this,"edges",{});u(this,"nodesById");u(this,"nodesByGroup",new Map);x(this,_n);x(this,Dd,(t,e)=>{let i=0;for(let o of e)(!o[a(this,_n)]||o[a(this,_n)]===t.properties[a(this,_n)])&&Di(t.geometry.coordinates,o.geometry.geometry)&&(i+=Math.max(0,o.cost));return i});P(this,_n,e);let{features:o}=t;this.nodesById=_(this,at,h4).call(this,o),_(this,at,f4).call(this),_(this,at,m4).call(this,o,e,{multiplicativeDistanceWeightScaling:i})}getShortestEuclideanDistance(t,e){return e.reduce((i,o)=>{let n=xr(t.geometry.coordinates,o.geometry.coordinates);return Math.min(i,n)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,disabledConnectionNodeIds:o,zones:n}){let s=_(this,at,Hg).call(this,t),c=_(this,at,Hg).call(this,e);if(s.length===0||c.length===0)return[];let{frontier:l,cameFrom:p,costSoFar:d}=_(this,at,g4).call(this,s,c);for(;l.length>0;){let m=l.shift();if(!m)break;if(_(this,at,y4).call(this,m.origin,c))return _(this,at,b4).call(this,p,m.origin.properties.id);for(let g of this.edges[m.origin.properties.id]){if(o!=null&&o.has(g.origin.properties.id)&&g.destination.properties.map!==g.origin.properties.map)continue;let b=d[m.origin.properties.id]+g.weight+a(this,Dd).call(this,g.destination,n);if(!(b===1/0||i!=null&&i.has(g.destination.properties.id))&&(d[g.destination.properties.id]==null||b<d[g.destination.properties.id])){let y=b+this.getShortestEuclideanDistance(g.destination,c);d[g.destination.properties.id]=b,p[g.destination.properties.id]=g,l.push({origin:g.destination,priority:y})}}l.sort((g,b)=>g.priority-b.priority)}return[]}};_n=new WeakMap,at=new WeakSet,Hg=function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},h4=function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},f4=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]))},m4=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],p=xr(o.geometry.coordinates,l.geometry.coordinates),d=Ei(o.geometry.coordinates,l.geometry.coordinates);return new Bn({origin:o,destination:l,pathWeight:c,distance:p,angle:d,multiplicativeDistanceWeightScaling:i==null?void 0:i.multiplicativeDistanceWeightScaling})})})},g4=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}},y4=function(t,e){return e.some(i=>i.properties.id===t.properties.id)},b4=function(t,e){let i=[],o=t[e];for(;o;)i.push(o),o=t[o.origin.properties.id];return i.reverse()},Dd=new WeakMap;var G9=.4,cs=class{constructor({nodes:t,geojsonCollection:e,groupBy:i="default",multiplicativeDistanceWeightScaling:o}){u(this,"groupBy");u(this,"graph");u(this,"geometryEdgesByMapId",new Map);u(this,"generatePath",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});u(this,"getDistance",(t,e)=>xr(t,e));u(this,"getAngle",(t,e)=>Ei(t,e));this.groupBy=i,this.graph=new wd({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((p,d)=>{this.geometryEdgesByMapId.get(l).push([p,c[d+1]||c[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:o,disabledConnectionNodeIds:n,simplify:s,multiplicativeDistanceWeightScaling:c}){var m,g;let l=(m=s==null?void 0:s.enabled)!=null?m:!0,p=t!=null?t:[],d=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:p,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(n)});return d.length===0?{type:"FeatureCollection",features:[]}:(l&&(d=this.simplifyAllSteps(d,(g=s==null?void 0:s.bufferRadius)!=null?g:G9,c)),this.generatePath(d))}simplifyAllSteps(t,e,i){var p,d;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],b=(p=this.geometryEdgesByMapId.get(g))!=null?p:[];o.push(...this.simplifySteps(n,b,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=(d=this.geometryEdgesByMapId.get(c))!=null?d:[];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||!d4(t[s].origin,t[c].origin,e,i)){let l=c-1;n.push(new Bn({...t[s],destination:t[l].origin,distance:xr(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:Ei(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),s=l}return n.push(new Bn({...t[s],destination:t[t.length-1].origin,distance:xr(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:Ei(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),n}};f();function nr(r){return r.verticalOffset===0?[r.longitude,r.latitude]:[r.longitude,r.latitude,r.verticalOffset]}function V9(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}var Wg=(r,t)=>{let e=V9(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}=fg(o,s);n=l.map(p=>p.geometry.coordinates),i.entrances.features.push(...c)}i.walls.geometry.coordinates.push(...n)}return i};function v4(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}function C4(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}function Ed(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}function Xg(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}function Yg(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity),r.flipImageToFaceCamera!==void 0&&(e.flipImageToFaceCamera=r.flipImageToFaceCamera)),e}function S4(r){let t={};return r.opacity!==void 0&&(t.opacity=r.opacity),t}function x4(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function I4(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}function P4(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}function Zg(r,t){return r.reduce((e,i)=>{let o=t[i.properties.id];if(o==null)return e;if("textures"in i.properties&&Array.isArray(i.properties.textures)&&i.properties.textures.length>0){let n={...o,id:o.id+"-textures"};e.set(n,[i])}else e.has(o)||e.set(o,[]),e.get(o).push(i);return e},new Map)}function oc(r,t={}){var o,n,s,c,l,p,d;let e={...r,flipImageToFaceCamera:(o=t==null?void 0:t.flipImagesToFaceCamera)!=null?o:!0},i=(s=(n=t==null?void 0:t.style)==null?void 0:n.shading)!=null?s:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(l=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let m=(d=(p=t==null?void 0:t.style)==null?void 0:p.wallTopColor)!=null?d:t==null?void 0:t.wallTopColor;m!=null&&(e.topColor=m)}return e}var M4=(r,t)=>{var o;let i=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Te);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(Co);case"exterior-walls":return i==null?void 0:i.layers.get(zr);case"interior-doors":return i==null?void 0:i.layers.get(ts);case"exterior-doors":return i==null?void 0:i.layers.get(rs);default:return typeof r=="string"?r:r.id}};function zg(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}function Od(r){return r.bbox?r.bbox:Ta(r)}function T4(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])]}function w4(r){return[...new Set(r)]}function qg(r,t,e){return r.floorId&&t.has(r.floorId)?t.get(r.floorId):e}var D4=Math.PI*.1,Ne,mt,xt,Rn,Nn,Oi,Gn,us,ar,E4,ps,O4,Fd=class{constructor(t,e,i,o){x(this,ar);x(this,Ne,{});x(this,mt);x(this,xt);x(this,Rn);x(this,Nn);x(this,Oi);x(this,Gn);x(this,us);P(this,mt,e),P(this,xt,t.features),P(this,Rn,i),P(this,Nn,o)}get path(){return a(this,xt).map(t=>a(this,mt).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(a(this,Ne).departure)return a(this,Ne).departure;let t=a(this,xt)[0].properties.id,e=a(this,Rn)[0];if(a(this,Rn).length>1){for(let i of a(this,Rn))if(nc(i,a(this,mt)).includes(t)){e=i;break}}return a(this,Ne).departure=e,e}get destination(){if(a(this,Ne).destination)return a(this,Ne).destination;let t=a(this,xt)[a(this,xt).length-1].properties.id,e=a(this,Nn)[0];if(a(this,Nn).length>1){for(let i of a(this,Nn))if(nc(i,a(this,mt)).includes(t)){e=i;break}}return a(this,Ne).destination=e,e}get coordinates(){return a(this,Ne).coordinates?a(this,Ne).coordinates:(a(this,Ne).coordinates=a(this,xt).map(t=>new J(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),a(this,Ne).coordinates)}get distance(){return a(this,Ne).distance?a(this,Ne).distance:(a(this,Ne).distance=a(this,xt).reduce((t,e)=>t+(e.properties.distance||0),0),a(this,Ne).distance)}get instructions(){if(a(this,xt).length<2)return[];if(a(this,Ne).instructions)return a(this,Ne).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 J(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=_(this,ar,E4).call(this,{prevDirection:n,direction:o,nextDirection:s});e+=(n==null?void 0:n.properties.distance)||0;for(let p of l)p&&(t.push({action:p,distance:e,coordinate:c,node:a(this,mt).getById("node",o.properties.id)}),e=0)}return a(this,Ne).instructions=t,a(this,Ne).instructions}};Ne=new WeakMap,mt=new WeakMap,xt=new WeakMap,Rn=new WeakMap,Nn=new WeakMap,Oi=new WeakMap,Gn=new WeakMap,us=new WeakMap,ar=new WeakSet,E4=function(t){var y,C;let{prevDirection:e,direction:i,nextDirection:o}=t,n=e&&a(this,mt).getById("floor",e.properties.groupBy),s=a(this,mt).getById("floor",i.properties.groupBy),c=o&&a(this,mt).getById("floor",o.properties.groupBy),l=[];e||l.push({type:"Departure"});let p=a(this,mt).getMVFFeatureByNodeId("connection",i.properties.id),d=p?a(this,mt).getById("connection",p.id):void 0,m=p&&p.nodes.length>1,g=a(this,mt).enterpriseMode&&(!i.properties.destination||!(p!=null&&p.nodes.includes(i.properties.destination))||!(p!=null&&p.nodes.includes(i.properties.id)));if(p&&!(!m||g))if(!a(this,Oi)||a(this,Oi)==="exit")l.push(_(this,ar,ps).call(this,"TakeConnection",s,c,d,p)),P(this,Oi,"take"),P(this,Gn,d),P(this,us,p);else{let v=a(this,mt).getMVFFeatureByNodeId("connection",(y=e==null?void 0:e.properties.id)!=null?y:""),S=a(this,mt).getById("connection",(C=v==null?void 0:v.id)!=null?C:"");l.push(_(this,ar,ps).call(this,"ExitConnection",s,n,S,v)),P(this,Oi,"exit"),P(this,Gn,d),P(this,us,p)}else a(this,Oi)==="take"?(l.push(_(this,ar,ps).call(this,"ExitConnection",s,n,a(this,Gn),a(this,us))),P(this,Oi,"exit"),P(this,Gn,d)):c&&s.id!==c.id?l.push(_(this,ar,ps).call(this,"TakeConnection",s,c,d)):n&&n.id!==s.id?l.push(_(this,ar,ps).call(this,"ExitConnection",s,n,d)):l.push(_(this,ar,O4).call(this,e,i));return o||l.push({type:"Arrival"}),l},ps=function(t,e,i,o,n){var l,p;let s="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let d=e.elevation-i.elevation;d>0?s="down":d<0&&(s="up")}let c=(p=(l=o==null?void 0:o.type)!=null?l:n==null?void 0:n.type)!=null?p:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:s,connection:o,connectionType:c}},O4=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?-x4(t.properties.angle,e.properties.angle):0;return Math.abs(n)>=D4?{type:"Turn",bearing:I4(n,D4),referencePosition:"At"}:null};var kd=class{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:o,multiplicativeDistanceWeightScaling:n}){u(this,"navigator");u(this,"connections");u(this,"getDirections",(t,e,i,o)=>{let{accessible:n,smoothing:{enabled:s,radius:c}}=i,l=t.flatMap(y=>nc(y,o)),p=e.flatMap(y=>nc(y,o)),d=this.getExcludedNodeIds(i.excludedConnections).filter(y=>!l.includes(y)&&!p.includes(y)),m=this.getDisabledConnectionNodeIds(n).filter(y=>!l.includes(y)&&!p.includes(y)),g=this.navigator.getDirections({zones:i.zones.map(y=>{var C;return{geometry:y.geometry,cost:y.cost,map:(C=y.floor)==null?void 0:C.id}}),originIds:l,destinationNodeIds:p,excludedNodeIds:d,disabledConnectionNodeIds:m,simplify:{enabled:s,bufferRadius:c},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(g,t,e);let b=new Fd(g,o,t,e);if(!(b.distance===0&&new Set([...l,...p]).size===l.length+p.length))return b});u(this,"getExcludedNodeIds",t=>{if(t.length===0)return[];let e=new Set(t.map(i=>i.id));return this.connections.reduce((i,o)=>e.has(o.id)?i.concat(o.nodes):i,[])});u(this,"getDisabledConnectionNodeIds",t=>t===!1?[]:this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]));u(this,"addCoordinateDirections",(t,[e],[i])=>{if(t.features.length){if(J.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(J.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)}}});u(this,"createDirectionFeature",(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:[]}}));this.navigator=new cs({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))),[])}}};function nc(r,t){var e,i,o,n,s;if(ls.is(r))return r.navigationTarget.flatMap(c=>nc(c,t));if(vo.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(J.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(bo.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(Xr.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(go.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(je.is(r)){let c=t==null?void 0:t.getMVFFeatureById("space",r.id);return c==null?[]:c.properties.destinationNodes}else{if(wn.is(r))return r.coordinates.reduce((c,l)=>{var d;let p=t.Query.nearest(l,{types:["node"]});return(d=p==null?void 0:p[0])!=null&&d.feature.id&&c.push(p[0].feature.id),c},[]);if(Yt.is(r)){let c=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return c!=null?c:[]}else return vr.is(r)?r.spaces.flatMap(c=>{var l,p;return(p=(l=t==null?void 0:t.getMVFFeatureById("space",c.id))==null?void 0:l.properties.destinationNodes)!=null?p:[]}).filter(c=>typeof c=="string"):Mi.is(r)?r.nodes.map(c=>c.id):mo.is(r)?[r.id]:[]}}f();f();f();f();f();f();function L4(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return A4(this.cover(t,e),t,e,r)}function A4(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,p=r._x1,d=r._y1,m,g,b,y,C,v,S,M;if(!n)return r._root=s,r;for(;n.length;)if((C=t>=(m=(c+p)/2))?c=m:p=m,(v=e>=(g=(l+d)/2))?l=g:d=g,o=n,!(n=n[S=v<<1|C]))return o[S]=s,r;if(b=+r._x.call(null,n.data),y=+r._y.call(null,n.data),t===b&&e===y)return s.next=n,o?o[S]=s:r._root=s,r;do o=o?o[S]=new Array(4):r._root=new Array(4),(C=t>=(m=(c+p)/2))?c=m:p=m,(v=e>=(g=(l+d)/2))?l=g:d=g;while((S=v<<1|C)===(M=(y>=g)<<1|b>=m));return o[M]=n,o[S]=s,r}function F4(r){var t,e,i=r.length,o,n,s=new Array(i),c=new Array(i),l=1/0,p=1/0,d=-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>d&&(d=o),n<p&&(p=n),n>m&&(m=n));if(l>d||p>m)return this;for(this.cover(l,p).cover(d,m),e=0;e<i;++e)A4(this,s[e],c[e],r[e]);return this}f();function k4(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,p;e>r||r>=o||i>t||t>=n;)switch(p=(t<i)<<1|r<e,l=new Array(4),l[p]=c,c=l,s*=2,p){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}f();function B4(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}f();function _4(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]]}f();f();function et(r,t,e,i,o){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=o}function R4(r,t,e){var i,o=this._x0,n=this._y0,s,c,l,p,d=this._x1,m=this._y1,g=[],b=this._root,y,C;for(b&&g.push(new et(b,o,n,d,m)),e==null?e=1/0:(o=r-e,n=t-e,d=r+e,m=t+e,e*=e);y=g.pop();)if(!(!(b=y.node)||(s=y.x0)>d||(c=y.y0)>m||(l=y.x1)<o||(p=y.y1)<n))if(b.length){var v=(s+l)/2,S=(c+p)/2;g.push(new et(b[3],v,S,l,p),new et(b[2],s,S,v,p),new et(b[1],v,c,l,S),new et(b[0],s,c,v,S)),(C=(t>=S)<<1|r>=v)&&(y=g[g.length-1],g[g.length-1]=g[g.length-1-C],g[g.length-1-C]=y)}else{var M=r-+this._x.call(null,b.data),w=t-+this._y.call(null,b.data),T=M*M+w*w;if(T<e){var D=Math.sqrt(e=T);o=r-D,n=t-D,d=r+D,m=t+D,i=b.data}}return i}f();function N4(r){if(isNaN(d=+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,p=this._y1,d,m,g,b,y,C,v,S;if(!e)return this;if(e.length)for(;;){if((y=d>=(g=(s+l)/2))?s=g:l=g,(C=m>=(b=(c+p)/2))?c=b:p=b,t=e,!(e=e[v=C<<1|y]))return this;if(!e.length)break;(t[v+1&3]||t[v+2&3]||t[v+3&3])&&(i=t,S=v)}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[v]=n:delete t[v],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[S]=e:this._root=e),this):(this._root=n,this)}function G4(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}f();function V4(){return this._root}f();function j4(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}f();function U4(r){var t=[],e,i=this._root,o,n,s,c,l;for(i&&t.push(new et(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 p=(n+c)/2,d=(s+l)/2;(o=i[3])&&t.push(new et(o,p,d,c,l)),(o=i[2])&&t.push(new et(o,n,d,p,l)),(o=i[1])&&t.push(new et(o,p,s,c,d)),(o=i[0])&&t.push(new et(o,n,s,p,d))}return this}f();function H4(r){var t=[],e=[],i;for(this._root&&t.push(new et(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,p=i.y1,d=(s+l)/2,m=(c+p)/2;(n=o[0])&&t.push(new et(n,s,c,d,m)),(n=o[1])&&t.push(new et(n,d,c,l,m)),(n=o[2])&&t.push(new et(n,s,m,d,p)),(n=o[3])&&t.push(new et(n,d,m,l,p))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}f();function W4(r){return r[0]}function X4(r){return arguments.length?(this._x=r,this):this._x}f();function Y4(r){return r[1]}function Z4(r){return arguments.length?(this._y=r,this):this._y}function ac(r,t,e){var i=new $g(t==null?W4:t,e==null?Y4:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}function $g(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}function z4(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}var It=ac.prototype=$g.prototype;It.copy=function(){var r=new $g(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=z4(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]=z4(i));return r};It.add=L4;It.addAll=F4;It.cover=k4;It.data=B4;It.extent=_4;It.find=R4;It.remove=N4;It.removeAll=G4;It.root=V4;It.size=j4;It.visit=U4;It.visitAfter=H4;It.x=X4;It.y=Z4;var Zt,To,Bd=class{constructor(t){x(this,Zt,{});x(this,To);P(this,To,t)}getTreeByType(t,e,i){var s;if(a(this,Zt)[t]||(a(this,Zt)[t]={}),a(this,Zt)[t][e]&&a(this,Zt)[t][e][i])return a(this,Zt)[t][e][i];a(this,Zt)[t][e]||(a(this,Zt)[t][e]={}),a(this,Zt)[t][e][i]||(a(this,Zt)[t][e][i]=ac());let o=a(this,Zt)[t][e][i];o.x(c=>c.geometry.coordinates[1]),o.y(c=>c.geometry.coordinates[0]);let n=[];switch(t){case"node":n=((s=a(this,To).directions.navigator.graph.nodesByGroup.get(i))==null?void 0:s.filter(c=>c.properties.neighbors.length>0))||[];break;case"point-of-interest":n=a(this,To).mvfPoisByFloorId[i]||[];break;case"door":n=a(this,To).mvfEntrancesByFloorId[i]||[];break;case"annotation":n=a(this,To).mvfAnnotationsByFloorId[i]||[];break}return(n==null?void 0:n.length)>0&&o.addAll(n),o}};Zt=new WeakMap,To=new WeakMap;var j9=N.object({limit:N.enum(["same-floor","same-elevation"]).optional(),radius:N.number().optional(),types:N.array(N.enum(["node","point-of-interest"])).min(1)}),Qr,lc,sc=class{constructor(t){x(this,Qr);x(this,lc);P(this,Qr,t),P(this,lc,new Bd(a(this,Qr)))}nearest(t,e){try{j9.parse(e)}catch(s){L.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 p;return(p=l.floors.find(d=>d.elevation===c))==null?void 0:p.id}).filter(Boolean))}}let n=[];for(let s of w4(e.types))for(let c of o){let l=a(this,lc).getTreeByType(s,a(this,Qr).mapName,c).find(i.latitude,i.longitude,e.radius);if(l){let p=a(this,Qr).getById(s,l==null?void 0:l.properties.id);p&&n.push({distance:xr([i.longitude,i.latitude],l.geometry.coordinates),feature:p})}}return n.sort((s,c)=>s.distance-c.distance)}};Qr=new WeakMap,lc=new WeakMap;f();f();var cc,_d=class{constructor(t){x(this,cc);P(this,cc,t||[])}get raw(){return a(this,cc)}};cc=new WeakMap;var Pt,H,Pe,pc=class pc extends Ye{constructor(e,i){super(i.mvfData.id);u(this,"__type",pc.__type);u(this,"id","loc_");u(this,"name","");u(this,"externalId");u(this,"description");u(this,"logo");u(this,"phone");u(this,"social",[]);u(this,"images",[]);u(this,"links",[]);u(this,"website");u(this,"icon");x(this,Pt);x(this,H,{});x(this,Pe);P(this,Pt,e),P(this,Pe,i.mvfData);for(let o in i.mvfData)o==="links"?this.links=i.mvfData.links.map(n=>new bn({mvfData:n})):o==="pictures"?this.images=i.mvfData.pictures.map(n=>n.url?new Ja({mvfData:{url:n.url}}):void 0).filter(n=>n!=null):o==="website"?i.mvfData.website&&(this.website=new bn({mvfData:i.mvfData.website})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,Pe)[o]}})}static is(e){return e.__type===pc.__type}get spaces(){if(a(this,H).spaces)return a(this,H).spaces;if(a(this,Pe).spaces==null)return a(this,H).spaces=[],a(this,H).spaces;a(this,H).spaces=[];for(let e=0;e<a(this,Pe).spaces.length;e++){let i=a(this,Pt).getById("space",a(this,Pe).spaces[e].id);i&&a(this,H).spaces.push(i)}return a(this,H).spaces}get points(){if(a(this,H).points)return a(this,H).points;if(a(this,Pe).spaces==null)return a(this,H).points=[],a(this,H).points;a(this,H).points=[];for(let e=0;e<a(this,Pe).spaces.length;e++){let i=a(this,Pt).getById("point-of-interest",a(this,Pe).spaces[e].id);i&&a(this,H).points.push(i)}return a(this,H).points}get doors(){if(a(this,H).doors)return a(this,H).doors;if(a(this,Pe).entrances==null)return a(this,H).doors=[],a(this,H).doors;a(this,H).doors=[];for(let e=0;e<a(this,Pe).entrances.length;e++){let i=a(this,Pt).getById("door",a(this,Pe).entrances[e].id);i&&a(this,H).doors.push(i)}return a(this,H).doors}get connections(){var i;if(a(this,H).connections)return a(this,H).connections;if(a(this,Pe).connections==null)return a(this,H).connections=[],a(this,H).connections;let e=new Set;for(let o=0;o<a(this,Pe).connections.length;o++){let n=a(this,Pe).connections[o],s=a(this,Pt).mvfConnectionsById[n],l=(s==null?[]:s.nodes).map(p=>a(this,Pt).getById("node",p)).filter(Boolean);for(let p of l){if(p==null)continue;let d=Zr([p.coordinate.longitude,p.coordinate.latitude]),g=((i=a(this,Pt).connectionSpaceIdsByLatLon[d])!=null?i:[]).map(b=>a(this,Pt).connectionsById[b]).filter(b=>b!=null);for(let b of g)e.add(b)}}return a(this,H).connections=Array.from(e),a(this,H).connections}get annotations(){if(a(this,H).annotations)return a(this,H).annotations;if(a(this,Pe).annotations==null)return a(this,H).annotations=[],a(this,H).annotations;a(this,H).annotations=[];for(let e=0;e<a(this,Pe).annotations.length;e++){let i=a(this,Pt).getById("annotation",a(this,Pe).annotations[e].id);i&&a(this,H).annotations.push(i)}return a(this,H).annotations}get categories(){return a(this,H).categories?a(this,H).categories:a(this,Pe).categories==null?(a(this,H).categories=[],a(this,H).categories):(a(this,H).categories=a(this,Pe).categories.map(e=>a(this,Pt).getById("location-category",e)).filter(e=>e!=null),a(this,H).categories)}get mapObjects(){return a(this,H).mapObjects?a(this,H).mapObjects:a(this,Pe).obstructions==null?(a(this,H).mapObjects=[],a(this,H).mapObjects):(a(this,H).mapObjects=a(this,Pe).obstructions.map(e=>a(this,Pt).getById("object",e.id)).filter(e=>e!=null),a(this,H).mapObjects)}get areas(){return a(this,H).areas?a(this,H).areas:a(this,Pe).areas==null?(a(this,H).areas=[],a(this,H).areas):(a(this,H).areas=a(this,Pe).areas.map(e=>a(this,Pt).getById("area",e.id)).filter(e=>e!=null),a(this,H).areas)}get focusTarget(){if(a(this,H).focusTarget)return a(this,H).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,H).focusTarget=e,e}get openingHours(){var e;return a(this,H).openingHours?a(this,H).openingHours:(a(this,H).openingHours=new _d((e=a(this,Pe).openingHoursSpecification)!=null?e:[]),a(this,H).openingHours)}get navigationTarget(){if(a(this,H).navigationTarget)return a(this,H).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,H).navigationTarget=e,e}toJSON(){return{id:this.id,name:this.name}}};Pt=new WeakMap,H=new WeakMap,Pe=new WeakMap,u(pc,"__type","location-profile");var Jg=pc,ls=Jg;f();var wo,_t,Vn,uc=class uc extends Ye{constructor(e,i){super(i.mvfData.id);u(this,"__type",uc.__type);u(this,"id","cat_");u(this,"name","");u(this,"icon","");x(this,wo);x(this,_t,{});x(this,Vn);P(this,wo,e),P(this,Vn,i.mvfData);for(let o in i.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return a(this,Vn)[o]}})}static is(e){return e.__type===uc.__type}get parent(){return a(this,_t).parent?a(this,_t).parent:(a(this,_t).parent=a(this,Vn).parent?a(this,wo).getById("location-category",a(this,Vn).parent):void 0,a(this,_t).parent)}get children(){return a(this,_t).children?a(this,_t).children:(a(this,_t).children=a(this,wo).locationCategoriesByParentId[this.id]||[],a(this,_t).children)}get locationProfiles(){if(a(this,_t).locationProfiles)return a(this,_t).locationProfiles;let e=[];for(let i of a(this,wo).locationProfilesByCategoryId[this.id]||[]){let o=a(this,wo).getById("location-profile",i.id);o&&e.push(o)}return a(this,_t).locationProfiles=e,e}toJSON(){return{id:this.id,name:this.name}}};wo=new WeakMap,_t=new WeakMap,Vn=new WeakMap,u(uc,"__type","location-category");var Qg=uc,Md=Qg;var q,Rd,q4,ds,Do,jn,hs=class extends ee{constructor(e,i){var c,l,p,d,m;super();x(this,Rd);u(this,"Analytics");x(this,q,{});u(this,"Query");u(this,"mvf");u(this,"outdoorViewToken");u(this,"spaceIdsByDestinationNodeId");u(this,"objectEntranceNodeIdsByObstructionId");u(this,"obstructionIdByEntranceId");u(this,"venue");u(this,"sasToken");u(this,"directions");u(this,"enterpriseMode",!1);u(this,"nodesById");u(this,"spacesById");u(this,"floorsById");u(this,"floorStacksById");u(this,"facadesById");u(this,"facadesBySpaceId");u(this,"connectionsById");u(this,"objectsById");u(this,"doorsById");u(this,"pointsOfInterestById");u(this,"annotationsById");u(this,"areasById");u(this,"locationProfilesById");u(this,"locationCategoriesById");u(this,"locationProfilesByExternalId");u(this,"locationsById");u(this,"locationProfilesByCategoryId");u(this,"locationCategoriesByParentId");u(this,"categoriesById");u(this,"doorsByNodeId");u(this,"mvfLocationsBySpaceId");u(this,"locationIdsByNodeId");u(this,"spaceIdsByNodeId");u(this,"mvfAnnotationsById");u(this,"mvfConnectionsById");u(this,"mvfConnectionsByNodeId");u(this,"mvfConnectionIdsByLatLon");u(this,"mvfEntrancesById");u(this,"mvfNodesById");u(this,"mvfObstructionById");u(this,"mvfSpacesById");u(this,"mvfFloorsById");u(this,"mvfFloorStacksById");u(this,"mvfAreasById");u(this,"connectionSpaceIdsByLatLon");u(this,"locationProfilesByAttachedFeatureId");u(this,"spacesByExternalId");u(this,"nodesByExternalId");u(this,"objectsByExternalId");u(this,"poisByExternalId");u(this,"floorsByExternalId");u(this,"floorStacksByExternalId");u(this,"doorsByExternalId");u(this,"areasByExternalId");u(this,"connectionsByExternalId");u(this,"locationsByExternalId");u(this,"categoriesByExternalId");u(this,"mvfNodesByFloorId");u(this,"mvfSpacesByFloorId");u(this,"mvfPoisByFloorId");u(this,"mvfEntrancesByFloorId");u(this,"mvfAnnotationsByFloorId");u(this,"localePacksUrls");u(this,"currentLanguage");u(this,"languagePacks",{});u(this,"tilesets",{});u(this,"binaryBundle");u(this,"envControl");u(this,"getMapDataOptions");x(this,ds);u(this,"getDirectionsMultiDestination",(e,i,o)=>this.getDirections(e,i,{...o,multiDestination:!0}));u(this,"getDirections",(e,i,o)=>{let{accessible:n=!1,smoothing:s=!0,multiDestination:c=!1}=o||{},l=typeof s=="object"?s.enabled:s,p=typeof s=="object"?s.radius:void 0,d=(o==null?void 0:o.zones)||[],m={accessible:n,zones:d,smoothing:{enabled:l!=null?l:!0,radius:p!=null?p:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(c&&Array.isArray(i)){let g=Array.isArray(e)?e:[e],b=[];for(let y of i){let C=Array.isArray(y)?y:[y],v=this.directions.getDirections(g,C,m,this);if(!v){L.error("getDirections failed due to missing directions for one of the segments");return}g=C,b.push(v)}return b}else{let g=Array.isArray(e)?e:[e],b=Array.isArray(i)?i:[i];if(Array.isArray(b[0])){L.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&b[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,b[0].id),this.directions.getDirections(g,b,m,this)}});x(this,Do);x(this,jn);u(this,"transformImageRequest",async e=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!c4(e))return{url:e};let i=await this.getSasToken();if(i==null)return L.error("Failed to append SAS token to image request. Requests for private images may fail."),{url:e};let[o]=e.split("?");return{url:"".concat(o,"?").concat(i)}});let o=(c=i==null?void 0:i.env)!=null?c:dn();if(this.envControl=o,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new Fa,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,((p=e["tileset.json"])==null?void 0:p.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=(d=i==null?void 0:i.enterprise)!=null?d:!1,this.sasToken=i==null?void 0:i.sasToken;let n=l4(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=s4(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 Gg(this,{mvfData:s.venue});let g={};for(let b in s.mvfLocationsById)g[b]=s.mvfLocationsById[b];for(let b in s.locationInstancesById)g[b]=s.locationInstancesById[b];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":g,"enterprise-category":s.mvfCategoriesById,"floor-stack":n.mvfFloorStacksById,floor:n.mvfFloorsById}},(m=i==null?void 0:i.languagePacks)==null||m.forEach(({language:b,localePack:y})=>{this.languagePacks[b.code]=Vg(y)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new sc(this),this.directions=new kd({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 J(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,q).spaces==null&&(a(this,q).spaces=globalThis.Object.values(this.spacesById)),a(this,q).spaces}get objects(){return a(this,q).objects==null&&(a(this,q).objects=globalThis.Object.values(this.objectsById)),a(this,q).objects}get connections(){return a(this,q).connections==null&&(a(this,q).connections=globalThis.Object.values(this.connectionsById)),a(this,q).connections}get floors(){return a(this,q).floors==null&&(a(this,q).floors=globalThis.Object.values(this.floorsById)),a(this,q).floors}get floorStacks(){return a(this,q).floorStacks==null&&(a(this,q).floorStacks=globalThis.Object.values(this.floorStacksById)),a(this,q).floorStacks}get facades(){return a(this,q).facades==null&&(a(this,q).facades=globalThis.Object.values(this.facadesById)),a(this,q).facades}get doors(){return a(this,q).doors==null&&(a(this,q).doors=globalThis.Object.values(this.doorsById)),a(this,q).doors}get pointsOfInterest(){return a(this,q).pointsOfInterest==null&&(a(this,q).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),a(this,q).pointsOfInterest}get annotations(){return a(this,q).annotations==null&&(a(this,q).annotations=globalThis.Object.values(this.annotationsById)),a(this,q).annotations}get areas(){return a(this,q).areas==null&&(a(this,q).areas=globalThis.Object.values(this.areasById)),a(this,q).areas}get nodes(){return a(this,q).nodes==null&&(a(this,q).nodes=globalThis.Object.values(this.nodesById)),a(this,q).nodes}get locations(){return a(this,q).locations==null&&(a(this,q).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return a(this,q).categories==null&&(a(this,q).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return a(this,q).locationProfiles==null&&(a(this,q).locationProfiles=globalThis.Object.values(this.locationProfilesById)),a(this,q).locationProfiles}get locationCategories(){return a(this,q).locationCategories==null&&(a(this,q).locationCategories=globalThis.Object.values(this.locationCategoriesById)),a(this,q).locationCategories}get mvfFloors(){return a(this,q).mvfFloors==null&&(a(this,q).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),a(this,q).mvfFloors}get mvfFloorStacks(){return a(this,q).mvfFloorStacks==null&&(a(this,q).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),a(this,q).mvfFloorStacks}async getAccessToken(){if(this.getMapDataOptions==null)return;let e="accessToken"in this.getMapDataOptions?this.getMapDataOptions.accessToken:void 0;if(!e&&"key"in this.getMapDataOptions&&"secret"in this.getMapDataOptions)try{a(this,Do)||P(this,Do,un(this.getMapDataOptions,this.enterpriseMode));let i=await a(this,Do);P(this,Do,void 0),e=i.accessToken}catch(i){P(this,Do,void 0),L.error("Failed to fetch access token. Requests for private images may fail.",i)}return e}async getSasToken(){if(this.getMapDataOptions==null)return;let e;try{a(this,jn)||P(this,jn,this.getAccessToken().then(o=>{if(this.getMapDataOptions==null||o==null)throw new Error("Unable to fetch SAS token without access token");return _a(this.getMapDataOptions,o)})),e=(await a(this,jn)).token}catch(i){L.log("Unable to fetch SAS token",i)}finally{P(this,jn,void 0)}return e}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(e,i){switch(e){case"location-profile":return this.locationProfilesById[i];case"location-category":return this.locationCategoriesById[i];case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":let o=this.connectionsById[i];return o==null&&(o=_(this,Rd,q4).call(this,this.mvfConnectionsById[i])),o;case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:return}}getByExternalId(e,i){var o,n,s,c,l,p,d,m,g,b,y,C;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(p=this.doorsByExternalId[i])!=null?p:[];case"connection":return(d=this.connectionsByExternalId[i])!=null?d:[];case"object":return(m=this.objectsByExternalId[i])!=null?m:[];case"point-of-interest":return(g=this.poisByExternalId[i])!=null?g:[];case"area":return(b=this.areasByExternalId[i])!=null?b:[];case"enterprise-location":return(y=this.locationsByExternalId[i])!=null?y:[];case"enterprise-category":return(C=this.categoriesByExternalId[i])!=null?C:[];default:return[]}}getMapDataById(e){var i,o,n,s,c,l,p,d,m,g;return(g=(m=(d=(p=(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?p:this.objectsById[e])!=null?d: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 l,p;if(!this.currentLanguage)return n;let{code:s}=this.currentLanguage,c=(p=(l=this.languagePacks[s])==null?void 0:l.optimized)==null?void 0:p[e];if(c){let d=c[o];if(d!=null&&d[i]!==void 0)return d[i]}return n}async changeLanguage(e){var c;let i=e.toLowerCase();if(!i){L.error("language code must be defined");return}if(!this.currentLanguage){L.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){L.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){L.error("locale packs url not found for ".concat(n.code));return}a(this,ds)&&a(this,ds).abort();let p=new AbortController;P(this,ds,p);let d;try{d=await W0(l,{signal:p.signal})}catch(m){L.error("failed downloading language pack",m);return}if(!d||p.signal.aborted)return;s=Vg(d),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 xr([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 xf(this.localePacksUrls[s.code],{signal:n.signal}),l=await Ra(c);l&&i.push({language:{code:s.code,name:s.name},localePack:l})}}catch(c){L.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){L.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 xf(this.localePacksUrls[s.code],{signal:n.signal});c&&i.push({language:{code:s.code,name:s.name},localePack:c})}}catch(c){L.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,q)))a(this,q)[e]=null}};q=new WeakMap,Rd=new WeakSet,q4=function(e){var c;let i=(c=e==null?void 0:e.nodes)==null?void 0:c[0],o=this.getById("node",i);if(o==null)return;let n=Zr([o.coordinate.longitude,o.coordinate.latitude]),s=this.connectionSpaceIdsByLatLon[n];return s==null?void 0:s.map(l=>this.connectionsById[l]).find(l=>l!=null)},ds=new WeakMap,Do=new WeakMap,jn=new WeakMap;f();f();f();f();f();f();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var $4="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=";f();f();var J4=!1;function Q4(){J4=!0}function K4(){return J4}var Nd=class{constructor(t){u(this,"backgroundAlpha",1);u(this,"backgroundColor",new Qe);u(this,"width",0);u(this,"height",0);u(this,"options",{});u(this,"renderer");u(this,"enabledLayers",new Set([0,1]));u(this,"handleWebGLContextCreationError",t=>{var e,i;(i=(e=this.options).onWebGLContextCreationError)==null||i.call(e,t)});u(this,"handleWebGLContextLost",t=>{var e,i;(i=(e=this.options).onWebGLContextLost)==null||i.call(e,t)});u(this,"handleWebGLContextRestored",t=>{var e,i;(i=(e=this.options).onWebGLContextRestored)==null||i.call(e,t)});var e,i,o,n,s;try{this.options=t,K4()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Qe,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 I1({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 Qe((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(i=t.backgroundAlpha)!=null?i:1}catch(c){L.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){I.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}};f();f();var e5='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';f();f();f();f();f();function t5(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}f();function r5(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}f();function i5(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,p=r.y+r.h;return e<l&&s<o&&i<p&&c<n}f();function Li(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}f();var Ze=class{constructor(t,e,i,o,n){u(this,"x");u(this,"y");u(this,"w");u(this,"h");u(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:t5(this,t)}intersects(t){return i5(this,t)}intersectsPoint(t){return r5(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var Kr=class r{constructor(t,e){u(this,"topLeft");u(this,"topRight");u(this,"bottomLeft");u(this,"bottomRight");u(this,"divided",!1);u(this,"boundary");u(this,"capacity",16);u(this,"objects",[]);u(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 r(new Ze(t,e,i/2,o/2),this),this.topRight=new r(new Ze(t+i/2,e,i/2,o/2),this),this.bottomLeft=new r(new Ze(t,e+o/2,i/2,o/2),this),this.bottomRight=new r(new Ze(t+i/2,e+o/2,i/2,o/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(Li(e,this.topLeft.queryRect(t)),Li(e,this.topRight.queryRect(t)),Li(e,this.bottomLeft.queryRect(t)),Li(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(Li(e,this.topLeft.queryPoint(t)),Li(e,this.topRight.queryPoint(t)),Li(e,this.bottomLeft.queryPoint(t)),Li(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()}};f();function n5(r,t,e){let i,o,n,s=null,c=0;e||(e={});let l=function(){c=e.leading===!1?0:Date.now(),s=null,n=r.apply(i,o),s||(i=o=null)};return function(){let p=Date.now();!c&&e.leading===!1&&(c=p);let d=t-(p-c);return i=globalThis,o=arguments,d<=0||d>t?(s&&(clearTimeout(s),s=null),c=p,n=r.apply(i,o),s||(i=o=null)):!s&&e.trailing!==!1&&(s=setTimeout(l,d)),n}}var Un=!1,H9=150,Gd=class extends ee{constructor(e,i,o=new Worker(URL.createObjectURL(new Blob([e5],{type:"text/javascript"})))){super();u(this,"worker");u(this,"debugContext");u(this,"debugCanvas");u(this,"collidersDirty",!0);u(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);u(this,"visibleCollidersQTree",new Kr(new Ze(0,0,0,0)));u(this,"interactiveCollidersQTree",new Kr(new Ze(0,0,0,0)));u(this,"coreState");u(this,"postMessage");u(this,"showCollisionBoxes",()=>{Un=!0,this.debugCanvas.style.display="block"});u(this,"hideCollisionBoxes",()=>{Un=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});u(this,"currentMsgId","");u(this,"working",!1);u(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});u(this,"componentArray",[]);u(this,"update",(e,i,o="bottom-left",n=!1)=>{let s=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let l of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(l);p&&(c=p.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()});u(this,"resolve",e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,o=-1,n,s,c;Un&&(this.visibleCollidersQTree=new Kr(new Ze(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Kr(new Ze(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let p=this.componentArray[l];i[l]!=null&&(o=i[l][0],n=i[l][2],p.offscreen=i[l][1]===1,o!==-1&&n!=null?(c=new Ze(n.x,n.y,n.w,n.h,{entityId:p.id}),Un&&this.visibleCollidersQTree.insert(c),s=this.coreState.geometry2DMap.get(p.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new Ze(n.x,n.y,n.w,n.h,{entityId:p.id})),(p.canShow===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),o!==-1&&o!==p.currentStrategyIndex&&(p.activeBoundingBox=c,p.onStrategySelected(o))):((p.canShow===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),o!==-1&&o!==p.currentStrategyIndex&&p.onStrategySelected(o)))}Un&&this.drawDebug(),this.publish("visibility-changed")});u(this,"drawDebug",()=>{Un&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});u(this,"destroy",()=>{this.worker.terminate()});this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=o,this.worker.onmessage=n=>this.resolve(n),this.postMessage=n5(this._postMessage,H9,!1),Un?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}};f();f();f();f();var Vd=class{constructor(t){u(this,"type");u(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},jd=class{constructor(){u(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()}};f();function s5(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)}function l5(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}var fs,dc=class extends ee{constructor(e,i,o,n,s){super();u(this,"raycaster",new _r);u(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});u(this,"coreState");u(this,"camera");u(this,"worldPlane");u(this,"_quadtree",new Kr(new Ze(0,0,0,0)));u(this,"_container");u(this,"lastPointerEvent");u(this,"cursor","grab");u(this,"touchesCount",0);u(this,"isUserInteracting");u(this,"hasTouched",!1);x(this,fs);u(this,"onPointerMoveRaf",e=>{this.lastPointerEvent=e,a(this,fs)&&cancelAnimationFrame(a(this,fs)),P(this,fs,requestAnimationFrame(()=>{this.onPointerMove(e)}))});u(this,"onPointerMove",e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()});u(this,"tapsControl",new jd);u(this,"onPointerDown",e=>{e.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new Vd(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))});u(this,"clickTimeout");u(this,"onPointerUp",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())});u(this,"dirty3D",!0);u(this,"cachedHitBoxes",{entities:[],groups:[]});u(this,"ndcPoint",new K);u(this,"debugPanel");this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=e,this.coreState=i,this.worldPlane=n,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}getThreeDIntersectsFromXY(e){return this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(o=>{var n,s;return((n=o.object)==null?void 0:n.name)==="worldPlane"||((s=o.object)==null?void 0:s.visible)})}getGroupContainerIntersectsFromXY(e){this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0);let i=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(n=>n.object.visible),o;return i!=null&&i.length>0&&(o=s5(i)),o}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:o,entity2D:n,position:s,groupContainers:c}=this.intersect(i);(this.detect3DEntityHover(o)||this.detect2DEntityHover(n)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=n,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:s,groupContainers:c})),this.handleCursor()}handleCursor(){var s;let e=!!(this.state.hovered3DEntity&&((s=this.state.hovered3DEntity)!=null&&s.components[2])||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,n=Y9(e,o,i);this.cursor!==n&&(this.cursor=n,n==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),(e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path"||(e==null?void 0:e.type)==="custom-geometry"?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var v,S,M,w,T;let i=[e.offsetX,e.offsetY],o=this._quadtree.queryPoint(i),[n]=o.filter(D=>D.intersectsPoint(i)),s=this.coreState.containerOffset[0],c=this.coreState.containerOffset[1];this.ndcPoint.x=(e.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-s)/this._container.clientHeight)*2+1;let l=this.getThreeDIntersectsFromXY(this.ndcPoint),p=(v=l[0])==null?void 0:v.point,d=[],m=[];for(let D of l.filter(F=>F.object.name!=="worldPlane"))D.object instanceof oe&&D.object.material.depthTest===!1?d.push(D):m.push(D);let g=(M=(S=d[0])!=null?S:m[0])!=null?M:void 0,b,y;if(g!=null){if(b=z9(g.object,this.coreState.geometry3DMap),!b){let D=(w=g==null?void 0:g.instanceId)!=null?w:g==null?void 0:g.batchId;b=D!=null&&(g!=null&&g.object.userData.entities)?this.coreState.geometry3DMap.get(g==null?void 0:g.object.userData.entities[D]):this.coreState.geometry3DMap.get(g==null?void 0:g.object.userData.entityId)}b!=null&&b.components[2]&&(y=b)}let C=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((T=n==null?void 0:n.userData)==null?void 0:T.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(n==null?void 0:n.userData.entityId),entity3D:y,position:p,groupContainers:C}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&p5(this.state.lastHover,!1,this.coreState),e&&p5(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!l5(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var o,n,s;this.queueDebugMessage("CLICK \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var o,n,s;this.queueDebugMessage("HOVER \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var n;let o=document.createElement("pre");o.style.maxWidth="300px",o.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",o.style.backgroundColor=i,o.textContent=e,(n=this.debugPanel)==null||n.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};fs=new WeakMap;function p5(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)}function Y9(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}function Z9(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof Qi)return;if(t.userData.isSingleModel)return t;t=t.parent}}function z9(r,t){let e=Z9(r);return e?t.get(e.userData.entityId):void 0}f();f();var Hn,ei,Ud,Oo,u5,fc,Hd,d5,h5,mc,Wd,gc,yc,Xd,hc=class{constructor(t){x(this,Oo);x(this,Hn,null);x(this,ei);u(this,"getCurrentSceneGLTF",async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await _(this,Oo,u5).call(this),o=a(this,Ud).call(this,e),n=await i.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),s;if(n instanceof ArrayBuffer)s=new Blob([n],{type:"application/octet-stream"});else{let c=JSON.stringify(n,null,2);s=new Blob([c],{type:"text/plain"})}return s});x(this,Ud,t=>{let{scale:e,light:i,onlyVisible:o}=t,n=new Qi,s=new ut().setFromObject(a(this,ei).entityScene);if(a(this,fc).call(this,a(this,ei).entityScene,n,o),i){let c=new su(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});x(this,fc,(t,e,i)=>{t.material&&(t instanceof ou?_(this,Oo,d5).call(this,t).forEach(o=>e.add(o)):t instanceof tf&&e.add(_(this,Oo,h5).call(this,t))),t.children.forEach(o=>{(!i||o.visible)&&a(this,fc).call(this,o,e,i)})});x(this,Hd,(t,e,i)=>{let o=new b1({color:new Qe(t),metalness:0});return o.opacity=e,o.transparent=i,o});x(this,mc,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,p=e.attributes.normal,d=e.attributes.uv;return a(this,Wd).call(this,l,p),a(this,yc).call(this,o,c,n,s),d&&a(this,Xd).call(this,d),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=rn),t});x(this,Wd,(t,e)=>{let i=new z,o=new z;for(let n=0;n<t.count;n++)i.fromBufferAttribute(t,n),a(this,gc).call(this,i),t.setXYZ(n,i.x,i.y,i.z),e&&(o.fromBufferAttribute(e,n),a(this,gc).call(this,o),e.setXYZ(n,o.x,o.y,o.z))});x(this,gc,t=>{let e=t.y;t.y=t.z,t.z=-e});x(this,yc,(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 Ia)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)}});x(this,Xd,t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),o=t.getY(e);t.setXY(e,i,o)}});P(this,ei,t),a(this,ei).entityScene=t.entityScene,a(this,ei).geometry3DMap=t.geometry3DMap}destroy(){P(this,Hn,null)}};Hn=new WeakMap,ei=new WeakMap,Ud=new WeakMap,Oo=new WeakSet,u5=async function(){if(!a(this,Hn)){let{GLTFExporter:t}=await import("./GLTFExporter-KTOVIOEP.js");P(this,Hn,new t)}return a(this,Hn)},fc=new WeakMap,Hd=new WeakMap,d5=function(t){var s,c;let e=[],o=((s=t.userData)!=null&&s.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(l=>a(this,ei).geometry3DMap.get(l)),n=new Map;return o.forEach(l=>{var b;if(!l||!(l instanceof Oe))return;let p=l.components[1],d=l.components[2];if(!p.visible||p instanceof Gr&&p.opacity===0||p instanceof rl||p instanceof mu)return;let m=d!=null&&d.hover?p.hoverColor||a(this,ei).hoverColor:p.color,g="".concat(m,"-").concat(p.opacity,"-").concat(Number(p.visible));n.has(g)||n.set(g,[]),(b=n.get(g))==null||b.push(l)}),n.forEach((l,p)=>{let[d,m,g]=p.split("-"),b=l.reduce((S,M)=>{if(M.type==="custom-geometry")return S;let w=M.components[0];return"geometry"in w&&w.geometry instanceof d1&&S.push(w.geometry),S},[]),y=a(this,Hd).call(this,d,Number(m),t.material.transparent),C=Vr(b,!0),v=new oe(C,y);v.position.copy(t.position),v.rotation.copy(t.rotation),v.scale.copy(t.scale),v.visible=!!g,a(this,yc).call(this,v.position,v.scale,v.rotation,v.quaternion),e.push(a(this,mc).call(this,v))}),e},h5=function(t){let e=t.geometry.clone(),i=t.material,o=new bt({color:i.color,side:rn});o.opacity=i.opacity,o.transparent=i.transparent;let n=new tf(e,o);return n.position.copy(t.position),n.rotation.copy(t.rotation),n.scale.copy(t.scale),n.visible=t.visible,a(this,mc).call(this,n)},mc=new WeakMap,Wd=new WeakMap,gc=new WeakMap,yc=new WeakMap,Xd=new WeakMap;f();f();f();var ry=tu(I5());function P5(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}P5.prototype=Error.prototype;ry.default.Error=function(r){throw new P5(r)};var qe=ry.default;var j8="gray",U8=.1,Cc=100,iy=new qe.ClipperOffset;function H8(r,t){iy.Clear(),t/=2;let e=r.map(o=>({X:o.x*Cc,Y:o.y*Cc}));iy.AddPath(e,qe.JoinType.jtMiter,qe.EndType.etClosedPolygon);let i=new qe.Paths;return iy.Execute(i,t*Cc),i.length?i.map(n=>n.map(s=>({x:s.X/Cc,y:s.Y/Cc}))):[r]}function Jd(r,t,e){var g,b,y,C,v;let{color:i=j8,opacity:o=1,altitude:n=0,height:s=U8}=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}},p=r.geometry.coordinates[0].map(S=>{let M=t(S[1],S[0]);return c.min.x=Math.min(c.min.x,M.x),c.min.y=Math.min(c.min.y,M.y),c.max.x=Math.max(c.max.x,M.x),c.max.y=Math.max(c.max.y,M.y),M});((b=(g=r.properties)==null?void 0:g.style)==null?void 0:b.edgeOffset)!=null&&r.properties.style.edgeOffset!==0||((y=r.properties)==null?void 0:y.image)!=null?p=H8(p,((v=(C=r.properties)==null?void 0:C.style)==null?void 0:v.edgeOffset)||0):p=[p];let d=[];for(let S of p){let M=new kr;M.moveTo(S[0].x,S[0].y),S.slice(1).forEach(F=>M.lineTo(F.x,F.y)),M.lineTo(S[0].x,S[0].y);let w=r.geometry.coordinates.slice(1);M.holes=w.map(F=>{let O=F.map(k=>t(k[1],k[0])),B=new eo;return B.moveTo(O[0].x,O[0].y),O.slice(1).forEach(k=>B.lineTo(k.x,k.y)),B.lineTo(O[0].x,O[0].y),B});let T={bevelEnabled:!1,depth:s},D=new Br(M,T);D.userData={style:{color:i,opacity:o}},d.push(D)}if(d.length===1)return d[0];let m=Vr(d);return m.userData={style:{color:i,opacity:o},_split:!0},m}f();var W8="gray",X8=.1;function Qd(r,t,e){let{color:i=W8,opacity:o=1,altitude:n=0,height:s=X8}=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},p=[];r.geometry.coordinates.forEach(m=>{let g=new kr,b=m[0].map(v=>{let S=t(v[1],v[0]);return c.min.x=Math.min(c.min.x,S.x),c.min.y=Math.min(c.min.y,S.y),c.max.x=Math.max(c.max.x,S.x),c.max.y=Math.max(c.max.y,S.y),S});g.moveTo(b[0].x,b[0].y),b.slice(1).forEach(v=>g.lineTo(v.x,v.y)),g.lineTo(b[0].x,b[0].y);let y=m.slice(1);g.holes=y.map(v=>{let S=v.map(w=>t(w[1],w[0])),M=new eo;return M.moveTo(S[0].x,S[0].y),S.slice(1).forEach(w=>M.lineTo(w.x,w.y)),M.lineTo(S[0].x,S[0].y),M});let C=new Br(g,l);p.push(C)});let d=Vr(p);return d.translate(0,0,n||0),d.userData={style:{color:i,opacity:o}},d}f();var Y8="gray",oy=new qe.ClipperOffset,Tt=100;function M5(r,t,e){let{color:i=Y8,opacity:o=1,width:n=1,join:s="round",cap:c="round",height:l=.01,altitude:p=0}=e||{};Array.isArray(o)&&(o=0);let d=[];for(let C=0;C<r.geometry.coordinates.length-1;C++){let v=t(r.geometry.coordinates[C][1],r.geometry.coordinates[C][0]),S=t(r.geometry.coordinates[C+1][1],r.geometry.coordinates[C+1][0]);d.push([v,S])}oy.AddPaths(d.map(C=>C.map(v=>({X:v.x*Tt,Y:v.y*Tt}))),s==="round"?qe.JoinType.jsRound:s==="miter"?qe.JoinType.jsMiter:qe.JoinType.jsSquare,c==="round"?qe.EndType.etOpenRound:c==="butt"?qe.EndType.etOpenButt:qe.EndType.etOpenSquare);let m=new qe.PolyTree;oy.Execute(m,n/2*Tt);let g=[],b={bevelEnabled:!1,depth:l};for(let C of m.m_AllPolys){let v=new kr;if(C.IsHole())continue;let S=C.m_polygon;v.moveTo(S[0].X/Tt,S[0].Y/Tt),S.slice(1).forEach(M=>v.lineTo(M.X/Tt,M.Y/Tt)),v.lineTo(S[0].X/Tt,S[0].Y/Tt),v.holes=C.m_Childs.map(M=>{let w=new eo,T=M.m_polygon;return w.moveTo(T[0].X/Tt,T[0].Y/Tt),T.slice(1).forEach(D=>w.lineTo(D.X/Tt,D.Y/Tt)),w.lineTo(T[0].X/Tt,T[0].Y/Tt),w}),g.push(new Br(v,b))}let y=Vr(g);return y.translate(0,0,p||0),y.userData={style:{color:i,opacity:o}},oy.Clear(),y}f();var wt=100,Z8=.22,z8=.01;function T5(r,t,e={}){let{width:i=Z8,height:o=z8,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}},p={bevelEnabled:!1,depth:o},d=new qe.ClipperOffset,m=r.geometry.coordinates.map(C=>C.map(v=>t(v[1],v[0])));d.AddPaths(m.map(C=>C.map(v=>({X:v.x*wt,Y:v.y*wt}))),qe.JoinType.jsMiter,qe.EndType.etOpenRound);let g=new qe.PolyTree;d.Execute(g,i/2*wt);let b=[];for(let C of g.m_AllPolys){let v=new kr;if(C.IsHole())continue;l.min.x=Math.min(l.min.x,C.m_polygon[0].X),l.min.y=Math.min(l.min.y,C.m_polygon[0].Y),l.max.x=Math.max(l.max.x,C.m_polygon[0].X),l.max.y=Math.max(l.max.y,C.m_polygon[0].Y);let S=C.m_polygon;v.moveTo(S[0].X/wt,S[0].Y/wt),S.slice(1).forEach(M=>v.lineTo(M.X/wt,M.Y/wt)),v.lineTo(S[0].X/wt,S[0].Y/wt),v.holes=C.m_Childs.map(M=>{let w=new eo,T=M.m_polygon;return w.moveTo(T[0].X/wt,T[0].Y/wt),T.slice(1).forEach(D=>w.lineTo(D.X/wt,D.Y/wt)),w.lineTo(T[0].X/wt,T[0].Y/wt),w}),b.push(new Br(v,p))}let y=Vr(b);return y.translate(0,0,c||0),y.userData={style:{color:n,opacity:s}},d.Clear(),y}f();f();var ys=N.object({type:N.enum(["Point"]),coordinates:N.array(N.number()).min(2).max(3)});var q8=N.object({rotation:N.array(N.number()).length(3).optional(),altitude:N.number().optional(),scale:N.array(N.number()).length(3).optional(),interactive:N.boolean().optional(),verticalOffset:N.number().optional(),id:N.union([N.number(),N.string()]).optional()}),$8=N.object({type:N.enum(["Feature"]),geometry:ys,properties:q8}),J8=N.object({type:N.enum(["FeatureCollection"]),features:N.array($8)}),Q8=N.object({color:N.string()}),K8=N.object({url:N.string(),color:N.string().optional(),opacity:N.number().optional(),material:N.record(N.string(),Q8).optional()});function D5(r,t,e){N.union([N.number(),N.string()]).parse(r),J8.parse(t),K8.parse(e)}var Sc,xc,Fo=class{constructor(t){u(this,"mesh");u(this,"type","model");u(this,"positionDirty",!0);u(this,"outline");u(this,"geometry");u(this,"material");u(this,"feature");u(this,"instanceIndex",-1);u(this,"visible",!0);u(this,"color",new Qe);u(this,"position",new z);x(this,Sc,0);x(this,xc,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return a(this,Sc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Sc,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(ne.degToRad(t[0]),ne.degToRad(t[1]),ne.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return a(this,xc)}set opacity(t){var e,i,o;if(this.mesh){if(this.mesh.children[0]instanceof Ki){for(let n of this.mesh.children)if(n instanceof Ki){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let s=oo(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 oe&&n.material&&(Array.isArray(n.material)?n.material.forEach(s=>{w5(s,t)}):w5(n.material,t))});P(this,xc,t)}}};Sc=new WeakMap,xc=new WeakMap;function w5(r,t){r.opacity!==t&&(t===1?(r.opacity=1,r.transparent=!1):(r.opacity=t,r.transparent=!0),r.needsUpdate=!0)}f();function Kd(r){var c,l;let t=r.components[0],e=r.components[1];e.opacity!=null&&e.opacity!==t.opacity&&(t.opacity=e.opacity);let i=e.material,o=e.color;if(i||o){let p=eT(o,i);(c=t.mesh)==null||c.traverse(d=>{d instanceof oe&&d.material&&(Array.isArray(d.material)?d.material.forEach(m=>{p[m.name]?m.color.set(p[m.name].color):m.color.set(o)}):p[d.material.name]?d.material.color.set(p[d.material.name].color):d.material.color.set(o))})}let n=(l=t.feature.geometry.coordinates[2])!=null?l:0,s=e.verticalOffset+n;t.altitude!==s&&(t.altitude=s),e.visible!==t.visible&&(t.visible=e.visible),e.rotation&&t.setRotation(e.rotation),e.scale&&t.setScale(e.scale)}function eT(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}function E5(r,t){var s,c;let e=r.components[0],o=(s=r.components[1].verticalOffset)!=null?s:0,n=e.feature.geometry.coordinates.slice();n[2]=((c=n[2])!=null?c:0)+o,e.mesh?e.mesh.position.copy(t(n)):e.position.copy(t(n))}function tT(r){let{color:t,opacity:e,topColor:i,texture:o,topTexture:n}=r;return"".concat(t).concat(e).concat(i||"").concat(o||"").concat(n||"")}var rT=1e4,eh=class extends ee{constructor(e,i){super();u(this,"state");u(this,"convertTo3DMapPosition");u(this,"loader");u(this,"optimizePromise",[]);this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:e}=await import("./GLTFLoader-27GHL672.js");return this.loader=new e,this.loader}createEntityFromFeature(e,i,o){var c,l;let n=new vt(i),s=new Oe(n,new Gr({...o,url:(l=(c=i.properties)==null?void 0:c.image)==null?void 0:l.path}));return s.id=e,s}createModelFromFeature(e,i,o){let n=new Fo(i),s={...o};i.properties.verticalOffset!=null&&(s.verticalOffset=i.properties.verticalOffset),i.properties.rotation!=null&&(s.rotation=i.properties.rotation),i.properties.scale!=null&&(s.scale=i.properties.scale);let c=new mu(s),l=new Oe(n,c);return l.id=e,l}populateEntityMesh(e,i){let o=e.components[0];o.geometry=i,o.currentHeight=e.components[1].height,o.dirty=!1}async populateModelGroup(e,i,o){let n=new on,s=new Ia,c=new p1,l=new z,p=new io,d=await this.getGLTFLoader(),m=new Promise(g=>{d.load(i,b=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?b.scene.traverse(y=>{let C=y;if("isMesh"in C&&C.isMesh===!0){let v=new Ki(C.geometry,C.material,e.size);v.userData={entities:{}},p.add(v),o.add(p)}}):(b.scene.traverse(y=>{"isMesh"in y&&y.isMesh===!0&&(y.position.set(0,0,0),y.rotation.set(0,0,0),y.scale.set(1,1,1),y.updateMatrix())}),p.add(b.scene),o.add(p),p.userData.isSingleModel=!0,p.userData.entityId=e.values().next().value,p.userData.type="model")),g()})});return this.optimizePromise.push(m.then(()=>{var y,C,v,S,M,w,T,D,F,O,B,k;let g=0,b;for(let G of e.values()){if(b=this.state.geometry3DMap.get(G),!b||(b==null?void 0:b.type)!=="model")continue;let V=b.components[0],X=b.components[1],re=b.components[0].feature;V.mesh=p,V.instanceIndex=g,Kd(b),b.components[1].dirty=!1;let{x:U,y:ie}=this.convertTo3DMapPosition(re.geometry.coordinates[1],re.geometry.coordinates[0],0);V.position.set(U,ie,V.altitude),s.set(ne.degToRad((C=(y=X.rotation)==null?void 0:y[0])!=null?C:La[0]),ne.degToRad((S=(v=X.rotation)==null?void 0:v[1])!=null?S:La[1]),ne.degToRad((w=(M=X.rotation)==null?void 0:M[2])!=null?w:La[2])),l.set((D=(T=X.scale)==null?void 0:T[0])!=null?D:Oa[0],(O=(F=X.scale)==null?void 0:F[1])!=null?O:Oa[1],(k=(B=X.scale)==null?void 0:B[2])!=null?k:Oa[2]),c.setFromEuler(s),n.compose(V.position,c,l),p.children.forEach(Z=>{!b||(b==null?void 0:b.type)!=="model"||!(Z instanceof Ki)||(Z.setMatrixAt(g,n),Z.userData.entities[g]=b.id)}),V.mesh.userData.isSingleModel&&(V.mesh.matrix.copy(n),V.mesh.matrix.decompose(V.mesh.position,V.mesh.quaternion,V.mesh.scale)),g++}this.publish("model-loaded")})),p}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 vt&&(o=s.components[0].feature,n=s.components[1],o.geometry.type==="Polygon"?(i=Jd(o,this.convertTo3DMapPosition,n),(c=o.properties)!=null&&c.textures&&o.properties.textures.length>0&&I0(i,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(s,i)):o.geometry.type==="MultiPolygon"?(i=Qd(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="LineString"?(i=M5(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiLineString"&&(i=T5(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof dr||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){L.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 p=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let d=c.components[1];s++,s>=rT&&(s=0,n++);let m=tT(d)+n;o[m]===void 0&&(o[m]={style:d,entities:[]}),o[m].entities.push(c)}else p&&"mesh"in p&&p.mesh&&((i=p.mesh)==null?void 0:i.parent)!==e&&e.add(p.mesh)}for(let l in o){let p=S0(o[l].entities,o[l].style);e.add(p),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 p of c.entities2D.values())p&&(c.addEntity(p),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};f();var th=class{constructor(t,e){u(this,"state");u(this,"dirty",!0);u(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 ro&&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}}};f();var rh=class{constructor(t,e){u(this,"state");u(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 Oe&&(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}}};f();f();var iT=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}}}(),O5=({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}=iT(i);l.font=c;let p=[],d=r.split(" "),m=0,g=0,b=0;for(;g<d.length;){let S=d[g];if(m===o&&m>0){p[m-1]+="...";break}if(p[m]==null&&(p[m]=S,g++),d.length===1){p[m]=S;break}if(d[g]==null)break;let{width:M}=l.measureText(p[m]+" "+d[g]);M<=e*i?(p[m]+=" "+d[g],g++):m++}p.forEach(S=>{let{width:M}=l.measureText(S);b=Math.max(M,b)});let y=t*i*n,C=p.length*y;return{maxWidth:b,maxHeight:C,lines:p.length,draw:(S,M,w)=>{p.length===1?(s.strokeText&&S.strokeText(p[0],M,w),S.fillText(p[0],M,w)):(s.strokeText&&(S.strokeText(p[0],M,w-y/2),S.strokeText(p[1],M,w+y/2)),S.fillText(p[0],M,w-y/2),S.fillText(p[1],M,w+y/2))}}};f();function L5(r){let t=new Image;return r&&(/<svg[\s\S]*>/i.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}var oT=3.5,nT=2.5,aT=2,sT=5,Ic=2.5;var ih=class extends ee{constructor(e,i,o){super();u(this,"dirty",!1);u(this,"state");u(this,"colliderContext");u(this,"colliderCanvas");u(this,"transformRequestFunc");u(this,"transformRequest",async e=>this.transformRequestFunc?await this.transformRequestFunc(e):{url:e});u(this,"pinCache",{});u(this,"imageCache",{});u(this,"imagePromiseCache",{});u(this,"imageDimensionsCache",{});u(this,"textCache",{});u(this,"update",e=>{let i=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let o,n,s,c,l,p,d;for(let m of this.state.geometry2DIdsInScene)if(d=this.state.geometry2DMap.get(m),d!=null&&(p=d.components[0],p instanceof to&&!d.disposed)){if(l=p.appearance.marker.iconVisibleAtZoomLevel,p.appearance.marker.icon!=null&&l&&e>=l!==p.iconVisible&&(p.iconVisible=e>=l,p.dirty=!0),(p.dirty||this.dirty)&&p.calculateMarkerSize(),n=p.appearance.marker.foregroundColor,s=p.appearance.marker.backgroundColor,c=Ma(p.markerSize,2),o="".concat(n.active,"-").concat(n.inactive,"-").concat(s.active,"-").concat(s.inactive,"-").concat(c,"-").concat(p.iconVisible),p.labelCacheId=o,this.pinCache[o]||this.prepare(p,o,this.colliderContext),p.appearance.marker.icon&&(!p.imageHash||p.dirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.dirty||this.dirty){p.collisionDirty=!0,this.textCache[p.id]={};let{textDrawFn:g,width:b,height:y}=this.processText(p.text,p.appearance.text.size,p.appearance.text.maxWidth,p.appearance.text.numLines,p.appearance.text.lineHeight);["left","center","right"].forEach(v=>{this.textCache[p.id][v]=this.textToCanvas(g,p.appearance.text.size,v,b,y,p.appearance.text.foregroundColor,p.appearance.text.backgroundColor)}),p.dimensions={width:Math.ceil(b/i),height:Math.ceil(y/i)},p.currentStrategyIndex===-1&&(p.currentStrategyIndex=0);let C=p.strategies[p.currentStrategyIndex];if(C){C.onStrategySelected(p);let v=p.style;p.style=p.newStyle,p.newStyle=v}}p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,o,this.colliderContext),p.dirty=!1}this.dirty=!1});u(this,"processText",(e,i,o,n,s)=>{let c=this.state.pixelRatio,{draw:l,maxWidth:p,maxHeight:d}=O5({text:e,size:i,pixelRatio:c,maxWidth:o,maxLines:n,lineHeight:s});return{textDrawFn:l,width:p+Ic*c*2,height:d+Ic*c*2}});u(this,"textToCanvas",(e,i,o,n,s,c,l)=>{let p=this.state.pixelRatio,d,m=n,g=s;window.OffscreenCanvas!=null&&!H1()?d=new OffscreenCanvas(m,g):(d=document.createElement("canvas"),d.width=m,d.height=g,d.style.width=m+"px",d.style.height=g+"px");let b=d.getContext("2d",{willReadFrequently:!0});if(!b)return;b.textAlign=o,b.font="bold ".concat(i*p,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=Ic*p,b.fillStyle=c,b.strokeStyle=l;let y=o==="left"?0:o==="center"?m/2:m-Ic*p/2;return e(b,y,(g+Ic*p/2)/2),d});u(this,"cacheImage",e=>{if(!e.appearance.marker.icon)return;let i=z1(e.appearance.marker.icon);this.imagePromiseCache[i]||(this.imagePromiseCache[i]=new Promise(o=>{this.transformRequest(e.appearance.marker.icon).then(n=>{let s=L5(n.url);s.onload=()=>{this.imageCache[i]=s,this.publish("img:loaded"),o(s)}})})),e.imageHash!==i&&(e.imageHash=i,this.imagePromiseCache[i].then(()=>{e.dirty=!0}))});u(this,"createPinCanvas",(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 p=s.getContext("2d");return p.shadowColor="rgba(0,0,0,0.3)",p.shadowOffsetY=aT*c,p.shadowBlur=sT*c,p.beginPath(),p.arc(l/2,l/2,i/2+nT*c/2,0,2*Math.PI),p.fillStyle=o,p.fill(),p.beginPath(),p.arc(l/2,l/2,i/2,0,2*Math.PI),p.shadowColor="transparent",p.fillStyle=n,p.fill(),s});u(this,"prepare",(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:oT*n,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[i]=[s,c]});this.state=e,this.colliderCanvas=i,this.colliderContext=i.getContext("2d"),this.transformRequestFunc=o}draw(e,i,o){var p,d;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 m=this.imageCache[e.imageHash],g=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*n,b=e.appearance.marker.iconFit,y=g,C=g,v="".concat(e.imageHash,"_").concat(b);if(this.imageDimensionsCache[v])y=this.imageDimensionsCache[v].width,C=this.imageDimensionsCache[v].height;else{let S=m.width*n,M=m.height*n;if(b==="contain"){let w=Math.sqrt(S**2+M**2),T=g/w;y=S*T,C=M*T}if(b==="cover"){let w=g/S,T=g/M,D=Math.max(w,T);y=S*D,C=M*D}}o.save(),o.beginPath(),o.arc(s,c,g/2,0,2*Math.PI),o.closePath(),((d=(p=e==null?void 0:e.appearance)==null?void 0:p.marker)==null?void 0:d.iconOverflow)!=="visible"&&o.clip(),o.drawImage(m,s-y/2,c-C/2,y,C),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()}};f();f();var Zn=class Zn{constructor(){u(this,"loader");this.loader=new Pa}static getInstance(){return Zn.instance||(Zn.instance=new Zn),Zn.instance}getLoader(){return this.loader}load(t){return new Promise((e,i)=>{this.loader.load(t,e,void 0,i)})}};u(Zn,"instance");var ny=Zn,ko=ny.getInstance();function cT(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]}var zn,Pc,oh=class extends ee{constructor(e,i){super();x(this,zn);u(this,"state");u(this,"convertTo3DMapPosition");u(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=i,this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,o){var n;if(i.texture!==e.texture&&i.texture!==""&&_(this,zn,Pc).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&_(this,zn,Pc).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?_(this,zn,Pc).call(this,s.path,e,"topTexture"):s.face==="side"&&e.texture!==s.path&&_(this,zn,Pc).call(this,s.path,e,"texture"),e.blendTexture=!0;(e.texture!=null||e.topTexture!=null)&&(o!=null&&o.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var n,s,c,l,p,d,m,g;let e,i,o;for(let b of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(b),o instanceof dr&&o.type==="geometry-group"){let y=o.components[0];if(o.userData.shadingDirty){let C=o.userData.entities3D.values().next().value;if(C==null)continue;let v=this.state.geometry3DMap.get(C);v instanceof Oe&&(v.type==="geometry"||v.type==="custom-geometry")&&(e=v.components[0],o.userData.shadingDirty&&y.shading&&this.setShading(e,y.shading));let S,M;for(let w of o.userData.entities3D.values())S=this.state.geometry3DMap.get(w),M=S.components[0],S.type==="geometry"&&M.detached&&o.userData.shadingDirty&&y.shading&&this.setShading(M,y.shading);o.userData.shadingDirty=!1}if(y.dirty){let C=B1(o);C&&C.material instanceof m1&&(C.material.color.set(x0(y.color)),C.material.needsUpdate=!0);let v=o.getfirstChildEntityId();if(v){let M=this.state.geometry3DMap.get(v),w=M==null?void 0:M.components[0];w instanceof vt&&this.processTextures(w,y)}let S=y.opacity*uf(o);o.getOpacity()!==S&&o.setOpacity(S),y.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 y=o.components[0],C=o.components[1];i=o.components[2];let v=cT(o,this.state.hoverColor);if(y.setColor(v[0],v[1]),C.visible!==y.visible&&(y.visible=C.visible,y instanceof vt&&y.textMesh)){let M=this.state.geometry3DMap.get(y.textMesh.userData.entityId);(M==null?void 0:M.type)==="text3d"&&M.components[0].polygonEntityId!=null&&(M.components[0].visible=C.visible)}C.altitude!==y.altitude&&(y.altitude=C.altitude);let S=C.opacity*uf(o);S!==y.opacity&&(y.opacity=S),C.renderOrder!==y.renderOrder&&(y.renderOrder=C.renderOrder),C.dirty=!1,y instanceof vt&&this.processTextures(y,C,i),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(Kd(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(E5(o,this.convertTo3DMapPosition),o.components[0].positionDirty=!1);else if((o==null?void 0:o.type)==="image"&&((c=o.components[1])!=null&&c.dirty)){e=o.components[0];let y=o.components[1];y.visible!==e.visible&&(e.visible=y.visible),y.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((l=o.components[1])!=null&&l.dirty)&&o.components[0].polygonEntityId!=null){e=o.components[0];let y=o.components[1];y.visible!=null&&y.visible!==e.visible&&(e.visible=y.visible);let{textMesh:C}=e;if(C){Object.assign(C,y.getState());let v=(p=y.hoverColor)!=null?p:this.state.text3dHoverColor;C.color=y.hoverByPolygon?v:(d=y.color)!=null?d:Ea.color,C.outlineColor=y.hoverByPolygon?v:(m=y.outlineColor)!=null?m:Ea.outlineColor,C.strokeColor=y.hoverByPolygon?v:(g=y.strokeColor)!=null?g:Ea.strokeColor}y.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};zn=new WeakSet,Pc=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)=>{ko.getLoader().load(e,l=>{o==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{L.error("Failed to load texture: ".concat(e)),c("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,n)}};f();var nh=class extends ee{constructor(e){super();u(this,"state");u(this,"animating",new Map);u(this,"isAnimating",!1);u(this,"startTime",-1);u(this,"showDuration",300);u(this,"hideDuration",250);u(this,"update",()=>{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 to&&(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")});u(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=oo(c,0,1,o,n,n===0?q1:$1),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")}};f();var ah=class extends ee{constructor(e,i,o,n,s,c,l){super();u(this,"state");u(this,"renderer");u(this,"mode");u(this,"scene");u(this,"cameraObject");u(this,"viewCamera");u(this,"systems");u(this,"needs2DRecompute",!1);u(this,"twoDdirty",!0);u(this,"threeDdirty",!0);u(this,"frameId",null);u(this,"twoDFrameId",null);u(this,"animationFrameId",null);u(this,"nextFrame",null);u(this,"update",(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()})})});u(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});u(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});u(this,"updateEntities2D",()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})});u(this,"commitRenderState",()=>{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(),Y1(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(),X1(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let i=this.systems.meshOptimizationSystem.update();i&&e.push(i),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let o=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!o)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(e)}catch(e){L.error("Render failed: ",e)}});this.renderer=e,this.state=i,this.mode=o,this.scene=n,this.cameraObject=s,this.viewCamera=c,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};f();var pT=N.object({interactive:N.boolean().optional(),id:N.string().optional(),nearRadius:N.number().optional(),farRadius:N.number().optional(),accentColor:N.string().optional(),displayArrowsOnPath:N.boolean().optional(),animateArrowsOnPath:N.boolean().optional(),nearZoomLevel:N.number().optional(),farZoomLevel:N.number().optional()}),uT=N.object({type:N.enum(["Feature"]),geometry:ys,properties:N.object({parentId:N.any().optional()})});function A5(r,t){N.object({features:N.array(uT)}).parse(r),pT.parse(t)}var Mc,Bo=class{constructor(t,e){u(this,"type","path");u(this,"mesh",new io);u(this,"material");u(this,"geometry");u(this,"outline");u(this,"feature");u(this,"options");u(this,"nearRadius",.2);u(this,"farRadius",.4);u(this,"nearZoomLevel");u(this,"farZoomLevel");u(this,"nearZoomAltitude");u(this,"farZoomAltitude");u(this,"accentColor","blue");u(this,"completeFraction",1);u(this,"altitudeAdjustment",1);u(this,"displayArrowsOnPath",!1);u(this,"animateArrowsOnPath",!1);u(this,"isVertical",!1);u(this,"dirty",!0);u(this,"materialDirty",!0);u(this,"position",new z);x(this,Mc,0);var i,o,n,s,c;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(o=e==null?void 0:e.nearRadius)!=null?o:this.nearRadius,this.farRadius=(n=e==null?void 0:e.farRadius)!=null?n:this.farRadius,this.nearZoomLevel=e==null?void 0:e.nearZoomLevel,this.farZoomLevel=e==null?void 0:e.farZoomLevel,this.displayArrowsOnPath=(s=e==null?void 0:e.displayArrowsOnPath)!=null?s:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=e==null?void 0:e.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return a(this,Mc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,Mc,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Mc=new WeakMap;f();var sh=class{constructor(t){u(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 dr||o instanceof Ie)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));i.dirty=!1}}}};f();f();f();var Ae=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-Ae.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?Ae.Bounce.In(r*2)*.5:Ae.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}}}}),Tc=function(){return performance.now()},sy=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 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=Tc()),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}(),bs={Linear:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=bs.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=bs.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=bs.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=bs.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}}},F5=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),ay=new sy,Rt=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=Ae.Linear.None,this._interpolationFunction=bs.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=F5.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=ay,ay.add(this))}return 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=Tc()),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),p=l?"array":typeof c,d=!l&&Array.isArray(i[s]);if(!(p==="undefined"||p==="function")){if(d){var m=i[s];if(m.length===0)continue;for(var g=[c],b=0,y=m.length;b<y;b+=1){var C=this._handleRelativeValue(c,m[b]);if(isNaN(C)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(C)}d&&(i[s]=g)}if((p==="object"||l)&&c&&!d){e[s]=l?[]:{};var v=c;for(var S in v)e[s][S]=v[S];o[s]=l?[]:{};var m=i[s];if(!this._isDynamic){var M={};for(var S in m)M[S]=m[S];i[s]=m=M}this._setupProperties(v,e[s],m,o[s],n)}else(typeof e[s]>"u"||n)&&(e[s]=c),l||(e[s]*=1),d?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=Tc()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=Tc()),!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=Ae.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=bs.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=Tc()),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,p=function(){if(i._duration===0||s>l)return 1;var C=Math.trunc(s/c),v=s-C*c,S=Math.min(v/i._duration,1);return S===0&&s===i._duration?1:S},d=p(),m=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),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 b=0,y=this._chainedTweens.length;b<y;b++)this._chainedTweens[b].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]),p=Array.isArray(c),d=!l&&p;d?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 jU=F5.nextId,ti=ay,UU=ti.getAll.bind(ti),HU=ti.removeAll.bind(ti),WU=ti.add.bind(ti),XU=ti.remove.bind(ti),YU=ti.update.bind(ti);f();f();f();var k5=(r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,B5=(r,t)=>new K(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),ly=(r,t)=>Math.atan2(t.y-r.y,t.x-r.x),wc=(r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),cy=(r,t)=>new K((r.x+t.x)/2,(r.y+t.y)/2),py=r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t};var lh=class{constructor(t,e){u(this,"input1");u(this,"input2");u(this,"lastAngle");u(this,"lastDistance");u(this,"totalDistance");u(this,"first");u(this,"second");this.input1=t,this.input2=e,this.lastAngle=ly(t,e),this.lastDistance=wc(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=wc(t,e);this.input1=t,this.input2=e;let o=ly(t,e);this.lastAngle=o,this.lastDistance=i,this.totalDistance+=(wc(this.first,t)+wc(this.second,e))/2,this.first=cy(this.first,t),this.second=cy(this.second,e)}};f();var Dc=class{constructor(t,e,i){u(this,"touch");u(this,"camera");u(this,"cameraPlane");u(this,"viewCoordinate");u(this,"snapHolderMatrix");u(this,"snapCamera");u(this,"cameraPosition");u(this,"raycaster");u(this,"worldCoordinate");u(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 K(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new _r,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 K(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}};var cr={};dx(cr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>hT,CLIPPING_RADIUS:()=>Ec,CONTROL_OPTIONS:()=>dT,DEFAULT_ANIMATION_DURATION:()=>my,DEFAULT_BEARING:()=>bT,DEFAULT_MAX_ZOOM_LEVEL:()=>gT,DEFAULT_MIN_ZOOM_LEVEL:()=>gy,DEFAULT_PITCH:()=>yT,DEFAULT_ZOOM_LEVEL:()=>mT,EVENTS:()=>dh,MAPLIBRE_TILE_SIZE:()=>ch,MAX_LAT:()=>dy,MAX_MERCATOR_ZOOM_LEVEL:()=>uh,MIN_LAT:()=>uy,MIN_MERCATOR_ZOOM_LEVEL:()=>ph,ROOM_MERCATOR_ZOOM_LEVEL:()=>fT,TWO_PI:()=>hy,WHEEL_ZOOM_MULTIPLIER:()=>fy,ZRANGE:()=>vs});f();var ch=512,uy=-85.051129,dy=85.051129,Ec=1e4,dT={chain:"chain",cancel:"cancel"},hy=Math.PI*2,vs=100,fy=1e4,ph=0,uh=24,hT=17,fT=20,my=200,dh=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],mT=18,gy=12,gT=22,yT=0,bT=0;var hh=!1,vT=!1;var fh,qn=class extends ee{constructor(e,i,o,n,s){super();u(this,"dirty",!1);u(this,"zoomDirty",!1);u(this,"rotationDirty",!1);u(this,"panDirty",!1);x(this,fh,gy);u(this,"zoomSpeed",5);u(this,"rotateSpeed",100);u(this,"enabled",!0);u(this,"enableZoom",!0);u(this,"enablePan",!0);u(this,"enablePedestal",!1);u(this,"maxPedestal",1/0);u(this,"minPedestal",0);u(this,"enableRotate",!0);u(this,"minZoomAltitude",0);u(this,"maxZoomAltitude",1/0);u(this,"ignoreZoomLimits",!1);u(this,"zoomFactor",1);u(this,"panBounds",{min:new z(1/0,1/0),max:new z(-1/0,-1/0),center:new z(0,0,0),radius:1/0});u(this,"minTilt",0);u(this,"maxTilt",1.2);u(this,"MOUSE_BUTTONS",{ORBIT:ru.RIGHT,ZOOM:ru.MIDDLE,PAN:ru.LEFT});u(this,"camera");u(this,"scene");u(this,"renderer");u(this,"elevation");u(this,"orbit");u(this,"cameraPlane");u(this,"raycaster",new _r);u(this,"rendererState");u(this,"options");u(this,"state",-1);u(this,"intersection");u(this,"viewState",null);u(this,"tweens",new Map);u(this,"clock",new C1(!0));u(this,"coords",{mouse:new K,rotateStart:new K,rotateEnd:new K,rotateDelta:new K,panStart:new z,panCameraStart:new z,panEnd:new z,panDelta:new z,initialShiftPos:new K,initialPedestal:0,floorAnchor:new z});u(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});u(this,"scrollTimer",null);u(this,"lastWheelTime",0);u(this,"resetZoom",!1);u(this,"zoomStart");u(this,"pedestalScaleFactor",1);u(this,"isUserZooming",!1);u(this,"stayInsideBounds",!0);u(this,"userInteracting",!1);u(this,"cameraMoving",!1);u(this,"lastCameraMoveTime",Date.now());u(this,"raycastToFloor",e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new z});u(this,"isUserInteracting",()=>this.userInteracting);u(this,"getPosition",()=>new z(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));u(this,"getPedestal",()=>this.orbit.position.z);u(this,"pan",(e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))});u(this,"postRender",()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))});u(this,"isCameraMoving",()=>this.cameraMoving);u(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);u(this,"setPosition",(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)});u(this,"updateCameraPosition",(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});u(this,"tilt",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")});u(this,"zoomIn",(e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n/1.5},e,i,o)});u(this,"zoomOut",(e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n*1.5},e,i,o)});u(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));u(this,"cancelAnimation",()=>{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)});u(this,"animateCamera",(e,i,o,n,s,c)=>{let l={interruptible:!0,...c},p={},d={},m=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(p.x=m.x,d.x=e.position.x),e.position.y!==void 0&&(p.y=m.y,d.y=e.position.y),e.position.z!==void 0&&(p.z=m.z,d.z=e.position.z)),e.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.zoom=e.zoom:d.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:w,end:T}=pu(this.getRotation(),e.rotation);p.rotation=w,d.rotation=T}e.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.tilt=e.tilt:d.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==d.zoom,b=p.rotation!==d.rotation,y=p.tilt!==d.tilt,C=new Rt(p).to(d,I.env.TESTING?0:i).onUpdate(w=>{this.setMulti({x:w.x,y:w.y,z:w.z},w.zoom,w.rotation,w.tilt)}).onComplete(()=>{this.completeTween(C),this.publish("multi-end",{zooming:g,rotating:b,tilting:y}),n&&n()}).onStart(()=>{this.state!==7&&(this.state=7,C.state=7,this.publish("multi-start",{zooming:g,rotating:b,tilting:y})),this.publish("change")});this.rendererState.tweenGroup.add(C);let v=Array.from(this.tweens.entries()),S=v[v.length-1],M=!1;return S!=null&&(S[1].interruptible?(typeof S[1].cancelledCallback=="function"&&S[1].cancelledCallback(),this.completeTween(S[0])):(M=!0,S[0].chain(C))),this.tweens.set(C,{cancelledCallback:s,interruptible:l.interruptible}),o?C.easing(o):C.easing(Ae.Quadratic.In),!e.doNotAutoStart&&!M&&(C.start(),this.publish("change")),C.cameraAnimation=!0,C});u(this,"setMulti",(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 p=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;p!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Ec&&(this.camera.near=i-Ec,this.camera.far=i+Ec):(this.camera.near=i/vs,this.camera.far=i*vs),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 p=this.stayInsideBounds?Math.max(Math.min(n,this.maxTilt),this.minTilt):n;p!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}s&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)});u(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);u(this,"getZoomScaledMax",()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)});u(this,"setRotation",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=-(e%hy);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});u(this,"setZoomAltitude",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/vs,this.camera.far=i*vs,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});u(this,"setZoomLevel",e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))});u(this,"getZoomAltitude",()=>this.camera.position.z);u(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));u(this,"setTilt",(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});u(this,"getTilt",()=>this.elevation.rotation.x);u(this,"setCameraPlaneElevation",e=>{this.cameraPlane.position.z=e});u(this,"zoom",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")});u(this,"getProjectionScaleFactor",(e,i,o)=>pf(e,i,o));u(this,"update",()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});u(this,"setPedestal",(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)});u(this,"dispose",()=>{for(let e of dh)e.endsWith("start")?(this.off(e,this.setCameraMoving),e.startsWith("user")&&this.off(e,this.setUserInteracting)):(e.endsWith("end")||e.endsWith("cancel"))&&(this.off(e,this.unsetCameraMoving),e.startsWith("user")&&this.off(e,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)});u(this,"createCameraPlane",()=>{let e=hh?2e3:1e10,i=hh?100:1,o=new fi(e,e,i,i),n=new bt({color:0,wireframe:hh,visible:hh}),s=new oe(o,n);return this.scene.add(s),s});u(this,"addEventListeners",()=>{let{domElement:e}=this.renderer;for(let i of dh)i.endsWith("start")?(this.on(i,this.setCameraMoving),i.startsWith("user")&&this.on(i,this.setUserInteracting)):(i.endsWith("end")||i.endsWith("cancel"))&&(this.on(i,this.unsetCameraMoving),i.startsWith("user")&&this.on(i,this.unsetUserInteracting));e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)});u(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});u(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeEventListeners",()=>{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)});u(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"onContextMenu",e=>{e.preventDefault()});u(this,"onMouseUp",()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}});u(this,"onMouseMove",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)});u(this,"onTouchStart",e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new lh(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});u(this,"onTouchMove",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 K(this.touch.touches[0].x,this.touch.touches[0].y),s=new K(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}});u(this,"onTouchEnd",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}});u(this,"handleTouchMovePan",e=>{let i=Object.hasOwn(e,"x")?new K(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panEnd.set(o.x,o.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});u(this,"handleTouchStartDolly",()=>{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 K(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 Dc(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Dc(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")});u(this,"handleMouseMovePan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});u(this,"handleTouchStartTilt",e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});u(this,"handleTouchMovePedestal",e=>{this.handleMouseMovePedestal(e.touches[0])});u(this,"handleTouchMoveTilt",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)});u(this,"handleTouchMoveDolly",()=>{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)});u(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});u(this,"handleTouchStartPan",e=>{let i=Object.hasOwn(e,"x")?new K(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")});u(this,"handleTouchStartPedestal",e=>{this.handleMouseDownPedestal(e.touches[0])});u(this,"onMouseDown",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()}});u(this,"onMouseWheel",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))});u(this,"handleMouseWheel",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-py(e)*i/fy*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")});u(this,"setCameraFromTransformMatrix",e=>{this.orbit.updateMatrixWorld();let i=new Ia;i.setFromRotationMatrix(e,"ZYX");let o=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),n=i.z,s=new z(0,0,1);s.applyEuler(i),s.setLength(o);let c=new z;c.setFromMatrixPosition(e),c.sub(s),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-n)});u(this,"makeTransformFromTouchAnchors",(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 p=e.viewCoordinate,d=i.viewCoordinate,m=s.x-n.x,g=s.y-n.y,b=Math.atan2(g,m),y=l.x-c.x,C=l.y-c.y,v=Math.atan2(C,y),S=k5(b,v),M=new on;M.makeRotationZ(-S);let w=M.clone();w.multiply(e.snapHolderMatrix);let T=(cx,px,ux)=>cx.elements[(px-1)*4+ux-1],D=T(o,1,1)*T(w,1,1)-p.x*T(o,3,4)*T(w,3,1),F=T(o,1,1)*T(w,1,2)-p.x*T(o,3,4)*T(w,3,2),O=T(o,1,1)*T(w,1,3)-p.x*T(o,3,4)*T(w,3,3),B=n.x*D+n.y*F+n.z*O,k=T(o,2,2)*T(w,2,1)-p.y*T(o,3,4)*T(w,3,1),G=T(o,2,2)*T(w,2,2)-p.y*T(o,3,4)*T(w,3,2),V=T(o,2,2)*T(w,2,3)-p.y*T(o,3,4)*T(w,3,3),X=n.x*k+n.y*G+n.z*V,re=T(o,1,1)*T(w,1,1)-d.x*T(o,3,4)*T(w,3,1),U=T(o,1,1)*T(w,1,2)-d.x*T(o,3,4)*T(w,3,2),ie=T(o,1,1)*T(w,1,3)-d.x*T(o,3,4)*T(w,3,3),Z=s.x*re+s.y*U+s.z*ie,we=T(o,2,2)*T(w,2,1)-d.y*T(o,3,4)*T(w,3,1),ue=T(o,2,2)*T(w,2,2)-d.y*T(o,3,4)*T(w,3,2),ge=T(o,2,2)*T(w,2,3)-d.y*T(o,3,4)*T(w,3,3),xe=s.x*we+s.y*ue+s.z*ge,pr=Math.abs(re-D),At=Math.abs(U-F),ct=Math.abs(ie-O),it=Math.abs(re-k),di=Math.abs(U-G),$i=Math.abs(ie-V),ae=Math.abs(we-D),de=Math.abs(ue-F),Ve=Math.abs(ge-O),pt=Math.abs(we-k),ur=Math.abs(ue-G),Ji=Math.abs(ge-V),tn=Math.min(pr+At+ct,it+di+$i),xa=Math.min(ae+de+Ve,pt+ur+Ji);tn<xa&&(re=we,U=ue,ie=ge,Z=xe);let $t=k*O-D*V,qs=G*O-F*V,Qy=X*O-B*V,Jh=re*V-k*ie,Qh=U*V-G*ie,Ky=Z*V-X*ie,ox=(Ky*qs-Qy*Qh)/(Jh*qs-$t*Qh),nx=(Ky*$t-Qy*Jh)/(Qh*$t-qs*Jh),e1=G*D-F*k,ax=V*D-O*k,sx=X*D-B*k,t1=U*k-G*re,lx=ie*k-V*re,r1=((Z*k-X*re)*e1-sx*t1)/(lx*e1-ax*t1),eu=w.clone();return eu.elements[12]=ox,eu.elements[13]=nx,eu.elements[14]=r1,r1>0?eu:null});u(this,"updateTouchOrigin",()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top});u(this,"touchToScene",e=>{this.touch.touches=[];for(let i=0,o=e.touches.length;i<o;i++){let n=e.touches[i],s=B5(n,this.touch.origin);this.touch.touches.push(new K(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]});u(this,"canScrollZoom",e=>{let i=py(e),o=this.getZoomAltitude();return!(i<0&&o===this.getZoomScaledMax()||i>0&&o===this.getZoomScaledMin())});u(this,"mouseToScene",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});u(this,"getMousePos",e=>({x:e.offsetX,y:e.offsetY}));u(this,"handleMouseDownRotate",e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});u(this,"handleMouseDownPan",()=>{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")});u(this,"handleMouseDownPedestal",e=>{let i=new K(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=pf(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});u(this,"handleMouseMovePedestal",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)});u(this,"handleMouseMoveRotate",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")});u(this,"publishUserZoomDebounced",Da(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));u(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});u(this,"setCameraMoving",()=>{this.cameraMoving=!0});u(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});u(this,"setUserInteracting",()=>{this.userInteracting=!0});u(this,"unsetUserInteracting",()=>{this.userInteracting=!1});u(this,"publishPedestalChangeEvent",e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});u(this,"convertAltitudeToZoomLevel",e=>{let[,i]=this.center,n=e*2*Math.tan(ne.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(ne.degToRad(i))*2*Math.PI*Kh/n;return ne.clamp(Math.log2(s/512),ph,uh)});u(this,"convertZoomLevelToAltitude",e=>{let[,i]=this.center,o=ne.clamp(e,ph,uh),n=Math.pow(2,o),s=ne.clamp(i,uy,dy),c=n*512;return Math.cos(ne.degToRad(s))*Math.PI*2*Kh/c*this.options.canvasHeight/2/Math.tan(ne.degToRad(this.camera.fov)/2)});u(this,"completeTween",e=>{e.isPlaying()&&e.stop(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)});u(this,"debugContainer",new nn);this.camera=e,this.renderer=o,this.rendererState=n,this.scene=i,this.options=s,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,s.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return a(this,fh)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,i),o=Math.max(o,e),(o-e)/(i-e)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var n,s,c,l;let e=this.getPosition(),{lat:i,lon:o}=du((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,p;let{x:o,y:n}=hu((c=(s=this.rendererState.center)==null?void 0:s[1])!=null?c:0,(p=(l=this.rendererState.center)==null?void 0:l[0])!=null?p: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(),p=this.getTilt(),d=this.getPosition();this.setRotation(i.rotation||l,!0),this.setTilt(i.tilt||p,!0);let m=_5(e,{canvasWidth:s,canvasHeight:c,paddingOption:i.padding,verticalPadding:i.verticalPadding,minZoom:o,maxZoom:n,position:d,camera:this.camera,orbit:this.orbit});return this.setRotation(l,!0),this.setTilt(p,!0),{center:m.position,zoomLevel:this.convertAltitudeToZoomLevel(m.zoom)}}focusOn(e,i){if(vT){this.debugContainer&&Re(this.debugContainer);let v=new hi(4,4,4),S=new bt({color:65280,depthTest:!1}),M=new Ki(v,S,e.length),w=new on;e.forEach((T,D)=>{w.setPosition(T),M.setMatrixAt(D,w)}),M.instanceMatrix.needsUpdate=!0,this.debugContainer.add(M),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,p=this.options.canvasWidth,d=this.options.canvasHeight,m;i.duration!==void 0?m=i.duration:I.env.TESTING==="true"?m=0:m=my;let g=i.padding,b=this.getRotation(),y=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let C=_5(e,{canvasHeight:d,paddingOption:g,canvasWidth:p,minZoom:c,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:i.verticalPadding});this.setRotation(b),this.setTilt(y),this.animateCamera({position:C.position,tilt:i.tilt,rotation:i.rotation,zoom:C.zoom},m,o,n,s,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};fh=new WeakMap,u(qn,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function _5(r,{canvasWidth:t,orbit:e,paddingOption:i,verticalPadding:o=0,canvasHeight:n,minZoom:s,maxZoom:c,camera:l,position:p}){let d={zoom:s,position:p};if(r.length===0)return d;for(let $t of qn.CAMERA_FRAME_PADDING_SIDES)typeof i[$t]!="number"&&(i[$t]=0);let m=i.type==="portion"?{top:i.top*n,bottom:i.bottom*n,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(m.left+m.right>=t||m.top+m.bottom>=n)return d;e.updateMatrixWorld();let g=l.matrixWorldInverse,b=l.fov*(Math.PI/180)/2,y=b,v=Math.atan(Math.tan(b)*(t/n)),S=new z(1/0,1/0,1/0),M=new z(-1/0,-1/0,-1/0),w=new ut,T=new z;for(let $t=0,qs=r.length;$t<qs;$t++)T.copy(r[$t]),w.expandByPoint(T),T.applyMatrix4(g),S.min(T),M.max(T),T.copy(r[$t]),T.z-=o,T.applyMatrix4(g),S.min(T),M.max(T),T.copy(r[$t]),T.z+=o,T.applyMatrix4(g),S.min(T),M.max(T);let D=M.x-S.x,F=M.y-S.y,O=t-m.left-m.right,B=n-m.top-m.bottom,k=(M.x+S.x)/2,G=(M.y+S.y)/2,V=D/O,X=F/B,re=s,U=c,ie=re*Math.tan(v)*2,Z=U*Math.tan(v)*2,we=ie/t,ue=Z/t,ge=Math.max(V,X);ge=ne.clamp(ge,we,ue);let xe=O*ge,pr=B*ge,At={min:{x:k-xe/2-m.left*ge,y:G-pr/2-m.bottom*ge},max:{x:k+xe/2+m.right*ge,y:G+pr/2+m.top*ge}},ct=(At.min.x+At.max.x)/2,it=(At.min.y+At.max.y)/2,di=w.getCenter(new z),$i=Math.abs(ct-At.min.x),ae=Math.abs(it-At.min.y),de=$i/Math.tan(v),Ve=ae/Math.tan(y),pt=new z;pt.set(ct,it,M.z+Math.max(de,Ve)),pt.applyMatrix4(l.matrixWorld);let ur=new z;ur.set(ct,it,M.z),ur.applyMatrix4(l.matrixWorld);let Ji=new z().subVectors(ur,pt),tn=(di.z-pt.z)/Ji.z,xa=new z().copy(pt).add(Ji.clone().multiplyScalar(tn));return ur.set(xa.x,xa.y,xa.z),pt.sub(ur),{position:xa,zoom:pt.length()}}f();var CT=300,Oc,Lc,mh=class{constructor(t){u(this,"state");x(this,Oc,new z);x(this,Lc,new z);this.state=t}update(t){var o;let e,i;this.state.cameraObject.getWorldPosition(a(this,Lc));for(let n of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if(i.visibilityNeedsUpdate!==!1&&(i.visibilityNeedsUpdate==="show"?i.canShow=!0:i.canShow=!1),(i.canShow&&i.visible===!0||((o=i.animation)==null?void 0:o.pending)===!0)&&!i.offscreen)if(i.options.zIndex!=null)i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.options.zIndex,"px)");else{e.object3d.getWorldPosition(a(this,Oc));let s=a(this,Lc).distanceTo(a(this,Oc));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-s,"px)")}if(i.canShow===!0&&i.visible===!0?i.containerEl.style.pointerEvents=t?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.currentStrategyIndex===-1&&i.visible&&i.visibilityNeedsUpdate==="show")continue;i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.visibilityNeedsUpdate==="show"&&(i.containerEl.style.opacity="0"),i.animation&&i.animation.cancel(),i.animation=i.containerEl.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:CT,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};Oc=new WeakMap,Lc=new WeakMap;f();var gh=class{constructor(){u(this,"percentExpanded",0);u(this,"activeId","");u(this,"gap",20);u(this,"dirty",!0)}};f();var yh=class extends ee{constructor(e,i){super();u(this,"state");u(this,"dirty",!0);u(this,"domTree");u(this,"observers",new Map);u(this,"updateDimensions",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 ro&&o.firstElementChild&&(s.components[0].updateDimensions(),s.components[0].collisionDirty=!0)}}),this.publish("dimensions-update")});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()}};f();var ST=0,xT=90,IT=(I.env.NODE_ENV==="test",!1);function Ai(r,t,e,i){return(r<t||r>e)&&L.warn(i),Math.min(e,Math.max(t,r))}var Cs={linear:Ae.Linear.None,"ease-in":Ae.Quadratic.In,"ease-out":Ae.Quadratic.Out,"ease-in-out":Ae.Quadratic.InOut},PT=-50,W,Q,_o,Ac,Fc,by,bh=class{constructor(t,e,i){x(this,Fc);x(this,W);x(this,Q);x(this,_o);x(this,Ac);P(this,W,t),P(this,Q,e),P(this,_o,i),a(this,Q).cameraSystem.on("pedestal-change",({pedestal:o})=>{a(this,W).map&&(a(this,W).map.transform.elevation=o,a(this,W).map.transform.minElevationForCurrentTile=PT,a(this,W).map.triggerRepaint()),a(this,Q).cameraSystem.setCameraPlaneElevation(o)})}get center(){return a(this,W).mode==="outdoors-overlay"&&a(this,W).map?a(this,W).map.getCenter().toArray():a(this,Q).cameraSystem.center}setCenter(t){var e;if(a(this,W).mode==="outdoors-overlay"&&a(this,W).map){(e=a(this,W).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,W).mode==="outdoors-overlay"&&a(this,W).map?(t=a(this,W).map)==null?void 0:t.getZoom():a(this,Q).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;a(this,W).mode==="outdoors-overlay"&&a(this,W).map&&((e=a(this,W).map)==null||e.setZoom(t)),a(this,Q).cameraSystem.setZoomLevel(Ai(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=Ai(t,cr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(cr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));a(this,Q).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(o=a(this,W).map)==null||o.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=Ai(t,this.minZoomLevel,cr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(cr.MAX_MERCATOR_ZOOM_LEVEL,"."));a(this,Q).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=a(this,W).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return a(this,W).mode==="outdoors-overlay"&&a(this,W).map?(t=a(this,W).map)==null?void 0:t.getMaxPitch():ne.radToDeg(a(this,Q).cameraSystem.maxTilt)}get minPitch(){var t;return a(this,W).mode==="outdoors-overlay"&&a(this,W).map?(t=a(this,W).map)==null?void 0:t.getMinPitch():ne.radToDeg(a(this,Q).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(ST,t);(i=a(this,W).map)==null||i.setMinPitch(e),a(this,Q).cameraSystem.minTilt=ne.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(xT,t);(i=a(this,W).map)==null||i.setMaxPitch(e),a(this,Q).cameraSystem.maxTilt=ne.degToRad(e)}get bearing(){var t;return a(this,W).mode==="outdoors-overlay"&&a(this,W).map?(t=a(this,W).map)==null?void 0:t.getBearing():ne.radToDeg(a(this,Q).cameraSystem.getRotation())}setBearing(t){var e;if(a(this,W).mode==="outdoors-overlay"&&a(this,W).map){(e=a(this,W).map)==null||e.setBearing(t);return}a(this,Q).cameraSystem.setRotation(ne.degToRad(t))}get pitch(){var t;return a(this,W).mode==="outdoors-overlay"&&a(this,W).map?(t=a(this,W).map)==null?void 0:t.getPitch():ne.radToDeg(a(this,Q).cameraSystem.getTilt())}setPitch(t){var e;if(a(this,W).mode==="outdoors-overlay"&&a(this,W).map){(e=a(this,W).map)==null||e.setPitch(t);return}a(this,Q).cameraSystem.setTilt(ne.degToRad(Ai(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,Ac)&&a(this,Ac).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,Cs[(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,_o).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,_o).insetsPadding=Object.assign({},Ks,t)}animateTo(t){var s,c,l,p,d,m;if(a(this,W).mode==="outdoors-overlay"&&a(this,W).map)return(m=a(this,W).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:(p=t.pitch)!=null?p:this.pitch,duration:(d=t.duration)!=null?d:600}),Promise.resolve();let e=t.center?a(this,W).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?a(this,Q).cameraSystem.convertZoomLevelToAltitude(Ai(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?ne.degToRad(t.bearing):void 0,n=t.pitch!==void 0?ne.degToRad(Ai(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 b;a(this,Q).cameraSystem.animateCamera({position:e,zoom:i,rotation:o,tilt:n},t.duration||0,Cs[t.easing||"ease-in-out"],()=>{a(this,Q).interactionSystem.handleHover(),g()},g,{interruptible:(b=t==null?void 0:t.interruptible)!=null?b:!0})})}getCameraFrameForCoordinates(t,e){let i=_(this,Fc,by).call(this,e||{},()=>Promise.resolve()),{pointCloud:o}=R5(t,a(this,W),a(this,_o).geometry3DMap);if(o.length===0)return L.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:n,zoomLevel:s}=a(this,Q).cameraSystem.getCameraFrameForCoordinates(o,i);return{center:a(this,W).convert3DMapPositionToCoordinate(n),zoomLevel:s}}focusOn(t,e){var s,c,l,p;let{pointCloud:i,geoBounds:o,firstPosition:n}=R5(t,a(this,W),a(this,_o).geometry3DMap);return i.length===0?(L.error("No valid coordinates found in targets:",t),Promise.resolve()):a(this,W).mode==="outdoors-overlay"&&a(this,W).map?(i.length===1&&n?(s=a(this,W).map)==null||s.flyTo({center:[n[0],n[1]],duration:(e==null?void 0:e.duration)||a(this,W).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?a(this,W).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,W).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||a(this,W).map.getMaxZoom()}):(IT&&MT(a(this,W),o),(p=a(this,W).map)==null||p.fitBounds(o,{duration:(c=e==null?void 0:e.duration)!=null?c:cr.DEFAULT_ANIMATION_DURATION,bearing:(e==null?void 0:e.bearing)===void 0?a(this,W).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,W).map.getPitch():e==null?void 0:e.pitch,maxZoom:(l=e==null?void 0:e.maxZoomLevel)!=null?l:a(this,W).map.getMaxZoom()})),a(this,Q).interactionSystem.handleHover(),Promise.resolve()):new Promise(d=>{a(this,Q).cameraSystem.focusOn(i,_(this,Fc,by).call(this,e||{},d))})}};W=new WeakMap,Q=new WeakMap,_o=new WeakMap,Ac=new WeakMap,Fc=new WeakSet,by=function(t,e){var i;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:a(this,Q).cameraSystem.convertZoomLevelToAltitude(Ai(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(Ai(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({},Ks,t==null?void 0:t.padding):this.insetsPadding,curve:Cs[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ne.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ne.degToRad(Ai(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,verticalPadding:t==null?void 0:t.verticalPadding}};function yy(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}function R5(r,t,e){var c;let i=[],o=[1/0,1/0,-1/0,-1/0],n=null;if(!r||!Array.isArray(r)||r.length===0)return{pointCloud:i,geoBounds:o,firstPosition:n};let s=t.getSystems().renderSystem;(s.threeDdirty||s.twoDdirty)&&t.renderSync();for(let l of r)if(typeof l=="string"){let p=e.get(l);if(!p){L.error("Entity not found with id:",l);continue}let d=new ut;U1(t,"userData"in p&&(c=p.userData.entityId)!=null?c:p.id,i,d,p instanceof Ie?p.position.z:void 0);let m=t.convert3DMapPositionToCoordinate(d.min),g=t.convert3DMapPositionToCoordinate(d.max);yy(o,m),yy(o,g),n||(n=t.convert3DMapPositionToCoordinate(d.getCenter(new z)))}else i.push(t.convertTo3DMapPosition(l[1],l[0],l[2]||0)),yy(o,l),n||(n=l);return{pointCloud:i,geoBounds:o,firstPosition:n}}function MT(r,t){var i,o,n,s;let e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(i=r.map)!=null&&i.getLayer("bounds-outline")&&r.map.removeLayer("bounds-outline"),(o=r.map)!=null&&o.getSource("bounds-source")&&r.map.removeSource("bounds-source"),(n=r.map)==null||n.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}}),(s=r.map)==null||s.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}f();var N5="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 G5="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}";f();var V5=4.291666666666667,j5=15,U5=25,H5=43/60;f();var W5=["horizontal","icon"],DT=new Map([[W5[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>'],[W5[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>']]),ET=/<svg([^>]*)>/g;function X5(r,t,e,i){let o=DT.get(r);return o?o.replace(ET,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var Y5=!1,Ce,Fi,Ss,gt,Dt,$n,Ir,ri,vh=class extends ee{constructor(e,i,o){super();x(this,Ce,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},interactive:!0,visible:!0});x(this,Fi);x(this,Ss);x(this,gt);x(this,Dt);x(this,$n);x(this,Ir,0);x(this,ri,0);u(this,"dirty",!0);u(this,"getPositionAlignedCanvasCoordinates",(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,Ce).position]);u(this,"getPositionAlignedPadding",()=>{var o,n,s,c;let e=a(this,Ce).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,Ce).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}});o&&Object.entries(o).forEach(([n,s])=>{s!==void 0&&(a(this,Ce)[n]=s)}),P(this,Ss,e),P(this,Fi,i)}get color(){return a(this,Ce).color==="light"?"white":"#293136"}get iconName(){return a(this,Ce).iconOnly?"icon":"horizontal"}get minWidth(){return a(this,Ce).iconOnly?j5:75}get defaultWidth(){return a(this,Ce).iconOnly?U5:150}get aspectRatio(){return a(this,Ce).iconOnly?H5:V5}get options(){return{...a(this,Ce)}}set options(e){var i;P(this,Ce,{padding:e.padding||a(this,Ce).padding,position:e.position||a(this,Ce).position,iconOnly:e.iconOnly||a(this,Ce).iconOnly,color:e.color||a(this,Ce).color,scale:e.scale||a(this,Ce).scale,onClick:a(this,Ce).onClick,interactive:(i=e.interactive)!=null?i:a(this,Ce).interactive,visible:e.visible||a(this,Ce).visible})}get icon(){return X5(this.iconName,this.color,a(this,Ir)*a(this,Fi).pixelRatio,a(this,ri)*a(this,Fi).pixelRatio)}setSize(e,i){a(this,Dt)&&(a(this,Dt).uniforms.uSize.value.x=e,a(this,Dt).uniforms.uSize.value.y=i)}setXY(e,i){a(this,Dt)&&(a(this,Dt).uniforms.uSize.value.w=e,a(this,Dt).uniforms.uSize.value.z=i)}get width(){return a(this,Ir)}get height(){return a(this,ri)}getPositionAlignedOffset(e,i){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-e,y:-i},center:{x:-(e/2),y:-(i/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-e,y:-(i/2)}}[a(this,Ce).position]}insertIntoQuadTree(e){a(this,$n)!=null&&typeof a(this,Ce).onClick=="function"&&a(this,Ce).interactive&&e.insert(a(this,$n))}resize(e,i){if(a(this,Ce).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(e,i),n=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(a(this,Ir),a(this,ri)),c=Math.min(e-a(this,Ir),Math.max(0,o.x+n.x+s.x)),l=Math.min(i-a(this,ri),Math.max(0,o.y+n.y+s.y));this.setSize(a(this,Ir)/e,a(this,ri)/i),this.setXY(c/e,l/i),P(this,$n,new Ze(c,l,a(this,Ir),a(this,ri),{entityId:"watermark"}))}update(){this.dirty&&a(this,Ce).visible===!0&&(P(this,Ir,Math.min(a(this,Fi).canvasWidth,Math.max(this.minWidth,this.defaultWidth*a(this,Ce).scale))),P(this,ri,a(this,Ir)/this.aspectRatio),ko.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(P(this,Dt,new sn({uniforms:{uTexture:{value:e},uSize:{value:new l1(0,0,0,0)},uOpacity:{value:.7}},vertexShader:N5,fragmentShader:G5,depthWrite:!1,depthTest:!1,defines:{debug:Y5},wireframe:Y5,transparent:!0,visible:!0})),a(this,gt))a(this,gt).material=a(this,Dt),a(this,gt).material.needsUpdate=!0;else{let i=new fi(2,2,1,1);P(this,gt,new oe(i,a(this,Dt))),a(this,gt).position.set(0,0,-1),a(this,gt).frustumCulled=!1,a(this,gt).renderOrder=999;let o=new hi(1,1,1),n=new oe(o,new bt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));n.frustumCulled=!1,n.layers.set(1),a(this,gt).add(n),a(this,Ss).add(a(this,gt))}this.resize(a(this,Fi).canvasWidth,a(this,Fi).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){a(this,gt)&&(a(this,Ss).remove(a(this,gt)),Re(a(this,gt))),P(this,gt,void 0),a(this,Dt)&&a(this,Dt).dispose(),P(this,Dt,void 0),P(this,$n,void 0)}};Ce=new WeakMap,Fi=new WeakMap,Ss=new WeakMap,gt=new WeakMap,Dt=new WeakMap,$n=new WeakMap,Ir=new WeakMap,ri=new WeakMap;f();var Ch=100,AT=!1,xh=class extends ee{constructor(e,i){super();u(this,"currentTotalBoundingBox");u(this,"state");u(this,"cameraSystem");u(this,"debugMesh",null);u(this,"dirty",!0);u(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new ut,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new z(0,0,0),new z(Ch*2,Ch*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Ch)));let e=new ut().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(e);let i=e.getSize(new z),o=Math.max(i.x,i.y,i.z);for(let s of this.state.geometry2DMap.values())s.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(s.position),s.positionDirty=!1);let n=Sh.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,Ch)).getBoundingSphere(FT).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new z),min:Sh.min,max:Sh.max,radius:n},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,AT&&this.state.entityScene.parent instanceof Qi){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new nn,this.debugMesh.add(new oe(new au(this.cameraSystem.panBounds.radius),new bt({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let s=new z;Sh.getSize(s);let c=new hi(s.x,s.y,s.z),l=new bt({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new oe(c,l);p.position.copy(this.currentTotalBoundingBox.getCenter(new z)),this.debugMesh.add(p)}}}},Sh=new ut,FT=new u1;f();var Z5="\xA9 Mappedin",kT="https://info.mappedin.com/feedback",Cy=["top-left","top-right","bottom-left","bottom-right"],BT=640,_T=()=>"<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>",vy={custom:[],position:"bottom-right",feedback:!0},Ih=class{constructor(t){u(this,"controlContainerEl");u(this,"controlPositions");u(this,"compact");u(this,"attribContainerEl");u(this,"attribInnerEl");u(this,"attribButtonEl");u(this,"feedbackLinkEl");u(this,"attribHTML",Z5);u(this,"customAttributions",[]);u(this,"toggleAttribution",t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))});this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Cy.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=vy){var o;let e=t.position&&Cy.includes(t.position)?t.position:vy.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=_T(),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:vy.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=kT,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=[Z5],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<=BT||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}};f();var kc,xs=class{constructor(t,e){u(this,"mesh");u(this,"type","custom-geometry");u(this,"dirty",!0);u(this,"feature");u(this,"builder");u(this,"outline");u(this,"color",new Qe);x(this,kc,0);this.mesh=new io,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){L.warn("TODO: implement custom geometry opacity")}get opacity(){return L.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,kc)}set altitude(t){this.mesh&&(this.mesh.position.z=t,P(this,kc,t))}get renderOrder(){return L.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){L.warn("TODO: implement custom geometry render order")}};kc=new WeakMap;f();var Ph=class{constructor(t,e){u(this,"state");u(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))}}};f();f();var Mh=class extends oe{constructor(){super(...arguments);u(this,"userData",{entityId:""})}},RT=N.object({flipImageToFaceCamera:N.boolean().optional(),url:N.string()}),NT=N.object({type:N.enum(["Feature"]),properties:N.object({width:N.number(),height:N.number(),rotation:N.number().min(0).max(360).optional(),verticalOffset:N.number().optional()}),geometry:ys});function z5(r,t,e){N.union([N.number(),N.string()]).parse(r),NT.parse(t),RT.parse(e)}var Th=class{constructor(t){u(this,"mesh",new io);u(this,"imageMesh");u(this,"outline");u(this,"type","image");u(this,"instanceIndex",-1);u(this,"geometry");u(this,"material");u(this,"feature");u(this,"position",new z);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)}};f();function Sy(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)}}function GT(r,t){return r.map(e=>Sy(e,t))}function VT(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}}function jT(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}function q5(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}function UT(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}}function HT(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};jT(l,r)&&(n[s][c]=1)}return n}function WT(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)&&q5(r,o,i,s,s);s++)n=s;e[i][o]=n}return e}function XT(r,t,e,i,o,n){let s=0,c=0,l=0;for(let p=0;p<i;p++)for(let d=0;d<i;d++)if(r[p][d]===1){let m=Math.pow(t[p][d],2),g=e.minX+d*o,b=e.minY+p*n;s+=m,c+=g*m,l+=b*m}return{x:c/s,y:l/s}}function YT(r,t,e,i,o,n,s){let c=-1/0,l=null,p=r.length,d=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let m=0;m<p;m++)for(let g=0;g<p;g++)if(r[m][g]===1)for(let b=1;b<=p-g;b++){let y=b;if(!(y>p-m)&&q5(r,g,m,b,y)){let C=b*y,v=t.minX+(g+b/2)*e,S=t.minY+(m+y/2)*i,M={x:v,y:S},T=Math.sqrt(Math.pow(M.x-o.x,2)+Math.pow(M.y-o.y,2))/d,D=C*(1-n)-T*n*C;D>c&&(c=D,l={center:M,width:b*e*s,height:b*i*s})}}return l}function xy(r,t,e,i={}){let{scaleFactor:o=.9,centerPriority:n=.5,resolution:s=100,minimumSizeRatio:c=.5}=i,l=P1(e),p=r.width/r.height,d=GT(t,l),m=VT(d),{dx:g,dy:b,gridBounds:y}=UT(m,p,s),C=HT(d,y,s,g,b),v=WT(C,s),S=XT(C,v,y,s,g,b),M=YT(C,y,g,b,S,n,o);return!M||M.width<r.width*c||M.height<r.height*c?r:{...M,center:Sy(M.center,-l),rotation:e,polygonCenter:Sy(S,-l)}}var Bc=Math.PI*2,ZT=Math.PI/2,zT=Math.PI*1.5,qT=Ma(ZT,2),$T=Ma(zT,2),JT=.01,$5=!1,wh=class extends ee{constructor(e,i,o=0,n=0,s={}){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"initialBearing",0);u(this,"naturalBearing",0);u(this,"imagePlacementOptions");u(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 y,C,v;let l={width:o.width,height:o.height,center:this.convertTo3DMapPosition(s),rotation:(y=o.rotation)!=null?y:0},p=(C=this.imagePlacementOptions.mode)!=null?C:"default",d=(()=>{switch(p){case"fit-nearest-90":let S=(this.initialBearing-this.naturalBearing+360)%180;return S>=45&&S<=135?xy(l,c,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return xy(l,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if($5&&d.polygonCenter){let S=new oe(new au(1),new mi({color:65280}));S.position.set(d.polygonCenter.x,d.polygonCenter.y,n),this.rendererState.entityScene.add(S)}let m=new mi({transparent:!0,depthWrite:!1,side:rn}),g=new fi(d.width,d.height),b=new Mh(g);if(b.visible=!1,(v=this.getOrDownloadImage(i))==null||v.then(S=>{m.map=S,m.needsUpdate=!0,m.map.colorSpace=iu,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=e,b.material=m,$5){let S=new oe(new fi(o.width,o.height),new mi({color:"gray"}));b.add(S);let M=new x1;b.add(M),M.scale.set(10,10,10)}return b.position.set(d.center.x,d.center.y,n+JT),b.rotation.z=(-ne.degToRad(d.rotation)+Bc)%Bc,b}getOrDownloadImage(e){var i;if(this.imageLoadingCache.has(e))return(i=this.imageLoadingCache.get(e))==null?void 0:i.promise;{let o=new Promise(n=>{ko.getLoader().load(e,s=>{let c=this.imageLoadingCache.get(e);c&&!c.loaded&&(c.loaded=!0),n(s)})});return this.imageLoadingCache.set(e,{loaded:!1,promise:o}),o}}flipIfNeeded(e,i){if(e.imageMesh==null)return;let o=-i,n=e.imageMesh.rotation.z,s=Ma((n-o+Bc)%Bc,2);s>qT&&s<$T&&(e.imageMesh.rotation.z=(n+Math.PI)%Bc)}update(e){var s,c,l,p,d;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),b={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,[b]),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(y=>{let C=this.convertTo3DMapPosition(y);return{x:C.x,y:C.y}}),b=this.createImageMesh(m,(l=o.feature.properties)==null?void 0:l.image.path,(p=o.feature.properties)==null?void 0:p.image,n.height,(d=o.feature.properties)==null?void 0:d.image.position,g);o.mesh.parent.add(b),o.imageMesh=b}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(n.showImage&&!o.imageMesh.visible)if(n.url){let g=this.imageLoadingCache.get(n.url);g&&g.loaded&&(o.imageMesh.visible=!0)}else o.imageMesh.visible=!0;else!n.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1);n.flipImageToFaceCamera&&this.flipIfNeeded(o,e)}}}};f();var QT=250,Ro,Dh=class extends ee{constructor(e,i){super();u(this,"cameraDirty",!0);u(this,"focusablesDirty",!0);u(this,"state");u(this,"camera");u(this,"debugEl",null);u(this,"raycasters",[]);u(this,"collisions",new Map);u(this,"focusableEntities",new Set);u(this,"debugRaycasters",!1);x(this,Ro);u(this,"update",(e=!1,i=Date.now())=>{e||Date.now()-i>QT||(a(this,Ro)&&cancelAnimationFrame(a(this,Ro)),P(this,Ro,requestAnimationFrame(()=>{this.updateRaf()})))});this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new K(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new K(e.x/1.2,e.y/1.2),o=new K(e.x+(e.x-i.x),i.y),n=new K(i.x,e.y+(e.y-i.y)),s=new K(o.x,n.y),c=new K(e.x,e.y/1.5),l=new K(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((p,d)=>{if(this.debugRaycasters){let C=document.createElement("div");C.style.position="absolute",C.style.top=p.y+"px",C.style.left=p.x+"px",C.style.width="10px",C.style.height="10px",C.style.backgroundColor="red",this.debugEl.append(C)}let m=p.x/this.state.canvasWidth*2-1,g=-(p.y/this.state.canvasHeight)*2+1,b=new K(m,g),y=new _r;return y.setFromCamera(b,this.camera),[y,b,d===0?10:d<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 vt&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let n=new oe(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 p=c.object.userData.entityId,d=(l=this.collisions.get(p))!=null?l:0;this.collisions.set(p,d+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,Ro)&&cancelAnimationFrame(a(this,Ro)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Ro=new WeakMap;f();f();f();f();function Eh(r,t){t===void 0&&(t={});var e=Na(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return KT(e,t);case"MultiPolygon":return ew(e,t);default:throw new Error("invalid poly")}}function KT(r,t){t===void 0&&(t={});var e=Na(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{};return J5(i,o)}function ew(r,t){t===void 0&&(t={});var e=Na(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{},n=[];return i.forEach(function(s){n.push(J5(s,o))}),pn(n)}function J5(r,t){return r.length>1?w1(r,t):gi(r[0],t)}function tw(r,t){var e=!0;return Nr(r,function(i){Nr(t,function(o){if(e===!1)return!1;e=rw(i.geometry,o.geometry)})}),e}function rw(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!aw(r.coordinates,t.coordinates);case"LineString":return!Q5(t,r);case"Polygon":return!Di(r,t)}break;case"LineString":switch(t.type){case"Point":return!Q5(r,t);case"LineString":return!iw(r,t);case"Polygon":return!K5(t,r)}break;case"Polygon":switch(t.type){case"Point":return!Di(t,r);case"LineString":return!K5(r,t);case"Polygon":return!ow(t,r)}}return!1}function Q5(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(nw(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}function iw(r,t){var e=$a(r,t);return e.features.length>0}function K5(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var o=i[e];if(Di(o,r))return!0}var n=$a(t,Eh(r));return n.features.length>0}function ow(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var o=i[e];if(Di(o,t))return!0}for(var n=0,s=t.coordinates[0];n<s.length;n++){var c=s[n];if(Di(c,r))return!0}var l=$a(Eh(r),Eh(t));return l.features.length>0}function nw(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]}function aw(r,t){return r[0]===t[0]&&r[1]===t[1]}var eS=tw;function Iy(r,t){var e=!1;return Nr(r,function(i){Nr(t,function(o){if(e===!0)return!0;e=!eS(i.geometry,o.geometry)})}),e}var Oh=class{constructor(t){u(this,"dirty",!0);u(this,"map");u(this,"stylesheetId","");u(this,"userHiddenLayers",new Set);u(this,"hiddenLayersInStyle",new Set);u(this,"centerPoint");u(this,"bbox");u(this,"polygons");u(this,"handleRender",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=uu(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(n=D1(o.geometry.coordinates)),!n)continue;for(let s of this.polygons)if(Iy(s,n)){t.push(["!=",["id"],o.id]);break}}}}t.length>0&&(this.hiddenLayersInStyle.forEach(i=>{this.map.setFilter(i,["all",...t])}),this.dirty=!1)});u(this,"handleStyleChange",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)}});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=uu(n.geometry.coordinates);o.push(s)}else n.geometry.type==="MultiPolygon"&&o.push(...n.geometry.coordinates.map(s=>uu(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))}};f();f();f();var Py="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 My='#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 tS="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 pw=new Pa;function rS(r,t,e){let{nearRadius:i,farRadius:o,accentColor:n,completeFraction:s,isVertical:c}=t,{color:l}=e,p=!0,d=0,m=1/0,g=t.displayArrowsOnPath,b=!c,y=!0,C=g,v=i/2+uw,S=0;r[0].z+=v;for(let ae=1;ae<r.length;++ae){r[ae].z+=v;let de=r[ae].x-r[ae-1].x,Ve=r[ae].z-r[ae-1].z;if(c)S+=Math.sqrt(de*de+Ve*Ve);else{let pt=r[ae].y-r[ae-1].y;S+=Math.sqrt(de*de+pt*pt+Ve*Ve)}}if(!c){let ae=r[0],de=r[r.length-1];r.push(de.clone().setZ(de.z-.01)),r.unshift(ae.clone().setZ(ae.z-.01))}let M=new s1;C&&(M=pw.load(tS),M.colorSpace=iu);let w=new Qe(l),T=new Qe(n),D={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new K(1,1)},cameraParameters:{type:"v2",value:new K(d,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:w},pathLength:{type:"f",value:S},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:d},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:T},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:M},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:b?.05:1},showPulse:{type:"b",value:y},opacityMultiplier:{type:"f",value:1}},F=new g1(r);F.curveType="catmullrom",F.tension=0;let O=30,B=8,k=O*r.length,G=new y1(F,k,i,B,!1),V=new Float32Array(G.attributes.position.count);for(let ae=r.length;ae<V.length;ae++)V[ae]=ae;G.setAttribute("vertexIndex",new an(V,1));let X=new Float32Array(G.attributes.position.count),re=new an(X,1);for(let ae=0;ae<=k;ae++)for(let de=0;de<=B;++de)re.setX(ae*(B+1)+de,ae/k);G.setAttribute("pathDistance",re);let U=new Float32Array(G.attributes.normal.count*3),ie=new an(U,3);for(let ae=0;ae<k;ae++){let de=G.tangents[ae];for(let Ve=0;Ve<=B;++Ve)ie.setXYZ(ae*(B+1)+Ve,de.x,de.y,de.z)}G.setAttribute("pathTangent",ie);let Z=new Float32Array(G.attributes.normal.count*3),we=new an(Z,3);for(let ae=0;ae<k;ae++){let de=G.tangents[ae];var ue,ge,xe;c?(ue=de.x*de.y,ge=-1+de.y*de.y,xe=de.z*de.y):(ue=-de.x*de.z,ge=-de.y*de.z,xe=1-de.z*de.z);let Ve=Math.sqrt(ue*ue+ge*ge+xe*xe);Ve===0&&(Ve=1);let pt=ue/Ve,ur=ge/Ve,Ji=xe/Ve;for(let tn=0;tn<=B;++tn)we.setXYZ(ae*(B+1)+tn,pt,ur,Ji)}G.setAttribute("pathNormal",we);let pr=new sn({uniforms:D,vertexShader:Py,fragmentShader:My});pr.transparent=!0,pr.alphaTest=.5,D.resolution.value.x=1,D.resolution.value.y=1,D.vertexes.value=V.length,D.arrowTexture.value.wrapS=$s,D.arrowTexture.value.wrapT=$s,D.arrowTexture.value.anisotropy=16,D.complete.value=s;let At=new oe(G,pr),ct=At.clone(),it={...D,opacityMultiplier:{type:"f",value:.25}};it.complete.value=1,ct.material=new sn({uniforms:it,vertexShader:Py,fragmentShader:My}),ct.material.transparent=!0,ct.material.alphaTest=.5,ct.material.depthWrite=!1,ct.material.depthTest=!1,ct.renderOrder=1,it.resolution.value.x=1,it.resolution.value.y=1,it.vertexes.value=V.length,it.arrowTexture.value.wrapS=$s,it.arrowTexture.value.wrapT=$s,it.arrowTexture.value.anisotropy=16,it.complete.value=s,At.userData=ct.userData=t.mesh.userData;let di=t.mesh;di.add(At),di.add(ct),G.computeBoundingBox();let $i=new z;return G.boundingBox.getCenter($i),{mesh:di,material:pr,center:$i}}var uw=.15;var _c=class extends ee{constructor(e,i,o,n){super();u(this,"rendererState");u(this,"altitudeDirty",!0);u(this,"convertTo3DMapPosition");u(this,"getParentContainer");u(this,"convertZoomLevelToAltitude");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=o,this.convertZoomLevelToAltitude=n}update(e,i,o){let n,s=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="path"&&n.components[0].type==="path"){let l=n.components[0],p=n.components[1],d=l.isVertical&&this.altitudeDirty;if(!(l instanceof Bo))continue;if(l.dirty||d){if(l.mesh.parent!=null)for(let g=l.mesh.children.length-1;g>=0;g--)Re(l.mesh.children[0]);let m=[];if(l.feature.features.forEach(g=>{let b=g.geometry.coordinates[2]||0,y;if(g.properties.parentId&&(y=this.getParentContainer(g.properties.parentId,!0),y!=null&&y.altitude!=null&&(b+=y.altitude,l.isVertical=!0)),!g.properties.parentId||y!=null&&y.visible){let C=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],b);m.push(C)}}),m.length>1){let{mesh:g,material:b,center:y}=rS(m,l,{color:p.color});l.mesh=g,l.material=b,l.position=y}l.dirty&&(l.nearZoomLevel!=null&&(l.nearZoomAltitude=this.convertZoomLevelToAltitude(l.nearZoomLevel)),l.farZoomLevel!=null&&(l.farZoomAltitude=this.convertZoomLevelToAltitude(l.farZoomLevel))),l.dirty=!1}p.dirty&&(l.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(p.color),m.material.needsUpdate=!0}),l.mesh.position.z=p.altitude,p.dirty=!1),l.material&&(l.mesh.children.forEach(m=>{var b,y;let g=m.material.uniforms;g.nearZoom.value=(b=l.nearZoomAltitude)!=null?b:e,g.farZoom.value=(y=l.farZoomAltitude)!=null?y: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()/3e3,m.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};f();var $e,Is,Pr,Lh=class{constructor(t){u(this,"rendererState");u(this,"dirty",!1);x(this,$e);x(this,Is);x(this,Pr);this.rendererState=t}updateOne(t){if(t instanceof Oe&&t.components[0]instanceof vt&&t.components[1]instanceof Gr&&t.parentObject3D instanceof dr&&(P(this,$e,t.components[0]),P(this,Pr,t.components[1]),a(this,$e).detached&&a(this,$e).dirty&&a(this,$e).geometry!=null&&a(this,$e).material!=null)){P(this,Is,t.parentObject3D),a(this,$e).visible=!1;let e=new Qe(a(this,Pr).color),i=new C0({color:e,side:rn,opacity:a(this,Pr).opacity||1,transparent:a(this,Pr).opacity!==void 0?a(this,Pr).opacity<1:!1},1,a(this,$e).material.repeatYFactor),o=new k1(1,a(this,$e).geometry.attributes.position.count||0,0,i),n=o.addGeometry(a(this,$e).geometry);o.addInstance(n),o.userData={entities:{0:t.id},detached:!0},a(this,$e).instanceIndex=n,a(this,$e).material.setColor(a(this,$e).instanceIndex,e,a(this,Pr).topColor?new Qe(a(this,Pr).topColor):e),a(this,$e).mesh=o,a(this,$e).material=i,a(this,Is).add(o),a(this,$e).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(){P(this,$e,void 0),P(this,Is,void 0),P(this,Pr,void 0)}};$e=new WeakMap,Is=new WeakMap,Pr=new WeakMap;f();f();function iS(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}}var Jn,No,Ah=class{constructor(t){u(this,"rendererState");u(this,"dirty",!1);x(this,Jn);x(this,No);this.rendererState=t}updateOne(t){var e;t instanceof Oe&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(P(this,Jn,t.components[0]),P(this,No,t.components[1]),t.type==="geometry"&&a(this,No).height!==a(this,Jn).currentHeight&&iS(a(this,Jn),a(this,No).height,a(this,No).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){P(this,Jn,void 0),P(this,No,void 0)}};Jn=new WeakMap,No=new WeakMap;f();var dw={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1},Fh=class{constructor(t){u(this,"state",dw);u(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))}};f();var Rc=9,hw=!1,oS=.1;function fw(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}}var kh=class{constructor(t,e,i){u(this,"state");u(this,"renderer");u(this,"renderService");u(this,"pickingTexture");u(this,"pickingMaterial");u(this,"pixelBuffer");u(this,"width",0);u(this,"height",0);u(this,"scale",1/2);u(this,"color",1);u(this,"convertTo3DMapPosition");u(this,"destroyed",!1);u(this,"enabled",!1);u(this,"backgroundId",16777215);u(this,"resize",()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new c1(this.width,this.height,{format:n1,type:o1,internalFormat:"RGBA"})});u(this,"shouldShowByXY",(t,e,i)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-e-1)*this.width,n=this.pixelBuffer[o*4],s=this.pixelBuffer[o*4+1],c=this.pixelBuffer[o*4+2],l=n<<16|s<<8|c;return l===i||l===this.backgroundId});u(this,"activeOccluders",new Set);u(this,"update",()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,e;for(let o of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(o);if(n&&n instanceof 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=Jd(t,this.convertTo3DMapPosition,{color:"white",height:oS});e=this.createOccluderMesh(s,n.userData.occluderId),n.add(e)}else if(t.geometry.type==="MultiPolygon"){let s=Qd(t,this.convertTo3DMapPosition,{color:"white",height:oS});e=this.createOccluderMesh(s,n.userData.occluderId),n==null||n.add(e)}n.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let i=new Qe(this.backgroundId);this.renderer.setClearColor(i),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(Rc),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(Rc),hw?this.renderService.enabledLayers.add(Rc):this.renderService.enabledLayers.delete(Rc),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),p=this.shouldShowByXY(c,l,n.occluderId);n.components[0].isOccluded=!p}}})});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 sn({glslVersion:a1,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);fw(o,i.count,e),t.setAttribute("color",new an(o,3))}createOccluderMesh(t,e){let i=new oe(t,this.pickingMaterial);return i.layers.set(Rc),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}};var nS=new _r;var{DEFAULT_PITCH:Oy,DEFAULT_BEARING:Ly,DEFAULT_ZOOM_LEVEL:Ay,DEFAULT_MIN_ZOOM_LEVEL:mw,DEFAULT_MAX_ZOOM_LEVEL:gw}=cr,yw=ne.radToDeg(.6435011087932844),Be,Fe,Qn,Nc,Ps,Go,Kn,Ms,st,wy,A,be,Mr,ke,ii,tt,E,Gc,Ue,Se,aS,sS,lS,Vo,Vc,jc,Uc,Hc,Bh,Wc,Xc,Yc,Ts,Dy,ea,Zc,Et,Ot,Ey,ws,zc,Ty=class extends ee{constructor(e,i={}){var g,b,y,C,v,S,M,w,T,D,F;super();x(this,st);u(this,"options");u(this,"container");u(this,"Debug");x(this,Be);x(this,Fe);x(this,Qn);x(this,Nc);x(this,Ps);x(this,Go);x(this,Kn);x(this,Ms);u(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:Ks,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new sy,cameraObject:new ef,naturalBearing:0,containerOffset:[0,0]});u(this,"camera");x(this,be);x(this,Mr);x(this,ke);x(this,ii);x(this,tt);x(this,E,{});x(this,Gc,window.matchMedia("screen and (min-resolution: 2dppx)"));u(this,"map");x(this,Ue,()=>{a(this,E).renderSystem.twoDdirty=!0});x(this,Se,()=>{a(this,E).renderSystem.threeDdirty=!0});x(this,Vo,"standalone");x(this,Vc,e=>Math.trunc(e*10)/10);x(this,jc,()=>{a(this,E).twoDDrawSystem.dirty=!0,_(this,st,wy).call(this,wa()),a(this,E).watermarkSystem.dirty=!0,a(this,E).occlusion2DSystem.resize(),this.render()});x(this,Uc,()=>{a(this,Hc).call(this)});x(this,Hc,(e,i)=>{let o=e!=null?e:this.rendererDomElement.clientWidth,n=i!=null?i:this.rendererDomElement.clientHeight;if(o===0||n===0)return;a(this,A).canvasWidth=o,a(this,A).canvasHeight=n,_(this,st,wy).call(this,wa()),a(this,Ts).call(this),_(this,st,lS).call(this),a(this,E).cameraSystem.resize(this.canvasWidth,this.canvasHeight),a(this,E).cameraSystem.dirty=!0,a(this,E).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),a(this,E).htmlControlsSystem.resize(this.canvasWidth),a(this,E).geometryInFocusSystem.resize(),a(this,E).occlusion2DSystem.resize();let{top:s,left:c}=this.container.getBoundingClientRect();a(this,A).containerOffset=[s,c],this.publish("resize"),this.render()});x(this,Bh,()=>{this.renderSync()});x(this,Wc,new z);x(this,Xc,(e,i)=>{let o=this.mode==="standalone"?a(this,Fe):this.viewCamera;if(a(this,Fe).position.z+this.camera.elevation>i.z){a(this,Wc).copy(i);let n=a(this,Wc).project(o),s=(n.x+1)/2*this.canvasWidth-0/2,c=(-n.y+1)/2*this.canvasHeight-0/2,l=a(this,Vc).call(this,s),p=a(this,Vc).call(this,c);e.x=l,e.y=p}else e.x=-1e3,e.y=-1e3});x(this,Yc,(e,i)=>{a(this,tt).setBufferSize(e,i),a(this,Fe).aspect=e/i,a(this,Fe).updateProjectionMatrix(),a(this,Fe).updateMatrixWorld(!0),a(this,Ps).x=e,a(this,Ps).y=i});x(this,Ts,()=>{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,Yc).call(this,o,n),(s=this.map)==null||s.resize(),a(this,A).shouldMeasureCanvas=!1});u(this,"getParentContainer",(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:(L.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});u(this,"showCollisionBoxes",()=>{a(this,E).collisionSystem.showCollisionBoxes(),this.render()});u(this,"hideCollisionBoxes",()=>{a(this,E).collisionSystem.hideCollisionBoxes(),this.render()});u(this,"projectScreenXYToCoordinate",(e,i,o=!1)=>{var g,b;let n=a(this,A).containerOffset[0],s=a(this,A).containerOffset[1],c=(e-s)/a(this,A).canvasWidth*2-1,l=-((i-n)/a(this,A).canvasHeight)*2+1,p=new K(c,l),d,m;if(o)nS.setFromCamera(p,a(this,Fe)),d=(g=nS.intersectObject(a(this,Go),!1)[0])==null?void 0:g.point;else{let y=a(this,E).interactionSystem.getThreeDIntersectsFromXY(p);d=(b=y==null?void 0:y[0])==null?void 0:b.point,m=a(this,E).interactionSystem.getGroupContainerIntersectsFromXY(p)}if(d)return{coordinate:this.convert3DMapPositionToCoordinate(d),groupContainers:m}});u(this,"projectCoordinateToScreenXY",e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o=new K;return a(this,Xc).call(this,o,i),{x:o.x,y:o.y}});u(this,"convert3DMapPositionToCoordinate",e=>{var n,s,c,l;let{lat:i,lon:o}=du((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]});u(this,"setBackgroundColor",(e,i)=>{a(this,tt).setBackgroundColor(e,i)});u(this,"getMetresPerPixel",()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,i,!0),n=this.projectScreenXYToCoordinate(e,i,!0);return o==null||n==null?void 0:cu(o.coordinate,n.coordinate)/e});u(this,"hideOutdoorLayersUnderPoint",(e,i)=>{!this.map||(i==null?void 0:i.length)===0||(a(this,E).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())});u(this,"hideOutdoorLayersIntersectingPolygons",(e,i,o)=>{a(this,E).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,o),this.render()});x(this,ea,new f1);x(this,Zc,new on);u(this,"render",()=>{var e;if(((e=a(this,E))==null?void 0:e.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return a(this,E).renderSystem.update()});u(this,"renderSync",()=>a(this,E).renderSystem.update(!0));x(this,Et,Da(()=>{this.publish("user-interaction-start",void 0)},0,!0));x(this,Ot,Da(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));u(this,"on",(e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&I.env.NODE_ENV!=="test"&&(L.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))});u(this,"off",(e,i)=>{super.off(e,i)});u(this,"getCursor",()=>a(this,E).interactionSystem.getCursor());u(this,"destroy",()=>{var e;a(this,E)&&(a(this,E).cameraSystem.off("user-dolly-start",a(this,Et)),a(this,E).cameraSystem.off("user-pan-start",a(this,Et)),a(this,E).cameraSystem.off("user-rotate-start",a(this,Et)),a(this,E).cameraSystem.off("user-zoom-start",a(this,Et)),a(this,E).cameraSystem.off("user-tilt-start",a(this,Et)),a(this,E).cameraSystem.off("user-pedestal-start",a(this,Et)),a(this,E).cameraSystem.off("user-dolly-end",a(this,Ot)),a(this,E).cameraSystem.off("user-pan-end",a(this,Ot)),a(this,E).cameraSystem.off("user-rotate-end",a(this,Ot)),a(this,E).cameraSystem.off("user-zoom-end",a(this,Ot)),a(this,E).cameraSystem.off("user-tilt-end",a(this,Ot)),a(this,E).cameraSystem.off("user-pedestal-end",a(this,Ot)),a(this,E).renderSystem.off("measure-canvas",a(this,Ts)),a(this,E).meshOptimizationSystem.off("geometry-2d-added",this.render),a(this,E).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),a(this,Ue).call(this),a(this,Se).call(this),this.renderSync(),a(this,E).renderSystem.destroy(),a(this,E).cameraSystem.off("change",this.render),a(this,E).pathSystem.off("animate:path",this.render),a(this,E).cameraSystem.dispose(),a(this,E).exporterSystem.destroy(),a(this,E).outdoorLayersSystem.destroy(),a(this,E).drawSystem.destroy(),window.removeEventListener("resize",a(this,Uc),!1),a(this,Gc).removeEventListener("change",a(this,jc)),a(this,Kn)&&a(this,Kn).disconnect(),this._subscribers={},a(this,tt).destroy(),(e=a(this,Be))==null||e.traverse(i=>{Re(i),"dispose"in i&&typeof i.dispose=="function"&&i.dispose()}),P(this,Be,void 0),a(this,E).htmlControlsSystem.destroy(),a(this,E).collisionSystem.destroy(),a(this,E).interactionSystem.destroy(),a(this,E).domMutationSystem.destroy(),a(this,E).geometryInFocusSystem.destroy(),P(this,E,void 0),a(this,Vo)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(a(this,ii)),this.container.removeChild(a(this,be)),P(this,tt,void 0))});x(this,ws,new z);x(this,zc,new z);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&&(P(this,Vo,i.mode),this.map=i.map),a(this,A).entityScene.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ue).call(this)}),a(this,A).entityScene.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ue).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,_(this,st,aS).call(this),_(this,st,sS).call(this),a(this,E).htmlControlsSystem=new Ih(this.container),a(this,Vo)!=="outdoors-overlay"&&a(this,E).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),I.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),P(this,tt,new Nd({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(b=i.gl)==null?void 0:b.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:O=>{var B;(B=i.onWebGLContextRestored)==null||B.call(i,O),a(this,Ue).call(this),a(this,Se).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(y=i.backgroundAlpha)!=null?y:1})),P(this,Be,new Qi),a(this,Be).add(a(this,A).entityScene);let o=window.__THREE_DEVTOOLS__;I.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:a(this,Be)})),o.dispatchEvent(new CustomEvent("observe",{detail:a(this,tt)}))),P(this,Fe,new ef(yw,this.aspect,50,1e5)),a(this,A).cameraObject=a(this,Fe),P(this,Nc,new h1),a(this,Fe).renderOrder=999;let n=new nn;n.add(a(this,Fe)),P(this,Ms,new nn),a(this,Ms).add(n),a(this,Be).add(a(this,Ms)),a(this,Fe).updateProjectionMatrix(),a(this,Fe).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,tt).domElement(),P(this,Ps,new K);let s=new fi(1e6,1e6),c=new bt({color:0,visible:!1});P(this,Go,new oe(s,c)),a(this,Go).name="worldPlane",a(this,Be).add(a(this,Go)),(C=i.gl)!=null&&C.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",a(this,Uc),!1),a(this,Gc).addEventListener("change",a(this,jc)),typeof ResizeObserver=="function"&&((v=I.env)==null?void 0:v.NODE_ENV)!=="test"&&(P(this,Kn,new ResizeObserver(V1(O=>{a(this,Hc).call(this,O[0].contentRect.width,O[0].contentRect.height)},50))),(S=a(this,Kn))==null||S.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1920px":"100%",I.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,p=this.canvasHeight;a(this,E).watermarkSystem=new vh(a(this,Fe),a(this,A),i==null?void 0:i.watermark),a(this,E).watermarkSystem.on("texture-loaded",this.render),a(this,A).shouldMeasureCanvas=!0,a(this,A).pixelRatio=this.resolutionScale,a(this,Yc).call(this,Math.floor(l*this.resolutionScale),Math.floor(p*this.resolutionScale));let d=new su(16777215,.3*Math.PI);d.position.set(-150,-150,350),a(this,Be).add(d);let m=new v1(16777215,.741*Math.PI);a(this,Be).add(m),a(this,E).cameraSystem=new qn(a(this,Fe),a(this,Be),a(this,tt).renderer,a(this,A),{mode:this.mode,canvasHeight:p,canvasWidth:l}),a(this,E).cameraSystem.on("user-dolly-start",a(this,Et)),a(this,E).cameraSystem.on("user-pan-start",a(this,Et)),a(this,E).cameraSystem.on("user-rotate-start",a(this,Et)),a(this,E).cameraSystem.on("user-zoom-start",a(this,Et)),a(this,E).cameraSystem.on("user-tilt-start",a(this,Et)),a(this,E).cameraSystem.on("user-pedestal-start",a(this,Et)),a(this,E).cameraSystem.on("user-dolly-end",a(this,Ot)),a(this,E).cameraSystem.on("user-pan-end",a(this,Ot)),a(this,E).cameraSystem.on("user-rotate-end",a(this,Ot)),a(this,E).cameraSystem.on("user-zoom-end",a(this,Ot)),a(this,E).cameraSystem.on("user-tilt-end",a(this,Ot)),a(this,E).cameraSystem.on("user-pedestal-end",a(this,Ot)),a(this,E).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),a(this,E).geometryInFocusSystem&&(a(this,E).geometryInFocusSystem.cameraDirty=!0),this.render()}),a(this,E).pathSystem=new _c(a(this,A),this.convertTo3DMapPosition,this.getParentContainer,a(this,E).cameraSystem.convertZoomLevelToAltitude),a(this,E).pathSystem.on("animate:path",this.render),a(this,E).panBoundsSystem=new xh(a(this,A),a(this,E).cameraSystem),a(this,E).panBoundsSystem.on("update",()=>{let{panBounds:O,fov:B,convertAltitudeToZoomLevel:k}=a(this,E).cameraSystem;if(a(this,E).panBoundsSystem.autoMinZoomLevel){if(O.radius<=0)return;let G=Math.min(a(this,A).canvasWidth/a(this,A).canvasHeight,1),V=B*Math.PI/180*G,X=Math.tan(V/2),{radius:re,center:U}=a(this,E).cameraSystem.panBounds,ie=re/X,Z=this.getThreeCamera().getWorldPosition(new z),we=U.distanceTo(Z),ue=Math.abs(Z.z-U.z),ge=ie*ue/we,xe=k(ge);Q1(xe,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(xe)}}),this.camera=new bh(this,a(this,E),a(this,A)),this.camera.setZoomLevel((T=i.zoomLevel)!=null?T:Ay),this.camera.setBearing((D=i.bearing)!=null?D:Ly),this.camera.setPitch((F=i.pitch)!=null?F:Oy),this.camera.setMaxZoomLevel(gw),this.camera.setMinZoomLevel(mw),a(this,E).domVisiblitySystem=new th(a(this,A),a(this,ii)),a(this,E).domMutationSystem=new yh(a(this,A),a(this,ii)),a(this,E).domMutationSystem.on("dimensions-update",()=>{a(this,E).collisionSystem.collidersDirty=!0,this.render()}),a(this,E).domDrawSystem=new mh(a(this,A)),a(this,E).collisionSystem=new Gd(a(this,Mr),a(this,A)),a(this,E).twoDDrawSystem=new ih(a(this,A),a(this,ke),i.transformImageRequest),a(this,E).twoDDrawSystem.on("img:loaded",this.render),a(this,E).interactionSystem=new dc(this.rendererDomElement,a(this,A),a(this,Fe),a(this,Go),a(this,E).cameraSystem.isUserInteracting),a(this,E).interactionSystem.on("doubletap-with-onefinger",O=>{var B;this.camera.animateTo({center:(B=this.projectScreenXYToCoordinate(O.clientX,O.clientY))==null?void 0:B.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:cf,easing:"ease-out"})}),a(this,E).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:cf,easing:"ease-out"})}),a(this,E).interactionSystem.on("hover",this.render),a(this,E).interactionSystem.on("click",O=>{var B,k,G,V,X,re;if(((B=O.entity2D)==null?void 0:B.id)==="watermark"&&typeof a(this,E).watermarkSystem.options.onClick=="function"&&a(this,E).watermarkSystem.options.interactive){a(this,E).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(O.position),geometry:O.entity3D?[(k=O.entity3D)==null?void 0:k.id]:[],paths:((G=O.entity3D)==null?void 0:G.components[0])instanceof Bo?[O.entity3D.id]:[],markers:((V=O.entity2D)==null?void 0:V.components[0])instanceof ro?[O.entity2D.id]:[],models:((X=O.entity3D)==null?void 0:X.components[0])instanceof Fo?[O.entity3D.id]:[],labels:((re=O.entity2D)==null?void 0:re.components[0])instanceof to?[O.entity2D.id]:[],containers:Array.isArray(O.groupContainers)?O.groupContainers.map(U=>U.userData.entityId):[],pointerEvent:O.pointerEvent})}),a(this,E).interactionSystem.on("hover",O=>{var B,k,G,V,X,re;O.position&&((B=O.entity2D)==null?void 0:B.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(O.position),geometry:O.entity3D?[(k=O.entity3D)==null?void 0:k.id]:[],paths:((G=O.entity3D)==null?void 0:G.components[0])instanceof Bo?[O.entity3D.id]:[],markers:((V=O.entity2D)==null?void 0:V.components[0])instanceof ro?[O.entity2D.id]:[],models:((X=O.entity3D)==null?void 0:X.components[0])instanceof Fo?[O.entity3D.id]:[],labels:((re=O.entity2D)==null?void 0:re.components[0])instanceof to?[O.entity2D.id]:[],containers:Array.isArray(O.groupContainers)?O.groupContainers.map(U=>U.userData.entityId):[]})}),a(this,E).geometryInFocusSystem=new Dh(a(this,A),a(this,Fe)),a(this,E).geometryInFocusSystem.on("geometry-in-focus",O=>{this.publish("geometry-in-focus",O)}),a(this,E).twoDVisiblitySystem=new nh(a(this,A)),a(this,E).drawSystem=new oh(a(this,A),this.convertTo3DMapPosition),a(this,E).drawSystem.on("texture-loaded",this.render),a(this,E).stackSystem=new sh(a(this,A)),a(this,E).twoDProjectionSystem=new rh(a(this,A),a(this,Xc)),a(this,E).exporterSystem=new hc(a(this,A)),a(this,E).meshOptimizationSystem=new eh(a(this,A),this.convertTo3DMapPosition),a(this,E).meshOptimizationSystem.on("model-loaded",this.render),a(this,E).meshOptimizationSystem.on("geometry-2d-added",this.render),a(this,E).meshDetachmentSystem=new Lh(a(this,A)),a(this,E).meshModificationSystem=new Ah(a(this,A)),a(this,E).customGeometrySystem=new Ph(a(this,A),this.convertTo3DMapPosition),a(this,E).outlineInterpolationSystem=new P0(a(this,A)),a(this,E).renderSystem=new ah(a(this,tt),a(this,A),this.mode,a(this,Be),a(this,Fe),this.viewCamera,a(this,E)),a(this,E).imageSystem=new wh(a(this,A),this.convertTo3DMapPosition,i.bearing,i.naturalBearing,i.imagePlacementOptions),a(this,E).text3DSystem=new K1(a(this,A),this.convertTo3DMapPosition),a(this,E).text3DSystem.on("render",this.render),a(this,E).imageSystem.on("image-loaded",this.render),a(this,E).renderSystem.on("pre-render",()=>this.publish("pre-render")),a(this,E).renderSystem.on("post-render",()=>this.publish("post-render")),a(this,E).renderSystem.on("measure-canvas",a(this,Ts)),a(this,E).outdoorLayersSystem=new Oh(this.map),a(this,E).occlusion2DSystem=new kh(a(this,A),this.convertTo3DMapPosition,a(this,tt)),i.occlusionEnabled&&a(this,E).occlusion2DSystem.enable(),this.Debug=new Fh(this),i.environment!==!1&&P(this,Qn,_(this,st,Ey).call(this)),a(this,Bh).call(this)}get viewCamera(){return a(this,Nc)}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:wa()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return a(this,Vo)}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,Ue).call(this)}),n.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ue).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&&Jt(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 L.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))L.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,Ue).call(this)}),n.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ue).call(this)}),n.components[0]=new gh,(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))L.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new xs(i,o),l=new Oe(c,new Gr(n));(n==null?void 0:n.interactive)!==void 0&&Jt(l,n.interactive,a(this,A)),l.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},a(this,A).geometry3DMap.set(l.id,l);let p=this.getParentContainer(s);p instanceof Ie&&p.addEntity(l),a(this,Se).call(this),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 dr(e,new af(o));l.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ue).call(this)}),l.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ue).call(this)}),l.userData.dirty=!0,a(this,A).geometry3DMap.set(e,l);for(let d of i.features){if(d.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(d.geometry.type))continue;let m=(d==null?void 0:d.id)||((s=d==null?void 0:d.properties)==null?void 0:s.id)||ve(),{visible:g,...b}=o||{color:F1},y=a(this,E).meshOptimizationSystem.createEntityFromFeature(m,d,b);a(this,A).geometry3DMap.set(m,y),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 p=this.getParentContainer(n);p instanceof Ie&&p.addEntity(l),a(this,Se).call(this),this.render()}else L.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return a(this,E).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,i){let o=this.getParentContainer(i),n=a(this,E).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(e,n),n}addImage(e,i,o,n){try{z5(e,i,o)}catch(s){L.error(s);return}if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let s=new Th(i),c=new Oe(s,new Gr(o));c.id=e||ve(),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 L.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{D5(e,i,o)}catch(p){L.error(p);return}if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let p=new dr(e,new af(o));p.addEventListener("childadded",()=>{a(this,Se).call(this),a(this,Ue).call(this)}),p.addEventListener("childremoved",()=>{a(this,Se).call(this),a(this,Ue).call(this)}),a(this,A).geometry3DMap.set(e,p),p.userData.dirty=!0,p.userData.modelURL=o.url;for(let m of i.features){let g=m.id||m.properties.id||ve(),b=a(this,E).meshOptimizationSystem.createModelFromFeature(g,m,o);(m.properties.interactive!==void 0||o.interactive!=null)&&Jt(b,(c=m.properties.interactive)!=null?c:o.interactive,a(this,A)),a(this,A).geometry3DMap.set(g,b),p.userData.entities3D.add(g)}let d=this.getParentContainer(n);d instanceof Ie&&d.addEntity(p),a(this,Se).call(this),(l=this.render())==null||l.then(s)}else L.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{N1(e,i,o||{})}catch(l){L.error(l);return}if(s===void 0||!a(this,A).geometry2DMap.has(s)&&!a(this,A).geometry3DMap.has(s)){let l=_(this,st,Dy).call(this,e,new ro(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"&&Jt(l,o==null?void 0:o.interactive,a(this,A)),(c=this.getParentContainer(n))==null||c.addEntity(l),this.render()}else L.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}addText3D(e,i,o,n){if(!a(this,A).geometry3DMap.has(e)&&!a(this,A).geometry2DMap.has(e)){let s=new gu({...i,properties:{...i.properties,id:e,content:i.properties.text}}),c=new Oe(s,new rl(o==null?void 0:o.appearance));c.id=e,s.mesh.userData.entityId=e.toString(),s.mesh.userData.type="text3d",a(this,A).geometry3DMap.set(e,c);let l=this.getParentContainer(n);l instanceof Ie&&l.addEntity(c),a(this,Se).call(this),this.render()}else L.error("Text3D with ID '".concat(e,"' already exists. The text3d cannot be added."));return{id:e,type:"text3d"}}labelText3D(e,i,o={}){var p,d;try{if(!i||!e)throw new Error("content and meshGeometryId are required");e0.parse(o)}catch(m){L.error(m);return}let n=a(this,A).geometry3DMap.get(e);if((n==null?void 0:n.type)!=="geometry"){L.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"){L.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let c=new gu({type:"Feature",geometry:{coordinates:(p=s.feature.properties.textArea)==null?void 0:p.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:i,id:ve()}});c.polygonEntityId=e;let l=new Oe(c,new rl(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&&((d=this.getParentContainer(o.parentId))==null||d.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{R1(e,i,o||{})}catch(l){L.error(l);return}if(s===void 0||!a(this,A).geometry2DMap.has(s)&&!a(this,A).geometry3DMap.has(s)){let l=_(this,st,Dy).call(this,e,new to(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&&Jt(l,o==null?void 0:o.interactive,a(this,A));let p=typeof n=="string"||typeof n=="number"?a(this,A).geometry3DMap.get(n):void 0;p instanceof Oe?p.addEntity(l):(c=this.getParentContainer(n))==null||c.addEntity(l),a(this,Ue).call(this),this.render()}else L.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{A5(e,i||{})}catch(p){L.error(p);return}let n=new Bo(e,g0(i)),s=new Oe(n,new Gr({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));s.id=(i==null?void 0:i.id)||ve(),n.mesh.userData={entityId:s.id,type:"path"},a(this,A).geometry3DMap.set(s.id,s),(i==null?void 0:i.interactive)!=null&&Jt(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,E).watermarkSystem.options=e,a(this,E).watermarkSystem.dirty=!0,a(this,E).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&&Re(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);Re(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);Re(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),Re(i.object3d)),"outline"in s&&s.outline&&Re(s.outline),"focusMesh"in s&&s.focusMesh!=null&&Re(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 Oe&&c.removeEntity(i)}}i.object3d&&Re(i.object3d),i.type==="label"&&delete a(this,E).twoDDrawSystem.textCache[i.id],a(this,A).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&Re(i.object3d),a(this,A).geometry3DMap.delete(i.id);else if(i.type==="text3d"){Re(i.object3d);let{batchedText:s,textMesh:c,polygonEntityId:l}=i.components[0];if(c&&(s&&s.removeText(c),Re(c)),l){a(this,E).text3DSystem.remove(l);let p=a(this,A).geometry3DMap.get(l);(p==null?void 0:p.type)==="geometry"&&(p.components[0].textMesh=void 0,p.components[0].textEntityId=void 0)}a(this,A).geometry3DMap.delete(i.id)}a(this,Se).call(this),a(this,Ue).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return a(this,Be)}getThreeCamera(){return a(this,Fe)}async setEnvironment(e){if(a(this,Be))if(e==="basic"){a(this,Qn)||P(this,Qn,_(this,st,Ey).call(this));let i=await a(this,Qn);a(this,Be).environment=i}else a(this,Be).environment=null}getEnvironment(){var e;return(e=a(this,Be))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return a(this,E).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(a(this,E).renderSystem.threeDdirty||a(this,E).renderSystem.twoDdirty)&&this.renderSync();let i=new ut;if(e==null)i.setFromObject(a(this,A).entityScene);else{let o=el(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 vt?n.geometry:void 0;n.mesh instanceof ou&&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(ln(i))return j1(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var o,n,s,c,l,p,d,m,g,b;if(e==null)return{type:"map-view",hoverColor:a(this,A).hoverColor,text3dHoverColor:a(this,A).text3dHoverColor};let i=el(a(this,A),e);if((i==null?void 0:i.type)==="custom-geometry"){let y=i.components[0],C=i.components[1];return{id:i.id,type:"custom-geometry",visible:C.visible,altitude:C.altitude,parent:(o=i.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(y.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let y=[];for(let v of i.userData.entities3D.values()){let S=this.getState(v);((S==null?void 0:S.type)==="geometry"||(S==null?void 0:S.type)==="model")&&y.push(S)}let C=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:C.opacity,color:C.color,initialColor:C.initialColor,height:C.height,altitude:i.altitude,topColor:C.topColor,outline:C.outline,shading:C.shading,texture:C.texture,topTexture:C.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(v=>a(this,A).geometry3DMap.get(v)).every(v=>v&&v.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(v=>this.getState(v)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,opacity:i.opacity,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(y=>this.getState(y)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let y=i.components[0],C=i.object3d.parent,v=C==null?void 0:C.userData.entityId;return{id:i.id,type:"label",text:y.text||"",parent:{id:v,type:C==null?void 0:C.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:y.enabled,visible:y.visible,initialRank:Qs(y.initialRank),options:{rank:Qs(y.rank),appearance:y.appearance,interactive:i.components[1]!=null,verticalOffset:i.verticalOffset}}}else if((i==null?void 0:i.type)==="marker"){let y=i.components[0],C=i.object3d.parent,v=C==null?void 0:C.userData.entityId;return{id:i.id,type:"marker",enabled:y.enabled,visible:y.visible,anchor:y.options.anchor,dynamicResize:y.options.dynamicResize,parent:{id:v,type:C==null?void 0:C.type},position:this.convert3DMapPositionToCoordinate(i.position),element:y.containerEl,initialRank:Qs(y.initialRank),options:{rank:Qs(y.rank),interactive:i.components[1]!=null||!1,verticalOffset:i.verticalOffset}}}else if((i==null?void 0:i.type)==="geometry"){let{color:y,hoverColor:C,initialColor:v,initialTopColor:S,topColor:M}=i.components[1],w=i.components[0],T=i.components[1],D=i.components[2],F=i.parentObject3D;return{id:i.id,type:"geometry",opacity:T.opacity,initialColor:v,color:y,focusable:w.focusable,initialTopColor:S,topColor:M,hoverColor:C,hovered:!!(D!=null&&D.hover),height:T.height,visible:T.visible,outline:T.outline,showImage:T.showImage,texture:T.texture,topTexture:T.topTexture,flipImageToFaceCamera:T.flipImageToFaceCamera,parent:{id:F==null?void 0:F.userData.entityId,type:F==null?void 0:F.type},position:this.convert3DMapPositionToCoordinate(w.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let y=i.components[0],C=i.components[1],v=i.components[2];return{id:i.id,type:"model",position:y.mesh?this.convert3DMapPositionToCoordinate((n=y.mesh)==null?void 0:n.getWorldPosition(new z)):this.convert3DMapPositionToCoordinate(y.position),interactive:v!=null,material:C.material,parent:(s=i.parentObject3D)!=null&&s.parent?{id:i.parentObject3D.parent.userData.entityId,type:i.parentObject3D.parent.type}:void 0,visible:C.visible,verticalOffset:C.verticalOffset,color:C.color,opacity:C.opacity,rotation:(c=C.rotation)!=null?c:La,scale:(l=C.scale)!=null?l:Oa}}else if((i==null?void 0:i.type)==="path"){let y=i.components[0],C=i.components[2],v=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(y.position),visible:v.visible,interactive:C!=null,completeFraction:y.completeFraction,color:v.color,accentColor:y.accentColor,nearRadius:y.nearRadius,farRadius:y.farRadius,animateArrowsOnPath:y.animateArrowsOnPath,displayArrowsOnPath:y.displayArrowsOnPath,nearZoomLevel:y.nearZoomLevel,farZoomLevel:y.farZoomLevel}}else if((i==null?void 0:i.type)==="image"){let y=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(y.position),visible:i.components[1].visible,verticalOffset:(p=y.feature.properties.verticalOffset)!=null?p:0,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"&&i.components[0]instanceof gu&&"textArea"in i.components[0].feature.properties){y0(i);let y=i.components[0],C=i.components[1],{textMesh:v}=y,S=(d=y.mesh)==null?void 0:d.parent;S instanceof Ie&&((m=S.children.find(T=>T.type==="batchedtext"))==null||m.getWorldPosition(a(this,zc))),a(this,ws).set(0,0,0);let M=v?v.getWorldPosition(a(this,ws)):a(this,ws);return Object.assign({},Ea,C.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(M.add(a(this,zc))),visible:(g=y.visible)!=null?g:!1,content:(b=y.feature.properties.content)!=null?b:""})}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=el(a(this,A),e);if(o!=null){if(o.type==="custom-geometry"){let c=a(this,A).geometry3DMap.get(o.id);if(c instanceof Oe&&c.components[0]instanceof xs){let l=i;no(o,a(this,A),l.visible),yu(o,l.altitude),hf(o,l.position,this.convertTo3DMapPosition),ff(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let c=i;Jt(o,c.interactive,a(this,A))&&a(this,Se).call(this),yu(o,c.altitude),m0(o,a(this,A),c)}else if(o.type==="model"){let c=i;Jt(o,c.interactive,a(this,A))&&a(this,Se).call(this),no(o,a(this,A),c.visible),v0(o,c)}else if(o.type==="group-container"){let c=i;no(o,a(this,A),c.visible)&&(a(this,E).outlineInterpolationSystem.dirty=!0,a(this,E).pathSystem.altitudeDirty=!0),yu(o,c.altitude)&&(a(this,E).pathSystem.altitudeDirty=!0),Jt(o,c.interactive,a(this,A))&&a(this,Se).call(this),gf(o,a(this,A),c.opacity)&&(a(this,E).outlineInterpolationSystem.geometries3DDirty=!0)}else if(o.type==="geometry-group"){let c=i;no(o,a(this,A),c.visible)&&(a(this,E).outlineInterpolationSystem.dirty=!0),t0(o,a(this,A),c)&&(a(this,E).outlineInterpolationSystem.dirty=!0),yf(o,c.outline)&&(a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),c.height!=null&&(df(o,a(this,A),c.height),a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),c.altitude!=null&&(o.setAltitude(c.altitude),o.userData.outlineDirty=!0),p0(o,c),r0(o,c.shading),gf(o,a(this,A),c.opacity)&&(a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),Jt(o,c.interactive,a(this,A))&&(a(this,Se).call(this),a(this,Ue).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof vt){let c=i;no(o,a(this,A),c.visible)&&(a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),yf(o,c.outline)&&(a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),i0(o,c),h0(o,c.focusable)&&(a(this,E).geometryInFocusSystem.focusablesDirty=!0),f0(o,c.renderOrder)&&(a(this,E).meshDetachmentSystem.dirty=!0),d0(o,c.opacity)&&(a(this,E).meshDetachmentSystem.dirty=!0,a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),mf(o,c.flipImageToFaceCamera),c.height!=null&&(df(o,a(this,A),c.height),a(this,E).outlineInterpolationSystem.geometries3DDirty=!0),u0(o,c)&&(a(this,E).meshDetachmentSystem.dirty=!0),o0(o,c),l0(o,c.hoverColor),Jt(o,c.interactive,a(this,A)),c0(o,c.hovered)}a(this,Se).call(this)}else if(o.type==="label"||o.type==="marker"){let c=i;s0(o,i,a(this,A)),a0(o,i,a(this,A))&&(a(this,Ue).call(this),a(this,E).domMutationSystem.dirty=!0),hf(o,c.position,this.convertTo3DMapPosition),ff(o,this.getParentContainer(c.parent,!1))&&(a(this,Ue).call(this),a(this,E).panBoundsSystem.dirty=!0),n0(o,c.enabled),no(o,a(this,A),c.visible)}else if(o.type==="image"){let c=i;no(o,a(this,A),c.visible),mf(o,c.flipImageToFaceCamera)}else if(o.type==="text3d"){let c=i;b0(o,a(this,A),c)}this.render()}}convertTo3DMapPosition(e,i,o=0,n){var l,p,d,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}=hu((d=(p=a(this,A).center)==null?void 0:p[1])!=null?d: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 z(s,c,o)}get backgroundColor(){return typeof a(this,tt).backgroundColor=="string"?a(this,tt).backgroundColor:"#".concat(a(this,tt).backgroundColor.getHexString())}get backgroundAlpha(){return a(this,tt).backgroundAlpha}getThreeRenderer(){return a(this,tt)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?J1(i):void 0}isInView(e){let i=el(a(this,A),e);if(a(this,Zc).identity().multiply(a(this,Fe).projectionMatrix).multiply(a(this,Fe).matrixWorldInverse),a(this,ea).setFromProjectionMatrix(a(this,Zc)),i instanceof sf)return a(this,ea).containsPoint(i.position);if(i instanceof Oe){let o=i==null?void 0:i.components[0];if(o instanceof xs||o instanceof Fo)return a(this,ea).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof vt){let n=new ut(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return a(this,ea).intersectsBox(n)}}return!1}getSystems(){return a(this,E)}getInternalState(){return a(this,A)}getTweenGroup(){return a(this,A).tweenGroup}};Be=new WeakMap,Fe=new WeakMap,Qn=new WeakMap,Nc=new WeakMap,Ps=new WeakMap,Go=new WeakMap,Kn=new WeakMap,Ms=new WeakMap,st=new WeakSet,wy=function(e){var i;a(this,Vo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),a(this,A).pixelRatio=this.resolutionScale},A=new WeakMap,be=new WeakMap,Mr=new WeakMap,ke=new WeakMap,ii=new WeakMap,tt=new WeakMap,E=new WeakMap,Gc=new WeakMap,Ue=new WeakMap,Se=new WeakMap,aS=function(){P(this,be,document.createElement("div")),a(this,be).classList.add("mappedin__smart-collision-engine__container"),P(this,Mr,document.createElement("canvas")),a(this,Mr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(a(this,be)),P(this,ke,document.createElement("canvas")),a(this,ke).classList.add("mappedin__smart-collision-engine__container"),a(this,ke).width=a(this,be).clientWidth*this.resolutionScale,a(this,ke).height=a(this,be).clientHeight*this.resolutionScale,a(this,ke).style.width=a(this,be).clientWidth+"px",a(this,ke).style.height=a(this,be).clientHeight+"px",a(this,be).appendChild(a(this,Mr)),a(this,be).appendChild(a(this,ke)),a(this,Mr).width=a(this,be).clientWidth,a(this,Mr).height=a(this,be).clientHeight,a(this,ke).width=a(this,be).clientWidth*this.resolutionScale,a(this,ke).height=a(this,be).clientHeight*this.resolutionScale,a(this,ke).style.width=a(this,be).clientWidth+"px",a(this,ke).style.height=a(this,be).clientHeight+"px"},sS=function(){P(this,ii,document.createElement("div")),a(this,ii).classList.add("mappedin-2d-entities"),Object.assign(a(this,ii).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(a(this,ii))},lS=function(){a(this,ke).width=a(this,be).clientWidth*this.resolutionScale,a(this,ke).height=a(this,be).clientHeight*this.resolutionScale,a(this,ke).style.width=a(this,be).clientWidth+"px",a(this,ke).style.height=a(this,be).clientHeight+"px",a(this,Mr).width=a(this,be).clientWidth,a(this,Mr).height=a(this,be).clientHeight,a(this,ke).width=a(this,be).clientWidth*this.resolutionScale,a(this,ke).height=a(this,be).clientHeight*this.resolutionScale,a(this,ke).style.width=a(this,be).clientWidth+"px",a(this,ke).style.height=a(this,be).clientHeight+"px",a(this,E).collisionSystem.collidersDirty=!0},Vo=new WeakMap,Vc=new WeakMap,jc=new WeakMap,Uc=new WeakMap,Hc=new WeakMap,Bh=new WeakMap,Wc=new WeakMap,Xc=new WeakMap,Yc=new WeakMap,Ts=new WeakMap,Dy=function(e,i,o,n){let s=new sf(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n);return s.occluderId=o!=null?o:a(this,E).occlusion2DSystem.backgroundId,a(this,A).geometry2DMap.set(s.id,s),s},ea=new WeakMap,Zc=new WeakMap,Et=new WeakMap,Ot=new WeakMap,Ey=async function(){return ko.load($4).then(e=>{var i;return a(this,Be)&&((i=a(this,Be).environment)==null||i.dispose(),e.mapping=i1,a(this,Be).environment=e,this.render()),e})},ws=new WeakMap,zc=new WeakMap;var qc=Ty;f();function bw(r,t){vw(r,t)(r.getScene(),t),Cw(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 p=window.URL.createObjectURL(c);l.href=p,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(p)}},"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)}function vw(r,t){let e=t;return 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 p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(o,{height:l})},set flipImageToFaceCamera(l){let p=r.getState(o.id);(p==null?void 0:p.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 p=r.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.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 p=r.getState(o.id);(p==null?void 0:p.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 p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{opacity:l})},get color(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?_1(l.color).toHexString():"#ffffff"},set color(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:l})},set interactive(l){let p=r.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(d=>d.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 p=r.getState(o.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{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 p;let l=r.getState(o.id);return(l==null?void 0:l.type)==="marker"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:l}}),e.controllersRecursive().forEach(d=>d.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 p;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:l}}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get text(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l})},get"Text Color"(){var p,d;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:d.foregroundColor:"#000000"},set"Text Color"(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(o.id,{text:c.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var p,d;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:d.size:10},set"Text Size"(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var p,d;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.iconSize:10},set"Icon Size"(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var p,d,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(l){var d,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(m=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:m.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var p,d,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(l){var d,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(m=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:m.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var p,d,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(l){var d,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(m=(d=p.options.appearance)==null?void 0:d.marker)==null?void 0:m.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var p,d,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(d=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:d.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(l){var d,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(m=(d=p.options.appearance)==null?void 0:d.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 p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(o,{opacity:l})},set visible(l){let p=r.getState(o.id);(p==null?void 0:p.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 p=r.getState(o.id);(p==null?void 0:p.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 p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var p,d;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(p=l.shading)==null?void 0:p.start)!=null?d:0},set shadingStart(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:l}})},get shadingEnd(){var p,d;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(p=l.shading)==null?void 0:p.end)!=null?d:0},set shadingEnd(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:l}})},get shadingIntensity(){var p,d;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(p=l.shading)==null?void 0:p.intensity)!=null?d:0},set shadingIntensity(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{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 p=r.getState(o.id);(p==null?void 0:p.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 p=r.getState(o.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:l}),e.controllersRecursive().forEach(d=>d.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)}}function Cw(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)})}var cS="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",xw="https://auth.mappedin.com/oauth2/token";async function pS(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-E5AHLHIP.js"),p=t.outdoorView.headers;p==null&&(p=await Z1(xw));let d=t.center||[0,0],m=new c({container:r,style:t.outdoorView.style||cS,center:d,attributionControl:!1,zoom:(i=t.zoomLevel)!=null?i:Ay,pitch:(o=t.pitch)!=null?o:Oy,bearing:(n=t.bearing)!=null?n:Ly,transformRequest:W1(p),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:wa(),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,b=new qc(r,{center:d,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}),y={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(b.camera.minZoomLevel),m.setMaxZoom(b.camera.maxZoomLevel),b.on("camera-change",T=>{y.center=T.center,y.zoom=T.zoomLevel,y.bearing=T.bearing,y.pitch=T.pitch,m.jumpTo(y)});let C=l.fromLngLat(d,0),v=fu(C,b.viewCamera,b.camera,()=>{b.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(v),b.renderSync())});let S=!1,M=!1;m.on("idle",()=>{m&&(S||(b.publish("outdoor-view-loaded"),S=!0),M||(M=!0,b.publish("outdoor-style-loaded")))});let w=T=>{T&&(T.sourceDataType==="metadata"||T.sourceDataType==="visibility"||T.dataType==="style"||T.type==="terrain")&&b.getSystems().htmlControlsSystem.updateData(m)};return m.on("styledata",T=>{m&&T&&T.dataType==="style"&&T.type==="styledata"&&(M=!1),w(T)}),m.on("sourcedata",w),m.on("terrain",w),m.on("error",T=>{var D;if(((D=T.error)==null?void 0:D.url)===cS){L.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}L.warn(T)}),b}else return new qc(r,t)}f();var Ld=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Ld||{}),Ad=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(Ad||{});f();f();var $c=class $c{constructor(t,e,i){u(this,"id");u(this,"text");u(this,"target");u(this,"__type",$c.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===$c.__type}get focusTarget(){return this.target.anchorTarget}};u($c,"__type","Label");var jo=$c;f();var ta,Jc=class Jc{constructor(t,e,i){u(this,"id");x(this,ta);u(this,"__type",Jc.__type);u(this,"contentEl");this.id=t,this.contentEl=e,P(this,ta,i)}get target(){return a(this,ta)}get coordinate(){return a(this,ta).anchorTarget}static is(t){return t.__type===Jc.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){P(this,ta,t)}};ta=new WeakMap,u(Jc,"__type","Marker");var ki=Jc;f();var ep,tp,Qc=class Qc{constructor(t,e,i){x(this,ep);x(this,tp);u(this,"target");u(this,"__type",Qc.__type);P(this,ep,t),P(this,tp,e),this.target=i}static is(t){return t.__type===Qc.__type}get id(){return a(this,ep)}get url(){return a(this,tp)}};ep=new WeakMap,tp=new WeakMap,u(Qc,"__type","Image");var Kc=Qc;f();var Ds,rp=class rp{constructor(t,e,i){u(this,"id");u(this,"groupId");u(this,"__type",rp.__type);x(this,Ds);this.id=t,this.groupId=e,P(this,Ds,i)}get target(){return a(this,Ds)}static is(t){return t.__type===rp.__type}updateTarget(t){P(this,Ds,t)}};Ds=new WeakMap,u(rp,"__type","Model");var ra=rp;f();var ip=class ip{constructor(t,e){u(this,"id");u(this,"coordinates");u(this,"__type",ip.__type);this.id=t,this.coordinates=e}static is(t){return t.__type===ip.__type}get focusTarget(){return this.coordinates}};u(ip,"__type","PathSegment");var Es=ip,op=class op{constructor(t,e,i,o){u(this,"id");u(this,"animation");u(this,"coordinates");u(this,"segments");u(this,"__type",op.__type);this.id=t,this.animation=e,this.coordinates=i,this.segments=o.map(({id:n,coordinates:s})=>new Es(n.toString(),s))}static is(t){return t.__type===op.__type}get focusTarget(){return this.coordinates}};u(op,"__type","Path");var Tr=op;f();var Uo,np=class{constructor(t){x(this,Uo);P(this,Uo,t)}get center(){return a(this,Uo).center}get bearing(){return a(this,Uo).bearing}get pitch(){return a(this,Uo).pitch}get zoomLevel(){return a(this,Uo).zoomLevel}};Uo=new WeakMap;f();var ap=class ap{constructor(t){u(this,"id");u(this,"__type",ap.__type);this.id=t}static is(t){return t.__type===ap.__type}get focusTarget(){return this}};u(ap,"__type","Shape");var Ho=ap;f();var _h=class _h{constructor(t,e){u(this,"id");u(this,"target");u(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===_h.__type}};u(_h,"__type","Text3D");var Wo=_h;f();f();f();var Iw=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>']]),Pw=/<svg([^>]*)>/g;function uS(r,t,e){let i=Iw.get(r);return i?i.replace(Pw,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var Mw=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 '),Tw=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 '),Fy="#722ED1",ky="#1890FF",dS=({type:r="departure",color:t=ky})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?Mw(t):Tw(t),"\n </div>"),ww=r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},hS=({type:r="stairs",color:t=Fy,direction:e="up"})=>{let i=ww("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(uS("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>")};f();var fS=async r=>new Promise(t=>setTimeout(t,r));var Dw={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},Ew={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},ia={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:Dw,inactivePathOptions:Ew,markerOptions:{departureColor:ky,destinationColor:Fy}},Bi,wr,_i,he,lp,Ri,oa,He,Dr,Nt,Er,Xo,_e,mS,gS,By,Rh,Os,_y,Ls,sp=class{constructor(t,e,i){x(this,_e);x(this,Bi,new Map);x(this,wr);x(this,_i);x(this,he,ia);x(this,lp);x(this,Ri);x(this,oa);x(this,He,[]);x(this,Dr);x(this,Nt,new Map);x(this,Er,new Map);x(this,Xo,new Map);x(this,Ls,t=>{var e;if((e=a(this,he).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=a(this,Bi).get(t.markers[0]);i!=null&&i.action.toFloor&&(a(this,he).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}))}});P(this,wr,t),P(this,lp,i),P(this,_i,e)}get currentMap(){return a(this,lp).call(this)}get isMultiFloor(){if(!a(this,He).length)return!1;let t=new Set;for(let e of a(this,He))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,Nt).get(t)}getMarkerById(t){return a(this,Bi).get(t)}get paths(){let t=new Set;return a(this,Nt).forEach(({path:e})=>t.add(e)),Array.from(t)}get activeDirections(){return a(this,Xo).get(a(this,Dr))}get activePath(){var t;if(a(this,Dr))return(t=a(this,Nt).get(a(this,Dr).id))==null?void 0:t.path}get floorStacks(){let t=a(this,_i).getMapData();if(!a(this,He).length||!t)return[];let e=new Set;for(let i of a(this,He))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,_i).getMapData();if(!a(this,He).length||!t)return[];let e=new Set;for(let i of a(this,He))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,He)[t];if(!a(this,He).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,He)[t]){L.warn("Direction #".concat(t," does not exist"));return}let i=a(this,Er).get(e);if(!i){L.warn("The direction is not a part of muli-direcional path");return}_(this,_e,Rh).call(this,i)}setActivePath(t){if(!a(this,He).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Xo).get(t)){L.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}_(this,_e,Rh).call(this,t)}setActivePathByDirections(t){if(!a(this,He).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=a(this,Er).get(t);if(!e){L.warn("The direction is not a part of muli-direcional path");return}_(this,_e,Rh).call(this,e)}drawSync(t,e={}){var c,l,p;a(this,oa)&&this.clear(),P(this,oa,!0),_(this,_e,By).call(this,e);let i=Array.isArray(t)?t:[t],o=i[0],n=i[i.length-1],s=o.coordinates[0];P(this,He,i),s.floorId&&a(this,he).setMapToDeparture&&this.currentMap.setFloor(s.floorId),(c=a(this,he).createMarkers)!=null&&c.departure&&_(this,_e,Os).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let d=0;d<i.length;d++){let m=i[d],g=d?{...a(this,he).inactivePathOptions}:{...a(this,he).pathOptions};if(m.coordinates.length<2){L.warn("Directions must have at least 2 coordinates");return}let b=this.currentMap.Paths.add(m.coordinates,g),y=b.paths.map(v=>v.id.toString()),C=new Tr(ve(),b.animation,m.coordinates,b.paths);for(let v of y){a(this,Nt).set(v,{path:C,entityIds:y});let S=d?{...a(this,he).inactivePathOptions,altitude:0}:{...a(this,he).pathOptions,altitude:.05};a(this,wr).setState(v,S)}a(this,Nt).set(C.id,{path:C,entityIds:y}),a(this,Er).set(m,C),a(this,Xo).set(C,m),(l=a(this,he).createMarkers)!=null&&l.connection&&_(this,_e,_y).call(this,m.instructions,"connection"),d===0&&(P(this,Dr,a(this,Er).get(a(this,He)[0])),a(this,wr).on("click",a(this,Ls)))}(p=a(this,he).createMarkers)!=null&&p.destination&&_(this,_e,Os).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),a(this,_i).mapObjects.forEach(d=>{d.processFloorChange(d.currentFloorId)})}async draw(t,e={}){a(this,Ri)&&this.clear(),_(this,_e,By).call(this,e);let i=Array.isArray(t)?t:[t],n=i[0].coordinates[0];return P(this,He,i),n.floorId&&a(this,he).setMapToDeparture&&this.currentMap.setFloor(n.floorId),_(this,_e,gS).call(this,i)}clear(){a(this,Bi).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),a(this,Bi).clear(),a(this,Nt).forEach(({path:t,entityIds:e})=>{a(this,Nt).delete(t.id),e.forEach(i=>a(this,Nt).delete(i)),this.currentMap.Paths.remove(e)}),a(this,Ri)&&(a(this,Ri).cancel(),P(this,Ri,void 0)),a(this,oa)&&P(this,oa,!1),P(this,He,[]),a(this,Er).clear(),a(this,Xo).clear(),P(this,Dr,void 0),a(this,wr).off("click",a(this,Ls)),a(this,_i).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};Bi=new WeakMap,wr=new WeakMap,_i=new WeakMap,he=new WeakMap,lp=new WeakMap,Ri=new WeakMap,oa=new WeakMap,He=new WeakMap,Dr=new WeakMap,Nt=new WeakMap,Er=new WeakMap,Xo=new WeakMap,_e=new WeakSet,mS=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},gS=function(t){let e=t[0],i=t[t.length-1],o=!1;return P(this,Ri,{promise:new Promise(async n=>{var s,c,l;if(I.env.NODE_ENV!=="test"&&await fS(500),o||!t.length){n();return}(s=a(this,he).createMarkers)!=null&&s.departure&&_(this,_e,Os).call(this,e.coordinates[0],"departure",e.instructions[0]);for(let p=0;p<t.length;p++){let d=t[p],m=p?{...a(this,he).inactivePathOptions}:{...a(this,he).pathOptions};if(d.coordinates.length<2){L.warn("Directions must have at least 2 coordinates"),n();return}let g=this.currentMap.Paths.add(d.coordinates,m),b=g.paths.map(C=>C.id.toString()),y=new Tr(ve(),g.animation,d.coordinates,g.paths);for(let C of b){a(this,Nt).set(C,{path:y,entityIds:b});let v=p?{...a(this,he).inactivePathOptions,altitude:0}:{...a(this,he).pathOptions,altitude:.05};a(this,wr).setState(C,v)}if(a(this,Nt).set(y.id,{path:y,entityIds:b}),a(this,Er).set(d,y),a(this,Xo).set(y,d),I.env.NODE_ENV!=="test"&&await g.animation,o){n();return}(c=a(this,he).createMarkers)!=null&&c.connection&&_(this,_e,_y).call(this,d.instructions,"connection"),p===0&&(P(this,Dr,a(this,Er).get(a(this,He)[0])),a(this,wr).on("click",a(this,Ls)))}if((l=a(this,he).createMarkers)!=null&&l.destination&&_(this,_e,Os).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),o){n();return}a(this,_i).mapObjects.forEach(p=>{p.processFloorChange(p.currentFloorId)}),n()}),cancel:()=>{o=!0}}),a(this,Ri).promise},By=function(t){var e,i;P(this,he,{setMapOnConnectionClick:(e=t.setMapOnConnectionClick)!=null?e:ia.setMapOnConnectionClick,setMapToDeparture:(i=t.setMapToDeparture)!=null?i:ia.setMapToDeparture,pathOptions:{...ia.pathOptions,...t.pathOptions},inactivePathOptions:{...ia.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...ia.createMarkers,...t.createMarkers},markerOptions:{...ia.markerOptions,...t.markerOptions}})},Rh=function(t){P(this,Dr,t),a(this,He).forEach(e=>{let i=a(this,Er).get(e);if(i){let o=a(this,Nt).get(i.id),n=o.path.id===a(this,Dr).id?{...a(this,he).pathOptions,altitude:.05}:{...a(this,he).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{a(this,wr).setState(s,n)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},Os=function(t,e,i){var o,n,s,c,l;if(e==="connection"&&i){let p=i.action.type==="ExitConnection"?a(this,he).markerOptions.departureColor:a(this,he).markerOptions.destinationColor,d;if(typeof((o=a(this,he).createMarkers)==null?void 0:o.connection)=="function"){let g=a(this,he).createMarkers.connection(i);a(this,wr).setState(g.id.toString(),{options:{interactive:!0}}),d={id:g.id,type:"marker"}}else d=this.currentMap.Markers.add(i.coordinate,hS({type:(s=(n=i.action.connection)==null?void 0:n.type)!=null?s:i.action.connectionType,color:p,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(d.id.toString());if(!m)throw new Error("marker component should exist");a(this,Bi).set(d.id,{instruction:i,marker:new ki(d.id.toString(),m,i.coordinate)})}else{let p=e==="departure"?a(this,he).markerOptions.departureColor:a(this,he).markerOptions.destinationColor,d;typeof((c=a(this,he).createMarkers)==null?void 0:c.departure)=="function"&&e==="departure"?d={id:a(this,he).createMarkers.departure(i).id,type:"marker"}:typeof((l=a(this,he).createMarkers)==null?void 0:l.destination)=="function"&&e==="destination"?d={id:a(this,he).createMarkers.destination(i).id,type:"marker"}:d=this.currentMap.Markers.add(t,dS({type:e,color:p}),{anchor:"top",rank:"always-visible"}),a(this,Bi).set(d.id,void 0)}},_y=function(t,e){t.filter(o=>_(this,_e,mS).call(this,o.action)).forEach(o=>{_(this,_e,Os).call(this,o.coordinate,e,o)})},Ls=new WeakMap;f();f();f();var Ow=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>']]),Lw=/<svg([^>]*)>/g;function yS(r,t,e){let i=Ow.get(r);return i?i.replace(Lw,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var na,As,Gt,Ry,bS,vS,Ny,CS,Nh=class{constructor(t,e){x(this,Gt);x(this,na);x(this,As);u(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});P(this,na,t),P(this,As,e)}auto(){let t=[],e=a(this,As)[Object.keys(a(this,As))[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,na).Labels.add(o,n,_(this,Gt,Ry).call(this,i));t.push(s)}});else{i.__type==="space"&&i.name!==""&&a(this,na).updateState(i,{interactive:!0,hoverColor:"#F0F0F0"});let o=i.name||i.externalId;if(o){let n=a(this,na).Labels.add(i,o,_(this,Gt,Ry).call(this,i));t.push(n)}}}),{labels:t}}};na=new WeakMap,As=new WeakMap,Gt=new WeakSet,Ry=function(t){let e=yS(_(this,Gt,bS).call(this,t),"white",12);return{appearance:{text:{foregroundColor:_(this,Gt,Ny).call(this,t)},marker:{foregroundColor:{active:_(this,Gt,Ny).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:_(this,Gt,CS).call(this,t)}},bS=function(t){return t.__type==="connection"?_(this,Gt,vS).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},vS=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},Ny=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},CS=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var Gh=class{constructor(t,e){u(this,"Labels");u(this,"auto",()=>this.Labels.auto());this.Labels=new Nh(t,e)}};f();var te,pp,Ni,Vh,Gy,cp=class{constructor(t){x(this,Ni);x(this,te);x(this,pp);u(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(a(this,te).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(a(this,te).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(a(this,te).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{a(this,te).getSystems().cameraSystem.enablePan=!0,a(this,te).getSystems().cameraSystem.enableZoom=!0,a(this,te).getSystems().cameraSystem.enableRotate=!0},disable:()=>{a(this,te).getSystems().cameraSystem.enablePan=!1,a(this,te).getSystems().cameraSystem.enableZoom=!1,a(this,te).getSystems().cameraSystem.enableRotate=!1}});u(this,"setMinPitch",t=>{a(this,te).camera.setMinPitch(t)});u(this,"setMaxPitch",t=>{a(this,te).camera.setMaxPitch(t)});u(this,"setMinZoomLevel",t=>{a(this,te).camera.setMinZoomLevel(t,!0)});u(this,"setMaxZoomLevel",t=>{a(this,te).camera.setMaxZoomLevel(t)});P(this,pp,t),P(this,te,t.core)}setScreenOffsets(t){a(this,te).camera.setInsetPadding(t)}get screenOffsets(){return a(this,te).camera.insetsPadding}get panMode(){return a(this,te).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&a(this,te).camera.setPanMode(t)}getFocusOnTransform(t,e){var o;let i=a(this,te).camera.getCameraFrameForCoordinates(_(this,Ni,Gy).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,verticalPadding:(o=e==null?void 0:e.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing});return{center:new J(i.center[1],i.center[0]),zoomLevel:i.zoomLevel}}focusOn(t,e){var i;return a(this,te).camera.focusOn(_(this,Ni,Gy).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,verticalPadding:(i=e==null?void 0:e.axisAlignedPadding)==null?void 0:i.vertical,easing:e==null?void 0:e.easing})}animateTo(t,e){var l;let{center:i,zoomLevel:o,bearing:n,pitch:s}=t,c=i!=null?i:this.center;return a(this,te).camera.animateTo({center:i!=null?[c.longitude,c.latitude,a(this,te).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,te).camera.setCenter(s),a(this,te).camera.setZoomLevel(i),a(this,te).camera.setBearing(o),a(this,te).camera.setPitch(n)}get center(){let t=a(this,te).camera.center;return new J(t[1],t[0],void 0)}setAutoMinZoomLevel(t){a(this,te).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return a(this,te).camera.autoMinZoomLevel}get zoomLevel(){return a(this,te).camera.zoomLevel}get pitch(){return a(this,te).camera.pitch}get minPitch(){return a(this,te).camera.minPitch}get maxPitch(){return a(this,te).camera.maxPitch}get bearing(){let t=a(this,te).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return a(this,te).camera.minZoomLevel}get maxZoomLevel(){return a(this,te).camera.maxZoomLevel}setElevation(t){a(this,te).camera.setElevation(t)}get elevation(){return a(this,te).camera.elevation}animateElevation(t,e){return a(this,te).camera.animateElevation(t,e)}};te=new WeakMap,pp=new WeakMap,Ni=new WeakSet,Vh=function(t){var i,o,n,s,c,l;let e=a(this,te).camera.elevation;return J.is(t)&&t.floorId!=null?(o=(i=a(this,te).getState(t.floorId))==null?void 0:i.altitude)!=null?o:e:Xt.is(t)?(s=(n=a(this,te).getState(t.id))==null?void 0:n.altitude)!=null?s:e:"floor"in t&&Xt.is(t.floor)&&(l=(c=a(this,te).getState(t.floor.id))==null?void 0:c.altitude)!=null?l:e},Gy=function(t){var n;let e=[],o=(Array.isArray(t)?t:[t]).flatMap(s=>{var c;return(c=s==null?void 0:s.focusTarget)!=null?c:[s]});for(let s of o)if(s!=null)if(J.is(s)){let c=_(this,Ni,Vh).call(this,s);e.push([s.longitude,s.latitude,c])}else if((s==null?void 0:s.id)!=null){let c=_(this,Ni,Vh).call(this,s);if(Xt.is(s)&&((n=a(this,pp).getMapDataInternal())!=null&&n.enterpriseMode)){e.push(s.id);continue}else if("geoJSON"in s&&s.geoJSON.geometry.coordinates.length>0){L1(s.geoJSON,p=>{e.push([p[0],p[1],c])});continue}let l=a(this,te).getBoundingArea(s.id);if(l)e.push(...l.map(p=>[p[0],p[1],c]));else if("geoJSONBoundingBox"in s){let p=_(this,Ni,Vh).call(this,s);if(s.geoJSONBoundingBox!=null){let d=[[s.geoJSONBoundingBox[0],s.geoJSONBoundingBox[1],p],[s.geoJSONBoundingBox[2],s.geoJSONBoundingBox[3],p]];e.push(...d)}}}else Mg(s)&&e.push(s);return e};f();var Fs,up=class{constructor({currentMapGetter:t}){x(this,Fs);P(this,Fs,t)}get currentMap(){return a(this,Fs).call(this)}async getCurrentSceneGLTF(t){let e=a(this,Fs).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(L.error("There is no map to export. Please load a map first."),new Blob)}};Fs=new WeakMap;f();var oi,hp,dp=class{constructor({currentMapGetter:t}){x(this,oi,new Map);x(this,hp);P(this,hp,t)}get currentMap(){return a(this,hp).call(this)}getById(t){return a(this,oi).get(t)}add(t,e,i){let o=t.anchorTarget,n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Labels.add(o,e,{...i,parentId:je.is(t)||Yt.is(t)?t.id:void 0,floorId:o.floorId,rank:(i==null?void 0:i.rank)==null||(i==null?void 0:i.rank)==="initial"?"medium":i.rank}),c=new jo(s.id.toString(),e,t);return a(this,oi).set(c.id,{label:c,entityId:c.id}),c}all(t){var i;let e=[];return(i=this.currentMap)==null||i.Labels.all({onCreate:(o,n,s)=>{let c=new jo(o.toString(),n,s);a(this,oi).set(c.id,{label:c,entityId:c.id}),e.push(c)},labelOptions:t}),e}remove(t){var i;let e=a(this,oi).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),a(this,oi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,oi).forEach(({label:e})=>{this.remove(e),t.push(e),a(this,oi).delete(e.id.toString())}),t}};oi=new WeakMap,hp=new WeakMap;f();f();var Vy={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},SS={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},xS=.5,Yo=class{constructor(t,e,i=new Map){u(this,"containerId");u(this,"labelIds",new Set);u(this,"layers");u(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})}},aa,fp=class{constructor(t,e,i,o,n,s,c){u(this,"id");u(this,"name");u(this,"elevation");u(this,"containerId");u(this,"externalId");u(this,"metadata");u(this,"shortName");u(this,"subtitle");u(this,"occluderId");u(this,"loaded",!1);u(this,"styleMap",{});u(this,"obstructions");u(this,"entrances");u(this,"spaces");u(this,"floorImages");u(this,"floorText");u(this,"renderer");u(this,"options");u(this,"layers",new Map);u(this,"footprint");u(this,"floorStackId");u(this,"multiFloorView");x(this,aa);u(this,"load",()=>{var o,n,s,c,l,p,d,m,g,b;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(Ti,"-").concat(this.id),{},this.id);this.layers.set(Ti,new Yo(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(qr,"-").concat(this.id),{},this.id);this.layers.set(qr,new Yo(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(Te,"-").concat(this.id),{},this.id);if(this.layers.set(Te,new Yo(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 y=this.renderer.addGroupContainer("".concat(os,"-").concat(this.id),{},this.id);this.layers.set(os,new Yo(this.renderer,y.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,y.id)}if(this.spaces!=null&&this.spaces.features.length>0){let y=this.spaces.features.filter(M=>{var w;return M.geometry.type==="Polygon"&&((w=M.properties.kind)==null?void 0:w.toLowerCase())!=="void"}),C=Zg(y,this.styleMap),v=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),S=0;for(let[M,w]of C){let T=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(S),{features:w},oc(M,this.options),v);S++;let D=v.id.toString();this.layers.get(Te).layers.set(M.id||D,T.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let y=this.obstructions.features.filter(O=>O.geometry.type==="Polygon"&&O.properties.kind==="object"),C=Zg(y,this.styleMap),v=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),S=0;for(let[O,B]of C){let k=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(S),{features:B},oc(O,this.options),v);S++;let G=v.id.toString();this.layers.get(Te).layers.set(O.id||G,k.id.toString())}let M=this.obstructions.features.filter(O=>O.geometry.type==="LineString"&&O.properties.kind==="Wall"&&O.properties.footprintComponent===!1),w=this.obstructions.features.filter(O=>O.geometry.type==="LineString"&&O.properties.kind==="Wall"&&O.properties.footprintComponent===!0),T=this.entrances,D=Vy,F=Vy;if(M!=null&&M.length>0){let O=this.styleMap[(s=M[0].properties)==null?void 0:s.id];O!=null&&(D={...O}),F=D;let{walls:B,entrances:k}=Wg(M,(T==null?void 0:T.features)||[]),G=Math.max(D.height-.11,xS),V={...SS,height:G},X=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),k,V,i);this.layers.get(Te).layers.set(ts,X.id.toString());let re=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[B]},oc(D,this.options),i);this.layers.get(Te).layers.set(Co,re.id.toString())}if(w!=null&&w.length>0){let O=this.styleMap[(c=w[0].properties)==null?void 0:c.id];O!=null&&(F={...O,id:zr});let{walls:B,entrances:k}=Wg(w,(T==null?void 0:T.features)||[]),G=Math.max(F.height-.11,xS),V={...SS,height:G},X=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),k,V,i);this.layers.get(Te).layers.set(rs,X.id.toString());let re=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[B]},oc(F,this.options),i);this.layers.get(Te).layers.set(zr,re.id.toString())}}if(this.floorImages!=null){let y=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let C of this.floorImages.features||[])"anchorId"in C.properties||"anchorId"in C.properties&&((l=C.properties)==null?void 0:l.anchorId)==null||this.renderer.addImage(ve(),C,{url:C.properties.path,flipImageToFaceCamera:(p=this.options.flipImagesToFaceCamera)!=null?p:!0},y);this.layers.set(o4,new Yo(this.renderer,y.id.toString()))}if(this.floorText!=null)for(let y of this.floorText.features||[]){let C=0;"geometryId"in y.properties?C=(m=(d=this.renderer.getState(y.properties.geometryId))==null?void 0:d.height)!=null?m:0:C=(g=y.properties.verticalOffset)!=null?g:0,this.renderer.addText3D(ve(),{...y,properties:{...y.properties,verticalOffset:C}},{},this.id)}return(b=this.multiFloorView)!=null&&b.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this});var p,d,m,g,b,y;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=(p=s.floorImages)==null?void 0:p[this.id],this.floorText=(m=(d=s.enterprise)==null?void 0:d.floorText)==null?void 0:m[this.id],this.footprint=(g=s["floor.geojson"])==null?void 0:g.features.find(C=>C.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=o,this.footprint&&((b=this.multiFloorView)!=null&&b.enabled)){let C=Vy;if(this.obstructions!=null&&this.obstructions.features.length>0){let S=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!0);S!=null&&S.length>0&&(C=this.styleMap[(y=S[0].properties)==null?void 0:y.id])}let v=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...C,height:this.multiFloorView.floorHeight,altitude:0,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":C.color},this.id);this.layers.set(is,new Yo(this.renderer,v.id.toString()))}}get geoJSONBoundingBox(){if(a(this,aa))return a(this,aa);if(!this.footprint){L.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return P(this,aa,Od(this.footprint)),a(this,aa)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};aa=new WeakMap;f();var jy=50,Uy=!1,Aw=1e3,Ee,ks,ni,Or,lt,gp,zo,Bs,sa,Vt,Wy,la,yp,bp,vp,Cp,Gi,TS,Sp,qo,Xy,wS,DS,ca,mp=class extends ee{constructor({currentMapGetter:e}){super();x(this,Vt);x(this,Ee);x(this,ks,0);x(this,ni);x(this,Or,!1);x(this,lt,[]);x(this,gp,0);x(this,zo,jy);x(this,Bs,!1);x(this,sa,"collapsed");u(this,"expandedFactor",0);x(this,la,"all-floors");x(this,yp,()=>{let e=a(this,Ee).call(this);if(a(this,gp)===this.expandedFactor||e==null||!a(this,Or))return;P(this,gp,this.expandedFactor);let i=oo(this.expandedFactor,0,1,0,this.distanceBetweenFloors),n=oo(this.expandedFactor,0,.1,0,1)===0;a(this,lt).forEach((s,c)=>{e.renderer.setState(s.containerId,{visible:n?s.id===e.currentFloorId:!0,altitude:i*c})}),this.expandedFactor===0?(P(this,Or,!1),e.renderer.camera.setPanMode("default"),a(this,qo)&&a(this,qo).call(this)):this.expandedFactor===1&&(P(this,Or,!1),a(this,qo)&&a(this,qo).call(this))});x(this,bp,()=>{var e,i,o;this.expanded&&P(this,ks,(i=(e=a(this,Ee).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(o=a(this,Ee).call(this))==null||o.renderer.on("user-interaction-end",a(this,Cp))});x(this,vp,()=>{var i;let e=a(this,Ee).call(this);if(e!=null&&this.expanded&&a(this,Bs)&&!a(this,Or)){let o=e.currentFloorId,n=[1/0,e.currentFloorId];for(let s=0;s<a(this,lt).length;s++){let c=a(this,lt)[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,lt).forEach(s=>{e.renderer.setState(s.containerId,{visible:a(this,la)==="all-floors"?!0:e.currentFloor.id===s.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId,previousFloorId:o}))}});x(this,Cp,()=>{var i,o;let e=a(this,Ee).call(this);if(this.expanded&&e&&a(this,ks)!==((i=e.renderer.camera.elevation)!=null?i:0)){let n=[1/0,e.currentFloorId,0];for(let s=0;s<a(this,lt).length;s++){let c=a(this,lt)[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,Bs)&&_(this,Vt,TS).call(this,n[2]),P(this,ks,0),e.renderer.off("user-interaction-end",a(this,Cp))}});x(this,Gi,null);x(this,Sp,null);x(this,qo);x(this,ca);P(this,Ee,e);let i=a(this,Ee).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",a(this,bp)),i.renderer.on("camera-change",a(this,vp)),i.renderer.on("pre-render",a(this,yp)))}get state(){return a(this,sa)}get expanded(){return a(this,sa)!=="collapsed"}get distanceBetweenFloors(){if(a(this,zo)==="auto"){if(a(this,ca)!=null)return a(this,ca);let e=_(this,Vt,DS).call(this);if(e)return P(this,ca,e),e}return typeof a(this,zo)=="number"?a(this,zo):jy}clearCachedFloorSeparationDistance(){P(this,ca,void 0)}get includedFloors(){var e;return(e=a(this,Vt,Wy))!=null&&e.api.mapData?a(this,lt).map(i=>{var o,n;return(n=(o=a(this,Vt,Wy))==null?void 0:o.api.mapData)==null?void 0:n.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return a(this,la)}setFloorVisiblityMode(e){P(this,la,e);let i=a(this,Ee).call(this);i!=null&&a(this,lt).forEach(o=>{i.renderer.setState(o.containerId,{visible:a(this,la)==="all-floors"?!0:i.currentFloor.id===o.id})})}changeFloorOnElevationChanges(e){P(this,Bs,e)}async expand(e){var o,n,s;let i=a(this,Ee).call(this);if(i!=null)return(e==null?void 0:e.distanceBetweenFloors)==="auto"?P(this,zo,"auto"):P(this,zo,(o=e==null?void 0:e.distanceBetweenFloors)!=null?o:jy),P(this,lt,(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,lt).sort((c,l)=>c.elevation-l.elevation),a(this,lt).length<=1||this.expanded===!0?Promise.resolve():(P(this,Or,!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),_(this,Vt,Xy).call(this,"expand",e).then(()=>{P(this,sa,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{P(this,Or,!1)}))}async collapse(e){let i=a(this,Ee).call(this);if(i!=null)return this.expanded===!0?(P(this,Or,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),_(this,Vt,Xy).call(this,"collapse",e).then(()=>{P(this,sa,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{P(this,Or,!1)})):Promise.resolve()}destroy(){let e=a(this,Ee).call(this);e!=null&&(e.renderer.off("user-interaction-start",a(this,bp)),e.renderer.off("camera-change",a(this,vp)),e.renderer.off("pre-render",a(this,yp)))}};Ee=new WeakMap,ks=new WeakMap,ni=new WeakMap,Or=new WeakMap,lt=new WeakMap,gp=new WeakMap,zo=new WeakMap,Bs=new WeakMap,sa=new WeakMap,Vt=new WeakSet,Wy=function(){return a(this,Ee).call(this)},la=new WeakMap,yp=new WeakMap,bp=new WeakMap,vp=new WeakMap,Cp=new WeakMap,Gi=new WeakMap,TS=function(e){var o,n,s;a(this,Gi)&&a(this,Gi).stop();let i=a(this,Ee).call(this);i!=null&&(P(this,Gi,new Rt({elevation:(o=i.renderer.camera.elevation)!=null?o:0}).to({elevation:e},150).easing(Ae.Quadratic.Out).onComplete(()=>{var c;a(this,Gi)&&((c=a(this,Ee).call(this))==null||c.renderer.getTweenGroup().remove(a(this,Gi)))}).onUpdate(({elevation:c})=>{i.renderer.camera.setElevation(c)}).start()),(n=a(this,Ee).call(this))==null||n.renderer.getTweenGroup().add(a(this,Gi)),(s=a(this,Ee).call(this))==null||s.renderer.render())},Sp=new WeakMap,qo=new WeakMap,Xy=function(e,i){var c,l,p,d;a(this,ni)&&a(this,ni).stop();let o=a(this,Ee).call(this);if(o==null)return Promise.reject(new Error("No current map"));let n=a(this,lt).indexOf(o.currentFloor),s=(c=o.renderer.camera.elevation)!=null?c:0;return P(this,Sp,new Promise(m=>{P(this,qo,m)})),P(this,ni,new Rt({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:Aw).easing(Cs[(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,ni)&&((m=a(this,Ee).call(this))==null||m.renderer.getTweenGroup().remove(a(this,ni)))}).start()),a(this,ni).cameraAnimation=!0,(p=a(this,Ee).call(this))==null||p.renderer.getTweenGroup().add(a(this,ni)),(d=a(this,Ee).call(this))==null||d.renderer.render(),a(this,Sp)},wS=function(e,i,o,n){let s=Hy(e,o),c=i.clone(),l=Hy(c,o);if(!ln(s)||!ln(l))return-1;let p=0,d;Uy&&n.querySelectorAll(".debug-box").forEach(g=>g.remove());do{if(p>1e4)return-1;if(p+=20,c.position.z=p,c.updateMatrixWorld(),l.makeEmpty(),Hy(c,o,l),d=s.intersectsBox(l),Uy){let m=MS(s,"blue",n),g=MS(l,d?"red":"green",n);m.classList.add("debug-box"),g.classList.add("debug-box")}}while(d);return p},DS=function(){let e=a(this,Ee).call(this);if(!e)return;let i=e.renderer,o=i.getThreeScene();if(!e.api.mapData||!o)return;let s=a(this,lt).length>0?a(this,lt):e.currentFloorStack.floorObjects;if(s.length<2)return;let c=i.getInternalState().geometry3DMap.get(s[0].id),l=i.getInternalState().geometry3DMap.get(s[1].id);if(!c||!l)return;if(rf(c,"group-container"),rf(l,"group-container"),Uy){let d=new ut;d.setFromObject(c);let m=new ut;if(m.setFromObject(l),c.children.forEach(M=>{M instanceof oe&&M.userData.debugBox&&Re(M)}),l.children.forEach(M=>{M instanceof oe&&M.userData.debugBox&&Re(M)}),!ln(d)||!ln(m))return;let g=new hi(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),b=new bt({color:255,transparent:!0,opacity:.5}),y=new oe(g,b);y.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),y.userData.debugBox=!0;let C=new hi(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),v=new bt({color:"cyan",transparent:!0,opacity:.5}),S=new oe(C,v);S.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),S.userData.debugBox=!0,c.add(y),l.add(S)}let p=_(this,Vt,wS).call(this,c,l,i.getThreeCamera(),i.container);if(p!==-1)return p},ca=new WeakMap;var Zo=new z,IS=new K;function Hy(r,t,e=new S1){return r.traverse(i=>{if(i instanceof oe){let n=i.geometry.attributes.position;if(t.position.distanceTo(i.position)<t.near)return;for(let c=0;c<n.count;c++)Zo.fromBufferAttribute(n,c),Zo.applyMatrix4(i.matrixWorld),Zo.applyMatrix4(t.matrixWorldInverse),Zo.applyMatrix4(t.projectionMatrix),Zo.z<1&&Zo.z>0&&(IS.set(Zo.x,Zo.y),e.expandByPoint(IS))}}),e}function PS(r,t){let e=t.clientWidth,i=t.clientHeight;return new K((r.x+1)*e/2,(1-r.y)*i/2)}function MS(r,t,e){let i=document.createElement("div");i.style.position="absolute",i.style.border="2px solid ".concat(t),i.style.pointerEvents="none";let o=PS(new K(r.min.x,r.min.y),e),n=PS(new K(r.max.x,r.max.y),e);i.style.left="".concat(o.x,"px"),i.style.top="".concat(n.y,"px");let s=Math.abs(n.x-o.x),c=Math.abs(n.y-o.y);return i.style.width="".concat(s,"px"),i.style.height="".concat(c,"px"),e.appendChild(i),i}f();var _s,xp=class{constructor(t,e,i,o){u(this,"id");u(this,"externalId");u(this,"name");u(this,"type");u(this,"floorIds");u(this,"defaultFloorId");u(this,"floorObjects",[]);u(this,"floorObjectsByElevation",new Map);u(this,"metadata");u(this,"containerId");u(this,"facade");u(this,"renderer");x(this,_s);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,_s)==null){this.floorObjects.length===0&&L.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)),P(this,_s,t)}return a(this,_s)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){L.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})})}};_s=new WeakMap;f();function ES(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=[qr,Te,Ti,os],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(is))):i.includes(s.id)&&s.elevation<t.elevation?(o.floorStates[n].visible=!0,o.floorStates[n].visibleLayers=[is,qr,Te,os],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=[is],o.floorStates[n].footprint.height=e,o.floorStates[n].footprint.altitude=0)}return o}f();f();f();f();var Rs,pa,Je,Pp,ua,Mp,Tp,Ns,Lt,Ip=class{constructor(t,e,i){u(this,"id");x(this,Rs);x(this,pa);x(this,Je);x(this,Pp);x(this,ua,[]);x(this,Mp,!1);x(this,Tp,1);x(this,Ns,new Map);x(this,Lt);this.id=t.id,P(this,Rs,t),P(this,pa,e),P(this,Je,i),this.setDefaultFloor(this.defaultFloor)}get floorStack(){return a(this,pa)}get defaultFloor(){var t;return(t=a(this,Pp))!=null?t:a(this,pa).defaultFloor}setDefaultFloor(t){a(this,ua).forEach(e=>{a(this,Je).setState(a(this,Je).getState(e),{opacity:1})}),a(this,Lt)&&(this.defaultFloor.setVisible(!1),t.setVisible(!0)),P(this,Pp,t),this.updateChildGeometryIds(t)}updateChildGeometryIds(t){P(this,ua,[]);let e=a(this,Je).getState(t.layers.get(Te).containerId);for(let i of e.children){let o=a(this,Je).getState(i);for(let n of o.children){let s=a(this,Je).getState(n);s&&a(this,ua).push(s.id.toString())}}}set focusable(t){P(this,Mp,t),a(this,Rs).spaces.forEach(e=>{let i=a(this,Je).getState(e.id);i&&a(this,Je).setState(i,{focusable:t,renderOrder:t?2:0})})}get focusable(){return a(this,Mp)}set opacity(t){P(this,Tp,t),a(this,Rs).spaces.forEach(e=>{let i=a(this,Je).getState(e.id);i&&(a(this,Ns).has(e.id)||a(this,Ns).set(e.id,i.opacity),a(this,Je).setState(i,{opacity:Math.min(a(this,Ns).get(e.id),t)}))})}get opacity(){return a(this,Tp)}animateOpacity(t,{duration:e=300,onEnd:i}={}){a(this,Lt)&&a(this,Lt).stop(),t<1&&this.defaultFloor.setVisible(!0),P(this,Lt,new Rt({opacity:this.opacity}).easing(Ae.Quadratic.In).to({opacity:t},e).onUpdate(({opacity:o})=>{this.opacity=o,a(this,ua).forEach(n=>{a(this,Je).setState(a(this,Je).getState(n),{opacity:1-o})})}).onStop(()=>{a(this,Lt)&&(a(this,Je).getTweenGroup().remove(a(this,Lt)),P(this,Lt,void 0)),i==null||i()}).onComplete(()=>{a(this,Lt)&&(a(this,Je).getTweenGroup().remove(a(this,Lt)),P(this,Lt,void 0)),this.opacity===1&&a(this,pa).floorObjects.forEach(o=>{o.setVisible(!1)}),i==null||i()})),a(this,Lt).start(),a(this,Je).getTweenGroup().add(a(this,Lt)),a(this,Je).render()}};Rs=new WeakMap,pa=new WeakMap,Je=new WeakMap,Pp=new WeakMap,ua=new WeakMap,Mp=new WeakMap,Tp=new WeakMap,Ns=new WeakMap,Lt=new WeakMap;var LS=!1,Lr,da,Gs,$o,wp,ha,Ar,ai,Dp,me,rt,AS,Yy,jh,Ep,Zy,Op,Vs,js,Us=class extends ee{constructor(e,i,{currentMapGetter:o}){super();x(this,me);x(this,Lr);x(this,da,!1);x(this,Gs,17);x(this,$o,!1);x(this,wp);x(this,ha);x(this,Ar,new Map);x(this,ai,new Set);x(this,Dp,new Set);x(this,Ep,(e,i)=>{if(!a(this,da)||e.length===0||!a(this,$o))return;let o=-1/0,n,s=!1,c=new Set,l=new Map;e.forEach((p,d)=>{var y;let m=_(this,me,Yy).call(this,p);if(!m)return;let g=1-d/e.length,b=((y=l.get(m.id))!=null?y:0)+g;l.set(m.id,b),b>o&&(o=b,n=m),a(this,ai).has(m.id)||(_(this,me,jh).call(this,m.id,0),s=!0),c.add(m.id)}),LS&&L.log("likelyInFocus:",[n==null?void 0:n.floorStack.name,o],"Weights:",e.flatMap(p=>{let d=_(this,me,Yy).call(this,p);return d?[d.floorStack.name,l.get(d.id)]:[]}));for(let p of a(this,ai))c.has(p)||(_(this,me,jh).call(this,p,1),s=!0);P(this,ai,c),P(this,Dp,new Set(e)),i&&n&&a(this,me,rt).currentFloorStackId!==n.floorStack.id&&(_(this,me,AS).call(this,n.id),s=!0),s&&this.publish("focus-change",{facades:Array.from(a(this,ai)),spaces:e})});x(this,Op,e=>{a(this,Ep).call(this,e,!0)});x(this,Vs,e=>{if(e.zoomLevel>=a(this,Gs)&&!a(this,$o))P(this,$o,!0);else if(e.zoomLevel<a(this,Gs)&&a(this,$o)){P(this,$o,!1);for(let i of a(this,Ar).values())i.opacity<1&&_(this,me,jh).call(this,i.id,1);a(this,ai).clear(),a(this,me,rt).outdoorFloorStacks.size>0&&!a(this,me,rt).outdoorFloorStacks.has(a(this,me,rt).currentFloorStackId)&&(a(this,me,rt).setFloorStack(a(this,me,rt).outdoorFloorStacks.values().next().value,"dynamic-focus"),this.publish("focus-change",{facades:[],spaces:[]}))}});x(this,js,({floorId:e})=>{var n;let i=a(this,me,rt).floorsById.get(e);if(!i)return;let o=(n=a(this,me,rt).floorStacksById.get(i.floorStackId))==null?void 0:n.facade;if(o&&!a(this,ai).has(o.id)){let s=o.spaces.map(c=>c.spaceId);a(this,Ep).call(this,[...s,...a(this,Dp)],!1)}});P(this,Lr,e),P(this,wp,o),P(this,ha,i)}get focusedFacades(){return Array.from(a(this,ai)).map(e=>{var i;return(i=a(this,ha).getMapDataInternal())==null?void 0:i.getById("facade",e)}).filter(e=>e!=null)}enable(e){var i;P(this,Gs,(i=e==null?void 0:e.minZoomLevel)!=null?i:17),this.enabled||(a(this,Lr).on("geometry-in-focus",a(this,Op)),a(this,Lr).on("camera-change",a(this,Vs)),a(this,me,rt).on("floor-change",a(this,js)),a(this,Vs).call(this,a(this,Lr).camera),_(this,me,Zy).call(this,!0),a(this,js).call(this,{floorId:a(this,me,rt).currentFloorId}),P(this,da,!0)),LS&&a(this,Lr).getSystems().geometryInFocusSystem.showRaycasters()}disable(){P(this,da,!1),a(this,Lr).off("geometry-in-focus",a(this,Op)),a(this,Lr).off("camera-change",a(this,Vs)),a(this,me,rt).off("floor-change",a(this,js)),_(this,me,Zy).call(this,!1)}get enabled(){return a(this,da)}setDefaultFloorForStack(e,i){a(this,me,rt)==null&&L.throw("Current map does not exist.");let o=a(this,me,rt).floorsById.get(i.id);if(o==null){L.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(o.floorStackId!==e.id){L.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,Ar).get(e.facade.id);n&&n.setDefaultFloor(o)}resetDefaultFloorForStack(e){let i=e.facade&&a(this,Ar).get(e.facade.id);i&&i.setDefaultFloor(i.floorStack.defaultFloor)}};Lr=new WeakMap,da=new WeakMap,Gs=new WeakMap,$o=new WeakMap,wp=new WeakMap,ha=new WeakMap,Ar=new WeakMap,ai=new WeakMap,Dp=new WeakMap,me=new WeakSet,rt=function(){return a(this,wp).call(this)},AS=function(e){let i=a(this,Ar).get(e);i&&a(this,me,rt).setFloor(i.defaultFloor.id,"dynamic-focus")},Yy=function(e){var o;let i=(o=a(this,ha).getMapDataInternal())==null?void 0:o.facadesBySpaceId[e];return a(this,Ar).get(i.id)},jh=function(e,i){let o=a(this,Ar).get(e);if(o)if(i<1){let n=o.defaultFloor,s=a(this,me,rt).floorsById.get(a(this,me,rt).currentFloorId);o.floorStack.id===(s==null?void 0:s.floorStackId)&&s.id!==o.defaultFloor.id&&o.setDefaultFloor(s),o.animateOpacity(i,{onEnd:()=>{o.defaultFloor!==n&&o.setDefaultFloor(n)}})}else o.animateOpacity(i)},Ep=new WeakMap,Zy=function(e){var i;(i=a(this,ha).getMapDataInternal())==null||i.facades.forEach(o=>{let n=a(this,Ar).get(o.id);n==null&&(n=new Ip(o,a(this,me,rt).floorStacksById.get(o.floorStack.id),a(this,Lr)),a(this,Ar).set(o.id,n)),n.focusable=e})},Op=new WeakMap,Vs=new WeakMap,js=new WeakMap;var Bw={linear:Ae.Linear.None,easeIn:Ae.Quadratic.In,easeOut:Ae.Quadratic.Out,easeInOut:Ae.Quadratic.InOut},si,Lp=class extends ee{constructor(e,i,o,n){var p,d,m,g;super();u(this,"floorStacksById",new Map);u(this,"floorsById",new Map);u(this,"currentFloorId","");u(this,"currentFloorStackId","");u(this,"outdoorFloorStacks",new Set);u(this,"id");u(this,"renderer");u(this,"api");u(this,"mvf");u(this,"options",{});u(this,"styleMap");u(this,"StackedMaps");u(this,"DynamicFocus");u(this,"animations",new Map);u(this,"Models",{add:(e,i,o)=>{let{floorId:n,scale:s,...c}=o,l=n?this.floorsById.get(n):this.currentFloor,p={...c};s!=null&&(p.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let d=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(m=>{var g;return{type:"Feature",properties:{id:ve(),rotation:o.rotation,scale:p.scale,interactive:o.interactive,verticalOffset:m.verticalOffset+((g=o.verticalOffset)!=null?g:0)},geometry:{type:"Point",coordinates:nr(m)}}})},p,{parent:l.id});if(d==null)throw new Error("error creating model");return this.renderer.getState(d).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});u(this,"Images",{add:(e,i,o)=>{let{floorId:n,flipImageToFaceCamera:s,...c}=o,l=n?this.floorsById.get(n):this.currentFloor,p={type:"Feature",properties:c,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(ve(),p,{url:i,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});u(this,"Markers",{add:(e,i,o)=>{var c;let n=qg(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),s=o;return o.rank==="initial"&&(s.rank="medium"),this.renderer.addMarker2D(nr(e),i,{...s,occluderId:n==null?void 0:n.occluderId},(c=n==null?void 0:n.layers.get(qr))==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){L.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(n.type!=="marker"){L.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(qr))==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 L.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(s.type!=="marker")return L.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 p=new Rt({lon:s.position[0],lat:s.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(Bw[l.easing]).onUpdate(({lon:d,lat:m})=>{var b;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let y=(b=c==null?void 0:c.layers.get(qr))==null?void 0:b.containerId;y&&this.Markers.setPosition(e,[d,m],y)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(e,p),zg(p).then(()=>{this.animations.delete(e)})}});u(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});u(this,"Shapes",{add:(e,i,o)=>{let n=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=ve();return this.renderer.addGeometryGroup(s,e,i,n.id),s},remove:e=>(this.renderer.remove(e.id),e.id)});u(this,"Text3D",{label:(e,i,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){L.warn("Enterprise mode is not enabled, skipping label creation");return}let n=FS(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 L.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 p=FS(this.renderer,s,(l=(c=s.locations[0])==null?void 0:c.name)!=null?l:s.name,e);p&&o.push({textInfo:p,target:s})}}),o},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){L.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});u(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 C,v,S,M,w;let l=(C=this.api.getMapData())==null?void 0:C.getById("space",c.properties.id);if(!l)return;let p=(v=this.styleMap[c.properties.id])==null?void 0:v.showImage,d=(S=c.properties.details)==null?void 0:S.images,g={marker:{...p&&((M=d==null?void 0:d[0])!=null&&M.url)?{icon:d[0].url}:{},...(w=i.appearance)==null?void 0:w.marker},...i.appearance},y=(n?this.floorsById.get(n):this.currentFloor).layers.get(Ti);if(c.properties.center&&c.properties.externalId!==""){let T=this.renderer.addLabel2D(c.properties.center,c.properties.externalId,{id:c.properties.id+"-label",...i,appearance:g,rank:i.rank},je.is(l)?l.id:y==null?void 0:y.containerId);T&&(je.is(l)&&y&&y.labelIds.add(T.id.toString()),e(T.id,c.properties.externalId,l))}})}},add:(e,i,o={})=>{var d;let{floorId:n,...s}=o,c=qg(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),l=c.layers.get(Ti),p=this.renderer.addLabel2D(nr(e),i,{...s,occluderId:c.occluderId,verticalOffset:o.verticalOffset},(d=o==null?void 0:o.parentId)!=null?d:l==null?void 0:l.containerId);if(!p)throw new Error("label creating failed");return l&&l.labelIds.add(p.id.toString()),p},remove:({label:e,entityId:i})=>{var o;if(je.is(e.target)){let n=this.floorsById.get(e.target.floor.id);n&&((o=n.layers.get(Ti))==null||o.labelIds.delete(e.id.toString()))}this.renderer.remove(i)},removeAll:()=>{}});u(this,"Paths",{add:(e,i)=>{var p;let o=[],n=e[0].floorId||"root",s=0;for(let d of e){let{floorId:m="root",latitude:g,longitude:b}=d;m!==n&&(s++,n=m),o[s]==null&&o.push({floorId:m,coordinates:[]});let y=m===d.floorId?d:new J({longitude:b,latitude:g,floorId:m});o[s].coordinates.push(y)}let c=o.reduce((d,{floorId:m,coordinates:g},b)=>{if(b!==0){let C=o[b-1],v=C.coordinates[C.coordinates.length-1],S=g[0],M=nr(v),w=nr(S),T=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:C.floorId},geometry:{type:"Point",coordinates:M}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:w}}]},i,this.id);T&&d.push({...T,coordinates:[v,S]})}let y=this.renderer.addPath({type:"FeatureCollection",features:g.map(C=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:nr(C)}}))},i,m);return y&&d.push({...y,coordinates:g}),d},[]),l=new Rt({fraction:0}).to({fraction:1},(p=i==null?void 0:i.drawDuration)!=null?p:1e3).onUpdate(({fraction:d})=>{c.forEach(m=>{this.renderer.setState(m.id,{completeFraction:d})})}).start();return this.renderer.getTweenGroup().add(l),this.renderer.render(),this.animations.set(c[0].id.toString(),l),{paths:c,animation:zg(l).then(()=>{this.animations.delete(c[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});x(this,si,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=n.core,this.api=n,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new mp({currentMapGetter:()=>this}),this.DynamicFocus=new Us(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(p=i==null?void 0:i.mvf)!=null?p:{};let s=P4(this.mvf["styles.json"]||{});if(this.styleMap=s,P(this,si,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!i){this.id!=="outdoors-container"&&L.warn("Map (".concat(this.id,") created with no data."));let b=new xp({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(b.id,b),this.currentFloorStackId=b.id;let y=new fp(b.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,a(this,si),o!=null?o:{});b.addFloor(y),this.floorsById.set(y.id,y),this.setFloor(y.id);return}let c=i.getMVFFeatureByType("floor-stack");(c==null||c.length===0)&&L.throw("MVF does not contain any Floor Stacks.");for(let b of c){let y=new xp(b,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[b.id]);if(y.floorIds.length!==0){for(let C of y.floorIds){let v=i.getMVFFeatureById("floor",C);if(v!=null){let S=this.mvf.space[v.id],M=this.mvf.obstruction[v.id];if((S==null||S.features.length===0)&&(M==null||M.features.length===0))continue;let w=new fp(y.id,v,this.renderer,a(this,si),o!=null?o:{},this.mvf,s);y.addFloor(w),this.floorsById.set(w.id,w)}}this.floorStacksById.set(b.id,y),this.currentFloorStackId||(this.currentFloorStackId=b.id)}}for(let[b]of Object.entries(i.facadesBySpaceId)){let y=i.getById("space",b);y&&(this.outdoorFloorStacks.add(y.floor.floorStack.id),(m=this.floorsById.get(y.floor.id))==null||m.setVisible(!0))}let l=(g=this.mvf.enterprise)==null?void 0:g.venue.defaultMap;if(o!=null&&o.initialFloor){let b=Nl(o.initialFloor);b&&this.floorsById.has(b)?l=b:L.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||L.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){L.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){L.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||L.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,p;if(this.StackedMaps.expandedFactor!==0)return;let i=this.floorsById.get(e),o=this.floorStacksById.get(this.currentFloorStackId);if(i&&o)if(!((n=a(this,si))!=null&&n.enabled)||i.floorStackId!==(o==null?void 0:o.id))for(let d of this.floorStacksById.values())this.options.keepOutdoorGeometryVisible&&this.outdoorFloorStacks.has(d.id)||d.floorObjects.forEach(m=>{m.id!==e&&(this.DynamicFocus.enabled&&this.DynamicFocus.focusedFacades.some(g=>g.floorStack.id!==o.id&&g.floorStack.defaultFloor.id===m.id)||m.setVisible(!1))});else{let d=ES(this.currentFloorStack.floorObjects,i,a(this,si).floorHeight,((c=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:c.map(m=>m.id))||[]);(p=(l=this.api)==null?void 0:l.Outdoor)==null||p.setOpacity(d.outdoorOpacity),d.floorStates.forEach(m=>{m.floor.setVisible(m.visible);for(let[g,b]of m.floor.layers)m.visibleLayers.includes(g)?b.show():b.hide();this.renderer.setState("Footprint-".concat(m.floor.id),{height:m.footprint.height,altitude:m.footprint.altitude})}),a(this,si).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*a(this,si).floorHeight)}}setFloor(e,i){if(this.currentFloorId===e)return;let o=this.floorsById.get(e);if(!o){L.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let n=this.currentFloorId;if(this.publish("floor-change-start",{previousFloorId:n,floorId:e,reason:i}),this.DynamicFocus.enabled){let s=this.floorStacksById.get(o.floorStackId);if(s)for(let c of s.floorObjects)c.id!==e&&c.setVisible(!1)}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.DynamicFocus.enabled||this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.DynamicFocus.enabled||this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id,previousFloorId:n})}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};si=new WeakMap;function FS(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}f();var Fr,Fp,Ap=class{constructor({currentMapGetter:t}){x(this,Fr,new Map);x(this,Fp);P(this,Fp,t)}get currentMap(){return a(this,Fp).call(this)}getById(t){return a(this,Fr).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 ki(s.id.toString(),c,t);return a(this,Fr).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var i;let e=a(this,Fr).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),a(this,Fr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Fr).forEach(({marker:e})=>{this.remove(e),t.push(e),a(this,Fr).delete(e.id.toString())}),t}setPosition(t,e){var s;let i=e.anchorTarget;if(!i){L.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){L.error("Cannot determine the current map.");return}let n=a(this,Fr).get(t.id);if(!n){L.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(n.entityId,nr(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 L.error("Cannot determine coordinate from target."),Promise.resolve();let n=this.currentMap;if(!n)return L.error("Cannot determine the current map."),Promise.resolve();let s=a(this,Fr).get(t.id);return s?(s.marker.updateTarget(e),n.Markers.animateTo(s.entityId,nr(o),(c=o.floorId)!=null?c:n.currentFloorId,i)):(L.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Fr=new WeakMap,Fp=new WeakMap;f();var Vi,Bp,kp=class{constructor({currentMapGetter:t}){x(this,Vi,new Map);x(this,Bp);P(this,Bp,t)}get currentMap(){return a(this,Bp).call(this)}getById(t){return a(this,Vi).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(nr(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 Kc(s.id.toString(),e,t);return a(this,Vi).set(c.id,{image:c,entityId:s.id.toString()}),c}remove(t){var i;let e=a(this,Vi).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),a(this,Vi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Vi).forEach(({image:e})=>{this.remove(e),t.push(e),a(this,Vi).delete(e.id.toString())}),t}};Vi=new WeakMap,Bp=new WeakMap;f();var li,Rp,_p=class{constructor({currentMapGetter:t}){x(this,li,new Map);x(this,Rp);P(this,Rp,t)}get currentMap(){return a(this,Rp).call(this)}getById(t){return a(this,li).get(t)}add(t,e,i){let o=[t],n=o.reduce((l,p)=>{var d;return p?(l.has(p.floorId)||l.set(p.floorId,[]),(d=l.get(p.floorId))==null||d.push(p),l):(L.error("Cannot determine coordinate from options."),l)},new Map);if(!o.length)throw new Error("targets should not be empty when adding a model");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let c=[];return n.forEach((l,p)=>{let d=ve();s.Models.add(d,l,{...i,url:e,floorId:p}).forEach(({id:g})=>{let b=new ra(g.toString(),d,l[0]);a(this,li).set(b.id,{model:b,entityId:g.toString(),groupId:d}),c.push(b)})}),c[0]}remove(t){var i;let e=a(this,li).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),a(this,li).delete(t.id.toString()))}removeAll(){let t=[];return a(this,li).forEach(({model:e})=>{var o;let i=a(this,li).get(e.id);i&&(t.push(e),(o=this.currentMap)==null||o.Models.remove(i.entityId,i.groupId),a(this,li).delete(e.id.toString()))}),t}};li=new WeakMap,Rp=new WeakMap;f();var ci,Gp,Np=class{constructor({currentMapGetter:t}){x(this,ci,new Map);x(this,Gp);P(this,Gp,t)}get currentMap(){return a(this,Gp).call(this)}getById(t){return a(this,ci).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let o=i.Paths.add(t,e),n=o.paths.map(c=>c.id.toString()),s=new Tr(ve(),o.animation,t,o.paths);for(let c of n)a(this,ci).set(c,{path:s,entityIds:n});return a(this,ci).set(s.id,{path:s,entityIds:n}),s}remove(t){var i;let e=a(this,ci).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),a(this,ci).delete(t.id),e.entityIds.forEach(o=>a(this,ci).delete(o)))}removeAll(){let t=[];return a(this,ci).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};ci=new WeakMap,Gp=new WeakMap;f();var XS=tu(hx(),1);f();var zy="#2266ff",_w="#808080",kS="#f5f5f5";var BS={radius:10,color:zy,inactiveColor:_w,heading:{color:zy,opacity:.7},accuracyRing:{color:zy,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};f();var _S="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";f();var RS=(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 kr;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 Br(c,{depth:.1,bevelEnabled:!1,UVGenerator:Nw(t)})},qy=(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 K(0,o)},Nw=r=>({generateTopUV:(t,e,i,o,n)=>{let s=e[i*3],c=e[i*3+1],l=e[o*3],p=e[o*3+1],d=e[n*3],m=e[n*3+1];return[qy(s,c,r),qy(l,p,r),qy(d,m,r)]},generateSideWallUV:()=>[new K(0,1),new K(0,1),new K(0,1),new K(0,1)]});function NS(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}function Gw([r,t],[e,i],[o,n]){let s=e-r,c=i-t,l=s**2+c**2;if(l===0)return;let p=((o-r)*s+(n-t)*c)/l,d;p<=0?d=[r,t]:p>=1?d=[e,i]:d=[r+p*s,t+p*c];let m=cu([o,n],d);return{proportion:Math.max(0,Math.min(1,p)),intersection:d,distance:m}}function GS(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],p=Gw(c,l,t);p!=null&&p.distance<e&&(e=p.distance,i=p.intersection,o=s,n=p.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:o,proportion:n}}function VS(r,t){let e=new mi({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,o=.35*4,n=RS(Math.PI/6,o,i);new Pa().load(_S,c=>{e.alphaMap=c,e.needsUpdate=!0});let s=new oe(n,e);return s.position.z=-.05,s.renderOrder=0,s}function jS(r,t){let e=new nu(1,1,.05,32),i=new mi({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),o=new oe(e,i);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}function US(r){let t=new nu(.35,.35,.07,32),e=new mi({transparent:!0,color:kS,depthTest:!1,depthWrite:!1}),i=new oe(t,e);i.renderOrder=2;let o=new nu(.35*.8,.35*.8,.01,32),n=new mi({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),s=new oe(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}}var YS=tu(HS(),1);var Xh="blue-dot",fa,ji,zt,qt,Ui,ma,ga,ya,Ge,jt,Vp,Hi,jp,Up,Hp,Wp,Hh,pi,Wi,Wh,ba,Xp,ui,Ws=class extends ee{constructor(e,i){super();this.core=e;this.geoJSONApi=i;x(this,fa,null);u(this,"geometry");x(this,ji);x(this,zt);x(this,qt);x(this,Ui);x(this,ma);x(this,ga);x(this,ya);x(this,Ge,BS);x(this,jt,1);x(this,Vp);x(this,Hi);u(this,"state","disabled");u(this,"following",!1);x(this,jp,e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)});x(this,Up,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,jp).call(this,n.id):void 0}return i});x(this,Hp,e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,o,n,s]=e.children;if(a(this,Hh).call(this),o.scale.set(a(this,jt),a(this,jt),a(this,jt)),o.position.z=.07/2*a(this,jt),n.scale.set(a(this,jt),a(this,jt),a(this,jt)),n.position.z=.07*a(this,jt),this.state==="active"){n.material.color.set(a(this,Ge).color);let c=this.accuracy;c!=null?(i.visible=!0,a(this,ga)&&a(this,ga).stop(),P(this,ga,new Rt({scale:i.scale.x}).to({scale:c/2},150).onUpdate(({scale:p})=>{i.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(a(this,ga))):i.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,a(this,ya)&&a(this,ya).stop();let{start:p,end:d}=pu(s.rotation.z,-ne.degToRad(l));P(this,ya,new Rt({rotation:p}).to({rotation:d},150).onUpdate(({rotation:m})=>{s.rotation.z=m}).start()),this.core.getTweenGroup().add(a(this,ya)),s.scale.set(a(this,jt),a(this,jt),1)}else s.visible=!1}else this.state==="inactive"&&(n.material.color.set(a(this,Ge).inactiveColor),s.visible=!1,i.visible=!1)});x(this,Wp,e=>{var s,c;let i;try{i=Ww.parse(NS(e,a(this,zt)))}catch(l){a(this,pi).call(this,"error"),L.error("BlueDot: Position parse failed",l instanceof N.ZodError?l.message:String(l)),this.publish("error");return}a(this,Ge).debug&&L.log("BlueDot: Parsed position",i),P(this,qt,i),a(this,pi).call(this,"position-update"),a(this,Ui)&&clearTimeout(a(this,Ui)),typeof a(this,Ge).timeout=="number"&&a(this,Ge).timeout<1/0&&P(this,Ui,setTimeout(()=>{a(this,Ge).debug&&L.log("BlueDot: Position timed out after ".concat(a(this,Ge).timeout,"ms")),a(this,pi).call(this,"timeout"),this.core.render()},a(this,Ge).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(s=i.floor)==null?void 0:s.elevation,accuracy:i.accuracy}});let o=i.floor!=null?i.floor.id:"outdoors-container",n=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(Xh,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:l=>{let p=jS(a(this,Ge).accuracyRing.color,a(this,Ge).accuracyRing.opacity),{outerMesh:d,innerMesh:m}=US(a(this,Ge).color),g=VS(a(this,Ge).heading.color,a(this,Ge).heading.opacity);l.add(p),p.visible=!1,l.add(d),l.add(m),l.add(g),g.visible=!1,a(this,Hp).call(this,l)},update:a(this,Hp)},{visible:!0,interactive:!0},o);else{let l=this.core.getState(this.geometry);n=[l.position[0],l.position[1]]}a(this,ma)&&a(this,ma).stop(),P(this,ma,new Rt(n).to([i.longitude,i.latitude],1e3).easing(Ae.Cubic.Out).onUpdate(l=>{if(this.geometry){let p={position:[l[0],l[1]]};p.parent=o,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(a(this,ma)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});u(this,"onPositionUpdate",e=>{var i,o,n,s,c;if(this.state!=="disabled"){try{Hw.parse(e)}catch(l){a(this,pi).call(this,"error"),L.error("BlueDot: Browser sent invalid position",l instanceof N.ZodError?l.message:String(l)),this.publish("error");return}P(this,ji,{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,Up).call(this,(c=e.coords)==null?void 0:c.floorLevel)}),a(this,Wp).call(this,a(this,ji))}});u(this,"onPositionError",e=>{var i;switch(a(this,pi).call(this,"error"),e.code){case e.PERMISSION_DENIED:L.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:L.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:L.error("Geolocation request timed out.",e);break;default:L.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)});x(this,Hh,()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==a(this,Vp)){P(this,Vp,e);let o=(i=this.core.getMetresPerPixel())!=null?i:1;P(this,jt,Math.max(a(this,Ge).radius/(.35/o),1))}});x(this,pi,e=>{let i=Uw[this.state].actions[e];if(i){switch(a(this,Ge).debug&&L.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 L.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))});x(this,Wi);x(this,Wh,()=>{if(a(this,Wi)==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);P(this,Wi,(0,YS.default)(i.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return a(this,Wi)});x(this,ba,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),a(this,ui)&&(this.off("position-update",a(this,ui)),P(this,ui,void 0)),this.following=!1,P(this,Wi,void 0),this.core.off("user-interaction-start",a(this,ba)),this.geoJSONApi.currentMap.off("navigation-active-path-change",a(this,Xp)),this.publish("follow-change",{following:!1})});x(this,Xp,()=>{P(this,Wi,void 0)});x(this,ui);u(this,"follow",(e,i)=>{var n,s,c,l;if(e===!1){a(this,ba).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&L.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(n=i==null?void 0:i.zoomLevel)!=null?n:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(s=i==null?void 0:i.pitch)!=null?s:45,duration:(c=i==null?void 0:i.duration)!=null?c:1e3,easing:(l=i==null?void 0:i.easing)!=null?l:"ease-in-out"};this.following?a(this,ui)&&this.off("position-update",a(this,ui)):(this.following=!0,this.core.on("user-interaction-start",a(this,ba)),this.geoJSONApi.currentMap.on("navigation-active-path-change",a(this,Xp))),P(this,ui,p=>{let{coordinate:d,heading:m,floor:g}=p;if(o.center=[d.longitude,d.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),P(this,Wi,void 0)),e==="position-and-heading")o.bearing=m!=null?m:void 0;else if(e==="position-and-path-direction"){let b=a(this,Wh).call(this);if(b!=null){let y=GS(b,[d.longitude,d.latitude]);if(y!=null){let C=b[y.segmentIndex],v=b[y.segmentIndex+1];o.bearing=M1(C,v)}}}this.core.camera.animateTo(o)}),this.on("position-update",a(this,ui)),this.publish("follow-change",{following:!0,mode:e})})}get heading(){var e;return(e=a(this,qt))==null?void 0:e.heading}get accuracy(){var e;return(e=a(this,qt))==null?void 0:e.accuracy}get coordinate(){var e,i;if(a(this,qt)!=null)return(a(this,Hi)==null||((e=this.floor)==null?void 0:e.id)!==a(this,Hi).floorId||a(this,qt).latitude!==a(this,Hi).latitude||a(this,qt).longitude!==a(this,Hi).longitude)&&P(this,Hi,new J(a(this,qt).latitude,a(this,qt).longitude,(i=this.floor)==null?void 0:i.id)),a(this,Hi)}get floor(){var e;return(e=a(this,qt))==null?void 0:e.floor}enable(e){P(this,Ge,(0,XS.default)({},e,a(this,Ge))),a(this,pi).call(this,"enable"),this.watchDevicePosition(a(this,Ge).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),a(this,Ui)&&(clearTimeout(a(this,Ui)),P(this,Ui,void 0)),this.following&&a(this,ba).call(this),this.watchDevicePosition(!1),P(this,qt,void 0),P(this,zt,void 0),a(this,pi).call(this,"disable")}watchDevicePosition(e){if(a(this,fa)&&(navigator.geolocation.clearWatch(a(this,fa)),P(this,fa,null)),a(this,ji)&&P(this,ji,void 0),e){if(this.state==="disabled"){L.warn("BlueDot must be enabled before watching browser position.");return}P(this,fa,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var o,n;e==null?P(this,zt,void 0):"coords"in e?P(this,zt,Object.assign({},a(this,zt),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:a(this,Up).call(this,e.coords.floorLevel)})):(P(this,zt,Object.assign({},a(this,zt),e)),"floorOrFloorId"in e&&(a(this,zt).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?a(this,jp).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((o=a(this,zt))==null?void 0:o.latitude)!=null&&((n=a(this,zt))==null?void 0:n.longitude)!=null||a(this,ji)!=null)&&a(this,Wp).call(this,a(this,ji))}};fa=new WeakMap,ji=new WeakMap,zt=new WeakMap,qt=new WeakMap,Ui=new WeakMap,ma=new WeakMap,ga=new WeakMap,ya=new WeakMap,Ge=new WeakMap,jt=new WeakMap,Vp=new WeakMap,Hi=new WeakMap,jp=new WeakMap,Up=new WeakMap,Hp=new WeakMap,Wp=new WeakMap,Hh=new WeakMap,pi=new WeakMap,Wi=new WeakMap,Wh=new WeakMap,ba=new WeakMap,Xp=new WeakMap,ui=new WeakMap;var Uw={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"}}},Hw=N.object({coords:N.object({latitude:N.number(),longitude:N.number(),accuracy:N.number(),altitude:N.number().optional().nullable(),altitudeAccuracy:N.number().optional().nullable(),heading:N.number().optional().nullable(),speed:N.number().optional().nullable(),floorLevel:N.number().optional().nullable()}),timestamp:N.number()}),Ww=N.object({latitude:N.number(),longitude:N.number(),floor:N.custom().optional(),accuracy:N.number().optional(),heading:N.number().optional().nullable()});f();var Xi,Zp,Yp=class{constructor({currentMapGetter:t}){x(this,Xi,new Map);x(this,Zp);P(this,Zp,t)}get currentMap(){return a(this,Zp).call(this)}getById(t){return a(this,Xi).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 Ho(n);return a(this,Xi).set(s.id,s),s}remove(t){var i;a(this,Xi).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),a(this,Xi).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Xi).forEach(e=>{this.remove(e),t.push(e.id),a(this,Xi).delete(e.id.toString())}),t}};Xi=new WeakMap,Zp=new WeakMap;f();var qp,zp=class{constructor({currentMapGetter:t}){x(this,qp);P(this,qp,t)}get currentMap(){return a(this,qp).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(Te))continue;let c=s.layers.get(Te);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===Co&&!(zr in t)){let l=c.layers.get(zr);l&&"color"in t[n]&&((o=this.currentMap)==null||o.renderer.setState(l,{color:t[n].color}))}}}};qp=new WeakMap;f();var $y={opacity:1},yt,$p,Jp,Qo,Yi,va,Jy,ZS,Xs=class{constructor(t,e){x(this,va);x(this,yt);x(this,$p,[]);x(this,Jp,{opacity:"initial"});x(this,Qo,{opacity:new Map});x(this,Yi,new Set);P(this,yt,t),P(this,$p,e||[]);let i=a(this,yt).map;i&&i.on("idle",()=>{a(this,Qo).opacity.size||_(this,va,Jy).call(this,i)})}setStyle(t){var e,i;if(a(this,yt).map){(e=a(this,yt).map)==null||e.setStyle(t),a(this,Yi).size&&(a(this,Yi).clear(),this.hide()),_(this,va,ZS).call(this),_(this,va,Jy).call(this,a(this,yt).map),this.setOpacity(a(this,Jp).opacity),(i=a(this,yt).map)==null||i.moveLayer(lf);for(let[o,n,s]of a(this,$p)||[])a(this,yt).hideOutdoorLayersIntersectingPolygons(o,n,s)}}get map(){return a(this,yt).map}get enabled(){return!!a(this,yt).map}get visible(){return a(this,Yi).size===0}show(){let t=a(this,yt).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{a(this,Yi).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),a(this,Yi).clear())}hide(t=[]){let e=a(this,yt).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(o=>{let n=e.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&n!=="none"&&(e.setLayoutProperty(o.id,"visibility","none"),a(this,Yi).add(o.id))})}setOpacity(t,e=[]){var n,s;let i=a(this,yt).map;if(!i)return;let o=(s=(n=a(this,yt).map)==null?void 0:n.getStyle())==null?void 0:s.layers;o&&i.once("idle",()=>{o.forEach(c=>{let l=i.getLayoutProperty(c.id,"visibility");if(!e.includes(c.id)&&l!=="none")try{let p=a(this,Qo).opacity.get(c.id);p!==void 0&&(c.id==="background"||(c.type==="symbol"?(i.setPaintProperty(c.id,"icon-opacity",t==="initial"?p[0]:t),i.setPaintProperty(c.id,"text-opacity",t==="initial"?p[1]:t)):i.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?p[0]:t)),a(this,Jp).opacity=t)}catch(p){L.warn("Error setting opacity:",p)}})})}};yt=new WeakMap,$p=new WeakMap,Jp=new WeakMap,Qo=new WeakMap,Yi=new WeakMap,va=new WeakSet,Jy=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,Qo).opacity.set(i.id,[(n=t.getPaintProperty(i.id,"icon-opacity"))!=null?n:$y.opacity,(s=t.getPaintProperty(i.id,"text-opacity"))!=null?s:$y.opacity]):a(this,Qo).opacity.set(i.id,[(c=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?c:$y.opacity,void 0])))})},ZS=function(){Object.values(a(this,Qo)).forEach(t=>t.clear())};f();var Zi,zi,Ko,Yh=class{constructor({currentMapGetter:t}){x(this,Zi);x(this,zi,new Map);x(this,Ko,new Map);P(this,Zi,t)}labelAll(t={}){var o,n;let e=[],i=new Set;return(n=(o=a(this,Zi).call(this))==null?void 0:o.Text3D.labelAll(t))==null||n.forEach(({textInfo:s,target:c})=>{let l=s.id.toString(),p=a(this,Ko).get(l);if(p){i.has(l)||e.push(p.text3DView),i.add(l);return}i.add(l);let d=new Wo(l,c);a(this,zi).set(d.id,{targetId:c.id,text3d:l,text3DView:d}),a(this,Ko).set(l,{text3DView:d}),e.push(d)}),e}label(t,e,i={}){var n;if(a(this,Zi).call(this))if(je.is(t)){let s=(n=a(this,Zi).call(this))==null?void 0:n.Text3D.label(t,e,i);if(!s)return;let c=s.textInfo.id.toString(),l=a(this,Ko).get(c);if(l)return l.text3DView;let p=new Wo(c,s.target);return a(this,zi).set(p.id,{targetId:s.target.id,text3d:c,text3DView:p}),a(this,Ko).set(c,{text3DView:p}),p}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,zi).get(e);i&&((o=a(this,Zi).call(this))==null||o.Text3D.remove(i.text3d),a(this,zi).delete(e),a(this,Ko).delete(i.text3d))}removeAll(){a(this,zi).forEach(t=>{var e;(e=a(this,Zi).call(this))==null||e.Text3D.remove(t.text3d)}),a(this,zi).clear()}};Zi=new WeakMap,zi=new WeakMap,Ko=new WeakMap;var Zh=.05,Qp=class{constructor(t,e){u(this,"core");u(this,"mapObjects",[]);u(this,"id");u(this,"mapDataExternal",{});u(this,"mapsByFloorId",{});u(this,"mapData");u(this,"currentMap");u(this,"hiddenOutdoorGeometries",[]);u(this,"lastFacadeIntersected");u(this,"mapView");u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"Outdoor");u(this,"BlueDot");u(this,"Shapes");u(this,"Style");u(this,"Images");u(this,"update",()=>{this.core.render()});this.core=t,this.mapView=e,this.Camera=new cp(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new Lp("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")});let o=new np(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let n=l=>p=>{var F,O,B;let d=[],m=[],g=[],b=[];p.labels.forEach(k=>{let G=this.Labels.getById(k.toString());G&&d.push(G.label)}),p.markers.forEach(k=>{let G=this.Markers.getById(k.toString())||this.Navigation.getMarkerById(k.toString());G&&m.push(G.marker)}),p.models.forEach(k=>{let G=this.Models.getById(k.toString());G&&g.push(G.model)}),p.paths.forEach(k=>{let G=this.Paths.getById(k.toString())||this.Navigation.getPathById(k.toString());G&&b.push(G.path)});let y=p.geometry.includes(Xh),C=p.geometry.filter(k=>k!==Xh)[0],v;C&&(v=(F=this.getMapDataInternal())==null?void 0:F.getById("space",C)),v||(v=(O=this.getMapDataInternal())==null?void 0:O.getById("object",C));let S=p.containers.reduce((k,G)=>{var X;let V=(X=this.getMapDataInternal())==null?void 0:X.getById("floor",G);return V&&Xt.is(V)&&k.push(V),k},[]),M,w=0;if(S.length>0){M=S[0].id;let k=this.core.getState(M);w=p.coordinate[2]?p.coordinate[2]-k.altitude:w}let T;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(k=>{this.core.setState(k.id,{hovered:!1})}),v&&je.is(v)&&(T=(B=this.getMapDataInternal())==null?void 0:B.facadesBySpaceId[C],T&&T.spaces.forEach(k=>{this.core.setState(k.id,{hovered:!0})})),this.lastFacadeIntersected=T;let D={coordinate:new J({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:M,verticalOffset:w}),spaces:v&&je.is(v)?[v]:[],objects:v&&Yt.is(v)?[v]:[],markers:m,labels:d,models:g,paths:b,blueDot:y,floors:S,facades:T?[T]:[]};"pointerEvent"in p&&(D.pointerEvent=p.pointerEvent),this.mapView.publish(l,D)};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 Ap(s),this.Models=new _p(s),this.Labels=new dp(s),this.Text3D=new Yh(s),this.Exporter=new up(s),this.Paths=new Np(s),this.Navigation=new sp(this.core,this,s.currentMapGetter),this.BlueDot=new Ws(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 Xs(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 kp(s),this.Shapes=new Yp(s),this.Style=new zp(s);let c=new Gh(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(Te);if(n){let s=n.layers.get(Co);s&&this.core.setState(s,Xg(e,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Te);if(n){let s=n.layers.get(zr);s&&this.core.setState(s,Xg(e,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Te);if(n){let s=n.layers.get(ts);s&&this.core.setState(s,Ed(e,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Te);if(n){let s=n.layers.get(rs);s&&this.core.setState(s,Ed(e,this.core.getState(s)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(jo.is(i))return this.core.setState(i.id,v4({...e,type:"label"},this.core.getState(i.id)));if(ki.is(i))return this.core.setState(i.id,C4({...e,type:"marker"},this.core.getState(i.id)));if((je.is(i)||Yt.is(i))&&this.core.setState(i.id,Yg({...e,type:"geometry"},this.core.getState(i.id))),Xr.is(i)&&this.core.setState(i.id,Ed({...e,type:"doors"},this.core.getState(i.id))),Ho.is(i)&&this.core.setState(i.id,tl(e,["altitude","color","opacity"])),ra.is(i)){let{position:o,scale:n,...s}=e,c=s;o&&(c.position=[o.longitude,o.latitude,o.verticalOffset]),n!=null&&(Array.isArray(n)?c.scale=n:c.scale=[n,n,n]),o&&i.updateTarget(o),this.core.setState(i.id,c)}if(Xt.is(i)){let o=this.currentMap.floorsById.get(i.id);if(o==null)return;let n=o.layers.get(Te);n!=null&&"geometry"in e&&this.core.setState(n.containerId,S4(e.geometry))}if(vr.is(i))for(let o of i.spaces)this.core.setState(o.id,Yg({...e,type:"geometry"},this.core.getState(o.id)));if(Wo.is(i)&&this.core.setState(i.id,tl(e,bf)),Tr.is(i))for(let o of i.segments)this.core.setState(o.id,tl(e,["color"]));Es.is(i)&&this.core.setState(i.id,tl(e,["color"]))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return cl(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var m,g,b,y;let o;try{o=cl(t)}catch(C){L.error("Error adding map",C),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 J(s[1],s[0])});let c=n["manifest.geojson"].features[0].properties.name,l=new Lp("mapObject-".concat(c),o,e,this),p=this.core.getBoundingArea(l.currentFloor.id);p==null&&L.error("Could not determine bounding box for map:",l.currentFloor.id);let d=(g=(m=e==null?void 0:e.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?g:[];if(d.length>0){let C,v=[];for(let S of l.floorStacksById.values())if(S.defaultFloor.footprint&&S.defaultFloor.footprint.geometry!=null&&((b=S.defaultFloor.footprint.geometry)==null?void 0:b.coordinates.length)>0){let M=S.defaultFloor.footprint,w=Od(M);C==null?C=w:T4(C,w),v.push(M)}v.length>0&&C!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(C,v,d),this.hiddenOutdoorGeometries.push([C,v,d]))}if(this.mapObjects.push(l),o.getMVFFeatureByType("floor").forEach(C=>{this.mapsByFloorId[C.id]=l}),l.on("navigation-connection-click",C=>{this.mapView.publish("navigation-connection-click",C)}),l.on("navigation-active-path-change",C=>{this.mapView.publish("navigation-active-path-change",C)}),l.StackedMaps.on("stacked-maps-state-change",({state:C})=>{this.mapView.publish("stacked-maps-state-change",{state:C})}),l.on("floor-change-start",C=>{var v,S,M,w;this.mapView.publish("floor-change-start",{reason:C.reason,floor:(S=(v=this.getMapDataInternal())==null?void 0:v.getById("floor",C.floorId))!=null?S:this.currentFloor,previousFloor:(w=(M=this.getMapDataInternal())==null?void 0:M.getById("floor",C.previousFloorId))!=null?w:this.currentFloor})}),l.on("floor-change",C=>{var v,S;this.mapView.publish("floor-change",{reason:C.reason,floor:this.currentFloor,previousFloor:(S=(v=this.getMapDataInternal())==null?void 0:v.getById("floor",C.previousFloorId))!=null?S:this.currentFloor})}),l.DynamicFocus.on("focus-change",C=>{this.mapView.publish("dynamic-focus-change",{facades:C.facades.map(v=>{var S;return(S=this.getMapDataInternal())==null?void 0:S.getById("facade",v)}).filter(v=>v!=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"&&p){let C=(y=e==null?void 0:e.screenOffsets)!=null?y:{top:Zh*this.core.canvasHeight,left:Zh*this.core.canvasWidth,right:Zh*this.core.canvasWidth,bottom:Zh*this.core.canvasHeight};this.core.camera.focusOn(p,{duration:i4,padding:C}).then(()=>{i(t)})}else i(t)})}setFloor(t,e){return this.currentMap.setFloor(Nl(t),e)}setFloorStack(t){return this.currentMap.setFloorStack(Nl(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw L.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw L.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw L.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw L.throw("Missing currentFloor");return e}getState(t){var o,n,s,c;if(typeof t=="object"&&vr.is(t)){L.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}typeof t=="object"&&Tr.is(t)&&L.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let e=M4(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:l,topColor:p,texture:d,topTexture:m,visible:g,height:b,opacity:y}=i;return{type:"walls",visible:g,color:l,topColor:p,texture:d?{url:d}:void 0,topTexture:m?{url:m}:void 0,height:b,opacity:y}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:l,topColor:p,texture:d,topTexture:m,visible:g,opacity:b}=i;return{type:"doors",visible:g,color:l,topColor:p,opacity:b,texture:d?{url:d}:void 0,topTexture:m?{url:m}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0,flipImageToFaceCamera:i.flipImageToFaceCamera,topColor:i.topColor};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((o=i.options)==null?void 0:o.rank)!==void 0&&i.options.interactive!==void 0){let l=typeof i.parent=="object"?i.parent.id:i.parent,p=this.Markers.getById(i.id.toString()),d=p!=null&&p.marker.target?p==null?void 0:p.marker.target.anchorTarget:void 0;return d==null&&(d=new J(i.position[1],i.position[0],l.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize}}else if(i.type==="model"){let l=i!=null&&typeof i.parent=="object"?i.parent.id.toString():(n=i.parent)==null?void 0:n.toString();return delete i.parent,{...i,position:new J({latitude:i.position[1],longitude:i.position[0],verticalOffset:i.position[2],floorId:l}),type:"model"}}else{if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&Ho.is(t)){let[l]=i.children;if(l.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(s=i.altitude)!=null?s:0,visible:i.visible,color:i.color,height:l.height,opacity:i.opacity}}else{if(i.type==="path")return{type:"path",color:i.color};if(i.type==="group-container"&&typeof t!="string"&&Xt.is(t)){let l=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Te);if(l)return{type:"floor",geometry:{opacity:this.core.getState(l.containerId).opacity}}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,e,i){var l;if(i!=null){let p=this.core.projectScreenXYToCoordinate(t,e,!0);return p?new J(p.coordinate[1],p.coordinate[0],i.id):void 0}let o=this.core.projectScreenXYToCoordinate(t,e);if(o==null||o.coordinate==null)return;let{coordinate:n,groupContainers:s}=o,c=(l=s==null?void 0:s.find(p=>{let d=p.userData.entityId.toString();return d.includes("f_")||d.includes("m_")}))==null?void 0:l.userData.entityId.toString();return new J(n[1],n[0],c)}getScreenCoordinateFromCoordinate(t){return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};f();f();var zh=class{constructor(t){u(this,"state");u(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};f();var zS=N.object({environment:N.union([N.literal("basic"),N.literal(!1)]).optional(),text3d:N.object({hoverColor:N.string().optional()}).optional(),geometry:N.object({hoverColor:N.string().optional()}).optional(),backgroundColor:N.string().optional(),backgroundAlpha:N.number().optional()}).strict();var Kp,Y,qi,Ys=class extends ee{constructor(e){super();x(this,Kp,{});x(this,Y);x(this,qi);u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Images");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"BlueDot");u(this,"Style");u(this,"Shapes");u(this,"Outdoor");u(this,"update",()=>{a(this,Y).core.render()});u(this,"getDirections",(e,i,o)=>{var n;return(n=a(this,Y).getMapData())==null?void 0:n.getDirections(e,i,o)});u(this,"getDirectionsMultiDestination",(e,i,o)=>{var n;return(n=a(this,Y).getMapData())==null?void 0:n.getDirectionsMultiDestination(e,i,o)});u(this,"on",(e,i)=>{super.on(e,i)});u(this,"off",(e,i)=>{super.off(e,i)});u(this,"Debug");P(this,qi,e);let i=new Qp(e,this);P(this,Y,i),this.Camera=a(this,Y).Camera,P(this,Kp,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,qi).container.dataset.version=I.env.npm_package_version,this.Debug=new zh(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{zS.parse(e)}catch(c){L.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,p=(s=e.backgroundAlpha)!=null?s:a(this,Y).core.backgroundAlpha;a(this,Y).core.setBackgroundColor(l,p)}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,Kp)}getDimensions(){return{width:a(this,qi).canvasWidth,height:a(this,qi).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 typeof e=="object"?new J(e):new J(e,i,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(e,i,o){return a(this,Y).createCoordinateFromScreenCoordinate(e,i,o)}getScreenCoordinateFromCoordinate(e){return a(this,Y).getScreenCoordinateFromCoordinate(e)}auto(){return{labels:this.Labels.all()}}get __core(){if(I.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-MC5DPTXA.js");await new i(this,a(this,Y)).enable(e)}async takeScreenshot(){return await a(this,qi).renderSync(),a(this,qi).rendererDomElement.toDataURL("image/png")}};Kp=new WeakMap,Y=new WeakMap,qi=new WeakMap;f();f();var qh=class extends ee{constructor(e){super();u(this,"gl");u(this,"el",document.createElement("div"));u(this,"core");u(this,"origin");u(this,"map");u(this,"layer");u(this,"handleStyleChange",()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))});u(this,"handleMove",()=>{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(ne.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ne.degToRad(this.map.getPitch()))});u(this,"handleError",e=>{L.warn(e)});this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new qc(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=G1.fromLngLat(this.origin,0);return this.layer=fu(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}};var Ca,Zs,en,Sa,$h=class $h extends ee{constructor(e,i,o){super();x(this,Ca);x(this,Zs);x(this,en);x(this,Sa);u(this,"on",(e,i)=>{super.on(e,i)});u(this,"off",(e,i)=>{super.off(e,i)});P(this,Sa,new qh(e)),P(this,Ca,i),P(this,Zs,o)}onAdd(e){var n,s;let i=a(this,Sa).onAdd(e),o={...Tn,...(n=a(this,Zs))!=null?n:{},outdoorView:{token:a(this,Ca).outdoorViewToken,...(s=a(this,Zs))==null?void 0:s.outdoorView}};return P(this,en,new Ys(a(this,Sa).core)),a(this,en).addMap(a(this,Ca),o).then(()=>{this.publish("loaded",{mapView:a(this,en),mapData:a(this,Ca)})}),i}onRemove(){a(this,en)&&a(this,en).clear(),$h.instance=null,a(this,Sa).onRemove()}};Ca=new WeakMap,Zs=new WeakMap,en=new WeakMap,Sa=new WeakMap,u($h,"instance");var zs=$h;f();var qS=(r,{id:t}={})=>{let e=Array.isArray(r)?r:[r];if(!e.every(n=>typeof n=="string"))return;let i=e.join(""),o=null;if(t){let n=document.getElementById(t);n instanceof HTMLStyleElement&&(o=n)}o==null&&(o=document.createElement("style")),t&&t!==""&&(o.id=t),o.textContent=i,document.head.appendChild(o)};var $S=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var JS=".mappedin-marker {\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n";var QS=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var KS=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var ex=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var tx='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var Jw=[$S,JS,QS,KS,ex,tx],rx;function BK(r){rx=r}var _K=async(r,t)=>{let e,i=dn();t&&i.updateByUserOption(t);try{t&&(e=(await un({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(s){L.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new hs(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new vu(o)},ix=!1;function RK(r){ix=r}var NK=async(r,t)=>{var p,d,m,g;let e={...t||{}},i,o=dn();o.updateByUserOption(e);let n={};if("type"in r&&typeof r.type=="string"){if(n.enterprise=(p=r.options)==null?void 0:p.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let b=await Su(r.main);i=Cu(b),n.languagePacks=[];for(let y of(d=r.languagePacks)!=null?d:[])y.localePack instanceof Uint8Array&&n.languagePacks.push({language:y.language,localePack:await Ra(y.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 b=await un(e,n.enterprise);s=(b==null?void 0:b.accessToken)||""}if(n.outdoorViewToken=s,n.env=o,s&&!n.enterprise)try{n.sasToken=(await _a(e,s)).token}catch(b){L.error("Failed to fetch SAS token.",b)}n.getMapDataOptions=e;let c=new hs(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 vu(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},Qw=async r=>{var C;let t=ix,e,i=dn();i.updateByUserOption(r);let o={...r};if("accessToken"in o){e=o.accessToken;let{aud:v,sub:S}=lu(e);(n4.some(M=>v.includes(M))||S&&S.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 un(o,t)).accessToken;else throw new Error("Missing key or secret.");o.layoutId!=null&&(t?o.layoutId!=="draft"&&L.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):L.warn("layoutId is currently unsupported!")),o.baseUri=i.getBaseUri(t);let n=performance.now(),s,c;if(t){let v={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},S=await If(v);s=S.compressed,c=S.localePacks}else s=await Pf(o,e);let l=performance.now(),p=await Su(s),d=Cu(p),m=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(d);let g;if(!t)try{g=(await _a(o,e)).token}catch(v){L.error("Failed to fetch SAS token.",v)}let b=new hs(d,{env:i,outdoorViewToken:e,sasToken:g,enterprise:t,localePacksUrls:c,binaryBundle:s,getMapDataOptions:o}),y=new vu(b,{search:r.search});if(b.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:(C=o.analytics)==null?void 0:C.context}),b.Analytics.sendGetMapDataEvent({parseDuration:m-l,downloadDuration:l-n,viewId:o.viewId}),"language"in o)try{await y.changeLanguage(o.language)}catch{}return y},GK=Qw,VK=(r,t)=>{zs.instance!=null&&L.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},Kw=async(r,t,e)=>{var p,d,m,g,b,y,C,v,S,M,w,T,D;let i=performance.now(),o=wg(e,t);o&&Tg(o),((p=o.injectStyles)==null||p)&&qS(Jw,{id:"mappedin__styles"});let n=a4((d=t.outdoorViewToken)!=null?d:""),s=cl(t);(m=o.outdoorView)!=null&&m.style&&s.envControl.updateTileServerBaseUrl((g=o.outdoorView)==null?void 0:g.style);let c=await pS(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(b=o.style)==null?void 0:b.backgroundAlpha,backgroundColor:(y=o.style)==null?void 0:y.backgroundColor,outdoorView:(C=o.outdoorView)!=null&&C.token?{headers:{"x-mappedin-tiles-key":(v=o.outdoorView)==null?void 0:v.token},style:t.getEnv().tileServerUri,enabled:!!((S=o.outdoorView)!=null&&S.enabled),lowDpi:(M=o.outdoorView)==null?void 0:M.lowDpi}:void 0,watermark:{...o.watermark,visible:((w=o.watermark)==null?void 0:w.visible)||!s.enterpriseMode&&!n.remove_watermark,onClick:rx||void 0},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((T=o.antialiasing)!=null&&T.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(D=o.occlusion)==null?void 0:D.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 Ys(c);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},jK=Kw;export{J as a,mo as b,bn as c,Ja as d,go as e,Xr as f,je as g,Xt as h,v9 as i,wn as j,Yt as k,bo as l,vo as m,Id as n,vr as o,Mi as p,Pd as q,Gg as r,Cu as s,Su as t,ls as u,Md as v,Q4 as w,bw as x,Ld as y,Ad as z,BK as A,_K as B,RK as C,NK as D,Qw as E,GK as F,VK as G,Kw as H,jK as I};