@mappedin/react-sdk 6.0.1-beta.11 → 6.0.1-beta.13

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.
@@ -1 +0,0 @@
1
- import{a as xy,b as R}from"./chunk-FX2Z4JKF.js";import{h as Hu,i as Wy,j as Wl}from"./chunk-N6VBKIZF.js";import{a as dr}from"./chunk-J2XPCSDV.js";import{A as Ty,B as Iy,C as wy,D as W,E as Nr,F as Ey,G as Gr,H as Wn,Ha as Zn,I as Rt,J as be,Ka as Xl,L as lr,La as Hy,M as da,O as Me,Oa as jy,P as Dy,Q as ma,R as Ly,Ra as hr,S as Oy,Sa as Xy,T as _y,U as Vr,X as Ay,Y as ky,Z as Un,a as Gl,c as Rr,ca as By,d as sr,fa as Vl,ga as Yn,ha as Hl,ja as Yi,m as My,n as Py,pa as Ry,qa as li,ra as jl,sa as Fy,ta as cr,u as Fr,ua as pr,va as Ny,w as le,wa as Gy,x as z,xa as Vy,za as ur}from"./chunk-AT6KMC44.js";import{a as s,b as B,c as Sy,d as ar,e as h,f as l,g as P,h as I,i as Y,j as m,k as b}from"./chunk-WAXG3UYQ.js";var Tg=B((ah,sh)=>{m();(function(r,t){typeof ah=="object"&&typeof sh<"u"?sh.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(ah,function(){"use strict";function r(v,S,E,w,T){s(function D(_,N,V,F,X){for(;F>V;){if(F-V>600){var j=F-V+1,ee=N-V+1,ve=Math.log(j),Se=.5*Math.exp(2*ve/3),we=.5*Math.sqrt(ve*Se*(j-Se)/j)*(ee-j/2<0?-1:1),He=Math.max(V,Math.floor(N-ee*Se/j+we)),lt=Math.min(F,Math.floor(N+(j-ee)*Se/j+we));D(_,N,He,lt,X)}var xe=_[N],ke=V,Ee=F;for(t(_,V,N),X(_[F],xe)>0&&t(_,V,F);ke<Ee;){for(t(_,ke,Ee),ke++,Ee--;X(_[ke],xe)<0;)ke++;for(;X(_[Ee],xe)>0;)Ee--}X(_[V],xe)===0?t(_,V,Ee):t(_,++Ee,F),Ee<=N&&(V=Ee+1),N<=Ee&&(F=Ee-1)}},"t")(v,S,E||0,w||v.length-1,T||e)}s(r,"t");function t(v,S,E){var w=v[S];v[S]=v[E],v[E]=w}s(t,"i");function e(v,S){return v<S?-1:v>S?1:0}s(e,"n");var i=s(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()},"r");function n(v,S,E){if(!E)return S.indexOf(v);for(var w=0;w<S.length;w++)if(E(v,S[w]))return w;return-1}s(n,"e");function o(v,S){a(v,0,v.children.length,S,v)}s(o,"a");function a(v,S,E,w,T){T||(T=x(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var D=S;D<E;D++){var _=v.children[D];p(T,v.leaf?w(_):_)}return T}s(a,"h");function p(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}s(p,"o");function c(v,S){return v.minX-S.minX}s(c,"s");function u(v,S){return v.minY-S.minY}s(u,"l");function f(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}s(f,"f");function y(v){return v.maxX-v.minX+(v.maxY-v.minY)}s(y,"u");function g(v,S){return v.minX<=S.minX&&v.minY<=S.minY&&S.maxX<=v.maxX&&S.maxY<=v.maxY}s(g,"m");function C(v,S){return S.minX<=v.maxX&&S.minY<=v.maxY&&S.maxX>=v.minX&&S.maxY>=v.minY}s(C,"c");function x(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}s(x,"p");function M(v,S,E,w,T){for(var D=[S,E];D.length;)if(!((E=D.pop())-(S=D.pop())<=w)){var _=S+Math.ceil((E-S)/w/2)*w;r(v,_,S,E,T),D.push(S,_,_,E)}}return s(M,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(v){var S=this.data,E=[];if(!C(v,S))return E;for(var w=this.toBBox,T=[];S;){for(var D=0;D<S.children.length;D++){var _=S.children[D],N=S.leaf?w(_):_;C(v,N)&&(S.leaf?E.push(_):g(v,N)?this._all(_,E):T.push(_))}S=T.pop()}return E},i.prototype.collides=function(v){var S=this.data;if(!C(v,S))return!1;for(var E=[];S;){for(var w=0;w<S.children.length;w++){var T=S.children[w],D=S.leaf?this.toBBox(T):T;if(C(v,D)){if(S.leaf||g(v,D))return!0;E.push(T)}}S=E.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 E=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===E.height)this._splitRoot(this.data,E);else{if(this.data.height<E.height){var w=this.data;this.data=E,E=w}this._insert(E,this.data.height-E.height-1,!0)}else this.data=E;return this},i.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},i.prototype.clear=function(){return this.data=x([]),this},i.prototype.remove=function(v,S){if(!v)return this;for(var E,w,T,D=this.data,_=this.toBBox(v),N=[],V=[];D||N.length;){if(D||(D=N.pop(),w=N[N.length-1],E=V.pop(),T=!0),D.leaf){var F=n(v,D.children,S);if(F!==-1)return D.children.splice(F,1),N.push(D),this._condense(N),this}T||D.leaf||!g(D,_)?w?(E++,D=w.children[E],T=!1):D=null:(N.push(D),V.push(E),E=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 E=[];v;)v.leaf?S.push.apply(S,v.children):E.push.apply(E,v.children),v=E.pop();return S},i.prototype._build=function(v,S,E,w){var T,D=E-S+1,_=this._maxEntries;if(D<=_)return o(T=x(v.slice(S,E+1)),this.toBBox),T;w||(w=Math.ceil(Math.log(D)/Math.log(_)),_=Math.ceil(D/Math.pow(_,w-1))),(T=x([])).leaf=!1,T.height=w;var N=Math.ceil(D/_),V=N*Math.ceil(Math.sqrt(_));M(v,S,E,V,this.compareMinX);for(var F=S;F<=E;F+=V){var X=Math.min(F+V-1,E);M(v,F,X,N,this.compareMinY);for(var j=F;j<=X;j+=N){var ee=Math.min(j+N-1,X);T.children.push(this._build(v,j,ee,w-1))}}return o(T,this.toBBox),T},i.prototype._chooseSubtree=function(v,S,E,w){for(;w.push(S),!S.leaf&&w.length-1!==E;){for(var T=1/0,D=1/0,_=void 0,N=0;N<S.children.length;N++){var V=S.children[N],F=f(V),X=(j=v,ee=V,(Math.max(ee.maxX,j.maxX)-Math.min(ee.minX,j.minX))*(Math.max(ee.maxY,j.maxY)-Math.min(ee.minY,j.minY))-F);X<D?(D=X,T=F<T?F:T,_=V):X===D&&F<T&&(T=F,_=V)}S=_||S.children[0]}var j,ee;return S},i.prototype._insert=function(v,S,E){var w=E?v:this.toBBox(v),T=[],D=this._chooseSubtree(w,this.data,S,T);for(D.children.push(v),p(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 E=v[S],w=E.children.length,T=this._minEntries;this._chooseSplitAxis(E,T,w);var D=this._chooseSplitIndex(E,T,w),_=x(E.children.splice(D,E.children.length-D));_.height=E.height,_.leaf=E.leaf,o(E,this.toBBox),o(_,this.toBBox),S?v[S-1].children.push(_):this._splitRoot(E,_)},i.prototype._splitRoot=function(v,S){this.data=x([v,S]),this.data.height=v.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(v,S,E){for(var w,T,D,_,N,V,F,X=1/0,j=1/0,ee=S;ee<=E-S;ee++){var ve=a(v,0,ee,this.toBBox),Se=a(v,ee,E,this.toBBox),we=(T=ve,D=Se,_=void 0,N=void 0,V=void 0,F=void 0,_=Math.max(T.minX,D.minX),N=Math.max(T.minY,D.minY),V=Math.min(T.maxX,D.maxX),F=Math.min(T.maxY,D.maxY),Math.max(0,V-_)*Math.max(0,F-N)),He=f(ve)+f(Se);we<X?(X=we,w=ee,j=He<j?He:j):we===X&&He<j&&(j=He,w=ee)}return w||E-S},i.prototype._chooseSplitAxis=function(v,S,E){var w=v.leaf?this.compareMinX:c,T=v.leaf?this.compareMinY:u;this._allDistMargin(v,S,E,w)<this._allDistMargin(v,S,E,T)&&v.children.sort(w)},i.prototype._allDistMargin=function(v,S,E,w){v.children.sort(w);for(var T=this.toBBox,D=a(v,0,S,T),_=a(v,E-S,E,T),N=y(D)+y(_),V=S;V<E-S;V++){var F=v.children[V];p(D,v.leaf?T(F):F),N+=y(D)}for(var X=E-S-1;X>=S;X--){var j=v.children[X];p(_,v.leaf?T(j):j),N+=y(_)}return N},i.prototype._adjustParentBBoxes=function(v,S,E){for(var w=E;w>=0;w--)p(S[w],v)},i.prototype._condense=function(v){for(var S=v.length-1,E=void 0;S>=0;S--)v[S].children.length===0?S>0?(E=v[S-1].children).splice(E.indexOf(v[S]),1):this.clear():o(v[S],this.toBBox)},i})});var hh=B(U=>{"use strict";m();Object.defineProperty(U,"__esModule",{value:!0});U.earthRadius=63710088e-1;U.factors={centimeters:U.earthRadius*100,centimetres:U.earthRadius*100,degrees:U.earthRadius/111325,feet:U.earthRadius*3.28084,inches:U.earthRadius*39.37,kilometers:U.earthRadius/1e3,kilometres:U.earthRadius/1e3,meters:U.earthRadius,metres:U.earthRadius,miles:U.earthRadius/1609.344,millimeters:U.earthRadius*1e3,millimetres:U.earthRadius*1e3,nauticalmiles:U.earthRadius/1852,radians:1,yards:U.earthRadius*1.0936};U.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/U.earthRadius,yards:1.0936133};U.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 hi(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}s(hi,"feature");U.feature=hi;function uC(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return lh(t).geometry;case"LineString":return ph(t).geometry;case"Polygon":return ch(t).geometry;case"MultiPoint":return wg(t).geometry;case"MultiLineString":return Ig(t).geometry;case"MultiPolygon":return Eg(t).geometry;default:throw new Error(r+" is invalid")}}s(uC,"geometry");U.geometry=uC;function lh(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(!ec(r[0])||!ec(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return hi(i,t,e)}s(lh,"point");U.point=lh;function hC(r,t,e){return e===void 0&&(e={}),tc(r.map(function(i){return lh(i,t)}),e)}s(hC,"points");U.points=hC;function ch(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:r};return hi(p,t,e)}s(ch,"polygon");U.polygon=ch;function dC(r,t,e){return e===void 0&&(e={}),tc(r.map(function(i){return ch(i,t)}),e)}s(dC,"polygons");U.polygons=dC;function ph(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 hi(i,t,e)}s(ph,"lineString");U.lineString=ph;function mC(r,t,e){return e===void 0&&(e={}),tc(r.map(function(i){return ph(i,t)}),e)}s(mC,"lineStrings");U.lineStrings=mC;function tc(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}s(tc,"featureCollection");U.featureCollection=tc;function Ig(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return hi(i,t,e)}s(Ig,"multiLineString");U.multiLineString=Ig;function wg(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return hi(i,t,e)}s(wg,"multiPoint");U.multiPoint=wg;function Eg(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return hi(i,t,e)}s(Eg,"multiPolygon");U.multiPolygon=Eg;function fC(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return hi(i,t,e)}s(fC,"geometryCollection");U.geometryCollection=fC;function yC(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}s(yC,"round");U.round=yC;function Dg(r,t){t===void 0&&(t="kilometers");var e=U.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}s(Dg,"radiansToLength");U.radiansToLength=Dg;function uh(r,t){t===void 0&&(t="kilometers");var e=U.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}s(uh,"lengthToRadians");U.lengthToRadians=uh;function gC(r,t){return Lg(uh(r,t))}s(gC,"lengthToDegrees");U.lengthToDegrees=gC;function vC(r){var t=r%360;return t<0&&(t+=360),t}s(vC,"bearingToAzimuth");U.bearingToAzimuth=vC;function Lg(r){var t=r%(2*Math.PI);return t*180/Math.PI}s(Lg,"radiansToDegrees");U.radiansToDegrees=Lg;function bC(r){var t=r%360;return t*Math.PI/180}s(bC,"degreesToRadians");U.degreesToRadians=bC;function CC(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 Dg(uh(r,t),e)}s(CC,"convertLength");U.convertLength=CC;function SC(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=U.areaFactors[t];if(!i)throw new Error("invalid original units");var n=U.areaFactors[e];if(!n)throw new Error("invalid final units");return r/i*n}s(SC,"convertArea");U.convertArea=SC;function ec(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}s(ec,"isNumber");U.isNumber=ec;function xC(r){return!!r&&r.constructor===Object}s(xC,"isObject");U.isObject=xC;function MC(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(!ec(t))throw new Error("bbox must only contain numbers")})}s(MC,"validateBBox");U.validateBBox=MC;function PC(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")}s(PC,"validateId");U.validateId=PC});var Bg=B(Be=>{"use strict";m();Object.defineProperty(Be,"__esModule",{value:!0});var Ye=hh();function Ia(r,t,e){if(r!==null)for(var i,n,o,a,p,c,u,f=0,y=0,g,C=r.type,x=C==="FeatureCollection",M=C==="Feature",v=x?r.features.length:1,S=0;S<v;S++){u=x?r.features[S].geometry:M?r.geometry:r,g=u?u.type==="GeometryCollection":!1,p=g?u.geometries.length:1;for(var E=0;E<p;E++){var w=0,T=0;if(a=g?u.geometries[E]:u,a!==null){c=a.coordinates;var D=a.type;switch(f=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(c,y,S,w,T)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],y,S,w,T)===!1)return!1;y++,D==="MultiPoint"&&w++}D==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-f;n++){if(t(c[i][n],y,S,w,T)===!1)return!1;y++}D==="MultiLineString"&&w++,D==="Polygon"&&T++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(T=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-f;o++){if(t(c[i][n][o],y,S,w,T)===!1)return!1;y++}T++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Ia(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(Ia,"coordEach");function TC(r,t,e,i){var n=e;return Ia(r,function(o,a,p,c,u){a===0&&e===void 0?n=o:n=t(n,o,a,p,c,u)},i),n}s(TC,"coordReduce");function Og(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}}s(Og,"propEach");function IC(r,t,e){var i=e;return Og(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}s(IC,"propReduce");function _g(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++);}s(_g,"featureEach");function wC(r,t,e){var i=e;return _g(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}s(wC,"featureReduce");function EC(r){var t=[];return Ia(r,function(e){t.push(e)}),t}s(EC,"coordAll");function dh(r,t){var e,i,n,o,a,p,c,u,f,y,g=0,C=r.type==="FeatureCollection",x=r.type==="Feature",M=C?r.features.length:1;for(e=0;e<M;e++){for(p=C?r.features[e].geometry:x?r.geometry:r,u=C?r.features[e].properties:x?r.properties:{},f=C?r.features[e].bbox:x?r.bbox:void 0,y=C?r.features[e].id:x?r.id:void 0,c=p?p.type==="GeometryCollection":!1,a=c?p.geometries.length:1,n=0;n<a;n++){if(o=c?p.geometries[n]:p,o===null){if(t(null,g,u,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,u,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,u,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}s(dh,"geomEach");function DC(r,t,e){var i=e;return dh(r,function(n,o,a,p,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,p,c)}),i}s(DC,"geomReduce");function rc(r,t){dh(r,function(e,i,n,o,a){var p=e===null?null:e.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return t(Ye.feature(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(p){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var f=e.coordinates[u],y={type:c,coordinates:f};if(t(Ye.feature(y,n),i,u)===!1)return!1}})}s(rc,"flattenEach");function LC(r,t,e){var i=e;return rc(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}s(LC,"flattenReduce");function Ag(r,t){rc(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var p,c=0,u=0,f=0;if(Ia(e,function(y,g,C,x,M){if(p===void 0||i>c||x>u||M>f){p=y,c=i,u=x,f=M,o=0;return}var v=Ye.lineString([p,y],e.properties);if(t(v,i,n,M,o)===!1)return!1;o++,p=y})===!1)return!1}}})}s(Ag,"segmentEach");function OC(r,t,e){var i=e,n=!1;return Ag(r,function(o,a,p,c,u){n===!1&&e===void 0?i=o:i=t(i,o,a,p,c,u),n=!0}),i}s(OC,"segmentReduce");function kg(r,t){if(!r)throw new Error("geojson is required");rc(r,function(e,i,n){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,i,n,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p<a.length;p++)if(t(Ye.lineString(a[p],e.properties),i,n,p)===!1)return!1;break}}})}s(kg,"lineEach");function _C(r,t,e){var i=e;return kg(r,function(n,o,a,p){o===0&&e===void 0?i=n:i=t(i,n,o,a,p)}),i}s(_C,"lineReduce");function AC(r,t){if(t=t||{},!Ye.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,p;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,p=r.features[e].geometry;break;case"Feature":a=a||r.properties,p=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=r;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var c=p.coordinates;switch(p.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),Ye.lineString([c[o],c[o+1]],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),Ye.lineString([c[n][o],c[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),Ye.lineString([c[i][o],c[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o-1),Ye.lineString([c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}s(AC,"findSegment");function kC(r,t){if(t=t||{},!Ye.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,p;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,p=r.features[e].geometry;break;case"Feature":a=a||r.properties,p=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=r;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var c=p.coordinates;switch(p.type){case"Point":return Ye.point(c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),Ye.point(c[i],a,t);case"LineString":return o<0&&(o=c.length+o),Ye.point(c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),Ye.point(c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),Ye.point(c[i][o],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),Ye.point(c[i][n][o],a,t)}throw new Error("geojson is invalid")}s(kC,"findPoint");Be.coordAll=EC;Be.coordEach=Ia;Be.coordReduce=TC;Be.featureEach=_g;Be.featureReduce=wC;Be.findPoint=kC;Be.findSegment=AC;Be.flattenEach=rc;Be.flattenReduce=LC;Be.geomEach=dh;Be.geomReduce=DC;Be.lineEach=kg;Be.lineReduce=_C;Be.propEach=Og;Be.propReduce=IC;Be.segmentEach=Ag;Be.segmentReduce=OC});var mh=B((LE,Fg)=>{"use strict";m();var Rg=Object.prototype.toString;Fg.exports=s(function(t){var e=Rg.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Rg.call(t.callee)==="[object Function]"),i},"isArguments")});var Yg=B((AE,Ug)=>{"use strict";m();var Wg;Object.keys||(wa=Object.prototype.hasOwnProperty,fh=Object.prototype.toString,Ng=mh(),yh=Object.prototype.propertyIsEnumerable,Gg=!yh.call({toString:null},"toString"),Vg=yh.call(function(){},"prototype"),Ea=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ic=s(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),Hg={$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},jg=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!Hg["$"+r]&&wa.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{ic(window[r])}catch{return!0}}catch{return!0}return!1}(),Xg=s(function(r){if(typeof window>"u"||!jg)return ic(r);try{return ic(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),Wg=s(function(t){var e=t!==null&&typeof t=="object",i=fh.call(t)==="[object Function]",n=Ng(t),o=e&&fh.call(t)==="[object String]",a=[];if(!e&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var p=Vg&&i;if(o&&t.length>0&&!wa.call(t,0))for(var c=0;c<t.length;++c)a.push(String(c));if(n&&t.length>0)for(var u=0;u<t.length;++u)a.push(String(u));else for(var f in t)!(p&&f==="prototype")&&wa.call(t,f)&&a.push(String(f));if(Gg)for(var y=Xg(t),g=0;g<Ea.length;++g)!(y&&Ea[g]==="constructor")&&wa.call(t,Ea[g])&&a.push(Ea[g]);return a},"keys"));var wa,fh,Ng,yh,Gg,Vg,Ea,ic,Hg,jg,Xg;Ug.exports=Wg});var oc=B((RE,qg)=>{"use strict";m();var BC=Array.prototype.slice,RC=mh(),Zg=Object.keys,nc=Zg?s(function(t){return Zg(t)},"keys"):Yg(),zg=Object.keys;nc.shim=s(function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=s(function(i){return RC(i)?zg(BC.call(i)):zg(i)},"keys"))}else Object.keys=nc;return Object.keys||nc},"shimObjectKeys");qg.exports=nc});var Jg=B((GE,$g)=>{"use strict";m();$g.exports=Error});var Qg=B((HE,Kg)=>{"use strict";m();Kg.exports=EvalError});var t0=B((XE,e0)=>{"use strict";m();e0.exports=RangeError});var i0=B((UE,r0)=>{"use strict";m();r0.exports=ReferenceError});var gh=B((ZE,n0)=>{"use strict";m();n0.exports=SyntaxError});var Wr=B((qE,o0)=>{"use strict";m();o0.exports=TypeError});var s0=B((JE,a0)=>{"use strict";m();a0.exports=URIError});var Da=B((QE,l0)=>{"use strict";m();l0.exports=s(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 n=42;t[e]=n;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 o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==n||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var ac=B((rD,p0)=>{"use strict";m();var c0=typeof Symbol<"u"&&Symbol,FC=Da();p0.exports=s(function(){return typeof c0!="function"||typeof Symbol!="function"||typeof c0("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:FC()},"hasNativeSymbols")});var h0=B((oD,u0)=>{"use strict";m();var vh={__proto__:null,foo:{}},NC=Object;u0.exports=s(function(){return{__proto__:vh}.foo===vh.foo&&!(vh instanceof NC)},"hasProto")});var f0=B((lD,m0)=>{"use strict";m();var GC="Function.prototype.bind called on incompatible ",VC=Object.prototype.toString,HC=Math.max,jC="[object Function]",d0=s(function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i},"concatty"),XC=s(function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},"slicy"),WC=s(function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e},"joiny");m0.exports=s(function(t){var e=this;if(typeof e!="function"||VC.apply(e)!==jC)throw new TypeError(GC+e);for(var i=XC(arguments,1),n,o=s(function(){if(this instanceof n){var f=e.apply(this,d0(i,arguments));return Object(f)===f?f:this}return e.apply(t,d0(i,arguments))},"binder"),a=HC(0,e.length-i.length),p=[],c=0;c<a;c++)p[c]="$"+c;if(n=Function("binder","return function ("+WC(p,",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var u=s(function(){},"Empty");u.prototype=e.prototype,n.prototype=new u,u.prototype=null}return n},"bind")});var sc=B((uD,y0)=>{"use strict";m();var UC=f0();y0.exports=Function.prototype.bind||UC});var bh=B((dD,g0)=>{"use strict";m();var YC=Function.prototype.call,ZC=Object.prototype.hasOwnProperty,zC=sc();g0.exports=zC.call(YC,ZC)});var Ht=B((fD,x0)=>{"use strict";m();var re,qC=Jg(),$C=Qg(),JC=t0(),KC=i0(),Qn=gh(),Kn=Wr(),QC=s0(),S0=Function,Ch=s(function(r){try{return S0('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Ji=Object.getOwnPropertyDescriptor;if(Ji)try{Ji({},"")}catch{Ji=null}var Sh=s(function(){throw new Kn},"throwTypeError"),e6=Ji?function(){try{return arguments.callee,Sh}catch{try{return Ji(arguments,"callee").get}catch{return Sh}}}():Sh,$n=ac()(),t6=h0()(),Xe=Object.getPrototypeOf||(t6?function(r){return r.__proto__}:null),Jn={},r6=typeof Uint8Array>"u"||!Xe?re:Xe(Uint8Array),Ki={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?re:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?re:ArrayBuffer,"%ArrayIteratorPrototype%":$n&&Xe?Xe([][Symbol.iterator]()):re,"%AsyncFromSyncIteratorPrototype%":re,"%AsyncFunction%":Jn,"%AsyncGenerator%":Jn,"%AsyncGeneratorFunction%":Jn,"%AsyncIteratorPrototype%":Jn,"%Atomics%":typeof Atomics>"u"?re:Atomics,"%BigInt%":typeof BigInt>"u"?re:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?re:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?re:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?re:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":qC,"%eval%":eval,"%EvalError%":$C,"%Float32Array%":typeof Float32Array>"u"?re:Float32Array,"%Float64Array%":typeof Float64Array>"u"?re:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?re:FinalizationRegistry,"%Function%":S0,"%GeneratorFunction%":Jn,"%Int8Array%":typeof Int8Array>"u"?re:Int8Array,"%Int16Array%":typeof Int16Array>"u"?re:Int16Array,"%Int32Array%":typeof Int32Array>"u"?re:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$n&&Xe?Xe(Xe([][Symbol.iterator]())):re,"%JSON%":typeof JSON=="object"?JSON:re,"%Map%":typeof Map>"u"?re:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$n||!Xe?re:Xe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?re:Promise,"%Proxy%":typeof Proxy>"u"?re:Proxy,"%RangeError%":JC,"%ReferenceError%":KC,"%Reflect%":typeof Reflect>"u"?re:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?re:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$n||!Xe?re:Xe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?re:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$n&&Xe?Xe(""[Symbol.iterator]()):re,"%Symbol%":$n?Symbol:re,"%SyntaxError%":Qn,"%ThrowTypeError%":e6,"%TypedArray%":r6,"%TypeError%":Kn,"%Uint8Array%":typeof Uint8Array>"u"?re:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?re:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?re:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?re:Uint32Array,"%URIError%":QC,"%WeakMap%":typeof WeakMap>"u"?re:WeakMap,"%WeakRef%":typeof WeakRef>"u"?re:WeakRef,"%WeakSet%":typeof WeakSet>"u"?re:WeakSet};if(Xe)try{null.error}catch(r){v0=Xe(Xe(r)),Ki["%Error.prototype%"]=v0}var v0,i6=s(function r(t){var e;if(t==="%AsyncFunction%")e=Ch("async function () {}");else if(t==="%GeneratorFunction%")e=Ch("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Ch("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&Xe&&(e=Xe(n.prototype))}return Ki[t]=e,e},"doEval"),b0={__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"]},La=sc(),lc=bh(),n6=La.call(Function.call,Array.prototype.concat),o6=La.call(Function.apply,Array.prototype.splice),C0=La.call(Function.call,String.prototype.replace),cc=La.call(Function.call,String.prototype.slice),a6=La.call(Function.call,RegExp.prototype.exec),s6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,l6=/\\(\\)?/g,c6=s(function(t){var e=cc(t,0,1),i=cc(t,-1);if(e==="%"&&i!=="%")throw new Qn("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Qn("invalid intrinsic syntax, expected opening `%`");var n=[];return C0(t,s6,function(o,a,p,c){n[n.length]=p?C0(c,l6,"$1"):a||o}),n},"stringToPath"),p6=s(function(t,e){var i=t,n;if(lc(b0,i)&&(n=b0[i],i="%"+n[0]+"%"),lc(Ki,i)){var o=Ki[i];if(o===Jn&&(o=i6(i)),typeof o>"u"&&!e)throw new Kn("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Qn("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");x0.exports=s(function(t,e){if(typeof t!="string"||t.length===0)throw new Kn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Kn('"allowMissing" argument must be a boolean');if(a6(/^%?[^%]*%?$/,t)===null)throw new Qn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=c6(t),n=i.length>0?i[0]:"",o=p6("%"+n+"%",e),a=o.name,p=o.value,c=!1,u=o.alias;u&&(n=u[0],o6(i,n6([0,1],u)));for(var f=1,y=!0;f<i.length;f+=1){var g=i[f],C=cc(g,0,1),x=cc(g,-1);if((C==='"'||C==="'"||C==="`"||x==='"'||x==="'"||x==="`")&&C!==x)throw new Qn("property names with quotes must have matching quotes");if((g==="constructor"||!y)&&(c=!0),n+="."+g,a="%"+n+"%",lc(Ki,a))p=Ki[a];else if(p!=null){if(!(g in p)){if(!e)throw new Kn("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ji&&f+1>=i.length){var M=Ji(p,g);y=!!M,y&&"get"in M&&!("originalValue"in M.get)?p=M.get:p=p[g]}else y=lc(p,g),p=p[g];y&&!c&&(Ki[a]=p)}}return p},"GetIntrinsic")});var uc=B((vD,M0)=>{"use strict";m();var u6=Ht(),pc=u6("%Object.defineProperty%",!0)||!1;if(pc)try{pc({},"a",{value:1})}catch{pc=!1}M0.exports=pc});var dc=B((CD,P0)=>{"use strict";m();var h6=Ht(),hc=h6("%Object.getOwnPropertyDescriptor%",!0);if(hc)try{hc([],"length")}catch{hc=null}P0.exports=hc});var mc=B((xD,w0)=>{"use strict";m();var T0=uc(),d6=gh(),eo=Wr(),I0=dc();w0.exports=s(function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new eo("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new eo("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new eo("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new eo("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new eo("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new eo("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,c=!!I0&&I0(t,e);if(T0)T0(t,e,{configurable:a===null&&c?c.configurable:!a,enumerable:n===null&&c?c.enumerable:!n,value:i,writable:o===null&&c?c.writable:!o});else if(p||!n&&!o&&!a)t[e]=i;else throw new d6("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var fc=B((TD,D0)=>{"use strict";m();var xh=uc(),E0=s(function(){return!!xh},"hasPropertyDescriptors");E0.hasArrayLengthDefineBug=s(function(){if(!xh)return null;try{return xh([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");D0.exports=E0});var di=B((ED,A0)=>{"use strict";m();var m6=oc(),f6=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",y6=Object.prototype.toString,g6=Array.prototype.concat,L0=mc(),v6=s(function(r){return typeof r=="function"&&y6.call(r)==="[object Function]"},"isFunction"),O0=fc()(),b6=s(function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!v6(i)||!i())return}O0?L0(r,t,e,!0):L0(r,t,e)},"defineProperty"),_0=s(function(r,t){var e=arguments.length>2?arguments[2]:{},i=m6(t);f6&&(i=g6.call(i,Object.getOwnPropertySymbols(t)));for(var n=0;n<i.length;n+=1)b6(r,i[n],t[i[n]],e[i[n]])},"defineProperties");_0.supportsDescriptors=!!O0;A0.exports=_0});var N0=B((OD,F0)=>{"use strict";m();var C6=Ht(),k0=mc(),S6=fc()(),B0=dc(),R0=Wr(),x6=C6("%Math.floor%");F0.exports=s(function(t,e){if(typeof t!="function")throw new R0("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||x6(e)!==e)throw new R0("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&B0){var a=B0(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(S6?k0(t,"length",e,!0,!0):k0(t,"length",e)),t},"setFunctionLength")});var Qi=B((kD,yc)=>{"use strict";m();var Mh=sc(),gc=Ht(),M6=N0(),P6=Wr(),H0=gc("%Function.prototype.apply%"),j0=gc("%Function.prototype.call%"),X0=gc("%Reflect.apply%",!0)||Mh.call(j0,H0),G0=uc(),T6=gc("%Math.max%");yc.exports=s(function(t){if(typeof t!="function")throw new P6("a function is required");var e=X0(Mh,j0,arguments);return M6(e,1+T6(0,t.length-(arguments.length-1)),!0)},"callBind");var V0=s(function(){return X0(Mh,H0,arguments)},"applyBind");G0?G0(yc.exports,"apply",{value:V0}):yc.exports.apply=V0});var St=B((FD,Y0)=>{"use strict";m();var W0=Ht(),U0=Qi(),I6=U0(W0("String.prototype.indexOf"));Y0.exports=s(function(t,e){var i=W0(t,!!e);return typeof i=="function"&&I6(t,".prototype.")>-1?U0(i):i},"callBoundIntrinsic")});var Ph=B((VD,J0)=>{"use strict";m();var w6=oc(),q0=Da()(),$0=St(),Z0=Object,E6=$0("Array.prototype.push"),z0=$0("Object.prototype.propertyIsEnumerable"),D6=q0?Object.getOwnPropertySymbols:null;J0.exports=s(function(t,e){if(t==null)throw new TypeError("target must be an object");var i=Z0(t);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=Z0(arguments[n]),a=w6(o),p=q0&&(Object.getOwnPropertySymbols||D6);if(p)for(var c=p(o),u=0;u<c.length;++u){var f=c[u];z0(o,f)&&E6(a,f)}for(var y=0;y<a.length;++y){var g=a[y];if(z0(o,g)){var C=o[g];i[g]=C}}}return i},"assign")});var Ih=B((XD,K0)=>{"use strict";m();var Th=Ph(),L6=s(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 n=Object.assign({},e),o="";for(var a in n)o+=a;return r!==o},"lacksProperEnumerationOrder"),O6=s(function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1},"assignHasPendingExceptions");K0.exports=s(function(){return!Object.assign||L6()||O6()?Th:Object.assign},"getPolyfill")});var e2=B((YD,Q0)=>{"use strict";m();var _6=di(),A6=Ih();Q0.exports=s(function(){var t=A6();return _6(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t},"shimAssign")});var n2=B((qD,i2)=>{"use strict";m();var k6=di(),B6=Qi(),R6=Ph(),t2=Ih(),F6=e2(),N6=B6.apply(t2()),r2=s(function(t,e){return N6(Object,arguments)},"assign");k6(r2,{getPolyfill:t2,implementation:R6,shim:F6});i2.exports=r2});var a2=B((KD,o2)=>{"use strict";m();var _a=s(function(){return typeof s(function(){},"f").name=="string"},"functionsHaveNames"),Oa=Object.getOwnPropertyDescriptor;if(Oa)try{Oa([],"length")}catch{Oa=null}_a.functionsHaveConfigurableNames=s(function(){if(!_a()||!Oa)return!1;var t=Oa(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var G6=Function.prototype.bind;_a.boundFunctionsHaveNames=s(function(){return _a()&&typeof G6=="function"&&s(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");o2.exports=_a});var c2=B((tL,l2)=>{"use strict";m();var s2=mc(),V6=fc()(),H6=a2().functionsHaveConfigurableNames(),j6=Wr();l2.exports=s(function(t,e){if(typeof t!="function")throw new j6("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||H6)&&(V6?s2(t,"name",e,!0,!0):s2(t,"name",e)),t},"setFunctionName")});var wh=B((nL,p2)=>{"use strict";m();var X6=c2(),W6=Wr(),U6=Object;p2.exports=X6(s(function(){if(this==null||this!==U6(this))throw new W6("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var Eh=B((sL,u2)=>{"use strict";m();var Y6=wh(),Z6=di().supportsDescriptors,z6=Object.getOwnPropertyDescriptor;u2.exports=s(function(){if(Z6&&/a/mig.flags==="gim"){var t=z6(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 Y6},"getPolyfill")});var m2=B((pL,d2)=>{"use strict";m();var q6=di().supportsDescriptors,$6=Eh(),J6=Object.getOwnPropertyDescriptor,K6=Object.defineProperty,Q6=TypeError,h2=Object.getPrototypeOf,e8=/a/;d2.exports=s(function(){if(!q6||!h2)throw new Q6("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=$6(),e=h2(e8),i=J6(e,"flags");return(!i||i.get!==t)&&K6(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var v2=B((dL,g2)=>{"use strict";m();var t8=di(),r8=Qi(),i8=wh(),f2=Eh(),n8=m2(),y2=r8(f2());t8(y2,{getPolyfill:f2,implementation:i8,shim:n8});g2.exports=y2});var mi=B((fL,b2)=>{"use strict";m();var o8=Da();b2.exports=s(function(){return o8()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Lh=B((vL,S2)=>{"use strict";m();var a8=mi()(),s8=St(),Dh=s8("Object.prototype.toString"),vc=s(function(t){return a8&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Dh(t)==="[object Arguments]"},"isArguments"),C2=s(function(t){return vc(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Dh(t)!=="[object Array]"&&Dh(t.callee)==="[object Function]"},"isArguments"),l8=function(){return vc(arguments)}();vc.isLegacyArguments=C2;S2.exports=l8?vc:C2});var x2=B(()=>{m()});var j2=B((PL,H2)=>{m();var Vh=typeof Map=="function"&&Map.prototype,Oh=Object.getOwnPropertyDescriptor&&Vh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Cc=Vh&&Oh&&typeof Oh.get=="function"?Oh.get:null,M2=Vh&&Map.prototype.forEach,Hh=typeof Set=="function"&&Set.prototype,_h=Object.getOwnPropertyDescriptor&&Hh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Sc=Hh&&_h&&typeof _h.get=="function"?_h.get:null,P2=Hh&&Set.prototype.forEach,c8=typeof WeakMap=="function"&&WeakMap.prototype,ka=c8?WeakMap.prototype.has:null,p8=typeof WeakSet=="function"&&WeakSet.prototype,Ba=p8?WeakSet.prototype.has:null,u8=typeof WeakRef=="function"&&WeakRef.prototype,T2=u8?WeakRef.prototype.deref:null,h8=Boolean.prototype.valueOf,d8=Object.prototype.toString,m8=Function.prototype.toString,f8=String.prototype.match,jh=String.prototype.slice,yi=String.prototype.replace,y8=String.prototype.toUpperCase,I2=String.prototype.toLowerCase,B2=RegExp.prototype.test,w2=Array.prototype.concat,mr=Array.prototype.join,g8=Array.prototype.slice,E2=Math.floor,Bh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ah=Object.getOwnPropertySymbols,Rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,to=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ze=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===to||!0)?Symbol.toStringTag:null,R2=Object.prototype.propertyIsEnumerable,D2=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function L2(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||B2.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-E2(-r):E2(r);if(i!==r){var n=String(i),o=jh.call(t,n.length+1);return yi.call(n,e,"$&_")+"."+yi.call(yi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yi.call(t,e,"$&_")}s(L2,"addNumericSeparator");var Fh=x2(),O2=Fh.custom,_2=N2(O2)?O2:null;H2.exports=s(function r(t,e,i,n){var o=e||{};if(fi(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fi(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=fi(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fi(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fi(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=o.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 V2(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return p?L2(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return p?L2(t,u):u}var f=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=f&&f>0&&typeof t=="object")return Nh(t)?"[Array]":"[Object]";var y=B8(o,i);if(typeof n>"u")n=[];else if(G2(n,t)>=0)return"[Circular]";function g(ve,Se,we){if(Se&&(n=g8.call(n),n.push(Se)),we){var He={depth:o.depth};return fi(o,"quoteStyle")&&(He.quoteStyle=o.quoteStyle),r(ve,He,i+1,n)}return r(ve,o,i+1,n)}if(s(g,"inspect"),typeof t=="function"&&!A2(t)){var C=I8(t),x=bc(t,g);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(x.length>0?" { "+mr.call(x,", ")+" }":"")}if(N2(t)){var M=to?yi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Rh.call(t);return typeof t=="object"&&!to?Aa(M):M}if(_8(t)){for(var v="<"+I2.call(String(t.nodeName)),S=t.attributes||[],E=0;E<S.length;E++)v+=" "+S[E].name+"="+F2(v8(S[E].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+I2.call(String(t.nodeName))+">",v}if(Nh(t)){if(t.length===0)return"[]";var w=bc(t,g);return y&&!k8(w)?"["+Gh(w,y)+"]":"[ "+mr.call(w,", ")+" ]"}if(C8(t)){var T=bc(t,g);return!("cause"in Error.prototype)&&"cause"in t&&!R2.call(t,"cause")?"{ ["+String(t)+"] "+mr.call(w2.call("[cause]: "+g(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+mr.call(T,", ")+" }"}if(typeof t=="object"&&a){if(_2&&typeof t[_2]=="function"&&Fh)return Fh(t,{depth:f-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(w8(t)){var D=[];return M2&&M2.call(t,function(ve,Se){D.push(g(Se,t,!0)+" => "+g(ve,t))}),k2("Map",Cc.call(t),D,y)}if(L8(t)){var _=[];return P2&&P2.call(t,function(ve){_.push(g(ve,t))}),k2("Set",Sc.call(t),_,y)}if(E8(t))return kh("WeakMap");if(O8(t))return kh("WeakSet");if(D8(t))return kh("WeakRef");if(x8(t))return Aa(g(Number(t)));if(P8(t))return Aa(g(Bh.call(t)));if(M8(t))return Aa(h8.call(t));if(S8(t))return Aa(g(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!b8(t)&&!A2(t)){var N=bc(t,g),V=D2?D2(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",X=!V&&Ze&&Object(t)===t&&Ze in t?jh.call(gi(t),8,-1):F?"Object":"",j=V||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",ee=j+(X||F?"["+mr.call(w2.call([],X||[],F||[]),": ")+"] ":"");return N.length===0?ee+"{}":y?ee+"{"+Gh(N,y)+"}":ee+"{ "+mr.call(N,", ")+" }"}return String(t)},"inspect_");function F2(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}s(F2,"wrapQuotes");function v8(r){return yi.call(String(r),/"/g,"&quot;")}s(v8,"quote");function Nh(r){return gi(r)==="[object Array]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(Nh,"isArray");function b8(r){return gi(r)==="[object Date]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(b8,"isDate");function A2(r){return gi(r)==="[object RegExp]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(A2,"isRegExp");function C8(r){return gi(r)==="[object Error]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(C8,"isError");function S8(r){return gi(r)==="[object String]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(S8,"isString");function x8(r){return gi(r)==="[object Number]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(x8,"isNumber");function M8(r){return gi(r)==="[object Boolean]"&&(!Ze||!(typeof r=="object"&&Ze in r))}s(M8,"isBoolean");function N2(r){if(to)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Rh)return!1;try{return Rh.call(r),!0}catch{}return!1}s(N2,"isSymbol");function P8(r){if(!r||typeof r!="object"||!Bh)return!1;try{return Bh.call(r),!0}catch{}return!1}s(P8,"isBigInt");var T8=Object.prototype.hasOwnProperty||function(r){return r in this};function fi(r,t){return T8.call(r,t)}s(fi,"has");function gi(r){return d8.call(r)}s(gi,"toStr");function I8(r){if(r.name)return r.name;var t=f8.call(m8.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}s(I8,"nameOf");function G2(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}s(G2,"indexOf");function w8(r){if(!Cc||!r||typeof r!="object")return!1;try{Cc.call(r);try{Sc.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}s(w8,"isMap");function E8(r){if(!ka||!r||typeof r!="object")return!1;try{ka.call(r,ka);try{Ba.call(r,Ba)}catch{return!0}return r instanceof WeakMap}catch{}return!1}s(E8,"isWeakMap");function D8(r){if(!T2||!r||typeof r!="object")return!1;try{return T2.call(r),!0}catch{}return!1}s(D8,"isWeakRef");function L8(r){if(!Sc||!r||typeof r!="object")return!1;try{Sc.call(r);try{Cc.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}s(L8,"isSet");function O8(r){if(!Ba||!r||typeof r!="object")return!1;try{Ba.call(r,Ba);try{ka.call(r,ka)}catch{return!0}return r instanceof WeakSet}catch{}return!1}s(O8,"isWeakSet");function _8(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}s(_8,"isElement");function V2(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return V2(jh.call(r,0,t.maxStringLength),t)+i}var n=yi.call(yi.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,A8);return F2(n,"single",t)}s(V2,"inspectString");function A8(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":"")+y8.call(t.toString(16))}s(A8,"lowbyte");function Aa(r){return"Object("+r+")"}s(Aa,"markBoxed");function kh(r){return r+" { ? }"}s(kh,"weakCollectionOf");function k2(r,t,e,i){var n=i?Gh(e,i):mr.call(e,", ");return r+" ("+t+") {"+n+"}"}s(k2,"collectionOf");function k8(r){for(var t=0;t<r.length;t++)if(G2(r[t],"\n")>=0)return!1;return!0}s(k8,"singleLineValues");function B8(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=mr.call(Array(r.indent+1)," ");else return null;return{base:e,prev:mr.call(Array(t+1),e)}}s(B8,"getIndent");function Gh(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+mr.call(r,","+e)+"\n"+t.prev}s(Gh,"indentedJoin");function bc(r,t){var e=Nh(r),i=[];if(e){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=fi(r,n)?t(r[n],r):""}var o=typeof Ah=="function"?Ah(r):[],a;if(to){a={};for(var p=0;p<o.length;p++)a["$"+o[p]]=o[p]}for(var c in r)fi(r,c)&&(e&&String(Number(c))===c&&c<r.length||to&&a["$"+c]instanceof Symbol||(B2.call(/[^\w$]/,c)?i.push(t(c,r)+": "+t(r[c],r)):i.push(c+": "+t(r[c],r))));if(typeof Ah=="function")for(var u=0;u<o.length;u++)R2.call(r,o[u])&&i.push("["+t(o[u])+"]: "+t(r[o[u]],r));return i}s(bc,"arrObjKeys")});var Wh=B((wL,W2)=>{"use strict";m();var X2=Ht(),ro=St(),R8=j2(),F8=Wr(),xc=X2("%WeakMap%",!0),Mc=X2("%Map%",!0),N8=ro("WeakMap.prototype.get",!0),G8=ro("WeakMap.prototype.set",!0),V8=ro("WeakMap.prototype.has",!0),H8=ro("Map.prototype.get",!0),j8=ro("Map.prototype.set",!0),X8=ro("Map.prototype.has",!0),Xh=s(function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),W8=s(function(r,t){var e=Xh(r,t);return e&&e.value},"listGet"),U8=s(function(r,t,e){var i=Xh(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},"listSet"),Y8=s(function(r,t){return!!Xh(r,t)},"listHas");W2.exports=s(function(){var t,e,i,n={assert:function(o){if(!n.has(o))throw new F8("Side channel does not contain "+R8(o))},get:function(o){if(xc&&o&&(typeof o=="object"||typeof o=="function")){if(t)return N8(t,o)}else if(Mc){if(e)return H8(e,o)}else if(i)return W8(i,o)},has:function(o){if(xc&&o&&(typeof o=="object"||typeof o=="function")){if(t)return V8(t,o)}else if(Mc){if(e)return X8(e,o)}else if(i)return Y8(i,o);return!1},set:function(o,a){xc&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new xc),G8(t,o,a)):Mc?(e||(e=new Mc),j8(e,o,a)):(i||(i={key:{},next:null}),U8(i,o,a))}};return n},"getSideChannel")});var Y2=B((LL,U2)=>{"use strict";m();var Z8=bh(),Ra=Wh()(),Ur=Wr(),Uh={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ur("`O` is not an object");if(typeof t!="string")throw new Ur("`slot` must be a string");if(Ra.assert(r),!Uh.has(r,t))throw new Ur("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ur("`O` is not an object");if(typeof t!="string")throw new Ur("`slot` must be a string");var e=Ra.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new Ur("`O` is not an object");if(typeof t!="string")throw new Ur("`slot` must be a string");var e=Ra.get(r);return!!e&&Z8(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new Ur("`O` is not an object");if(typeof t!="string")throw new Ur("`slot` must be a string");var i=Ra.get(r);i||(i={},Ra.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(Uh);U2.exports=Uh});var q2=B((_L,z2)=>{"use strict";m();var Fa=Y2(),z8=SyntaxError,Z2=typeof StopIteration=="object"?StopIteration:null;z2.exports=s(function(t){if(!Z2)throw new z8("this environment lacks StopIteration");Fa.set(t,"[[Done]]",!1);var e={next:s(function(){var n=Fa.get(this,"[[Iterator]]"),o=Fa.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(Fa.set(n,"[[Done]]",!0),a!==Z2)throw a;return{done:!0,value:void 0}}},"next")};return Fa.set(e,"[[Iterator]]",t),e},"getStopIterationIterator")});var Yh=B((BL,$2)=>{m();var q8={}.toString;$2.exports=Array.isArray||function(r){return q8.call(r)=="[object Array]"}});var Zh=B((FL,J2)=>{"use strict";m();var $8=String.prototype.valueOf,J8=s(function(t){try{return $8.call(t),!0}catch{return!1}},"tryStringObject"),K8=Object.prototype.toString,Q8="[object String]",eS=mi()();J2.exports=s(function(t){return typeof t=="string"?!0:typeof t!="object"?!1:eS?J8(t):K8.call(t)===Q8},"isString")});var qh=B((VL,ev)=>{"use strict";m();var zh=typeof Map=="function"&&Map.prototype?Map:null,tS=typeof Set=="function"&&Set.prototype?Set:null,Pc;zh||(Pc=s(function(t){return!1},"isMap"));var Q2=zh?Map.prototype.has:null,K2=tS?Set.prototype.has:null;!Pc&&!Q2&&(Pc=s(function(t){return!1},"isMap"));ev.exports=Pc||s(function(t){if(!t||typeof t!="object")return!1;try{if(Q2.call(t),K2)try{K2.call(t)}catch{return!0}return t instanceof zh}catch{}return!1},"isMap")});var Jh=B((XL,iv)=>{"use strict";m();var rS=typeof Map=="function"&&Map.prototype?Map:null,$h=typeof Set=="function"&&Set.prototype?Set:null,Tc;$h||(Tc=s(function(t){return!1},"isSet"));var tv=rS?Map.prototype.has:null,rv=$h?Set.prototype.has:null;!Tc&&!rv&&(Tc=s(function(t){return!1},"isSet"));iv.exports=Tc||s(function(t){if(!t||typeof t!="object")return!1;try{if(rv.call(t),tv)try{tv.call(t)}catch{return!0}return t instanceof $h}catch{}return!1},"isSet")});var fv=B((YL,Ec)=>{"use strict";m();var nv=Lh(),ov=q2();ac()()||Da()()?(Ic=Symbol.iterator,Ec.exports=s(function(t){if(t!=null&&typeof t[Ic]<"u")return t[Ic]();if(nv(t))return Array.prototype[Ic].call(t)},"getIterator")):(av=Yh(),sv=Zh(),Kh=Ht(),lv=Kh("%Map%",!0),cv=Kh("%Set%",!0),wt=St(),Qh=wt("Array.prototype.push"),ed=wt("String.prototype.charCodeAt"),pv=wt("String.prototype.slice"),uv=s(function(t,e){var i=t.length;if(e+1>=i)return e+1;var n=ed(t,e);if(n<55296||n>56319)return e+1;var o=ed(t,e+1);return o<56320||o>57343?e+1:e+2},"advanceStringIndex"),wc=s(function(t){var e=0;return{next:s(function(){var n=e>=t.length,o;return n||(o=t[e],e+=1),{done:n,value:o}},"next")}},"getArrayIterator"),td=s(function(t,e){if(av(t)||nv(t))return wc(t);if(sv(t)){var i=0;return{next:s(function(){var o=uv(t,i),a=pv(t,i,o);return i=o,{done:o>t.length,value:a}},"next")}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},"getNonCollectionIterator"),!lv&&!cv?Ec.exports=s(function(t){if(t!=null)return td(t,!0)},"getIterator"):(hv=qh(),dv=Jh(),rd=wt("Map.prototype.forEach",!0),id=wt("Set.prototype.forEach",!0),(typeof b>"u"||!b.versions||!b.versions.node)&&(nd=wt("Map.prototype.iterator",!0),od=wt("Set.prototype.iterator",!0)),ad=wt("Map.prototype.@@iterator",!0)||wt("Map.prototype._es6-shim iterator_",!0),sd=wt("Set.prototype.@@iterator",!0)||wt("Set.prototype._es6-shim iterator_",!0),mv=s(function(t){if(hv(t)){if(nd)return ov(nd(t));if(ad)return ad(t);if(rd){var e=[];return rd(t,function(n,o){Qh(e,[o,n])}),wc(e)}}if(dv(t)){if(od)return ov(od(t));if(sd)return sd(t);if(id){var i=[];return id(t,function(n){Qh(i,n)}),wc(i)}}},"getCollectionIterator"),Ec.exports=s(function(t){return mv(t)||td(t)},"getIterator")));var Ic,av,sv,Kh,lv,cv,wt,Qh,ed,pv,uv,wc,td,hv,dv,rd,id,nd,od,ad,sd,mv});var ld=B((qL,gv)=>{"use strict";m();var yv=s(function(r){return r!==r},"numberIsNaN");gv.exports=s(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||yv(t)&&yv(e))},"is")});var cd=B((KL,vv)=>{"use strict";m();var iS=ld();vv.exports=s(function(){return typeof Object.is=="function"?Object.is:iS},"getPolyfill")});var Cv=B((tO,bv)=>{"use strict";m();var nS=cd(),oS=di();bv.exports=s(function(){var t=nS();return oS(Object,{is:t},{is:s(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var Pv=B((nO,Mv)=>{"use strict";m();var aS=di(),sS=Qi(),lS=ld(),Sv=cd(),cS=Cv(),xv=sS(Sv(),Object);aS(xv,{getPolyfill:Sv,implementation:lS,shim:cS});Mv.exports=xv});var ud=B((aO,Ev)=>{"use strict";m();var pS=Qi(),wv=St(),uS=Ht(),pd=uS("%ArrayBuffer%",!0),Dc=wv("ArrayBuffer.prototype.byteLength",!0),hS=wv("Object.prototype.toString"),Tv=!!pd&&!Dc&&new pd(0).slice,Iv=!!Tv&&pS(Tv);Ev.exports=s(Dc||Iv?function(t){if(!t||typeof t!="object")return!1;try{return Dc?Dc(t):Iv(t,0),!0}catch{return!1}}:pd?function(t){return hS(t)==="[object ArrayBuffer]"}:function(t){return!1},"isArrayBuffer")});var Lv=B((cO,Dv)=>{"use strict";m();var dS=Date.prototype.getDay,mS=s(function(t){try{return dS.call(t),!0}catch{return!1}},"tryDateGetDayCall"),fS=Object.prototype.toString,yS="[object Date]",gS=mi()();Dv.exports=s(function(t){return typeof t!="object"||t===null?!1:gS?mS(t):fS.call(t)===yS},"isDateObject")});var Bv=B((hO,kv)=>{"use strict";m();var hd=St(),Ov=mi()(),_v,Av,dd,md;Ov&&(_v=hd("Object.prototype.hasOwnProperty"),Av=hd("RegExp.prototype.exec"),dd={},Lc=s(function(){throw dd},"throwRegexMarker"),md={toString:Lc,valueOf:Lc},typeof Symbol.toPrimitive=="symbol"&&(md[Symbol.toPrimitive]=Lc));var Lc,vS=hd("Object.prototype.toString"),bS=Object.getOwnPropertyDescriptor,CS="[object RegExp]";kv.exports=s(Ov?function(t){if(!t||typeof t!="object")return!1;var e=bS(t,"lastIndex"),i=e&&_v(e,"value");if(!i)return!1;try{Av(t,md)}catch(n){return n===dd}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:vS(t)===CS},"isRegex")});var Nv=B((fO,Fv)=>{"use strict";m();var SS=St(),Rv=SS("SharedArrayBuffer.prototype.byteLength",!0);Fv.exports=s(Rv?function(t){if(!t||typeof t!="object")return!1;try{return Rv(t),!0}catch{return!1}}:function(t){return!1},"isSharedArrayBuffer")});var Vv=B((vO,Gv)=>{"use strict";m();var xS=Number.prototype.toString,MS=s(function(t){try{return xS.call(t),!0}catch{return!1}},"tryNumberObject"),PS=Object.prototype.toString,TS="[object Number]",IS=mi()();Gv.exports=s(function(t){return typeof t=="number"?!0:typeof t!="object"?!1:IS?MS(t):PS.call(t)===TS},"isNumberObject")});var Xv=B((SO,jv)=>{"use strict";m();var Hv=St(),wS=Hv("Boolean.prototype.toString"),ES=Hv("Object.prototype.toString"),DS=s(function(t){try{return wS(t),!0}catch{return!1}},"booleanBrandCheck"),LS="[object Boolean]",OS=mi()();jv.exports=s(function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:OS&&Symbol.toStringTag in t?DS(t):ES(t)===LS},"isBoolean")});var Zv=B((PO,fd)=>{"use strict";m();var _S=Object.prototype.toString,AS=ac()();AS?(Wv=Symbol.prototype.toString,Uv=/^Symbol\(.*\)$/,Yv=s(function(t){return typeof t.valueOf()!="symbol"?!1:Uv.test(Wv.call(t))},"isRealSymbolObject"),fd.exports=s(function(t){if(typeof t=="symbol")return!0;if(_S.call(t)!=="[object Symbol]")return!1;try{return Yv(t)}catch{return!1}},"isSymbol")):fd.exports=s(function(t){return!1},"isSymbol");var Wv,Uv,Yv});var $v=B((wO,qv)=>{"use strict";m();var zv=typeof BigInt<"u"&&BigInt;qv.exports=s(function(){return typeof zv=="function"&&typeof BigInt=="function"&&typeof zv(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var Qv=B((LO,yd)=>{"use strict";m();var kS=$v()();kS?(Jv=BigInt.prototype.valueOf,Kv=s(function(t){try{return Jv.call(t),!0}catch{}return!1},"tryBigIntObject"),yd.exports=s(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:Kv(t)},"isBigInt")):yd.exports=s(function(t){return!1},"isBigInt");var Jv,Kv});var tb=B((AO,eb)=>{"use strict";m();var BS=Zh(),RS=Vv(),FS=Xv(),NS=Zv(),GS=Qv();eb.exports=s(function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(BS(t))return"String";if(RS(t))return"Number";if(FS(t))return"Boolean";if(NS(t))return"Symbol";if(GS(t))return"BigInt"},"whichBoxedPrimitive")});var nb=B((RO,ib)=>{"use strict";m();var Oc=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,rb=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,_c;Oc||(_c=s(function(t){return!1},"isWeakMap"));var vd=Oc?Oc.prototype.has:null,gd=rb?rb.prototype.has:null;!_c&&!vd&&(_c=s(function(t){return!1},"isWeakMap"));ib.exports=_c||s(function(t){if(!t||typeof t!="object")return!1;try{if(vd.call(t,vd),gd)try{gd.call(t,gd)}catch{return!0}return t instanceof Oc}catch{}return!1},"isWeakMap")});var ab=B((GO,Cd)=>{"use strict";m();var VS=Ht(),ob=St(),HS=VS("%WeakSet%",!0),bd=ob("WeakSet.prototype.has",!0);bd?(Ac=ob("WeakMap.prototype.has",!0),Cd.exports=s(function(t){if(!t||typeof t!="object")return!1;try{if(bd(t,bd),Ac)try{Ac(t,Ac)}catch{return!0}return t instanceof HS}catch{}return!1},"isWeakSet")):Cd.exports=s(function(t){return!1},"isWeakSet");var Ac});var lb=B((jO,sb)=>{"use strict";m();var jS=qh(),XS=Jh(),WS=nb(),US=ab();sb.exports=s(function(t){if(t&&typeof t=="object"){if(jS(t))return"Map";if(XS(t))return"Set";if(WS(t))return"WeakMap";if(US(t))return"WeakSet"}return!1},"whichCollection")});var hb=B((UO,ub)=>{"use strict";m();var pb=Function.prototype.toString,io=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,xd,kc;if(typeof io=="function"&&typeof Object.defineProperty=="function")try{xd=Object.defineProperty({},"length",{get:function(){throw kc}}),kc={},io(function(){throw 42},null,xd)}catch(r){r!==kc&&(io=null)}else io=null;var YS=/^\s*class\b/,Md=s(function(t){try{var e=pb.call(t);return YS.test(e)}catch{return!1}},"isES6ClassFunction"),Sd=s(function(t){try{return Md(t)?!1:(pb.call(t),!0)}catch{return!1}},"tryFunctionToStr"),Bc=Object.prototype.toString,ZS="[object Object]",zS="[object Function]",qS="[object GeneratorFunction]",$S="[object HTMLAllCollection]",JS="[object HTML document.all class]",KS="[object HTMLCollection]",QS=typeof Symbol=="function"&&!!Symbol.toStringTag,e9=!(0 in[,]),Pd=s(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(cb=document.all,Bc.call(cb)===Bc.call(document.all)&&(Pd=s(function(t){if((e9||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=Bc.call(t);return(e===$S||e===JS||e===KS||e===ZS)&&t("")==null}catch{}return!1},"isDocumentDotAll")));var cb;ub.exports=s(io?function(t){if(Pd(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{io(t,null,xd)}catch(e){if(e!==kc)return!1}return!Md(t)&&Sd(t)}:function(t){if(Pd(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(QS)return Sd(t);if(Md(t))return!1;var e=Bc.call(t);return e!==zS&&e!==qS&&!/^\[object HTML/.test(e)?!1:Sd(t)},"isCallable")});var fb=B((zO,mb)=>{"use strict";m();var t9=hb(),r9=Object.prototype.toString,db=Object.prototype.hasOwnProperty,i9=s(function(t,e,i){for(var n=0,o=t.length;n<o;n++)db.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},"forEachArray"),n9=s(function(t,e,i){for(var n=0,o=t.length;n<o;n++)i==null?e(t.charAt(n),n,t):e.call(i,t.charAt(n),n,t)},"forEachString"),o9=s(function(t,e,i){for(var n in t)db.call(t,n)&&(i==null?e(t[n],n,t):e.call(i,t[n],n,t))},"forEachObject"),a9=s(function(t,e,i){if(!t9(e))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),r9.call(t)==="[object Array]"?i9(t,e,n):typeof t=="string"?n9(t,e,n):o9(t,e,n)},"forEach");mb.exports=a9});var gb=B((JO,yb)=>{"use strict";m();yb.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var bb=B((QO,vb)=>{"use strict";m();var Td=gb(),s9=typeof globalThis>"u"?global:globalThis;vb.exports=s(function(){for(var t=[],e=0;e<Td.length;e++)typeof s9[Td[e]]=="function"&&(t[t.length]=Td[e]);return t},"availableTypedArrays")});var Pb=B((r_,Mb)=>{"use strict";m();var Fc=fb(),l9=bb(),Cb=Qi(),Ed=St(),Rc=dc(),c9=Ed("Object.prototype.toString"),xb=mi()(),Sb=typeof globalThis>"u"?global:globalThis,wd=l9(),Dd=Ed("String.prototype.slice"),Id=Object.getPrototypeOf,p9=Ed("Array.prototype.indexOf",!0)||s(function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},"indexOf"),Nc={__proto__:null};xb&&Rc&&Id?Fc(wd,function(r){var t=new Sb[r];if(Symbol.toStringTag in t){var e=Id(t),i=Rc(e,Symbol.toStringTag);if(!i){var n=Id(e);i=Rc(n,Symbol.toStringTag)}Nc["$"+r]=Cb(i.get)}}):Fc(wd,function(r){var t=new Sb[r],e=t.slice||t.set;e&&(Nc["$"+r]=Cb(e))});var u9=s(function(t){var e=!1;return Fc(Nc,function(i,n){if(!e)try{"$"+i(t)===n&&(e=Dd(n,1))}catch{}}),e},"tryAllTypedArrays"),h9=s(function(t){var e=!1;return Fc(Nc,function(i,n){if(!e)try{i(t),e=Dd(n,1)}catch{}}),e},"tryAllSlices");Mb.exports=s(function(t){if(!t||typeof t!="object")return!1;if(!xb){var e=Dd(c9(t),8,-1);return p9(wd,e)>-1?e:e!=="Object"?!1:h9(t)}return Rc?u9(t):null},"whichTypedArray")});var wb=B((o_,Ib)=>{"use strict";m();var d9=St(),Tb=d9("ArrayBuffer.prototype.byteLength",!0),m9=ud();Ib.exports=s(function(t){return m9(t)?Tb?Tb(t):t.byteLength:NaN},"byteLength")});var Kb=B((l_,Jb)=>{"use strict";m();var zb=n2(),fr=St(),Eb=v2(),f9=Ht(),no=fv(),y9=Wh(),Db=Pv(),Lb=Lh(),Ob=Yh(),_b=ud(),Ab=Lv(),kb=Bv(),Bb=Nv(),Rb=oc(),Fb=tb(),Nb=lb(),Gb=Pb(),Vb=wb(),Hb=fr("SharedArrayBuffer.prototype.byteLength",!0),jb=fr("Date.prototype.getTime"),Ld=Object.getPrototypeOf,Xb=fr("Object.prototype.toString"),Vc=f9("%Set%",!0),Od=fr("Map.prototype.has",!0),Hc=fr("Map.prototype.get",!0),Wb=fr("Map.prototype.size",!0),jc=fr("Set.prototype.add",!0),qb=fr("Set.prototype.delete",!0),Xc=fr("Set.prototype.has",!0),Gc=fr("Set.prototype.size",!0);function Ub(r,t,e,i){for(var n=no(r),o;(o=n.next())&&!o.done;)if(jt(t,o.value,e,i))return qb(r,o.value),!0;return!1}s(Ub,"setHasEqualElement");function $b(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}s($b,"findLooseMatchingPrimitives");function g9(r,t,e,i,n,o){var a=$b(e);if(a!=null)return a;var p=Hc(t,a),c=zb({},n,{strict:!1});return typeof p>"u"&&!Od(t,a)||!jt(i,p,c,o)?!1:!Od(r,a)&&jt(i,p,c,o)}s(g9,"mapMightHaveLoosePrim");function v9(r,t,e){var i=$b(e);return i!=null?i:Xc(t,i)&&!Xc(r,i)}s(v9,"setMightHaveLoosePrim");function Yb(r,t,e,i,n,o){for(var a=no(r),p,c;(p=a.next())&&!p.done;)if(c=p.value,jt(e,c,n,o)&&jt(i,Hc(t,c),n,o))return qb(r,c),!0;return!1}s(Yb,"mapHasEqualEntry");function jt(r,t,e,i){var n=e||{};if(n.strict?Db(r,t):r===t)return!0;var o=Fb(r),a=Fb(t);if(o!==a)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return n.strict?Db(r,t):r==t;var p=i.has(r),c=i.has(t),u;if(p&&c){if(i.get(r)===i.get(t))return!0}else u={};return p||i.set(r,u),c||i.set(t,u),S9(r,t,n,i)}s(jt,"internalDeepEqual");function Zb(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))}s(Zb,"isBuffer");function b9(r,t,e,i){if(Gc(r)!==Gc(t))return!1;for(var n=no(r),o=no(t),a,p,c;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")c||(c=new Vc),jc(c,a.value);else if(!Xc(t,a.value)){if(e.strict||!v9(r,t,a.value))return!1;c||(c=new Vc),jc(c,a.value)}if(c){for(;(p=o.next())&&!p.done;)if(p.value&&typeof p.value=="object"){if(!Ub(c,p.value,e.strict,i))return!1}else if(!e.strict&&!Xc(r,p.value)&&!Ub(c,p.value,e.strict,i))return!1;return Gc(c)===0}return!0}s(b9,"setEquiv");function C9(r,t,e,i){if(Wb(r)!==Wb(t))return!1;for(var n=no(r),o=no(t),a,p,c,u,f,y;(a=n.next())&&!a.done;)if(u=a.value[0],f=a.value[1],u&&typeof u=="object")c||(c=new Vc),jc(c,u);else if(y=Hc(t,u),typeof y>"u"&&!Od(t,u)||!jt(f,y,e,i)){if(e.strict||!g9(r,t,u,f,e,i))return!1;c||(c=new Vc),jc(c,u)}if(c){for(;(p=o.next())&&!p.done;)if(u=p.value[0],y=p.value[1],u&&typeof u=="object"){if(!Yb(c,r,u,y,e,i))return!1}else if(!e.strict&&(!r.has(u)||!jt(Hc(r,u),y,e,i))&&!Yb(c,r,u,y,zb({},e,{strict:!1}),i))return!1;return Gc(c)===0}return!0}s(C9,"mapEquiv");function S9(r,t,e,i){var n,o;if(typeof r!=typeof t||r==null||t==null||Xb(r)!==Xb(t)||Lb(r)!==Lb(t))return!1;var a=Ob(r),p=Ob(t);if(a!==p)return!1;var c=r instanceof Error,u=t instanceof Error;if(c!==u||(c||u)&&(r.name!==t.name||r.message!==t.message))return!1;var f=kb(r),y=kb(t);if(f!==y||(f||y)&&(r.source!==t.source||Eb(r)!==Eb(t)))return!1;var g=Ab(r),C=Ab(t);if(g!==C||(g||C)&&jb(r)!==jb(t)||e.strict&&Ld&&Ld(r)!==Ld(t))return!1;var x=Gb(r),M=Gb(t);if(x!==M)return!1;if(x||M){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var v=Zb(r),S=Zb(t);if(v!==S)return!1;if(v||S){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}var E=_b(r),w=_b(t);if(E!==w)return!1;if(E||w)return Vb(r)!==Vb(t)?!1:typeof Uint8Array=="function"&&jt(new Uint8Array(r),new Uint8Array(t),e,i);var T=Bb(r),D=Bb(t);if(T!==D)return!1;if(T||D)return Hb(r)!==Hb(t)?!1:typeof Uint8Array=="function"&&jt(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var _=Rb(r),N=Rb(t);if(_.length!==N.length)return!1;for(_.sort(),N.sort(),n=_.length-1;n>=0;n--)if(_[n]!=N[n])return!1;for(n=_.length-1;n>=0;n--)if(o=_[n],!jt(r[o],t[o],e,i))return!1;var V=Nb(r),F=Nb(t);return V!==F?!1:V==="Set"||F==="Set"?b9(r,t,e,i):V==="Map"?C9(r,t,e,i):!0}s(S9,"objEquiv");Jb.exports=s(function(t,e,i){return jt(t,e,i,y9())},"deepEqual")});var m3=B(ae=>{"use strict";m();Object.defineProperty(ae,"__esModule",{value:!0});function x9(r){return r&&r.__esModule?r:{default:r}}s(x9,"_interopRequireDefault");var M9=Object.defineProperty,pe=s((r,t)=>M9(r,"name",{value:t,configurable:!0}),"__name"),P9=Kb(),T9=x9(P9),Va,Qb=(Va=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,i,n;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=(n=t==null?void 0:t.compareProperties)!=null?n:!0}compare(t,e){if(t.type!==e.type||!Na(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=_d(t),n=_d(e);return i.every(o=>n.some(a=>this.compare(o,a)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((i,n)=>Math.abs(i-e[n])<this.precision)}compareLine(t,e,i=0,n=!1){if(!Na(t,e))return!1;let o=t,a=e;if(n&&!this.compareCoord(o[0],a[0])){let c=this.fixStartIndex(a,o);if(c)a=c;else return!1}let p=this.compareCoord(o[i],a[i]);return this.direction||p?this.comparePath(o,a):this.compareCoord(o[i],a[a.length-(1+i)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(t,e){let i,n=-1;for(let o=0;o<t.length;o++)if(this.compareCoord(t[o],e[0])){n=o;break}return n>=0&&(i=[].concat(t.slice(n,t.length),t.slice(1,n+1))),i}comparePath(t,e){return t.every((i,n)=>this.compareCoord(i,e[n]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){let i=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length);return i.every(o=>n.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(t,e){return Na(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((i,n)=>this.compare(i,e.geometries[n]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?T9.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Na(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((i,n)=>this.compare(i,e.features[n]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}},s(Va,"_GeojsonEquality"),Va);pe(Qb,"GeojsonEquality");var I9=Qb;function Na(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}s(Na,"sameLength");pe(Na,"sameLength");function _d(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}s(_d,"explode");pe(_d,"explode");var ut=63710088e-1,kd={centimeters:ut*100,centimetres:ut*100,degrees:360/(2*Math.PI),feet:ut*3.28084,inches:ut*39.37,kilometers:ut/1e3,kilometres:ut/1e3,meters:ut,metres:ut,miles:ut/1609.344,millimeters:ut*1e3,millimetres:ut*1e3,nauticalmiles:ut/1852,radians:1,yards:ut*1.0936},Ad={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 Yr(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}s(Yr,"feature");pe(Yr,"feature");function e3(r,t,e={}){switch(r){case"Point":return Wc(t).geometry;case"LineString":return Yc(t).geometry;case"Polygon":return Uc(t).geometry;case"MultiPoint":return Rd(t).geometry;case"MultiLineString":return Bd(t).geometry;case"MultiPolygon":return Fd(t).geometry;default:throw new Error(r+" is invalid")}}s(e3,"geometry");pe(e3,"geometry");function Wc(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(!Ga(r[0])||!Ga(r[1]))throw new Error("coordinates must contain numbers");return Yr({type:"Point",coordinates:r},t,e)}s(Wc,"point");pe(Wc,"point");function t3(r,t,e={}){return Ha(r.map(i=>Wc(i,t)),e)}s(t3,"points");pe(t3,"points");function Uc(r,t,e={}){for(let n of r){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<n[n.length-1].length;o++)if(n[n.length-1][o]!==n[0][o])throw new Error("First and last Position are not equivalent.")}return Yr({type:"Polygon",coordinates:r},t,e)}s(Uc,"polygon");pe(Uc,"polygon");function r3(r,t,e={}){return Ha(r.map(i=>Uc(i,t)),e)}s(r3,"polygons");pe(r3,"polygons");function Yc(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return Yr({type:"LineString",coordinates:r},t,e)}s(Yc,"lineString");pe(Yc,"lineString");function i3(r,t,e={}){return Ha(r.map(i=>Yc(i,t)),e)}s(i3,"lineStrings");pe(i3,"lineStrings");function Ha(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}s(Ha,"featureCollection");pe(Ha,"featureCollection");function Bd(r,t,e={}){return Yr({type:"MultiLineString",coordinates:r},t,e)}s(Bd,"multiLineString");pe(Bd,"multiLineString");function Rd(r,t,e={}){return Yr({type:"MultiPoint",coordinates:r},t,e)}s(Rd,"multiPoint");pe(Rd,"multiPoint");function Fd(r,t,e={}){return Yr({type:"MultiPolygon",coordinates:r},t,e)}s(Fd,"multiPolygon");pe(Fd,"multiPolygon");function n3(r,t,e={}){return Yr({type:"GeometryCollection",geometries:r},t,e)}s(n3,"geometryCollection");pe(n3,"geometryCollection");function o3(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}s(o3,"round");pe(o3,"round");function Nd(r,t="kilometers"){let e=kd[t];if(!e)throw new Error(t+" units is invalid");return r*e}s(Nd,"radiansToLength");pe(Nd,"radiansToLength");function Zc(r,t="kilometers"){let e=kd[t];if(!e)throw new Error(t+" units is invalid");return r/e}s(Zc,"lengthToRadians");pe(Zc,"lengthToRadians");function a3(r,t){return Gd(Zc(r,t))}s(a3,"lengthToDegrees");pe(a3,"lengthToDegrees");function s3(r){let t=r%360;return t<0&&(t+=360),t}s(s3,"bearingToAzimuth");pe(s3,"bearingToAzimuth");function Gd(r){return r%(2*Math.PI)*180/Math.PI}s(Gd,"radiansToDegrees");pe(Gd,"radiansToDegrees");function l3(r){return r%360*Math.PI/180}s(l3,"degreesToRadians");pe(l3,"degreesToRadians");function c3(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Nd(Zc(r,t),e)}s(c3,"convertLength");pe(c3,"convertLength");function p3(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=Ad[t];if(!i)throw new Error("invalid original units");let n=Ad[e];if(!n)throw new Error("invalid final units");return r/i*n}s(p3,"convertArea");pe(p3,"convertArea");function Ga(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}s(Ga,"isNumber");pe(Ga,"isNumber");function u3(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}s(u3,"isObject");pe(u3,"isObject");function h3(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(!Ga(t))throw new Error("bbox must only contain numbers")})}s(h3,"validateBBox");pe(h3,"validateBBox");function d3(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")}s(d3,"validateId");pe(d3,"validateId");ae.GeojsonEquality=I9;ae.areaFactors=Ad;ae.bearingToAzimuth=s3;ae.convertArea=p3;ae.convertLength=c3;ae.degreesToRadians=l3;ae.earthRadius=ut;ae.factors=kd;ae.feature=Yr;ae.featureCollection=Ha;ae.geometry=e3;ae.geometryCollection=n3;ae.isNumber=Ga;ae.isObject=u3;ae.lengthToDegrees=a3;ae.lengthToRadians=Zc;ae.lineString=Yc;ae.lineStrings=i3;ae.multiLineString=Bd;ae.multiPoint=Rd;ae.multiPolygon=Fd;ae.point=Wc;ae.points=t3;ae.polygon=Uc;ae.polygons=r3;ae.radiansToDegrees=Gd;ae.radiansToLength=Nd;ae.round=o3;ae.validateBBox=h3;ae.validateId=d3});var T3=B(Re=>{"use strict";m();Object.defineProperty(Re,"__esModule",{value:!0});var w9=Object.defineProperty,Ue=s((r,t)=>w9(r,"name",{value:t,configurable:!0}),"__name"),ze=m3();function oo(r,t,e){if(r!==null)for(var i,n,o,a,p,c,u,f=0,y=0,g,C=r.type,x=C==="FeatureCollection",M=C==="Feature",v=x?r.features.length:1,S=0;S<v;S++){u=x?r.features[S].geometry:M?r.geometry:r,g=u?u.type==="GeometryCollection":!1,p=g?u.geometries.length:1;for(var E=0;E<p;E++){var w=0,T=0;if(a=g?u.geometries[E]:u,a!==null){c=a.coordinates;var D=a.type;switch(f=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(c,y,S,w,T)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],y,S,w,T)===!1)return!1;y++,D==="MultiPoint"&&w++}D==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-f;n++){if(t(c[i][n],y,S,w,T)===!1)return!1;y++}D==="MultiLineString"&&w++,D==="Polygon"&&T++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(T=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-f;o++){if(t(c[i][n][o],y,S,w,T)===!1)return!1;y++}T++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(oo(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(oo,"coordEach");Ue(oo,"coordEach");function f3(r,t,e,i){var n=e;return oo(r,function(o,a,p,c,u){a===0&&e===void 0?n=o:n=t(n,o,a,p,c,u)},i),n}s(f3,"coordReduce");Ue(f3,"coordReduce");function Vd(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}}s(Vd,"propEach");Ue(Vd,"propEach");function y3(r,t,e){var i=e;return Vd(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}s(y3,"propReduce");Ue(y3,"propReduce");function Hd(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++);}s(Hd,"featureEach");Ue(Hd,"featureEach");function g3(r,t,e){var i=e;return Hd(r,function(n,o){o===0&&e===void 0?i=n:i=t(i,n,o)}),i}s(g3,"featureReduce");Ue(g3,"featureReduce");function v3(r){var t=[];return oo(r,function(e){t.push(e)}),t}s(v3,"coordAll");Ue(v3,"coordAll");function zc(r,t){var e,i,n,o,a,p,c,u,f,y,g=0,C=r.type==="FeatureCollection",x=r.type==="Feature",M=C?r.features.length:1;for(e=0;e<M;e++){for(p=C?r.features[e].geometry:x?r.geometry:r,u=C?r.features[e].properties:x?r.properties:{},f=C?r.features[e].bbox:x?r.bbox:void 0,y=C?r.features[e].id:x?r.id:void 0,c=p?p.type==="GeometryCollection":!1,a=c?p.geometries.length:1,n=0;n<a;n++){if(o=c?p.geometries[n]:p,o===null){if(t(null,g,u,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,u,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,u,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}s(zc,"geomEach");Ue(zc,"geomEach");function b3(r,t,e){var i=e;return zc(r,function(n,o,a,p,c){o===0&&e===void 0?i=n:i=t(i,n,o,a,p,c)}),i}s(b3,"geomReduce");Ue(b3,"geomReduce");function ja(r,t){zc(r,function(e,i,n,o,a){var p=e===null?null:e.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return t(ze.feature.call(void 0,e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(p){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var f=e.coordinates[u],y={type:c,coordinates:f};if(t(ze.feature.call(void 0,y,n),i,u)===!1)return!1}})}s(ja,"flattenEach");Ue(ja,"flattenEach");function C3(r,t,e){var i=e;return ja(r,function(n,o,a){o===0&&a===0&&e===void 0?i=n:i=t(i,n,o,a)}),i}s(C3,"flattenReduce");Ue(C3,"flattenReduce");function jd(r,t){ja(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var p,c=0,u=0,f=0;if(oo(e,function(y,g,C,x,M){if(p===void 0||i>c||x>u||M>f){p=y,c=i,u=x,f=M,o=0;return}var v=ze.lineString.call(void 0,[p,y],e.properties);if(t(v,i,n,M,o)===!1)return!1;o++,p=y})===!1)return!1}}})}s(jd,"segmentEach");Ue(jd,"segmentEach");function S3(r,t,e){var i=e,n=!1;return jd(r,function(o,a,p,c,u){n===!1&&e===void 0?i=o:i=t(i,o,a,p,c,u),n=!0}),i}s(S3,"segmentReduce");Ue(S3,"segmentReduce");function Xd(r,t){if(!r)throw new Error("geojson is required");ja(r,function(e,i,n){if(e.geometry!==null){var o=e.geometry.type,a=e.geometry.coordinates;switch(o){case"LineString":if(t(e,i,n,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p<a.length;p++)if(t(ze.lineString.call(void 0,a[p],e.properties),i,n,p)===!1)return!1;break}}})}s(Xd,"lineEach");Ue(Xd,"lineEach");function x3(r,t,e){var i=e;return Xd(r,function(n,o,a,p){o===0&&e===void 0?i=n:i=t(i,n,o,a,p)}),i}s(x3,"lineReduce");Ue(x3,"lineReduce");function M3(r,t){if(t=t||{},!ze.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.segmentIndex||0,a=t.properties,p;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,p=r.features[e].geometry;break;case"Feature":a=a||r.properties,p=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=r;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var c=p.coordinates;switch(p.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=c.length+o-1),ze.lineString.call(void 0,[c[o],c[o+1]],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o-1),ze.lineString.call(void 0,[c[n][o],c[n][o+1]],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o-1),ze.lineString.call(void 0,[c[i][o],c[i][o+1]],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o-1),ze.lineString.call(void 0,[c[i][n][o],c[i][n][o+1]],a,t)}throw new Error("geojson is invalid")}s(M3,"findSegment");Ue(M3,"findSegment");function P3(r,t){if(t=t||{},!ze.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,n=t.geometryIndex||0,o=t.coordIndex||0,a=t.properties,p;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),a=a||r.features[e].properties,p=r.features[e].geometry;break;case"Feature":a=a||r.properties,p=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=r;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var c=p.coordinates;switch(p.type){case"Point":return ze.point.call(void 0,c,a,t);case"MultiPoint":return i<0&&(i=c.length+i),ze.point.call(void 0,c[i],a,t);case"LineString":return o<0&&(o=c.length+o),ze.point.call(void 0,c[o],a,t);case"Polygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),ze.point.call(void 0,c[n][o],a,t);case"MultiLineString":return i<0&&(i=c.length+i),o<0&&(o=c[i].length+o),ze.point.call(void 0,c[i][o],a,t);case"MultiPolygon":return i<0&&(i=c.length+i),n<0&&(n=c[i].length+n),o<0&&(o=c[i][n].length-o),ze.point.call(void 0,c[i][n][o],a,t)}throw new Error("geojson is invalid")}s(P3,"findPoint");Ue(P3,"findPoint");Re.coordAll=v3;Re.coordEach=oo;Re.coordReduce=f3;Re.featureEach=Hd;Re.featureReduce=g3;Re.findPoint=P3;Re.findSegment=M3;Re.flattenEach=ja;Re.flattenReduce=C3;Re.geomEach=zc;Re.geomReduce=b3;Re.lineEach=Xd;Re.lineReduce=x3;Re.propEach=Vd;Re.propReduce=y3;Re.segmentEach=jd;Re.segmentReduce=S3});var I3=B(qc=>{"use strict";m();Object.defineProperty(qc,"__esModule",{value:!0});var E9=Object.defineProperty,D9=s((r,t)=>E9(r,"name",{value:t,configurable:!0}),"__name"),L9=T3();function Wd(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return L9.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}s(Wd,"bbox");D9(Wd,"bbox");var O9=Wd;qc.bbox=Wd;qc.default=O9});var O3=B((x_,Ud)=>{m();var yr=Tg(),E3=hh(),D3=Bg(),ao=I3().default,_9=D3.featureEach,C_=D3.coordEach,S_=E3.polygon,w3=E3.featureCollection;function L3(r){var t=new yr(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ao(e),yr.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:ao(n),i.push(n)}):_9(e,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:ao(n),i.push(n)}),yr.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:ao(e),yr.prototype.remove.call(this,e,i)},t.clear=function(){return yr.prototype.clear.call(this)},t.search=function(e){var i=yr.prototype.search.call(this,this.toBBox(e));return w3(i)},t.collides=function(e){return yr.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=yr.prototype.all.call(this);return w3(e)},t.toJSON=function(){return yr.prototype.toJSON.call(this)},t.fromJSON=function(e){return yr.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=ao(e);else if(e.type==="FeatureCollection")i=ao(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}s(L3,"geojsonRbush");Ud.exports=L3;Ud.exports.default=L3});var Cn=B((nf,of)=>{m();var af=s(function(){this._tweens={},this._tweensAddedDuringUpdate={}},"_Group");af.prototype={getAll:function(){return Object.keys(this._tweens).map((function(r){return this._tweens[r]}).bind(this))},removeAll:function(){this._tweens={}},add:function(r){this._tweens[r.getId()]=r,this._tweensAddedDuringUpdate[r.getId()]=r},remove:function(r){delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]},update:function(r,t){var e=Object.keys(this._tweens);if(e.length===0)return!1;for(r=r!==void 0?r:ue.now();e.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<e.length;i++){var n=this._tweens[e[i]];n&&n.update(r)===!1&&(n._isPlaying=!1,t||delete this._tweens[e[i]])}e=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var ue=new af;ue.Group=af;ue._nextId=0;ue.nextId=function(){return ue._nextId++};typeof self>"u"&&typeof b<"u"&&b.hrtime?ue.now=function(){var r=b.hrtime();return r[0]*1e3+r[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?ue.now=self.performance.now.bind(self.performance):Date.now!==void 0?ue.now=Date.now:ue.now=function(){return new Date().getTime()};ue.Tween=function(r,t){this._object=r,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=ue.Easing.Linear.None,this._interpolationFunction=ue.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=t||ue,this._id=ue.nextId()};ue.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(r,t){return this._valuesEnd=r,t!==void 0&&(this._duration=t),this},duration:s(function(t){return this._duration=t,this},"duration"),start:function(r){this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=r!==void 0?typeof r=="string"?ue.now()+parseFloat(r):r:ue.now(),this._startTime+=this._delayTime;for(var t in this._valuesEnd){if(this._valuesEnd[t]instanceof Array){if(this._valuesEnd[t].length===0)continue;this._valuesEnd[t]=[this._object[t]].concat(this._valuesEnd[t])}this._object[t]!==void 0&&(this._valuesStart[t]=this._object[t],this._valuesStart[t]instanceof Array||(this._valuesStart[t]*=1),this._valuesStartRepeat[t]=this._valuesStart[t]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,this._onStopCallback!==null&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var r=0,t=this._chainedTweens.length;r<t;r++)this._chainedTweens[r].stop()},group:function(r){return this._group=r,this},delay:function(r){return this._delayTime=r,this},repeat:function(r){return this._repeat=r,this},repeatDelay:function(r){return this._repeatDelayTime=r,this},yoyo:function(r){return this._yoyo=r,this},easing:function(r){return this._easingFunction=r,this},interpolation:function(r){return this._interpolationFunction=r,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(r){return this._onStartCallback=r,this},onUpdate:function(r){return this._onUpdateCallback=r,this},onRepeat:s(function(t){return this._onRepeatCallback=t,this},"onRepeat"),onComplete:function(r){return this._onCompleteCallback=r,this},onStop:function(r){return this._onStopCallback=r,this},update:function(r){var t,e,i;if(r<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback!==null&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),e=(r-this._startTime)/this._duration,e=this._duration===0||e>1?1:e,i=this._easingFunction(e);for(t in this._valuesEnd)if(this._valuesStart[t]!==void 0){var n=this._valuesStart[t]||0,o=this._valuesEnd[t];o instanceof Array?this._object[t]=this._interpolationFunction(o,i):(typeof o=="string"&&(o.charAt(0)==="+"||o.charAt(0)==="-"?o=n+parseFloat(o):o=parseFloat(o)),typeof o=="number"&&(this._object[t]=n+(o-n)*i))}if(this._onUpdateCallback!==null&&this._onUpdateCallback(this._object,e),e===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(t in this._valuesStartRepeat){if(typeof this._valuesEnd[t]=="string"&&(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo){var a=this._valuesStartRepeat[t];this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=a}this._valuesStart[t]=this._valuesStartRepeat[t]}return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=r+this._repeatDelayTime:this._startTime=r+this._delayTime,this._onRepeatCallback!==null&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback!==null&&this._onCompleteCallback(this._object);for(var p=0,c=this._chainedTweens.length;p<c;p++)this._chainedTweens[p].start(this._startTime+this._duration);return!1}return!0}};ue.Easing={Linear:{None:function(r){return r}},Quadratic:{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:{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:{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:{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:{In:function(r){return 1-Math.cos(r*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.cos(Math.PI*r))}},Exponential:{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:{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:{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:{In:function(r){var t=1.70158;return r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return--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:{In:function(r){return 1-ue.Easing.Bounce.Out(1-r)},Out:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},InOut:function(r){return r<.5?ue.Easing.Bounce.In(r*2)*.5:ue.Easing.Bounce.Out(r*2-1)*.5+.5}}};ue.Interpolation={Linear:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=ue.Interpolation.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[n],r[n+1>e?e:n+1],i-n)},Bezier:function(r,t){for(var e=0,i=r.length-1,n=Math.pow,o=ue.Interpolation.Utils.Bernstein,a=0;a<=i;a++)e+=n(1-t,i-a)*n(t,a)*r[a]*o(i,a);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,n=Math.floor(i),o=ue.Interpolation.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(n=Math.floor(i=e*(1+t))),o(r[(n-1+e)%e],r[n],r[(n+1)%e],r[(n+2)%e],i-n)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[n?n-1:0],r[n],r[e<n+1?e:n+1],r[e<n+2?e:n+2],i-n)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=ue.Interpolation.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,n){var o=(e-r)*.5,a=(i-t)*.5,p=n*n,c=n*p;return(2*t-2*e+o+a)*c+(-3*t+3*e-2*o-a)*p+o*n+t}}};(function(r){typeof define=="function"&&define.amd?define([],function(){return ue}):typeof of<"u"&&typeof nf=="object"?of.exports=ue:r!==void 0&&(r.TWEEN=ue)})(nf)});var N5=B((pU,Ws)=>{"use strict";m();var mM=!1,Dn=!1,O5=!0,_5=!1,d={},A5=!1;typeof Ws<"u"&&Ws.exports?(Ws.exports=d,A5=!0):typeof document<"u"?window.ClipperLib=d:self.ClipperLib=d;var Zp;A5?(Ve="chrome",Zp="Netscape"):(Ve=navigator.userAgent.toString().toLowerCase(),Zp=navigator.appName);var Ve,Q={};Ve.indexOf("chrome")!=-1&&Ve.indexOf("chromium")==-1?Q.chrome=1:Q.chrome=0;Ve.indexOf("chromium")!=-1?Q.chromium=1:Q.chromium=0;Ve.indexOf("safari")!=-1&&Ve.indexOf("chrome")==-1&&Ve.indexOf("chromium")==-1?Q.safari=1:Q.safari=0;Ve.indexOf("firefox")!=-1?Q.firefox=1:Q.firefox=0;Ve.indexOf("firefox/17")!=-1?Q.firefox17=1:Q.firefox17=0;Ve.indexOf("firefox/15")!=-1?Q.firefox15=1:Q.firefox15=0;Ve.indexOf("firefox/3")!=-1?Q.firefox3=1:Q.firefox3=0;Ve.indexOf("opera")!=-1?Q.opera=1:Q.opera=0;Ve.indexOf("msie 10")!=-1?Q.msie10=1:Q.msie10=0;Ve.indexOf("msie 9")!=-1?Q.msie9=1:Q.msie9=0;Ve.indexOf("msie 8")!=-1?Q.msie8=1:Q.msie8=0;Ve.indexOf("msie 7")!=-1?Q.msie7=1:Q.msie7=0;Ve.indexOf("msie ")!=-1?Q.msie=1:Q.msie=0;d.biginteger_used=null;var Ai,fM=0xdeadbeefcafe,D5=(fM&16777215)==15715070;function A(r,t,e){d.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))}s(A,"BigInteger");function oe(){return new A(null)}s(oe,"nbi");function yM(r,t,e,i,n,o){for(;--o>=0;){var a=t*this[r++]+e[i]+n;n=Math.floor(a/67108864),e[i++]=a&67108863}return n}s(yM,"am1");function gM(r,t,e,i,n,o){for(var a=t&32767,p=t>>15;--o>=0;){var c=this[r]&32767,u=this[r++]>>15,f=p*c+u*a;c=a*c+((f&32767)<<15)+e[i]+(n&1073741823),n=(c>>>30)+(f>>>15)+p*u+(n>>>30),e[i++]=c&1073741823}return n}s(gM,"am2");function vM(r,t,e,i,n,o){for(var a=t&16383,p=t>>14;--o>=0;){var c=this[r]&16383,u=this[r++]>>14,f=p*c+u*a;c=a*c+((f&16383)<<14)+e[i]+n,n=(c>>28)+(f>>14)+p*u,e[i++]=c&268435455}return n}s(vM,"am3");D5&&Zp=="Microsoft Internet Explorer"?(A.prototype.am=gM,Ai=30):D5&&Zp!="Netscape"?(A.prototype.am=yM,Ai=26):(A.prototype.am=vM,Ai=28);A.prototype.DB=Ai;A.prototype.DM=(1<<Ai)-1;A.prototype.DV=1<<Ai;var n1=52;A.prototype.FV=Math.pow(2,n1);A.prototype.F1=n1-Ai;A.prototype.F2=2*Ai-n1;var bM="0123456789abcdefghijklmnopqrstuvwxyz",qp=new Array,Zo,kt;Zo=48;for(kt=0;kt<=9;++kt)qp[Zo++]=kt;Zo=97;for(kt=10;kt<36;++kt)qp[Zo++]=kt;Zo=65;for(kt=10;kt<36;++kt)qp[Zo++]=kt;function L5(r){return bM.charAt(r)}s(L5,"int2char");function k5(r,t){var e=qp[r.charCodeAt(t)];return e==null?-1:e}s(k5,"intAt");function CM(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}s(CM,"bnpCopyTo");function SM(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}s(SM,"bnpFromInt");function _i(r){var t=oe();return t.fromInt(r),t}s(_i,"nbv");function xM(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,n=!1,o=0;--i>=0;){var a=e==8?r[i]&255:k5(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=e,o>=this.DB&&(o-=this.DB)}e==8&&r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&A.ZERO.subTo(this,this)}s(xM,"bnpFromString");function MM(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}s(MM,"bnpClamp");function PM(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,n=!1,o="",a=this.t,p=this.DB-a*this.DB%t;if(a-- >0)for(p<this.DB&&(i=this[a]>>p)>0&&(n=!0,o=L5(i));a>=0;)p<t?(i=(this[a]&(1<<p)-1)<<t-p,i|=this[--a]>>(p+=this.DB-t)):(i=this[a]>>(p-=t)&e,p<=0&&(p+=this.DB,--a)),i>0&&(n=!0),n&&(o+=L5(i));return n?o:"0"}s(PM,"bnToString");function TM(){var r=oe();return A.ZERO.subTo(this,r),r}s(TM,"bnNegate");function IM(){return this.s<0?this.negate():this}s(IM,"bnAbs");function wM(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}s(wM,"bnCompareTo");function $p(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}s($p,"nbits");function EM(){return this.t<=0?0:this.DB*(this.t-1)+$p(this[this.t-1]^this.s&this.DM)}s(EM,"bnBitLength");function DM(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}s(DM,"bnpDLShiftTo");function LM(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}s(LM,"bnpDRShiftTo");function OM(r,t){var e=r%this.DB,i=this.DB-e,n=(1<<i)-1,o=Math.floor(r/this.DB),a=this.s<<e&this.DM,p;for(p=this.t-1;p>=0;--p)t[p+o+1]=this[p]>>i|a,a=(this[p]&n)<<e;for(p=o-1;p>=0;--p)t[p]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}s(OM,"bnpLShiftTo");function _M(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,n=this.DB-i,o=(1<<i)-1;t[0]=this[e]>>i;for(var a=e+1;a<this.t;++a)t[a-e-1]|=(this[a]&o)<<n,t[a-e]=this[a]>>i;i>0&&(t[this.t-e-1]|=(this.s&o)<<n),t.t=this.t-e,t.clamp()}s(_M,"bnpRShiftTo");function AM(r,t){for(var e=0,i=0,n=Math.min(r.t,this.t);e<n;)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()}s(AM,"bnpSubTo");function kM(r,t){var e=this.abs(),i=r.abs(),n=e.t;for(t.t=n+i.t;--n>=0;)t[n]=0;for(n=0;n<i.t;++n)t[n+e.t]=e.am(0,i[n],t,n,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&A.ZERO.subTo(t,t)}s(kM,"bnpMultiplyTo");function BM(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()}s(BM,"bnpSquareTo");function RM(r,t,e){var i=r.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=oe());var o=oe(),a=this.s,p=r.s,c=this.DB-$p(i[i.t-1]);c>0?(i.lShiftTo(c,o),n.lShiftTo(c,e)):(i.copyTo(o),n.copyTo(e));var u=o.t,f=o[u-1];if(f!=0){var y=f*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),g=this.FV/y,C=(1<<this.F1)/y,x=1<<this.F2,M=e.t,v=M-u,S=t==null?oe():t;for(o.dlShiftTo(v,S),e.compareTo(S)>=0&&(e[e.t++]=1,e.subTo(S,e)),A.ONE.dlShiftTo(u,S),S.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--v>=0;){var E=e[--M]==f?this.DM:Math.floor(e[M]*g+(e[M-1]+x)*C);if((e[M]+=o.am(0,E,e,v,0,u))<E)for(o.dlShiftTo(v,S),e.subTo(S,e);e[M]<--E;)e.subTo(S,e)}t!=null&&(e.drShiftTo(u,t),a!=p&&A.ZERO.subTo(t,t)),e.t=u,e.clamp(),c>0&&e.rShiftTo(c,e),a<0&&A.ZERO.subTo(e,e)}}}s(RM,"bnpDivRemTo");function FM(r){var t=oe();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(A.ZERO)>0&&r.subTo(t,t),t}s(FM,"bnMod");function Ln(r){this.m=r}s(Ln,"Classic");function NM(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}s(NM,"cConvert");function GM(r){return r}s(GM,"cRevert");function VM(r){r.divRemTo(this.m,null,r)}s(VM,"cReduce");function HM(r,t,e){r.multiplyTo(t,e),this.reduce(e)}s(HM,"cMulTo");function jM(r,t){r.squareTo(t),this.reduce(t)}s(jM,"cSqrTo");Ln.prototype.convert=NM;Ln.prototype.revert=GM;Ln.prototype.reduce=VM;Ln.prototype.mulTo=HM;Ln.prototype.sqrTo=jM;function XM(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}s(XM,"bnpInvDigit");function On(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}s(On,"Montgomery");function WM(r){var t=oe();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(A.ZERO)>0&&this.m.subTo(t,t),t}s(WM,"montConvert");function UM(r){var t=oe();return r.copyTo(t),this.reduce(t),t}s(UM,"montRevert");function YM(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)}s(YM,"montReduce");function ZM(r,t){r.squareTo(t),this.reduce(t)}s(ZM,"montSqrTo");function zM(r,t,e){r.multiplyTo(t,e),this.reduce(e)}s(zM,"montMulTo");On.prototype.convert=WM;On.prototype.revert=UM;On.prototype.reduce=YM;On.prototype.mulTo=zM;On.prototype.sqrTo=ZM;function qM(){return(this.t>0?this[0]&1:this.s)==0}s(qM,"bnpIsEven");function $M(r,t){if(r>4294967295||r<1)return A.ONE;var e=oe(),i=oe(),n=t.convert(this),o=$p(r)-1;for(n.copyTo(e);--o>=0;)if(t.sqrTo(e,i),(r&1<<o)>0)t.mulTo(i,n,e);else{var a=e;e=i,i=a}return t.revert(e)}s($M,"bnpExp");function JM(r,t){var e;return r<256||t.isEven()?e=new Ln(t):e=new On(t),this.exp(r,e)}s(JM,"bnModPowInt");A.prototype.copyTo=CM;A.prototype.fromInt=SM;A.prototype.fromString=xM;A.prototype.clamp=MM;A.prototype.dlShiftTo=DM;A.prototype.drShiftTo=LM;A.prototype.lShiftTo=OM;A.prototype.rShiftTo=_M;A.prototype.subTo=AM;A.prototype.multiplyTo=kM;A.prototype.squareTo=BM;A.prototype.divRemTo=RM;A.prototype.invDigit=XM;A.prototype.isEven=qM;A.prototype.exp=$M;A.prototype.toString=PM;A.prototype.negate=TM;A.prototype.abs=IM;A.prototype.compareTo=wM;A.prototype.bitLength=EM;A.prototype.mod=FM;A.prototype.modPowInt=JM;A.ZERO=_i(0);A.ONE=_i(1);function KM(){var r=oe();return this.copyTo(r),r}s(KM,"bnClone");function QM(){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]}s(QM,"bnIntValue");function eP(){return this.t==0?this.s:this[0]<<24>>24}s(eP,"bnByteValue");function tP(){return this.t==0?this.s:this[0]<<16>>16}s(tP,"bnShortValue");function rP(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}s(rP,"bnpChunkSize");function iP(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}s(iP,"bnSigNum");function nP(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=_i(e),n=oe(),o=oe(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(e+o.intValue()).toString(r).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(r)+a}s(nP,"bnpToRadix");function oP(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),n=!1,o=0,a=0,p=0;p<r.length;++p){var c=k5(r,p);if(c<0){r.charAt(p)=="-"&&this.signum()==0&&(n=!0);continue}a=t*a+c,++o>=e&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),n&&A.ZERO.subTo(this,this)}s(oP,"bnpFromRadix");function aP(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(A.ONE.shiftLeft(r-1),o1,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(A.ONE.shiftLeft(r-1),this);else{var i=new Array,n=r&7;i.length=(r>>3)+1,t.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}s(aP,"bnpFromNumber");function sP(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[n++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),i&128&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(t[n++]=i);return t}s(sP,"bnToByteArray");function lP(r){return this.compareTo(r)==0}s(lP,"bnEquals");function cP(r){return this.compareTo(r)<0?this:r}s(cP,"bnMin");function pP(r){return this.compareTo(r)>0?this:r}s(pP,"bnMax");function uP(r,t,e){var i,n,o=Math.min(r.t,this.t);for(i=0;i<o;++i)e[i]=t(this[i],r[i]);if(r.t<this.t){for(n=r.s&this.DM,i=o;i<this.t;++i)e[i]=t(this[i],n);e.t=this.t}else{for(n=this.s&this.DM,i=o;i<r.t;++i)e[i]=t(n,r[i]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}s(uP,"bnpBitwiseTo");function hP(r,t){return r&t}s(hP,"op_and");function dP(r){var t=oe();return this.bitwiseTo(r,hP,t),t}s(dP,"bnAnd");function o1(r,t){return r|t}s(o1,"op_or");function mP(r){var t=oe();return this.bitwiseTo(r,o1,t),t}s(mP,"bnOr");function B5(r,t){return r^t}s(B5,"op_xor");function fP(r){var t=oe();return this.bitwiseTo(r,B5,t),t}s(fP,"bnXor");function R5(r,t){return r&~t}s(R5,"op_andnot");function yP(r){var t=oe();return this.bitwiseTo(r,R5,t),t}s(yP,"bnAndNot");function gP(){for(var r=oe(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}s(gP,"bnNot");function vP(r){var t=oe();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}s(vP,"bnShiftLeft");function bP(r){var t=oe();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}s(bP,"bnShiftRight");function CP(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}s(CP,"lbit");function SP(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+CP(this[r]);return this.s<0?this.t*this.DB:-1}s(SP,"bnGetLowestSetBit");function xP(r){for(var t=0;r!=0;)r&=r-1,++t;return t}s(xP,"cbit");function MP(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=xP(this[e]^t);return r}s(MP,"bnBitCount");function PP(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}s(PP,"bnTestBit");function TP(r,t){var e=A.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}s(TP,"bnpChangeBit");function IP(r){return this.changeBit(r,o1)}s(IP,"bnSetBit");function wP(r){return this.changeBit(r,R5)}s(wP,"bnClearBit");function EP(r){return this.changeBit(r,B5)}s(EP,"bnFlipBit");function DP(r,t){for(var e=0,i=0,n=Math.min(r.t,this.t);e<n;)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()}s(DP,"bnpAddTo");function LP(r){var t=oe();return this.addTo(r,t),t}s(LP,"bnAdd");function OP(r){var t=oe();return this.subTo(r,t),t}s(OP,"bnSubtract");function _P(r){var t=oe();return this.multiplyTo(r,t),t}s(_P,"bnMultiply");function AP(){var r=oe();return this.squareTo(r),r}s(AP,"bnSquare");function kP(r){var t=oe();return this.divRemTo(r,t,null),t}s(kP,"bnDivide");function BP(r){var t=oe();return this.divRemTo(r,null,t),t}s(BP,"bnRemainder");function RP(r){var t=oe(),e=oe();return this.divRemTo(r,t,e),new Array(t,e)}s(RP,"bnDivideAndRemainder");function FP(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}s(FP,"bnpDMultiply");function NP(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]}}s(NP,"bnpDAddOffset");function Us(){}s(Us,"NullExp");function F5(r){return r}s(F5,"nNop");function GP(r,t,e){r.multiplyTo(t,e)}s(GP,"nMulTo");function VP(r,t){r.squareTo(t)}s(VP,"nSqrTo");Us.prototype.convert=F5;Us.prototype.revert=F5;Us.prototype.mulTo=GP;Us.prototype.sqrTo=VP;function HP(r){return this.exp(r,new Us)}s(HP,"bnPow");function jP(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 n;for(n=e.t-this.t;i<n;++i)e[i+this.t]=this.am(0,r[i],e,i,0,this.t);for(n=Math.min(r.t,t);i<n;++i)this.am(0,r[i],e,i,0,t-i);e.clamp()}s(jP,"bnpMultiplyLowerTo");function XP(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)}s(XP,"bnpMultiplyUpperTo");function zo(r){this.r2=oe(),this.q3=oe(),A.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}s(zo,"Barrett");function WP(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=oe();return r.copyTo(t),this.reduce(t),t}s(WP,"barrettConvert");function UP(r){return r}s(UP,"barrettRevert");function YP(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)}s(YP,"barrettReduce");function ZP(r,t){r.squareTo(t),this.reduce(t)}s(ZP,"barrettSqrTo");function zP(r,t,e){r.multiplyTo(t,e),this.reduce(e)}s(zP,"barrettMulTo");zo.prototype.convert=WP;zo.prototype.revert=UP;zo.prototype.reduce=YP;zo.prototype.mulTo=zP;zo.prototype.sqrTo=ZP;function qP(r,t){var e=r.bitLength(),i,n=_i(1),o;if(e<=0)return n;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?o=new Ln(t):t.isEven()?o=new zo(t):o=new On(t);var a=new Array,p=3,c=i-1,u=(1<<i)-1;if(a[1]=o.convert(this),i>1){var f=oe();for(o.sqrTo(a[1],f);p<=u;)a[p]=oe(),o.mulTo(f,a[p-2],a[p]),p+=2}var y=r.t-1,g,C=!0,x=oe(),M;for(e=$p(r[y])-1;y>=0;){for(e>=c?g=r[y]>>e-c&u:(g=(r[y]&(1<<e+1)-1)<<c-e,y>0&&(g|=r[y-1]>>this.DB+e-c)),p=i;!(g&1);)g>>=1,--p;if((e-=p)<0&&(e+=this.DB,--y),C)a[g].copyTo(n),C=!1;else{for(;p>1;)o.sqrTo(n,x),o.sqrTo(x,n),p-=2;p>0?o.sqrTo(n,x):(M=n,n=x,x=M),o.mulTo(x,a[g],n)}for(;y>=0&&!(r[y]&1<<e);)o.sqrTo(n,x),M=n,n=x,x=M,--e<0&&(e=this.DB-1,--y)}return o.revert(n)}s(qP,"bnModPow");function $P(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 n=t.getLowestSetBit(),o=e.getLowestSetBit();if(o<0)return t;for(n<o&&(o=n),o>0&&(t.rShiftTo(o,t),e.rShiftTo(o,e));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return o>0&&e.lShiftTo(o,e),e}s($P,"bnGCD");function JP(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}s(JP,"bnpModInt");function KP(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return A.ZERO;for(var e=r.clone(),i=this.clone(),n=_i(1),o=_i(0),a=_i(0),p=_i(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!n.isEven()||!o.isEven())&&(n.addTo(this,n),o.subTo(r,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),t?((!a.isEven()||!p.isEven())&&(a.addTo(this,a),p.subTo(r,p)),a.rShiftTo(1,a)):p.isEven()||p.subTo(r,p),p.rShiftTo(1,p);e.compareTo(i)>=0?(e.subTo(i,e),t&&n.subTo(a,n),o.subTo(p,o)):(i.subTo(e,i),t&&a.subTo(n,a),p.subTo(o,p))}if(i.compareTo(A.ONE)!=0)return A.ZERO;if(p.compareTo(r)>=0)return p.subtract(r);if(p.signum()<0)p.addTo(r,p);else return p;return p.signum()<0?p.add(r):p}s(KP,"bnModInverse");var rt=[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],QP=(1<<26)/rt[rt.length-1];function eT(r){var t,e=this.abs();if(e.t==1&&e[0]<=rt[rt.length-1]){for(t=0;t<rt.length;++t)if(e[0]==rt[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<rt.length;){for(var i=rt[t],n=t+1;n<rt.length&&i<QP;)i*=rt[n++];for(i=e.modInt(i);t<n;)if(i%rt[t++]==0)return!1}return e.millerRabin(r)}s(eT,"bnIsProbablePrime");function tT(r){var t=this.subtract(A.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>rt.length&&(r=rt.length);for(var n=oe(),o=0;o<r;++o){n.fromInt(rt[Math.floor(Math.random()*rt.length)]);var a=n.modPow(i,this);if(a.compareTo(A.ONE)!=0&&a.compareTo(t)!=0){for(var p=1;p++<e&&a.compareTo(t)!=0;)if(a=a.modPowInt(2,this),a.compareTo(A.ONE)==0)return!1;if(a.compareTo(t)!=0)return!1}}return!0}s(tT,"bnpMillerRabin");A.prototype.chunkSize=rP;A.prototype.toRadix=nP;A.prototype.fromRadix=oP;A.prototype.fromNumber=aP;A.prototype.bitwiseTo=uP;A.prototype.changeBit=TP;A.prototype.addTo=DP;A.prototype.dMultiply=FP;A.prototype.dAddOffset=NP;A.prototype.multiplyLowerTo=jP;A.prototype.multiplyUpperTo=XP;A.prototype.modInt=JP;A.prototype.millerRabin=tT;A.prototype.clone=KM;A.prototype.intValue=QM;A.prototype.byteValue=eP;A.prototype.shortValue=tP;A.prototype.signum=iP;A.prototype.toByteArray=sP;A.prototype.equals=lP;A.prototype.min=cP;A.prototype.max=pP;A.prototype.and=dP;A.prototype.or=mP;A.prototype.xor=fP;A.prototype.andNot=yP;A.prototype.not=gP;A.prototype.shiftLeft=vP;A.prototype.shiftRight=bP;A.prototype.getLowestSetBit=SP;A.prototype.bitCount=MP;A.prototype.testBit=PP;A.prototype.setBit=IP;A.prototype.clearBit=wP;A.prototype.flipBit=EP;A.prototype.add=LP;A.prototype.subtract=OP;A.prototype.multiply=_P;A.prototype.divide=kP;A.prototype.remainder=BP;A.prototype.divideAndRemainder=RP;A.prototype.modPow=qP;A.prototype.modInverse=KP;A.prototype.pow=HP;A.prototype.gcd=$P;A.prototype.isProbablePrime=eT;A.prototype.square=AP;var $=A;$.prototype.IsNegative=function(){return this.compareTo($.ZERO)==-1};$.op_Equality=function(r,t){return r.compareTo(t)==0};$.op_Inequality=function(r,t){return r.compareTo(t)!=0};$.op_GreaterThan=function(r,t){return r.compareTo(t)>0};$.op_LessThan=function(r,t){return r.compareTo(t)<0};$.op_Addition=function(r,t){return new $(r).add(new $(t))};$.op_Subtraction=function(r,t){return new $(r).subtract(new $(t))};$.Int128Mul=function(r,t){return new $(r).multiply(new $(t))};$.op_Division=function(r,t){return r.divide(t)};$.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof zp>"u"&&(zp=s(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),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(t.prototype,i[n]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}},"Inherit"));var zp;d.Path=function(){return[]};d.Paths=function(){return[]};d.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])};d.DoublePoint0=function(){this.X=0,this.Y=0};d.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};d.DoublePoint2=function(r,t){this.X=r,this.Y=t};d.PolyNode=function(){this.m_Parent=null,this.m_polygon=new d.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};d.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};d.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};d.PolyNode.prototype.Contour=function(){return this.m_polygon};d.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};d.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};d.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]};d.PolyNode.prototype.Childs=function(){return this.m_Childs};d.PolyNode.prototype.Parent=function(){return this.m_Parent};d.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};d.PolyTree=function(){this.m_AllPolys=[],d.PolyNode.call(this)};d.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};d.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};d.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};zp(d.PolyTree,d.PolyNode);d.Math_Abs_Int64=d.Math_Abs_Int32=d.Math_Abs_Double=function(r){return Math.abs(r)};d.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};Q.msie||Q.opera||Q.safari?d.Cast_Int32=function(r){return r|0}:d.Cast_Int32=function(r){return~~r};Q.chrome?d.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:Q.firefox&&typeof Number.toInteger=="function"?d.Cast_Int64=function(r){return Number.toInteger(r)}:Q.msie7||Q.msie8?d.Cast_Int64=function(r){return parseInt(r,10)}:Q.msie?d.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:d.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};d.Clear=function(r){r.length=0};d.PI=3.141592653589793;d.PI2=2*3.141592653589793;d.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,Dn)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 d.DoublePoint){var e=r[0];this.X=d.Clipper.Round(e.X),this.Y=d.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 d.DoublePoint){var e=r[0];this.X=d.Clipper.Round(e.X),this.Y=d.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};d.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};d.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};Dn?(d.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},d.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},d.IntPoint1dp=function(r){this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y),this.Z=0},d.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},d.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(d.IntPoint0=function(){this.X=0,this.Y=0},d.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},d.IntPoint1dp=function(r){this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y)},d.IntPoint2=function(r,t){this.X=r,this.Y=t});d.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)};d.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};d.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};d.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};d.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};d.PolyType={ptSubject:0,ptClip:1};d.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};d.JoinType={jtSquare:0,jtRound:1,jtMiter:2};d.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};_5&&(d.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});d.EdgeSide={esLeft:0,esRight:1};d.Direction={dRightToLeft:0,dLeftToRight:1};d.TEdge=function(){this.Bot=new d.IntPoint,this.Curr=new d.IntPoint,this.Top=new d.IntPoint,this.Delta=new d.IntPoint,this.Dx=0,this.PolyTyp=d.PolyType.ptSubject,this.Side=d.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};d.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new d.IntPoint};d.MyIntersectNodeSort=function(){};d.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};d.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};d.Scanbeam=function(){this.Y=0,this.Next=null};d.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};d.OutPt=function(){this.Idx=0,this.Pt=new d.IntPoint,this.Next=null,this.Prev=null};d.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new d.IntPoint};d.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};d.ClipperBase.horizontal=-9007199254740992;d.ClipperBase.Skip=-2;d.ClipperBase.Unassigned=-1;d.ClipperBase.tolerance=1e-20;mM?(d.ClipperBase.loRange=46340,d.ClipperBase.hiRange=46340):(d.ClipperBase.loRange=47453132,d.ClipperBase.hiRange=0xfffffffffffff);d.ClipperBase.near_zero=function(r){return r>-d.ClipperBase.tolerance&&r<d.ClipperBase.tolerance};d.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};d.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(d.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};d.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&&$.op_Equality($.Int128Mul(r.X-t.X,e.Y-t.Y),$.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)};d.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};d.ClipperBase.prototype.SlopesEqual=d.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,n,o,a,p,c;return t==3?(e=r[0],i=r[1],c=r[2],c?$.op_Equality($.Int128Mul(e.Delta.Y,i.Delta.X),$.Int128Mul(e.Delta.X,i.Delta.Y)):d.Cast_Int64(e.Delta.Y*i.Delta.X)==d.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(n=r[0],o=r[1],a=r[2],c=r[3],c?$.op_Equality($.Int128Mul(n.Y-o.Y,o.X-a.X),$.Int128Mul(n.X-o.X,o.Y-a.Y)):d.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-d.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=r[0],o=r[1],a=r[2],p=r[3],c=r[4],c?$.op_Equality($.Int128Mul(n.Y-o.Y,a.X-p.X),$.Int128Mul(n.X-o.X,a.Y-p.Y)):d.Cast_Int64((n.Y-o.Y)*(a.X-p.X))-d.Cast_Int64((n.X-o.X)*(a.Y-p.Y))===0)};d.ClipperBase.SlopesEqual3=function(r,t,e){return e?$.op_Equality($.Int128Mul(r.Delta.Y,t.Delta.X),$.Int128Mul(r.Delta.X,t.Delta.Y)):d.Cast_Int64(r.Delta.Y*t.Delta.X)==d.Cast_Int64(r.Delta.X*t.Delta.Y)};d.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?$.op_Equality($.Int128Mul(r.Y-t.Y,t.X-e.X),$.Int128Mul(r.X-t.X,t.Y-e.Y)):d.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-d.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};d.ClipperBase.SlopesEqual5=function(r,t,e,i,n){return n?$.op_Equality($.Int128Mul(r.Y-t.Y,e.X-i.X),$.Int128Mul(r.X-t.X,e.Y-i.Y)):d.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-d.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};d.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;d.Clear(this.m_edges[r])}d.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.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};d.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>d.ClipperBase.hiRange||r.Y>d.ClipperBase.hiRange||-r.X>d.ClipperBase.hiRange||-r.Y>d.ClipperBase.hiRange)&&d.Error("Coordinate outside allowed range in RangeTest()."):(r.X>d.ClipperBase.loRange||r.Y>d.ClipperBase.loRange||-r.X>d.ClipperBase.loRange||-r.Y>d.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};d.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};d.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};d.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;d.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||d.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=d.ClipperBase.horizontal&&r.Prev.Dx!=d.ClipperBase.horizontal)break;for(;r.Prev.Dx==d.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==d.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};d.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,n,o;if(r.Dx==d.ClipperBase.horizontal&&(t?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=d.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=d.ClipperBase.Skip;)i=i.Next;if(i.Dx==d.ClipperBase.horizontal&&i.Next.OutIdx!=d.ClipperBase.Skip){for(n=i;n.Prev.Dx==d.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?t||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==d.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!=d.ClipperBase.Skip;)i=i.Prev;if(i.Dx==d.ClipperBase.horizontal&&i.Prev.OutIdx!=d.ClipperBase.Skip){for(n=i;n.Next.Dx==d.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?t||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==d.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==d.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==d.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var a=new d.LocalMinima;a.Next=null,a.Y=r.Bot.Y,a.LeftBound=null,a.RightBound=r,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,t),this.InsertLocalMinima(a)}}return i};d.ClipperBase.prototype.AddPath=function(r,t,e){O5?!e&&t==d.PolyType.ptClip&&d.Error("AddPath: Open paths must be subject."):e||d.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&d.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&d.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new d.TEdge);var a=!0;n[1].Curr.X=r[1].X,n[1].Curr.Y=r[1].Y;var p={Value:this.m_UseFullRange};this.RangeTest(r[0],p),this.m_UseFullRange=p.Value,p.Value=this.m_UseFullRange,this.RangeTest(r[i],p),this.m_UseFullRange=p.Value,this.InitEdge(n[0],n[1],n[i],r[0]),this.InitEdge(n[i],n[0],n[i-1],r[i]);for(var o=i-1;o>=1;--o)p.Value=this.m_UseFullRange,this.RangeTest(r[o],p),this.m_UseFullRange=p.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var c=n[0],u=c,f=c;;){if(d.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==c&&(c=u.Next),u=this.RemoveEdge(u),f=u;continue}if(u.Prev==u.Next)break;if(e&&d.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==c&&(c=u.Next),u=this.RemoveEdge(u),u=u.Prev,f=u;continue}if(u=u.Next,u==f)break}if(!e&&u==u.Next||e&&u.Prev==u.Next)return!1;e||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=d.ClipperBase.Skip);var y=c;u=c;do this.InitEdge2(u,t),u=u.Next,a&&u.Curr.Y!=c.Curr.Y&&(a=!1);while(u!=c);if(a){if(e)return!1;u.Prev.OutIdx=d.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var g=new d.LocalMinima;for(g.Next=null,g.Y=u.Bot.Y,g.LeftBound=null,g.RightBound=u,g.RightBound.Side=d.EdgeSide.esRight,g.RightBound.WindDelta=0;u.Next.OutIdx!=d.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(g),this.m_edges.push(n),!0}this.m_edges.push(n);for(var C,x=null;u=this.FindNextLocMin(u),u!=x;){x==null&&(x=u);var g=new d.LocalMinima;g.Next=null,g.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(g.LeftBound=u.Prev,g.RightBound=u,C=!1):(g.LeftBound=u,g.RightBound=u.Prev,C=!0),g.LeftBound.Side=d.EdgeSide.esLeft,g.RightBound.Side=d.EdgeSide.esRight,e?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,u=this.ProcessBound(g.LeftBound,C);var M=this.ProcessBound(g.RightBound,!C);g.LeftBound.OutIdx==d.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==d.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),C||(u=M)}return!0};d.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],t,e)&&(i=!0);return i};d.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return d.IntPoint.op_Equality(r,e)||d.IntPoint.op_Equality(r,t)||d.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};d.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};d.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=d.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};d.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}};d.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};d.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,Dn&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};d.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=d.EdgeSide.esLeft,t.OutIdx=d.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=d.EdgeSide.esRight,t.OutIdx=d.ClipperBase.Unassigned),r=r.Next}};d.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=d.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=d.PolyFillType.pftEvenOdd,this.m_SubjFillType=d.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,d.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=d.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,Dn&&(this.ZFillFunction=null)};d.Clipper.ioReverseSolution=1;d.Clipper.ioStrictlySimple=2;d.Clipper.ioPreserveCollinear=4;d.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),d.ClipperBase.prototype.Clear.call(this))};d.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};d.Clipper.prototype.Reset=function(){d.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};d.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new d.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new d.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 d.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};d.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof d.PolyTree;if(t==4&&!e){var i=r[0],n=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&d.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,d.Clear(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var p=this.ExecuteInternal();p&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return p}else if(t==4&&e){var i=r[0],c=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var p=this.ExecuteInternal();p&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return p}else if(t==2&&!e){var i=r[0],n=r[1];return this.Execute(i,n,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],c=r[1];return this.Execute(i,c,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}};d.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}};d.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),d.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 n=this.m_PolyOuts[e];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{d.Clear(this.m_Joins),d.Clear(this.m_GhostJoins)}};d.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};d.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);d.Clear(this.m_PolyOuts)};d.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};d.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}};d.Clipper.prototype.AddJoin=function(r,t,e){var i=new d.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};d.Clipper.prototype.AddGhostJoin=function(r,t){var e=new d.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};Dn&&(d.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))});d.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&&(d.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&d.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var n=0,o=this.m_GhostJoins.length;n<o;n++){var a=this.m_GhostJoins[n];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,e.Bot,e.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var p=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,p,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var p=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,p,e.Top)}var c=t.NextInAEL;if(c!==null)for(;c!=e;)this.IntersectEdges(e,c,t.Curr,!1),c=c.NextInAEL}}}};d.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}};d.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<d.Clipper.TopX(r,t.Top.Y):r.Top.X>d.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};d.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==d.PolyType.ptSubject?this.m_SubjFillType==d.PolyFillType.pftEvenOdd:this.m_ClipFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==d.PolyType.ptSubject?this.m_ClipFillType==d.PolyFillType.pftEvenOdd:this.m_SubjFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==d.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case d.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case d.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case d.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case d.ClipType.ctIntersection:switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2!==0;case d.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case d.ClipType.ctUnion:switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case d.ClipType.ctDifference:if(r.PolyTyp==d.PolyType.ptSubject)switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2!==0;case d.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case d.ClipType.ctXor:if(r.WindDelta===0)switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};d.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!=d.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};d.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)};d.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};d.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)}};d.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)}};d.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)};d.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,n,o;if(d.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=d.EdgeSide.esLeft,t.Side=d.EdgeSide.esRight,n=r,n.PrevInAEL==t?o=t.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=d.EdgeSide.esRight,t.Side=d.EdgeSide.esLeft,n=t,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&d.Clipper.TopX(o,e.Y)==d.Clipper.TopX(n,e.Y)&&d.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,e);this.AddJoin(i,a,n.Top)}return i};d.Clipper.prototype.CreateOutRec=function(){var r=new d.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};d.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==d.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var n=new d.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),Dn&&(d.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):d.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),r.OutIdx=i.Idx,n}else{var i=this.m_PolyOuts[r.OutIdx],o=i.Pts;if(e&&d.IntPoint.op_Equality(t,o.Pt))return o;if(!e&&d.IntPoint.op_Equality(t,o.Prev.Pt))return o.Prev;var n=new d.OutPt;return n.Idx=i.Idx,n.Pt.X=t.X,n.Pt.Y=t.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,e&&(i.Pts=n),Dn&&(d.IntPoint.op_Equality(t,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):d.IntPoint.op_Equality(t,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),n}};d.Clipper.prototype.SwapPoints=function(r,t){var e=new d.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};d.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};d.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new d.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};d.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)};d.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?d.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};d.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;d.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;d.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var n=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;d.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var o=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;d.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var a=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=o&&i>=a||n>=o&&n>=a};d.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;d.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};d.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};d.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};d.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};d.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],n;this.Param1RightOfParam2(e,i)?n=i:this.Param1RightOfParam2(i,e)?n=e:n=this.GetLowermostRec(e,i);var o=e.Pts,a=o.Prev,p=i.Pts,c=p.Prev,u;r.Side==d.EdgeSide.esLeft?(t.Side==d.EdgeSide.esLeft?(this.ReversePolyPtLinks(p),p.Next=o,o.Prev=p,a.Next=c,c.Prev=a,e.Pts=c):(c.Next=o,o.Prev=c,p.Prev=a,a.Next=p,e.Pts=p),u=d.EdgeSide.esLeft):(t.Side==d.EdgeSide.esRight?(this.ReversePolyPtLinks(p),a.Next=c,c.Prev=a,p.Next=o,o.Prev=p):(a.Next=p,p.Prev=a,o.Prev=c,c.Next=o),u=d.EdgeSide.esRight),e.BottomPt=null,n==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var f=r.OutIdx,y=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==y){g.OutIdx=f,g.Side=u;break}g=g.NextInAEL}i.Idx=e.Idx};d.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)}};d.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};d.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};d.Clipper.prototype.IntersectEdges=function(r,t,e,i){var n=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,o=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,a=r.OutIdx>=0,p=t.OutIdx>=0;if(O5&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(n||o)&&a&&p&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==d.ClipType.ctUnion?r.WindDelta===0?p&&(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):a&&(this.AddOutPt(t,e),p&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),a&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),p&&(t.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):d.Error("Error intersecting polylines")),o&&(t.OutIdx<0?this.DeleteFromAEL(t):d.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var c=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=c}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var u,f,y,g;r.PolyTyp==d.PolyType.ptSubject?(u=this.m_SubjFillType,y=this.m_ClipFillType):(u=this.m_ClipFillType,y=this.m_SubjFillType),t.PolyTyp==d.PolyType.ptSubject?(f=this.m_SubjFillType,g=this.m_ClipFillType):(f=this.m_ClipFillType,g=this.m_SubjFillType);var C,x;switch(u){case d.PolyFillType.pftPositive:C=r.WindCnt;break;case d.PolyFillType.pftNegative:C=-r.WindCnt;break;default:C=Math.abs(r.WindCnt);break}switch(f){case d.PolyFillType.pftPositive:x=t.WindCnt;break;case d.PolyFillType.pftNegative:x=-t.WindCnt;break;default:x=Math.abs(t.WindCnt);break}if(a&&p)n||o||C!==0&&C!=1||x!==0&&x!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=d.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t));else if(a)(x===0||x==1)&&(this.AddOutPt(r,e),d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t));else if(p)(C===0||C==1)&&(this.AddOutPt(t,e),d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t));else if((C===0||C==1)&&(x===0||x==1)&&!n&&!o){var M,v;switch(y){case d.PolyFillType.pftPositive:M=r.WindCnt2;break;case d.PolyFillType.pftNegative:M=-r.WindCnt2;break;default:M=Math.abs(r.WindCnt2);break}switch(g){case d.PolyFillType.pftPositive:v=t.WindCnt2;break;case d.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(C==1&&x==1)switch(this.m_ClipType){case d.ClipType.ctIntersection:M>0&&v>0&&this.AddLocalMinPoly(r,t,e);break;case d.ClipType.ctUnion:M<=0&&v<=0&&this.AddLocalMinPoly(r,t,e);break;case d.ClipType.ctDifference:(r.PolyTyp==d.PolyType.ptClip&&M>0&&v>0||r.PolyTyp==d.PolyType.ptSubject&&M<=0&&v<=0)&&this.AddLocalMinPoly(r,t,e);break;case d.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else d.Clipper.SwapSides(r,t)}n!=o&&(n&&r.OutIdx>=0||o&&t.OutIdx>=0)&&(d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(t)};d.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)};d.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)};d.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&d.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,d.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};d.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};d.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=d.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=d.Direction.dRightToLeft)};d.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=d.EdgeSide.esLeft&&(e=e.Prev),t&&(d.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};d.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,n=e.Left,o=e.Right,a=r,p=null;a.NextInLML!==null&&d.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(p=this.GetMaximaPair(a));;){for(var c=r==a,u=this.GetNextInAEL(r,i);u!==null&&!(u.Curr.X==r.Top.X&&r.NextInLML!==null&&u.Dx<r.NextInLML.Dx);){var f=this.GetNextInAEL(u,i);if(i==d.Direction.dLeftToRight&&u.Curr.X<=o||i==d.Direction.dRightToLeft&&u.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),u==p&&c){i==d.Direction.dLeftToRight?this.IntersectEdges(r,u,u.Top,!1):this.IntersectEdges(u,r,u.Top,!1),p.OutIdx>=0&&d.Error("ProcessHorizontal error");return}else if(i==d.Direction.dLeftToRight){var y=new d.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(r,u,y,!0)}else{var y=new d.IntPoint(u.Curr.X,r.Curr.Y);this.IntersectEdges(u,r,y,!0)}this.SwapPositionsInAEL(r,u)}else if(i==d.Direction.dLeftToRight&&u.Curr.X>=o||i==d.Direction.dRightToLeft&&u.Curr.X<=n)break;u=f}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&d.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,e),i=e.Dir,n=e.Left,o=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 C=r.PrevInAEL,f=r.NextInAEL;if(C!==null&&C.Curr.X==r.Bot.X&&C.Curr.Y==r.Bot.Y&&C.WindDelta!==0&&C.OutIdx>=0&&C.Curr.Y>C.Top.Y&&d.ClipperBase.SlopesEqual(r,C,this.m_UseFullRange)){var x=this.AddOutPt(C,r.Bot);this.AddJoin(g,x,r.Top)}else if(f!==null&&f.Curr.X==r.Bot.X&&f.Curr.Y==r.Bot.Y&&f.WindDelta!==0&&f.OutIdx>=0&&f.Curr.Y>f.Top.Y&&d.ClipperBase.SlopesEqual(r,f,this.m_UseFullRange)){var x=this.AddOutPt(f,r.Bot);this.AddJoin(g,x,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else p!==null?p.OutIdx>=0?(i==d.Direction.dLeftToRight?this.IntersectEdges(r,p,r.Top,!1):this.IntersectEdges(p,r,r.Top,!1),p.OutIdx>=0&&d.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(p)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};d.Clipper.prototype.GetNextInAEL=function(r,t){return t==d.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};d.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};d.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};d.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};d.Clipper.prototype.GetMaximaPair=function(r){var t=null;return d.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:d.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!d.ClipperBase.IsHorizontal(t))?null:t};d.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,d.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};d.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=d.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 n=e.NextInSEL,o=new d.IntPoint;if(e.Curr.X>n.Curr.X){!this.IntersectPoint(e,n,o)&&e.Curr.X>n.Curr.X+1&&d.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(e.Dx)>Math.abs(n.Dx)?o.X=d.Clipper.TopX(n,r):o.X=d.Clipper.TopX(e,r));var a=new d.IntersectNode;a.Edge1=e,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(e,n),i=!0}else e=n}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};d.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};d.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};d.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};d.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 rT=s(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),iT=s(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),nT=s(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),oT=s(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");Q.msie?d.Clipper.Round=rT:Q.chromium?d.Clipper.Round=nT:Q.safari?d.Clipper.Round=oT:d.Clipper.Round=iT;d.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+d.Clipper.Round(r.Dx*(t-r.Bot.Y))};d.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,n;if(d.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,d.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(n=t.Bot.Y-t.Bot.X/t.Dx,e.Y=d.Clipper.Round(e.X/t.Dx+n));else if(t.Delta.X===0)e.X=t.Bot.X,d.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=d.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=t.Bot.X-t.Bot.Y*t.Dx;var o=(n-i)/(r.Dx-t.Dx);e.Y=d.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=d.Clipper.Round(r.Dx*o+i):e.X=d.Clipper.Round(t.Dx*o+n)}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=d.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=d.Clipper.TopX(r,e.Y):e.X=d.Clipper.TopX(t,e.Y)}return!0};d.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||!d.ClipperBase.IsHorizontal(i)}if(e){var n=t.PrevInAEL;this.DoMaxima(t),n===null?t=this.m_ActiveEdges:t=n.NextInAEL}else{if(this.IsIntermediate(t,r)&&d.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=d.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var n=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==t.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,t.Curr),a=this.AddOutPt(t,t.Curr);this.AddJoin(o,a,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var o=null;t.OutIdx>=0&&(o=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var n=t.PrevInAEL,p=t.NextInAEL;if(n!==null&&n.Curr.X==t.Bot.X&&n.Curr.Y==t.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&d.ClipperBase.SlopesEqual(t,n,this.m_UseFullRange)&&t.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,t.Bot);this.AddJoin(o,a,t.Top)}else if(p!==null&&p.Curr.X==t.Bot.X&&p.Curr.Y==t.Bot.Y&&o!==null&&p.OutIdx>=0&&p.Curr.Y>p.Top.Y&&d.ClipperBase.SlopesEqual(t,p,this.m_UseFullRange)&&t.WindDelta!==0&&p.WindDelta!==0){var a=this.AddOutPt(p,t.Bot);this.AddJoin(o,a,t.Top)}}t=t.NextInAEL}};d.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)):d.Error("DoMaxima error")};d.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};d.Clipper.Orientation=function(r){return d.Clipper.Area(r)>=0};d.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};d.Clipper.prototype.BuildResult=function(r){d.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 n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),p=0;p<o;p++)a[p]=n.Pt,n=n.Prev;r.push(a)}}}};d.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],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new d.PolyNode;r.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,p=0;p<n;p++)o.m_polygon[p]=a.Pt,a=a.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))}};d.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(d.IntPoint.op_Equality(e.Pt,e.Next.Pt)||d.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||d.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};d.Clipper.prototype.DupOutPt=function(r,t){var e=new d.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};d.Clipper.prototype.GetOverlap=function(r,t,e,i,n){return r<t?e<i?(n.Left=Math.max(r,e),n.Right=Math.min(t,i)):(n.Left=Math.max(r,i),n.Right=Math.min(t,e)):e<i?(n.Left=Math.max(t,e),n.Right=Math.min(r,i)):(n.Left=Math.max(t,i),n.Right=Math.min(r,e)),n.Left<n.Right};d.Clipper.prototype.JoinHorz=function(r,t,e,i,n,o){var a=r.Pt.X>t.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight,p=e.Pt.X>i.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight;if(a==p)return!1;if(a==d.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,!o),d.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=n.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;!o&&r.Pt.X!=n.X&&(r=r.Next),t=this.DupOutPt(r,o),d.IntPoint.op_Inequality(t.Pt,n)&&(r=t,r.Pt.X=n.X,r.Pt.Y=n.Y,t=this.DupOutPt(r,o))}if(p==d.Direction.dLeftToRight){for(;e.Next.Pt.X<=n.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,!o),d.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,!o))}else{for(;e.Next.Pt.X>=n.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==n.Y;)e=e.Next;!o&&e.Pt.X!=n.X&&(e=e.Next),i=this.DupOutPt(e,o),d.IntPoint.op_Inequality(i.Pt,n)&&(e=i,e.Pt.X=n.X,e.Pt.Y=n.Y,i=this.DupOutPt(e,o))}return a==d.Direction.dLeftToRight==o?(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};d.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,n=new d.OutPt,o=r.OutPt2,a=new d.OutPt,p=r.OutPt1.Pt.Y==r.OffPt.Y;if(p&&d.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&d.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(n=r.OutPt1.Next;n!=i&&d.IntPoint.op_Equality(n.Pt,r.OffPt);)n=n.Next;var c=n.Pt.Y>r.OffPt.Y;for(a=r.OutPt2.Next;a!=o&&d.IntPoint.op_Equality(a.Pt,r.OffPt);)a=a.Next;var u=a.Pt.Y>r.OffPt.Y;return c==u?!1:c?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}else if(p){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var f={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,f))return!1;var y=f.Left,g=f.Right,C=new d.IntPoint,x;return i.Pt.X>=y&&i.Pt.X<=g?(C.X=i.Pt.X,C.Y=i.Pt.Y,x=i.Pt.X>n.Pt.X):o.Pt.X>=y&&o.Pt.X<=g?(C.X=o.Pt.X,C.Y=o.Pt.Y,x=o.Pt.X>a.Pt.X):n.Pt.X>=y&&n.Pt.X<=g?(C.X=n.Pt.X,C.Y=n.Pt.Y,x=n.Pt.X>i.Pt.X):(C.X=a.Pt.X,C.Y=a.Pt.Y,x=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,C,x)}else{for(n=i.Next;d.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var M=n.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(M){for(n=i.Prev;d.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;d.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var v=a.Pt.Y>o.Pt.Y||!d.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(v){for(a=o.Prev;d.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!d.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||t==e&&M==v?!1:M?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}};d.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new d.IntRect(0,0,0,0);var i=new d.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 n=0,o=r[t].length;n<o;n++)r[t][n].X<i.left?i.left=r[t][n].X:r[t][n].X>i.right&&(i.right=r[t][n].X),r[t][n].Y<i.top?i.top=r[t][n].Y:r[t][n].Y>i.bottom&&(i.bottom=r[t][n].Y);return i};d.Clipper.prototype.GetBounds2=function(r){var t=r,e=new d.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};d.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var n=t[0],o=1;o<=i;++o){var a=o==i?t[0]:t[o];if(a.Y==r.Y&&(a.X==r.X||n.Y==r.Y&&a.X>r.X==n.X<r.X))return-1;if(n.Y<r.Y!=a.Y<r.Y){if(n.X>=r.X)if(a.X>r.X)e=1-e;else{var p=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(p==0)return-1;p>0==a.Y>n.Y&&(e=1-e)}else if(a.X>r.X){var p=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(p==0)return-1;p>0==a.Y>n.Y&&(e=1-e)}}n=a}return e};d.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var n=t.Pt.X,o=t.Pt.Y,a=t.Next.Pt.X,p=t.Next.Pt.Y;if(p==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=p<r.Y){if(n>=r.X)if(a>r.X)e=1-e;else{var c=(n-r.X)*(p-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==p>o&&(e=1-e)}else if(a>r.X){var c=(n-r.X)*(p-r.Y)-(a-r.X)*(o-r.Y);if(c==0)return-1;c>0==p>o&&(e=1-e)}}if(t=t.Next,i==t)break}return e};d.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};d.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var n=this.m_PolyOuts[e];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,t.Pts)&&(n.FirstLeft=t)}};d.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,n=i.length,o=i[e];e<n;e++,o=i[e])o.FirstLeft==r&&(o.FirstLeft=t)};d.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};d.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),n=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||n.Pts==null)){var o;if(i==n?o=i:this.Param1RightOfParam2(i,n)?o=n:this.Param1RightOfParam2(n,i)?o=i:o=this.GetLowermostRec(i,n),!!this.JoinPoints(e,i,n))if(i==n){if(i.Pts=e.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=e.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,p=this.m_PolyOuts.length;a<p-1;a++){var c=this.m_PolyOuts[a];c.Pts==null||d.Clipper.ParseFirstLeft(c.FirstLeft)!=i||c.IsHole==i.IsHole||this.Poly2ContainsPoly1(c.Pts,e.OutPt2)&&(c.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};d.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};d.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(d.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var n=e.Prev,o=i.Prev;e.Prev=o,o.Next=e,i.Prev=n,n.Next=i,t.Pts=e;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,t.Pts)?(a.IsHole=!t.IsHole,a.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,a.Pts)?(a.IsHole=t.IsHole,t.IsHole=!a.IsHole,a.FirstLeft=t.FirstLeft,t.FirstLeft=a):(a.IsHole=t.IsHole,a.FirstLeft=t.FirstLeft),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};d.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,n=t-1;i<t;++i)e+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-e*.5};d.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};_5&&(d.Clipper.OffsetPaths=function(r,t,e,i,n){var o=new d.Paths,a=new d.ClipperOffset(n,n);return a.AddPaths(r,e,i),a.Execute(o,t),o});d.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,e,t,t),e};d.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=d.PolyFillType.pftEvenOdd);var e=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,e,t,t),e};d.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};d.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,n=e.X-t.X,o=i*t.X+n*t.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};d.Clipper.SlopesNearCollinear=function(r,t,e,i){return d.Clipper.DistanceFromLineSqrd(t,r,e)<i};d.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,n=r.Y-t.Y;return i*i+n*n<=e};d.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};d.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),n=0;n<e;++n)i[n]=new d.OutPt;for(var n=0;n<e;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%e],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=t*t,a=i[0];a.Idx==0&&a.Next!=a.Prev;)d.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=d.Clipper.ExcludeOp(a),e--):d.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(d.Clipper.ExcludeOp(a.Next),a=d.Clipper.ExcludeOp(a),e-=2):d.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=d.Clipper.ExcludeOp(a),e--):(a.Idx=1,a=a.Next);e<3&&(e=0);for(var p=new Array(e),n=0;n<e;++n)p[n]=new d.IntPoint(a.Pt),a=a.Next;return i=null,p};d.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,n=r.length;i<n;i++)e[i]=d.Clipper.CleanPolygon(r[i],t);return e};d.Clipper.Minkowski=function(r,t,e,i){var n=i?1:0,o=r.length,a=t.length,p=new Array;if(e)for(var c=0;c<a;c++){for(var u=new Array(o),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])u[f]=new d.IntPoint(t[c].X+g.X,t[c].Y+g.Y);p.push(u)}else for(var c=0;c<a;c++){for(var u=new Array(o),f=0,y=r.length,g=r[f];f<y;f++,g=r[f])u[f]=new d.IntPoint(t[c].X-g.X,t[c].Y-g.Y);p.push(u)}for(var C=new Array,c=0;c<a-1+n;c++)for(var f=0;f<o;f++){var x=new Array;x.push(p[c%a][f%o]),x.push(p[(c+1)%a][f%o]),x.push(p[(c+1)%a][(f+1)%o]),x.push(p[c%a][(f+1)%o]),d.Clipper.Orientation(x)||x.reverse(),C.push(x)}var M=new d.Clipper(0);return M.AddPaths(C,d.PolyType.ptSubject,!0),M.Execute(d.ClipType.ctUnion,p,d.PolyFillType.pftNonZero,d.PolyFillType.pftNonZero),p};d.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],n=r[2];return d.Clipper.Minkowski(e,i,!0,n)}else if(t==4){for(var e=r[0],o=r[1],a=r[2],n=r[3],p=new d.Clipper,c,u=0,f=o.length;u<f;++u){var c=d.Clipper.Minkowski(e,o[u],!0,n);p.AddPaths(c,d.PolyType.ptSubject,!0)}n&&p.AddPaths(o,d.PolyType.ptClip,!0);var y=new d.Paths;return p.Execute(d.ClipType.ctUnion,y,a,a),y}};d.Clipper.MinkowskiDiff=function(r,t,e){return d.Clipper.Minkowski(r,t,!1,e)};d.Clipper.PolyTreeToPaths=function(r){var t=new Array;return d.Clipper.AddPolyNodeToPaths(r,d.Clipper.NodeType.ntAny,t),t};d.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case d.Clipper.NodeType.ntOpen:return;case d.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,p=o[n];n<a;n++,p=o[n])d.Clipper.AddPolyNodeToPaths(p,t,e)};d.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new d.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};d.Clipper.ClosedPathsFromPolyTree=function(r){var t=new d.Paths;return d.Clipper.AddPolyNodeToPaths(r,d.Clipper.NodeType.ntClosed,t),t};zp(d.Clipper,d.ClipperBase);d.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};d.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=d.ClipperOffset.def_arc_tolerance),this.m_destPolys=new d.Paths,this.m_srcPoly=new d.Path,this.m_destPoly=new d.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 d.IntPoint,this.m_polyNodes=new d.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};d.ClipperOffset.two_pi=6.28318530717959;d.ClipperOffset.def_arc_tolerance=.25;d.ClipperOffset.prototype.Clear=function(){d.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};d.ClipperOffset.Round=d.Clipper.Round;d.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var n=new d.PolyNode;if(n.m_jointype=t,n.m_endtype=e,e==d.EndType.etClosedLine||e==d.EndType.etClosedPolygon)for(;i>0&&d.IntPoint.op_Equality(r[0],r[i]);)i--;n.m_polygon.push(r[0]);for(var o=0,a=0,p=1;p<=i;p++)d.IntPoint.op_Inequality(n.m_polygon[o],r[p])&&(o++,n.m_polygon.push(r[p]),(r[p].Y>n.m_polygon[a].Y||r[p].Y==n.m_polygon[a].Y&&r[p].X<n.m_polygon[a].X)&&(a=o));if(!(e==d.EndType.etClosedPolygon&&o<2||e!=d.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),e==d.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new d.IntPoint(0,a);else{var c=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>c.Y||n.m_polygon[a].Y==c.Y&&n.m_polygon[a].X<c.X)&&(this.m_lowest=new d.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};d.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],t,e)};d.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!d.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==d.EndType.etClosedPolygon||t.m_endtype==d.EndType.etClosedLine&&d.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==d.EndType.etClosedLine&&!d.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};d.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new d.DoublePoint(0,0);var n=1/Math.sqrt(e*e+i*i);return e*=n,i*=n,new d.DoublePoint(i,-e)};d.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,d.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==d.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=d.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*d.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*d.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(d.ClipperOffset.two_pi/n),this.m_cos=Math.cos(d.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/d.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 o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||e.m_endtype!=d.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(e.m_jointype==d.JoinType.jtRound)for(var a=1,p=0,c=1;c<=n;c++){this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+p*r)));var u=a;a=a*this.m_cos-this.m_sin*p,p=u*this.m_sin+p*this.m_cos}else for(var a=-1,p=-1,c=0;c<4;++c)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+p*r))),a<0?a=1:p<0?p=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var c=0;c<o-1;c++)this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(e.m_endtype==d.EndType.etClosedLine||e.m_endtype==d.EndType.etClosedPolygon?this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new d.DoublePoint(this.m_normals[o-2])),e.m_endtype==d.EndType.etClosedPolygon){for(var f=o-1,c=0;c<o;c++)f=this.OffsetPoint(c,f,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==d.EndType.etClosedLine){for(var f=o-1,c=0;c<o;c++)f=this.OffsetPoint(c,f,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var y=this.m_normals[o-1],c=o-1;c>0;c--)this.m_normals[c]=new d.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new d.DoublePoint(-y.X,-y.Y),f=0;for(var c=o-1;c>=0;c--)f=this.OffsetPoint(c,f,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var f=0,c=1;c<o-1;++c)f=this.OffsetPoint(c,f,e.m_jointype);var g;if(e.m_endtype==d.EndType.etOpenButt){var c=o-1;g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*r),d.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*r)),this.m_destPoly.push(g),g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*r),d.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*r)),this.m_destPoly.push(g)}else{var c=o-1;f=o-2,this.m_sinA=0,this.m_normals[c]=new d.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),e.m_endtype==d.EndType.etOpenSquare?this.DoSquare(c,f):this.DoRound(c,f)}for(var c=o-1;c>0;c--)this.m_normals[c]=new d.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new d.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),f=o-1;for(var c=f-1;c>0;--c)f=this.OffsetPoint(c,f,e.m_jointype);e.m_endtype==d.EndType.etOpenButt?(g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(f=1,this.m_sinA=0,e.m_endtype==d.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};d.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof d.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new d.Clipper(0);if(n.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)n.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var o=d.Clipper.GetBounds(this.m_destPolys),a=new d.Path;if(a.push(new d.IntPoint(o.left-10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.top-10)),a.push(new d.IntPoint(o.left-10,o.top-10)),n.AddPath(a,d.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var p=e.Childs()[0];e.Childs()[0]=p.Childs()[0];for(var c=1;c<p.ChildCount();c++)e.AddChild(p.Childs()[c])}else e.Clear()}}else{var e=r[0],i=r[1];d.Clear(e),this.FixOrientations(),this.DoOffset(i);var n=new d.Clipper(0);if(n.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)n.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var o=d.Clipper.GetBounds(this.m_destPolys),a=new d.Path;a.push(new d.IntPoint(o.left-10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.top-10)),a.push(new d.IntPoint(o.left-10,o.top-10)),n.AddPath(a,d.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};d.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 d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new d.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case d.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 d.JoinType.jtSquare:this.DoSquare(r,t);break;case d.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};d.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 d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),d.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 d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};d.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),d.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};d.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=d.Cast_Int32(d.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),n=this.m_normals[t].X,o=this.m_normals[t].Y,a,p=0;p<i;++p)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};d.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};d.JS={};d.JS.AreaOfPolygon=function(r,t){return t||(t=1),d.Clipper.Area(r)/(t*t)};d.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=d.Clipper.Area(r[i]);return e/(t*t)};d.JS.BoundsOfPath=function(r,t){return d.JS.BoundsOfPaths([r],t)};d.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=d.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};d.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=d.JS.Clone(i);if(typeof t!="number"||t===null)return d.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 n=i.length,o,a,p,c,u,f,y,g=[],C=0;C<n;C++)if(a=i[C],o=a.length,o!==0){if(o<3){p=a,g.push(p);continue}for(p=a,c=t*t,u=a[0],f=1,y=1;y<o;y++)(a[y].X-u.X)*(a[y].X-u.X)+(a[y].Y-u.Y)*(a[y].Y-u.Y)<=c||(p[f]=a[y],u=a[y],f++);u=a[f-1],(a[0].X-u.X)*(a[0].X-u.X)+(a[0].Y-u.Y)*(a[0].Y-u.Y)<=c&&f--,f<o&&p.splice(f,o-f),p.length&&g.push(p)}return!e&&g.length?g=g[0]:!e&&g.length===0?g=[]:e&&g.length===0&&(g=[[]]),g};d.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,n,o,a,p=new Array(e);for(n=0;n<e;n++){for(i=r[n].length,a=new Array(i),o=0;o<i;o++)a[o]={X:r[n][o].X,Y:r[n][o].Y};p[n]=a}return t||(p=p[0]),p};d.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return d.Error("Tolerance is not a number in Lighten()."),d.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return d.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,n,o,a,p,c,u,f,y,g,C,x,M,v,S,E,w=r.length,T=t*t,D=[];for(e=0;e<w;e++)if(n=r[e],p=n.length,p!=0){for(o=0;o<1e6;o++){for(a=[],p=n.length,n[p-1].X!=n[0].X||n[p-1].Y!=n[0].Y?(C=1,n.push({X:n[0].X,Y:n[0].Y}),p=n.length):C=0,g=[],i=0;i<p-2;i++)c=n[i],f=n[i+1],u=n[i+2],S=c.X,E=c.Y,x=u.X-S,M=u.Y-E,(x!==0||M!==0)&&(v=((f.X-S)*x+(f.Y-E)*M)/(x*x+M*M),v>1?(S=u.X,E=u.Y):v>0&&(S+=x*v,E+=M*v)),x=f.X-S,M=f.Y-E,y=x*x+M*M,y<=T&&(g[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<p-1;i++)g[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[p-1].X,Y:n[p-1].Y}),C&&n.pop(),g.length)n=a;else break}p=a.length,a[p-1].X==a[0].X&&a[p-1].Y==a[0].Y&&a.pop(),a.length>2&&D.push(a)}return!r[0]instanceof Array&&(D=D[0]),typeof D>"u"&&(D=[[]]),D};d.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,p=0,c=0,u=0,f=0,y=r.length;if(y<2)return 0;for(t&&(r[y]=r[0],y++);--y;)o=r[y],p=o.X,c=o.Y,a=r[y-1],u=a.X,f=a.Y,n+=i((p-u)*(p-u)+(c-f)*(c-f));return t&&r.pop(),n/e};d.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,n=0;n<r.length;n++)i+=d.JS.PerimeterOfPath(r[n],t,e);return i};d.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};d.JS.ScaleDownPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=n.X/t,n.Y=n.Y/t};d.JS.ScaleUpPath=function(r,t){var e,i,n=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=n(i.X*t),i.Y=n(i.Y*t)};d.JS.ScaleUpPaths=function(r,t){var e,i,n,o=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)n=r[e][i],n.X=o(n.X*t),n.Y=o(n.Y*t)};d.ExPolygons=function(){return[]};d.ExPolygon=function(){this.outer=null,this.holes=null};d.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new d.ExPolygon;e.outer=r.Contour();var i=r.Childs(),n=i.length;e.holes=new Array(n);var o,a,p,c,u,f;for(p=0;p<n;p++)for(o=i[p],e.holes[p]=o.Contour(),c=0,u=o.Childs(),f=u.length;c<f;c++)a=u[c],d.JS.AddOuterPolyNodeToExPolygons(a,t);t.push(e)};d.JS.ExPolygonsToPaths=function(r){var t,e,i,n,o=new d.Paths;for(t=0,i=r.length;t<i;t++)for(o.push(r[t].outer),e=0,n=r[t].holes.length;e<n;e++)o.push(r[t].holes[e]);return o};d.JS.PolyTreeToExPolygons=function(r){var t=new d.ExPolygons,e,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)e=n[i],d.JS.AddOuterPolyNodeToExPolygons(e,t);return t};Ws.exports=d});var hI={};Sy(hI,{Annotation:()=>an,Connection:()=>Cr,Coordinate:()=>ne,DOORS:()=>cs,Door:()=>Xt,E_SDK_LOG_LEVEL:()=>ju,EnterpriseCategory:()=>ns,EnterpriseLocation:()=>hn,EnterpriseVenue:()=>$c,Floor:()=>gr,FloorStack:()=>is,Hyperlink:()=>Ya,Image:()=>Ka,MapObject:()=>dt,PointOfInterest:()=>zr,Space:()=>ht,WALLS:()=>ls,createMapLibreOverlay:()=>pI,enableTestMode:()=>Yf,getMapData:()=>E7,getMapDataEnterprise:()=>cI,hydrateMapDataFromMVF:()=>sI,parseMVF:()=>zl,setLoggerLevel:()=>Uy,setUseEnterpriseAPI:()=>lI,show3dMap:()=>uI,show3dMapGeojson:()=>D7,unzipMVF:()=>ql});m();m();m();m();m();m();var ju=(n=>(n[n.LOG=0]="LOG",n[n.WARN=1]="WARN",n[n.ERROR=2]="ERROR",n[n.SILENT=3]="SILENT",n))(ju||{});function Uy(r){0<=r&&r<=3&&(Yy.logState=r)}s(Uy,"setLoggerLevel");var Yy={logState:b.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log("[MappedinJS]",...r)},warn(...r){this.logState<=1&&console.warn("[MappedinJS]",...r)},error(...r){this.logState<=2&&console.error("[MappedinJS]",...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)}},k=Yy;m();m();var Xu=class Xu extends Error{};s(Xu,"InvalidTokenError");var Zi=Xu;Zi.prototype.name="InvalidTokenError";function N7(r){return decodeURIComponent(atob(r).replace(/(.)/g,(t,e)=>{let i=e.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}s(N7,"b64DecodeUnicode");function G7(r){let t=r.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return N7(t)}catch{return atob(t)}}s(G7,"base64UrlDecode");function Zy(r,t){if(typeof r!="string")throw new Zi("Invalid token specified: must be a string");t||(t={});let e=t.header===!0?0:1,i=r.split(".")[e];if(typeof i!="string")throw new Zi("Invalid token specified: missing part #".concat(e+1));let n;try{n=G7(i)}catch(o){throw new Zi("Invalid token specified: invalid base64 for part #".concat(e+1," (").concat(o.message,")"))}try{return JSON.parse(n)}catch(o){throw new Zi("Invalid token specified: invalid json for part #".concat(e+1," (").concat(o.message,")"))}}s(Zy,"jwtDecode");function Ul(r){var e,i;let t=Zy(r);if(t.sub==null)throw new Error("Access token is missing sub claim.");return{sub:t.sub,aud:typeof t.aud=="string"?[t.aud]:(e=t.aud)!=null?e:[],capabilities:(i=t.capabilities)!=null?i:{}}}s(Ul,"decodeAccessToken");m();function zy(r,t,e=!1){let i=null,n=0;return function(...o){n++,n===1&&e===!0&&r(...o);let a=s(()=>{(!e||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,t)}}s(zy,"debounce");m();var Wu=class Wu{constructor(){h(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach(function(i){typeof i=="function"&&i(e)})}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||this._subscribers[t]==null)return;let i=this._subscribers[t].indexOf(e);i!==-1&&this._subscribers[t].splice(i,1)}destroy(){this._subscribers={}}};s(Wu,"PubSub");var Z=Wu;m();m();var Uu=[0,4,6,8,10],q=s(()=>{let r=new Array(16).fill(0),t=Math.random()*4294967296;for(let i=0;i<r.length;i++)i>0&&!(i&3)&&(t=Math.random()*4294967296),r[i]=t>>>((i&3)<<3)&255;let e=r.map(i=>i.toString(16).padStart(2,"0"));return e[6]="4"+e[6][1],e[8]=["8","9","a","b"].includes(e[7][0])?e[7]:"a"+e[7][1],Uu.map((i,n)=>e.slice(i,n===Uu.length-1?void 0:Uu[n+1]).join("")).join("-")},"randomId");var qy="mi-session-data",$y="mi-local-data",zi,Ft,Nt,fa=class fa{constructor(){P(this,Ft,void 0);P(this,Nt,void 0);try{let t=sessionStorage.getItem(qy);t?I(this,Ft,JSON.parse(t)):I(this,Ft,{id:q()})}catch{I(this,Ft,{id:q()})}try{let t=localStorage.getItem($y);t?I(this,Nt,JSON.parse(t)):I(this,Nt,{deviceId:q()})}catch{I(this,Nt,{deviceId:q()})}l(this,Ft).id||(l(this,Ft).id=q()),l(this,Nt).deviceId||(l(this,Nt).deviceId=q())}static getInstance(){return l(this,zi)||I(this,zi,new fa),l(this,zi)}static ___clearInstance(){I(this,zi,void 0)}saveSessionData(t,e){l(this,Ft)[t]=e;try{return sessionStorage.setItem(qy,JSON.stringify(l(this,Ft))),!0}catch{return!1}}loadSessionData(t){let e=l(this,Ft)[t];if(e!=null)return e}saveLocalData(t,e){l(this,Nt)[t]=e;try{return localStorage.setItem($y,JSON.stringify(l(this,Nt))),!0}catch{return!1}}loadLocalData(t){let e=l(this,Nt)[t];if(e!=null)return e}};zi=new WeakMap,Ft=new WeakMap,Nt=new WeakMap,s(fa,"SafeStorage"),P(fa,zi,void 0);var ci=fa;m();m();var ya=s(r=>r!=null,"notNull");var V7=s(function(){let t=globalThis.fetch;return{fetch(...e){if(!ya(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...e)},setFetch(e){t=e}}},"createFetchControl")(),Jy=V7.fetch;var tg=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],Ky=tg[0],rg="https://api-gateway.mappedin.com/track-analytics/a/",ig="deny-watchposition",ng="load-mapview",og="load-mapdata",ag="change-language",sg="query-directions";var Hr,Gt,zn,Yl,Zu=class Zu{constructor(){P(this,zn);P(this,Hr,Object.freeze({}));P(this,Gt,void 0);h(this,"oneTimeEventsSent",new Set);h(this,"sendGetDirectionsEvent",zy((t,e)=>this.sendAnalyticEvent(sg,{start:t,end:e,type:"location_to_location"}),2500));I(this,Gt,Y(this,zn,Yl).call(this,l(this,Hr)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){I(this,Hr,{}),I(this,Gt,Y(this,zn,Yl).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return I(this,Hr,Object.freeze(Object.assign({},l(this,Hr),t))),I(this,Gt,Y(this,zn,Yl).call(this,t)),l(this,Gt)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=Yu({...l(this,Gt),mapId:e.mapId})),e.context&&(e.context=eg(e.context)),e.baseUri&&(e.analyticsBaseUrl=Yu({baseUri:e.baseUri,mapId:l(this,Gt).mapId})),Object.assign(l(this,Gt),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 l(this,Gt)}getContext(){return this.getState().context||l(this,Hr).context||Ky}getSessionId(){return this.getState().sessionId||l(this,Hr).sessionId||Qy()}sendAnalyticEvent(t,e={}){let i=this.getState(),n=j7(i.analyticsBaseUrl,t),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&k.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return k.warn("Auth needs to be ready to send analytics.");let a={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(a,i.userPosition),o["Content-Type"]="application/json",i.accessToken?o.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(o["x-mappedin-key"]=btoa(i.key),o["x-mappedin-secret"]=btoa(i.secret)),Jy(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(t,e){if(W7.includes(t))return k.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=X7.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(og,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(ag,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(ig)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(ng,{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)}};Hr=new WeakMap,Gt=new WeakMap,zn=new WeakSet,Yl=s(function(t){var i,n,o,a;let e=(i=t.baseUri)!=null?i:rg;return{baseUri:e,analyticsBaseUrl:Yu({...t,baseUri:e}),version:((n=b==null?void 0:b.env)==null?void 0:n.npm_package_version)||"v6",deviceId:H7(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||Qy(),platformString:t.platformString||"",context:eg(t.context)||Ky,geolocationMode:!1,sendEvents:(o=t.sendEvents)!=null?o:!0,logEvents:(a=t.logEvents)!=null?a:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),s(Zu,"AnalyticsInternal");var qn=Zu;function Yu({mapId:r,baseUri:t=rg}){return"".concat(t).concat(r,"/")}s(Yu,"getBaseUrl");function H7(){return ci.getInstance().loadLocalData("deviceId")}s(H7,"getDeviceIDFromStorage");function Qy(){return ci.getInstance().loadSessionData("id")}s(Qy,"getSessionIDFromStorage");function j7(r,t){return r+t}s(j7,"buildUrl");function eg(r){return tg.find(t=>t===r)}s(eg,"getValidContext");var X7=["$select-location","$select-category","$query-suggest","$query-search"],W7=[ng,og,sg,ig,ag],ew=new qn,jr,zu=class zu{constructor(t){P(this,jr,void 0);h(this,"capture");h(this,"updateState");I(this,jr,t),this.capture=l(this,jr).capture.bind(l(this,jr)),this.updateState=l(this,jr).updateState.bind(l(this,jr))}getState(){return Object.assign({},l(this,jr).getState())}};jr=new WeakMap,s(zu,"Analytics");var ga=zu;m();m();var ba,Ca,Sa,qu=class qu{constructor(t,e,{enabled:i=!1}={}){P(this,ba,void 0);h(this,"searchInstance");P(this,Ca,void 0);P(this,Sa,void 0);h(this,"enabled",!1);I(this,ba,t),I(this,Ca,e),I(this,Sa,()=>{var n;(n=this.searchInstance)==null||n.then(o=>o.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return k.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return k.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return k.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return k.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-XBV5SBGJ.js").then(({InternalSearch:t})=>new t(l(this,ba)))),l(this,Ca).on("language-change",l(this,Sa)),await this.searchInstance)}};ba=new WeakMap,Ca=new WeakMap,Sa=new WeakMap,s(qu,"Search");var va=qu;var lg=new WeakMap,Ie,Ku=class Ku extends Z{constructor(e,{search:i}={}){super();P(this,Ie,void 0);h(this,"Analytics");h(this,"Search");I(this,Ie,e),lg.set(this,e),this.Analytics=new ga(e.Analytics),this.Search=new va(this,e,{enabled:i==null?void 0:i.enabled})}get mapName(){return l(this,Ie).mapName}get mapCenter(){return l(this,Ie).mapCenter}get organizationId(){return l(this,Ie).organizationId}get outdoorViewToken(){return l(this,Ie).outdoorViewToken}getByType(e){switch(e){case"space":return l(this,Ie).spaces;case"door":return l(this,Ie).doors;case"floor":return l(this,Ie).floors;case"floor-stack":return l(this,Ie).floorStacks;case"connection":return l(this,Ie).connections;case"object":return l(this,Ie).objects;case"point-of-interest":return l(this,Ie).pointsOfInterest;case"annotation":return l(this,Ie).annotations;case"enterprise-location":return l(this,Ie).locations;case"enterprise-category":return l(this,Ie).categories;case"enterprise-venue":return l(this,Ie).venue||{};default:return[]}}getById(e,i){return l(this,Ie).getById(e,i)}async changeLanguage(e){return l(this,Ie).changeLanguage(e)}get currentLanguage(){return l(this,Ie).currentLanguage}};Ie=new WeakMap,s(Ku,"MapData");var $u=Ku,Ju=$u;function xa(r){let t=lg.get(r);if(!t)throw new Error("MapDataInternal not found");return t}s(xa,"getMapDataInternal");m();m();var cg=globalThis.fetch,ug,U7=(ug=b==null?void 0:b.env)==null?void 0:ug.npm_package_version,hg="https://app.mappedin.com/",Y7="https://auth.mappedin.com/",pg="accessTokens";function qi(){if(cg==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return cg}s(qi,"isomorphicFetch");var dg={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function mg(r){var e;let t={...dg,...r};return t.headers={...t.headers,"mappedin-sdk-version":U7},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}s(mg,"parseOptions");function Z7(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete i.language,i.language&&(t+="&lang=".concat(encodeURIComponent(i.language)));let{headers:n}=r;n["Content-Type"]=n["Content-Type"]||"text/json",r.accessToken?n.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(n["x-mappedin-key"]=btoa(r.clientId),n["x-mappedin-secret"]=btoa(r.clientSecret)),i.language&&(n["Accept-Language"]=i.language);let o={method:"GET",headers:n};return r.secure&&(t+="&withcdntoken"),{req:o,url:t}}s(Z7,"constructParamsForRequest");async function z7(r,t,e=!1){let i=Z7(r,t,e),n=await qi()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}s(z7,"generateAPIRequest");async function q7(r,t="exports/mvf/1/bundle"){var o;let e=mg({baseUri:"https://api-gateway.mappedin.com/",...dg,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((o=e.version)!=null?o:"2.0.0");return e.headers["Content-Type"]="application/zip",await z7(e,i)}s(q7,"getVenueMVFURL");var Qu=new TextDecoder;async function fg(r,{signal:t}){try{let e=await(await qi()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e),o=(await import("./browser-4CAPWYD3.js")).unzipSync(i),a={};if(o["enterprise/"]!=null){a.enterprise={};let p=o["enterprise/locations.json"];p&&(a.enterprise.locations=JSON.parse(Qu.decode(p)));let c=o["enterprise/categories.json"];c&&(a.enterprise.categories=JSON.parse(Qu.decode(c)))}return o["manifest.json"]&&(a["manifest.geojson"]=JSON.parse(Qu.decode(o["manifest.json"]))),a}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}s(fg,"downloadLanguagePack");async function eh(r){return new Promise(async(t,e)=>{try{let{url:i,locale_packs:n}=await q7(r,"exports/mvf2/1/bundle"),o=await qi()(i).then(p=>p.arrayBuffer()),a=new Uint8Array(o);t({compressed:a,localePacks:n})}catch(i){e(i)}})}s(eh,"downloadVenueBundleMVFAPIGateway");async function th(r,t){return new Promise(async(e,i)=>{try{let{url:n}=await $7(r,t),o=await qi()(n).then(p=>p.arrayBuffer()),a=new Uint8Array(o);e(a)}catch(n){i(n)}})}s(th,"downloadMVF");function yg(r){return r.endsWith("/")?r:"".concat(r,"/")}s(yg,"normalizeUrl");async function $7(r,t){let e="".concat(r.baseUri?yg(r.baseUri):hg,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await qi()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}s($7,"getMakerBundleURL");async function Zl(r,t=!1){let e=r.key,i=ci.getInstance(),n=(i==null?void 0:i.loadSessionData(pg))||{},o=Math.floor(Date.now()/1e3);if(n[e]&&o<n[e].expiresTimestamp)return n[e];let a=t?await J7(r,o):await K7(r,o),p={...n,[e]:a};return i==null||i.saveSessionData(pg,p),a}s(Zl,"getAccessToken");async function J7(r,t){var o;let e="".concat((o=r.baseAuthUri)!=null?o:Y7,"oauth2/token"),i=await qi()(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 n=await i.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}s(J7,"fetchAccessTokenEnterprise");async function K7(r,t){let e="".concat(r.baseUri?yg(r.baseUri):hg,"api/api-key/token"),i=await qi()(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 n=await i.json();return{accessToken:n.access_token,expiresTimestamp:t+n.expires_in}}s(K7,"fetchAccessToken");function zl(r){var i,n,o,a,p,c;let t=new TextDecoder,e=t.decode.bind(t);try{let u={"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:{}};if(r.enterprise!=null&&(u.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(u.enterprise.locations=JSON.parse(e((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(u.enterprise.categories=JSON.parse(e((a=r.enterprise)==null?void 0:a["categories.json"]))),(p=r.enterprise)!=null&&p["venue.json"]&&(u.enterprise.venue=JSON.parse(e((c=r.enterprise)==null?void 0:c["venue.json"])))),r["floorstack.json"]!=null?u["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(u["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),u["floorstack.json"]==null&&u["mapstack.json"]==null&&u["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(u["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),u["floor.geojson"]==null&&u["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(u["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(u["shapes.json"]=JSON.parse(e(r["shapes.json"]))),r.annotation!=null){u.annotation={};let y=Object.keys(r.annotation);for(let g of y){let C=g.replace(/\.json|\.geojson/g,"");u.annotation[C]=JSON.parse(e(r.annotation[g]))}}let f=Object.keys(r.space);for(let y of f){let g=y.replace(/\.json|\.geojson/g,"");u.space[g]=JSON.parse(e(r.space[y]))}if(r.obstruction!=null){let y=Object.keys(r.obstruction);for(let g of y){let C=g.replace(/\.json|\.geojson/g,"");u.obstruction[C]=JSON.parse(e(r.obstruction[g]))}}else u.obstruction={};if(r.entrance!=null){let y=Object.keys(r.entrance);for(let g of y){let C=g.replace(/\.json|\.geojson/g,"");u.entrance[C]=JSON.parse(e(r.entrance[g]))}}else u.entrance={};if("floorImages"in r&&r.floorImages!=null){u.floorImages={};for(let y of Object.keys(r.floorImages)){let g=y.replace(/\.json|\.geojson/g,"");u.floorImages[g]=JSON.parse(e(r.floorImages[y]))}}return u}catch(u){throw k.error(u),new Error("MVF parsing failed! Probably encountered a bad file.")}}s(zl,"parseMVF");function Q7(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}s(Q7,"validateStaticMVFFiles");async function ql(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 n=(await import("./browser-4CAPWYD3.js")).unzipSync(r);if(!Q7(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let p of a){if(n[p].length===0)continue;let c=p.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){o[c[0]]=n[p];continue}if(c[0]==="image"){k.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[c[0]]==null&&(o[c[0]]={}),o[c[0]][c[1]]=n[p]}t(o)}catch(i){e(i)}})}s(ql,"unzipMVF");m();m();m();m();var Ke=63710088e-1,gg={centimeters:Ke*100,centimetres:Ke*100,degrees:Ke/111325,feet:Ke*3.28084,inches:Ke*39.37,kilometers:Ke/1e3,kilometres:Ke/1e3,meters:Ke,metres:Ke,miles:Ke/1609.344,millimeters:Ke*1e3,millimetres:Ke*1e3,nauticalmiles:Ke/1852,radians:1,yards:Ke*1.0936},Pw={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ke,yards:1.0936133};function pi(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}s(pi,"feature");function Vt(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(!rh(r[0])||!rh(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return pi(i,t,e)}s(Vt,"point");function Xr(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 pi(i,t,e)}s(Xr,"lineString");function Ma(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}s(Ma,"featureCollection");function vg(r,t){t===void 0&&(t="kilometers");var e=gg[t];if(!e)throw new Error(t+" units is invalid");return r*e}s(vg,"radiansToLength");function bg(r,t){t===void 0&&(t="kilometers");var e=gg[t];if(!e)throw new Error(t+" units is invalid");return r/e}s(bg,"lengthToRadians");function Pa(r){var t=r%(2*Math.PI);return t*180/Math.PI}s(Pa,"radiansToDegrees");function pt(r){var t=r%360;return t*Math.PI/180}s(pt,"degreesToRadians");function rh(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}s(rh,"isNumber");function It(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")}s(It,"getCoord");function Ct(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")}s(Ct,"getCoords");function Cg(r){return r.type==="Feature"?r.geometry:r}s(Cg,"getGeom");function Sg(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}s(Sg,"getType");function eC(r,t,e){e===void 0&&(e={});for(var i=It(r),n=Ct(t),o=0;o<n.length-1;o++){var a=!1;if(e.ignoreEndVertices&&(o===0&&(a="start"),o===n.length-2&&(a="end"),o===0&&o+1===n.length-1&&(a="both")),tC(n[o],n[o+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}s(eC,"booleanPointOnLine");function tC(r,t,e,i,n){var o=e[0],a=e[1],p=r[0],c=r[1],u=t[0],f=t[1],y=e[0]-p,g=e[1]-c,C=u-p,x=f-c,M=y*x-g*C;if(n!==null){if(Math.abs(M)>n)return!1}else if(M!==0)return!1;if(i){if(i==="start")return Math.abs(C)>=Math.abs(x)?C>0?p<o&&o<=u:u<=o&&o<p:x>0?c<a&&a<=f:f<=a&&a<c;if(i==="end")return Math.abs(C)>=Math.abs(x)?C>0?p<=o&&o<u:u<o&&o<=p:x>0?c<=a&&a<f:f<a&&a<=c;if(i==="both")return Math.abs(C)>=Math.abs(x)?C>0?p<o&&o<u:u<o&&o<p:x>0?c<a&&a<f:f<a&&a<c}else return Math.abs(C)>=Math.abs(x)?C>0?p<=o&&o<=u:u<=o&&o<=p:x>0?c<=a&&a<=f:f<=a&&a<=c;return!1}s(tC,"isPointOnLineSegment");var xg=eC;m();m();m();function $l(r,t,e){if(r!==null)for(var i,n,o,a,p,c,u,f=0,y=0,g,C=r.type,x=C==="FeatureCollection",M=C==="Feature",v=x?r.features.length:1,S=0;S<v;S++){u=x?r.features[S].geometry:M?r.geometry:r,g=u?u.type==="GeometryCollection":!1,p=g?u.geometries.length:1;for(var E=0;E<p;E++){var w=0,T=0;if(a=g?u.geometries[E]:u,a!==null){c=a.coordinates;var D=a.type;switch(f=e&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(t(c,y,S,w,T)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(t(c[i],y,S,w,T)===!1)return!1;y++,D==="MultiPoint"&&w++}D==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-f;n++){if(t(c[i][n],y,S,w,T)===!1)return!1;y++}D==="MultiLineString"&&w++,D==="Polygon"&&T++}D==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(T=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-f;o++){if(t(c[i][n][o],y,S,w,T)===!1)return!1;y++}T++}w++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if($l(a.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s($l,"coordEach");function ih(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++);}s(ih,"featureEach");function rC(r,t){var e,i,n,o,a,p,c,u,f,y,g=0,C=r.type==="FeatureCollection",x=r.type==="Feature",M=C?r.features.length:1;for(e=0;e<M;e++){for(p=C?r.features[e].geometry:x?r.geometry:r,u=C?r.features[e].properties:x?r.properties:{},f=C?r.features[e].bbox:x?r.bbox:void 0,y=C?r.features[e].id:x?r.id:void 0,c=p?p.type==="GeometryCollection":!1,a=c?p.geometries.length:1,n=0;n<a;n++){if(o=c?p.geometries[n]:p,o===null){if(t(null,g,u,f,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,g,u,f,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(t(o.geometries[i],g,u,f,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}s(rC,"geomEach");function Ta(r,t){rC(r,function(e,i,n,o,a){var p=e===null?null:e.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return t(pi(e,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(p){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var f=e.coordinates[u],y={type:c,coordinates:f};if(t(pi(y,n),i,u)===!1)return!1}})}s(Ta,"flattenEach");function iC(r,t){Ta(r,function(e,i,n){var o=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var p,c=0,u=0,f=0;if($l(e,function(y,g,C,x,M){if(p===void 0||i>c||x>u||M>f){p=y,c=i,u=x,f=M,o=0;return}var v=Xr([p,y],e.properties);if(t(v,i,n,M,o)===!1)return!1;o++,p=y})===!1)return!1}}})}s(iC,"segmentEach");function Mg(r,t,e){var i=e,n=!1;return iC(r,function(o,a,p,c,u){n===!1&&e===void 0?i=o:i=t(i,o,a,p,c,u),n=!0}),i}s(Mg,"segmentReduce");function nh(r){var t=[1/0,1/0,-1/0,-1/0];return $l(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}s(nh,"bbox");nh.default=nh;var Jl=nh;function nC(r,t){t===void 0&&(t={});var e=Jl(r),i=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Vt([i,n],t.properties,t)}s(nC,"center");var Pg=nC;m();m();function oC(r,t,e){e===void 0&&(e={});var i=It(r),n=It(t),o=pt(n[1]-i[1]),a=pt(n[0]-i[0]),p=pt(i[1]),c=pt(n[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(p)*Math.cos(c);return vg(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}s(oC,"distance");var ui=oC;function Kl(r,t){return t===void 0&&(t={}),Mg(r,function(e,i){var n=i.geometry.coordinates;return e+ui(n[0],n[1],t)},0)}s(Kl,"length");m();m();m();function Ql(r,t,e){if(e===void 0&&(e={}),e.final===!0)return aC(r,t);var i=It(r),n=It(t),o=pt(i[0]),a=pt(n[0]),p=pt(i[1]),c=pt(n[1]),u=Math.sin(a-o)*Math.cos(c),f=Math.cos(p)*Math.sin(c)-Math.sin(p)*Math.cos(c)*Math.cos(a-o);return Pa(Math.atan2(u,f))}s(Ql,"bearing");function aC(r,t){var e=Ql(t,r);return e=(e+180)%360,e}s(aC,"calculateFinalBearing");m();function $i(r,t,e,i){i===void 0&&(i={});var n=It(r),o=pt(n[0]),a=pt(n[1]),p=pt(e),c=bg(t,i.units),u=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(p)),f=o+Math.atan2(Math.sin(p)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(u)),y=Pa(f),g=Pa(u);return Vt([y,g],i.properties)}s($i,"destination");m();m();function sC(r){if(!r)throw new Error("geojson is required");var t=[];return Ta(r,function(e){lC(e,t)}),Ma(t)}s(sC,"lineSegment");function lC(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ct(i);break;case"LineString":e=[Ct(i)]}e.forEach(function(n){var o=cC(n,r.properties);o.forEach(function(a){a.id=t.length,t.push(a)})})}}s(lC,"lineSegmentFeature");function cC(r,t){var e=[];return r.reduce(function(i,n){var o=Xr([i,n],t);return o.bbox=pC(i,n),e.push(o),n}),e}s(cC,"createSegments");function pC(r,t){var e=r[0],i=r[1],n=t[0],o=t[1],a=e<n?e:n,p=i<o?i:o,c=e>n?e:n,u=i>o?i:o;return[a,p,c,u]}s(pC,"bbox");var oh=sC;var A3=ar(O3(),1);function A9(r,t){var e={},i=[];if(r.type==="LineString"&&(r=pi(r)),t.type==="LineString"&&(t=pi(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 n=_3(r,t);return n&&i.push(n),Ma(i)}var o=(0,A3.default)();return o.load(oh(t)),ih(oh(r),function(a){ih(o.search(a),function(p){var c=_3(a,p);if(c){var u=Ct(c).join(",");e[u]||(e[u]=!0,i.push(c))}})}),Ma(i)}s(A9,"lineIntersect");function _3(r,t){var e=Ct(r),i=Ct(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 n=e[0][0],o=e[0][1],a=e[1][0],p=e[1][1],c=i[0][0],u=i[0][1],f=i[1][0],y=i[1][1],g=(y-u)*(a-n)-(f-c)*(p-o),C=(f-c)*(o-u)-(y-u)*(n-c),x=(a-n)*(o-u)-(p-o)*(n-c);if(g===0)return null;var M=C/g,v=x/g;if(M>=0&&M<=1&&v>=0&&v<=1){var S=n+M*(a-n),E=o+M*(p-o);return Vt([S,E])}return null}s(_3,"intersects");var k3=A9;function k9(r,t,e){e===void 0&&(e={});var i=Vt([1/0,1/0],{dist:1/0}),n=0;return Ta(r,function(o){for(var a=Ct(o),p=0;p<a.length-1;p++){var c=Vt(a[p]);c.properties.dist=ui(t,c,e);var u=Vt(a[p+1]);u.properties.dist=ui(t,u,e);var f=ui(c,u,e),y=Math.max(c.properties.dist,u.properties.dist),g=Ql(c,u),C=$i(t,y,g+90,e),x=$i(t,y,g-90,e),M=k3(Xr([C.geometry.coordinates,x.geometry.coordinates]),Xr([c.geometry.coordinates,u.geometry.coordinates])),v=null;M.features.length>0&&(v=M.features[0],v.properties.dist=ui(t,v,e),v.properties.location=n+ui(c,v,e)),c.properties.dist<i.properties.dist&&(i=c,i.properties.index=p,i.properties.location=n),u.properties.dist<i.properties.dist&&(i=u,i.properties.index=p+1,i.properties.location=n+f),v&&v.properties.dist<i.properties.dist&&(i=v,i.properties.index=p),n+=f}}),i}s(k9,"nearestPointOnLine");var Xa=k9;function B9(r,t,e){var i=Ct(e);if(Sg(e)!=="LineString")throw new Error("line must be a LineString");var n=Xa(e,r),o=Xa(e,t),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var p=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)p.push(i[c]);return p.push(a[1].geometry.coordinates),Xr(p,e.properties)}s(B9,"lineSlice");var Yd=B9;var R9=1e-7;function Zd(r){return{type:"Point",coordinates:r}}s(Zd,"point");function F9(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,n=e.map(o=>Xa(r,Zd(o)));return i.reduce((o,a)=>{let p=Yd(Zd(a),n[0],r),c=Yd(Zd(a),n[1],r),u=Kl(p)<Kl(c)?p:c;return u.properties={...r.properties,entrances:[]},o.concat([u])},[])}s(F9,"splitObstructionByEntrance");function zd(r,t){return t.reduce((e,i)=>{let n={epsilon:R9},o=e.obstructions.findIndex(p=>xg(Pg(i),p,n)),a=e.obstructions[o];if(a){let[p,c]=F9(a,i);e.entrances.push(i),e.obstructions.splice(o,1,p,c)}return e},{obstructions:[r],entrances:[]})}s(zd,"findAndSplitObstructionByAllEntrances");m();m();m();var so=class so{constructor(t,e,i){h(this,"__type",so.__type);h(this,"id",q());h(this,"latitude");h(this,"longitude");h(this,"floorId");this.latitude=t,this.longitude=e,this.floorId=i}static is(t){return t.__type===so.__type}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}}destroy(){}};s(so,"Coordinate"),h(so,"__type","coordinate");var qd=so,ne=qd;m();m();m();m();var $d=class $d{constructor(t){h(this,"id");this.id=t}};s($d,"BaseMetaData");var en=$d;var Ua,lo,Wa=class Wa extends en{constructor(e){super(String(q()));P(this,Ua,{});P(this,lo,void 0);I(this,lo,e.mvfData)}static is(e){return e.__type===Wa.__type}get url(){return l(this,lo).url}get name(){return l(this,lo).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(l(this,Ua)))delete l(this,Ua)[e]}};Ua=new WeakMap,lo=new WeakMap,s(Wa,"Hyperlink"),h(Wa,"__type","hyperlink");var Jd=Wa,Ya=Jd;var Kd=class Kd{constructor(t,e){h(this,"id");h(this,"links",[]);var n;this.id=t;let i=(n=e==null?void 0:e.links)!=null?n:[];i.length>0&&(this.links=i.map(o=>new Ya({mvfData:o})))}};s(Kd,"BaseMapData");var fe=Kd;var tn,Zr,rn,vi,co=class co extends fe{constructor(e,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",co.__type);P(this,tn,void 0);P(this,Zr,void 0);P(this,rn,void 0);P(this,vi,void 0);I(this,Zr,{}),I(this,vi,i.mvfData),I(this,tn,e),I(this,rn,i.floorId)}static is(e){return e.__type===co.__type}get name(){var e,i;return(i=(e=l(this,vi).properties.details)==null?void 0:e.name)!=null?i:""}get description(){var e,i;return(i=(e=l(this,vi).properties.details)==null?void 0:e.description)!=null?i:""}get images(){var e,i;return(i=(e=l(this,vi).properties.details)==null?void 0:e.images)!=null?i:[]}get floor(){let e=l(this,tn).getById("floor",l(this,rn));if(e==null)throw new Error("Floor ".concat(l(this,rn)," not found!"));return e}get center(){if(l(this,Zr).center==null){let[[e,i],[n,o]]=l(this,vi).geometry.coordinates,a=(e+n)/2,p=(i+o)/2;l(this,Zr).center=new ne(p,a,l(this,rn))}return l(this,Zr).center}get isExterior(){var n;let e=l(this,tn).obstructionIdByEntranceId[this.id],i=l(this,tn).getMVFFeatureById("obstruction",e);return(n=i==null?void 0:i.properties.footprintComponent)!=null?n:!1}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(l(this,Zr)))delete l(this,Zr)[e]}};tn=new WeakMap,Zr=new WeakMap,rn=new WeakMap,vi=new WeakMap,s(co,"Door"),h(co,"__type","door");var Qd=co,Xt=Qd;m();var bi,nn,xt,Wt,po=class po extends fe{constructor(e,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",po.__type);P(this,bi,void 0);P(this,nn,void 0);P(this,xt,{});P(this,Wt,void 0);I(this,bi,e),I(this,nn,i.floorId),I(this,Wt,i.mvfData)}static is(e){return e.__type===po.__type}get name(){var i,n;let{properties:e}=l(this,Wt);return(n=(i=e.details)==null?void 0:i.name)!=null?n:e.externalId}get type(){return G9(l(this,Wt).properties.kind)}get description(){var e,i;return(i=(e=l(this,Wt).properties.details)==null?void 0:e.description)!=null?i:""}get images(){var e,i;return(i=(e=l(this,Wt).properties.details)==null?void 0:e.images)!=null?i:[]}get locations(){if(l(this,xt).locations)return l(this,xt).locations;l(this,xt).locations=[];let e=l(this,bi).locationsBySpaceId[l(this,Wt).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let n=l(this,bi).getById("enterprise-location",i.id);n&&l(this,xt).locations.push(n)}return l(this,xt).locations}get floor(){let e=l(this,bi).getById("floor",l(this,nn));if(e==null)throw new Error("Floor ".concat(l(this,nn)," not found!"));return e}get doors(){return l(this,Wt).properties.destinationNodes.reduce((e,i)=>{let n=l(this,bi).doorsByNodeId[i];return n&&e.push(n),e},[])}get center(){var e;if(l(this,xt).center==null){let[i,n]=(e=l(this,Wt).properties.center)!=null?e:[0,0];l(this,xt).center=new ne(n,i,l(this,nn))}return l(this,xt).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(l(this,xt)))delete l(this,xt)[e]}};bi=new WeakMap,nn=new WeakMap,xt=new WeakMap,Wt=new WeakMap,s(po,"Space"),h(po,"__type","space");var em=po,N9=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function G9(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return N9.includes(t)?t:"room"}s(G9,"validateSpaceType");var ht=em;m();var Ut,ye,on,uo=class uo extends fe{constructor(e,i){super(i.mvfData.id);h(this,"__type",uo.__type);P(this,Ut,void 0);P(this,ye,{});P(this,on,void 0);I(this,Ut,e),I(this,on,i.mvfData)}static is(e){return e.__type===uo.__type}get name(){return l(this,on).name||l(this,on).externalId}get elevation(){return l(this,on).elevation}get spaces(){if(l(this,ye).spaces==null){let e=l(this,Ut).spaces.filter(i=>i.floor.id===this.id);l(this,ye).spaces=e}return l(this,ye).spaces}get objects(){if(l(this,ye).objects==null){let e=l(this,Ut).objects.filter(i=>i.floor.id===this.id);l(this,ye).objects=e}return l(this,ye).objects}get connections(){if(l(this,ye).connections==null){let e=l(this,Ut).connections.filter(i=>i.floors.includes(this));l(this,ye).connections=e}return l(this,ye).connections}get doors(){if(l(this,ye).doors==null){let e=l(this,Ut).doors.filter(i=>i.floor.id===this.id);l(this,ye).doors=e}return l(this,ye).doors}get annotations(){if(l(this,ye).annotations==null){let e=l(this,Ut).annotations.filter(i=>i.floor.id===this.id);l(this,ye).annotations=e}return l(this,ye).annotations}get pois(){if(l(this,ye).pois==null){let e=l(this,Ut).pointsOfInterest.filter(i=>i.floor.id===this.id);l(this,ye).pois=e}return l(this,ye).pois}get floorStack(){if(l(this,ye).floorStack==null){let e=l(this,Ut).floorStacks.find(i=>i.floors.includes(this));l(this,ye).floorStack=e}return l(this,ye).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(l(this,ye)))delete l(this,ye)[e]}};Ut=new WeakMap,ye=new WeakMap,on=new WeakMap,s(uo,"Floor"),h(uo,"__type","floor");var tm=uo,gr=tm;m();m();m();function B3(r){return typeof r=="string"?r:r.id}s(B3,"getId");m();function Et(r){let t;if(ht.is(r)||Xt.is(r)||dt.is(r))t=r.center;else if(zr.is(r)||an.is(r))t=r.coordinate;else if(ne.is(r))t=r;else return;return t}s(Et,"getCoordinateFromStuffs");m();m();var Za={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},vr="ExteriorWalls",Ci="Walls",R3=0,ho="InteriorDoors",mo="ExteriorDoors";var F3=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];function rm(r){var t,e;if((t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}s(rm,"validateOptions");function im(r,t){var n,o,a,p;let e=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||t.outdoorViewToken,i={...Za,...r!=null?r:{},outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!e:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(p=Za.outdoorView)==null?void 0:p.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}s(im,"handleDefault");function N3(r){let t={remove_watermark:!1};if(r)try{let e=Ul(r);Object.assign(t,e.capabilities)}catch(e){k.error("Error decoding capabilities from token",e)}return t}s(N3,"handleTokenCapabilities");var za,qr,br,fo=class fo extends fe{constructor(e,i){let n=Object.values(i.mvfDataByFloorId)[0];super(n.properties.id,n.properties.details);h(this,"__type",fo.__type);P(this,za,void 0);P(this,qr,void 0);P(this,br,void 0);I(this,qr,{}),I(this,za,e),I(this,br,i.mvfDataByFloorId)}static is(e){return e.__type===fo.__type}get name(){var e,i;return(i=(e=Object.values(l(this,br))[0].properties.details)==null?void 0:e.name)!=null?i:""}get description(){var e,i;return(i=(e=Object.values(l(this,br))[0].properties.details)==null?void 0:e.description)!=null?i:""}get images(){var e,i;return(i=(e=Object.values(l(this,br))[0].properties.details)==null?void 0:e.images)!=null?i:[]}get externalId(){var e;return(e=Object.values(l(this,br))[0].properties.externalId)!=null?e:""}get type(){var e,i;return(i=(e=Object.values(l(this,br))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get coordinates(){return l(this,qr).coordinates==null&&(l(this,qr).coordinates=Object.entries(l(this,br)).map(([e,i])=>new ne(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),l(this,qr).coordinates}get floors(){return this.coordinates.map(e=>e.floorId?l(this,za).getById("floor",e.floorId):void 0).filter(ya)}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)}}destroy(){for(let e of Object.keys(l(this,qr)))delete l(this,qr)[e]}};za=new WeakMap,qr=new WeakMap,br=new WeakMap,s(fo,"Connection"),h(fo,"__type","connection");var nm=fo,Cr=nm;m();var qa,sn,Si,$r,yo=class yo extends fe{constructor(e,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",yo.__type);P(this,qa,void 0);P(this,sn,void 0);P(this,Si,{});P(this,$r,void 0);I(this,qa,e),I(this,sn,i.floorId),I(this,$r,i.mvfData)}static is(e){return e.__type===yo.__type}get name(){var e,i;return(i=(e=l(this,$r).properties.details)==null?void 0:e.name)!=null?i:""}get description(){var e,i;return(i=(e=l(this,$r).properties.details)==null?void 0:e.description)!=null?i:""}get images(){var e,i;return(i=(e=l(this,$r).properties.details)==null?void 0:e.images)!=null?i:[]}get type(){let e=l(this,$r).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=l(this,qa).getById("floor",l(this,sn));if(e==null)throw new Error("Floor ".concat(l(this,sn)," not found!"));return e}get center(){var e;if(l(this,Si).center==null){let[i,n]=(e=l(this,$r).properties.center)!=null?e:[0,0];l(this,Si).center=new ne(n,i,l(this,sn))}return l(this,Si).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(l(this,Si)))l(this,Si)[e]=null}};qa=new WeakMap,sn=new WeakMap,Si=new WeakMap,$r=new WeakMap,s(yo,"MapObject"),h(yo,"__type","object");var om=yo,dt=om;m();m();var Ja,go,$a=class $a extends en{constructor(e){super(String(q()));P(this,Ja,{});P(this,go,void 0);I(this,go,e.mvfData)}static is(e){return e.__type===$a.__type}get url(){return l(this,go).url}get name(){return l(this,go).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(l(this,Ja)))delete l(this,Ja)[e]}};Ja=new WeakMap,go=new WeakMap,s($a,"Image"),h($a,"__type","image");var am=$a,Ka=am;var Qa,ln,Yt,xi,vo=class vo extends fe{constructor(e,i){super(i.mvfData.properties.id,i.mvfData.properties.details);h(this,"__type",vo.__type);P(this,Qa,void 0);P(this,ln,void 0);P(this,Yt,{});P(this,xi,void 0);I(this,Qa,e),I(this,xi,i.mvfData),I(this,ln,i.floorId)}static is(e){return e.__type===vo.__type}get name(){var e,i;return(i=(e=l(this,xi).properties.details)==null?void 0:e.name)!=null?i:""}get description(){var e,i;return(i=(e=l(this,xi).properties.details)==null?void 0:e.description)!=null?i:""}get images(){var e,i;if(l(this,Yt).images==null){let n=(i=(e=l(this,xi).properties.details)==null?void 0:e.images)!=null?i:[];l(this,Yt).images=n.map(o=>new Ka({mvfData:o}))}return l(this,Yt).images}get floor(){let e=l(this,Qa).getById("floor",l(this,ln));if(e==null)throw new Error("Floor ".concat(l(this,ln)," not found!"));return e}get coordinate(){var e;if(l(this,Yt).coordinate==null){let[i,n]=(e=l(this,xi).geometry.coordinates)!=null?e:[0,0];l(this,Yt).coordinate=new ne(n,i,l(this,ln))}return l(this,Yt).coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in l(this,Yt))l(this,Yt)[e]=null}};Qa=new WeakMap,ln=new WeakMap,Yt=new WeakMap,xi=new WeakMap,s(vo,"PointOfInterest"),h(vo,"__type","point-of-interest");var sm=vo,zr=sm;m();var es,cn,Mi,Co,ts,cm,bo=class bo extends fe{constructor(e,i){super(i.mvfData.properties.id);P(this,ts);h(this,"__type",bo.__type);P(this,es,void 0);P(this,cn,void 0);P(this,Mi,{});P(this,Co,void 0);I(this,es,e),I(this,cn,i.floorId),I(this,Co,i.mvfData)}static is(e){return e.__type===bo.__type}get group(){return Y(this,ts,cm).call(this).group}get type(){return Y(this,ts,cm).call(this).type}get coordinate(){if(l(this,Mi).coordinate==null){let[e,i]=l(this,Co).geometry.coordinates;l(this,Mi).coordinate=new ne(i,e,l(this,cn))}return l(this,Mi).coordinate}get floor(){let e=l(this,es).getById("floor",l(this,cn));if(e==null)throw new Error("Floor ".concat(l(this,cn)," not found!"));return e}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(l(this,Mi)))delete l(this,Mi)[e]}};es=new WeakMap,cn=new WeakMap,Mi=new WeakMap,Co=new WeakMap,ts=new WeakSet,cm=s(function(){let[e,i]=l(this,Co).properties.symbolId.split("--");return{group:e,type:i}},"#getGroupAndTypeFromSymbolId"),s(bo,"Annotation"),h(bo,"__type","annotation");var lm=bo,an=lm;m();var rs,Pi,Jr,So=class So extends fe{constructor(e,i){super(i.mvfData.id);h(this,"__type",So.__type);P(this,rs,void 0);P(this,Pi,{});P(this,Jr,void 0);I(this,rs,e),I(this,Jr,i.mvfData)}static is(e){return e.__type===So.__type}get type(){return l(this,Jr).type}get name(){return l(this,Jr).name||l(this,Jr).externalId}get floors(){var e,i;if(l(this,Pi).floors==null){let n=((i=(e=l(this,Jr).floors)!=null?e:l(this,Jr).maps)!=null?i:[]).reduce((o,a)=>{let p=l(this,rs).floorsById[a];return p&&o.push(p),o},[]);l(this,Pi).floors=n}return l(this,Pi).floors}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(l(this,Pi)))delete l(this,Pi)[e]}};rs=new WeakMap,Pi=new WeakMap,Jr=new WeakMap,s(So,"FloorStack"),h(So,"__type","floor-stack");var pm=So,is=pm;m();m();var Mo,Zt,pn,Po,xo=class xo extends fe{constructor(e,i){super(i.mvfData.properties.id);h(this,"__type",xo.__type);P(this,Mo,void 0);P(this,Zt,{});P(this,pn,void 0);P(this,Po,void 0);I(this,Mo,e),I(this,pn,i.floorId),I(this,Po,i.mvfData)}static is(e){return e.__type===xo.__type}get floor(){let e=l(this,Mo).getById("floor",l(this,pn));if(e==null)throw new Error("Floor ".concat(l(this,pn)," not found!"));return e}get coordinate(){if(l(this,Zt).coordinate==null){let[e,i]=l(this,Po).geometry.coordinates;l(this,Zt).coordinate=new ne(i,e,l(this,pn))}return l(this,Zt).coordinate}get neighbors(){if(l(this,Zt).neighbours==null){let e=l(this,Po).properties.neighbors.map(i=>{let n=l(this,Mo).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});l(this,Zt).neighbours=e}return l(this,Zt).neighbours}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(l(this,Zt)))delete l(this,Zt)[e]}};Mo=new WeakMap,Zt=new WeakMap,pn=new WeakMap,Po=new WeakMap,s(xo,"Node"),h(xo,"__type","node");var um=xo,G3=um;m();var V9=new Set(["polygons"]),un,Le,Sr,To=class To extends fe{constructor(e,i){super(i.mvfData.externalId,i.mvfData);h(this,"__type",To.__type);h(this,"description");h(this,"name","");h(this,"amenity");h(this,"externalId","");h(this,"extra");h(this,"gallery");h(this,"logo");h(this,"operationHours");h(this,"phone");h(this,"picture");h(this,"shortName");h(this,"showFloatingLabelWhenImagePresent");h(this,"showLogo");h(this,"siblingGroups");h(this,"social");h(this,"sortOrder",-1);h(this,"states");h(this,"tags");h(this,"type","");P(this,un,void 0);P(this,Le,{});P(this,Sr,void 0);I(this,un,e),I(this,Sr,i.mvfData);for(let n in i.mvfData)!V9.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return l(this,un).getPropTranslation(this.__type,n,l(this,Sr).id,l(this,Sr)[n])}})}static is(e){return e.__type===To.__type}get coordinates(){if(l(this,Le).coordinates)return l(this,Le).coordinates;l(this,Le).coordinates=[];for(let e=0;e<this.nodes.length;e++)l(this,Le).coordinates.push(this.nodes[e].coordinate);return l(this,Le).coordinates}get nodes(){if(l(this,Le).nodes)return l(this,Le).nodes;l(this,Le).nodes=[];for(let e=0;e<l(this,Sr).nodes.length;e++){let i=l(this,un).getById("node",l(this,Sr).nodes[e].id);i&&l(this,Le).nodes.push(i)}return l(this,Le).nodes}get spaces(){if(l(this,Le).spaces)return l(this,Le).spaces;l(this,Le).spaces=[];for(let e=0;e<l(this,Sr).polygons.length;e++){let i=l(this,un).getById("space",l(this,Sr).polygons[e].id);i&&l(this,Le).spaces.push(i)}return l(this,Le).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(l(this,Le)))delete l(this,Le)[e]}};un=new WeakMap,Le=new WeakMap,Sr=new WeakMap,s(To,"EnterpriseLocation"),h(To,"__type","enterprise-location");var hm=To,hn=hm;m();var H9=new Set,dn,Qe,xr,Io=class Io extends fe{constructor(e,i){super(i.mvfData.externalId,i.mvfData);h(this,"__type",Io.__type);h(this,"name","");h(this,"color");h(this,"externalId","");h(this,"extra");h(this,"icon");h(this,"iconFromDefaultList");h(this,"sortOrder",-1);P(this,dn,void 0);P(this,Qe,{});P(this,xr,void 0);I(this,dn,e),I(this,xr,i.mvfData);for(let n in i.mvfData)!H9.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return l(this,dn).getPropTranslation(this.__type,n,l(this,xr).id,l(this,xr)[n])}})}static is(e){return e.__type===Io.__type}get children(){if(l(this,Qe).children)return l(this,Qe).children;l(this,Qe).children=[];for(let e=0;e<l(this,xr).children.length;e++){let i=l(this,dn).getById("enterprise-category",l(this,xr).children[e]);i&&l(this,Qe).children.push(i)}return l(this,Qe).children}get locations(){if(l(this,Qe).locations)return l(this,Qe).locations;l(this,Qe).locations=[];for(let e=0;e<l(this,xr).locations.length;e++){let i=l(this,dn).getById("enterprise-location",l(this,xr).locations[e]);i&&l(this,Qe).locations.push(i)}return l(this,Qe).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(l(this,Qe)))delete l(this,Qe)[e]}};dn=new WeakMap,Qe=new WeakMap,xr=new WeakMap,s(Io,"EnterpriseCategory"),h(Io,"__type","enterprise-category");var dm=Io,ns=dm;var j9=s((r,t)=>{var y,g;let e={},i={},n={},o={},a={},p={},c={},u={},f=globalThis.Object.keys(r.space);for(let C of f){let x=r.space[C];if(x!=null)for(let M of x.features){u[M.properties.id]=C,a[M.properties.id]=M;for(let v of M.properties.destinationNodes)n[v]==null&&(n[v]=[]),n[v].push(M.properties.id);if(M.properties.kind==="desk-entrance"&&(o[M.properties.externalId]==null&&(o[M.properties.externalId]=[]),o[M.properties.externalId].push(...M.properties.destinationNodes)),!["void","desk-entrance"].includes((y=M.properties.kind)!=null?y:"")){if((g=M.properties.kind)!=null&&g.includes("connection")){let v="".concat(M.geometry.coordinates[1],"-").concat(M.geometry.coordinates[0]);p[v]==null&&(p[v]=[]),p[v].push(M.properties.id);continue}if(M.properties.kind==="poi"){let v=new zr(t,{floorId:C,mvfData:M});i[M.properties.id]=v}else{let v=new ht(t,{floorId:C,mvfData:M});e[M.properties.id]=v}}}}for(let C in p){let x=p[C],M={};for(let S of x){let E=u[S],w=a[S];M[E]=w}let v=new Cr(t,{mvfDataByFloorId:M});c[v.id]=v}return{spacesById:e,poisById:i,connectionsById:c,spaceIdsByDestinationNodeId:n,objectEntranceNodeIdsByObstructionId:o,mvfSpacesById:a,connectionIdsByLatLon:p}},"processMVFSpaces"),X9=s((r,t)=>{var n;let e={},i={};for(let o of r["node.geojson"].features){i[o.properties.id]=o;let a=new G3(t,{mvfData:o,floorId:(n=o.properties.floor)!=null?n:o.properties.map});e[o.properties.id]=a}return{nodesById:e,mvfNodesById:i}},"processMVFNodes"),W9=s((r,t)=>{let e={},i={},n={},o=globalThis.Object.keys(r.obstruction);for(let a of o){let p=r.obstruction[a];if(p!=null)for(let c of p.features){i[c.properties.id]=c;for(let f of c.properties.entrances)n[f]=c.properties.id;if(c.properties.kind==="Wall")continue;let u=new dt(t,{floorId:a,mvfData:c});e[c.properties.id]=u}}return{objectsById:e,mvfObstructionById:i,obstructionIdByEntranceId:n}},"processMVFObstructions"),U9=s((r,t)=>{let e={},i={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){i[n.properties.id]=n.properties;let o=new gr(t,{mvfData:n.properties});e[n.properties.id]=o}else for(let n of r["map.geojson"]){i[n.id]=n;let o=new gr(t,{mvfData:n});e[n.id]=o}return{floorsById:e,mvfFloorsById:i}},"processMVFFloors"),Y9=s((r,t)=>{let e={},i={},n=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(n!=null)for(let o of n){let a=new is(t,{mvfData:o});e[o.id]=a,i[o.id]=o}return{floorStacksById:e,mvfFloorStacksById:i}},"processMVFFloorStacks"),Z9=s(r=>{let t={},e=r["connection.json"].reduce((i,n)=>(n.nodes.forEach(o=>i[o]=n),t[n.id]=n,i),{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:e}},"processMVFConnections"),z9=s((r,t)=>{let e={},i={},n={},o=globalThis.Object.keys(r.entrance);for(let a of o){let p=r.entrance[a];if(p!=null)for(let c of p.features){n[c.properties.id]=c;let u=new Xt(t,{floorId:a,mvfData:c});c.properties.node&&(i[c.properties.node]=u),e[c.properties.id]=u}}return{doorsById:e,doorsByNodeId:i,mvfEntrancesById:n}},"processMVFEntrances"),q9=s((r,t,e)=>{var i;if(r.floorImages!=null)for(let n in r.floorImages){let o=(i=r.floorImages[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let p=a==null?void 0:a.properties,c=t[p.anchorId]||e[p.anchorId];if(c!=null&&p!=null){let u=c.properties;u.image=p,u.image&&(u.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),$9=s((r,t)=>{let e={},i={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i};let n=globalThis.Object.keys(r.annotation);for(let o of n){let a=r.annotation[o];if(a!=null)for(let p of a.features){i[p.properties.id]=p;let c=new an(t,{floorId:o,mvfData:p});e[p.properties.id]=c}}return{annotationsById:e,mvfAnnotationsById:i}},"processMVFAnnotations"),V3=s((r,t)=>{var y,g,C;let e={},i={},n={},o={},a={},p={},c=((y=r.enterprise)==null?void 0:y.venue)||{},u;if(Object.keys(((g=r.enterprise)==null?void 0:g.locations)||{}).length>0)for(let x=0;x<r.enterprise.locations.length;x++){u=r.enterprise.locations[x],i[u.id]=new hn(t,{mvfData:u}),n[u.id]=u;for(let M of u.polygons)p[M.id]==null&&(p[M.id]=[]),p[M.id].push(u)}let f;if(Object.keys(((C=r.enterprise)==null?void 0:C.categories)||{}).length>0)for(let x=0;x<r.enterprise.categories.length;x++)f=r.enterprise.categories[x],o[f.id]=new ns(t,{mvfData:f}),a[f.id]=f;if(t.enterpriseMode===!0){for(let x in t.mvfConnectionsById){let M={};for(let v of t.mvfConnectionsById[x].nodes){let S=t.nodesById[v],E=t.mvfConnectionsById[x];S!=null&&(M[S.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[S.coordinate.longitude,S.coordinate.latitude]},properties:{id:x,externalId:E.externalId,kind:"enterprise."+E.type,destinationNodes:[],flags:""}})}Object.keys(M).length>0&&(e[x]=new Cr(t,{mvfDataByFloorId:M}))}t.connectionsById=e}return{locationsBySpaceId:p,mvfLocationsById:n,mvfCategoriesById:a,locationsById:i,categoriesById:o,venue:c}},"createEnterpriseDataFromMVF"),H3=s((r,t)=>{let{spacesById:e,spaceIdsByDestinationNodeId:i,poisById:n,mvfSpacesById:o,objectEntranceNodeIdsByObstructionId:a,connectionsById:p,connectionIdsByLatLon:c}=j9(r,t),{nodesById:u,mvfNodesById:f}=X9(r,t),{objectsById:y,mvfObstructionById:g,obstructionIdByEntranceId:C}=W9(r,t),{floorsById:x,mvfFloorsById:M}=U9(r,t),{floorStacksById:v,mvfFloorStacksById:S}=Y9(r,t),{mvfConnectionsById:E,mvfConnectionsByNodeId:w}=Z9(r),{doorsById:T,doorsByNodeId:D,mvfEntrancesById:_}=z9(r,t),{annotationsById:N,mvfAnnotationsById:V}=$9(r,t);return q9(r,o,g),{spacesById:e,nodesById:u,objectsById:y,floorsById:x,floorStacksById:v,connectionsById:p,doorsById:T,doorsByNodeId:D,poisById:n,annotationsById:N,spaceIdsByDestinationNodeId:i,objectEntranceNodeIdsByObstructionId:a,obstructionIdByEntranceId:C,connectionIdsByLatLon:c,mvfSpacesById:o,mvfNodesById:f,mvfObstructionById:g,mvfFloorsById:M,mvfFloorStacksById:S,mvfConnectionsById:E,mvfConnectionsByNodeId:w,mvfEntrancesById:_,mvfAnnotationsById:V}},"createDataFromMVF");m();var J9=new Set,os,as,wo=class wo extends fe{constructor(e,i){super(i.mvfData.externalId,i.mvfData);h(this,"__type",wo.__type);h(this,"countrycode");h(this,"externalId","");h(this,"defaultLanguage",{code:"en",name:"English"});h(this,"defaultMap");h(this,"extra");h(this,"icon");h(this,"languages",[]);h(this,"links",[]);h(this,"logo");h(this,"mappedinWebUrl");h(this,"slug","");h(this,"topLocations");h(this,"tzid");P(this,os,{});P(this,as,void 0);I(this,as,i.mvfData);for(let n in i.mvfData)!J9.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(e){return e.__type===wo.__type}get name(){let{name:e}=l(this,as);return e}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(l(this,os)))delete l(this,os)[e]}};os=new WeakMap,as=new WeakMap,s(wo,"EnterpriseVenue"),h(wo,"__type","enterprise-venue");var mm=wo,$c=mm;m();function fm(r){var t,e,i,n;return{type:"downloaded",data:r,optimized:{locations:(e=(t=r.enterprise)==null?void 0:t.locations)==null?void 0:e.reduce((o,a)=>(o[a.id]=a,o),{}),categories:(n=(i=r.enterprise)==null?void 0:i.categories)==null?void 0:n.reduce((o,a)=>(o[a.id]=a,o),{})}}}s(fm,"parseLocalePackToLanguagePack");var ie,Eo,ym=class ym extends Z{constructor(e,{outdoorViewToken:i,localePacksUrls:n,enterprise:o=!1,languagePacks:a}={}){super();h(this,"Analytics");P(this,ie,{});h(this,"mvf");h(this,"outdoorViewToken");h(this,"spaceIdsByDestinationNodeId");h(this,"objectEntranceNodeIdsByObstructionId");h(this,"obstructionIdByEntranceId");h(this,"venue");h(this,"enterpriseMode",!1);h(this,"nodesById");h(this,"spacesById");h(this,"floorsById");h(this,"floorStacksById");h(this,"connectionsById");h(this,"objectsById");h(this,"doorsById");h(this,"pointsOfInterestById");h(this,"annotationsById");h(this,"locationsById");h(this,"categoriesById");h(this,"doorsByNodeId");h(this,"locationsBySpaceId");h(this,"mvfAnnotationsById");h(this,"mvfConnectionsById");h(this,"mvfConnectionsByNodeId");h(this,"mvfEntrancesById");h(this,"mvfNodesById");h(this,"mvfObstructionById");h(this,"mvfSpacesById");h(this,"mvfFloorsById");h(this,"mvfFloorStacksById");h(this,"localePacksUrls");h(this,"currentLanguage");h(this,"languagePacks",{});P(this,Eo,void 0);this.Analytics=new qn,this.localePacksUrls=n!=null?n:{},this.mvf=e,this.outdoorViewToken=i,this.enterpriseMode=o;let p=H3(e,this);this.nodesById=p.nodesById,this.spacesById=p.spacesById,this.floorsById=p.floorsById,this.floorStacksById=p.floorStacksById,this.connectionsById=p.connectionsById,this.objectsById=p.objectsById,this.doorsById=p.doorsById,this.pointsOfInterestById=p.poisById,this.annotationsById=p.annotationsById,this.mvfAnnotationsById=p.mvfAnnotationsById,this.mvfConnectionsById=p.mvfConnectionsById,this.mvfConnectionsByNodeId=p.mvfConnectionsByNodeId,this.mvfEntrancesById=p.mvfEntrancesById,this.mvfNodesById=p.mvfNodesById,this.mvfObstructionById=p.mvfObstructionById,this.mvfSpacesById=p.mvfSpacesById,this.mvfFloorsById=p.mvfFloorsById,this.mvfFloorStacksById=p.mvfFloorStacksById,this.doorsByNodeId=p.doorsByNodeId,this.spaceIdsByDestinationNodeId=p.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=p.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=p.obstructionIdByEntranceId;let c=V3(e,this);this.locationsById=c.locationsById,this.categoriesById=c.categoriesById,this.locationsBySpaceId=c.locationsBySpaceId,c.venue.name!=null&&(this.venue=new $c(this,{mvfData:c.venue}),this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:c.mvfLocationsById,categories:c.mvfCategoriesById}},a==null||a.forEach(({language:u,localePack:f})=>{this.languagePacks[u.code]=fm(f)}),this.currentLanguage=this.venue.defaultLanguage)}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 ne(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return l(this,ie).spaces==null&&(l(this,ie).spaces=globalThis.Object.values(this.spacesById)),l(this,ie).spaces}get objects(){return l(this,ie).objects==null&&(l(this,ie).objects=globalThis.Object.values(this.objectsById)),l(this,ie).objects}get connections(){return l(this,ie).connections==null&&(l(this,ie).connections=globalThis.Object.values(this.connectionsById)),l(this,ie).connections}get floors(){return l(this,ie).floors==null&&(l(this,ie).floors=globalThis.Object.values(this.floorsById)),l(this,ie).floors}get floorStacks(){return l(this,ie).floorStacks==null&&(l(this,ie).floorStacks=globalThis.Object.values(this.floorStacksById)),l(this,ie).floorStacks}get doors(){return l(this,ie).doors==null&&(l(this,ie).doors=globalThis.Object.values(this.doorsById)),l(this,ie).doors}get pointsOfInterest(){return l(this,ie).pointsOfInterest==null&&(l(this,ie).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),l(this,ie).pointsOfInterest}get annotations(){return l(this,ie).annotations==null&&(l(this,ie).annotations=globalThis.Object.values(this.annotationsById)),l(this,ie).annotations}get nodes(){return l(this,ie).nodes==null&&(l(this,ie).nodes=globalThis.Object.values(this.nodesById)),l(this,ie).nodes}get locations(){return l(this,ie).locations==null&&(l(this,ie).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return l(this,ie).categories==null&&(l(this,ie).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}getById(e,i){switch(e){case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorsById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":return this.connectionsById[i];case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:throw new Error("Unknown type: ".concat(e))}}getMapDataById(e){var i,n,o,a,p,c,u;return(u=(c=(p=(a=(o=(n=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?n:this.nodesById[e])!=null?o:this.doorsById[e])!=null?a:this.connectionsById[e])!=null?p:this.objectsById[e])!=null?c:this.pointsOfInterestById[e])!=null?u:this.annotationsById[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"map":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];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))}}getPropTranslation(e,i,n,o){var u,f;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,p=e==="enterprise-category"?"categories":e==="enterprise-location"?"locations":void 0;if(!p)return o;let c=(f=(u=this.languagePacks[a])==null?void 0:u.optimized)==null?void 0:f[p];if(c){let y=c[n];if(y!=null&&y[i]!==void 0)return y[i]}return o}async changeLanguage(e){var p;let i=e.toLowerCase();if(!i){k.error("language code must be defined");return}if(!this.currentLanguage){k.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(p=this.venue)==null?void 0:p.languages.find(({code:c})=>c.toLowerCase()===i.toLowerCase());if(!o){k.warn("language not found");return}if(n===o.code)return;let a=this.languagePacks[o.code];if(!a){let c=this.localePacksUrls[o.code];if(!c){k.error("locale packs url not found for ".concat(o.code));return}l(this,Eo)&&l(this,Eo).abort();let u=new AbortController;I(this,Eo,u);let f;try{f=await fg(c,{signal:u.signal})}catch(y){k.error("failed downloading language pack",y);return}if(!f||u.signal.aborted)return;a=fm(f),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}destroy(){for(let e of globalThis.Object.keys(l(this,ie)))l(this,ie)[e]=null}};ie=new WeakMap,Eo=new WeakMap,s(ym,"MapDataInternal");var ss=ym;m();m();m();m();var ls=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(ls||{}),cs=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(cs||{});m();m();var Do=class Do{constructor(t,e){h(this,"id");h(this,"text");h(this,"__type",Do.__type);this.id=t,this.text=e}static is(t){return t.__type===Do.__type}};s(Do,"Label"),h(Do,"__type","Label");var Ti=Do;m();var Lo=class Lo{constructor(t,e){h(this,"id");h(this,"__type",Lo.__type);h(this,"contentEl");this.id=t,this.contentEl=e}static is(t){return t.__type===Lo.__type}};s(Lo,"Marker"),h(Lo,"__type","Marker");var mn=Lo;m();var us,hs,Oo=class Oo{constructor(t,e){P(this,us,void 0);P(this,hs,void 0);h(this,"__type",Oo.__type);I(this,us,t),I(this,hs,e)}static is(t){return t.__type===Oo.__type}get id(){return l(this,us)}get url(){return l(this,hs)}};us=new WeakMap,hs=new WeakMap,s(Oo,"Image"),h(Oo,"__type","Image");var ps=Oo;m();var _o=class _o{constructor(t,e){h(this,"id");h(this,"groupId");h(this,"__type",_o.__type);this.id=t,this.groupId=e}static is(t){return t.__type===_o.__type}};s(_o,"Model"),h(_o,"__type","Model");var ds=_o;m();var gm=class gm{constructor(t,e){h(this,"id");h(this,"animation");h(this,"__type");this.id=t,this.__type="Path",this.animation=e}};s(gm,"Path");var ms=gm;m();var Ii,vm=class vm{constructor(t){P(this,Ii,void 0);I(this,Ii,t)}get center(){return l(this,Ii).center}get bearing(){return l(this,Ii).bearing}get pitch(){return l(this,Ii).pitch}get zoomLevel(){return l(this,Ii).zoomLevel}};Ii=new WeakMap,s(vm,"CameraTransform");var fs=vm;m();var Ao=class Ao{constructor(t){h(this,"id");h(this,"__type",Ao.__type);this.id=t}static is(t){return t.__type===Ao.__type}};s(Ao,"Shape"),h(Ao,"__type","Shape");var ys=Ao;m();m();m();var K9=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>']]),Q9=/<svg([^>]*)>/g;function j3(r,t,e){let i=K9.get(r);return i?i.replace(Q9,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}s(j3,"getStyledIcon");var ex=s(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),tx=s(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(r,'"\n />\n </svg>\n '),"getDestinationPin"),bm="#722ED1",Cm="#1890FF",Sm=s(({type:r="departure",color:t=Cm})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?ex(t):tx(t),"\n </div>"),"DroppedPin"),rx=s(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),X3=s(({type:r="stairs",color:t=bm,direction:e="up"})=>{let i=rx("default"),n=i/2+2,o=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(j3("connection-"+r+"-16x16","white",n)||"","\n </div>\n ").concat(o?'<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(n,"px; height: ").concat(n,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");m();var W3=s(async r=>new Promise(t=>setTimeout(t,r)),"ms");var Jc={createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{color:"#40A9FF",accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},markerOptions:{departureColor:Cm,destinationColor:bm}},Kr,fn,ko,Dt,gs,Qr,Qc,U3,vs,xm=class xm{constructor(t,e){P(this,Qc);P(this,Kr,new Map);P(this,fn,void 0);P(this,ko,void 0);P(this,Dt,Jc);P(this,gs,void 0);P(this,Qr,void 0);h(this,"draw",s(async(t,e={})=>{var p;if(t.coordinates.length<2){k.warn("Directions must have at least 2 coordinates");return}l(this,Qr)&&this.clear();let i={pathOptions:{...Jc.pathOptions,...e.pathOptions},createMarkers:{...Jc.createMarkers,...e.createMarkers},markerOptions:{...Jc.markerOptions,...e.markerOptions}};I(this,Dt,i);let n=t.coordinates[0],o=t.coordinates[t.coordinates.length-1];if(n.floorId&&this.currentMap.setFloor(n.floorId),(p=l(this,Dt).createMarkers)!=null&&p.departure){let c=this.currentMap.Markers.add(n,Sm({type:"departure",color:l(this,Dt).markerOptions.departureColor}),{anchor:"top",rank:"always-visible"});l(this,Kr).set(c.id,void 0)}let a=!1;return I(this,Qr,{promise:new Promise(async c=>{var f,y;if(await W3(500),a){c();return}let u=this.currentMap.Paths.add(t.coordinates,l(this,Dt).pathOptions);if(I(this,fn,u.paths),await u.animation,a){c();return}if((f=l(this,Dt).createMarkers)!=null&&f.destination){let g=this.currentMap.Markers.add(o,Sm({type:"destination",color:l(this,Dt).markerOptions.destinationColor}),{anchor:"top",rank:"always-visible"});l(this,Kr).set(g.id,void 0)}(y=l(this,Dt).createMarkers)!=null&&y.connection&&(t.instructions.filter(C=>Y(this,Qc,U3).call(this,C.action)).forEach(C=>{var M;let x=this.currentMap.Markers.add(C.coordinate,X3({type:(M=C.action.connection)==null?void 0:M.type,color:C.action.type==="ExitConnection"?l(this,Dt).markerOptions.departureColor:l(this,Dt).markerOptions.destinationColor,direction:C.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});l(this,Kr).set(x.id,C)}),l(this,ko).on("click",l(this,vs))),c()}),cancel:()=>{a=!0}}),l(this,Qr).promise},"draw"));P(this,vs,s(t=>{if(t.markers.length>0){let e=l(this,Kr).get(t.markers[0]);e!=null&&e.action.toFloor&&this.currentMap.setFloor(e.action.toFloor.id)}},"#handleClick"));h(this,"clear",s(()=>{l(this,Kr).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),l(this,Kr).clear(),l(this,fn)&&(this.currentMap.Paths.remove(l(this,fn).map(t=>t.id.toString())),I(this,fn,void 0)),l(this,Qr)&&(l(this,Qr).cancel(),I(this,Qr,void 0)),l(this,ko).off("click",l(this,vs))},"clear"));I(this,ko,t),I(this,gs,e)}get currentMap(){return l(this,gs).call(this)}};Kr=new WeakMap,fn=new WeakMap,ko=new WeakMap,Dt=new WeakMap,gs=new WeakMap,Qr=new WeakMap,Qc=new WeakSet,U3=s(function(t){return t!=null&&["TakeConnection","ExitConnection"].includes(t.type)},"#isVortexAction"),vs=new WeakMap,s(xm,"Navigation");var Kc=xm;m();m();m();var ix=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>']]),nx=/<svg([^>]*)>/g;function Y3(r,t,e){let i=ix.get(r);return i?i.replace(nx,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}s(Y3,"getStyledIcon");var yn,Bo,bs,Mm,tp,Z3,rp,z3,Cs,Pm,ip,q3,Tm=class Tm{constructor(t,e){P(this,bs);P(this,tp);P(this,rp);P(this,Cs);P(this,ip);P(this,yn,void 0);P(this,Bo,void 0);h(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});I(this,yn,t),I(this,Bo,e)}auto(){let t=l(this,Bo)[Object.keys(l(this,Bo))[0]];[...t.getByType("connection"),...t.getByType("point-of-interest"),...t.getByType("space")].forEach(e=>{e.__type==="connection"?e.coordinates.forEach(i=>{l(this,yn).Labels.add(i,e.name,Y(this,bs,Mm).call(this,e))}):(e.__type==="space"&&e.name!==""&&l(this,yn).updateState(e,{interactive:!0,hoverColor:"#F0F0F0"}),l(this,yn).Labels.add(e,e.name,Y(this,bs,Mm).call(this,e)))})}};yn=new WeakMap,Bo=new WeakMap,bs=new WeakSet,Mm=s(function(t){let e=Y3(Y(this,tp,Z3).call(this,t),"white",12);return{appearance:{text:{foregroundColor:Y(this,Cs,Pm).call(this,t)},marker:{foregroundColor:{active:Y(this,Cs,Pm).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:Y(this,ip,q3).call(this,t)}},"#generatLabelAppearance"),tp=new WeakSet,Z3=s(function(t){return t.__type==="connection"?Y(this,rp,z3).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),rp=new WeakSet,z3=s(function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},"#attemptIconNameForConnection"),Cs=new WeakSet,Pm=s(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),ip=new WeakSet,q3=s(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),s(Tm,"Labels");var ep=Tm;var Im=class Im{constructor(t,e){h(this,"Labels");h(this,"auto",s(()=>{this.Labels.auto()},"auto"));this.Labels=new ep(t,e)}};s(Im,"DefaultTheme");var np=Im;m();var se,wm=class wm{constructor(t){P(this,se,void 0);h(this,"setMinPitch",s(t=>{l(this,se).camera.setMinPitch(t)},"setMinPitch"));h(this,"setMaxPitch",s(t=>{l(this,se).camera.setMaxPitch(t)},"setMaxPitch"));h(this,"setMinZoomLevel",s(t=>{l(this,se).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));h(this,"setMaxZoomLevel",s(t=>{l(this,se).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));I(this,se,t)}setScreenOffsets(t){l(this,se).camera.setInsetPadding(t)}focusOn(t,e){var o,a;let i=[],n=Array.isArray(t)?t:[t];for(let p of n)if(Cr.is(p)){let c;for(c of p.coordinates)if(c.floorId!=null){let u=l(this,se).getBoundingArea(c.floorId);u&&i.push([c.longitude,c.latitude,(o=u[0][2])!=null?o:l(this,se).camera.elevation])}else i.push([c.longitude,c.latitude,l(this,se).camera.elevation])}else if(gr.is(p)||ht.is(p)||dt.is(p)){let c=l(this,se).getBoundingArea(p.id);c&&i.push(...c)}else{let c=Et(p);if(c)if(c.floorId!=null){let u=l(this,se).getBoundingArea(c.floorId);u&&i.push([c.longitude,c.latitude,(a=u[0][2])!=null?a:l(this,se).camera.elevation])}else i.push([c.longitude,c.latitude,l(this,se).camera.elevation])}return l(this,se).camera.focusOn(i,{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:e==null?void 0:e.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing})}animateTo(t,e){var u;let{center:i,zoomLevel:n,bearing:o,pitch:a}=t,p=i!=null?i:this.center,c=[p.longitude,p.latitude];return l(this,se).camera.animateTo({center:c,zoomLevel:n!=null?n:this.zoomLevel,bearing:o!=null?o:this.bearing,pitch:a!=null?a:this.pitch,duration:(u=e==null?void 0:e.duration)!=null?u:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:i=this.zoomLevel,bearing:n=this.bearing,pitch:o=this.pitch}=t,a=[e.longitude,e.latitude];l(this,se).camera.setCenter(a),l(this,se).camera.setZoomLevel(i),l(this,se).camera.setBearing(n),l(this,se).camera.setPitch(o)}get center(){let t=l(this,se).camera.center;return new ne(t[1],t[0],void 0)}setAutoMinZoomLevel(t){l(this,se).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return l(this,se).camera.autoMinZoomLevel}get zoomLevel(){return l(this,se).camera.zoomLevel}get pitch(){return l(this,se).camera.pitch}get minPitch(){return l(this,se).camera.minPitch}get maxPitch(){return l(this,se).camera.maxPitch}get bearing(){let t=l(this,se).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return l(this,se).camera.minZoomLevel}get maxZoomLevel(){return l(this,se).camera.maxZoomLevel}};se=new WeakMap,s(wm,"Camera");var Ss=wm;m();m();m();m();m();m();m();m();function Em(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return $3(this.cover(t,e),t,e,r)}s(Em,"default");function $3(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var n,o=r._root,a={data:i},p=r._x0,c=r._y0,u=r._x1,f=r._y1,y,g,C,x,M,v,S,E;if(!o)return r._root=a,r;for(;o.length;)if((M=t>=(y=(p+u)/2))?p=y:u=y,(v=e>=(g=(c+f)/2))?c=g:f=g,n=o,!(o=o[S=v<<1|M]))return n[S]=a,r;if(C=+r._x.call(null,o.data),x=+r._y.call(null,o.data),t===C&&e===x)return a.next=o,n?n[S]=a:r._root=a,r;do n=n?n[S]=new Array(4):r._root=new Array(4),(M=t>=(y=(p+u)/2))?p=y:u=y,(v=e>=(g=(c+f)/2))?c=g:f=g;while((S=v<<1|M)===(E=(x>=g)<<1|C>=y));return n[E]=o,n[S]=a,r}s($3,"add");function J3(r){var t,e,i=r.length,n,o,a=new Array(i),p=new Array(i),c=1/0,u=1/0,f=-1/0,y=-1/0;for(e=0;e<i;++e)isNaN(n=+this._x.call(null,t=r[e]))||isNaN(o=+this._y.call(null,t))||(a[e]=n,p[e]=o,n<c&&(c=n),n>f&&(f=n),o<u&&(u=o),o>y&&(y=o));if(c>f||u>y)return this;for(this.cover(c,u).cover(f,y),e=0;e<i;++e)$3(this,a[e],p[e],r[e]);return this}s(J3,"addAll");m();function Dm(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(e))n=(e=Math.floor(r))+1,o=(i=Math.floor(t))+1;else{for(var a=n-e||1,p=this._root,c,u;e>r||r>=n||i>t||t>=o;)switch(u=(t<i)<<1|r<e,c=new Array(4),c[u]=p,p=c,a*=2,u){case 0:n=e+a,o=i+a;break;case 1:e=n-a,o=i+a;break;case 2:n=e+a,i=o-a;break;case 3:e=n-a,i=o-a;break}this._root&&this._root.length&&(this._root=p)}return this._x0=e,this._y0=i,this._x1=n,this._y1=o,this}s(Dm,"default");m();function Lm(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}s(Lm,"default");m();function Om(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]]}s(Om,"default");m();m();function Fe(r,t,e,i,n){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=n}s(Fe,"default");function _m(r,t,e){var i,n=this._x0,o=this._y0,a,p,c,u,f=this._x1,y=this._y1,g=[],C=this._root,x,M;for(C&&g.push(new Fe(C,n,o,f,y)),e==null?e=1/0:(n=r-e,o=t-e,f=r+e,y=t+e,e*=e);x=g.pop();)if(!(!(C=x.node)||(a=x.x0)>f||(p=x.y0)>y||(c=x.x1)<n||(u=x.y1)<o))if(C.length){var v=(a+c)/2,S=(p+u)/2;g.push(new Fe(C[3],v,S,c,u),new Fe(C[2],a,S,v,u),new Fe(C[1],v,p,c,S),new Fe(C[0],a,p,v,S)),(M=(t>=S)<<1|r>=v)&&(x=g[g.length-1],g[g.length-1]=g[g.length-1-M],g[g.length-1-M]=x)}else{var E=r-+this._x.call(null,C.data),w=t-+this._y.call(null,C.data),T=E*E+w*w;if(T<e){var D=Math.sqrt(e=T);n=r-D,o=t-D,f=r+D,y=t+D,i=C.data}}return i}s(_m,"default");m();function Am(r){if(isNaN(f=+this._x.call(null,r))||isNaN(y=+this._y.call(null,r)))return this;var t,e=this._root,i,n,o,a=this._x0,p=this._y0,c=this._x1,u=this._y1,f,y,g,C,x,M,v,S;if(!e)return this;if(e.length)for(;;){if((x=f>=(g=(a+c)/2))?a=g:c=g,(M=y>=(C=(p+u)/2))?p=C:u=C,t=e,!(e=e[v=M<<1|x]))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(n=e,!(e=e.next))return this;return(o=e.next)&&delete e.next,n?(o?n.next=o:delete n.next,this):t?(o?t[v]=o: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=o,this)}s(Am,"default");function K3(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}s(K3,"removeAll");m();function km(){return this._root}s(km,"default");m();function Bm(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}s(Bm,"default");m();function Rm(r){var t=[],e,i=this._root,n,o,a,p,c;for(i&&t.push(new Fe(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,o=e.x0,a=e.y0,p=e.x1,c=e.y1)&&i.length){var u=(o+p)/2,f=(a+c)/2;(n=i[3])&&t.push(new Fe(n,u,f,p,c)),(n=i[2])&&t.push(new Fe(n,o,f,u,c)),(n=i[1])&&t.push(new Fe(n,u,a,p,f)),(n=i[0])&&t.push(new Fe(n,o,a,u,f))}return this}s(Rm,"default");m();function Fm(r){var t=[],e=[],i;for(this._root&&t.push(new Fe(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var n=i.node;if(n.length){var o,a=i.x0,p=i.y0,c=i.x1,u=i.y1,f=(a+c)/2,y=(p+u)/2;(o=n[0])&&t.push(new Fe(o,a,p,f,y)),(o=n[1])&&t.push(new Fe(o,f,p,c,y)),(o=n[2])&&t.push(new Fe(o,a,y,f,u)),(o=n[3])&&t.push(new Fe(o,f,y,c,u))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}s(Fm,"default");m();function Q3(r){return r[0]}s(Q3,"defaultX");function Nm(r){return arguments.length?(this._x=r,this):this._x}s(Nm,"default");m();function e4(r){return r[1]}s(e4,"defaultY");function Gm(r){return arguments.length?(this._y=r,this):this._y}s(Gm,"default");function xs(r,t,e){var i=new Vm(t==null?Q3:t,e==null?e4:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}s(xs,"quadtree");function Vm(r,t,e,i,n,o){this._x=r,this._y=t,this._x0=e,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}s(Vm,"Quadtree");function t4(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}s(t4,"leaf_copy");var et=xs.prototype=Vm.prototype;et.copy=function(){var r=new Vm(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=t4(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var n=0;n<4;++n)(i=t.source[n])&&(i.length?e.push({source:i,target:t.target[n]=new Array(4)}):t.target[n]=t4(i));return r};et.add=Em;et.addAll=J3;et.cover=Dm;et.data=Lm;et.extent=Om;et.find=_m;et.remove=Am;et.removeAll=K3;et.root=km;et.size=Bm;et.visit=Rm;et.visitAfter=Fm;et.x=Nm;et.y=Gm;m();m();var Hm=class Hm{constructor({origin:t,destination:e,distance:i=0,angle:n=0,pathWeight:o=0}){h(this,"origin");h(this,"destination");h(this,"distance");h(this,"angle");h(this,"weight");this.origin=t,this.destination=e,this.distance=i,this.angle=n;let a=o||0;if(this.weight=a>=0?this.distance+a:0,isNaN(this.angle))throw new Error("nan angle")}};s(Hm,"Edge");var gn=Hm;m();m();m();function jm(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=It(r),n=Cg(t),o=n.type,a=t.bbox,p=n.coordinates;if(a&&ox(i,a)===!1)return!1;o==="Polygon"&&(p=[p]);for(var c=!1,u=0;u<p.length&&!c;u++)if(r4(i,p[u][0],e.ignoreBoundary)){for(var f=!1,y=1;y<p[u].length&&!f;)r4(i,p[u][y],!e.ignoreBoundary)&&(f=!0),y++;f||(c=!0)}return c}s(jm,"booleanPointInPolygon");function r4(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 n=0,o=t.length-1;n<t.length;o=n++){var a=t[n][0],p=t[n][1],c=t[o][0],u=t[o][1],f=r[1]*(a-c)+p*(c-r[0])+u*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(p-r[1])*(u-r[1])<=0;if(f)return!e;var y=p>r[1]!=u>r[1]&&r[0]<(c-a)*(r[1]-p)/(u-p)+a;y&&(i=!i)}return i}s(r4,"inRing");function ox(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}s(ox,"inBBox");m();m();function ei([r,t],[e,i]){let n=t-i,o=r-e;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}s(ei,"getAngle");m();var ax=63710088e-1;function vn(r,t){let[e,i]=r.map(f=>f*Math.PI/180),[n,o]=t.map(f=>f*Math.PI/180),a=o-i,p=n-e,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(p/2)*Math.sin(p/2),u=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return ax*u}s(vn,"getDistance");m();m();function op(r,t,e,i){let[n,o]=r,[a,p]=t,[c,u]=e,[f,y]=i;if(o===p&&n===a||u===y&&c===f)return null;let g=(f-c)*(p-o)-(y-u)*(a-n);if(g===0)return null;let C=((y-u)*(n-c)-(f-c)*(o-u))/g,x=((p-o)*(n-c)-(a-n)*(o-u))/g;if(C<0||C>1||x<0||x>1)return null;let M=o+C*(p-o);return[n+C*(a-n),M]}s(op,"getLineIntersection");m();function Xm(r,t,e,i){let n=$i(r,e/1e3,i),o=$i(t,e/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}s(Xm,"getOffsetLine");m();function Wm(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}s(Wm,"radToDegNormalized");function i4(r,t,e=[],i=0){let n=!0,o=r.geometry.coordinates,a=t.geometry.coordinates,p=Wm(ei(o,a)-Math.PI/2),c=Wm(ei(o,a)+Math.PI/2);return e.forEach(u=>{if(i>0){let f=Xm(o,a,i,p),y=Xm(o,a,i,c);if(op(f[0],f[1],u[0],u[1])||op(y[0],y[1],u[0],u[1])){n=!1;return}}else if(op(o,a,u[0],u[1])){n=!1;return}}),n}s(i4,"hasLineOfSight");var bn,Ms,Um,sp,n4,lp,o4,cp,a4,pp,s4,up,l4,hp,c4,dp,Ym=class Ym{constructor({nodes:t,groupBy:e}){P(this,Ms);P(this,sp);P(this,lp);P(this,cp);P(this,pp);P(this,up);P(this,hp);h(this,"edges",{});h(this,"nodesById");h(this,"nodesByGroup",new Map);P(this,bn,void 0);P(this,dp,s((t,e)=>{let i=0;for(let n of e)(!n[l(this,bn)]||n[l(this,bn)]===t.properties[l(this,bn)])&&jm(t.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i},"#getZonalCost"));I(this,bn,e);let{features:i}=t;this.nodesById=Y(this,sp,n4).call(this,i),Y(this,lp,o4).call(this),Y(this,cp,a4).call(this,i,e)}getShortestEuclideanDistance(t,e){return e.reduce((i,n)=>{let o=vn(t.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,zones:n}){let o=Y(this,Ms,Um).call(this,t),a=Y(this,Ms,Um).call(this,e);if(o.length===0||a.length===0)return[];let{frontier:p,cameFrom:c,costSoFar:u}=Y(this,pp,s4).call(this,o,a);for(;p.length>0;){let f=p.shift();if(!f)break;if(Y(this,up,l4).call(this,f.origin,a))return Y(this,hp,c4).call(this,c,f.origin.properties.id);for(let y of this.edges[f.origin.properties.id]){let g=u[f.origin.properties.id]+y.weight+l(this,dp).call(this,y.destination,n);if(!(g===1/0||i!=null&&i.has(y.destination.properties.id))&&(u[y.destination.properties.id]==null||g<u[y.destination.properties.id])){let C=g+this.getShortestEuclideanDistance(y.destination,a);u[y.destination.properties.id]=g,c[y.destination.properties.id]=y,p.push({origin:y.destination,priority:C})}}p.sort((y,g)=>y.priority-g.priority)}return[]}};bn=new WeakMap,Ms=new WeakSet,Um=s(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),sp=new WeakSet,n4=s(function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},"#createNodesById"),lp=new WeakSet,o4=s(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},"#removeInvalidNeighbors"),cp=new WeakSet,a4=s(function(t,e){t.forEach(i=>{let n=e==="default"?e:i.properties[e];this.nodesByGroup.has(n)||this.nodesByGroup.set(n,[]),this.nodesByGroup.get(n).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:o,weight:a})=>{let p=this.nodesById[o],c=vn(i.geometry.coordinates,p.geometry.coordinates),u=ei(i.geometry.coordinates,p.geometry.coordinates);return new gn({origin:i,destination:p,pathWeight:a,distance:c,angle:u})})})},"#initializeEdgesAndGroups"),pp=new WeakSet,s4=s(function(t,e){let i=[],n={},o={};return t.forEach(a=>{let p=this.getShortestEuclideanDistance(a,e);i.push({origin:a,priority:p}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,p)=>a.priority-p.priority),{frontier:i,cameFrom:n,costSoFar:o}},"#initializeSearch"),up=new WeakSet,l4=s(function(t,e){return e.some(i=>i.properties.id===t.properties.id)},"#isDestinationNode"),hp=new WeakSet,c4=s(function(t,e){let i=[],n=t[e];for(;n;)i.push(n),n=t[n.origin.properties.id];return i.reverse()},"#reconstructPath"),dp=new WeakMap,s(Ym,"NavigationGraph");var ap=Ym;var sx=.4,Zm=class Zm{constructor({nodes:t,geojsonCollection:e,groupBy:i="default"}){h(this,"groupBy");h(this,"graph");h(this,"geometryEdgesByMapId",new Map);h(this,"cache",{nodeTreesByGroup:new Map});h(this,"findNearestNode",s(t=>{var n;let e=this.groupBy==="default"?this.groupBy:t.properties[this.groupBy];if(!this.cache.nodeTreesByGroup.has(e)){let o=(n=this.graph.nodesByGroup.get(e))!=null?n:[],a=xs();a.x(p=>p.geometry.coordinates[1]),a.y(p=>p.geometry.coordinates[0]),a.addAll(o),this.cache.nodeTreesByGroup.set(e,a)}return this.cache.nodeTreesByGroup.get(e).find(t.geometry.coordinates[1],t.geometry.coordinates[0])||null},"findNearestNode"));h(this,"generatePath",s(t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<t.length;o++){let{origin:a}=t[o],p={id:a.properties.id,angle:t[o].angle,distance:t[o].distance};this.groupBy!=="default"&&(p.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:p})}let n={id:e.properties.id};return this.groupBy!=="default"&&(n.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:n}),i},"generatePath"));h(this,"getDistance",s((t,e)=>vn(t,e),"getDistance"));h(this,"getAngle",s((t,e)=>ei(t,e),"getAngle"));this.groupBy=i,this.graph=new ap({nodes:t,groupBy:this.groupBy}),((e==null?void 0:e.features)||[]).forEach(o=>{let a=null;if(o.geometry.type==="LineString"?a=o.geometry.coordinates:o.geometry.type==="Polygon"&&(a=o.geometry.coordinates.flat()),a){let p=this.groupBy==="default"?this.groupBy:o.properties[this.groupBy];this.geometryEdgesByMapId.has(p)||this.geometryEdgesByMapId.set(p,[]),a.forEach((c,u)=>{this.geometryEdgesByMapId.get(p).push([c,a[u+1]||a[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:n,simplify:o}){var u,f;let a=(u=o==null?void 0:o.enabled)!=null?u:!0,p=t!=null?t:[],c=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:p,excludedNodeIds:new Set(n)});return c.length===0?{type:"FeatureCollection",features:[]}:(a&&(c=this.simplifyAllSteps(c,(f=o==null?void 0:o.bufferRadius)!=null?f:sx)),this.generatePath(c))}simplifyAllSteps(t,e){var c,u;let i=[],n=[t[0]];for(let f=1;f<t.length;f++){if(this.groupBy!=="default"&&t[f].origin.properties[this.groupBy]!==t[f-1].origin.properties[this.groupBy]){let y=t[f-1].origin.properties[this.groupBy],g=(c=this.geometryEdgesByMapId.get(y))!=null?c:[];i.push(...this.simplifySteps(n,g,e)),n=[t[f]]}n.push(t[f])}let o=t[t.length-1],a=this.groupBy==="default"?this.groupBy:o.origin.properties[this.groupBy],p=(u=this.geometryEdgesByMapId.get(a))!=null?u:[];return i.push(...this.simplifySteps(n,p,e)),i}simplifySteps(t,e,i){if(t.length<3)return t;let n=[t[0]],o=1;for(let a=o+2;a<t.length;a++)if(!i4(t[o].origin,t[a].origin,e,i)){let p=a-1;n.push(new gn({...t[o],destination:t[p].origin,distance:vn(t[o].origin.geometry.coordinates,t[p].origin.geometry.coordinates),angle:ei(t[o].origin.geometry.coordinates,t[p].origin.geometry.coordinates)})),o=p}return n.push(new gn({...t[o],destination:t[t.length-1].origin,distance:vn(t[o].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:ei(t[o].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates)}),t[t.length-1]),n}};s(Zm,"Navigator");var Ro=Zm;m();function Mr(r){return[r.longitude,r.latitude]}s(Mr,"convertCoordinateToPosition");function lx(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}s(lx,"getEntranceMap");var zm=s((r,t)=>{let e=lx(t),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of r){let o=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((p,c)=>(e.has(c)&&p.push(e.get(c)),p),[]);if(a.length){let{entrances:p,obstructions:c}=zd(n,a);o=c.map(u=>u.geometry.coordinates),i.entrances.features.push(...p)}i.walls.geometry.coordinates.push(...o)}return i},"cutEntrancesFromLineStrings");function p4(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),e}s(p4,"translateLabelStateToGeojsonCore");function u4(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),e}s(u4,"translateMarkerStateToGeojsonCore");function qm(r,t){var i,n;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(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),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}s(qm,"translateDoorsStateToGeojsonCore");function $m(r,t){var i,n;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(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),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url)),e}s($m,"translateWallsStateToGeojsonCore");function h4(r,t){var i,n;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(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),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}s(h4,"translateSpaceStateToGeojsonCore");function d4(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}s(d4,"differenceBetweenAngles");function m4(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}s(m4,"getRelativeBearing");function f4(r){let t={};for(let e in r){let i=r[e];if(i!=null){if(i.id=e,"polygons"in i)for(let n of i.polygons)t[n]=i;else if("lineStrings"in i)for(let n of i.lineStrings)t[n]=i;else if("points"in i)for(let n of i.points)t[n]=i}}return t}s(f4,"extractStyleMap");function Jm(r,t){return r.reduce((e,i)=>{let n=t[i.properties.id];return n==null||(e.has(n)||e.set(n,[]),e.get(n).push(i)),e},new Map)}s(Jm,"groupGeometryByStyle");function Ps(r,t={}){var n,o,a,p,c,u;let e={...r},i=(o=(n=t==null?void 0:t.style)==null?void 0:n.shading)!=null?o: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=(p=(a=t==null?void 0:t.style)==null?void 0:a.outlines)!=null?p:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let f=(u=(c=t==null?void 0:t.style)==null?void 0:c.wallTopColor)!=null?u:t==null?void 0:t.wallTopColor;f!=null&&(e.topColor=f)}return e}s(Ps,"translateToCoreStyle");var y4=s((r,t)=>{var e,i,n,o;switch(r){case"interior-walls":return(e=t.currentMap)==null?void 0:e.currentFloor.layers.get(Ci);case"exterior-walls":return(i=t.currentMap)==null?void 0:i.currentFloor.layers.get(vr);case"interior-doors":return(n=t.currentMap)==null?void 0:n.currentFloor.layers.get(ho);case"exterior-doors":return(o=t.currentMap)==null?void 0:o.currentFloor.layers.get(mo);default:return typeof r=="string"?r:r.id}},"getTargetID");function Km(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}s(Km,"tweenToPromise");var g4=Math.PI*.1,tt,Mt,Lt,yp,v4,wi,Fo,gp,b4,Qm=class Qm{constructor(t,e){P(this,yp);P(this,wi);P(this,gp);P(this,tt,{});P(this,Mt,void 0);P(this,Lt,void 0);h(this,"lastConnectionAction");h(this,"lastConnection");I(this,Mt,e),I(this,Lt,t.features),I(this,Mt,e),I(this,Lt,t.features)}get coordinates(){return l(this,tt).coordinates?l(this,tt).coordinates:(l(this,tt).coordinates=l(this,Lt).map(t=>new ne(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),l(this,tt).coordinates)}get distance(){return l(this,tt).distance?l(this,tt).distance:(l(this,tt).distance=l(this,Lt).reduce((t,e)=>t+(e.properties.distance||0),0),l(this,tt).distance)}get instructions(){if(l(this,Lt).length<2)return[];if(l(this,tt).instructions)return l(this,tt).instructions;let t=[],e=0;for(let i=0;i<l(this,Lt).length;i++){let n=l(this,Lt)[i],o=l(this,Lt)[i-1],a=l(this,Lt)[i+1],p=new ne(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=Y(this,yp,v4).call(this,{prevDirection:o,direction:n,nextDirection:a});e+=(o==null?void 0:o.properties.distance)||0;for(let u of c)u&&(t.push({action:u,distance:e,coordinate:p}),e=0)}return l(this,tt).instructions=t,l(this,tt).instructions}};tt=new WeakMap,Mt=new WeakMap,Lt=new WeakMap,yp=new WeakSet,v4=s(function(t){var g,C,x;let{prevDirection:e,direction:i,nextDirection:n}=t,o=e&&l(this,Mt).getById("floor",e.properties.groupBy),a=l(this,Mt).getById("floor",i.properties.groupBy),p=n&&l(this,Mt).getById("floor",n.properties.groupBy),c=[];e||c.push({type:"Departure"});let u=l(this,Mt).getMVFFeatureByNodeId("connection",i.properties.id),f=l(this,Mt).getMVFFeatureByNodeId("connection",(g=n==null?void 0:n.properties.id)!=null?g:""),y=u?l(this,Mt).getById("connection",u.id):void 0;if(u)if(!this.lastConnectionAction||this.lastConnectionAction==="exit")c.push(Y(this,wi,Fo).call(this,"TakeConnection",a,p,y)),this.lastConnectionAction="take",this.lastConnection=y;else{let M=l(this,Mt).getMVFFeatureByNodeId("connection",(C=e==null?void 0:e.properties.id)!=null?C:""),v=l(this,Mt).getById("connection",(x=M==null?void 0:M.id)!=null?x:"");c.push(Y(this,wi,Fo).call(this,"ExitConnection",a,o,v)),this.lastConnectionAction="exit",this.lastConnection=y}else f&&this.lastConnectionAction==="take"?(c.push(Y(this,wi,Fo).call(this,"ExitConnection",a,o,this.lastConnection)),this.lastConnectionAction="exit",this.lastConnection=y):p&&a.id!==p.id?c.push(Y(this,wi,Fo).call(this,"TakeConnection",a,p,y)):o&&o.id!==a.id?c.push(Y(this,wi,Fo).call(this,"ExitConnection",a,o,y)):c.push(Y(this,gp,b4).call(this,e,i));return n||c.push({type:"Arrival"}),c},"#getActions"),wi=new WeakSet,Fo=s(function(t,e,i,n){var a;let o="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let p=e.elevation-i.elevation;p>0?o="down":p<0&&(o="up")}return{type:t,fromFloor:e,toFloor:i,direction:o,connection:n,connectionType:(a=n==null?void 0:n.type)!=null?a:"stairs"}},"#createConnectionAction"),gp=new WeakSet,b4=s(function(t,e){let i=t?-d4(t.properties.angle,e.properties.angle):0;return Math.abs(i)>=g4?{type:"Turn",bearing:m4(i,g4),referencePosition:"At"}:null},"#createTurnAction"),s(Qm,"Directions");var mp=Qm,ef=class ef{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:n}){h(this,"navigator");h(this,"connections");h(this,"getDirections",s((t,e,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:p}}=i,c=t.flatMap(C=>this.getNodesFromTarget(C,n)),u=e.flatMap(C=>this.getNodesFromTarget(C,n)),f=this.getExcludedNodeIds(o).filter(C=>!c.includes(C)&&!u.includes(C)),y=this.navigator.getDirections({zones:i.zones.map(C=>{var x;return{geometry:C.geometry,cost:C.cost,map:(x=C.floor)==null?void 0:x.id}}),originIds:c,destinationNodeIds:u,excludedNodeIds:f,simplify:{enabled:a,bufferRadius:p}});this.addCoordinateDirections(y,t,e);let g=new mp(y,n);if(!(g.distance===0&&new Set([...c,...u]).size===c.length+u.length))return g},"getDirections"));h(this,"getExcludedNodeIds",s(t=>t?this.connections.reduce((e,i)=>i.accessible?e:e.concat(i.nodes),[]):[],"getExcludedNodeIds"));h(this,"addCoordinateDirections",s((t,[e],[i])=>{if(t.features.length){if(ne.is(e)){let n=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,n)}if(ne.is(i)){let n=this.createDirectionFeature(i,0,0),o=t.features[t.features.length-1];o.properties.distance=this.navigator.getDistance(o.geometry.coordinates,[i.longitude,i.latitude]),o.properties.angle=this.navigator.getAngle(o.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(n)}}},"addCoordinateDirections"));h(this,"getNodesFromTarget",s((t,e)=>{if(ne.is(t)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(t));return i?[i.properties.id]:[]}else if(zr.is(t)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(t.coordinate));return i?[i.properties.id]:[]}else if(Xt.is(t)){let i=this.navigator.findNearestNode(this.createCoordinateFeature(t.center));return i?[i.properties.id]:[]}else if(ht.is(t)){let i=e==null?void 0:e.getMVFFeatureById("space",t.id);return i==null?[]:i.properties.destinationNodes}else{if(Cr.is(t))return t.coordinates.reduce((i,n)=>{let o=this.navigator.findNearestNode(this.createCoordinateFeature(n));return o&&i.push(o.properties.id),i},[]);if(dt.is(t)){let i=e==null?void 0:e.objectEntranceNodeIdsByObstructionId[t.id];return i!=null?i:[]}else return hn.is(t)?t.nodes.map(i=>i.id):[]}},"getNodesFromTarget"));h(this,"createCoordinateFeature",s(t=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{map:t.floorId}}),"createCoordinateFeature"));h(this,"createDirectionFeature",s((t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i}}),"createDirectionFeature"));this.navigator=new Ro({nodes:t,geojsonCollection:this.createCollection(e),groupBy:n}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,n])=>e.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};s(ef,"DirectionsInternal");var fp=ef;m();var No,tf=class tf{constructor({currentMapGetter:t}){P(this,No,void 0);I(this,No,t)}get currentMap(){return l(this,No).call(this)}async getCurrentSceneGLTF(t){let e=l(this,No).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(k.error("There is no map to export. Please load a map first."),new Blob)}};No=new WeakMap,s(tf,"Exporter");var Ts=tf;m();var Pr,ws,rf=class rf{constructor({currentMapGetter:t}){P(this,Pr,new Map);P(this,ws,void 0);I(this,ws,t)}get currentMap(){return l(this,ws).call(this)}getById(t){return l(this,Pr).get(t)}add(t,e,i){let n=Et(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Labels.add(Mr(n),e,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium"}),p=new Ti(a.id.toString(),e);return l(this,Pr).set(p.id,{label:p,entityId:p.id}),p}all(){var e;let t=[];return(e=this.currentMap)==null||e.Labels.all({onCreate:(i,n)=>{let o=new Ti(i.toString(),n);l(this,Pr).set(o.id,{label:o,entityId:o.id}),t.push(o)}}),t}remove(t){var i;let e=l(this,Pr).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e.entityId),l(this,Pr).delete(t.id.toString()))}removeAll(){let t=[];return l(this,Pr).forEach(({label:e})=>{this.remove(e),t.push(e),l(this,Pr).delete(e.id.toString())}),t}};Pr=new WeakMap,ws=new WeakMap,s(rf,"Labels");var Is=rf;m();var Gn=ar(Cn());m();var C4={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},S4={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},x4=.5,sf=class sf{constructor(t,e,i,n,o,a){h(this,"id");h(this,"name");h(this,"elevation");h(this,"containerId");h(this,"loaded",!1);h(this,"styleMap",{});h(this,"obstructions");h(this,"entrances");h(this,"spaces");h(this,"renderer");h(this,"options");h(this,"mvf");h(this,"layers",new Map);h(this,"load",s(()=>{var t,e,i,n,o;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;if(this.loaded=!0,this.spaces!=null&&this.spaces.features.length>0){let a=this.spaces.features.filter(f=>{var y;return f.geometry.type==="Polygon"&&((y=f.properties.kind)==null?void 0:y.toLowerCase())!=="void"}),p=Jm(a,this.styleMap),c=this.renderer.addGroupContainer("spaces-".concat(this.id),{},this.id),u=0;for(let[f,y]of p){let g=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(u),{features:y},Ps(f,this.options),c);u++;let C=g.id.toString();this.layers.set(f.id||C,g.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let a=this.obstructions.features.filter(M=>M.geometry.type==="Polygon"&&M.properties.kind==="object"),p=Jm(a,this.styleMap),c=this.renderer.addGroupContainer("objects-".concat(this.id),{},this.id),u=0;for(let[M,v]of p){let S=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(u),{features:v},Ps(M,this.options),c);u++;let E=S.id.toString();this.layers.set(M.id||E,E)}let f=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!1),y=this.obstructions.features.filter(M=>M.geometry.type==="LineString"&&M.properties.kind==="Wall"&&M.properties.footprintComponent===!0),g=this.entrances,C=C4,x=C4;if(f!=null&&f.length>0){let M=this.styleMap[(t=f[0].properties)==null?void 0:t.id];M!=null&&(C={...M}),x=C;let{walls:v,entrances:S}=zm(f,(g==null?void 0:g.features)||[]),E=Math.max(C.height-.11,x4),w={...S4,height:E},T=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),S,w,this.id);this.layers.set(ho,T.id.toString());let D=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[v]},Ps(C,this.options),this.id);this.layers.set(Ci,D.id.toString())}if(y!=null&&y.length>0){let M=this.styleMap[(e=y[0].properties)==null?void 0:e.id];M!=null&&(x={...M,id:vr});let{walls:v,entrances:S}=zm(y,(g==null?void 0:g.features)||[]),E=Math.max(x.height-.11,x4),w={...S4,height:E},T=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),S,w,this.id);this.layers.set(mo,T.id.toString());let D=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[v]},Ps(x,this.options),this.id);this.layers.set(vr,D.id.toString())}}if(((i=this.mvf.floorImages)==null?void 0:i[this.id])!=null){let a=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let p of((n=this.mvf.floorImages[this.id])==null?void 0:n.features)||[])"anchorId"in p.properties||"anchorId"in p.properties&&((o=p.properties)==null?void 0:o.anchorId)==null||this.renderer.addImage(q(),p,{url:p.properties.path,flipImageToFaceCamera:!0},a);this.layers.set(a.id.toString(),a.id.toString())}return this.renderer.render(),this},"load"));this.id=e.id,this.options=n,this.mvf=o;let p=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=p.id.toString(),this.name=e.externalId,this.elevation=e.elevation,o!=null&&a!=null&&(this.styleMap=a,this.spaces=o.space[this.id],this.entrances=o.entrance[this.id],this.obstructions=o.obstruction[this.id]),this.renderer=i}};s(sf,"FloorObject");var vp=sf;m();m();m();m();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();m();m();m();m();function M4(r){return Jl(r)}s(M4,"getBoundingBoxFromFeature");m();var bp="#ffffff";var lf=class lf{constructor(t={}){h(this,"initialColor",bp);h(this,"color",bp);h(this,"topColor");h(this,"topTexture");h(this,"texture");h(this,"hoverColor");h(this,"dirty",!0);h(this,"visible",!0);h(this,"opacity",1);h(this,"width",.1);h(this,"height",.1);h(this,"initialHeight",.1);h(this,"altitude",0);h(this,"join","round");h(this,"cap","round");h(this,"outline",!0);h(this,"showImage",!0);h(this,"flipImageToFaceCamera",!0);h(this,"url");this.color=(t==null?void 0:t.color)!==void 0?t.color:this.color,this.initialColor=this.color,this.width=(t==null?void 0:t.width)!==void 0?t.width:this.width,this.opacity=(t==null?void 0:t.opacity)!==void 0?t.opacity:this.opacity,this.visible=(t==null?void 0:t.visible)!==void 0?t.visible:this.visible,this.height=(t==null?void 0:t.height)!==void 0?t.height:this.height,this.initialHeight=this.height,this.altitude=(t==null?void 0:t.altitude)!==void 0?t.altitude:this.altitude,this.join=(t==null?void 0:t.join)!==void 0?t.join:this.join,this.cap=(t==null?void 0:t.cap)!==void 0?t.cap:this.cap,this.topColor=t==null?void 0:t.topColor,this.texture=t==null?void 0:t.texture,this.topTexture=t==null?void 0:t.topTexture,this.outline=(t==null?void 0:t.outline)!==void 0?!!t.outline:this.outline,this.showImage=(t==null?void 0:t.showImage)!==void 0?t.showImage:this.showImage,this.flipImageToFaceCamera=(t==null?void 0:t.flipImageToFaceCamera)!==void 0?t.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=t==null?void 0:t.url}};s(lf,"StyleComponent");var zt=lf;var cf=class cf extends Yn{constructor(){super(...arguments);h(this,"userData",{entities:{}})}};s(cf,"EntityBatchedMesh");var Tr=cf,Es,Ds,Sn,pf=class pf{constructor(t){h(this,"mesh");h(this,"focusMesh");h(this,"outline");h(this,"imageMesh");h(this,"type","geometry");h(this,"dirty",!0);h(this,"detached",!1);h(this,"instanceIndex",-1);h(this,"geometry");h(this,"material");h(this,"feature");h(this,"currentHeight",.1);h(this,"focusable",!1);h(this,"color",new be);h(this,"topColor",new be);h(this,"position",new W);P(this,Es,0);P(this,Ds,1);P(this,Sn,void 0);h(this,"texturesVisible",!1);this.feature=t}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(t){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,t),this.imageMesh&&(this.imageMesh.visible=t)}setOpacity(t){this.mesh&&(this.material&&(this.material.opacity=t,this.material.transparent=t<1),this.outline&&(this.outline.material.opacity=t),t===0?this.mesh.visible=!1:this.mesh.visible=!0)}setColor(t,e){this.color.set(t),this.topColor.set(e),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var t;return(t=this.material)==null?void 0:t.getColor(this.instanceIndex)}get altitude(){return l(this,Es)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,Es,t))}get opacity(){return l(this,Ds)}set opacity(t){this.material&&(this.material.opacity=t,this.material.transparent=t<1,this.outline&&(this.outline.material.opacity=t),this.material.needsUpdate=!0),I(this,Ds,t)}get texture(){var t,e;return(e=(t=this.material)==null?void 0:t.texture)==null?void 0:e.image.src}set texture(t){this.material&&(this.material.texture=t)}get textureInstance(){var t;return(t=this.material)==null?void 0:t.texture}set topTexture(t){this.material&&(this.material.topTexture=t)}get topTexture(){var t,e;return(e=(t=this.material)==null?void 0:t.topTexture)==null?void 0:e.image.src}get topTextureInstance(){var t;return(t=this.material)==null?void 0:t.topTexture}get featureBbox(){return l(this,Sn)?l(this,Sn):(I(this,Sn,M4(this.feature)),l(this,Sn))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Es=new WeakMap,Ds=new WeakMap,Sn=new WeakMap,s(pf,"MeshComponent");var ge=pf;m();var px="#ffffff",Ei,uf=class uf{constructor(t={}){h(this,"color",px);h(this,"topColor");h(this,"opacity",1);P(this,Ei,void 0);h(this,"outline",!0);h(this,"texture");h(this,"topTexture");h(this,"dirty",!0);var e,i;this.color=(e=t==null?void 0:t.color)!=null?e:this.color,this.topColor=t==null?void 0:t.topColor,this.opacity=(i=t==null?void 0:t.opacity)!=null?i:this.opacity,this.shading=t==null?void 0:t.shading,this.outline=(t==null?void 0:t.outline)!==void 0?!!t.outline:this.outline}get shading(){return l(this,Ei)}set shading(t){var e;if(!t){I(this,Ei,void 0);return}I(this,Ei,(e=l(this,Ei))!=null?e:{start:0,end:0,intensity:0}),Object.assign(l(this,Ei),t)}};Ei=new WeakMap,s(uf,"GeometryGroupStyleComponent");var xn=uf;m();m();function Di(r){var e;let t=(e=r.parent)==null?void 0:e.children.find(i=>i.userData.outlineOfEntityId===r.userData.entityId);return t instanceof Yi?t:void 0}s(Di,"findOutline");m();m();m();m();var hf=class hf{constructor(){h(this,"hover",!1);h(this,"dirty",!1)}};s(hf,"InteractionComponent");var Go=hf;m();m();var P4=["","","low","medium","high","always-visible"];function T4(r){return Math.min(5,Math.max(2,r))}s(T4,"clampTierNumber");function Vo(r){if(typeof r=="number")return T4(r);let t=P4.indexOf(r);return t===-1?3:t}s(Vo,"convertCollisionRankingTierToNumber");function Ls(r){let t=T4(r);return P4[t]}s(Ls,"convertNumberToCollisionRankingTier");var df=R.object({rank:R.union([R.enum(["low","medium","high","always-visible"]),R.number()]).optional(),interactive:R.boolean().optional(),id:R.string().optional(),anchor:R.enum(["top","bottom","left","right","center"]).optional(),dynamicResize:R.boolean().optional()});function I4(r,t,e){R.array(R.number()).length(2).parse(r),R.string().parse(t),df.parse(e)}s(I4,"validateMarker");var Mn=class Mn{constructor(t,e={}){h(this,"id");h(this,"type","marker");h(this,"rank",0);h(this,"initialRank",0);h(this,"options",{});h(this,"projection",new z);h(this,"enabled",!0);h(this,"activeStrategyIndex",-1);h(this,"strategyIndex",-1);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"containerEl");h(this,"contentEl",null);h(this,"contentHtml","");h(this,"style",{top:"0px",left:"0px"});h(this,"dirty",!1);h(this,"collisionDirty",!0);h(this,"visibilityNeedsUpdate",!0);h(this,"visible",!1);h(this,"animation",null);h(this,"currentStrategyIndex",-1);h(this,"onStrategySelected",s((t,e=!1)=>{if(this.currentStrategyIndex===t||e)return;let{width:i,height:n}=this.dimensions,o=-n/2+"px",a=-i/2+"px";switch(this.style.top=o,this.style.left=a,this.options.anchor){case"top":{this.style.top=-n+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-i+"px";break}case"right":{this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));if(this.id=(e==null?void 0:e.id)||q(),this.options=e,typeof e.rank=="string")this.rank=Vo(e.rank);else if(e.rank!=null&&e.rank>0)this.rank=e.rank;else{let n=Math.trunc(b.env.NODE_ENV==="test"?Mn.testId:Mn.testId*10)/10;Mn.testId+=.001,this.rank=n}this.contentHtml=t,this.initialRank=this.rank;let i=document.createElement("div");i.style.opacity="0",i.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=i.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(t,e){if(t!=null&&e!=null)this.dimensions={width:t,height:e};else{let{width:i,height:n}=this.containerEl.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"})}get strategies(){let{width:t,height:e}=this.dimensions;return[{name:"center",getBoundingBox:()=>{let i=e/2,n=e/2,o=t/2,a=t/2;switch(this.options.anchor){case"top":{i=e,n=0;break}case"bottom":{i=0,n=e;break}case"left":{o=t,a=0;break}case"right":{o=0,a=t;break}}return[i,n,o,a]}}]}toJSON(){return{x:this.projection.x,y:this.projection.y,enabled:this.enabled,id:this.id,rank:this.rank,bboxes:this.strategies.map((t,e)=>({index:e,boundingBox:t.getBoundingBox()})),shouldCollideWithScreenEdges:!1}}destroy(){}};s(Mn,"MarkerComponent"),h(Mn,"testId",0);var Ot=Mn;m();m();var mf=class mf extends Rt{};s(mf,"Geometry2DObject3D");var Ho=mf,ff=class ff{constructor(t,e){h(this,"id");h(this,"positionDirty",!0);h(this,"object3d",new Ho);h(this,"components");h(this,"disposed",!1);h(this,"worldPosition",new W);this.id=t.id||q(),this.components=[t],this.object3d=new Ho,this.object3d.position.copy(e),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parent(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}};s(ff,"Geometry2D");var _t=ff;m();var yf=class yf extends Rt{constructor(){super(...arguments);h(this,"userData",{entityId:"",type:"geometry"})}};s(yf,"Geometry3DObject3D");var At=yf,gf=class gf{constructor(t,e){h(this,"id",q());h(this,"components");this.components=[t,e]}get object3d(){return this.components[0].mesh}get parent(){var t;return(t=this.components[0].mesh)==null?void 0:t.parent}get type(){return this.components[0].type}};s(gf,"Geometry3D");var he=gf;var Xo={};Sy(Xo,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>ux,CLIPPING_RADIUS:()=>Os,CONTROL_OPTIONS:()=>Sp,DEFAULT_BEARING:()=>yx,DEFAULT_MAX_ZOOM_LEVEL:()=>mx,DEFAULT_MIN_ZOOM_LEVEL:()=>Sf,DEFAULT_PITCH:()=>fx,DEFAULT_ZOOM_LEVEL:()=>dx,EARTH_RADIUS_M:()=>Ir,EVENTS:()=>Tp,MAPLIBRE_TILE_SIZE:()=>Cp,MAX_LAT:()=>bf,MAX_MERCATOR_ZOOM_LEVEL:()=>Pp,MIN_LAT:()=>vf,MIN_MERCATOR_ZOOM_LEVEL:()=>Mp,ROOM_MERCATOR_ZOOM_LEVEL:()=>hx,TWO_PI:()=>xp,WHEEL_ZOOM_MULTIPLIER:()=>Cf,ZRANGE:()=>jo});m();var Cp=512,Ir=63710088e-1,vf=-85.051129,bf=85.051129,Os=1e4,Sp={chain:"chain",cancel:"cancel"},xp=Math.PI*2,jo=100,Cf=1e4,Mp=0,Pp=22,ux=17,hx=20,Tp=["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"],dx=18,Sf=12,mx=22,fx=0,yx=0;m();var _s="mappedin";m();function xf(r){let t=r.min,e=r.max,i=new W(t.x,t.y,t.z),n=new W(e.x,t.y,t.z),o=new W(t.x,e.y,t.z),a=new W(e.x,e.y,t.z);return[i,n,o,a]}s(xf,"getCornersOfBoundingBox");m();function Li(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}s(Li,"getPixelRatio");m();function Oi(r,t,e=!1){let i=null,n=0;return function(...o){n++,n===1&&e===!0&&r(...o);let a=s(()=>{(!e||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,t)}}s(Oi,"debounce");m();var gx=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:t,platform:e,maxTouchPoints:i}=window.navigator,n=/(iphone|ipod|ipad)/i.test(t),o=e==="iPad"||e.indexOf("Mac")===0&&i>0&&!window.MSStream,a=/android/i.test(t);return r={isIpad:o,isMobile:a||n||o,isSafari12:/Version\/12.+Safari/.test(t),isFirefox:/Firefox/.test(t),isWindows:/windows/i.test(t)},r},_reset(){r=void 0}}})(),w4=gx.getDeviceType,E4=(()=>{let r,t,e;function i(){if(t!==void 0)return t;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return t;try{let a=w4().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return t=a?o.getParameter(a.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),t}catch{let p=new Error("Failed getting device info");throw p.name="FailedGettingDeviceInfo",p}}s(i,"getInfo");function n(){var a,p;if(!w4().isWindows)return!1;if(e!==void 0)return e;let o=(p=(a=vx())==null?void 0:a.toLowerCase())!=null?p:"";return e=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),e}return s(n,"shouldDisableOffscreenCanvas"),{getInfo:i,shouldDisableOffscreenCanvas:n,_setCanvas(o){r=o,t=void 0,e=void 0}}})(),vx=E4.getInfo,Mf=E4.shouldDisableOffscreenCanvas;m();m();var Pf=s(r=>t=>{if(!t.includes("mappedin")){let e={};for(let i in r){let n=r[i];t.includes("mappedin")||(r[i]=n)}return{url:t,headers:e}}return{url:t,headers:r}},"transformRequest");function wp(r,t,e,i){let n=r*(Math.PI/180),o=i/Ir,a=r+o*180/Math.PI,p=e/Ir/Math.cos(n),c=t+p*180/Math.PI;return{lat:a,lon:c}}s(wp,"cartesianToGeographic");function Ep(r,t,e,i){let n=e*(Math.PI/180),o=i*(Math.PI/180),a=r*(Math.PI/180),p=t*(Math.PI/180),c=n-a,u=o-p,f=Ir*u*Math.cos(a),y=Ir*c;return{x:f,y}}s(Ep,"geographicToCartesian");var Tf=s((r,t)=>{var e;if(r.children&&r.visible)for(let i of r.children){if(i.visible)if((e=i.userData)!=null&&e.entities3D&&i.type==="geometry-group"){t.add(i.userData.entityId);for(let n of i.userData.entities3D.values())t.add(n)}else(i.type==="group-container"||i.type==="custom-geometry"||i instanceof At)&&t.add(i.userData.entityId);Tf(i,t)}return t},"populateGeometry3DIdsInScene"),If=s((r,t)=>{var e;if(r.children&&r.visible&&!((e=r.userData)!=null&&e.hidden))for(let i of r.children)i.visible&&i instanceof Ho&&t.add(i.userData.entityId),If(i,t);return t},"populateGeometry2DIdsInScene");function wf(r,t){for(let e in t){if(t[e]==null){r[e]=void 0;continue}typeof t[e]=="object"?wf(r[e],t[e]):r[e]=t[e]}return r}s(wf,"mergeObjects");function Dp(r,t,e,i){let n={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new Gr,a=new W(n.scale,-n.scale,n.scale),p=new Gr().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(a),c=e.elevation;return{id:_s,type:"custom",renderingMode:"3d",render:(u,f)=>{if(o.fromArray(f),c!==e.elevation){let y=Wl.fromLngLat(r.toLngLat(),e.elevation);p.makeTranslation(n.translateX,n.translateY,-y.z).scale(a)}t.projectionMatrix=o.multiply(p),c=e.elevation,i()}}}s(Dp,"createCustomLayer");function bx(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}s(bx,"fetchToken");async function D4(r){let t=await bx(r),{access_token:e}=await t.json();return{"x-mappedin-tiles-key":e}}s(D4,"getRequestHeaders");function L4(r,t=0){let e=3735928559^t,i=1103547991^t;for(let n=0,o;n<r.length;n++)o=r.charCodeAt(n),e=Math.imul(e^o,2654435761),i=Math.imul(i^o,1597334677);return e=Math.imul(e^e>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),4294967296*(2097151&i)+(e>>>0)}s(L4,"cyrb53");var Cx=s(r=>r,"linearEase");function qt(r,t,e,i,n,o=Cx){r=Math.max(t,Math.min(r,e));let a=(r-Math.min(t,e))/Math.abs(e-t),p=o(a);return i+p*(n-i)}s(qt,"interpolate");function Ef(r,t,e){let i=r*(Math.PI/180)/2,n=t/2;return e*Math.tan(i)/n}s(Ef,"getProjectionScaleFactor");function As(r,t){let e;return typeof t=="string"||typeof t=="number"?(e=r.geometry2DMap.get(t),e==null&&(e=r.geometry3DMap.get(t))):typeof(t==null?void 0:t.id)=="string"||typeof(t==null?void 0:t.id)=="number"?(e=r.geometry2DMap.get(t.id),e==null&&(e=r.geometry3DMap.get(t.id))):e=t,e}s(As,"getGeometryByGeometryId");function O4(r){return new Wy(new Hu(r[0][0],r[0][1]),new Hu(r[1][0],r[1][1])).getCenter().toArray()}s(O4,"getBoundingBoxCenter");function Ip(r){return r*(Math.PI/180)}s(Ip,"toRadians");function _4(r,t){let e=Ip(t[1]-r[1]),i=Ip(t[0]-r[0]),n=Ip(r[1]),o=Ip(t[1]),a=Math.sin(e/2)*Math.sin(e/2)+Math.sin(i/2)*Math.sin(i/2)*Math.cos(n)*Math.cos(o),p=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return Ir*p}s(_4,"haversineDistance");function A4(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof Xy||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}s(A4,"isFiniteBox");m();m();function Lp(r){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lp(r)}s(Lp,"_typeof");var Sx=/^\s+/,xx=/\s+$/;function G(r,t){if(r=r||"",t=t||{},r instanceof G)return r;if(!(this instanceof G))return new G(r,t);var e=Mx(r);this._originalInput=r,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||e.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}s(G,"tinycolor");G.prototype={isDark:s(function(){return this.getBrightness()<128},"isDark"),isLight:s(function(){return!this.isDark()},"isLight"),isValid:s(function(){return this._ok},"isValid"),getOriginalInput:s(function(){return this._originalInput},"getOriginalInput"),getFormat:s(function(){return this._format},"getFormat"),getAlpha:s(function(){return this._a},"getAlpha"),getBrightness:s(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:s(function(){var t=this.toRgb(),e,i,n,o,a,p;return e=t.r/255,i=t.g/255,n=t.b/255,e<=.03928?o=e/12.92:o=Math.pow((e+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?p=n/12.92:p=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*p},"getLuminance"),setAlpha:s(function(t){return this._a=V4(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:s(function(){var t=B4(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:s(function(){var t=B4(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHsvString"),toHsl:s(function(){var t=k4(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:s(function(){var t=k4(this._r,this._g,this._b),e=Math.round(t.h*360),i=Math.round(t.s*100),n=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHslString"),toHex:s(function(t){return R4(this._r,this._g,this._b,t)},"toHex"),toHexString:s(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:s(function(t){return wx(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:s(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:s(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:s(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:s(function(){return{r:Math.round(Pe(this._r,255)*100)+"%",g:Math.round(Pe(this._g,255)*100)+"%",b:Math.round(Pe(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:s(function(){return this._a==1?"rgb("+Math.round(Pe(this._r,255)*100)+"%, "+Math.round(Pe(this._g,255)*100)+"%, "+Math.round(Pe(this._b,255)*100)+"%)":"rgba("+Math.round(Pe(this._r,255)*100)+"%, "+Math.round(Pe(this._g,255)*100)+"%, "+Math.round(Pe(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:s(function(){return this._a===0?"transparent":this._a<1?!1:Gx[R4(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:s(function(t){var e="#"+F4(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var o=G(t);i="#"+F4(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},"toFilter"),toString:s(function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!e&&n&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(i=this.toRgbString()),t==="prgb"&&(i=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(i=this.toHexString()),t==="hex3"&&(i=this.toHexString(!0)),t==="hex4"&&(i=this.toHex8String(!0)),t==="hex8"&&(i=this.toHex8String()),t==="name"&&(i=this.toName()),t==="hsl"&&(i=this.toHslString()),t==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},"toString"),clone:s(function(){return G(this.toString())},"clone"),_applyModification:s(function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},"_applyModification"),lighten:s(function(){return this._applyModification(Ox,arguments)},"lighten"),brighten:s(function(){return this._applyModification(_x,arguments)},"brighten"),darken:s(function(){return this._applyModification(Ax,arguments)},"darken"),desaturate:s(function(){return this._applyModification(Ex,arguments)},"desaturate"),saturate:s(function(){return this._applyModification(Dx,arguments)},"saturate"),greyscale:s(function(){return this._applyModification(Lx,arguments)},"greyscale"),spin:s(function(){return this._applyModification(kx,arguments)},"spin"),_applyCombination:s(function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},"_applyCombination"),analogous:s(function(){return this._applyCombination(Fx,arguments)},"analogous"),complement:s(function(){return this._applyCombination(Bx,arguments)},"complement"),monochromatic:s(function(){return this._applyCombination(Nx,arguments)},"monochromatic"),splitcomplement:s(function(){return this._applyCombination(Rx,arguments)},"splitcomplement"),triad:s(function(){return this._applyCombination(N4,[3])},"triad"),tetrad:s(function(){return this._applyCombination(N4,[4])},"tetrad")};G.fromRatio=function(r,t){if(Lp(r)=="object"){var e={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?e[i]=r[i]:e[i]=ks(r[i]));r=e}return G(r,t)};function Mx(r){var t={r:0,g:0,b:0},e=1,i=null,n=null,o=null,a=!1,p=!1;return typeof r=="string"&&(r=Xx(r)),Lp(r)=="object"&&(ti(r.r)&&ti(r.g)&&ti(r.b)?(t=Px(r.r,r.g,r.b),a=!0,p=String(r.r).substr(-1)==="%"?"prgb":"rgb"):ti(r.h)&&ti(r.s)&&ti(r.v)?(i=ks(r.s),n=ks(r.v),t=Ix(r.h,i,n),a=!0,p="hsv"):ti(r.h)&&ti(r.s)&&ti(r.l)&&(i=ks(r.s),o=ks(r.l),t=Tx(r.h,i,o),a=!0,p="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=V4(e),{ok:a,format:r.format||p,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}s(Mx,"inputToRGB");function Px(r,t,e){return{r:Pe(r,255)*255,g:Pe(t,255)*255,b:Pe(e,255)*255}}s(Px,"rgbToRgb");function k4(r,t,e){r=Pe(r,255),t=Pe(t,255),e=Pe(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,p=(i+n)/2;if(i==n)o=a=0;else{var c=i-n;switch(a=p>.5?c/(2-i-n):c/(i+n),i){case r:o=(t-e)/c+(t<e?6:0);break;case t:o=(e-r)/c+2;break;case e:o=(r-t)/c+4;break}o/=6}return{h:o,s:a,l:p}}s(k4,"rgbToHsl");function Tx(r,t,e){var i,n,o;r=Pe(r,360),t=Pe(t,100),e=Pe(e,100);function a(u,f,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?u+(f-u)*6*y:y<1/2?f:y<2/3?u+(f-u)*(2/3-y)*6:u}if(s(a,"hue2rgb"),t===0)i=n=o=e;else{var p=e<.5?e*(1+t):e+t-e*t,c=2*e-p;i=a(c,p,r+1/3),n=a(c,p,r),o=a(c,p,r-1/3)}return{r:i*255,g:n*255,b:o*255}}s(Tx,"hslToRgb");function B4(r,t,e){r=Pe(r,255),t=Pe(t,255),e=Pe(e,255);var i=Math.max(r,t,e),n=Math.min(r,t,e),o,a,p=i,c=i-n;if(a=i===0?0:c/i,i==n)o=0;else{switch(i){case r:o=(t-e)/c+(t<e?6:0);break;case t:o=(e-r)/c+2;break;case e:o=(r-t)/c+4;break}o/=6}return{h:o,s:a,v:p}}s(B4,"rgbToHsv");function Ix(r,t,e){r=Pe(r,360)*6,t=Pe(t,100),e=Pe(e,100);var i=Math.floor(r),n=r-i,o=e*(1-t),a=e*(1-n*t),p=e*(1-(1-n)*t),c=i%6,u=[e,a,o,o,p,e][c],f=[p,e,e,a,o,o][c],y=[o,o,p,e,e,a][c];return{r:u*255,g:f*255,b:y*255}}s(Ix,"hsvToRgb");function R4(r,t,e,i){var n=[Jt(Math.round(r).toString(16)),Jt(Math.round(t).toString(16)),Jt(Math.round(e).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}s(R4,"rgbToHex");function wx(r,t,e,i,n){var o=[Jt(Math.round(r).toString(16)),Jt(Math.round(t).toString(16)),Jt(Math.round(e).toString(16)),Jt(H4(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}s(wx,"rgbaToHex");function F4(r,t,e,i){var n=[Jt(H4(i)),Jt(Math.round(r).toString(16)),Jt(Math.round(t).toString(16)),Jt(Math.round(e).toString(16))];return n.join("")}s(F4,"rgbaToArgbHex");G.equals=function(r,t){return!r||!t?!1:G(r).toRgbString()==G(t).toRgbString()};G.random=function(){return G.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Ex(r,t){t=t===0?0:t||10;var e=G(r).toHsl();return e.s-=t/100,e.s=Op(e.s),G(e)}s(Ex,"_desaturate");function Dx(r,t){t=t===0?0:t||10;var e=G(r).toHsl();return e.s+=t/100,e.s=Op(e.s),G(e)}s(Dx,"_saturate");function Lx(r){return G(r).desaturate(100)}s(Lx,"_greyscale");function Ox(r,t){t=t===0?0:t||10;var e=G(r).toHsl();return e.l+=t/100,e.l=Op(e.l),G(e)}s(Ox,"_lighten");function _x(r,t){t=t===0?0:t||10;var e=G(r).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),G(e)}s(_x,"_brighten");function Ax(r,t){t=t===0?0:t||10;var e=G(r).toHsl();return e.l-=t/100,e.l=Op(e.l),G(e)}s(Ax,"_darken");function kx(r,t){var e=G(r).toHsl(),i=(e.h+t)%360;return e.h=i<0?360+i:i,G(e)}s(kx,"_spin");function Bx(r){var t=G(r).toHsl();return t.h=(t.h+180)%360,G(t)}s(Bx,"_complement");function N4(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=G(r).toHsl(),i=[G(r)],n=360/t,o=1;o<t;o++)i.push(G({h:(e.h+o*n)%360,s:e.s,l:e.l}));return i}s(N4,"polyad");function Rx(r){var t=G(r).toHsl(),e=t.h;return[G(r),G({h:(e+72)%360,s:t.s,l:t.l}),G({h:(e+216)%360,s:t.s,l:t.l})]}s(Rx,"_splitcomplement");function Fx(r,t,e){t=t||6,e=e||30;var i=G(r).toHsl(),n=360/e,o=[G(r)];for(i.h=(i.h-(n*t>>1)+720)%360;--t;)i.h=(i.h+n)%360,o.push(G(i));return o}s(Fx,"_analogous");function Nx(r,t){t=t||6;for(var e=G(r).toHsv(),i=e.h,n=e.s,o=e.v,a=[],p=1/t;t--;)a.push(G({h:i,s:n,v:o})),o=(o+p)%1;return a}s(Nx,"_monochromatic");G.mix=function(r,t,e){e=e===0?0:e||50;var i=G(r).toRgb(),n=G(t).toRgb(),o=e/100,a={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return G(a)};G.readability=function(r,t){var e=G(r),i=G(t);return(Math.max(e.getLuminance(),i.getLuminance())+.05)/(Math.min(e.getLuminance(),i.getLuminance())+.05)};G.isReadable=function(r,t,e){var i=G.readability(r,t),n,o;switch(o=!1,n=Wx(e),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o};G.mostReadable=function(r,t,e){var i=null,n=0,o,a,p,c;e=e||{},a=e.includeFallbackColors,p=e.level,c=e.size;for(var u=0;u<t.length;u++)o=G.readability(r,t[u]),o>n&&(n=o,i=G(t[u]));return G.isReadable(r,i,{level:p,size:c})||!a?i:(e.includeFallbackColors=!1,G.mostReadable(r,["#fff","#000"],e))};var Df=G.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Gx=G.hexNames=Vx(Df);function Vx(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}s(Vx,"flip");function V4(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}s(V4,"boundAlpha");function Pe(r,t){Hx(r)&&(r="100%");var e=jx(r);return r=Math.min(t,Math.max(0,parseFloat(r))),e&&(r=parseInt(r*t,10)/100),Math.abs(r-t)<1e-6?1:r%t/parseFloat(t)}s(Pe,"bound01");function Op(r){return Math.min(1,Math.max(0,r))}s(Op,"clamp01");function Pt(r){return parseInt(r,16)}s(Pt,"parseIntFromHex");function Hx(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}s(Hx,"isOnePointZero");function jx(r){return typeof r=="string"&&r.indexOf("%")!=-1}s(jx,"isPercentage");function Jt(r){return r.length==1?"0"+r:""+r}s(Jt,"pad2");function ks(r){return r<=1&&(r=r*100+"%"),r}s(ks,"convertToPercentage");function H4(r){return Math.round(parseFloat(r)*255).toString(16)}s(H4,"convertDecimalToHex");function G4(r){return Pt(r)/255}s(G4,"convertHexToDecimal");var $t=function(){var r="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",e="(?:"+t+")|(?:"+r+")",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ti(r){return!!$t.CSS_UNIT.exec(r)}s(ti,"isValidCSSUnit");function Xx(r){r=r.replace(Sx,"").replace(xx,"").toLowerCase();var t=!1;if(Df[r])r=Df[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=$t.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=$t.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=$t.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=$t.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=$t.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=$t.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=$t.hex8.exec(r))?{r:Pt(e[1]),g:Pt(e[2]),b:Pt(e[3]),a:G4(e[4]),format:t?"name":"hex8"}:(e=$t.hex6.exec(r))?{r:Pt(e[1]),g:Pt(e[2]),b:Pt(e[3]),format:t?"name":"hex"}:(e=$t.hex4.exec(r))?{r:Pt(e[1]+""+e[1]),g:Pt(e[2]+""+e[2]),b:Pt(e[3]+""+e[3]),a:G4(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=$t.hex3.exec(r))?{r:Pt(e[1]+""+e[1]),g:Pt(e[2]+""+e[2]),b:Pt(e[3]+""+e[3]),format:t?"name":"hex"}:!1}s(Xx,"stringInputToObject");function Wx(r){var t,e;return r=r||{level:"AA",size:"small"},t=(r.level||"AA").toUpperCase(),e=(r.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:t,size:e}}s(Wx,"validateWCAG2Parms");var Lf=ar(xy());var _f=R.object({rank:R.union([R.enum(["low","medium","high","always-visible"]),R.number()]).optional(),interactive:R.boolean().optional(),appearance:R.object({margin:R.number().min(6).optional(),text:R.object({numLines:R.number().optional(),lineHeight:R.number().optional(),size:R.number().optional(),maxWidth:R.number().optional(),foregroundColor:R.string().optional(),backgroundColor:R.string().optional()}).optional(),marker:R.object({size:R.number().optional(),foregroundColor:R.object({active:R.string().optional(),inactive:R.string().optional()}).optional(),backgroundColor:R.object({active:R.string().optional(),inactive:R.string().optional()}).optional()}).optional()}).optional()});function U4(r,t,e){R.array(R.number()).length(2).parse(r),R.string().parse(t),_f.parse(e||{})}s(U4,"validateLabel");var Wo={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},Ux={lightOnDark:{...Wo,text:{...Wo.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Wo.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Wo,text:{...Wo.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Wo.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},Yx="LOW_PRIORITY",j4=4,Zx=6,zx=20,qx=2.5,$x=2,Jx="cover",X4=.5,Kx=6.5,W4={heightAbovePolygon:0,appearance:Ux.darkOnLight};var Pn=class Pn{constructor(t,e,i){h(this,"lines",0);h(this,"id");h(this,"rank");h(this,"type","label");h(this,"initialRank");h(this,"contextConfigured",!1);h(this,"fillText");h(this,"newStyle",{});h(this,"opacity",0);h(this,"visibilityNeedsUpdate",!0);h(this,"activeStrategyIndex",-1);h(this,"text");h(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});h(this,"projection",new z);h(this,"_cache",{});h(this,"appearance");h(this,"options");h(this,"visible",!1);h(this,"enabled",!0);h(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});h(this,"dimensions",{width:0,height:0});h(this,"currentStrategyIndex",-1);h(this,"totalMarkerSize",0);h(this,"dirty",!0);h(this,"collisionDirty",!0);h(this,"lastTextAlign");h(this,"imageHash");h(this,"markerSize",0);h(this,"iconVisible",!1);h(this,"zoomProportion",0);h(this,"dp");h(this,"onStrategySelected",s(t=>{if(this.currentStrategyIndex===t)return;let e=this.strategies[t];e&&e.onStrategySelected(this),this.currentStrategyIndex=t;let i=this.style;this.style=this.newStyle,this.newStyle=i,this.iconVisible||(this.opacity=0,this.visibilityNeedsUpdate=!0)},"onStrategySelected"));var o,a;if(this.id=(o=e.id)!=null?o:q(),this.options=(0,Lf.default)({},e,W4),this.text=t,this.dp=(p=1)=>p*i.pixelRatio,typeof e.rank=="string")this.rank=Vo(e.rank),this.initialRank=this.rank;else if(e.rank!=null&&e.rank>0)this.rank=e.rank,this.initialRank=e.rank;else{let p=Math.trunc(b.env.NODE_ENV==="test"?Pn.testId:Pn.testId*10)/10;Pn.testId+=.001,this.rank=p,this.initialRank=p}let n=(0,Lf.default)({},this.options.appearance,W4.appearance);this.appearance={margin:n.margin,text:{lineHeight:n.text.lineHeight,numLines:n.text.numLines,size:n.text.size,maxWidth:n.text.maxWidth,foregroundColor:n.text.foregroundColor,backgroundColor:n.text.backgroundColor},marker:{foregroundColor:{active:n.marker.foregroundColor.active,inactive:n.marker.foregroundColor.inactive||G(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||G(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||zx,iconPadding:(a=n.marker.iconPadding)!=null?a:$x,iconFit:n.marker.iconFit||Jx,iconVisibilityThreshold:n.marker.iconVisibilityThreshold==null?X4:n.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:t=X4}=this.appearance.marker,e=this.dp();this.zoomProportion<=t&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(Kx)),this.totalMarkerSize=Math.ceil((this.markerSize+qx)/e)}get strategies(){let{width:t,height:e}=this.dimensions,{margin:i}=this.appearance;this.calculateMarkerSize();let n=Math.max(Zx,i),o=this.iconVisible?n/2:0,a=[{name:"RIGHT",getBoundingBox:()=>{let p=Math.max(this.totalMarkerSize,e);return[p/2+n,p/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+t+n]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=this.totalMarkerSize/2+j4,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let p=Math.max(this.totalMarkerSize,e);return[p/2+n,p/2+n,this.totalMarkerSize/2+t+n,this.totalMarkerSize/2+n]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=-t-this.totalMarkerSize/2-j4,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let p=this.dp();return[e+this.totalMarkerSize/2/p+n,this.totalMarkerSize/2+n,t/2+n,t/2+n]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-this.totalMarkerSize-e/2,this.newStyle.left=-t/2}},{name:Yx,getBoundingBox:()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:a}updatePosition(){}disable(){this.visible=!1}toJSON(){return{x:this.projection.x,y:this.projection.y,enabled:this.enabled,id:this.id,rank:this.rank,bboxes:this.strategies.map((t,e)=>({index:e,boundingBox:t.getBoundingBox()})),shouldCollideWithScreenEdges:!1}}destroy(){}};s(Pn,"LabelComponent"),h(Pn,"testId",0);var Of=Pn,wr=Of;function ft(r,t,e){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return t===!0?(r instanceof _t&&r.components[1]===void 0?(r.components[1]=new Go,r.components[1].dirty=!0):r instanceof he&&r.components[2]===void 0?(r.components[2]=new Go,r.components[2].dirty=!0):r instanceof Oe&&r.components[1]===void 0&&(r.components[1]=new Go,r.components[1].dirty=!0),!0):(r instanceof _t?r.components[1]=void 0:r instanceof he?r.components[2]=void 0:r instanceof Oe&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let i;for(let n of r.userData.entities3D.values())i=e.geometry3DMap.get(n),ft(i,t,e);return!0}}return!1}s(ft,"updateInteractivity");function Y4(r,t,e){if(!(!(e!=null&&e.color)&&!(e!=null&&e.topColor))){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let i,n,o=r.components[0];for(let a of r.userData.entities3D.values())i=t.geometry3DMap.get(a),i&&(n=i.components[1],n.color===o.color&&(n.initialColor=e.color||o.color,n.color=e.color||o.color,n.dirty=!0),n.topColor===o.topColor&&(n.topColor=e.topColor||o.topColor,n.dirty=!0));return e.color!==void 0&&(o.color=e.color,o.dirty=!0),e.topColor!==void 0&&(o.topColor=e.topColor,o.dirty=!0),!0}return!1}}s(Y4,"updateGroupColor");function Z4(r,t){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let e=r.components[0];return e.shading=e.shading||{},e.shading&&(t.start!==e.shading.start||t.end!==e.shading.end||t.intensity!==e.shading.intensity)&&(Object.assign(e.shading,t),r.userData.shadingDirty=!0),!0}return!1}s(Z4,"updateGroupShading");function z4(r,t){t!==void 0&&r.type==="geometry"&&(t.showImage!==void 0&&(r.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}s(z4,"updateImageProps");function q4(r,t){var e;if(t!==void 0&&r.type==="geometry"){let i=r.components[1];if(i.height!==t)return i.height=t,i.dirty=!0,((e=r.parent)==null?void 0:e.type)==="geometry-group"&&(r.parent.userData.outlineDirty=!0),!0}return!1}s(q4,"updateHeight");function $4(r,t){t!==void 0&&(r.type==="path"||r.type==="geometry")&&(t.initialColor!==void 0&&(r.components[1].initialColor=t.initialColor),t.color!==void 0&&(r.components[1].color=t.color),t.topColor!==void 0&&(r.components[1].topColor=t.topColor),r.components[1].dirty=!0)}s($4,"updateColor");function Af(r,t,e){t!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(e(t[1],t[0],t[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(e(t[1],t[0],t[2]||0)))}s(Af,"updatePosition");function kf(r,t){var e;return t!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parent!==t&&r.parent instanceof Oe?((e=r.parent)==null||e.removeEntity(r),t.addEntity(r),!0):!1}s(kf,"updateParent");function J4(r,t){t!==void 0&&(r.type==="marker"||r.type==="label")&&(r.components[0].enabled=t)}s(J4,"updateEnabled");function K4(r,t){if(t!==void 0&&r.type==="path"){let e=r.components[0];t.completeFraction!==void 0&&(e.completeFraction=t.completeFraction)}}s(K4,"updatePath");function Q4(r,t,e){if(t!==void 0&&r.type==="marker"){let i=r.components[0];if(t.contentHTML!==void 0)return i.containerEl.innerHTML=t.contentHTML,!0;if(t.options!=null){try{df.parse(t.options||{})}catch(n){return k.error(n),!1}return ft(r,t.options.interactive,e),e5(r,t.options.rank),!0}}return!1}s(Q4,"updateMarker");function e5(r,t){return t!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Vo(t),!0):!1}s(e5,"updateRank");function t5(r,t,e){var i,n,o,a,p;if(t!==void 0&&r.type==="label"){let c=r.components[0];t.text!==void 0&&(c.text=t.text,c.dirty=!0);try{_f.parse(t.options||{})}catch(u){k.error(u);return}((i=t.options)==null?void 0:i.appearance)!==void 0&&Object.keys((n=t.options)==null?void 0:n.appearance).length>0&&(wf(c.appearance,((o=t.options)==null?void 0:o.appearance)||{}),c.dirty=!0),ft(r,(a=t.options)==null?void 0:a.interactive,e),e5(r,(p=t.options)==null?void 0:p.rank)}}s(t5,"updateLabel");function r5(r,t){t!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=t,r.components[1].dirty=!0)}s(r5,"updateHoverColor");function Bf(r,t){t!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=t)}s(Bf,"updateFlipImageToFaceCamera");function Tn(r,t){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"){r.components[1].visible=t,r.components[1].dirty=!0;let e=r.parent;e instanceof Ne&&(e.userData.outlineDirty=!0)}else(r.type==="group-container"||r.type==="geometry-group")&&r.setVisible(t);return!0}return!1}s(Tn,"updateVisibility");function i5(r,t,e){if(e!==void 0&&r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=t.geometry3DMap.get(n),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.opacity===i.opacity&&(o.components[1].opacity=e,o.components[1].dirty=!0))}r.setOpacity(e),i.opacity=e}}s(i5,"updateOpacity");function n5(r,t){if(t!==void 0&&r.type==="geometry-group"){let e=r.components[0];(t==null?void 0:t.texture)!=null&&e.texture!==(t==null?void 0:t.texture)&&(e.texture=t.texture,e.dirty=!0),(t==null?void 0:t.topTexture)!=null&&e.topTexture!==(t==null?void 0:t.topTexture)&&(e.topTexture=t.topTexture,e.dirty=!0)}}s(n5,"updateGroupTexture");function o5(r,t){if(r.type==="geometry"){let e=!1,i=r.components[1];if((t==null?void 0:t.texture)!=null&&i.texture!==(t==null?void 0:t.texture)&&(i.texture=t.texture,e=!0),(t==null?void 0:t.topTexture)!=null&&i.topTexture!==(t==null?void 0:t.topTexture)&&(i.topTexture=t.topTexture,e=!0),e&&r.components[0]instanceof ge){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}s(o5,"updateIndividualGeometryTexture");function a5(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.opacity!==t){e.opacity=t;let i=r.components[0];i.detached===!1&&(i.detached=!0,i.dirty=!0),t===0?e.visible=!1:e.visible=!0,e.dirty=!0;let n=r.parent;return(n==null?void 0:n.type)==="geometry-group"&&(n.userData.outlineDirty=!0,n.userData.shadingDirty=!0),!0}}return!1}s(a5,"updateIndividualGeometryOpacity");function Rf(r,t){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=t,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==t)return r.setAltitude(t),!0}return!1}s(Rf,"updateAltitude");function Ff(r,t){if(t!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=t,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=t,r.components[1].dirty=!0;let e=r.parent;e instanceof Ne&&(e.userData.outlineDirty=!0)}return!0}return!1}s(Ff,"updateOutline");m();m();m();m();var Vf=class Vf extends By{constructor(e){let i=e,n=3,o=n*4;super(new Float32Array(e*o),n,e,Py,My);h(this,"_width");h(this,"_height");h(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(e,i,n){let o=this.image.data,a=e*this._width;o[a]=i.r,o[a+1]=i.g,o[a+2]=i.b,o[a+3]=0,o[a+4]=n.r,o[a+5]=n.g,o[a+6]=n.b,o[a+7]=0,this.needsUpdate=!0}getColor(e){let i=this.image.data,n=e*this._width,o=new be(i[n],i[n+1],i[n+2]),a=new be(i[n+4],i[n+5],i[n+6]);return{color:o,topColor:a}}setTexture(e,i,n){let o=this.image.data,a=e*this._width;o[a+8]=i?1:0,o[a+9]=n?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};s(Vf,"BatchedPropertiesTexture");var _p=Vf;var s5="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var l5="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}\n";var tM=-.05,rM=1,Hf=class Hf extends ur{constructor(e,i,n=1){super(e);h(this,"propertiesTexture");h(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});h(this,"showTextures",s(e=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,i,n),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new _p(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,p=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,f=this.uniforms.uTexture,y=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=s5,o.fragmentShader=l5,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:p,uGradientStart:c,uMinSideAlpha:{value:tM},uMaxSideAlpha:{value:rM},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:f,uRepeatYFactor:y})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(e){e!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=e,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(e){e.wrapS=sr,e.wrapT=sr,e.colorSpace=Fr,this.uniforms.uTexture.value=e}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(e){e.wrapS=sr,e.wrapT=sr,e.colorSpace=Fr,this.uniforms.uTopTexture.value=e}setGradientShading(e,i,n){this.uniforms.uGradientStart.value=e,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(e,i,n){this.propertiesTexture.setColor(e,i,n)}getColor(e){return this.propertiesTexture.getColor(e)}hideTextures(e){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(e,!1,!1),this.needsUpdate=!0)}removeSideTexture(e){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(e,!1,i),this.needsUpdate=!0}}removeTopTexture(e){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(e,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};s(Hf,"BatchedStandardMaterial");var Uo=Hf;var oM=80;function c5(r,t){var p,c;let e=0;for(let u of r)e+=((c=(p=u.components[0])==null?void 0:p.geometry)==null?void 0:c.attributes.position.count)||0;let i=new be(t.color),n=new Uo({color:i,side:Rr,opacity:t.opacity||1,transparent:t.opacity!==void 0?t.opacity<1:!1},r.length),o=new Tr(r.length,e,0,n),a;for(let u of r)a=u.components[0],!(!(a instanceof ge)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=u.id,n.setColor(a.instanceIndex,i,t.topColor?new be(t.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}s(c5,"batchGeometries");function jf(r,t){t.polygonOffset=!0,t.polygonOffsetFactor=1,t.polygonOffsetUnits=1;let e=new Fy(r,oM),i=Xf(t.color.getHexString()),n=new Hl({linewidth:2,color:i,transparent:!0}),o=new Yi(e,n);return o.layers.set(1),o}s(jf,"createOutlines");function Xf(r){return G(r).darken(30).toRgbString()}s(Xf,"darkenColorForOutline");m();function p5(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}s(p5,"scrubMaterial");function We(r){for(let t=r.children.length-1;t>=0;t--)We(r.children[t]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(t){p5(t)}):"material"in r&&typeof r.material<"u"&&p5(r.material)}s(We,"destroyObject3D");var Rs,Wf=class Wf{constructor(t){h(this,"rendererState");h(this,"dirty",!0);P(this,Rs,!0);this.rendererState=t}get geometries3DDirty(){return l(this,Rs)}set geometries3DDirty(t){I(this,Rs,t)}update(t,e=!1){var o,a;let i=e&&t>=16&&t<=19,n;if(this.geometries3DDirty){let p;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let u=n.children[0];n.userData.outlineDirty=!1;let f=Di(n);if(f&&We(f),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let y;if(u instanceof Tr){let C=[],x,M,v,S;for(let E of n.userData.entities3D)S=this.rendererState.geometry3DMap.get(E),S instanceof he&&(M=S.components[0],v=S.components[1],M instanceof ge&&v.visible&&v.outline&&!M.detached&&(x=M==null?void 0:M.geometry,x&&C.push(x)));C.length>0&&(y=dr(C))}else y=u.geometry;y&&(p=jf(y,u.material),p.userData.outlineOfEntityId=n.userData.entityId);let g;for(let C of n.userData.entities3D.values()){let x=this.rendererState.geometry3DMap.get(C);g=x==null?void 0:x.components[0],g instanceof ge&&(p&&(x==null?void 0:x.type)==="geometry"&&!g.detached?(x.components[0].outline=p,(o=n.parent)==null||o.add(p)):(x==null?void 0:x.type)==="geometry"&&g.geometry!=null&&g.material!=null&&g.detached&&(g.outline&&We(g.outline),g.outline=jf(g.geometry,g.material),(a=n.parent)==null||a.add(g.outline)))}}this.dirty=!0}this.geometries3DDirty=!1}if((i||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let p=qt(t,16,19,0,1),c;for(let u of this.rendererState.geometry3DIdsInScene)if(c=this.rendererState.geometry3DMap.get(u),(c==null?void 0:c.type)==="geometry-group"&&c.components[0]!=null&&c.components[0].outline&&c.visible){let f=Di(c);if(f&&f.visible){let y=Array.isArray(f.material)?f.material:[f.material];for(let g of y)g.opacity=p}}else if((c==null?void 0:c.type)==="geometry"&&c.components[0]instanceof ge&&c.components[0].detached){let f=c.components[0].outline;if(f){let y=Array.isArray(f.material)?f.material:[f.material];for(let g of y)g.opacity=p}}}this.dirty=!1}};Rs=new WeakMap,s(Wf,"OutlineInterpolationSystem");var Bs=Wf;var Uf=class Uf extends Rt{constructor(e,i=new xn){super();h(this,"visible",!0);h(this,"type","geometry-group");h(this,"components");h(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[i],this.userData.entityId=e}setVisible(e){this.visible=e;let i=Di(this);i&&(i.visible=e),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(e){this.userData.opacity=e}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let e;for(let n of this.children)if(!n.userData.detached){e=n;break}return e instanceof Tr?Object.values(e.userData.entities)[0]:void 0}};s(Uf,"GeometryGroupObject3D");var Ne=Uf;var Fs=class Fs extends Rt{constructor(e){super();h(this,"childrenIds",new Set);h(this,"type","group-container");h(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});h(this,"components",[]);this.userData.entityId=e}addEntity(e){e instanceof Fs?(this.childrenIds.add(e.userData.entityId),this.add(e)):e instanceof _t?(this.childrenIds.add(e.id),this.add(e.object3d),this.userData.entities2D.add(e.id)):e instanceof Ne?(this.childrenIds.add(e.userData.entityId),this.add(e)):e instanceof he&&e.object3d&&(this.childrenIds.add(e.id),this.add(e.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(e){e instanceof Fs?(this.childrenIds.delete(e.userData.entityId),this.remove(e)):e instanceof _t?(this.childrenIds.delete(e.id),this.userData.entities2D.delete(e.id),this.remove(e.object3d)):e instanceof Ne?(this.childrenIds.delete(e.userData.entityId),this.remove(e)):e instanceof he&&e.object3d&&(this.childrenIds.delete(e.id),this.add(e.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(e){this.visible=e,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(e){this.position.z=e,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};s(Fs,"GroupContainerObject3D");var Oe=Fs;m();var d5=!1;function Yf(){d5=!0}s(Yf,"enableTestMode");var Zf=class Zf{constructor(t,e=2){h(this,"backgroundAlpha",1);h(this,"backgroundColor",new be);h(this,"width",0);h(this,"height",0);h(this,"options",{});h(this,"renderer");var i,n;try{this.options=t;let o={canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,outputColorSpace:Fr,powerPreference:"high-performance",preserveDrawingBuffer:!0};d5?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new be,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),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=e===2?new Ay(o):new ky(o),this.backgroundColor=new be((i=t.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(o){k.error(o),t.onWebGLRendererError&&t.onWebGLRendererError(o)}}destroy(){var t,e;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t))}render(t,e){this.renderer&&(this.renderer.state.reset(),e.layers.enable(0),e.layers.enable(1),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){b.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}};s(Zf,"Renderer");var Ap=Zf;m();m();var m5='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(J(n,typeof e!="symbol"?e+"":e,t),t);function j(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 q(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function z(n,e){let t=e.x,i=e.y,r=e.x+e.w,c=e.y+e.h,h=n.x,f=n.y,y=n.x+n.w,R=n.y+n.h;return t<y&&h<r&&i<R&&f<c}function a(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var k=4,o=class{constructor(e,t,i,r,c){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");let h=typeof window>"u"?2:window.devicePixelRatio;this.userData=typeof c>"u"?null:c,this.x=e-k,this.y=t-k,this.w=i+k*Math.min(h,2),this.h=r+k*Math.min(h,2)}contains(e){return e===this?!1:j(this,e)}intersects(e){return z(this,e)}intersectsPoint(e){return q(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.5)",e.fillRect(this.x,this.y,this.w,this.h)}};var I=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:r}=this.boundary;this.topLeft=new n(new o(e,t,i/2,r/2),this),this.topRight=new n(new o(e+i/2,t,i/2,r/2),this),this.bottomLeft=new n(new o(e,t+r/2,i/2,r/2),this),this.bottomRight=new n(new o(e+i/2,t+r/2,i/2,r/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(a(t,this.topLeft.queryRect(e)),a(t,this.topRight.queryRect(e)),a(t,this.bottomLeft.queryRect(e)),a(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(a(t,this.topLeft.queryPoint(e)),a(t,this.topRight.queryPoint(e)),a(t,this.bottomLeft.queryPoint(e)),a(t,this.bottomRight.queryPoint(e))),t}insert(e){return this.boundary.contains(e)?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):!1}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,C=10;function X(n,e,t,i,r,c,h="-1"){let f=1/0,y=1/0,R=-1/0,S=-1/0,K=new o(-C,0,5,t),Q=new o(-C,0,e,5),W=new o(e-5,0,e+C,t),Y=new o(0,t-5,e,t+C),F=Z(e,t,i,r,c),V=[K,Q,W,Y],E=new o(-d,-d,e+d*2,t+d*2);for(let s of n)for(let b=0;b<s.bboxes.length;b++){let{boundingBox:P}=s.bboxes[b],[m,T,u,p]=P,[v,x,_,U]=[s.y-m,s.y+T,s.x-u,s.x+p],B=_,D=v,A=U-_,M=x-v;f=Math.min(f,B)-d,y=Math.min(y,D)-d,R=Math.max(R,B+A)+d,S=Math.max(S,D+M)+d,s.bboxes[b].boundingRect=new o(B,D,A,M)}let g={msgId:h,colliders:new Array(n.length),debug:[]},L=new I(new o(f,y,R-f,S-y)),w;for(let s=0;s<n.length;s++)if(w=n[s],g.colliders[s]=[-1,!1],w.enabled){let[b,P,m]=[1/0,-1,void 0];for(let{index:T,boundingRect:u}of w.bboxes){let p=[];if(p=L.queryRect(u).filter(x=>u.intersects(x)),w.shouldCollideWithScreenEdges&&V.forEach(x=>{u.intersects(x)&&p.push(x)}),u.intersects(F)){g.colliders[s]=[T,!0,u];break}if(p.length<=b&&(m=u,P=T,b=p.length),p.length===0){L.insert(u),g.colliders[s]=[T,!E.contains(u),u];break}}w.rank===5&&m!=null&&(L.insert(m),g.colliders[s]=[P,!E.contains(m),m])}else g.colliders[s]=[-1,!1];return g}function Z(n,e,t,i,r){switch(r){case"top-right":return new o(n-t,0,t,i);case"bottom-left":return new o(0,e-i,t,i);case"bottom-right":return new o(n-t,e-i,t,i);case"top-left":return new o(0,0,t,i)}}function O(n){let e=n[0].map(t=>{let i=t[0].map((r,c)=>({index:c,boundingBox:[r[0],r[1],r[2],r[3]]}));return{enabled:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],bboxes:i}});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=O(n.data);self.postMessage(X(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';m();m();m();m();m();function f5(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}s(f5,"contains");m();function y5(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}s(y5,"intersectPoint");m();function g5(r,t){let e=t.x,i=t.y,n=t.x+t.w,o=t.y+t.h,a=r.x,p=r.y,c=r.x+r.w,u=r.y+r.h;return e<c&&a<n&&i<u&&p<o}s(g5,"intersects");m();function ii(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}s(ii,"appendItems");m();var kp=4,zf=class zf{constructor(t,e,i,n,o){h(this,"x");h(this,"y");h(this,"w");h(this,"h");h(this,"userData");let a=typeof window>"u"?2:window.devicePixelRatio;this.userData=typeof o>"u"?null:o,this.x=t-kp,this.y=e-kp,this.w=i+kp*Math.min(a,2),this.h=n+kp*Math.min(a,2)}contains(t){return t===this?!1:f5(this,t)}intersects(t){return g5(this,t)}intersectsPoint(t){return y5(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.5)",t.fillRect(this.x,this.y,this.w,this.h)}};s(zf,"Rectangle");var Ge=zf;var In=class In{constructor(t,e){h(this,"topLeft");h(this,"topRight");h(this,"bottomLeft");h(this,"bottomRight");h(this,"divided",!1);h(this,"boundary");h(this,"capacity",16);h(this,"objects",[]);h(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:n}=this.boundary;this.topLeft=new In(new Ge(t,e,i/2,n/2),this),this.topRight=new In(new Ge(t+i/2,e,i/2,n/2),this),this.bottomLeft=new In(new Ge(t,e+n/2,i/2,n/2),this),this.bottomRight=new In(new Ge(t+i/2,e+n/2,i/2,n/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(ii(e,this.topLeft.queryRect(t)),ii(e,this.topRight.queryRect(t)),ii(e,this.bottomLeft.queryRect(t)),ii(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(ii(e,this.topLeft.queryPoint(t)),ii(e,this.topRight.queryPoint(t)),ii(e,this.bottomLeft.queryPoint(t)),ii(e,this.bottomRight.queryPoint(t))),e}insert(t){return this.boundary.contains(t)?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):!1}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()}};s(In,"QuadTree");var Er=In;m();function v5(r,t,e){let i,n,o,a=null,p=0;e||(e={});let c=s(function(){p=e.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)},"later");return function(){let u=Date.now();!p&&e.leading===!1&&(p=u);let f=t-(u-p);return i=globalThis,n=arguments,f<=0||f>t?(a&&(clearTimeout(a),a=null),p=u,o=r.apply(i,n),a||(i=n=null)):!a&&e.trailing!==!1&&(a=setTimeout(c,f)),o}}s(v5,"throttle");function b5(r){return[r.bboxes.map(e=>[e.boundingBox[0],e.boundingBox[1],e.boundingBox[2],e.boundingBox[3]]),r.enabled?1:0,r.rank===5?1:0,r.x,r.y]}s(b5,"packCollider");var wn=!1,aM=150,$f=class $f extends Z{constructor(e,i,n=new Worker(URL.createObjectURL(new Blob([m5],{type:"text/javascript"})))){super();h(this,"worker");h(this,"debugContext");h(this,"debugCanvas");h(this,"dirty",!0);h(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);h(this,"visibleCollidersQTree",new Er(new Ge(0,0,0,0)));h(this,"interactiveCollidersQTree",new Er(new Ge(0,0,0,0)));h(this,"coreState");h(this,"postMessage");h(this,"showCollisionBoxes",s(()=>{wn=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{wn=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));h(this,"currentMsgId","");h(this,"working",!1);h(this,"_postMessage",s(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));h(this,"componentArray",[]);h(this,"update",s((e,i,n="bottom-left")=>{if(this.dirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=new Array(this.coreState.geometry2DIdsInScene.size);let o=0,a;for(let p of this.coreState.geometry2DIdsInScene){let c=this.coreState.geometry2DMap.get(p);c&&(a=c.components[0],this.componentArray[o]=a),o++}this.resize(e,i,n),this.dirty=!1,this.componentArray.sort((p,c)=>c.rank-p.rank)}else this.componentArray.filter(a=>a.collisionDirty===!0).length>0&&this.componentArray.sort((a,p)=>p.rank-a.rank);for(let o=0;o<this.componentArray.length;o++)this.packedMessage&&(this.componentArray[o].collisionDirty||this.packedMessage[0][o]==null?(this.packedMessage[0][o]=b5(this.componentArray[o].toJSON()),this.componentArray[o].collisionDirty=!1):(this.packedMessage[0][o][1]=this.componentArray[o].enabled?1:0,this.packedMessage[0][o][2]=this.componentArray[o].rank===5?1:0,this.packedMessage[0][o][3]=this.componentArray[o].projection.x,this.packedMessage[0][o][4]=this.componentArray[o].projection.y));this.working||this.postMessage()},"update"));h(this,"resolve",s(e=>{if(this.working=!1,this.dirty||!e.data)return;let i=e.data.colliders,n=-1,o=!1,a,p,c;wn&&(this.visibleCollidersQTree=new Er(new Ge(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Er(new Ge(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let u=0;u<this.componentArray.length;u++){let f=this.componentArray[u];i[u]==null||!f.enabled||([n,o,a]=i[u],n!==-1&&!o&&a!=null?(c=new Ge(a.x,a.y,a.w,a.h,{entityId:f.id}),wn&&this.visibleCollidersQTree.insert(c),p=this.coreState.geometry2DMap.get(f.id),(p==null?void 0:p.components[1])!=null&&this.interactiveCollidersQTree.insert(new Ge(a.x,a.y,a.w,a.h,{entityId:f.id})),f.visible===!1&&(f.visible=!0,"visibilityNeedsUpdate"in f&&(f.visibilityNeedsUpdate=!0)),n!==-1&&n!==f.activeStrategyIndex&&(f.activeBoundingBox=c,f.onStrategySelected(n))):(f.visible===!0&&(f.visible=!1,"visibilityNeedsUpdate"in f&&(f.visibilityNeedsUpdate=!0)),n!==-1&&n!==f.activeStrategyIndex&&f.onStrategySelected(n)))}wn&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));h(this,"drawDebug",s(()=>{wn&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));h(this,"destroy",s(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=v5(this._postMessage,aM,!1),wn?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,i,n){this.packedMessage[6]=n,this.packedMessage[5]=i,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};s($f,"CollisionSystem");var Bp=$f;m();m();m();m();var Kf=class Kf{constructor(t){h(this,"type");h(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};s(Kf,"Tap");var Rp=Kf,Qf=class Qf{constructor(){h(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()}};s(Qf,"TapsController");var Fp=Qf;m();function C5(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 Oe&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}s(C5,"getUniqueIntersectedGroupContainers");function S5(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}s(S5,"arraysEqual");var Yo,e1=class e1 extends Z{constructor(e,i,n,o){super();h(this,"raycaster",new hr);h(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});h(this,"coreState");h(this,"camera");h(this,"cameraPlane");h(this,"_quadtree",new Er(new Ge(0,0,0,0)));h(this,"_container");h(this,"lastPointerEvent");h(this,"cursor","grab");h(this,"touchesCount",0);h(this,"hasTouched",!1);P(this,Yo,void 0);h(this,"onPointerMoveRaf",s(e=>{this.lastPointerEvent=e,l(this,Yo)&&cancelAnimationFrame(l(this,Yo)),I(this,Yo,requestAnimationFrame(()=>{this.onPointerMove(e)}))},"onPointerMoveRaf"));h(this,"onPointerMove",s(e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()},"onPointerMove"));h(this,"tapsControl",new Fp);h(this,"onPointerDown",s(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 Rp(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));h(this,"clickTimeout");h(this,"onPointerUp",s(e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));h(this,"dirty3D",!0);h(this,"cachedHitBoxes",{entities:[],groups:[]});h(this,"ndcPoint",new z);h(this,"debugPanel");h(this,"resize",s(()=>{let{top:e,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[e,i]},"resize"));this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=e,this.coreState=i,this.cameraPlane=o,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i)return;let{entity3D:n,entity2D:o,position:a,groupContainers:p}=this.intersect(i);(this.handle3DEntityHover(n)||this.handle2DEntityHover(o)||this.handle3DContainerHover(p))&&this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:p}),this.handleCursor()}handleCursor(){let e=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=cM(e,n,i);this.cursor!==o&&(this.cursor=o,o==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}handle2DEntityHover(e){let i=this.state.hovered2DEntity!==e;return this.state.hovered2DEntity=e,i}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.components[2]?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var x,M;let i=[e.offsetX,e.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(v=>v.intersectsPoint(i)),a=this.state.containerOffset[0],p=this.state.containerOffset[1];this.ndcPoint.x=(e.clientX-p)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-a)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[c]=this.getMouseRayIntersects(),u=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(v=>v.object.visible),[f]=u,y=(x=f==null?void 0:f.instanceId)!=null?x:f==null?void 0:f.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(v=>v.object.visible),C;return g!=null&&g.length>0&&(C=C5(g)),{entity2D:((M=o==null?void 0:o.userData)==null?void 0:M.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:y!=null?this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entities[y]):this.coreState.geometry3DMap.get(f==null?void 0:f.object.userData.entityId),position:Array.isArray(g)&&(g==null?void 0:g.length)>0?g[0].point:c==null?void 0:c.point,groupContainers:C}}handle3DEntityHover(e){this.state.lastHover!==e&&(this.state.lastHover&&M5(this.state.lastHover,!1),e&&M5(e,!0));let i=this.state.hovered3DEntity!==e;return this.state.hovered3DEntity=e,this.state.lastHover=e,i}handle3DContainerHover(e){let i=!S5(this.state.hovered3DContainers,e);return this.state.hovered3DContainers=e,i}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.cameraPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var n,o,a;this.queueDebugMessage("CLICK \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var n,o,a;this.queueDebugMessage("HOVER \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var o;let n=document.createElement("pre");n.style.maxWidth="300px",n.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",n.style.backgroundColor=i,n.textContent=e,(o=this.debugPanel)==null||o.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};Yo=new WeakMap,s(e1,"InteractionSystem");var Ns=e1;function M5(r,t){let e=r.components[2];e&&(e.hover=t,e.dirty=!0)}s(M5,"updateHover");function cM(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}s(cM,"processCursor");m();var t1=class t1 extends Z{constructor(){super();h(this,"interpolators",new Map);h(this,"update",s(e=>{for(let[i,n]of this.interpolators)i instanceof ge?i.setOpacity(n(e)):i instanceof wr?i.enabled=n(e):n(e)},"update"))}addEntity3D(e,i){let[n,o,a,p]=i[1];this.interpolators.set(e,c=>qt(c,n,o,a,p))}addEntity2D(e,i){let[n,o,a]=i[1];this.interpolators.set(e,p=>p<n?o:a)}addAny(e,i){this.interpolators.set(e,i)}destroy(){this.interpolators.clear()}};s(t1,"ZoomInterpolationSystem");var Np=t1;m();m();var En,Dr,Gp,Vp,P5,Vs,Hp,jp,T5,Xp,I5,Hs,Wp,js,Xs,Up,i1=class i1{constructor(t){P(this,Vp);P(this,jp);P(this,Xp);P(this,En,null);P(this,Dr,void 0);h(this,"getCurrentSceneGLTF",s(async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await Y(this,Vp,P5).call(this),n=l(this,Gp).call(this,e),o=await i.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),a;if(o instanceof ArrayBuffer)a=new Blob([o],{type:"application/octet-stream"});else{let p=JSON.stringify(o,null,2);a=new Blob([p],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));P(this,Gp,s(t=>{let{scale:e,light:i,onlyVisible:n}=t,o=new Un,a=new Nr().setFromObject(l(this,Dr).entityScene);if(l(this,Vs).call(this,l(this,Dr).entityScene,o,n),i){let p=new Xl(16777215,.3*Math.PI);p.position.set(0,Math.max(a.max.x,a.max.y)*e*.5,a.max.y*e*4),p.lookAt(0,0,-1),p.target.position.set(0,0,-1),p.add(p.target),o.add(p)}return o},"#getExportedScene"));P(this,Vs,s((t,e,i)=>{t.material&&(t instanceof Yn?Y(this,jp,T5).call(this,t).forEach(n=>e.add(n)):t instanceof Yi&&e.add(Y(this,Xp,I5).call(this,t))),t.children.forEach(n=>{(!i||n.visible)&&l(this,Vs).call(this,n,e,i)})},"#processObject3D"));P(this,Hp,s((t,e,i)=>{let n=new Vy({color:new be(t),metalness:0});return n.opacity=e,n.transparent=i,n},"#createStandardMaterial"));P(this,Hs,s(t=>{let{geometry:e,material:i,position:n,rotation:o,quaternion:a,scale:p}=t;if(!(e!=null&&e.isBufferGeometry))return t;let c=e.attributes.position,u=e.attributes.normal,f=e.attributes.uv;return l(this,Wp).call(this,c,u),l(this,Xs).call(this,n,p,o,a),f&&l(this,Up).call(this,f),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=Rr),t},"#convertGeometry"));P(this,Wp,s((t,e)=>{let i=new W,n=new W;for(let o=0;o<t.count;o++)i.fromBufferAttribute(t,o),l(this,js).call(this,i),t.setXYZ(o,i.x,i.y,i.z),e&&(n.fromBufferAttribute(e,o),l(this,js).call(this,n),e.setXYZ(o,n.x,n.y,n.z))},"#convertAttributes"));P(this,js,s(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));P(this,Xs,s((t,e,i,n)=>{let o=t.y;t.y=t.z,t.z=-o;let a=e.y;if(e.y=e.z,e.z=a,i instanceof Wn)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let p=n.y;n.set(n.x,n.z,-p,n.w)}},"#convertObjectProperties"));P(this,Up,s(t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),n=t.getY(e);t.setXY(e,i,n)}},"#convertUVs"));I(this,Dr,t),l(this,Dr).entityScene=t.entityScene,l(this,Dr).geometry3DMap=t.geometry3DMap}destroy(){I(this,En,null)}};En=new WeakMap,Dr=new WeakMap,Gp=new WeakMap,Vp=new WeakSet,P5=s(async function(){if(!l(this,En)){let{GLTFExporter:t}=await import("./GLTFExporter-QNR5O542.js");I(this,En,new t)}return l(this,En)},"#getGLTFExporter"),Vs=new WeakMap,Hp=new WeakMap,jp=new WeakSet,T5=s(function(t){var a,p;let e=[],n=((a=t.userData)!=null&&a.entities?Object.values((p=t.userData)==null?void 0:p.entities):[]).map(c=>l(this,Dr).geometry3DMap.get(c)),o=new Map;return n.forEach(c=>{var C;if(!c||!(c instanceof he))return;let u=c.components[1],f=c.components[2];if(!u.visible||u.opacity===0)return;let y=f!=null&&f.hover?u.hoverColor||l(this,Dr).hoverColor:u.color,g="".concat(y,"-").concat(u.opacity,"-").concat(Number(u.visible));o.has(g)||o.set(g,[]),(C=o.get(g))==null||C.push(c)}),o.forEach((c,u)=>{let[f,y,g]=u.split("-"),C=c.reduce((S,E)=>{let w=E.components[0];if(w.type==="custom-geometry")return S;let T=w==null?void 0:w.geometry;return T&&S.push(T),S},[]),x=l(this,Hp).call(this,f,Number(y),t.material.transparent),M=dr(C,!0),v=new Me(M,x);v.position.copy(t.position),v.rotation.copy(t.rotation),v.scale.copy(t.scale),v.visible=!!g,l(this,Xs).call(this,v.position,v.scale,v.rotation,v.quaternion),e.push(l(this,Hs).call(this,v))}),e},"#processBatchedMesh"),Xp=new WeakSet,I5=s(function(t){let e=t.geometry.clone(),i=t.material,n=new lr({color:i.color,side:Rr});n.opacity=i.opacity,n.transparent=i.transparent;let o=new Yi(e,n);return o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o.visible=t.visible,l(this,Hs).call(this,o)},"#processLineSegments"),Hs=new WeakMap,Wp=new WeakMap,js=new WeakMap,Xs=new WeakMap,Up=new WeakMap,s(i1,"ExporterSystem");var Gs=i1;m();m();m();m();var Yp={top:0,bottom:0,left:0,right:0};m();m();var pM="gray",uM=.1;function w5(r,t,e){let{color:i=pM,opacity:n=1,altitude:o=0,height:a=uM}=e||{};Array.isArray(n)&&(n=1);let p={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o},center:{x:0,y:0,z:(a+o)/2}},c=new cr,u=r.geometry.coordinates[0].map(C=>{let x=t(C[1],C[0]);return p.min.x=Math.min(p.min.x,x.x),p.min.y=Math.min(p.min.y,x.y),p.max.x=Math.max(p.max.x,x.x),p.max.y=Math.max(p.max.y,x.y),x});c.moveTo(u[0].x,u[0].y),u.slice(1).forEach(C=>c.lineTo(C.x,C.y)),c.lineTo(u[0].x,u[0].y);let f=r.geometry.coordinates.slice(1);c.holes=f.map(C=>{let x=C.map(v=>t(v[1],v[0])),M=new li;return M.moveTo(x[0].x,x[0].y),x.slice(1).forEach(v=>M.lineTo(v.x,v.y)),M.lineTo(x[0].x,x[0].y),M});let y={bevelEnabled:!1,depth:a},g=new pr(c,y);return g.translate(0,0,o||0),g.userData={style:{color:i,opacity:n}},g}s(w5,"renderPolygonGeometry");m();var hM="gray",dM=.1;function E5(r,t,e){let{color:i=hM,opacity:n=1,altitude:o=0,height:a=dM}=e||{};Array.isArray(n)&&(n=1);let p={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},c={bevelEnabled:!1,depth:a},u=[];r.geometry.coordinates.forEach(y=>{let g=new cr,C=y[0].map(v=>{let S=t(v[1],v[0]);return p.min.x=Math.min(p.min.x,S.x),p.min.y=Math.min(p.min.y,S.y),p.max.x=Math.max(p.max.x,S.x),p.max.y=Math.max(p.max.y,S.y),S});g.moveTo(C[0].x,C[0].y),C.slice(1).forEach(v=>g.lineTo(v.x,v.y)),g.lineTo(C[0].x,C[0].y);let x=y.slice(1);g.holes=x.map(v=>{let S=v.map(w=>t(w[1],w[0])),E=new li;return E.moveTo(S[0].x,S[0].y),S.slice(1).forEach(w=>E.lineTo(w.x,w.y)),E.lineTo(S[0].x,S[0].y),E});let M=new pr(g,c);u.push(M)});let f=dr(u);return f.translate(0,0,o||0),f.userData={style:{color:i,opacity:n}},f}s(E5,"renderMultiPolygonGeometry");m();m();var a1=ar(N5());function G5(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}s(G5,"JSClipperError");G5.prototype=Error.prototype;a1.default.Error=function(r){throw new G5(r)};var yt=a1.default;var aT="gray",s1=new yt.ClipperOffset,it=100;function V5(r,t,e){let{color:i=aT,opacity:n=1,width:o=1,join:a="round",cap:p="round",height:c=.01,altitude:u=0}=e||{};Array.isArray(n)&&(n=0);let f=[];for(let M=0;M<r.geometry.coordinates.length-1;M++){let v=t(r.geometry.coordinates[M][1],r.geometry.coordinates[M][0]),S=t(r.geometry.coordinates[M+1][1],r.geometry.coordinates[M+1][0]);f.push([v,S])}s1.AddPaths(f.map(M=>M.map(v=>({X:v.x*it,Y:v.y*it}))),a==="round"?yt.JoinType.jsRound:a==="miter"?yt.JoinType.jsMiter:yt.JoinType.jsSquare,p==="round"?yt.EndType.etOpenRound:p==="butt"?yt.EndType.etOpenButt:yt.EndType.etOpenSquare);let y=new yt.PolyTree;s1.Execute(y,o/2*it);let g=[],C={bevelEnabled:!1,depth:c};for(let M of y.m_AllPolys){let v=new cr;if(M.IsHole())continue;let S=M.m_polygon;v.moveTo(S[0].X/it,S[0].Y/it),S.slice(1).forEach(E=>v.lineTo(E.X/it,E.Y/it)),v.lineTo(S[0].X/it,S[0].Y/it),v.holes=M.m_Childs.map(E=>{let w=new li,T=E.m_polygon;return w.moveTo(T[0].X/it,T[0].Y/it),T.slice(1).forEach(D=>w.lineTo(D.X/it,D.Y/it)),w.lineTo(T[0].X/it,T[0].Y/it),w}),g.push(new pr(v,C))}let x=dr(g);return x.translate(0,0,u||0),x.userData={style:{color:i,opacity:n}},s1.Clear(),x}s(V5,"renderLineStringGeometry");m();var nt=100,sT=.22,lT=.01;function H5(r,t,e={}){let{width:i=sT,height:n=lT,color:o="gray",opacity:a=1,altitude:p=0}=e,c={min:{x:1/0,y:1/0,z:p},max:{x:-1/0,y:-1/0,z:p+n}},u={bevelEnabled:!1,depth:n},f=new yt.ClipperOffset,y=r.geometry.coordinates.map(M=>M.map(v=>t(v[1],v[0])));f.AddPaths(y.map(M=>M.map(v=>({X:v.x*nt,Y:v.y*nt}))),yt.JoinType.jsMiter,yt.EndType.etOpenRound);let g=new yt.PolyTree;f.Execute(g,i/2*nt);let C=[];for(let M of g.m_AllPolys){let v=new cr;if(M.IsHole())continue;c.min.x=Math.min(c.min.x,M.m_polygon[0].X),c.min.y=Math.min(c.min.y,M.m_polygon[0].Y),c.max.x=Math.max(c.max.x,M.m_polygon[0].X),c.max.y=Math.max(c.max.y,M.m_polygon[0].Y);let S=M.m_polygon;v.moveTo(S[0].X/nt,S[0].Y/nt),S.slice(1).forEach(E=>v.lineTo(E.X/nt,E.Y/nt)),v.lineTo(S[0].X/nt,S[0].Y/nt),v.holes=M.m_Childs.map(E=>{let w=new li,T=E.m_polygon;return w.moveTo(T[0].X/nt,T[0].Y/nt),T.slice(1).forEach(D=>w.lineTo(D.X/nt,D.Y/nt)),w.lineTo(T[0].X/nt,T[0].Y/nt),w}),C.push(new pr(v,u))}let x=dr(C);return x.translate(0,0,p||0),x.userData={style:{color:o,opacity:a}},f.Clear(),x}s(H5,"renderMultiLineStringGeometry");m();m();var Jp=R.object({type:R.enum(["Point"]),coordinates:R.array(R.number()).length(2)});var cT=R.object({rotation:R.array(R.number()).length(3).optional(),altitude:R.number().optional(),scale:R.array(R.number()).length(3).optional(),interactive:R.boolean().optional(),id:R.union([R.number(),R.string()]).optional()}),pT=R.object({type:R.enum(["Feature"]),geometry:Jp,properties:cT}),uT=R.object({type:R.enum(["FeatureCollection"]),features:R.array(pT)}),hT=R.object({url:R.string(),color:R.string().optional(),opacity:R.number().optional()});function j5(r,t,e){R.union([R.number(),R.string()]).parse(r),uT.parse(t),hT.parse(e)}s(j5,"validateModelGroup");var Ys,Zs,l1=class l1{constructor(t){h(this,"mesh");h(this,"type","model");h(this,"outline");h(this,"geometry");h(this,"material");h(this,"feature");h(this,"instanceIndex",-1);h(this,"visible",!0);h(this,"color",new be);h(this,"position",new W);P(this,Ys,0);P(this,Zs,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return l(this,Ys)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,Ys,t))}get opacity(){return l(this,Zs)}set opacity(t){var e,i;if(this.mesh){for(let n of this.mesh.children)if(n instanceof Vl){((e=n.userData)==null?void 0:e.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let o=qt(t,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=o,n.material.transparent=o<1,n.material.needsUpdate=!0}}I(this,Zs,t)}};Ys=new WeakMap,Zs=new WeakMap,s(l1,"ModelComponent");var ki=l1;function dT(r){let{color:t,opacity:e,topColor:i,texture:n,topTexture:o}=r;return"".concat(t).concat(e).concat(i||"").concat(n||"").concat(o||"")}s(dT,"generateIndex");var mT=1e4,c1=class c1 extends Z{constructor(e,i){super();h(this,"state");h(this,"convertTo3DMapPosition");h(this,"loader");this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:e}=await import("./GLTFLoader-I7YDGRSV.js");this.loader=new e}createEntityFromFeature(e,i,n){let o=new ge(i),a=new he(o,new zt(n));return a.id=e,a}createModelFromFeature(e,i,n){let o=new ki(i),a=new he(o,new zt(n));return a.id=e,a}populateEntityMesh(e,i){let n=e.components[0];n.geometry=i,n.currentHeight=e.components[1].height,n.dirty=!1}async populateModelGroup(e,i,n){let o=new Gr,a=new Wn,p=new wy,c=new W,u=new At;return this.loader||await this.getGLTFLoader(),this.loader.load(i,f=>{var C,x,M,v,S,E;f.scene.traverse(w=>{let T=w;if("isMesh"in T&&T.isMesh===!0){let D=new Vl(T.geometry,T.material,e.size);D.userData={entities:{}},u.add(D),n.add(u)}});let y=0,g;for(let w of e.values()){g=this.state.geometry3DMap.get(w);let T=g.components[0],D=g.components[0].feature;T.mesh=u,T.instanceIndex=y;let{x:_,y:N,z:V}=this.convertTo3DMapPosition(D.geometry.coordinates[1],D.geometry.coordinates[0],0);T.position.set(_,N,V),a.set(((C=D.properties.rotation)==null?void 0:C[0])||0,((x=D.properties.rotation)==null?void 0:x[1])||0,((M=D.properties.rotation)==null?void 0:M[2])||0),c.set(((v=D.properties.scale)==null?void 0:v[0])||1,((S=D.properties.scale)==null?void 0:S[1])||1,((E=D.properties.scale)==null?void 0:E[2])||1),p.setFromEuler(a),o.compose(T.position,p,c),u.children.forEach(F=>{let X=F;X.setMatrixAt(y,o),X.userData.entities[y]=g.id}),y++}this.publish("model-loaded")}),u}populateEntityGroup(e){let i,n,o,a;for(let p of e.values())a=this.state.geometry3DMap.get(p),a.components[0]instanceof ge&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=w5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=E5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=V5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=H5(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return e}optimize(e){if(e.visible&&(e instanceof Ne||e instanceof Oe)){for(let o of e.children)this.optimize(o);if(e instanceof Oe||e.userData.dirty===!1)return;let i={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(o){k.warn(o)}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 o=0,a;for(let p of e.userData.entities3D.values()){a=this.state.geometry3DMap.get(p);let c=a.components[0],u=a.components[1];if(c instanceof ge){o++,o>=mT&&(o=0,n++);let f=dT(u)+n;i[f]===void 0&&(i[f]={style:u,entities:[]}),i[f].entities.push(a)}else c.mesh&&c.mesh.parent!==e&&e.add(c.mesh)}for(let p in i){let c=c5(i[p].entities,i[p].style);e.add(c),e.userData.outlineDirty=!0,e.userData.dirty=!1}}}}update(){this.optimize(this.state.entityScene)}};s(c1,"MeshCreationAndOptimizationSystem");var Kp=c1;m();var p1=class p1{constructor(t,e){h(this,"state");h(this,"dirty",!0);h(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 Ot&&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}}};s(p1,"DOMVisibilitySystem");var Qp=p1;m();var u1=class u1{constructor(t,e){h(this,"state");h(this,"project");this.state=t,this.project=e}update(){let t;for(let e of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(e),t&&this.project(t.components[0].projection,t.position)}};s(u1,"TwoDProjectionSystem");var eu=u1;m();m();var fT=s(function(){let t,e;return i=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*i,t.height=500*i,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}},"createMeasureCanvasContext")(),X5=s(({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let p="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:c}=fT(i);c.font=p;let u=[],f=r.split(" "),y=0,g=0,C=0;for(;g<f.length;){let S=f[g];if(y===n&&y>0){u[y-1]+="...";break}if(u[y]==null&&(u[y]=S,g++),f.length===1){u[y]=S;break}if(f[g]==null)break;let{width:E}=c.measureText(u[y]+" "+f[g]);E<=e*i?(u[y]+=" "+f[g],g++):y++}u.forEach(S=>{let{width:E}=c.measureText(S);C=Math.max(E,C)});let x=t*i*o,M=u.length*x;return{maxWidth:C,maxHeight:M,lines:u.length,draw:(S,E,w)=>{u.length===1?(a.strokeText&&S.strokeText(u[0],E,w),S.fillText(u[0],E,w)):(a.strokeText&&(S.strokeText(u[0],E,w-x/2),S.strokeText(u[1],E,w+x/2)),S.fillText(u[0],E,w-x/2),S.fillText(u[1],E,w+x/2))}}},"shaveText");m();function W5(r){let t=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}s(W5,"createImage");var yT=4.5,gT=2.5,vT=2,bT=5,zs=2.5;var h1=class h1{constructor(t,e){h(this,"dirty",!1);h(this,"state");h(this,"colliderContext");h(this,"colliderCanvas");h(this,"pinCache",{});h(this,"imagePromiseCache",{});h(this,"imageDimensionsCache",{});h(this,"textCache",{});h(this,"update",s((t,e,i)=>{let n=(t-e)/(i-e),o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let a,p,c,u,f,y;for(let g of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(g),y!=null&&y.components[0]instanceof wr&&!y.disposed){if(f=y.components[0],p=f.appearance.marker.foregroundColor,c=f.appearance.marker.backgroundColor,u=f.markerSize,a="".concat(p.active,"-").concat(p.inactive,"-").concat(c.active,"-").concat(c.inactive,"-").concat(u),this.pinCache[a]||this.prepare(f,a,this.colliderContext),f.appearance.marker.icon&&(!f.imageHash||f.dirty)&&this.cacheImage(f),this.textCache[f.id]==null||f.dirty||this.dirty){f.dirty=!1,f.collisionDirty=!0,this.textCache[f.id]={};let{textDrawFn:C,width:x,height:M}=this.processText(f.text,f.appearance.text.size,f.appearance.text.maxWidth,f.appearance.text.numLines,f.appearance.text.lineHeight);["left","center","right"].forEach(S=>{this.textCache[f.id][S]=this.textToCanvas(C,f.appearance.text.size,S,x,M,f.appearance.text.foregroundColor,f.appearance.text.backgroundColor)}),f.dimensions={width:Math.ceil(x/o),height:Math.ceil(M/o)},f.currentStrategyIndex===-1&&(f.currentStrategyIndex=0);let v=f.strategies[f.currentStrategyIndex];if(v){v.onStrategySelected(f);let S=f.style;f.style=f.newStyle,f.newStyle=S}}f.visible&&f.enabled&&(f.zoomProportion=n,this.draw(f,a,this.colliderContext))}this.dirty=!1},"update"));h(this,"processText",s((t,e,i,n,o)=>{let a=this.state.pixelRatio,{draw:p,maxWidth:c,maxHeight:u}=X5({text:t,size:e,pixelRatio:a,maxWidth:i,maxLines:n,lineHeight:o});return{textDrawFn:p,width:c+zs*a*2,height:u+zs*a*2}},"processText"));h(this,"textToCanvas",s((t,e,i,n,o,a,p)=>{let c=this.state.pixelRatio,u,f=n,y=o;window.OffscreenCanvas!=null&&!Mf()?u=new OffscreenCanvas(f,y):(u=document.createElement("canvas"),u.width=f,u.height=y,u.style.width=f+"px",u.style.height=y+"px");let g=u.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=i,g.font="bold ".concat(e*c,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=zs*c,g.fillStyle=a,g.strokeStyle=p;let C=i==="left"?0:i==="center"?f/2:f-zs*c/2;return t(g,C,(y+zs*c/2)/2),u},"textToCanvas"));h(this,"cacheImage",s(t=>{if(!t.appearance.marker.icon)return;let e=L4(t.appearance.marker.icon);if(t.imageHash=e,!this.imagePromiseCache[e]){let i=W5(t.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[e]=i}}},"cacheImage"));h(this,"createPinCanvas",s((t,e,i,n)=>{let o,a=this.state.pixelRatio,p=t.totalMarkerSize*2*a;window.OffscreenCanvas!=null?o=new OffscreenCanvas(p,p):(o=document.createElement("canvas"),o.width=p,o.height=p,o.style.width=p/a+"px",o.style.height=p/a+"px");let c=o.getContext("2d");return c.shadowColor="rgba(0,0,0,0.3)",c.shadowOffsetY=vT*a,c.shadowBlur=bT*a,c.beginPath(),c.arc(p/2,p/2,e/2+gT*a/2,0,2*Math.PI),c.fillStyle=i,c.fill(),c.beginPath(),c.arc(p/2,p/2,e/2,0,2*Math.PI),c.shadowColor="transparent",c.fillStyle=n,c.fill(),o},"createPinCanvas"));h(this,"prepare",s((t,e,i)=>{let n=this.state.pixelRatio;i.lineWidth=4*n;let o=this.createPinCanvas(t,t.markerSize,t.appearance.marker.backgroundColor.active,t.appearance.marker.foregroundColor.active),a=this.createPinCanvas(t,t.iconVisible?t.markerSize:yT*n,t.appearance.marker.backgroundColor.inactive,t.appearance.marker.foregroundColor.inactive);this.pinCache[e]=[o,a]},"prepare"));this.state=t,this.colliderCanvas=e,this.colliderContext=e.getContext("2d")}draw(t,e,i){if(!t.visible)return;i.save(),i.globalAlpha=t.opacity;let n=this.state.pixelRatio,o=t.projection.x*n,a=t.projection.y*n,p=t.style.pinVisibility===1?this.pinCache[e][0]:this.pinCache[e][1];if(i.drawImage(p,o-t.totalMarkerSize*n,a-t.totalMarkerSize*n),t.appearance.marker.icon&&t.iconVisible&&t.imageHash&&t.appearance.marker.iconSize&&this.imagePromiseCache[t.imageHash]){let c=this.imagePromiseCache[t.imageHash],u=(t.appearance.marker.iconSize-t.appearance.marker.iconPadding)*n,{iconFit:f}=t.appearance.marker,y=u,g=u,C="".concat(t.imageHash,"_").concat(f);if(this.imageDimensionsCache[C])y=this.imageDimensionsCache[C].width,g=this.imageDimensionsCache[C].height;else{let x=c.width*n,M=c.height*n;if(f==="contain"){let v=Math.sqrt(x**2+M**2),S=u/v;y=x*S,g=M*S}if(f==="cover"){let v=u/x,S=u/M,E=Math.max(v,S);y=x*E,g=M*E}}i.save(),i.beginPath(),i.arc(o,a,u/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(c,o-y/2,a-g/2,y,g),i.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left&&t.style.top&&i.drawImage(this.textCache[t.id][t.style.textAlign],o+t.style.left*n,a+t.style.top*n),i.restore()}};s(h1,"TwoDDrawSystem");var tu=h1;m();m();var Bi=class Bi{constructor(){h(this,"loader");this.loader=new Zn}static getInstance(){return Bi.instance||(Bi.instance=new Bi),Bi.instance}getLoader(){return this.loader}};s(Bi,"TextureLoaderSingleton"),h(Bi,"instance");var d1=Bi,qo=d1.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]}s(CT,"processColor");var qs,m1,f1=class f1 extends Z{constructor(e){super();P(this,qs);h(this,"state");h(this,"textureLoadingCache",new Map);this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,n){i.texture!==e.texture&&i.texture!==""&&Y(this,qs,m1).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&Y(this,qs,m1).call(this,i.topTexture,e,"topTexture"),(e.texture!=null||e.topTexture!=null)&&(n!=null&&n.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var a,p,c,u;let e,i,n,o;for(let f of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(f),o instanceof Ne&&o.type==="geometry-group"){if(i=o.components[0],o.userData.shadingDirty){let y=o.userData.entities3D.values().next().value,g=this.state.geometry3DMap.get(y);g instanceof he&&(g.type==="geometry"||g.type==="custom-geometry")&&(e=g.components[0],o.userData.shadingDirty&&i.shading&&this.setShading(e,i.shading));let C,x;for(let M of o.userData.entities3D.values())C=this.state.geometry3DMap.get(M),x=C.components[0],C.type==="geometry"&&x.detached&&o.userData.shadingDirty&&i.shading&&this.setShading(x,i.shading);o.userData.shadingDirty=!1}if(i.dirty){let y=Di(o);y&&y.material instanceof Hl&&(y.material.color.set(Xf(i.color)),y.material.needsUpdate=!0);let g=o.getfirstChildEntityId();if(g){let C=this.state.geometry3DMap.get(g),x=C==null?void 0:C.components[0];x instanceof ge&&this.processTextures(x,i)}i.dirty=!1}}else if(o instanceof he&&(o.type==="geometry"||o.type==="custom-geometry")&&((a=o.components[1])!=null&&a.dirty||(p=o.components[2])!=null&&p.dirty)){e=o.components[0],i=o.components[1],n=o.components[2];let y=CT(o,this.state.hoverColor);e.setColor(y[0],y[1]),i.visible!==e.visible&&(e.visible=i.visible),i.altitude!==e.altitude&&(e.altitude=i.altitude),i.opacity!==e.opacity&&(e.opacity=i.opacity),i.dirty=!1,this.processTextures(e,i,n),o.components[2]&&(o.components[2].dirty=!1)}else(o==null?void 0:o.type)==="model"&&((c=o.components[1])!=null&&c.dirty)?(e=o.components[0],i=o.components[1],i.opacity!==e.opacity&&(e.opacity=i.opacity),i.dirty=!1):(o==null?void 0:o.type)==="image"&&((u=o.components[1])!=null&&u.dirty)&&(e=o.components[0],i=o.components[1],i.visible!==e.visible&&(e.visible=i.visible),i.dirty=!1)}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};qs=new WeakSet,m1=s(async function(e,i,n){if(!(!e||!i.showTextures))if(this.textureLoadingCache.has(e)){n==="topTexture"?i.topTexture=await this.textureLoadingCache.get(e):i.texture=await this.textureLoadingCache.get(e),i.showTextures();return}else{let o=new Promise((a,p)=>{qo.getLoader().load(e,c=>{n==="topTexture"?i.topTexture=c:i.texture=c,i.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{k.error("Failed to load texture: ".concat(e)),p("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,o)}},"#loadTexture"),s(f1,"DrawSystem");var ru=f1;m();var y1=class y1 extends Z{constructor(e){super();h(this,"state");h(this,"animating",new Map);h(this,"isAnimating",!1);h(this,"startTime",-1);h(this,"duration",500);h(this,"update",s(()=>{this.animating.clear();let e,i;for(let n of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i instanceof wr&&i.visibilityNeedsUpdate&&(i.visible?this.animating.set(i,i.opacity):(i.opacity=0,i.visibilityNeedsUpdate=!1)));this.startTime=performance.now(),this.publish("animate:2d")},"update"));h(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,n]of this.animating.entries()){let o=(e-this.startTime)/this.duration;i.opacity=qt(o,0,1,n,1),e-this.startTime>=this.duration&&(i.visible=!0,i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};s(y1,"TwoDVisibilitySystem");var iu=y1;m();var U5=ar(Cn());var g1=class g1 extends Z{constructor(e,i,n,o,a,p,c){super();h(this,"state");h(this,"renderer");h(this,"mode");h(this,"scene");h(this,"cameraObject");h(this,"viewCamera");h(this,"systems");h(this,"twoDdirty",!0);h(this,"threeDdirty",!0);h(this,"frameId",null);h(this,"twoDFrameId",null);h(this,"animationFrameId",null);h(this,"nextFrame",null);h(this,"update",s((e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)!=null)if(e)this.commitRenderState(),this.paint();else{if(this.frameId)return;this.frameId=requestAnimationFrame(()=>{var n;((n=this.renderer)==null?void 0:n.renderer)!=null&&this.mode==="standalone"&&(this.commitRenderState(),this.paint())})}},"update"));h(this,"animate2D",s(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));h(this,"drawEntities2D",s(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"drawEntities2D"));h(this,"updateEntities2D",s(()=>{this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));h(this,"commitRenderState",s(()=>{this.frameId=null,this.systems.preRenderSystem.update(),U5.default.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(),If(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.dirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),Tf(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),this.systems.meshOptimizationSystem.update(),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.drawSystem.update(),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.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position)}),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1},"commitRenderState"));this.renderer=e,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=p,this.systems=c,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.dirty=!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)}};s(g1,"RenderSystem");var nu=g1;m();var $o,$s,v1=class v1{constructor(t,e){h(this,"type","path");h(this,"mesh",new At);h(this,"material");h(this,"geometry");h(this,"outline");h(this,"feature");h(this,"options");h(this,"nearRadius",.2);h(this,"farRadius",.4);h(this,"color","#ff834c");h(this,"accentColor","blue");P(this,$o,1);h(this,"altitudeAdjustment",1);h(this,"displayArrowsOnPath",!1);h(this,"animateArrowsOnPath",!1);h(this,"isVertical",!1);h(this,"dirty",!0);h(this,"position",new W);P(this,$s,0);var i,n,o,a,p,c;this.feature=t,this.options=e||{},this.color=(i=e==null?void 0:e.color)!=null?i:this.color,this.accentColor=(n=e==null?void 0:e.accentColor)!=null?n:this.accentColor,this.nearRadius=(o=e==null?void 0:e.nearRadius)!=null?o:this.nearRadius,this.farRadius=(a=e==null?void 0:e.farRadius)!=null?a:this.farRadius,this.displayArrowsOnPath=(p=e==null?void 0:e.displayArrowsOnPath)!=null?p:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=e==null?void 0:e.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath}setColor(){}setOpacity(){}set completeFraction(t){I(this,$o,t),this.mesh&&this.mesh.children.forEach(e=>{e.material.uniforms.complete.value=l(this,$o),e.material.needsUpdate=!0})}get completeFraction(){return l(this,$o)}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return l(this,$s)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,$s,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};$o=new WeakMap,$s=new WeakMap,s(v1,"PathComponent");var ou=v1;m();var b1=class b1{constructor(t){h(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Oe&&t.components[0]){let i=t.components[0];if(i.dirty){for(let n of t.children)(n instanceof Ne||n instanceof Oe)&&(n.userData.entityId!==t.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};s(b1,"StackSystem");var au=b1;m();m();var lu=ar(Cn());m();m();m();var Y5=s((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),Z5=s((r,t)=>new z(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),C1=s((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),Js=s((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),S1=s((r,t)=>new z((r.x+t.x)/2,(r.y+t.y)/2),"average"),x1=s(r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t},"getScrollDelta");var M1=class M1{constructor(t,e){h(this,"input1");h(this,"input2");h(this,"lastAngle");h(this,"lastDistance");h(this,"totalDistance");h(this,"first");h(this,"second");this.input1=t,this.input2=e,this.lastAngle=C1(t,e),this.lastDistance=Js(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=Js(t,e);this.input1=t,this.input2=e;let n=C1(t,e);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(Js(this.first,t)+Js(this.second,e))/2,this.first=S1(this.first,t),this.second=S1(this.second,e)}};s(M1,"InputSet");var su=M1;m();var P1=class P1{constructor(t,e,i){h(this,"touch");h(this,"camera");h(this,"cameraPlane");h(this,"viewCoordinate");h(this,"snapHolderMatrix");h(this,"snapCamera");h(this,"cameraPosition");h(this,"raycaster");h(this,"worldCoordinate");h(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 z(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new hr,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,n;let t=new z(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(t,this.snapCamera);let e=(n=this.raycaster)==null?void 0:n.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};s(P1,"TouchAnchor");var Ks=P1;var cu,_n,pu,T1=class T1 extends Z{constructor(e,i,n,o,a){super();h(this,"dirty",!1);h(this,"zoomDirty",!1);P(this,cu,Sf);h(this,"zoomSpeed",5);h(this,"rotateSpeed",100);h(this,"enabled",!0);h(this,"enableZoom",!0);h(this,"enablePan",!0);h(this,"enablePedestal",!1);h(this,"maxPedestal",1/0);h(this,"minPedestal",0);h(this,"enableRotate",!0);h(this,"minZoomAltitude",0);h(this,"maxZoomAltitude",1/0);h(this,"ignoreZoomLimits",!1);h(this,"zoomFactor",1);h(this,"panBounds",{min:new W(1/0,1/0),max:new W(-1/0,-1/0),center:new W(0,0,0),radius:1/0});h(this,"minTilt",0);h(this,"maxTilt",1.2);h(this,"MOUSE_BUTTONS",{ORBIT:Gl.RIGHT,ZOOM:Gl.MIDDLE,PAN:Gl.LEFT});h(this,"camera");h(this,"scene");h(this,"renderer");h(this,"elevation");h(this,"orbit");h(this,"cameraPlane");h(this,"raycaster",new hr);h(this,"rendererState");h(this,"options");h(this,"state",-1);h(this,"intersection");h(this,"viewState",null);h(this,"tweens",new Set);h(this,"clock",new jy(!0));h(this,"coords",{mouse:new z,rotateStart:new z,rotateEnd:new z,rotateDelta:new z,panStart:new W,panCameraStart:new W,panEnd:new W,panDelta:new W,initialShiftPos:new z,initialPedestal:0,floorAnchor:new W});h(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});h(this,"scrollTimer",null);h(this,"lastWheelTime",0);h(this,"resetZoom",!1);h(this,"zoomStart");h(this,"pedestalScaleFactor",1);h(this,"isUserZooming",!1);h(this,"stayInsideBounds",!0);h(this,"userInteracting",!1);h(this,"raycastToFloor",s(e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new W},"raycastToFloor"));h(this,"isUserInteracting",s(()=>this.userInteracting,"isUserInteracting"));h(this,"getPosition",s(()=>new W(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));h(this,"getPedestal",s(()=>this.orbit.position.z,"getPedestal"));h(this,"pan",s((e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));h(this,"postRender",s(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating()===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));h(this,"isAnimating",s(()=>lu.default.getAll().some(e=>e._mMapAnimation),"isAnimating"));h(this,"isCameraMoving",s(()=>this.state!==-1,"isCameraMoving"));h(this,"setPosition",s((e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));h(this,"updateCameraPosition",s((e,i)=>{let n=e-this.panBounds.center.x,o=i-this.panBounds.center.y,a=Math.sqrt(n*n+o*o);if(this.stayInsideBounds&&a>this.panBounds.radius){let p=Math.atan2(o,n),c={x:Math.cos(p)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(p)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=e,this.orbit.position.y=i},"updateCameraPosition"));h(this,"tilt",s(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));h(this,"zoomIn",s((e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},e,i,n)},"zoomIn"));h(this,"zoomOut",s((e,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},e,i,n)},"zoomOut"));h(this,"getRotation",s(()=>this.orbit.rotation.z,"getRotation"));h(this,"cancelAnimation",s(()=>{let e=Array.from(this.tweens),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));h(this,"animateCamera",s((e,i,n,o,a,p)=>{let c={mode:Sp.cancel,...p},u={},f={},y=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(u.x=y.x,f.x=e.position.x),e.position.y!==void 0&&(u.y=y.y,f.y=e.position.y),e.position.z!==void 0&&(u.z=y.z,f.z=e.position.z)),e.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.zoom=e.zoom:f.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let w=u.rotation=this.getRotation(),T=e.rotation%(2*Math.PI),D=T-w;if(Math.abs(D)>Math.PI){let _=D<0?1:-1;f.rotation=T+2*Math.PI*_}else f.rotation=T}e.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?f.tilt=e.tilt:f.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let g=u.zoom!==f.zoom,C=u.rotation!==f.rotation,x=u.tilt!==f.tilt,M=new lu.default.Tween(u).to(f,b.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(M),this.publish("multi-end",{zooming:g,rotating:C,tilting:x}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,M.state=7,this.publish("multi-start",{zooming:g,rotating:C,tilting:x})),this.publish("change")}),v=Array.from(this.tweens),S=v[v.length-1],E=!1;return S!=null&&(c.mode===Sp.chain?(E=!0,S.chain(M)):(this.completeTween(S),typeof a=="function"&&a(),S=null)),this.tweens.add(M),n?M.easing(n):M.easing(lu.default.Easing.Quadratic.In),!e.doNotAutoStart&&!E&&(M.start(),this.publish("change")),M._mMapAnimation=!0,M},"animateCamera"));h(this,"setMulti",s((e,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let p=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),p=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),p=!0)),p&&this.publish("position-updated");let c={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let u=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;u!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Os&&(this.camera.near=i-Os,this.camera.far=i+Os):(this.camera.near=i/jo,this.camera.far=i*jo),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.orbit.rotation.z&&(c.rotating=!0,this.orbit.rotation.z=n,this.publish("rotation-updated")),o!==void 0&&!isNaN(o)){let u=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;u!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=u,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c)},"setMulti"));h(this,"getZoomScaledMin",s(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));h(this,"getZoomScaledMax",s(()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)},"getZoomScaledMax"));h(this,"setRotation",s((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=e%xp;n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setRotation"));h(this,"setZoomAltitude",s(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/jo,this.camera.far=i*jo,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));h(this,"setZoomLevel",s(e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))},"setZoomLevel"));h(this,"getZoomAltitude",s(()=>this.camera.position.z,"getZoomAltitude"));h(this,"getZoomLevel",s(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));h(this,"rotate",s(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=(this.orbit.rotation.z+e)%xp;i!==this.orbit.rotation.z&&(this.orbit.rotation.z=i,this.publish("rotation-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"rotate"));h(this,"setTilt",s((e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));h(this,"getTilt",s(()=>this.elevation.rotation.x,"getTilt"));h(this,"setCameraPlaneElevation",s(e=>{this.cameraPlane.position.z=e},"setCameraPlaneElevation"));h(this,"zoom",s(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));h(this,"getProjectionScaleFactor",s((e,i,n)=>Ef(e,i,n),"getProjectionScaleFactor"));h(this,"update",s(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));h(this,"setPedestal",s((e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)},"setPedestal"));h(this,"dispose",s(()=>{for(let e of Tp)e.endsWith("start")?this.off(e,this.setUserInteracting):e.endsWith("end")&&this.off(e,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));h(this,"createCameraPlane",s(()=>{let e=new Vr(1e10,1e10),i=new lr({color:0,visible:!1}),n=new Me(e,i);return this.scene.add(n),n},"createCameraPlane"));h(this,"addEventListeners",s(()=>{let{domElement:e}=this.renderer;for(let i of Tp)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));h(this,"addMouseEventListeners",s(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));h(this,"addMouseMoveEventListeners",s(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));h(this,"removeMouseMoveEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));h(this,"removeEventListeners",s(()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));h(this,"removeMouseUpEventListeners",s(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));h(this,"onContextMenu",s(e=>{e.preventDefault()},"onContextMenu"));h(this,"onMouseUp",s(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1}},"onMouseUp"));h(this,"onMouseMove",s(e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)},"onMouseMove"));h(this,"onTouchStart",s(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 su(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));h(this,"onTouchMove",s(e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let i={...this.touch.inputs.first},n={...this.touch.inputs.second},o=new z(this.touch.touches[0].x,this.touch.touches[0].y),a=new z(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 p=i.y<o.y&&n.y<a.y,c=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(c||p)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}},"onTouchMove"));h(this,"onTouchEnd",s(e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}},"onTouchEnd"));h(this,"handleTouchMovePan",s(e=>{let i=Object.hasOwn(e,"x")?new z(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panEnd.set(n.x,n.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleTouchMovePan"));h(this,"handleTouchStartDolly",s(()=>{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 n=new z(this.touch.touches[0].x-e/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Ks(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Ks(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));h(this,"handleMouseMovePan",s(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")},"handleMouseMovePan"));h(this,"handleTouchStartTilt",s(e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));h(this,"handleTouchMovePedestal",s(e=>{this.handleMouseMovePedestal(e.touches[0])},"handleTouchMovePedestal"));h(this,"handleTouchMoveTilt",s(e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));h(this,"handleTouchMoveDolly",s(()=>{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 n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));h(this,"handleTouchEnd",s(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")},"handleTouchEnd"));h(this,"handleTouchStartPan",s(e=>{let i=Object.hasOwn(e,"x")?new z(e.x,e.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));h(this,"handleTouchStartPedestal",s(e=>{this.handleMouseDownPedestal(e.touches[0])},"handleTouchStartPedestal"));h(this,"onMouseDown",s(e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));h(this,"onMouseWheel",s(e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))},"onMouseWheel"));h(this,"handleMouseWheel",s(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(),n=i-x1(e)*i/Cf*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let o=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-o),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));h(this,"setCameraFromTransformMatrix",s(e=>{this.orbit.updateMatrixWorld();let i=new Wn;i.setFromRotationMatrix(e,"ZYX");let n=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new W(0,0,1);a.applyEuler(i),a.setLength(n);let p=new W;p.setFromMatrixPosition(e),p.sub(a),this.enablePan&&this.setPosition(p.x,p.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(o)},"setCameraFromTransformMatrix"));h(this,"makeTransformFromTouchAnchors",s((e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=e.worldCoordinate,a=i.worldCoordinate,p=e.reUnproject(),c=i.reUnproject();if(!p||!c||!o||!a)return null;let u=e.viewCoordinate,f=i.viewCoordinate,y=a.x-o.x,g=a.y-o.y,C=Math.atan2(g,y),x=c.x-p.x,M=c.y-p.y,v=Math.atan2(M,x),S=Y5(C,v),E=new Gr;E.makeRotationZ(-S);let w=E.clone();w.multiply(e.snapHolderMatrix);let T=s((B7,R7,F7)=>B7.elements[(R7-1)*4+F7-1],"m"),D=T(n,1,1)*T(w,1,1)-u.x*T(n,3,4)*T(w,3,1),_=T(n,1,1)*T(w,1,2)-u.x*T(n,3,4)*T(w,3,2),N=T(n,1,1)*T(w,1,3)-u.x*T(n,3,4)*T(w,3,3),V=o.x*D+o.y*_+o.z*N,F=T(n,2,2)*T(w,2,1)-u.y*T(n,3,4)*T(w,3,1),X=T(n,2,2)*T(w,2,2)-u.y*T(n,3,4)*T(w,3,2),j=T(n,2,2)*T(w,2,3)-u.y*T(n,3,4)*T(w,3,3),ee=o.x*F+o.y*X+o.z*j,ve=T(n,1,1)*T(w,1,1)-f.x*T(n,3,4)*T(w,3,1),Se=T(n,1,1)*T(w,1,2)-f.x*T(n,3,4)*T(w,3,2),we=T(n,1,1)*T(w,1,3)-f.x*T(n,3,4)*T(w,3,3),He=a.x*ve+a.y*Se+a.z*we,lt=T(n,2,2)*T(w,2,1)-f.y*T(n,3,4)*T(w,3,1),xe=T(n,2,2)*T(w,2,2)-f.y*T(n,3,4)*T(w,3,2),ke=T(n,2,2)*T(w,2,3)-f.y*T(n,3,4)*T(w,3,3),Ee=a.x*lt+a.y*xe+a.z*ke,Bt=Math.abs(ve-D),bt=Math.abs(Se-_),Je=Math.abs(we-N),Wi=Math.abs(ve-F),jn=Math.abs(Se-X),te=Math.abs(we-j),ce=Math.abs(lt-D),je=Math.abs(xe-_),ct=Math.abs(ke-N),Br=Math.abs(lt-F),Xn=Math.abs(xe-X),Ui=Math.abs(ke-j),Fu=Math.min(Bt+bt+Je,Wi+jn+te),si=Math.min(ce+je+ct,Br+Xn+Ui);Fu<si&&(ve=lt,Se=xe,we=ke,He=Ee);let ha=F*N-D*j,Nu=X*N-_*j,yy=ee*N-V*j,Gu=ve*j-F*we,Vu=Se*j-X*we,gy=He*j-ee*we,L7=(gy*Nu-yy*Vu)/(Gu*Nu-ha*Vu),O7=(gy*ha-yy*Gu)/(Vu*ha-Nu*Gu),vy=X*D-_*F,_7=j*D-N*F,A7=ee*D-V*F,by=Se*F-X*ve,k7=we*F-j*ve,Cy=((He*F-ee*ve)*vy-A7*by)/(k7*vy-_7*by),Nl=w.clone();return Nl.elements[12]=L7,Nl.elements[13]=O7,Nl.elements[14]=Cy,Cy>0?Nl:null},"makeTransformFromTouchAnchors"));h(this,"updateTouchOrigin",s(()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top},"updateTouchOrigin"));h(this,"touchToScene",s(e=>{this.touch.touches=[];for(let i=0,n=e.touches.length;i<n;i++){let o=e.touches[i],a=Z5(o,this.touch.origin);this.touch.touches.push(new z(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));h(this,"canScrollZoom",s(e=>{let i=x1(e),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())},"canScrollZoom"));h(this,"mouseToScene",s(e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));h(this,"getMousePos",s(e=>({x:e.offsetX,y:e.offsetY}),"getMousePos"));h(this,"handleMouseDownRotate",s(e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));h(this,"handleMouseDownPan",s(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));h(this,"handleMouseDownPedestal",s(e=>{let i=new z(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=Ef(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));h(this,"handleMouseMovePedestal",s(e=>{let i={x:e.clientX,y:e.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)},"handleMouseMovePedestal"));h(this,"handleMouseMoveRotate",s(e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.rotate(-this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));h(this,"publishUserZoomDebounced",Oi(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));h(this,"publishUserZoomEvent",s(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));h(this,"setUserInteracting",s(()=>{this.userInteracting=!0},"setUserInteracting"));h(this,"unsetUserInteracting",s(()=>{this.userInteracting=!1},"unsetUserInteracting"));h(this,"publishPedestalChangeEvent",s(e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));h(this,"convertAltitudeToZoomLevel",s(e=>{let[,i]=this.center,o=e*2*Math.tan(le.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(le.degToRad(i))*2*Math.PI*Ir/o;return le.clamp(Math.log2(a/512),Mp,Pp)},"convertAltitudeToZoomLevel"));h(this,"convertZoomLevelToAltitude",s(e=>{let[,i]=this.center,n=le.clamp(e,Mp,Pp),o=Math.pow(2,n),a=le.clamp(i,vf,bf),p=o*512;return Math.cos(le.degToRad(a))*Math.PI*2*Ir/p*this.options.canvasHeight/2/Math.tan(le.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));h(this,"completeTween",s(e=>{e.isPlaying?e.stop():e.end(),this.tweens.delete(e)},"completeTween"));P(this,_n,{PIXELS:"pixels",PORTIONS:"portions"});P(this,pu,["top","bottom","left","right"]);h(this,"getCameraFrameForPoints",s((e,i,n,o,{canvasWidth:a,canvasHeight:p},c=this.minZoomAltitude,u=this.maxZoomAltitude)=>{Number.isFinite(n)&&(n=1),Number.isFinite(i)&&(i=1);let f={position:this.getPosition(),zoom:c};if(e==null||e.length===0)return f;o||(o={top:0,bottom:0,left:0,right:0,type:l(this,_n).PIXELS});for(let si of l(this,pu))typeof o[si]!="number"&&(o[si]=0);if(o.type||(o.type=l(this,_n).PIXELS),o.type===l(this,_n).PORTIONS&&(o={top:o.top*p,bottom:o.bottom*p,left:o.left*a,right:o.right*a,type:l(this,_n).PIXELS}),o.left+o.right>=a||o.top+o.bottom>=p)return f;this.orbit.updateMatrixWorld();let y=this.camera.matrixWorldInverse,g=this.camera.fov*(Math.PI/180)/2,C=g*n,M=Math.atan(Math.tan(g)*(a/p))*i,v=new W(1/0,1/0,1/0),S=new W(-1/0,-1/0,-1/0),E=new Nr().setFromPoints(e),w;for(let si=0,ha=e.length;si<ha;si++)w=e[si].clone(),w.applyMatrix4(y),v.min(w),S.max(w);let T=S.x-v.x,D=S.y-v.y,_=a-o.left-o.right,N=p-o.top-o.bottom,V=(S.x+v.x)/2,F=(S.y+v.y)/2,X=T/_,j=D/N,ee=c,ve=u,Se=ee*Math.tan(M)*2,we=ve*Math.tan(M)*2,He=Se/a,lt=we/a,xe=Math.max(X,j);xe=le.clamp(xe,He,lt);let ke=_*xe,Ee=N*xe,Bt={min:{x:V-ke/2-o.left*xe,y:F-Ee/2-o.bottom*xe},max:{x:V+ke/2+o.right*xe,y:F+Ee/2+o.top*xe}},bt=(Bt.min.x+Bt.max.x)/2,Je=(Bt.min.y+Bt.max.y)/2,Wi=E.getCenter(new W),jn=Math.abs(bt-Bt.min.x),te=Math.abs(Je-Bt.min.y),ce=jn/Math.tan(M),je=te/Math.tan(C),ct=new W;ct.set(bt,Je,S.z+Math.max(ce,je)),ct.applyMatrix4(this.camera.matrixWorld);let Br=new W;Br.set(bt,Je,S.z),Br.applyMatrix4(this.camera.matrixWorld);let Xn=new W().subVectors(Br,ct),Ui=(Wi.z-ct.z)/Xn.z,Fu=new W().copy(ct).add(Xn.clone().multiplyScalar(Ui));return f.position=Fu,Br.set(f.position.x,f.position.y,f.position.z),ct.sub(Br),f.zoom=ct.length(),f},"getCameraFrameForPoints"));this.camera=e,this.renderer=n,this.rendererState=o,this.scene=i,this.options=a,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return l(this,cu)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,i),n=Math.max(n,e),(n-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 o,a,p,c;let e=this.getPosition(),{lat:i,lon:n}=wp((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(c=(p=this.rendererState.center)==null?void 0:p[0])!=null?c:0,e.x,e.y);return[n,i]}setCenter(e,i){var a,p,c,u;let{x:n,y:o}=Ep((p=(a=this.rendererState.center)==null?void 0:a[1])!=null?p:0,(u=(c=this.rendererState.center)==null?void 0:c[0])!=null?u:0,i,e);this.setPosition(n,o)}focusOn(e,{insetsPadding:i},n={}){let o=n.curve,a=1,p=1,c=n.callback,u=n.cancelledCallback,f=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,y=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,g=this.options.canvasWidth,C=this.options.canvasHeight,x;if(n.duration!==void 0?x=n.duration:b.env.TESTING==="true"?x=0:x=200,i.top!==0||i.bottom!==0||i.left!==0||i.right!==0)if(n.tilt!==void 0&&n.tilt!==this.getTilt()||n.rotation!==void 0&&n.rotation!==this.getRotation())this.animateCamera({position:this.getPosition(),tilt:n.tilt,rotation:n.rotation},x,o,()=>{let M={...n.padding,...i},v=this.getCameraFrameForPoints(e,a,p,M,{canvasWidth:g,canvasHeight:C},f,y);this.animateCamera({position:v.position,tilt:this.getTilt(),rotation:this.getRotation(),zoom:v.zoom},x,o,c,u)});else{let M={...n.padding,...i},v=this.getCameraFrameForPoints(e,a,p,M,{canvasWidth:g,canvasHeight:C},f,y);this.animateCamera({position:v.position,tilt:this.getTilt(),rotation:this.getRotation(),zoom:v.zoom},x,o,c,u)}else{let M={...n.padding,...i},v=this.getCameraFrameForPoints(e,a,p,M,{canvasHeight:C,canvasWidth:g},f,y);this.animateCamera({position:v.position,tilt:n.tilt,rotation:n.rotation,zoom:v.zoom},x,o,c,u)}}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};cu=new WeakMap,_n=new WeakMap,pu=new WeakMap,s(T1,"CameraSystem");var Qs=T1;m();var ST=300,I1=class I1{constructor(t){h(this,"state");this.state=t}update(t){var o;let e,i,n;for(let a of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(a),e&&(i=e.components[0],n=e.components[1],i instanceof Ot&&i.containerEl!=null&&((i.visible===!0||((o=i.animation)==null?void 0:o.pending)===!0)&&(i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.projection.y,"px)")),i.visible===!0?i.containerEl.style.pointerEvents=t||n!=null?"none":"auto":i.containerEl.style.pointerEvents="none",i.visibilityNeedsUpdate&&(i.animation&&i.animation.cancel(),i.animation=i.containerEl.animate([{opacity:i.visible?"1":"0"}],{duration:ST,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)))}};s(I1,"DOMDrawSystem");var uu=I1;m();var w1=class w1{constructor(){h(this,"percentExpanded",0);h(this,"activeId","");h(this,"gap",20);h(this,"dirty",!0)}};s(w1,"StackComponent");var hu=w1;m();var E1=class E1 extends Z{constructor(e,i){super();h(this,"state");h(this,"dirty",!0);h(this,"domTree");h(this,"observers",new Map);h(this,"updateDimensions",s(e=>{e.forEach(i=>{let n=i.target,o=n.getAttribute("data-marker-id");if(o){let a=this.state.geometry2DMap.get(o);if(a&&a.components[0]instanceof Ot&&n.firstElementChild){let{width:p,height:c}=n.firstElementChild.getBoundingClientRect();a.components[0].updateDimensions(p,c)}}}),this.publish("dimensions-update")},"updateDimensions"));this.state=e,this.domTree=i}setupObserver(){var i;if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let e;for(let n of this.domTree.children){let o=n.getAttribute("data-marker-id");if(o!=null&&(e=this.state.geometry2DMap.get(o),(i=e.components[0].options)!=null&&i.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(n),this.observers.set(n.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};s(E1,"DOMResizeSystem");var du=E1;m();var el=ar(Cn());var xT=0,MT=22,PT=0,TT=90;function An(r,t,e,i){return(r<t||r>e)&&k.warn(i),Math.min(e,Math.max(t,r))}s(An,"clampWithWarning");var z5={linear:el.default.Easing.Linear.None,"ease-in":el.default.Easing.Quadratic.In,"ease-out":el.default.Easing.Quadratic.Out,"ease-in-out":el.default.Easing.Quadratic.InOut},H,J,kn,tl,D1=class D1{constructor(t,e,i,n){P(this,H,void 0);P(this,J,void 0);P(this,kn,void 0);P(this,tl,void 0);I(this,H,t),I(this,J,e),I(this,kn,i),I(this,tl,n),l(this,J).cameraSystem.on("pedestal-change",({pedestal:o})=>{l(this,H).map&&(l(this,H).map.transform.elevation=o,l(this,H).map.transform.minElevationForCurrentTile=o,l(this,H).map.triggerRepaint()),l(this,J).cameraSystem.setCameraPlaneElevation(o),l(this,tl).position.z=o})}get center(){return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?l(this,H).map.getCenter().toArray():l(this,J).cameraSystem.center}setCenter(t){var e;if(l(this,H).mode==="outdoors-overlay"&&l(this,H).map){(e=l(this,H).map)==null||e.setCenter(t),l(this,J).interactionSystem.handleHover();return}l(this,J).cameraSystem.setCenter(t[0],t[1]),l(this,J).interactionSystem.handleHover()}get zoomLevel(){var t;return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?(t=l(this,H).map)==null?void 0:t.getZoom():l(this,J).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;l(this,H).mode==="outdoors-overlay"&&l(this,H).map&&((e=l(this,H).map)==null||e.setZoom(t)),l(this,J).cameraSystem.setZoomLevel(An(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get maxZoomLevel(){return l(this,J).cameraSystem.maxZoomLevel}get minZoomLevel(){return l(this,J).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){l(this,J).panBoundsSystem.autoMinZoomLevel=t,t&&(l(this,J).panBoundsSystem.dirty=!0,l(this,J).panBoundsSystem.update())}get autoMinZoomLevel(){return l(this,J).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var n;e&&this.setAutoMinZoomLevel(!1);let i=Math.max(xT,t);l(this,J).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=l(this,H).map)==null||n.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=Math.min(MT,t);l(this,J).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=l(this,H).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?(t=l(this,H).map)==null?void 0:t.getMaxPitch():le.radToDeg(l(this,J).cameraSystem.maxTilt)}get minPitch(){var t;return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?(t=l(this,H).map)==null?void 0:t.getMinPitch():le.radToDeg(l(this,J).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(PT,t);(i=l(this,H).map)==null||i.setMinPitch(e),l(this,J).cameraSystem.minTilt=le.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(TT,t);(i=l(this,H).map)==null||i.setMaxPitch(e),l(this,J).cameraSystem.maxTilt=le.degToRad(e)}get bearing(){var t;return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?(t=l(this,H).map)==null?void 0:t.getBearing():le.radToDeg(l(this,J).cameraSystem.getRotation())}setBearing(t){var e;if(l(this,H).mode==="outdoors-overlay"&&l(this,H).map){(e=l(this,H).map)==null||e.setBearing(t);return}l(this,J).cameraSystem.setRotation(le.degToRad(t))}get pitch(){var t;return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?(t=l(this,H).map)==null?void 0:t.getPitch():le.radToDeg(l(this,J).cameraSystem.getTilt())}setPitch(t){var e;if(l(this,H).mode==="outdoors-overlay"&&l(this,H).map){(e=l(this,H).map)==null||e.setPitch(t);return}l(this,J).cameraSystem.setTilt(le.degToRad(An(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 l(this,J).cameraSystem.getPedestal()}setElevation(t){l(this,J).cameraSystem.setPedestal(t,!0)}get insetsPadding(){return l(this,kn).insetsPadding}setInsetPadding(t){l(this,kn).center&&(l(this,kn).insetsPadding=t?{...t}:Yp)}animateTo(t){var a;if(l(this,H).mode==="outdoors-overlay"&&l(this,H).map)return(a=l(this,H).map)==null||a.flyTo({center:t.center,zoom:t.zoomLevel,bearing:t.bearing,pitch:t.pitch,duration:t.duration}),Promise.resolve();let e=t.center?l(this,H).convertTo3DMapPosition(t.center[1],t.center[0],0):void 0,i=t.zoomLevel!==void 0?l(this,J).cameraSystem.convertZoomLevelToAltitude(An(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,n=t.bearing!==void 0?le.degToRad(t.bearing):void 0,o=t.pitch!==void 0?le.degToRad(An(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(p=>{l(this,J).cameraSystem.animateCamera({position:e,zoom:i,rotation:n,tilt:o},t.duration||0,z5[t.easing||"ease-in-out"],()=>{l(this,J).interactionSystem.handleHover(),p()},p)})}focusOn(t,e){var i,n;return l(this,H).mode==="outdoors-overlay"&&l(this,H).map?(t.length===1?(i=l(this,H).map)==null||i.flyTo({center:t[0],duration:(e==null?void 0:e.duration)||l(this,H).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?l(this,H).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?l(this,H).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||l(this,H).map.getMaxZoom()}):(n=l(this,H).map)==null||n.fitBounds(t,{duration:e==null?void 0:e.duration,animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?l(this,H).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?l(this,H).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||l(this,H).map.getMaxZoom()}),l(this,J).interactionSystem.handleHover(),Promise.resolve()):new Promise(o=>{l(this,J).cameraSystem.focusOn(t.map(a=>l(this,H).convertTo3DMapPosition(a[1],a[0],a[2]||0)),{insetsPadding:(e==null?void 0:e.padding)||this.insetsPadding},{minZoom:(e==null?void 0:e.maxZoomLevel)===void 0?void 0:l(this,J).cameraSystem.convertZoomLevelToAltitude(An(e.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(e==null?void 0:e.minZoomLevel)===void 0?void 0:l(this,J).cameraSystem.convertZoomLevelToAltitude(An(e.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:(e==null?void 0:e.padding)||{top:0,left:0,bottom:0,right:0},curve:z5[(e==null?void 0:e.easing)||"ease-in-out"],rotation:(e==null?void 0:e.bearing)===void 0?void 0:le.degToRad(e.bearing),tilt:(e==null?void 0:e.pitch)!==void 0?le.degToRad(An(e.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:e==null?void 0:e.duration,callback:()=>{l(this,J).interactionSystem.handleHover(),o()},cancelledCallback:o})})}};H=new WeakMap,J=new WeakMap,kn=new WeakMap,tl=new WeakMap,s(D1,"Camera");var mu=D1;m();var q5="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 $5="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";m();var J5=4.291666666666667,K5=15,Q5=25,e7=43/60;m();var t7=["horizontal","icon"],ET=new Map([[t7[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>'],[t7[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>']]),DT=/<svg([^>]*)>/g;function r7(r,t,e,i){let n=ET.get(r);return n?n.replace(DT,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}s(r7,"getLogoIcon");var i7=!1,de,Jo,Ko,qe,ot,Bn,Kt,Lr,Qt,Or,L1=class L1 extends Z{constructor(e,i,n){super();P(this,de,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});P(this,Jo,void 0);P(this,Ko,void 0);P(this,qe,void 0);P(this,ot,void 0);P(this,Bn,void 0);P(this,Kt,0);P(this,Lr,0);P(this,Qt,0);P(this,Or,0);h(this,"dirty",!0);h(this,"getPositionAlignedCanvasCoordinates",s((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}})[l(this,de).position],"getPositionAlignedCanvasCoordinates"));h(this,"getPositionAlignedPadding",s(()=>{var n,o,a,p;let e=l(this,de).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}}[l(this,de).position];let i={top:(n=e.top)!=null?n:0,right:(o=e.right)!=null?o:0,bottom:(a=e.bottom)!=null?a:0,left:(p=e.left)!=null?p:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));I(this,de,Object.assign({},l(this,de),n)),I(this,Ko,e),I(this,Jo,i),I(this,Qt,i.canvasWidth),I(this,Or,i.canvasHeight)}get color(){return l(this,de).color==="light"?"white":"#293136"}get iconName(){return l(this,de).iconOnly?"icon":"horizontal"}get minWidth(){return l(this,de).iconOnly?K5:75}get defaultWidth(){return l(this,de).iconOnly?Q5:150}get aspectRatio(){return l(this,de).iconOnly?e7:J5}get options(){return{...l(this,de)}}set options(e){I(this,de,{padding:e.padding||l(this,de).padding,position:e.position||l(this,de).position,iconOnly:e.iconOnly||l(this,de).iconOnly,color:e.color||l(this,de).color,scale:e.scale||l(this,de).scale,onClick:l(this,de).onClick,visible:l(this,de).visible})}get icon(){return r7(this.iconName,this.color,l(this,Kt)*l(this,Jo).pixelRatio,l(this,Lr)*l(this,Jo).pixelRatio)}setSize(e,i){l(this,ot)&&(l(this,ot).uniforms.uSize.value.x=e,l(this,ot).uniforms.uSize.value.y=i)}setXY(e,i){l(this,ot)&&(l(this,ot).uniforms.uSize.value.w=e,l(this,ot).uniforms.uSize.value.z=i)}get width(){return l(this,Kt)}get height(){return l(this,Lr)}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)}}[l(this,de).position]}show(){l(this,de).visible=!0,this.dirty=!0}hide(){l(this,de).visible=!1,l(this,qe)&&(l(this,Ko).remove(l(this,qe)),We(l(this,qe))),I(this,qe,void 0),l(this,ot)&&l(this,ot).dispose(),I(this,ot,void 0),I(this,Bn,void 0)}insertIntoQuadTree(e){l(this,Bn)!=null&&typeof l(this,de).onClick=="function"&&e.insert(l(this,Bn))}resize(e,i){if(l(this,de).visible!==!0)return;I(this,Qt,e),I(this,Or,i);let n=this.getPositionAlignedCanvasCoordinates(l(this,Qt),l(this,Or)),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(l(this,Kt),l(this,Lr)),p=Math.min(l(this,Qt)-l(this,Kt),Math.max(0,n.x+o.x+a.x)),c=Math.min(l(this,Or)-l(this,Lr),Math.max(0,n.y+o.y+a.y));this.setSize(l(this,Kt)/l(this,Qt),l(this,Lr)/l(this,Or)),this.setXY(p/l(this,Qt),c/l(this,Or)),I(this,Bn,new Ge(p,c,l(this,Kt),l(this,Lr),{entityId:"watermark"}))}update(){this.dirty&&l(this,de).visible===!0&&(I(this,Kt,Math.min(l(this,Qt),Math.max(this.minWidth,this.defaultWidth*l(this,de).scale))),I(this,Lr,l(this,Kt)/this.aspectRatio),qo.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(I(this,ot,new ma({uniforms:{uTexture:{value:e},uSize:{value:new Iy(0,0,0,0)},uOpacity:{value:.7}},vertexShader:q5,fragmentShader:$5,depthWrite:!1,depthTest:!1,defines:{debug:i7},wireframe:i7,transparent:!0,visible:!0})),l(this,qe))l(this,qe).material=l(this,ot),l(this,qe).material.needsUpdate=!0;else{let i=new Vr(2,2,1,1);I(this,qe,new Me(i,l(this,ot))),l(this,qe).position.set(0,0,-1),l(this,qe).frustumCulled=!1,l(this,qe).renderOrder=999;let n=new Dy(1,1,1),o=new Me(n,new lr({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.layers.set(1),l(this,qe).add(o),l(this,Ko).add(l(this,qe))}this.resize(l(this,Qt),l(this,Or)),this.publish("texture-loaded")})),this.dirty=!1}destroy(){this.hide()}};de=new WeakMap,Jo=new WeakMap,Ko=new WeakMap,qe=new WeakMap,ot=new WeakMap,Bn=new WeakMap,Kt=new WeakMap,Lr=new WeakMap,Qt=new WeakMap,Or=new WeakMap,s(L1,"WatermarkSystem");var fu=L1;m();var O1=100,_T=!1,_1=class _1 extends Z{constructor(e,i){super();h(this,"currentTotalBoundingBox");h(this,"state");h(this,"cameraSystem");h(this,"debugMesh",null);h(this,"dirty",!1);h(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Nr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new W(0,0,0),new W(O1*2,O1*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(O1))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let e of this.state.geometry2DMap.values())e.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(e.position),e.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new W),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new Ey).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,_T&&this.state.entityScene.parent instanceof Un&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Me(new Ny(this.cameraSystem.panBounds.radius),new lr({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};s(_1,"PanBoundsSystem");var yu=_1;m();var n7="\xA9 Mappedin",AT="https://info.mappedin.com/feedback",A1=["top-left","top-right","bottom-left","bottom-right"],kT=640,BT=s(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),o7={custom:[],position:"bottom-right"},k1=class k1{constructor(t){h(this,"controlContainerEl");h(this,"controlPositions");h(this,"compact");h(this,"attribContainerEl");h(this,"attribInnerEl");h(this,"attribButtonEl");h(this,"feedbackLinkEl");h(this,"attribHTML",n7);h(this,"customAttributions",[]);h(this,"toggleAttribution",s(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=A1.reduce((e,i)=>{let n=document.createElement("div");return n.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(n),e[i]=n,e},{})}addAttributionControl(t=o7){let e=t.position&&A1.includes(t.position)?t.position:o7.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=BT(),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),this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=AT,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="nofollow noopener noreferrer",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=[n7],i=t.style.sourceCaches;for(let n in i){let o=i[n];if(o.used||o.usedForTerrain){let a=o.getSource();a.attribution&&e.indexOf(a.attribution)<0&&e.push(a.attribution)}}e=e.filter(n=>String(n).trim()),e=e.filter((n,o)=>{for(let a=o+1;a<e.length;a++)if(e[a].indexOf(n)>=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<=kT||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}};s(k1,"HTMLControlsSystem");var gu=k1;m();var rl,B1=class B1{constructor(t,e){h(this,"mesh");h(this,"type","custom-geometry");h(this,"dirty",!0);h(this,"feature");h(this,"builder");h(this,"outline");h(this,"color",new be);P(this,rl,0);this.mesh=new At,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}setOpacity(){}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return l(this,rl)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,rl,t))}};rl=new WeakMap,s(B1,"CustomGeometryComponent");var Qo=B1;m();var R1=class R1{constructor(t){h(this,"state");this.state=t}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(t=n.components[0],e=n.components[1],t.dirty&&e.visible!==!1&&(t.builder.setup(t.mesh),t.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};s(R1,"CustomGeometrySystem");var vu=R1;m();m();var F1=class F1 extends Me{constructor(){super(...arguments);h(this,"userData",{entityId:""})}};s(F1,"EntityMesh");var bu=F1,RT=R.object({flipImageToFaceCamera:R.boolean().optional(),url:R.string()}),FT=R.object({type:R.enum(["Feature"]),properties:R.object({width:R.number(),height:R.number(),rotation:R.number().min(0).max(360).optional(),verticalOffset:R.number().optional()}),geometry:Jp});function a7(r,t,e){R.union([R.number(),R.string()]).parse(r),FT.parse(t),RT.parse(e)}s(a7,"validateImage");var N1=class N1{constructor(t){h(this,"mesh",new At);h(this,"imageMesh");h(this,"outline");h(this,"type","image");h(this,"instanceIndex",-1);h(this,"geometry");h(this,"material");h(this,"feature");h(this,"position",new W);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};s(N1,"ImageComponent");var Cu=N1;var s7=Math.PI*2,l7=Math.PI/2,c7=Math.PI*1.5,NT=.01,GT=!1,G1=class G1 extends Z{constructor(e,i){super();h(this,"rendererState");h(this,"convertTo3DMapPosition");h(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}createImageMesh(e,i,n,o=0,a){var y;let p=new ur({transparent:!0,depthWrite:!1,side:Rr}),c=new Vr(n.width,n.height),u=new bu(c);if(u.visible=!1,GT){let g=new Me(new Vr(n.width,n.height),new ur({color:"gray"}));u.add(g)}(y=this.getOrDownloadImage(i))==null||y.then(g=>{p.map=g,p.needsUpdate=!0,p.map.colorSpace=Fr,u.visible=!0,this.publish("image-loaded")}),u.userData.entityId=e,u.material=p;let f=this.convertTo3DMapPosition(a);return u.renderOrder=1,u.position.set(f.x,f.y,o+NT),u.rotation.z=le.degToRad(n.rotation||0),u}getOrDownloadImage(e){if(this.imageLoadingCache.has(e))return this.imageLoadingCache.get(e);{let i=new Promise(n=>{qo.getLoader().load(e,o=>{n(o)})});return this.imageLoadingCache.set(e,i),i}}flipIfNeeded(e,i){let o=(e.imageMesh.rotation.z-i+s7)%s7;(o>l7&&o<c7||o<-l7&&o>-c7)&&(e.imageMesh.rotation.z=e.imageMesh.rotation.z+Math.PI)}update(e){var a,p,c,u,f;let i,n,o;for(let y of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(y),(i==null?void 0:i.type)==="image")n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null&&(n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)),n.imageMesh&&o.flipImageToFaceCamera&&this.flipIfNeeded(n,e);else if((i==null?void 0:i.type)==="geometry"){if(n=i.components[0],o=i.components[1],o.showImage&&((a=n.feature.properties)!=null&&a.image)&&n.imageMesh==null&&n.mesh!=null&&n.mesh.parent!=null&&((p=n.feature.properties)==null?void 0:p.image.position)!=null){let g=this.createImageMesh(y,(c=n.feature.properties)==null?void 0:c.image.path,(u=n.feature.properties)==null?void 0:u.image,o.height,(f=n.feature.properties)==null?void 0:f.image.position);n.mesh.parent.add(g),n.imageMesh=g}n.imageMesh&&(o.showImage&&!n.imageMesh.visible?n.imageMesh.visible=!0:!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1),o.flipImageToFaceCamera&&this.flipIfNeeded(n,e))}}};s(G1,"ImageSystem");var Su=G1;m();var VT=!1,Ri,V1=class V1 extends Z{constructor(e,i){super();h(this,"cameraDirty",!0);h(this,"focusablesDirty",!0);h(this,"state");h(this,"camera");h(this,"debugEl",null);h(this,"raycasters",[]);h(this,"collisions",new Map);h(this,"focusableEntities",new Set);P(this,Ri,void 0);h(this,"update",s(()=>{l(this,Ri)&&cancelAnimationFrame(l(this,Ri)),I(this,Ri,requestAnimationFrame(()=>{this.updateRaf()}))},"update"));this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new z(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new z(e.x/1.2,e.y/1.2),n=new z(e.x+(e.x-i.x),i.y),o=new z(i.x,e.y+(e.y-i.y)),a=new z(n.x,o.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,i,n,o,a].map((p,c)=>{if(VT){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 u=p.x/this.state.canvasWidth*2-1,f=-(p.y/this.state.canvasHeight)*2+1,y=new z(u,f),g=new hr;return g.setFromCamera(y,this.camera),[g,y,c===0?10:c<5?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null&&(e=i.components[0],e instanceof ge&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let o=new Me(e.geometry);o.userData={entityId:i.id},e.focusMesh=o}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",null);return}this.collisions.clear();for(let[o,a]of this.raycasters)o.setFromCamera(a,this.camera);let e=null,i,n=-1/0;for(let[o,a,p]of this.raycasters)o.intersectObjects(Array.from(this.focusableEntities.values())).forEach(u=>{if((u==null?void 0:u.object)!=null&&"isMesh"in u.object&&(u!=null&&u.object.isMesh)){i=u.object.userData.entityId,this.collisions.has(i)||this.collisions.set(i,0);let f=this.collisions.get(i)+p;this.collisions.set(i,f),f>n&&(e=i,n=f)}});this.publish("geometry-in-focus",e),this.cameraDirty=!1}destroy(){l(this,Ri)&&cancelAnimationFrame(l(this,Ri)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Ri=new WeakMap,s(V1,"GeometryInFocusSystem");var xu=V1;m();var H1=class H1{constructor(t){h(this,"dirty",!0);h(this,"map");h(this,"stylesheetId","");h(this,"userHiddenLayers",new Set);h(this,"hiddenLayersInStyle",new Set);h(this,"centerPoint");h(this,"handleRender",s(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let t=[],e=this.map.project(this.centerPoint),i=this.map.queryRenderedFeatures(e,{layers:Array.from(this.hiddenLayersInStyle)});for(var n of i)t.push(["!=",["id"],n.id]);t.length>0&&(this.hiddenLayersInStyle.forEach(o=>{this.map.setFilter(o,["all",...t])}),this.dirty=!1)},"handleRender"));h(this,"handleStyleChange",s(t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}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))}};s(H1,"OutdoorLayers");var Mu=H1;m();m();m();var j1="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 X1='#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 p7="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 WT=new Zn;function u7(r,t){let{nearRadius:e,farRadius:i,color:n,accentColor:o,completeFraction:a,isVertical:p}=t,c=!0,u=0,f=1/0,y=t.displayArrowsOnPath,g=!p,C=!0,x=y,M=e/2+UT,v=0;r[0].z+=M;for(let te=1;te<r.length;++te){r[te].z+=M;let ce=r[te].x-r[te-1].x,je=r[te].z-r[te-1].z;if(p)v+=Math.sqrt(ce*ce+je*je);else{let ct=r[te].y-r[te-1].y;v+=Math.sqrt(ce*ce+ct*ct+je*je)}}if(!p){let te=M-.01;r.push(r[r.length-1].clone().setZ(te)),r.unshift(r[0].clone().setZ(te))}let S=new Ty;x&&(S=WT.load(p7),S.colorSpace=Fr);let E=new be(n),w=new be(o),T={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new z(1,1)},cameraParameters:{type:"v2",value:new z(u,0)},complete:{type:"f",value:c?0:1},color:{type:"c",value:E},pathLength:{type:"f",value:v},nearRadius:{type:"f",value:e},farRadius:{type:"f",value:i},nearZoom:{type:"f",value:u},farZoom:{type:"f",value:f},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:p},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:S},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:g?.05:1},showPulse:{type:"b",value:C},opacityMultiplier:{type:"f",value:1}},D=new Ry(r);D.curveType="catmullrom",D.tension=0;let _=30,N=8,V=_*r.length,F=new Gy(D,V,e,N,!1),X=new Float32Array(F.attributes.position.count);for(let te=r.length;te<X.length;te++)X[te]=te;F.setAttribute("vertexIndex",new da(X,1));let j=new Float32Array(F.attributes.position.count),ee=new da(j,1);for(let te=0;te<=V;te++)for(let ce=0;ce<=N;++ce)ee.setX(te*(N+1)+ce,te/V);F.setAttribute("pathDistance",ee);let ve=new Float32Array(F.attributes.normal.count*3),Se=new da(ve,3);for(let te=0;te<V;te++){let ce=F.tangents[te];for(let je=0;je<=N;++je)Se.setXYZ(te*(N+1)+je,ce.x,ce.y,ce.z)}F.setAttribute("pathTangent",Se);let we=new Float32Array(F.attributes.normal.count*3),He=new da(we,3);for(let te=0;te<V;te++){let ce=F.tangents[te];var lt,xe,ke;p?(lt=ce.x*ce.y,xe=-1+ce.y*ce.y,ke=ce.z*ce.y):(lt=-ce.x*ce.z,xe=-ce.y*ce.z,ke=1-ce.z*ce.z);let je=Math.sqrt(lt*lt+xe*xe+ke*ke);je===0&&(je=1);let ct=lt/je,Br=xe/je,Xn=ke/je;for(let Ui=0;Ui<=N;++Ui)He.setXYZ(te*(N+1)+Ui,ct,Br,Xn)}F.setAttribute("pathNormal",He);let Ee=new ma({uniforms:T,vertexShader:j1,fragmentShader:X1});Ee.transparent=!0,Ee.alphaTest=.5,T.resolution.value.x=1,T.resolution.value.y=1,T.vertexes.value=X.length,T.arrowTexture.value.wrapS=sr,T.arrowTexture.value.wrapT=sr,T.arrowTexture.value.anisotropy=16,T.complete.value=a;let Bt=new Me(F,Ee),bt=Bt.clone(),Je={...T,opacityMultiplier:{type:"f",value:.25}};Je.complete.value=1,bt.material=new ma({uniforms:Je,vertexShader:j1,fragmentShader:X1}),bt.material.transparent=!0,bt.material.alphaTest=.5,bt.material.depthWrite=!1,bt.material.depthTest=!1,bt.renderOrder=1,Je.resolution.value.x=1,Je.resolution.value.y=1,Je.vertexes.value=X.length,Je.arrowTexture.value.wrapS=sr,Je.arrowTexture.value.wrapT=sr,Je.arrowTexture.value.anisotropy=16,Je.complete.value=a;let Wi=t.mesh;Wi.add(Bt),Wi.add(bt),F.computeBoundingBox();let jn=new W;return F.boundingBox.getCenter(jn),{mesh:Wi,material:Ee,center:jn}}s(u7,"buildPath");var UT=.15;var W1=class W1 extends Z{constructor(e,i,n){super();h(this,"rendererState");h(this,"altitudeDirty",!0);h(this,"convertTo3DMapPosition");h(this,"getParentContainer");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=n}update(e,i,n){let o,a=!1;for(let p of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(p),o&&o.type==="path"&&o.components[0].type==="path"){let c=o.components[0],u=c.isVertical&&this.altitudeDirty;if(c.dirty||u){if(c.mesh.parent!=null)for(let y=c.mesh.children.length-1;y>=0;y--)We(c.mesh.children[0]);let f=[];if(c.feature.features.forEach(y=>{let g=y.geometry.coordinates[2]||0,C;if(y.properties.parentId&&(C=this.getParentContainer(y.properties.parentId,!0),C!=null&&C.altitude!=null&&(g+=C.altitude,c.isVertical=!0)),!y.properties.parentId||C!=null&&C.visible){let x=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],g);f.push(x)}}),f.length>1){let{mesh:y,material:g,center:C}=u7(f,c);c.mesh=y,c.material=g,c.position=C}c.dirty=!1}c.material&&(c.material.uniforms.nearZoom.value=e,c.material.uniforms.farZoom.value=i,c.material.uniforms.cameraParameters.value.x=n,c.displayArrowsOnPath&&c.animateArrowsOnPath&&(c.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,a=!0),c.material.needsUpdate=!0)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};s(W1,"PathSystem");var il=W1;m();var _e,ea,er,U1=class U1{constructor(t){h(this,"rendererState");h(this,"dirty",!1);P(this,_e,void 0);P(this,ea,void 0);P(this,er,void 0);this.rendererState=t}updateOne(t){var e;if(t instanceof he&&t.components[0]instanceof ge&&t.components[1]instanceof zt&&t.parent instanceof Ne&&(I(this,_e,t.components[0]),I(this,er,t.components[1]),l(this,_e).detached&&l(this,_e).dirty&&l(this,_e).geometry!=null&&l(this,_e).material!=null)){I(this,ea,t.parent),(e=l(this,_e).mesh)==null||e.setVisibleAt(l(this,_e).instanceIndex,!1);let i=new be(l(this,er).color),n=new Uo({color:i,side:Rr,opacity:l(this,er).opacity||1,transparent:l(this,er).opacity!==void 0?l(this,er).opacity<1:!1},1,l(this,_e).material.repeatYFactor),o=new Tr(1,l(this,_e).geometry.attributes.position.count||0,0,n);o.addGeometry(l(this,_e).geometry),o.userData={entities:{0:t.id},detached:!0},l(this,_e).instanceIndex=0,l(this,_e).material.setColor(l(this,_e).instanceIndex,i,l(this,er).topColor?new be(l(this,er).topColor):i),l(this,_e).mesh=o,l(this,_e).material=n,l(this,ea).add(o),l(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(){I(this,_e,void 0),I(this,ea,void 0),I(this,er,void 0)}};_e=new WeakMap,ea=new WeakMap,er=new WeakMap,s(U1,"MeshDetachmentSystem");var Pu=U1;m();m();function h7(r,t,e){var i;if(r.geometry!=null){let n=t||1e-4,o=n/r.currentHeight,a=n/e;r.geometry.scale(1,1,o),r.material&&(r.material.repeatYFactor=a),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=n}}s(h7,"updateHeight");var Rn,Fi,Y1=class Y1{constructor(t){h(this,"rendererState");h(this,"dirty",!1);P(this,Rn,void 0);P(this,Fi,void 0);this.rendererState=t}updateOne(t){var e;t instanceof he&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(I(this,Rn,t.components[0]),I(this,Fi,t.components[1]),t.type==="geometry"&&l(this,Fi).height!==l(this,Rn).currentHeight&&h7(l(this,Rn),l(this,Fi).height,l(this,Fi).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){I(this,Rn,void 0),I(this,Fi,void 0)}};Rn=new WeakMap,Fi=new WeakMap,s(Y1,"MeshModificationSystem");var Tu=Y1;m();var nl,Z1=class Z1{constructor(t){P(this,nl,void 0);I(this,nl,t)}update(){var t;(t=l(this,nl)._subscribers["pre-render"])==null||t.forEach(e=>e())}};nl=new WeakMap,s(Z1,"PreRenderSystem");var Iu=Z1;var d7=new hr;var{DEFAULT_PITCH:J1,DEFAULT_BEARING:K1,DEFAULT_ZOOM_LEVEL:Q1,DEFAULT_MIN_ZOOM_LEVEL:YT,DEFAULT_MAX_ZOOM_LEVEL:ZT}=Xo,zT=le.radToDeg(.698132),gt,De,ol,ta,Ni,Fn,ra,al,q1,O,me,tr,Te,_r,Tt,L,sl,Ae,Ce,wu,m7,Eu,f7,Du,y7,Gi,ll,cl,ia,Lu,pl,ul,hl,na,dl,$1,Nn,ml,at,st,ey=class ey extends Z{constructor(e,i={}){var g,C,x,M,v,S,E,w,T,D;super();P(this,al);P(this,wu);P(this,Eu);P(this,Du);P(this,dl);h(this,"options");h(this,"container");P(this,gt,void 0);P(this,De,void 0);P(this,ol,void 0);P(this,ta,void 0);P(this,Ni,void 0);P(this,Fn,void 0);P(this,ra,void 0);h(this,"rendererDomElement");P(this,O,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Oe("__scene"),hoverColor:"red",insetsPadding:Yp,shouldMeasureCanvas:!0,pixelRatio:Li(),canvasWidth:0,canvasHeight:0});h(this,"camera");P(this,me,void 0);P(this,tr,void 0);P(this,Te,void 0);P(this,_r,void 0);P(this,Tt,void 0);P(this,L,{});P(this,sl,window.matchMedia("screen and (min-resolution: 2dppx)"));h(this,"map");P(this,Ae,s(()=>{l(this,L).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));P(this,Ce,s(()=>{l(this,L).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));P(this,Gi,"standalone");P(this,ll,s(e=>Math.trunc(e*10)/10,"#round10"));P(this,cl,s(()=>{l(this,L).twoDDrawSystem.dirty=!0,Y(this,al,q1).call(this,Li()),l(this,L).watermarkSystem.dirty=!0,this.render()},"#handlePixelRatioChange"));P(this,ia,s(()=>{l(this,O).canvasWidth=this.rendererDomElement.clientWidth,l(this,O).canvasHeight=this.rendererDomElement.clientHeight,Y(this,al,q1).call(this,Li()),l(this,na).call(this),Y(this,Du,y7).call(this),l(this,L).cameraSystem.resize(this.canvasWidth,this.canvasHeight),l(this,L).cameraSystem.dirty=!0,l(this,L).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),l(this,L).htmlControlsSystem.resize(this.canvasWidth),l(this,L).geometryInFocusSystem.resize(),l(this,L).interactionSystem.resize(),this.render()},"#handleWindowResize"));P(this,Lu,s(()=>{this.renderSync()},"#renderFull"));P(this,pl,new W);P(this,ul,s((e,i)=>{let n=this.mode==="standalone"?l(this,De):this.viewCamera;if(l(this,De).position.z+this.camera.elevation>i.z){l(this,pl).copy(i);let o=l(this,pl).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,p=(-o.y+1)/2*this.canvasHeight-0/2,c=l(this,ll).call(this,a),u=l(this,ll).call(this,p);e.x=c,e.y=u}else e.x=-1e3,e.y=-1e3},"#project"));P(this,hl,s((e,i)=>{l(this,Tt).setBufferSize(e,i),l(this,De).aspect=e/i,l(this,De).updateProjectionMatrix(),l(this,De).updateMatrixWorld(!0),l(this,ta).x=e,l(this,ta).y=i},"#setBufferSize"));P(this,na,s(()=>{var a;let e=l(this,O).canvasWidth=this.rendererDomElement.clientWidth,i=l(this,O).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(e*this.resolutionScale),o=Math.floor(i*this.resolutionScale);l(this,hl).call(this,n,o),(a=this.map)==null||a.resize(),l(this,O).shouldMeasureCanvas=!1},"#measureCanvas"));h(this,"getParentContainer",s((e,i=!0)=>{if(!e)return i?l(this,O).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let n=l(this,O).geometry3DMap.get(e);return n instanceof Oe?n:(k.warn("Parent is not a valid container, adding to scene"),i?l(this,O).entityScene:void 0)}else if(e.type==="group-container"){let n=l(this,O).geometry3DMap.get(e.id);if(n instanceof Oe)return n}return i?l(this,O).entityScene:void 0},"getParentContainer"));h(this,"showCollisionBoxes",s(()=>{l(this,L).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));h(this,"hideCollisionBoxes",s(()=>{l(this,L).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));h(this,"projectScreenXYToCoordinate",s((e,i)=>{var c;let n=e/this.canvasWidth*2-1,o=-(i/this.canvasHeight)*2+1,a=new z(n,o);d7.setFromCamera(a,l(this,De).clone());let p=(c=d7.intersectObject(l(this,Ni),!1)[0])==null?void 0:c.point;return p!=null?this.convert3DMapPositionToCoordinate(p):void 0},"projectScreenXYToCoordinate"));h(this,"projectCoordinateToScreenXY",s(e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),n=new z;return l(this,ul).call(this,n,i),{x:n.x,y:n.y}},"projectCoordinateToScreenXY"));h(this,"convert3DMapPositionToCoordinate",s(e=>{var o,a,p,c;let{lat:i,lon:n}=wp((a=(o=l(this,O).center)==null?void 0:o[1])!=null?a:0,(c=(p=l(this,O).center)==null?void 0:p[0])!=null?c:0,e.x,e.y);return[n,i,e.z]},"convert3DMapPositionToCoordinate"));h(this,"setBackgroundColor",s((e,i)=>{l(this,Tt).setBackgroundColor(e,i)},"setBackgroundColor"));h(this,"getMetresPerPixel",s(()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i),o=this.projectScreenXYToCoordinate(e,i);return n==null||o==null?void 0:_4(n,o)/e},"getMetresPerPixel"));h(this,"hideOutdoorLayersUnderPoint",s((e,i)=>{!this.map||(i==null?void 0:i.length)===0||(l(this,L).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())},"hideOutdoorLayersUnderPoint"));P(this,Nn,new _y);P(this,ml,new Gr);h(this,"render",s(()=>{l(this,L).renderSystem!=null&&(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay")?this.map.triggerRepaint():l(this,L).renderSystem.update())},"render"));h(this,"renderSync",s(()=>{l(this,L).renderSystem.update(!0)},"renderSync"));P(this,at,Oi(()=>{this.publish("user-interaction-start",void 0)},0,!0));P(this,st,Oi(()=>{this.publish("user-interaction-end",void 0)},0,!0));h(this,"on",s((e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&b.env.NODE_ENV!=="test"&&(k.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))},"on"));h(this,"off",s((e,i)=>{super.off(e,i)},"off"));h(this,"getCursor",s(()=>l(this,L).interactionSystem.getCursor(),"getCursor"));h(this,"destroy",s(()=>{l(this,L).cameraSystem.off("user-dolly-start",l(this,at)),l(this,L).cameraSystem.off("user-pan-start",l(this,at)),l(this,L).cameraSystem.off("user-rotate-start",l(this,at)),l(this,L).cameraSystem.off("user-zoom-start",l(this,at)),l(this,L).cameraSystem.off("user-tilt-start",l(this,at)),l(this,L).cameraSystem.off("user-pedestal-start",l(this,at)),l(this,L).cameraSystem.off("user-dolly-end",l(this,st)),l(this,L).cameraSystem.off("user-pan-end",l(this,st)),l(this,L).cameraSystem.off("user-rotate-end",l(this,st)),l(this,L).cameraSystem.off("user-zoom-end",l(this,st)),l(this,L).cameraSystem.off("user-tilt-end",l(this,st)),l(this,L).cameraSystem.off("user-pedestal-end",l(this,st)),l(this,L).renderSystem.off("measure-canvas",l(this,na)),this.remove("__scene"),l(this,Ae).call(this),l(this,Ce).call(this),this.renderSync(),l(this,L).renderSystem.destroy(),l(this,L).zoomInterpolationSystem.destroy(),l(this,L).renderSystem.destroy(),l(this,L).cameraSystem.off("change",this.render),l(this,L).pathSystem.off("animate:path",this.render),l(this,L).cameraSystem.dispose(),l(this,L).exporterSystem.destroy(),l(this,L).outdoorLayersSystem.destroy(),l(this,L).drawSystem.destroy(),window.removeEventListener("resize",l(this,ia),!1),l(this,sl).removeEventListener("change",l(this,cl)),l(this,Fn)&&l(this,Fn).disconnect(),this._subscribers={},l(this,Tt).destroy(),l(this,gt).traverse(e=>{We(e),"dispose"in e&&typeof e.dispose=="function"&&e.dispose()}),I(this,gt,void 0),l(this,L).htmlControlsSystem.destroy(),l(this,L).collisionSystem.destroy(),l(this,L).domMutationSystem.destroy(),l(this,L).geometryInFocusSystem.destroy(),I(this,L,void 0),l(this,Gi)!=="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(l(this,_r)),this.container.removeChild(l(this,me)),I(this,Tt,void 0)},"destroy"));this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(I(this,Gi,i.mode),this.map=i.map),l(this,O).entityScene.addEventListener("childadded",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),l(this,O).entityScene.addEventListener("childremoved",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),l(this,O).geometry3DMap.set(l(this,O).entityScene.userData.entityId,l(this,O).entityScene),i.center&&(l(this,O).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,Y(this,wu,m7).call(this),Y(this,Eu,f7).call(this),l(this,L).htmlControlsSystem=new gu(this.container),l(this,Gi)!=="outdoors-overlay"&&l(this,L).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),b.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),I(this,Tt,new Ap({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(g=i.gl)==null?void 0:g.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:()=>{typeof i.onWebGLContextLost=="function"&&i.onWebGLContextLost()},onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),l(this,Ae).call(this),l(this,Ce).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(C=i.backgroundAlpha)!=null?C:1})),I(this,gt,new Un),l(this,gt).add(l(this,O).entityScene);let n=window.__THREE_DEVTOOLS__;b.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:l(this,gt)})),n.dispatchEvent(new CustomEvent("observe",{detail:l(this,Tt)}))),I(this,De,new Oy(zT,this.aspect,50,1e5)),I(this,ol,new Ly),l(this,De).renderOrder=999;let o=new Rt;o.add(l(this,De)),I(this,ra,new Rt),l(this,ra).add(o),l(this,gt).add(l(this,ra)),l(this,De).updateProjectionMatrix(),l(this,De).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=l(this,Tt).domElement(),I(this,ta,new z);let a=new Vr(1e6,1e6),p=new lr({color:0,visible:!1});I(this,Ni,new Me(a,p)),l(this,gt).add(l(this,Ni)),(x=i.gl)!=null&&x.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",l(this,ia),!1),l(this,sl).addEventListener("change",l(this,cl)),typeof ResizeObserver=="function"&&((M=b.env)==null?void 0:M.NODE_ENV)!=="test"&&(I(this,Fn,new ResizeObserver(Oi(()=>{l(this,ia).call(this)},0))),(v=l(this,Fn))==null||v.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(S=globalThis.MappedinDebug)!=null&&S.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(E=globalThis.MappedinDebug)!=null&&E.TEST_IOS?"1920px":"100%",b.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),l(this,O).canvasWidth=this.rendererDomElement.clientWidth,l(this,O).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,u=this.canvasHeight;l(this,L).watermarkSystem=new fu(l(this,De),l(this,O),i==null?void 0:i.watermark),l(this,L).watermarkSystem.on("texture-loaded",this.render),l(this,O).shouldMeasureCanvas=!0,l(this,O).pixelRatio=this.resolutionScale,l(this,hl).call(this,Math.floor(c*this.resolutionScale),Math.floor(u*this.resolutionScale));let f=new Xl(16777215,.3*Math.PI);f.position.set(-150,-150,350),l(this,gt).add(f);let y=new Hy(16777215,.741*Math.PI);l(this,gt).add(y),l(this,L).cameraSystem=new Qs(l(this,De),l(this,gt),l(this,Tt).renderer,l(this,O),{mode:this.mode,canvasHeight:u,canvasWidth:c}),l(this,L).cameraSystem.on("user-dolly-start",l(this,at)),l(this,L).cameraSystem.on("user-pan-start",l(this,at)),l(this,L).cameraSystem.on("user-rotate-start",l(this,at)),l(this,L).cameraSystem.on("user-zoom-start",l(this,at)),l(this,L).cameraSystem.on("user-tilt-start",l(this,at)),l(this,L).cameraSystem.on("user-pedestal-start",l(this,at)),l(this,L).cameraSystem.on("user-dolly-end",l(this,st)),l(this,L).cameraSystem.on("user-pan-end",l(this,st)),l(this,L).cameraSystem.on("user-rotate-end",l(this,st)),l(this,L).cameraSystem.on("user-zoom-end",l(this,st)),l(this,L).cameraSystem.on("user-tilt-end",l(this,st)),l(this,L).cameraSystem.on("user-pedestal-end",l(this,st)),l(this,L).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),l(this,L).geometryInFocusSystem&&(l(this,L).geometryInFocusSystem.cameraDirty=!0),this.render()}),l(this,L).pathSystem=new il(l(this,O),this.convertTo3DMapPosition,this.getParentContainer),l(this,L).pathSystem.on("animate:path",this.render),l(this,L).panBoundsSystem=new yu(l(this,O),l(this,L).cameraSystem),l(this,L).panBoundsSystem.on("update",()=>{let{panBounds:_,fov:N,convertAltitudeToZoomLevel:V}=l(this,L).cameraSystem;if(l(this,L).panBoundsSystem.autoMinZoomLevel){let F=N*Math.PI/180,X=Math.tan(F/2),j=V(_.radius/X);this.camera.setMinZoomLevel(j)}}),this.camera=new mu(this,l(this,L),l(this,O),l(this,Ni)),this.camera.setZoomLevel((w=i.zoomLevel)!=null?w:Q1),this.camera.setBearing((T=i.bearing)!=null?T:K1),this.camera.setPitch((D=i.pitch)!=null?D:J1),this.camera.setMaxZoomLevel(ZT),this.camera.setMinZoomLevel(YT),l(this,L).domVisiblitySystem=new Qp(l(this,O),l(this,_r)),l(this,L).domMutationSystem=new du(l(this,O),l(this,_r)),l(this,L).domMutationSystem.on("dimensions-update",()=>{l(this,L).collisionSystem.dirty=!0,this.render()}),l(this,L).domDrawSystem=new uu(l(this,O)),l(this,L).collisionSystem=new Bp(l(this,tr),l(this,O)),l(this,L).twoDDrawSystem=new tu(l(this,O),l(this,Te)),l(this,L).interactionSystem=new Ns(this.rendererDomElement,l(this,O),l(this,De),l(this,Ni)),l(this,L).interactionSystem.on("hover",this.render),l(this,L).interactionSystem.on("click",_=>{var N,V,F,X,j;if(((N=_.entity2D)==null?void 0:N.id)==="watermark"&&typeof l(this,L).watermarkSystem.options.onClick=="function"){l(this,L).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(_.position),geometry:_.entity3D?[(V=_.entity3D)==null?void 0:V.id]:[],markers:((F=_.entity2D)==null?void 0:F.components[0])instanceof Ot?[_.entity2D.id]:[],models:((X=_.entity3D)==null?void 0:X.components[0])instanceof ki?[_.entity3D.id]:[],labels:((j=_.entity2D)==null?void 0:j.components[0])instanceof wr?[_.entity2D.id]:[],containers:Array.isArray(_.groupContainers)?_.groupContainers.map(ee=>ee.userData.entityId):[],pointerEvent:_.pointerEvent})}),l(this,L).interactionSystem.on("hover",_=>{var N,V,F,X,j;_.position&&((N=_.entity2D)==null?void 0:N.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(_.position),geometry:_.entity3D?[(V=_.entity3D)==null?void 0:V.id]:[],markers:((F=_.entity2D)==null?void 0:F.components[0])instanceof Ot?[_.entity2D.id]:[],models:((X=_.entity3D)==null?void 0:X.components[0])instanceof ki?[_.entity3D.id]:[],labels:((j=_.entity2D)==null?void 0:j.components[0])instanceof wr?[_.entity2D.id]:[],containers:Array.isArray(_.groupContainers)?_.groupContainers.map(ee=>ee.userData.entityId):[]})}),l(this,L).geometryInFocusSystem=new xu(l(this,O),l(this,De)),l(this,L).geometryInFocusSystem.on("geometry-in-focus",_=>{this.publish("geometry-in-focus",_)}),l(this,L).twoDVisiblitySystem=new iu(l(this,O)),l(this,L).drawSystem=new ru(l(this,O)),l(this,L).drawSystem.on("texture-loaded",this.render),l(this,L).stackSystem=new au(l(this,O)),l(this,L).twoDProjectionSystem=new eu(l(this,O),l(this,ul)),l(this,L).zoomInterpolationSystem=new Np,l(this,L).exporterSystem=new Gs(l(this,O)),l(this,L).meshOptimizationSystem=new Kp(l(this,O),this.convertTo3DMapPosition),l(this,L).meshOptimizationSystem.on("model-loaded",this.render),l(this,L).meshDetachmentSystem=new Pu(l(this,O)),l(this,L).meshModificationSystem=new Tu(l(this,O)),l(this,L).customGeometrySystem=new vu(l(this,O)),l(this,L).outlineInterpolationSystem=new Bs(l(this,O)),l(this,L).renderSystem=new nu(l(this,Tt),l(this,O),this.mode,l(this,gt),l(this,De),this.viewCamera,l(this,L)),l(this,L).preRenderSystem=new Iu(this),l(this,L).imageSystem=new Su(l(this,O),this.convertTo3DMapPosition),l(this,L).imageSystem.on("image-loaded",this.render),l(this,L).renderSystem.on("measure-canvas",l(this,na)),l(this,L).outdoorLayersSystem=new Mu(this.map),l(this,Lu).call(this)}get viewCamera(){return l(this,ol)}get canvasWidth(){return l(this,O).canvasWidth}get canvasHeight(){return l(this,O).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e.getPixelRatio())!=null?i:Li()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return l(this,Gi)}addGroupContainer(e,i,n){var o;if(!l(this,O).geometry3DMap.has(e)&&!l(this,O).geometry2DMap.has(e)){let a=new Oe(e);a.addEventListener("childadded",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),a.addEventListener("childremoved",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&a.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&ft(a,i.interactive,l(this,O)),l(this,O).geometry3DMap.set(e,a),(o=this.getParentContainer(n))==null||o.addEntity(a),l(this,Ce).call(this),this.render()}else k.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,n){var o;if(l(this,O).geometry3DMap.has(e))k.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let a=new Oe(e);a.addEventListener("childadded",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),a.addEventListener("childremoved",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),a.components[0]=new hu,(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),l(this,O).geometry3DMap.set(e,a),(o=this.getParentContainer(n))==null||o.addEntity(a)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,n,o,a){var p;if(l(this,O).geometry3DMap.has(e))k.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new Qo(i,n),u=new he(c,new zt(o));u.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},l(this,O).geometry3DMap.set(u.id,u),(p=this.getParentContainer(a))==null||p.addEntity(u),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,n,o){var a,p;if(!l(this,O).geometry3DMap.has(e)&&!l(this,O).geometry2DMap.has(e)){let c=new Ne(e,new xn(n));c.addEventListener("childadded",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),c.addEventListener("childremoved",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),c.userData.dirty=!0,l(this,O).geometry3DMap.set(e,c);for(let u of i.features){if(!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(u.geometry.type))continue;let f=u.id||u.properties.id||q(),{visible:y,...g}=n||{color:bp},C=l(this,L).meshOptimizationSystem.createEntityFromFeature(f,u,g);l(this,O).geometry3DMap.set(f,C),c.userData.entities3D.add(f)}c.setVisible((a=n==null?void 0:n.visible)!=null?a:!0),(p=this.getParentContainer(o))==null||p.addEntity(c),l(this,Ce).call(this),this.render()}else k.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return l(this,L).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addImage(e,i,n,o){var a;try{a7(e,i,n)}catch(p){k.error(p);return}if(!l(this,O).geometry3DMap.has(e)&&!l(this,O).geometry2DMap.has(e)){let p=new Cu(i),c=new he(p,new zt(n));c.id=e||q(),p.mesh.userData={entityId:c.id,type:"path"},l(this,O).geometry3DMap.set(c.id,c),(a=this.getParentContainer(o))==null||a.addEntity(c),l(this,Ce).call(this),this.render()}else k.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,n,o){var a;try{j5(e,i,n)}catch(p){k.error(p);return}if(!l(this,O).geometry3DMap.has(e)&&!l(this,O).geometry2DMap.has(e)){let p=new Ne(e,new xn(n));p.addEventListener("childadded",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),p.addEventListener("childremoved",()=>{l(this,Ce).call(this),l(this,Ae).call(this)}),l(this,O).geometry3DMap.set(e,p),p.userData.dirty=!0,p.userData.modelURL=n.url;for(let c of i.features){let u=c.id||c.properties.id||q(),f=l(this,L).meshOptimizationSystem.createModelFromFeature(u,c,n);c.properties.interactive!==void 0&&ft(f,c.properties.interactive,l(this,O)),l(this,O).geometry3DMap.set(u,f),p.userData.entities3D.add(u)}(a=this.getParentContainer(o))==null||a.addEntity(p),l(this,Ce).call(this),this.render()}else k.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,n,o){var p;let a=n==null?void 0:n.id;try{I4(e,i,n||{})}catch(c){k.error(c);return}if(a===void 0||!l(this,O).geometry2DMap.has(a)&&!l(this,O).geometry3DMap.has(a)){let c=Y(this,dl,$1).call(this,e,new Ot(i,n));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&ft(c,n==null?void 0:n.interactive,l(this,O)),(p=this.getParentContainer(o))==null||p.addEntity(c),this.render()}else k.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addLabel2D(e,i,n,o){var p;let a=n==null?void 0:n.id;try{U4(e,i,n||{})}catch(c){k.error(c);return}if(a===void 0||!l(this,O).geometry2DMap.has(a)&&!l(this,O).geometry3DMap.has(a)){let c=Y(this,dl,$1).call(this,e,new wr(i,n||{},l(this,O)));c.id=a||String(c.id),a=c.id,(n==null?void 0:n.interactive)!=null&&ft(c,n==null?void 0:n.interactive,l(this,O)),(p=this.getParentContainer(o))==null||p.addEntity(c),l(this,Ae).call(this),this.render()}else k.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(e,i={},n){var p;let o=new ou(e,i),a=new he(o,new zt);return a.id=(i==null?void 0:i.id)||q(),o.mesh.userData={entityId:a.id,type:"path"},l(this,O).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&ft(a,i==null?void 0:i.interactive,l(this,O)),(p=this.getParentContainer(n))==null||p.addEntity(a),l(this,Ce).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(e){l(this,L).watermarkSystem.options=e,l(this,L).watermarkSystem.dirty=!0,l(this,L).collisionSystem.dirty=!0,this.render()}remove(e){var n;let i;if(typeof e=="string"||typeof e=="number"?(i=l(this,O).geometry2DMap.get(e),i==null&&(i=l(this,O).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=l(this,O).geometry2DMap.get(e.id),i==null&&(i=l(this,O).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")l(this,O).geometry3DMap.delete(i.id),i.object3d&&We(i.object3d);else if(i.type==="group-container"){l(this,O).geometry3DMap.delete(i.userData.entityId);for(let o of i.childrenIds.values())this.remove(o),i.userData.entities2D.delete(o);We(i)}else if(i.type==="geometry-group"){l(this,O).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);We(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let o=i.components[0];i.object3d&&(((n=i.parent)==null?void 0:n.type)==="geometry-group"&&i.parent.userData.entities3D.delete(i.id),We(i.object3d)),o.outline&&We(o.outline),"focusMesh"in o&&o.focusMesh!=null&&We(o.focusMesh),l(this,O).geometry3DMap.delete(i.id)}else i.type==="marker"||i.type==="label"?(i.object3d&&We(i.object3d),i.type==="label"&&delete l(this,L).twoDDrawSystem.textCache[i.id],l(this,O).geometry2DMap.delete(i.id)):i.type==="image"&&(i.object3d&&We(i.object3d),l(this,O).geometry3DMap.delete(i.id));l(this,Ce).call(this),l(this,Ae).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(e){return l(this,L).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(l(this,L).renderSystem.threeDdirty||l(this,L).renderSystem.twoDdirty)&&this.renderSync();let i=new Nr;if(e==null)i.setFromObject(l(this,O).entityScene);else{let n=As(l(this,O),e);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof ge?o.geometry:void 0;o.mesh instanceof Yn&&a?(a.computeBoundingBox(),a.boundingBox&&i.union(a.boundingBox)):i.setFromObject(n.object3d)}else((n==null?void 0:n.type)==="geometry-group"||(n==null?void 0:n.type)==="group-container")&&(n==null?void 0:n.userData.entityId)!=null&&i.setFromObject(n)}if(A4(i))return xf(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var n;if(e==null)return{type:"map-view",hoverColor:l(this,O).hoverColor};let i=As(l(this,O),e);if((i==null?void 0:i.type)==="custom-geometry"){let o=i.components[0],a=i.components[1];return{id:i.id,type:"custom-geometry",visible:a.visible,altitude:a.altitude,parent:(n=i.parent)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(o.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let o=[];for(let p of i.userData.entities3D.values()){let c=this.getState(p);((c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model")&&o.push(c)}let a=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:a.opacity,color:a.color,topColor:a.topColor,outline:a.outline,shading:a.shading,texture:a.texture,topTexture:a.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(p=>l(this,O).geometry3DMap.get(p)).every(p=>p&&p.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(p=>this.getState(p)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(o=>this.getState(o)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let o=i.components[0],a=i.object3d.parent,p=a==null?void 0:a.userData.entityId;return{id:i.id,type:"label",text:o.text||"",parent:{id:p,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:o.enabled,initialRank:Ls(o.initialRank),options:{rank:Ls(o.rank),appearance:o.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let o=i.components[0],a=i.object3d.parent,p=a==null?void 0:a.userData.entityId;return{id:i.id,type:"marker",enabled:o.enabled,parent:{id:p,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),element:o.containerEl,initialRank:Ls(o.initialRank),options:{rank:Ls(o.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:o,hoverColor:a,initialColor:p,topColor:c}=i.components[1],u=i.components[0],f=i.components[1];return{id:i.id,type:"geometry",opacity:f.opacity,color:o,focusable:u.focusable,topColor:c,initialColor:p,hoverColor:a,height:f.height,visible:f.visible,outline:f.outline,showImage:f.showImage,texture:f.texture,topTexture:f.topTexture,flipImageToFaceCamera:f.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(u.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let o=i.components[0],a=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(o.position),interactive:a!=null}}else if((i==null?void 0:i.type)==="path"){let o=i.components[0],a=i.components[2],p=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(o.position),visible:p.visible,interactive:a!=null,completeFraction:o.completeFraction}}else if((i==null?void 0:i.type)==="image"){let o=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(o.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else return}}setState(e,i){var o;if(typeof e=="object"&&"hoverColor"in e&&i==null){l(this,O).hoverColor=(o=e.hoverColor)!=null?o:l(this,O).hoverColor;return}let n=As(l(this,O),e);if(n!=null){if(n.type==="custom-geometry"){let a=l(this,O).geometry3DMap.get(n.id);if(a instanceof he&&a.components[0]instanceof Qo){let p=i;Tn(n,p.visible),Rf(n,p.altitude),Af(n,p.position,this.convertTo3DMapPosition),kf(n,this.getParentContainer(p.parent,!1))}}else if(n.type==="model"||n.type==="path"){let a=i;ft(n,a.interactive,l(this,O))&&l(this,Ce).call(this),n.type==="path"&&(a=a,K4(n,a),Tn(n,a.visible))}else if(n.type==="group-container"){let a=i;Tn(n,a.visible)&&(l(this,L).outlineInterpolationSystem.dirty=!0),Rf(n,a.altitude)&&(l(this,L).pathSystem.altitudeDirty=!0),ft(n,a.interactive,l(this,O))&&l(this,Ce).call(this)}else if(n.type==="geometry-group"){let a=i;Tn(n,a.visible)&&(l(this,L).outlineInterpolationSystem.dirty=!0),Y4(n,l(this,O),a)&&(l(this,L).outlineInterpolationSystem.dirty=!0),Ff(n,a.outline)&&(l(this,L).outlineInterpolationSystem.geometries3DDirty=!0),n5(n,a),Z4(n,a.shading),i5(n,l(this,O),a.opacity),ft(n,a.interactive,l(this,O))&&(l(this,Ce).call(this),l(this,Ae).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof ge){let a=i;Tn(n,a.visible)&&(l(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Ff(n,a.outline)&&(l(this,L).outlineInterpolationSystem.geometries3DDirty=!0),z4(n,a),a.focusable!=null&&(n.components[0].focusable=a.focusable,l(this,L).geometryInFocusSystem.focusablesDirty=!0),a5(n,a.opacity)&&(l(this,L).meshDetachmentSystem.dirty=!0,l(this,L).outlineInterpolationSystem.geometries3DDirty=!0),Bf(n,a.flipImageToFaceCamera),q4(n,a.height)&&(l(this,L).outlineInterpolationSystem.geometries3DDirty=!0),o5(n,a)&&(l(this,L).meshDetachmentSystem.dirty=!0),$4(n,a),r5(n,a.hoverColor),ft(n,a.interactive,l(this,O))}l(this,Ce).call(this)}else if(n.type==="label"||n.type==="marker"){let a=i;t5(n,i,l(this,O)),Q4(n,i,l(this,O))&&l(this,Ae).call(this),Af(n,a.position,this.convertTo3DMapPosition),kf(n,this.getParentContainer(a.parent,!1))&&(l(this,Ae).call(this),l(this,L).panBoundsSystem.dirty=!0),J4(n,a.enabled)}else if(n.type==="image"){let a=i;Tn(n,a.visible),Bf(n,a.flipImageToFaceCamera)}this.render()}}convertTo3DMapPosition(e,i,n=0,o){var c,u,f,y,g;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(c=e[2])!=null?c:n,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:p}=Ep((f=(u=l(this,O).center)==null?void 0:u[1])!=null?f:0,(g=(y=l(this,O).center)==null?void 0:y[0])!=null?g:0,e,i);return o?(o.set(a,p,n),o):new W(a,p,n)}get backgroundColor(){return l(this,Tt).backgroundColor}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?O4(i):void 0}isInView(e){let i=As(l(this,O),e);if(l(this,ml).identity().multiply(l(this,De).projectionMatrix).multiply(l(this,De).matrixWorldInverse),l(this,Nn).setFromProjectionMatrix(l(this,ml)),i instanceof _t)return l(this,Nn).containsPoint(i.position);if(i instanceof he){let n=i==null?void 0:i.components[0];if(n instanceof Qo||n instanceof ki)return l(this,Nn).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof ge){let o=new Nr(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return l(this,Nn).intersectsBox(o)}}return!1}getSystems(){return l(this,L)}getInternalState(){return l(this,O)}};gt=new WeakMap,De=new WeakMap,ol=new WeakMap,ta=new WeakMap,Ni=new WeakMap,Fn=new WeakMap,ra=new WeakMap,al=new WeakSet,q1=s(function(e){var i;l(this,Gi)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),l(this,O).pixelRatio=this.resolutionScale},"#setResolutionScale"),O=new WeakMap,me=new WeakMap,tr=new WeakMap,Te=new WeakMap,_r=new WeakMap,Tt=new WeakMap,L=new WeakMap,sl=new WeakMap,Ae=new WeakMap,Ce=new WeakMap,wu=new WeakSet,m7=s(function(){I(this,me,document.createElement("div")),l(this,me).classList.add("mappedin__smart-collision-engine__container"),I(this,tr,document.createElement("canvas")),l(this,tr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(l(this,me)),I(this,Te,document.createElement("canvas")),l(this,Te).classList.add("mappedin__smart-collision-engine__container"),l(this,Te).width=l(this,me).clientWidth*this.resolutionScale,l(this,Te).height=l(this,me).clientHeight*this.resolutionScale,l(this,Te).style.width=l(this,me).clientWidth+"px",l(this,Te).style.height=l(this,me).clientHeight+"px",l(this,me).appendChild(l(this,tr)),l(this,me).appendChild(l(this,Te)),l(this,tr).width=l(this,me).clientWidth,l(this,tr).height=l(this,me).clientHeight,l(this,Te).width=l(this,me).clientWidth*this.resolutionScale,l(this,Te).height=l(this,me).clientHeight*this.resolutionScale,l(this,Te).style.width=l(this,me).clientWidth+"px",l(this,Te).style.height=l(this,me).clientHeight+"px"},"#renderEntity2DContainer"),Eu=new WeakSet,f7=s(function(){I(this,_r,document.createElement("div")),l(this,_r).classList.add("mappedin-2d-entities"),Object.assign(l(this,_r).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(l(this,_r))},"#renderEntityDOMContainer"),Du=new WeakSet,y7=s(function(){l(this,Te).width=l(this,me).clientWidth*this.resolutionScale,l(this,Te).height=l(this,me).clientHeight*this.resolutionScale,l(this,Te).style.width=l(this,me).clientWidth+"px",l(this,Te).style.height=l(this,me).clientHeight+"px",l(this,tr).width=l(this,me).clientWidth,l(this,tr).height=l(this,me).clientHeight,l(this,Te).width=l(this,me).clientWidth*this.resolutionScale,l(this,Te).height=l(this,me).clientHeight*this.resolutionScale,l(this,Te).style.width=l(this,me).clientWidth+"px",l(this,Te).style.height=l(this,me).clientHeight+"px",l(this,L).collisionSystem.dirty=!0},"#resizeCollisionCanvas"),Gi=new WeakMap,ll=new WeakMap,cl=new WeakMap,ia=new WeakMap,Lu=new WeakMap,pl=new WeakMap,ul=new WeakMap,hl=new WeakMap,na=new WeakMap,dl=new WeakSet,$1=s(function(e,i,n){let o=new _t(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||n||0));return l(this,O).geometry2DMap.set(o.id,o),o},"#createEntity2D"),Nn=new WeakMap,ml=new WeakMap,at=new WeakMap,st=new WeakMap,s(ey,"Core");var z1=ey,fl=z1;m();function qT(r,t){$T(r,t)(r.getScene(),t),JT(r,t),t.addFolder("Export").add({export:async()=>{let n=await r.getCurrentSceneGLTF({binary:!0}),o=new Blob([n],{type:"application/octet-stream"});var a=document.createElement("a");document.body.appendChild(a),a.style.display="none";let p=window.URL.createObjectURL(o);a.href=p,a.download="scene.glb",a.click(),window.URL.revokeObjectURL(p)}},"export")}s(qT,"mountSceneGraphVisualizer");function $T(r,t){let e=t;return s(function i(n,o){let a=o.addFolder("".concat([n.type]," ").concat(n.id.slice(0,16)));if(o.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let p={get height(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.height:0},set height(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(n,{height:c})},set flipImageToFaceCamera(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="image"&&r.setState(n,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="image"?c.flipImageToFaceCamera:!1},set visible(c){let u=r.getState(n.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?c.visible:!1},set outline(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(n,{outline:c})},get outline(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"?c.outline:!1},get color(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"&&c.color?G(c.color).toHexString():"#ffffff"},set color(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry"&&r.setState(u,{color:c})},set interactive(c){let u=r.getState(n.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(r.setState(n,{interactive:c}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry"||(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"?c.interactive:!1},get completeFraction(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="path"?c.completeFraction:1},set completeFraction(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="path"&&r.setState(u,{completeFraction:c})},focus:()=>{}};a.add(p,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="model"||(c==null?void 0:c.type)==="path"||(c==null?void 0:c.type)==="image"?r.camera.focusOn([c.position]):(c==null?void 0:c.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(c))}),a.add(p,"visible"),n.type==="image"?a.add(p,"flipImageToFaceCamera"):(a.add(p,"interactive"),n.type==="path"&&a.add(p,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(p,"color"),a.add(p,"outline"))),n.type==="geometry"&&a.add(p,"height")}else if(n.type==="marker"){let p={get interactive(){var u;let c=r.getState(n.id);return(c==null?void 0:c.type)==="marker"?(u=c.options)==null?void 0:u.interactive:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="marker"&&(r.setState(u,{options:{interactive:c}}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},focus:()=>{}};a.add(p,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="marker"&&r.camera.focusOn([c.position])}),a.add(p,"interactive")}else if(n.type==="label"){let p={get interactive(){var u;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(u=c.options)==null?void 0:u.interactive:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&(r.setState(u,{options:{interactive:c}}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get text(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?c.text:""},set text(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:c})},get"Text Color"(){var u,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(f=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:f.foregroundColor:"#000000"},set"Text Color"(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(n.id,{text:p.text,options:{appearance:{text:{foregroundColor:c}}}})},get"Text Size"(){var u,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(f=(u=c.options.appearance)==null?void 0:u.text)==null?void 0:f.size:10},set"Text Size"(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{text:{size:c}}}})},get"Icon Size"(){var u,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(f=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:f.iconSize:10},set"Icon Size"(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{iconSize:c}}}})},get"Active Foreground Color"(){var u,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:f.foregroundColor)==null?void 0:y.active:"#000000"},set"Active Foreground Color"(c){var f,y;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,active:c}}}}})},get"Inactive Foreground Color"(){var u,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:f.foregroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Foreground Color"(c){var f,y;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{foregroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.foregroundColor,inactive:c}}}}})},get"Active Background Color"(){var u,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:f.backgroundColor)==null?void 0:y.active:"#000000"},set"Active Background Color"(c){var f,y;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,active:c}}}}})},get"Inactive Background Color"(){var u,f,y;let c=r.getState(n.id);return(c==null?void 0:c.type)==="label"?(y=(f=(u=c.options.appearance)==null?void 0:u.marker)==null?void 0:f.backgroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Background Color"(c){var f,y;let u=r.getState(n.id);(u==null?void 0:u.type)==="label"&&r.setState(u,{text:p.text,options:{appearance:{marker:{backgroundColor:{...(y=(f=u.options.appearance)==null?void 0:f.marker)==null?void 0:y.backgroundColor,inactive:c}}}}})},focus:()=>{}};a.add(p,"focus").onChange(()=>{let c=r.getState(n.id);(c==null?void 0:c.type)==="label"&&r.camera.focusOn([c.position])}),a.add(p,"interactive"),a.add(p,"text"),a.add(p,"Text Size",10,50),a.add(p,"Icon Size",10,50),a.addColor(p,"Text Color"),a.addColor(p,"Active Background Color"),a.addColor(p,"Inactive Background Color"),a.addColor(p,"Active Foreground Color"),a.addColor(p,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let p={get opacity(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.opacity:1},set opacity(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(n,{opacity:c})},set visible(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.visible:!1},set outline(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(n,{outline:c})},get outline(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.outline:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&(r.setState(n,{interactive:c}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"?c.interactive:!1},get shadingStart(){var u,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(u=c.shading)==null?void 0:u.start)!=null?f:0},set shadingStart(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{start:c}})},get shadingEnd(){var u,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(u=c.shading)==null?void 0:u.end)!=null?f:0},set shadingEnd(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{end:c}})},get shadingIntensity(){var u,f;let c=r.getState(n.id);return(c==null?void 0:c.type)==="geometry-group"&&(f=(u=c.shading)==null?void 0:u.intensity)!=null?f:0},set shadingIntensity(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="geometry-group"&&r.setState(u,{shading:{intensity:c}})}};a.add(p,"visible"),a.add(p,"opacity",0,1,.1),a.add(p,"interactive"),a.add(p,"outline"),a.add(p,"shadingStart",0,1,.1),a.add(p,"shadingEnd",0,1,.1),a.add(p,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let p={set visible(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="group-container"&&r.setState(n,{visible:c})},get visible(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.visible:!1},set interactive(c){let u=r.getState(n.id);(u==null?void 0:u.type)==="group-container"&&(r.setState(u,{interactive:c}),e.controllersRecursive().forEach(f=>f.updateDisplay()))},get interactive(){let c=r.getState(n.id);return(c==null?void 0:c.type)==="group-container"?c.interactive:!1}};a.add(p,"visible"),a.add(p,"interactive")}if(a.close(),n.children)for(let p of n.children.values())i(p,a)},"parseChild")}s($T,"createParseChild");function JT(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)})}s(JT,"createWatermarkChild");var g7="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",KT="https://auth.mappedin.com/oauth2/token";async function v7(r,t){var e,i,n,o,a;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled&&((i=t==null?void 0:t.outdoorView)!=null&&i.headers)){let{Map:p,MercatorCoordinate:c}=await import("./outdoor-context-v4-JXMCUTTH.js"),u=t.outdoorView.headers;u==null&&(u=await D4(KT));let f=t.center||[0,0],y=new p({container:r,style:t.outdoorView.style||g7,center:f,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:Q1,pitch:(o=t.pitch)!=null?o:J1,bearing:(a=t.bearing)!=null?a:K1,transformRequest:Pf(u),trackResize:!1,pixelRatio:Li(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=y.painter.context.gl,C=new fl(r,{center:f,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:g,map:y,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias}),x={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(C.camera.minZoomLevel),y.setMaxZoom(C.camera.maxZoomLevel),C.on("camera-change",T=>{x.center=T.center,x.zoom=T.zoomLevel,x.bearing=-T.bearing,x.pitch=T.pitch,y.jumpTo(x)});let M=c.fromLngLat(f,0),v=Dp(M,C.viewCamera,C.camera,()=>{C.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(v),y.moveLayer(_s),C.renderSync())});let S=!1,E=!1;y.on("idle",()=>{y&&(S||(C.publish("outdoor-view-loaded"),S=!0),E||(C.publish("outdoor-style-loaded"),E=!0))});let w=s(T=>{T&&(T.sourceDataType==="metadata"||T.sourceDataType==="visibility"||T.dataType==="style"||T.type==="terrain")&&C.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",T=>{y&&T&&T.dataType==="style"&&T.type==="styledata"&&(E=!1),w(T)}),y.on("sourcedata",w),y.on("terrain",w),y.on("error",T=>{var D;if(((D=T.error)==null?void 0:D.url)===g7){k.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}k.warn(T)}),C}else return new fl(r,t)}s(v7,"createRenderer");var yl=ar(Cn());var Ou=50,QT=1e3,eI=500,Ar,oa,aa,$e,gl,vl,bl,Vi,ty=class ty extends Z{constructor(e,i){super();this.api=e;this.core=i;P(this,Ar,void 0);P(this,oa,0);P(this,aa,void 0);h(this,"percentExpanded",0);P(this,$e,[]);P(this,gl,0);h(this,"animateToCurrentFloorTween",null);h(this,"expanded",!1);h(this,"handlePreRender",s(()=>{if(l(this,gl)===this.percentExpanded)return;I(this,gl,this.percentExpanded);let e=qt(this.percentExpanded,0,1,0,Ou);l(this,$e).forEach((i,n)=>{this.core.setState(i.containerId,{visible:!0,altitude:e*n})}),this.percentExpanded===0?(l(this,$e).forEach(i=>{this.core.setState(i.containerId,{visible:i.id===this.api.currentFloorId})}),this.core.getSystems().cameraSystem.enablePedestal=!1,this.core.getSystems().cameraSystem.enablePan=!0,this.expanded=!1,this.publish("collapsed"),l(this,Vi)&&l(this,Vi).call(this)):this.percentExpanded===1?(this.expanded=!0,this.publish("expanded"),this.core.getSystems().cameraSystem.enablePedestal=!0,this.core.getSystems().cameraSystem.enablePan=!1,l(this,Vi)&&l(this,Vi).call(this)):(this.expanded=!0,l(this,$e).forEach(i=>{this.core.setState(i.containerId,{visible:!0})}),this.core.getSystems().cameraSystem.enablePedestal=!0,this.core.getSystems().cameraSystem.enablePan=!1)},"handlePreRender"));h(this,"handleUserInteractionStart",s(()=>{this.expanded&&I(this,oa,this.core.camera.elevation),l(this,Ar).on("user-interaction-end",this.handleUserInteractionEnd)},"handleUserInteractionStart"));h(this,"handleUserInteractionEnd",s(()=>{if(this.expanded&&l(this,oa)!==this.core.camera.elevation){let e=[1/0,this.api.currentFloorId];for(let i=0;i<l(this,$e).length;i++){let n=l(this,$e)[i],o=Math.abs(this.core.camera.elevation-i*Ou);o<e[0]&&(e[0]=o,e[1]=n.id)}this.api.currentFloorId=e[1],I(this,oa,0),l(this,Ar).off("user-interaction-end",this.handleUserInteractionEnd),l(this,vl).call(this)}},"handleUserInteractionEnd"));P(this,vl,s(e=>{this.animateToCurrentFloorTween&&this.animateToCurrentFloorTween.stop();let i=l(this,$e).indexOf(this.api.currentFloor)*Ou;this.animateToCurrentFloorTween=new yl.default.Tween({elevation:this.core.camera.elevation}).to({elevation:i},eI).easing(yl.default.Easing.Quadratic.Out).onUpdate(({elevation:n})=>{this.core.camera.setElevation(n)}).onComplete(()=>{this.api.publish("floor-change",{reason:"",floorId:this.api.currentFloorId}),this.animateToCurrentFloorTween=null,e&&e()}).start(),this.core.render()},"#animateToCurrentFloorSync"));P(this,bl,null);P(this,Vi,void 0);I(this,Ar,i),l(this,Ar).on("user-interaction-start",this.handleUserInteractionStart),l(this,Ar).on("pre-render",this.handlePreRender)}animateToCurrentFloor(){return new Promise(l(this,vl))}expand(e){return I(this,$e,this.api.floors.filter(i=>!(e!=null&&e.excludeFloorIds.includes(i.id)))),l(this,$e).length<=1?Promise.resolve():this.animate("expand")}collapse(){return this.expanded===!0?this.animate("collapse"):Promise.resolve()}showStack(e={}){var u;let i=(u=e.numFloors)!=null?u:3,n=l(this,$e).indexOf(this.api.currentFloor),o=Math.floor((i-1)/2),a=Math.ceil((i-1)/2);n===0?(o=i-1,a=0):n===l(this,$e).length-1&&(o=0,a=i-1);let p=[];for(let f=Math.max(0,n-a);f<=Math.min(l(this,$e).length-1,n+o);f++)p.push(l(this,$e)[f].id);let c=p.flatMap(f=>l(this,Ar).getBoundingArea(f)).filter(f=>f!=null);return l(this,Ar).camera.focusOn(c,e.cameraOptions)}animate(e,i){var a;l(this,aa)&&l(this,aa).stop();let n=l(this,$e).indexOf(this.api.currentFloor)*Ou,o=this.core.camera.elevation;return I(this,bl,new Promise(p=>{I(this,Vi,p)})),I(this,aa,new yl.default.Tween({percentExpanded:this.percentExpanded}).to({percentExpanded:e==="expand"?1:0},(a=i==null?void 0:i.duration)!=null?a:QT).easing(yl.default.Easing.Quadratic.Out).onUpdate(({percentExpanded:p})=>{this.percentExpanded=p,this.core.camera.setElevation(e==="expand"?n*p:o*p)}).start()),this.core.render(),l(this,bl)}};Ar=new WeakMap,oa=new WeakMap,aa=new WeakMap,$e=new WeakMap,gl=new WeakMap,vl=new WeakMap,bl=new WeakMap,Vi=new WeakMap,s(ty,"StackedMaps");var _u=ty;var tI={linear:Gn.default.Easing.Linear.None,"ease-in":Gn.default.Easing.Quadratic.In,"ease-out":Gn.default.Easing.Quadratic.Out,"ease-in-out":Gn.default.Easing.Quadratic.InOut},ry=class ry extends Z{constructor(e,i,n,o={},a){super();h(this,"floors");h(this,"currentFloorId","");h(this,"id");h(this,"renderer");h(this,"mvf");h(this,"styleMap");h(this,"StackedMaps");h(this,"animations",new Map);h(this,"Models",{add:(e,i,n)=>{let{floorId:o,...a}=n,p=o?this.floors.find(u=>u.id===o):this.floors[0],c=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(u=>{var f;return{type:"Feature",properties:{id:q(),rotation:(f=u.rotation)==null?void 0:f.map(y=>y*(Math.PI/180)),scale:u.scale,interactive:u.interactive},geometry:{type:"Point",coordinates:Mr(u.target)}}})},{url:a.url},p.id);if(c==null)throw new Error("error creating model");return this.renderer.getState(c).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});h(this,"Images",{add:(e,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...p}=n,c=o?this.floors.find(f=>f.id===o):this.floors[0],u={type:"Feature",properties:p,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(q(),u,{url:i,flipImageToFaceCamera:a!=null?a:!1},c.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});h(this,"Markers",{add:(e,i,n)=>this.renderer.addMarker2D(Mr(e),i,n,e.floorId),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,n)=>{let o=this.renderer.getState(e);if(!o){k.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(o.type!=="marker"){k.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:n!=null?n:this.currentFloorId})},animateTo:(e,i,n,o)=>{let a=this.renderer.getState(e);if(!a)return k.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(a.type!=="marker")return k.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let p={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(e);let c=new Gn.default.Tween({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},p.duration).easing(tI[p.easing]).onUpdate(({lon:u,lat:f})=>{this.Markers.setPosition(e,[u,f],n),this.renderer.render()}).start();return this.animations.set(e,c),Km(c).then(()=>{this.animations.delete(e)})}});h(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});h(this,"Shapes",{add:(e,i,n)=>{let o=n!=null&&n.floorId?this.floors.find(p=>p.id===(n==null?void 0:n.floorId)):this.floors[0],a=q();return this.renderer.addGeometryGroup(a,e,i,o.id),a},remove:e=>(this.renderer.remove(e.id),e.id)});h(this,"Labels",{all:({onCreate:e})=>{for(let i of Object.entries(this.mvf.space)){let[n,o]=i;o&&o.features.forEach(a=>{var f,y;let p=(f=this.styleMap[a.properties.id])==null?void 0:f.showImage,c=(y=a.properties.details)==null?void 0:y.images,u={};if(p&&c&&c.length>0&&(u={marker:{icon:c[0].url}}),a.properties.center&&a.properties.externalId!==""){let g=this.renderer.addLabel2D(a.properties.center,a.properties.externalId,{id:a.properties.id+"-label",appearance:u},n);g&&e(g.id,a.properties.externalId)}})}},add:(e,i,n={})=>{let{floorId:o,...a}=n,p=o?this.floors.find(u=>u.id===o):this.floors[0],c=this.renderer.addLabel2D(e,i,a,p.containerId);if(!c)throw new Error("label creating failed");return c},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});h(this,"Paths",{add:(e,i)=>{let n=[],o=e[0].floorId||"root",a=0;for(let u of e){let{floorId:f="root",latitude:y,longitude:g}=u;f!==o&&(a++,o=f),n[a]==null&&n.push({floorId:f,coordinates:[]}),n[a].coordinates.push([g,y])}let p=n.reduce((u,{floorId:f,coordinates:y},g)=>{if(g!==0){let x=n[g-1],M=y[0],v=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:x.floorId},geometry:{type:"Point",coordinates:x.coordinates[x.coordinates.length-1]}},{type:"Feature",properties:{parentId:f},geometry:{type:"Point",coordinates:M}}]},i,this.id);u.push(v)}let C=this.renderer.addPath({type:"FeatureCollection",features:y.map(x=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:x}}))},i,f);return u.push(C),u},[]),c=new Gn.default.Tween({fraction:0}).to({fraction:1},(i==null?void 0:i.drawDuration)||1e3).onUpdate(({fraction:u})=>{p.forEach(f=>{this.renderer.setState(f.id,{completeFraction:u})})}).start();return this.animations.set(p[0].id.toString(),c),{paths:p,animation:Km(c).then(()=>{this.animations.delete(p[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});this.renderer=a,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.StackedMaps=new _u(this,this.renderer),this.mvf=i,this.styleMap=n,this.floors=this.mvf["map.geojson"].sort((p,c)=>p.elevation-c.elevation).map(p=>{var u,f;if(e!=="outdoors-container"&&((u=i.space[p.id])==null?void 0:u.features.length)===0&&((f=i.obstruction[p.id])==null?void 0:f.features.length)===0)return;let c=new vp(e,p,this.renderer,o,i,n);return c.load(),c}).filter(Boolean),this.setFloor(o.initialFloor?B3(o.initialFloor):this.floors[0].id)}get currentFloor(){return this.floors.find(e=>e.id===this.currentFloorId)}setFloor(e,i){if(this.currentFloorId!==e){if(this.publish("floor-change-start",{floorId:e}),this.currentFloorId=e,this.StackedMaps.expanded)return this.StackedMaps.animateToCurrentFloor();this.floors.forEach(n=>{n.id===e?this.renderer.setState(n.containerId,{visible:!0}):this.renderer.setState(n.containerId,{visible:!1})}),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e))}};s(ry,"GeojsonApiMapObject");var Cl=ry;m();var rr,xl,iy=class iy{constructor({currentMapGetter:t}){P(this,rr,new Map);P(this,xl,void 0);I(this,xl,t)}get currentMap(){return l(this,xl).call(this)}getById(t){return l(this,rr).get(t)}add(t,e,i){let n=Et(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Markers.add(n,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(a==null)throw new Error("error creating marker");let p=o.Markers.getContentEl(a.id.toString());if(!p)throw new Error("marker component should exist");let c=new mn(a.id.toString(),p);return l(this,rr).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(t){var i;let e=l(this,rr).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),l(this,rr).delete(t.id.toString()))}removeAll(){let t=[];return l(this,rr).forEach(({marker:e})=>{this.remove(e),t.push(e),l(this,rr).delete(e.id.toString())}),t}setPosition(t,e){var a;let i=Et(e);if(!i){k.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){k.error("Cannot determine the current map.");return}let o=l(this,rr).get(t.id);if(!o){k.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}n.Markers.setPosition(o.entityId,Mr(i),(a=i.floorId)!=null?a:n.currentFloorId)}animateTo(t,e,i){var p;let n=Et(e);if(!n)return k.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return k.error("Cannot determine the current map."),Promise.resolve();let a=l(this,rr).get(t.id);return a?o.Markers.animateTo(a.entityId,Mr(n),(p=n.floorId)!=null?p:o.currentFloorId,i):(k.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};rr=new WeakMap,xl=new WeakMap,s(iy,"Markers");var Sl=iy;m();var ni,Pl,ny=class ny{constructor({currentMapGetter:t}){P(this,ni,new Map);P(this,Pl,void 0);I(this,Pl,t)}get currentMap(){return l(this,Pl).call(this)}getById(t){return l(this,ni).get(t)}add(t,e,i){let n=Et(t);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Images.add(Mr(n),e,{...i,floorId:n.floorId});if(!a)throw new Error("image component should exist");let p=new ps(a.id.toString(),e);return l(this,ni).set(p.id,{image:p,entityId:a.id.toString()}),p}remove(t){var i;let e=l(this,ni).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),l(this,ni).delete(t.id.toString()))}removeAll(){let t=[];return l(this,ni).forEach(({image:e})=>{this.remove(e),t.push(e),l(this,ni).delete(e.id.toString())}),t}};ni=new WeakMap,Pl=new WeakMap,s(ny,"Images");var Ml=ny;m();var kr,Il,oy=class oy{constructor({currentMapGetter:t}){P(this,kr,new Map);P(this,Il,void 0);I(this,Il,t)}get currentMap(){return l(this,Il).call(this)}getById(t){return l(this,kr).get(t)}add(t,e){let i=Array.isArray(t)?t:[t],n=i.reduce((p,c)=>{var f;let u=Et(c.target);return u?(p.has(u.floorId)||p.set(u.floorId,[]),(f=p.get(u.floorId))==null||f.push({...c,target:u}),p):(k.error("Cannot determine coordinate from options."),p)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=[];return n.forEach((p,c)=>{let u=q();o.Models.add(u,p,{...e,floorId:c}).forEach(({id:y})=>{let g=new ds(y.toString(),u);l(this,kr).set(g.id,{model:g,entityId:y.toString(),groupId:u}),a.push(g)})}),a}remove(t){var i;let e=l(this,kr).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),l(this,kr).delete(t.id.toString()))}removeAll(){let t=[];return l(this,kr).forEach(({model:e})=>{var n;let i=l(this,kr).get(e.id);i&&(t.push(e),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),l(this,kr).delete(e.id.toString()))}),t}};kr=new WeakMap,Il=new WeakMap,s(oy,"Models");var Tl=oy;m();var Hi,El,ay=class ay{constructor({currentMapGetter:t}){P(this,Hi,new Map);P(this,El,void 0);I(this,El,t)}get currentMap(){return l(this,El).call(this)}getById(t){return l(this,Hi).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let n=i.Paths.add(t,e),o=new ms(q(),n.animation);return l(this,Hi).set(o.id,{path:o,entityIds:n.paths.map(a=>a.id.toString())}),o}remove(t){var i;let e=l(this,Hi).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),l(this,Hi).delete(t.id))}removeAll(){let t=[];return l(this,Hi).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Hi=new WeakMap,El=new WeakMap,s(ay,"Paths");var wl=ay;m();var Au=ar(Cn());m();var sy="#2266ff",b7="#f5f5f5";var C7={radius:10,color:sy,bearing:{color:sy,opacity:.7},accuracyRing:{color:sy,opacity:.3}};var I7=ar(xy());m();var S7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var x7=s((r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=e/Math.tan(r/2),n=e/Math.sin(r/2),o=n+t,a=10,p=new cr;p.moveTo(n*Math.cos(r/2)-i,n*Math.sin(r/2));for(let c=0;c<a;c++)p.lineTo(o*Math.cos(r/2-r/a*c)-i,o*Math.sin(r/2-r/a*c));for(let c=0;c<a;c++)p.lineTo(e*Math.cos(Math.PI/-2+Math.PI/a*c),e*Math.sin(Math.PI/-2+Math.PI/a*c));return new pr(p,{depth:.1,bevelEnabled:!1,UVGenerator:iI(t)})},"createSectorGeometry"),ly=s((r,t,e)=>{let n=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return n>1?n=1:n<0&&(n=0),new z(0,n)},"generateRadialUV"),iI=s(r=>({generateTopUV:(t,e,i,n,o)=>{let a=e[i*3],p=e[i*3+1],c=e[n*3],u=e[n*3+1],f=e[o*3],y=e[o*3+1];return[ly(a,p,r),ly(c,u,r),ly(f,y,r)]},generateSideWallUV:()=>[new z(0,1),new z(0,1),new z(0,1),new z(0,1)]}),"radialUVGenerator");function M7(r,t){let e=new ur({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=x7(Math.PI/6,n,i);new Zn().load(S7,p=>{e.alphaMap=p,e.needsUpdate=!0});let a=new Me(o,e);return a.position.z=-.05,a.renderOrder=0,a}s(M7,"createBearingCone");function P7(r,t){let e=new jl(1,1,.05,32),i=new ur({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),n=new Me(e,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}s(P7,"createAccuracyRing");function T7(r){let t=new jl(.35,.35,.07,32),e=new ur({transparent:!0,color:b7,depthTest:!1,depthWrite:!1}),i=new Me(t,e);i.renderOrder=2;let n=new jl(.35*.8,.35*.8,.01,32),o=new ur({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new Me(n,o);return a.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:i,innerMesh:a}}s(T7,"createBlueDot");var nr,vt,Dl,cy=class cy extends Z{constructor(e,i){super();this.core=e;this.geoJSONApi=i;h(this,"watcherId",null);h(this,"geometry");h(this,"currentGeolocation");h(this,"positionAnimation");h(this,"scaleAnimation");h(this,"rotationAnimation");P(this,nr,C7);P(this,vt,1);P(this,Dl,void 0);h(this,"updateGeometryPerFrame",s(e=>{var u;let[i,n,o,a]=e.children,{accuracy:p,heading:c}=((u=this.currentGeolocation)==null?void 0:u.coords)||{};this.updateScale(),n.scale.set(l(this,vt),l(this,vt),l(this,vt)),n.position.z=.07/2*l(this,vt),o.scale.set(l(this,vt),l(this,vt),l(this,vt)),o.position.z=.07*l(this,vt),p!=null&&(this.scaleAnimation&&this.scaleAnimation.stop(),this.scaleAnimation=new Au.default.Tween({scale:i.scale.x}).to({scale:p/2},150).onUpdate(({scale:f})=>{i.scale.set(f,1,f)}).start()),c!=null?(a.visible=!0,this.rotationAnimation&&this.rotationAnimation.stop(),this.rotationAnimation=new Au.default.Tween({rotation:a.rotation.z}).to({rotation:le.degToRad(c)},150).onUpdate(({rotation:f})=>{a.rotation.z=f}).start(),a.scale.set(l(this,vt),l(this,vt),1)):a.visible=!1},"updateGeometryPerFrame"));h(this,"onPositionUpdate",s(e=>{var i,n;if(this.currentGeolocation=e,(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:e.coords.latitude,longitude:e.coords.longitude,floorLevel:e.coords.floorLevel,accuracy:e.coords.accuracy}}),this.geometry){let o=this.core.getState(this.geometry);o.visible===!1&&this.core.setState(this.geometry,{position:[e.coords.longitude,e.coords.latitude],visible:!0}),this.positionAnimation&&this.positionAnimation.stop(),o=this.core.getState(this.geometry);let a;if(e.coords.floorLevel!==void 0){let p=(n=this.geoJSONApi.currentMap)==null?void 0:n.floors[e.coords.floorLevel];a=p==null?void 0:p.id}this.positionAnimation=new Au.default.Tween(o.position).to([e.coords.longitude,e.coords.latitude],500).onUpdate(p=>{if(this.geometry){let c={position:p};if(a==null&&o.parent!=="outdoors-container")c.parent="outdoors-container";else if(a!=null&&o.parent!==a){let u=a!=null?a:"outdoors-container";c.parent=u,this.publish("floor-change",{reason:"blue-dot-floor-change",floorId:u})}this.core.setState(this.geometry,c)}}).start(),this.core.render()}},"onPositionUpdate"));h(this,"onPositionError",s(e=>{var i;switch(e.code){case e.PERMISSION_DENIED:k.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:k.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:k.error("Geolocation request timed out.",e);break;default:k.error("An unknown geolocation error occurred.",e);break}this.disable()},"onPositionError"));h(this,"updateScale",s(()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==l(this,Dl)){I(this,Dl,e);let n=(i=this.core.getMetresPerPixel())!=null?i:1;I(this,vt,Math.max(l(this,nr).radius/(.35/n),1))}},"updateScale"))}enable(e){I(this,nr,(0,I7.default)({},e,l(this,nr))),this.watcherId&&navigator.geolocation.clearWatch(this.watcherId),this.geometry=this.core.addCustomGeometry("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[-79.3935,43.6532]}},{setup:i=>{let n=P7(l(this,nr).accuracyRing.color,l(this,nr).accuracyRing.opacity),{outerMesh:o,innerMesh:a}=T7(l(this,nr).color),p=M7(l(this,nr).bearing.color,l(this,nr).bearing.opacity);i.add(n),i.add(o),i.add(a),i.add(p),this.updateScale()},update:this.updateGeometryPerFrame},{visible:!1},"outdoors-container"),this.watcherId=navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0})}disable(){this.watcherId&&navigator.geolocation.clearWatch(this.watcherId),this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),this.currentGeolocation=void 0}};nr=new WeakMap,vt=new WeakMap,Dl=new WeakMap,s(cy,"BlueDot");var ku=cy;m();var oi,Ol,py=class py{constructor({currentMapGetter:t}){P(this,oi,new Map);P(this,Ol,void 0);I(this,Ol,t)}get currentMap(){return l(this,Ol).call(this)}getById(t){return l(this,oi).get(t)}add(t,e,i){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Shapes.add(t,e||{},{floorId:i==null?void 0:i.id}),a=new ys(o);return l(this,oi).set(a.id,a),a}remove(t){var i;l(this,oi).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),l(this,oi).delete(t.id.toString()))}removeAll(){let t=[];return l(this,oi).forEach(e=>{this.remove(e),t.push(e.id),l(this,oi).delete(e.id.toString())}),t}};oi=new WeakMap,Ol=new WeakMap,s(py,"Shapes");var Ll=py;m();var Al,uy=class uy{constructor({currentMapGetter:t}){P(this,Al,void 0);I(this,Al,t)}get currentMap(){return l(this,Al).call(this)}setFromStyleCollection(t){var e,i,n;for(let o in t)for(let a of((e=this.currentMap)==null?void 0:e.floors)||[])if(t[o]!=null){if(a.layers.has(o)&&"color"in t[o]){let p=a.layers.get(o);(i=this.currentMap)==null||i.renderer.setState(p,{color:t[o].color})}if(o===Ci&&!(vr in t)){let p=a.layers.get(vr);p&&"color"in t[o]&&((n=this.currentMap)==null||n.renderer.setState(p,{color:t[o].color}))}}}};Al=new WeakMap,s(uy,"Style");var _l=uy;m();var or,kl,ai,hy=class hy{constructor(t,e){P(this,or,void 0);P(this,kl,void 0);P(this,ai,new Set([]));I(this,or,t),I(this,kl,e||[])}setStyle(t){var e;if(l(this,or).map){(e=l(this,or).map)==null||e.setStyle(t,{diff:!1}),l(this,ai).size&&(l(this,ai).clear(),this.hide());for(let[i,n]of l(this,kl)||[])l(this,or).hideOutdoorLayersUnderPoint(i,n)}}get map(){return l(this,or).map}get enabled(){return!!l(this,or).map}get visible(){return!!l(this,ai).size}show(){let t=l(this,or).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{l(this,ai).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),l(this,ai).clear())}hide(t=[]){let e=l(this,or).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(n=>{let o=e.getLayoutProperty(n.id,"visibility");!t.includes(n.id)&&o!=="none"&&(e.setLayoutProperty(n.id,"visibility","none"),l(this,ai).add(n.id))})}};or=new WeakMap,kl=new WeakMap,ai=new WeakMap,s(hy,"Outdoor");var la=hy;var Bu=.05,dy=class dy{constructor(t,e){h(this,"core");h(this,"outdoors");h(this,"mapObjects",[]);h(this,"id");h(this,"mapDataExternal",{});h(this,"mapsByFloorId",{});h(this,"mapData");h(this,"currentMap");h(this,"directions");h(this,"hiddenOutdoorGeometries",[]);h(this,"mapView");h(this,"Camera");h(this,"Labels");h(this,"Markers");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"Outdoor");h(this,"BlueDot");h(this,"Shapes");h(this,"Style");h(this,"Images");h(this,"update",s(()=>{this.core.render()},"update"));h(this,"getDirections",s((t,e,i)=>{var C;if(!this.directions)throw new Error("You have to call .addMap() before you can get directions");let n=this.getMapDataInternal();if(!n)throw new Error("getDirections failed due to missing mapData");let{accessible:o=!1,smoothing:a=!0}=i||{},p=Array.isArray(t)?t:[t],c=Array.isArray(e)?e:[e];(C=this.getMapDataInternal())==null||C.Analytics.sendGetDirectionsEvent(p[0].id,c[0].id);let u=typeof a=="object"?a.enabled:a,f=typeof a=="object"?a.radius:void 0,y=(i==null?void 0:i.zones)||[],g={accessible:o,zones:y,smoothing:{enabled:u!=null?u:!0,radius:f!=null?f:.75}};return this.directions.getDirections(p,c,g,n)},"getDirections"));this.core=t,this.mapView=e,this.Camera=new Ss(this.core),this.id=this.core.addGroupContainer("root").id.toString(),this.outdoors=new Cl("outdoors-container",{"map.geojson":[{id:"outdoors",externalId:"outdoors",elevation:0}],"styles.json":{},space:{},entrance:{},obstruction:{}},{},{},this.core),this.mapObjects.push(this.outdoors);let i=new fs(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",i)});let n=s(p=>c=>{var v,S,E;let u=[],f=[],y=[];c.labels.forEach(w=>{let T=this.Labels.getById(w.toString());T&&u.push(T.label)}),c.markers.forEach(w=>{let T=this.Markers.getById(w.toString());T&&f.push(T.marker)}),c.models.forEach(w=>{let T=this.Models.getById(w.toString());T&&y.push(T.model)});let g=c.geometry[0],C;g&&(C=(v=this.getMapDataInternal())==null?void 0:v.getById("space",g)),C||(C=(S=this.getMapDataInternal())==null?void 0:S.getById("object",g));let x=c.containers.reduce((w,T)=>{var _;let D=(_=this.getMapDataInternal())==null?void 0:_.getById("floor",T);return D&&gr.is(D)&&w.push(D),w},[]),M={coordinate:new ne(c.coordinate[1],c.coordinate[0],(E=x==null?void 0:x[0])==null?void 0:E.id),spaces:C&&ht.is(C)?[C]:[],objects:C&&dt.is(C)?[C]:[],markers:f,labels:u,models:y,floors:x};"pointerEvent"in c&&(M.pointerEvent=c.pointerEvent),this.mapView.publish(p,M)},"createHandler");this.core.on("hover",n("hover")),this.core.on("click",n("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let o={currentMapGetter:()=>this.currentMap};this.Markers=new Sl(o),this.Models=new Tl(o),this.Labels=new Is(o),this.Exporter=new Ts(o),this.Paths=new wl(o),this.Navigation=new Kc(this.core,o.currentMapGetter),this.BlueDot=new ku(this.core,this),this.BlueDot.on("floor-change",p=>{this.setFloor(p.floorId,"blue-dot-floor-change")}),this.Outdoor=new la(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 Ml(o),this.Shapes=new Ll(o),this.Style=new _l(o);let a=new np(e,this.mapDataExternal);this.auto=a.auto}updateState(t,e){var n,o,a,p;if(t==="interior-walls"){(n=this.currentMap)==null||n.floors.forEach(c=>{let u=c.layers.get(Ci);u&&this.core.setState(u,$m(e,this.core.getState(u)))});return}else if(t==="exterior-walls"){(o=this.currentMap)==null||o.floors.forEach(c=>{let u=c.layers.get(vr);u&&this.core.setState(u,$m(e,this.core.getState(u)))});return}else if(t==="interior-doors"){(a=this.currentMap)==null||a.floors.forEach(c=>{let u=c.layers.get(ho);u&&this.core.setState(u,qm(e,this.core.getState(u)))});return}else if(t==="exterior-doors"){(p=this.currentMap)==null||p.floors.forEach(c=>{let u=c.layers.get(mo);u&&this.core.setState(u,qm(e,this.core.getState(u)))});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(Ti.is(i))return this.core.setState(i.id,p4({...e,type:"label"},this.core.getState(i.id)));if(mn.is(i))return this.core.setState(i.id,u4({...e,type:"marker"},this.core.getState(i.id)));(ht.is(i)||dt.is(i)||Xt.is(i))&&this.core.setState(i.id,h4({...e,type:"geometry"},this.core.getState(i.id)))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return xa(this.mapData)}getMapData(){return this.mapData}expand(t){var e;return(e=this.currentMap)==null?void 0:e.StackedMaps.expand({excludeFloorIds:(t==null?void 0:t.excludeFloors.map(i=>i.id))||[]})}collapse(){var t;return(t=this.currentMap)==null?void 0:t.StackedMaps.collapse()}showStack(t){var e;return(e=this.currentMap)==null?void 0:e.StackedMaps.showStack(t)}addMap(t,e){return new Promise(i=>{var g,C,x;let n;try{n=xa(t)}catch(M){k.error("Error adding map",M),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ne(a[1],a[0])});let p=f4(o["styles.json"]||{}),c=o["manifest.geojson"].features[0].properties.name,u=new Cl("mapObject-".concat(c),o,p,e,this.core),f=this.core.getBoundingArea(u.currentFloor.id),y=(C=(g=e==null?void 0:e.outdoorView)==null?void 0:g.layersHiddenByGeometry)!=null?C:[];if(y.length>0){let M=(x=this.core.getCenter(f))!=null?x:a;this.core.hideOutdoorLayersUnderPoint(M,y),this.hiddenOutdoorGeometries.push([M,y])}this.mapObjects.push(u),o["map.geojson"].forEach(M=>{this.mapsByFloorId[M.id]=u}),u.StackedMaps.on("expanded",()=>{this.mapView.publish("expanded")}),u.StackedMaps.on("collapsed",()=>{this.mapView.publish("collapsed")}),u.on("floor-change-start",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),u.on("floor-change",M=>{this.mapView.publish("floor-change",{reason:M.reason,floor:this.currentFloor})}),this.currentMap=u,this.mapData=t,this.directions=new fp({nodes:this.currentMap.mvf["node.geojson"],geojsonCollection:this.currentMap.mvf.enterprise?this.currentMap.mvf.space:this.currentMap.mvf.obstruction,connections:this.currentMap.mvf["connection.json"],groupBy:"map"}),(e==null?void 0:e.zoomLevel)!=null?(this.core.camera.setZoomLevel(e.zoomLevel),i(t)):this.core.mode!=="outdoors-overlay"?this.core.camera.focusOn(this.core.getBoundingArea(u.currentFloor.id),{duration:R3,padding:{top:Bu*this.core.canvasHeight,left:Bu*this.core.canvasWidth,right:Bu*this.core.canvasWidth,bottom:Bu*this.core.canvasHeight}}).then(()=>{i(t)}):i(t)})}setFloor(t,e){if(!this.currentMap)throw new Error("mappObject should exist atm");return this.currentMap.setFloor(typeof t=="string"?t:t.id,e)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloor(){var i,n;let t=(i=this.currentMap)==null?void 0:i.currentFloor.id;if(!t)throw new Error("Missing currentFloor object from GeoJsonApi");let e=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!e)throw new Error("Missing currentFloor");return e}getState(t){var n;let e=y4(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:o,topColor:a,texture:p,topTexture:c,visible:u}=i;return{type:"walls",visible:u,color:o,topColor:a,texture:p?{url:p}:void 0,topTexture:c?{url:c}:void 0}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:o,topColor:a,texture:p,topTexture:c,visible:u,opacity:f}=i;return{type:"doors",visible:u,color:o,topColor:a,opacity:f,texture:p?{url:p}:void 0,topTexture:c?{url:c}: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};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"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let o=typeof i.parent=="object"?i.parent.id:i.parent;return{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,coordinate:new ne(i.position[1],i.position[0],o.toString())}}else{if(i.type==="model")return{type:"model"};if(i.type==="image")return{type:"image"}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinate(t,e,i){return new ne(t,e,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(t,e,i){let n=this.core.projectScreenXYToCoordinate(t,e);return n?new ne(n[1],n[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){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()}};s(dy,"GeoJsonApi");var Bl=dy;var Rl,K,Vn,my=class my extends Z{constructor(e){super();P(this,Rl,{});P(this,K,void 0);P(this,Vn,void 0);h(this,"Camera");h(this,"Labels");h(this,"Markers");h(this,"Images");h(this,"Models");h(this,"Paths");h(this,"Exporter");h(this,"Navigation");h(this,"BlueDot");h(this,"Style");h(this,"Shapes");h(this,"Outdoor");h(this,"update",s(()=>{l(this,K).core.render()},"update"));h(this,"getDirections",s((e,i,n)=>l(this,K).getDirections(e,i,n),"getDirections"));h(this,"on",s((e,i)=>{super.on(e,i)},"on"));h(this,"off",s((e,i)=>{super.off(e,i)},"off"));I(this,Vn,e);let i=new Bl(e,this);I(this,K,i),this.Camera=l(this,K).Camera,I(this,Rl,l(this,K).mapDataExternal),this.Markers=l(this,K).Markers,this.Models=l(this,K).Models,this.Labels=l(this,K).Labels,this.Exporter=l(this,K).Exporter,this.Paths=l(this,K).Paths,this.Navigation=l(this,K).Navigation,this.BlueDot=l(this,K).BlueDot,this.Shapes=l(this,K).Shapes,this.Style=l(this,K).Style,this.auto=l(this,K).auto,this.Outdoor=l(this,K).Outdoor,this.Images=l(this,K).Images,l(this,Vn).container.dataset.version=b.env.npm_package_version}updateState(e,i){return l(this,K).updateState(e,i)}getMapData(){return l(this,Rl)}getDimensions(){return{width:l(this,Vn).canvasWidth,height:l(this,Vn).canvasHeight}}expand(e){return l(this,K).expand(e)}showStack(e){return l(this,K).showStack(e)}collapse(){return l(this,K).collapse()}addMap(e,i){return l(this,K).addMap(e,i)}setFloor(e){return l(this,K).setFloor(e)}get currentFloor(){return l(this,K).currentFloor}updateWatermark(e){l(this,K).updateWatermark(e)}getState(e){return l(this,K).getState(e)}setHoverColor(e){l(this,K).setHoverColor(e)}getHoverColor(){return l(this,K).getHoverColor()}isInView(e){return l(this,K).isInView(e)}createCoordinate(e,i,n){return l(this,K).createCoordinate(e,i,n)}createCoordinateFromScreenCoordinate(e,i,n){return l(this,K).createCoordinateFromScreenCoordinate(e,i,n)}auto(){this.Labels.all()}get __core(){if(b.env.INTERNAL==="true")return l(this,K).core;throw new Error("__core is not available.")}clear(){l(this,K).clear()}destroy(){l(this,K).destroy()}async enableDebug(){let{Inspector:e}=await import("./inspector-TGJ6IITM.js");await new e(this,l(this,K)).enable()}};Rl=new WeakMap,K=new WeakMap,Vn=new WeakMap,s(my,"MapView");var ca=my;m();m();var fy=class fy extends Z{constructor(e){super();h(this,"gl");h(this,"el",document.createElement("div"));h(this,"core");h(this,"origin");h(this,"map");h(this,"layer");h(this,"handleStyleChange",s(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));h(this,"handleMove",s(()=>{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(le.degToRad(-this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(le.degToRad(this.map.getPitch()))},"handleMove"));h(this,"handleError",s(e=>{k.warn(e)},"handleError"));this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new fl(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=Wl.fromLngLat(this.origin,0);return this.layer=Dp(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}};s(fy,"MapLibreOverlay");var Ru=fy;var Hn,pa,Xi,Fl=class Fl extends Ru{constructor(e,i,n){super(e);P(this,Hn,void 0);P(this,pa,void 0);P(this,Xi,void 0);I(this,Hn,i),I(this,pa,n)}onAdd(e){var n,o;super.onAdd(e);let i={...Za,...(n=l(this,pa))!=null?n:{},outdoorView:{token:l(this,Hn).outdoorViewToken,...(o=l(this,pa))==null?void 0:o.outdoorView}};return I(this,Xi,new ca(this.core)),l(this,Xi).addMap(l(this,Hn),i).then(()=>{this.publish("loaded",{mapView:l(this,Xi),mapData:l(this,Hn)})}),this.el}onRemove(){l(this,Xi)&&l(this,Xi).clear(),Fl.instance=null,super.onRemove()}};Hn=new WeakMap,pa=new WeakMap,Xi=new WeakMap,s(Fl,"MappedinMapLibreOverlay"),h(Fl,"instance");var ua=Fl;var sI=s(async(r,t)=>{let e;try{t&&(e=(await Zl(t)).accessToken)}catch(o){k.warn("Getting access token failed. Outdoor map disabled.",o)}let i=new ss(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks});return new Ju(i)},"hydrateMapDataFromMVF"),w7=!1;function lI(r){w7=r}s(lI,"setUseEnterpriseAPI");var E7=s(async r=>{var C;let t=w7,e,i={...r};if("accessToken"in i){e=i.accessToken;let{aud:x,sub:M}=Ul(e);(F3.some(v=>x.includes(v))||M&&M.startsWith("client"))&&(t=!0)}else if("key"in i&&"secret"in i)i.key.startsWith("mik_")||(t=!0),e=(await Zl(i,t)).accessToken;else throw new Error("Missing key or secret.");let n=performance.now(),o,a;if(t){let x={...i,venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0"},M=await eh(x);o=M.compressed,a=M.localePacks}else o=await th(i,e);let p=performance.now(),c=await ql(o),u=zl(c),f=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(u);let y=new ss(u,{outdoorViewToken:e,enterprise:t,localePacksUrls:a}),g=new Ju(y,{search:r.search});return y.Analytics.init({accessToken:e,mapId:i.mapId,key:"key"in i?i.key:void 0,secret:"secret"in i?i.secret:void 0,...i.analytics,context:(C=i.analytics)==null?void 0:C.context}),y.Analytics.sendGetMapDataEvent({parseDuration:f-p,downloadDuration:p-n,viewId:i.viewId}),y.on("language-change",x=>{g.publish("language-change",x)}),g},"getMapData"),cI=E7,pI=s((r,t)=>{ua.instance!=null&&k.warn("Only a single map venue is supported at this time.");let e=new ua([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return ua.instance=e,e},"createMapLibreOverlay"),D7=s(async(r,t,e)=>{var c,u,f,y,g,C,x,M;let i=performance.now(),n=im(e,t);try{e&&rm(e)}catch(v){if(v instanceof Error&&v.name==="MissingOutdoorViewToken")k.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw v}let o=N3((c=t.outdoorViewToken)!=null?c:""),a=await v7(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(u=n.style)==null?void 0:u.backgroundAlpha,backgroundColor:(f=n.style)==null?void 0:f.backgroundColor,outdoorView:(y=n.outdoorView)!=null&&y.token?{headers:{"x-mappedin-tiles-key":(g=n.outdoorView)==null?void 0:g.token},style:(C=n.outdoorView)==null?void 0:C.style,enabled:!!((x=n.outdoorView)!=null&&x.enabled)}:void 0,watermark:{...n.watermark,visible:!o.remove_watermark},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((M=n.antialiasing)!=null&&M.enabled),accessToken:t.outdoorViewToken}),p=new ca(a);return await p.addMap(t,n),xa(t).Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:p.getDimensions()}),p},"show3dMapGeojson"),uI=D7;export{k as a,Z as b,ne as c,ht as d,hn as e,ns as f,qT as g,E7 as h,uI as i,hI as j};